<?php if (isset($component)) { $__componentOriginal91fdd17964e43374ae18c674f95cdaa3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3 = $attributes; } ?>
<?php $component = App\View\Components\AdminLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('admin-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(\App\View\Components\AdminLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h1 class="text-2xl font-bold">Response Templates</h1>
     <?php $__env->endSlot(); ?>

    <?php if (isset($component)) { $__componentOriginal2342e1caa3b5224183b4572420a79d31 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2342e1caa3b5224183b4572420a79d31 = $attributes; } ?>
<?php $component = App\View\Components\Message::resolve(['type' => 'success','message' => 'success'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('message'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Message::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2342e1caa3b5224183b4572420a79d31)): ?>
<?php $attributes = $__attributesOriginal2342e1caa3b5224183b4572420a79d31; ?>
<?php unset($__attributesOriginal2342e1caa3b5224183b4572420a79d31); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2342e1caa3b5224183b4572420a79d31)): ?>
<?php $component = $__componentOriginal2342e1caa3b5224183b4572420a79d31; ?>
<?php unset($__componentOriginal2342e1caa3b5224183b4572420a79d31); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginal2342e1caa3b5224183b4572420a79d31 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2342e1caa3b5224183b4572420a79d31 = $attributes; } ?>
<?php $component = App\View\Components\Message::resolve(['type' => 'danger','message' => 'error'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('message'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\Message::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2342e1caa3b5224183b4572420a79d31)): ?>
<?php $attributes = $__attributesOriginal2342e1caa3b5224183b4572420a79d31; ?>
<?php unset($__attributesOriginal2342e1caa3b5224183b4572420a79d31); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2342e1caa3b5224183b4572420a79d31)): ?>
<?php $component = $__componentOriginal2342e1caa3b5224183b4572420a79d31; ?>
<?php unset($__componentOriginal2342e1caa3b5224183b4572420a79d31); ?>
<?php endif; ?>

    <!-- Groups Section - Display as Folders in a Row -->
    <div class="p-4 bg-white dark:bg-gray-800">
        <h2 class="p-4 text-lg font-semibold text-gray-700 dark:text-gray-300">Groups</h2>

        <!-- Flexbox layout for proper row structure -->
        <div class="flex flex-wrap gap-4">
            <?php $__empty_1 = true; $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <a href="<?php echo e(route('admin.response_templates.index', ['group' => $group->id])); ?>"
                class="w-[18%] sm:w-[18%] md:w-[18%] lg:w-[18%] xl:w-[18%] text-center p-4 rounded-lg shadow transition-all duration-200
                       <?php echo e(request('group') == $group->id ? 'bg-indigo-600 text-white' : 'bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600'); ?>">
                 <svg class="w-12 h-12 mx-auto <?php echo e(request('group') == $group->id ? 'text-white' : 'text-gray-500 dark:text-gray-300'); ?>"
                      xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
                     <path d="M10 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V8C22 6.9 21.1 6 20 6H12L10 4Z"></path>
                 </svg>
                 <p class="mt-2 text-sm font-medium">
                     <?php echo e($group->name); ?>

                 </p>
             </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <p class="text-gray-500 dark:text-gray-400">No groups available.</p>
            <?php endif; ?>
        </div>
    </div>

    <!-- Response Templates Table -->
    <div class="mt-4 mb-4 flex justify-between items-center">
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-enable-disable')): ?>
        <div>
            <a href="<?php echo e(route('admin.response_templates.enabled' , ['group' => request('group')])); ?>" class="inline-flex items-center px-4 py-2 text-xs font-semibold tracking-widest uppercase border border-transparent rounded-md shadow-sm
                <?php echo e(request()->routeIs('admin.response_templates.disabled') ? 'bg-gray-300 text-black hover:bg-gray-400' : 'bg-blue-600 text-white hover:bg-blue-700'); ?>">
                View Enabled Templates
            </a>
            <a href="<?php echo e(route('admin.response_templates.disabled' , ['group' => request('group')])); ?>" class="inline-flex items-center px-4 py-2 text-xs font-semibold tracking-widest uppercase border border-transparent rounded-md shadow-sm
                <?php echo e(request()->routeIs('admin.response_templates.disabled') ? 'bg-gray-600 text-white hover:bg-gray-700' : 'bg-gray-300 text-black hover:bg-gray-400'); ?>">
                View Disabled Templates
            </a>
        </div>
        <?php endif; ?>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-delete')): ?>
        <div>
            <a href="<?php echo e(route('admin.response_templates.trashed' , ['group' => request('group')])); ?>"
                class="inline-flex items-center px-4 py-2 text-xs font-semibold tracking-widest text-white uppercase bg-red-600 border border-transparent rounded-md shadow-sm hover:bg-red-700">
                View Templates Trashed
            </a>
        </div>
        <?php endif; ?>
    </div>
    <div class="p-6 bg-white rounded-lg shadow-md dark:bg-gray-800">
        <div class="hidden md:block">
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-add')): ?>
            <div class="flex items-center justify-between mb-4">
                <a href="<?php echo e(route('admin.response_templates.create', ['group' => request('group')])); ?>"
                    class="inline-flex items-center px-4 py-2 text-xs font-semibold tracking-widest text-white uppercase bg-indigo-600 border border-transparent rounded-md shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                    Add New Response Template
                </a>
            </div>
            <?php endif; ?>

            <h2 class="mb-4 text-lg font-semibold text-gray-700 dark:text-gray-300">Response Templates</h2>
            <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
                <thead class="bg-gray-50 dark:bg-gray-800">
                    <tr>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Title</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Write To</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Reason</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Stage</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Type</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Subject</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Groups</th>
                        <th class="px-4 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase dark:text-gray-400">Actions</th>
                    </tr>
                </thead>
                <tbody class="bg-white divide-y divide-gray-200 dark:bg-gray-900 dark:divide-gray-700">
                    <?php $__empty_1 = true; $__currentLoopData = $responseTemplates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $template): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td class="px-2 py-4 text-sm font-medium text-gray-900 whitespace-nowrap dark:text-gray-100"><?php echo e($template->title); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->write_to); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->reason); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->stage_of_booking); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->type); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->subject); ?></td>
                            <td class="px-2 py-4 text-sm text-gray-700 dark:text-gray-300"><?php echo e($template->groups->pluck('name')->implode(', ')); ?></td>
                            <td class="px-2 py-4 text-sm font-medium whitespace-nowrap">
                                <a href="<?php echo e(route('admin.response_templates.show', $template)); ?>" class="text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300">View</a>
                                <?php if($template->status): ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-edit')): ?>
                                <a href="<?php echo e(route('admin.response_templates.edit', $template)); ?>" class="ml-2 text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300">Edit</a>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-delete')): ?>
                                <button type="button" class="inline ml-2 text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300" data-bs-toggle="modal" data-bs-target="#deleteModal<?php echo e($template->id); ?>">
                                    Delete
                                </button>
                                <?php if (isset($component)) { $__componentOriginal37b7f052626c638ba0443fdb400d6f57 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal37b7f052626c638ba0443fdb400d6f57 = $attributes; } ?>
<?php $component = App\View\Components\DeleteModal::resolve(['type' => 'Response Template','id' => $template->id,'name' => $template->title,'route' => 'admin.response_templates.destroy'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('delete-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\DeleteModal::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal37b7f052626c638ba0443fdb400d6f57)): ?>
<?php $attributes = $__attributesOriginal37b7f052626c638ba0443fdb400d6f57; ?>
<?php unset($__attributesOriginal37b7f052626c638ba0443fdb400d6f57); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal37b7f052626c638ba0443fdb400d6f57)): ?>
<?php $component = $__componentOriginal37b7f052626c638ba0443fdb400d6f57; ?>
<?php unset($__componentOriginal37b7f052626c638ba0443fdb400d6f57); ?>
<?php endif; ?>
                                <?php endif; ?>
                                <?php endif; ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('response-template-enable-disable')): ?>
                                <button type="button" class="ml-2 px-3 py-1 text-white text-xs font-semibold rounded-md <?php echo e($template->status ? 'bg-green-500 hover:bg-green-600' : 'bg-gray-500 hover:bg-gray-600'); ?>" data-bs-toggle="modal" data-bs-target="#statusModal<?php echo e($template->id); ?>">
                                    <?php echo e($template->status ? 'Enable' : 'Disable'); ?>

                                </button>
                                <!-- Status Modal Component -->
                                <?php if (isset($component)) { $__componentOriginalc7fde9c4e105387dbff2286758ae4b66 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc7fde9c4e105387dbff2286758ae4b66 = $attributes; } ?>
<?php $component = App\View\Components\StatusModal::resolve(['type' => $template->status ? 'Disable' : 'Enable','id' => $template->id,'name' => $template->title,'route' => 'admin.response_templates.toggle-status'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('status-modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\StatusModal::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc7fde9c4e105387dbff2286758ae4b66)): ?>
<?php $attributes = $__attributesOriginalc7fde9c4e105387dbff2286758ae4b66; ?>
<?php unset($__attributesOriginalc7fde9c4e105387dbff2286758ae4b66); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc7fde9c4e105387dbff2286758ae4b66)): ?>
<?php $component = $__componentOriginalc7fde9c4e105387dbff2286758ae4b66; ?>
<?php unset($__componentOriginalc7fde9c4e105387dbff2286758ae4b66); ?>
<?php endif; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="8" class="px-6 py-4 text-center text-gray-500 dark:text-gray-400">
                                No response templates found.
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
            <!-- Pagination -->
            <div class="mt-4">
                <?php echo e($responseTemplates->links()); ?>

            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $attributes = $__attributesOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__attributesOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3)): ?>
<?php $component = $__componentOriginal91fdd17964e43374ae18c674f95cdaa3; ?>
<?php unset($__componentOriginal91fdd17964e43374ae18c674f95cdaa3); ?>
<?php endif; ?>
<?php /**PATH C:\xampp8.2\htdocs\Portal\resources\views/admin/response_templates/index.blade.php ENDPATH**/ ?>