{{-- #CodeGenerator V3 Δ 8c08af4cd7c2ded24d8a784acfcc586d Δ DYNAMICALLY GENERATED FILE - Do not modify this line! Remove it completely to protect the file from changes.
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @version     STUB: 1.0.0
 * @generated   2026-04-27 21:40:07
 * @package     bplan-base/globals
 * @subpackage  Views
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 --}}

<div x-data="editPrinter" x-cloak x-show="show" id="editPrinterModal" tabindex="-1"
    x-on:show-edit-printer-modal.window="showEditPrinterModal($event)"
    x-on:printer-edited.window="onPrinterEdited($event)"
    x-on:printer-deleted.window="onPrinterDeleted($event)"
    class="fixed top-0 left-0 right-0 z-50 flex items-center justify-center w-full h-screen overflow-x-hidden overflow-y-auto md:inset-0 md:h-full">
    <div class="fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75"></div>
    <div class="relative w-full h-full max-w-2xl p-4 md:h-auto">

        <!-- Modal content -->
        <div class="relative p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5">

            <!-- Modal header -->
            <div class="flex items-center justify-between pb-4 mb-4 border-b rounded-t sm:mb-5 dark:border-gray-600">

                <div class="flex items-center space-x-2 text-gray-900 dark:text-white">
                    <h3 class="text-lg font-semibold text-gray-900 dark:text-white">
                        @lang('globals::printers.action.edit')
                    </h3>
                </div>
                <button x-on:click="hideEditPrinterModal" type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white">
                    <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
                        <path clip-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" fill-rule="evenodd" />
                    </svg>
                    <span class="sr-only">
                        @lang('globals::global.action.close')
                    </span>
                </button>
            </div>

            <!-- Modal body -->
            <div>
                <div class="grid gap-4 mb-4 sm:grid-cols-2">

                    <!-- Form fields -->

                </div>



                <div x-show="editSucceeded" class="flex justify-end">
                    <p x-cloak class="mt-2 text-xs text-green-600 dark:text-green-400">
                        @lang('globals::printers.info.updated')
                    </p>
                </div>

                <!-- Form fields -->


            </div>
        </div>
    </div>

    <script>

        document.addEventListener('alpine:init', () => {
            Alpine.data('editPrinter', () => ({
                show: false,
                editSucceeded: false,
                showRemove: false,

                onPrinterEdited(event) {
                    this.editSucceeded = true;

                    setTimeout(() => {
                        this.hideEditPrinterModal();
                        this.resetPrinterEdited();
                    }, 2000);
                },

                onPrinterDeleted(event) {
                    this.show = false;
                    this.resetPrinterEdited();
                },

                resetPrinterEdited() {
                    this.editSucceeded = false;
                    this.showRemove = false;
                },

                hideEditPrinterModal() {
                    this.show = false;
                    this.resetPrinterEdited();
                },

                showEditPrinterModal(event) {
                    this.show = true;

                    setTimeout(() => {
                        // document.getElementById('').focus();
                    }, 100);
                }
            }));
        });
    </script>

</div>
