<?php if (isset($component)) { $__componentOriginald956570c5321d7185b887a45463f814f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginald956570c5321d7185b887a45463f814f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.site-layout','data' => ['title' => 'My account']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('site-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'My account']); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

    <?php
        $user = auth()->user();
        $profile = $user->profile;
        $upcoming = $user->bookings()
            ->with('room')
            ->whereIn('status', ['pending_payment', 'payment_submitted', 'confirmed'])
            ->where('starts_at', '>=', now())
            ->orderBy('starts_at')
            ->get();
        $past = $user->bookings()
            ->with('room')
            ->where('starts_at', '<', now())
            ->orderByDesc('starts_at')
            ->limit(10)
            ->get();
        $package = $user->usablePackage();
    ?>

    <div class="mx-auto max-w-4xl px-4 sm:px-6 py-10">
        <div class="flex flex-wrap items-end justify-between gap-4">
            <div>
                <h1 class="text-3xl uppercase tracking-wide text-stone-100">
                    <?php echo e($profile?->artist_name ?: $user->name); ?>

                </h1>
                <p class="mt-1 text-stone-400 text-sm">
                    <?php echo e($profile?->genres->pluck('name')->join(' · ') ?: 'No genres chosen yet'); ?>

                </p>
            </div>
            <a href="<?php echo e(route('profile.edit')); ?>"
               class="rounded-lg border border-ink-600 px-4 py-2 text-sm text-stone-300 hover:border-amber-500">
                Edit profile
            </a>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(! $profile?->isComplete()): ?>
            <div class="mt-6 rounded-lg border border-amber-500/40 bg-amber-500/10 p-4 text-sm">
                <span class="text-amber-200 font-semibold">Finish your profile to book.</span>
                <span class="text-amber-100/70">
                    We need your artist name, phone number and date of birth.
                </span>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <div class="mt-8 grid gap-4 sm:grid-cols-3">
            <div class="rounded-lg border border-ink-700 bg-ink-900 p-4">
                <div class="text-xs font-mono uppercase tracking-widest text-stone-500">Sessions completed</div>
                <div class="mt-1 text-2xl font-mono text-stone-100"><?php echo e($profile?->completed_bookings_count ?? 0); ?></div>
            </div>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($package): ?>
                <div class="rounded-lg border border-ink-700 bg-ink-900 p-4">
                    <div class="text-xs font-mono uppercase tracking-widest text-stone-500">Studio hours left</div>
                    <div class="mt-1 text-2xl font-mono text-amber-400">
                        <?php echo e(rtrim(rtrim(number_format($package->studioHoursRemaining(), 1), '0'), '.')); ?>

                    </div>
                </div>
                <div class="rounded-lg border border-ink-700 bg-ink-900 p-4">
                    <div class="text-xs font-mono uppercase tracking-widest text-stone-500">Package expires</div>
                    <div class="mt-1 text-2xl font-mono text-stone-100">
                        <?php echo e($package->expires_at->setTimezone(config('studio.timezone'))->format('j M')); ?>

                    </div>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </div>

        <section class="mt-10">
            <h2 class="text-xs font-mono uppercase tracking-widest text-stone-500">Upcoming</h2>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($upcoming->isEmpty()): ?>
                <p class="mt-3 rounded-lg border border-ink-700 bg-ink-900 p-4 text-sm text-stone-400">
                    Nothing booked yet.
                    <a href="<?php echo e(route('book')); ?>" class="text-amber-400 hover:underline">Book a session</a>.
                </p>
            <?php else: ?>
                <div class="mt-3 space-y-2">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $upcoming; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                        <a href="<?php echo e(route('checkout', $booking->reference)); ?>"
                           class="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-ink-700
                                  bg-ink-900 p-4 hover:border-ink-600">
                            <div>
                                <div class="text-stone-100">
                                    <?php echo e($booking->starts_at->setTimezone(config('studio.timezone'))->format('D j M, H:i')); ?>

                                    <span class="text-stone-500">·</span>
                                    <?php echo e($booking->room->name); ?>

                                </div>
                                <div class="text-xs font-mono text-stone-500 mt-1"><?php echo e($booking->reference); ?></div>
                            </div>
                            
                            <span class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                                'rounded px-2 py-1 text-xs font-mono uppercase tracking-wide',
                                'bg-amber-500/15 text-amber-300' => $booking->status->value === 'pending_payment',
                                'bg-sky-500/15 text-sky-300' => $booking->status->value === 'payment_submitted',
                                'bg-emerald-500/15 text-emerald-300' => $booking->status->value === 'confirmed',
                            ]); ?>">
                                <?php echo e($booking->status->getLabel()); ?>

                            </span>
                        </a>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                </div>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </section>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($past->isNotEmpty()): ?>
            <section class="mt-10">
                <h2 class="text-xs font-mono uppercase tracking-widest text-stone-500">Past sessions</h2>
                <div class="mt-3 space-y-2">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $past; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                        <div class="flex flex-wrap items-center justify-between gap-3 rounded-lg border border-ink-800
                                    bg-ink-900/50 px-4 py-3 text-sm">
                            <span class="text-stone-400">
                                <?php echo e($booking->starts_at->setTimezone(config('studio.timezone'))->format('j M Y, H:i')); ?>

                                <span class="text-stone-600">·</span> <?php echo e($booking->room->name); ?>

                            </span>
                            <span class="text-xs font-mono text-stone-500"><?php echo e($booking->status->getLabel()); ?></span>
                        </div>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                </div>
            </section>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginald956570c5321d7185b887a45463f814f)): ?>
<?php $attributes = $__attributesOriginald956570c5321d7185b887a45463f814f; ?>
<?php unset($__attributesOriginald956570c5321d7185b887a45463f814f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald956570c5321d7185b887a45463f814f)): ?>
<?php $component = $__componentOriginald956570c5321d7185b887a45463f814f; ?>
<?php unset($__componentOriginald956570c5321d7185b887a45463f814f); ?>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\projects\bilal\mith\mithstudios\resources\views/account/dashboard.blade.php ENDPATH**/ ?>