<?php $__env->startSection('title', __('Mi perfil')); ?>

<?php $__env->startSection('content'); ?>
    <div class="d-sm-flex align-items-center justify-content-between mb-4">
        <h1 class="h3 mb-0 text-gray-800"><?php echo e(__('Mi perfil')); ?></h1>
    </div>

    <?php $__env->startPush('scripts'); ?>
        <script>
            document.addEventListener('DOMContentLoaded', function () {
                if (typeof Swal === 'undefined') return;
                <?php if(session('success')): ?>
                    Swal.fire({
                        icon: 'success',
                        title: <?php echo json_encode(session('success'), 15, 512) ?>,
                        confirmButtonText: <?php echo json_encode(__('Aceptar'), 15, 512) ?>,
                        confirmButtonColor: '#b91830',
                    });
                <?php endif; ?>
            });
        </script>
    <?php $__env->stopPush(); ?>

    <div class="row">
        <div class="col-lg-8">
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary"><?php echo e(__('Datos de contacto')); ?></h6>
                </div>
                <div class="card-body">
                    <form method="POST" action="<?php echo e(route('dashboard.profile.update')); ?>">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PUT'); ?>

                        <div class="form-group mb-3">
                            <label for="name"><?php echo e(__('Nombre')); ?></label>
                            <input type="text" class="form-control <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="name" name="name" value="<?php echo e(old('name', $user->name)); ?>" required>
                            <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group mb-3">
                            <label for="email"><?php echo e(__('Correo')); ?></label>
                            <input type="email" class="form-control" id="email" value="<?php echo e($user->email); ?>" disabled>
                            <small class="form-text text-muted"><?php echo e(__('El correo no se puede cambiar desde aquí.')); ?></small>
                        </div>

                        <div class="form-group mb-3">
                            <label for="phone"><?php echo e(__('Teléfono')); ?></label>
                            <input type="text" class="form-control <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="phone" name="phone" value="<?php echo e(old('phone', $user->phone)); ?>" required maxlength="32">
                            <?php $__errorArgs = ['phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group mb-3">
                            <label for="organization_name"><?php echo e(__('Nombre de la organización')); ?></label>
                            <input type="text" class="form-control <?php $__errorArgs = ['organization_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="organization_name" name="organization_name" value="<?php echo e(old('organization_name', $user->organization_name)); ?>" required maxlength="255">
                            <?php $__errorArgs = ['organization_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group mb-3">
                            <label for="primary_event_type"><?php echo e(__('Tipo de eventos principal')); ?></label>
                            <select name="primary_event_type" id="primary_event_type" class="form-control <?php $__errorArgs = ['primary_event_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                <?php $__currentLoopData = \App\Enums\OrganizerPrimaryEventType::cases(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($type->value); ?>" <?php if(old('primary_event_type', $user->organizer?->primary_event_type?->value) === $type->value): echo 'selected'; endif; ?>><?php echo e($type->label()); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            <?php $__errorArgs = ['primary_event_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="form-group mb-3">
                            <label for="paypal_email"><?php echo e(__('Correo de PayPal para pagos')); ?></label>
                            <input type="email" class="form-control <?php $__errorArgs = ['paypal_email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="paypal_email" name="paypal_email" value="<?php echo e(old('paypal_email', $user->organizer?->paypal_email)); ?>" placeholder="pagos@tuorganizacion.com" maxlength="255">
                            <?php $__errorArgs = ['paypal_email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="invalid-feedback"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            <small class="form-text text-muted"><?php echo e(__('Opcional por ahora. Se usará para enviarte el remanente de ventas cuando el checkout esté activo.')); ?></small>
                        </div>

                        <button type="submit" class="btn btn-primary"><?php echo e(__('Guardar cambios')); ?></button>
                    </form>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="card shadow mb-4">
                <div class="card-header py-3">
                    <h6 class="m-0 font-weight-bold text-primary"><?php echo e(__('Estado de la cuenta')); ?></h6>
                </div>
                <div class="card-body">
                    <?php ($st = $user->account_status); ?>
                    <p class="mb-1">
                        <?php if($st === \App\Enums\AccountStatus::Approved): ?>
                            <span class="badge badge-success"><?php echo e(__('Aprobada')); ?></span>
                        <?php elseif($st === \App\Enums\AccountStatus::AwaitingReview): ?>
                            <span class="badge badge-warning text-dark"><?php echo e(__('En revisión')); ?></span>
                        <?php elseif($st === \App\Enums\AccountStatus::Rejected): ?>
                            <span class="badge badge-danger"><?php echo e(__('Rechazada')); ?></span>
                        <?php else: ?>
                            <span class="badge badge-secondary"><?php echo e(__('Inactiva')); ?></span>
                        <?php endif; ?>
                    </p>
                    <?php if($st === \App\Enums\AccountStatus::Rejected && $user->rejection_reason): ?>
                        <p class="small text-muted mb-0"><?php echo e($user->rejection_reason); ?></p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?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/profile/organizer.blade.php ENDPATH**/ ?>