<?php $__env->startSection('title', __('Nuevo recinto')); ?>

<?php $__env->startSection('content'); ?>
    <div class="d-sm-flex align-items-start justify-content-between rt-flex-gap-3 mb-4">
        <div>
            <nav aria-label="breadcrumb" class="mb-1">
                <ol class="breadcrumb bg-transparent p-0 mb-0" style="font-size:.82rem">
                    <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard.venues.index')); ?>"><?php echo e(__('Recintos')); ?></a></li>
                    <li class="breadcrumb-item active"><?php echo e(__('Nuevo')); ?></li>
                </ol>
            </nav>
            <h1 class="h3 mb-0 text-gray-800 font-weight-bold"><?php echo e(__('Nuevo recinto')); ?></h1>
            <p class="small text-muted mb-0"><?php echo e(__('Alta completa con dirección y mapa.')); ?></p>
        </div>
        <a href="<?php echo e(route('dashboard.venues.index')); ?>" class="btn btn-sm btn-outline-secondary flex-shrink-0"><?php echo e(__('Volver')); ?></a>
    </div>

    <div class="card shadow-sm border-0">
        <div class="card-body">
            <form id="rt-venue-form" method="post" action="<?php echo e(route('dashboard.venues.store')); ?>" data-google-maps-key="<?php echo e(e($googleMapsKey)); ?>" data-google-maps-map-id="<?php echo e(e($googleMapsMapId ?? '')); ?>">
                <?php echo csrf_field(); ?>
                <?php echo $__env->make('dashboard.venues._form', ['venue' => $venue, 'timezones' => $timezones, 'googleMapsKey' => $googleMapsKey], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                <button type="submit" class="btn rt-btn-cherry"><?php echo e(__('Guardar recinto')); ?></button>
            </form>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('head'); ?>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.bootstrap4.min.css">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('scripts'); ?>
    <script src="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.complete.min.js"></script>
    <script src="<?php echo e(asset('js/dashboard-venue-page-map.js')); ?>?v=4"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            var tz = document.getElementById('timezone');
            if (tz && window.TomSelect) {
                new TomSelect(tz, { maxOptions: null, allowEmptyOption: false });
            }
            var country = document.getElementById('country');
            if (country && window.TomSelect) {
                new TomSelect(country, {
                    allowEmptyOption: true,
                    maxOptions: null,
                    placeholder: <?php echo json_encode(__('Buscar país o código ISO…'), 15, 512) ?>,
                });
            }
            var form = document.getElementById('rt-venue-form');
            var key = form && form.getAttribute('data-google-maps-key');
            if (key && window.rtVenuePageMapInit) {
                window.rtVenuePageMapInit({
                    apiKey: key,
                    mapId: form.getAttribute('data-google-maps-map-id') || '',
                });
            }
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.dashboard', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/resources/views/dashboard/venues/create.blade.php ENDPATH**/ ?>