<div>
    <div class="container mx-auto">

        <?php if (isset($component)) { $__componentOriginalf9d340f3d6b60a185b72c8cb01544576 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf9d340f3d6b60a185b72c8cb01544576 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.breadcrumb','data' => ['items' => [
            'Dashboard' => route('home'),
            'Etablissement' => route('merchant.show'),
            'Modifier  l\'établissement' => null,
        ]]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.breadcrumb'); ?>
<?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(['items' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute([
            'Dashboard' => route('home'),
            'Etablissement' => route('merchant.show'),
            'Modifier  l\'établissement' => null,
        ])]); ?>
             <?php $__env->slot('action', null, []); ?> 
                <?php if (isset($component)) { $__componentOriginal2c155398bb259ca8bbb2a40244a314f7 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2c155398bb259ca8bbb2a40244a314f7 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.merchants.dropdown','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.merchants.dropdown'); ?>
<?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([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2c155398bb259ca8bbb2a40244a314f7)): ?>
<?php $attributes = $__attributesOriginal2c155398bb259ca8bbb2a40244a314f7; ?>
<?php unset($__attributesOriginal2c155398bb259ca8bbb2a40244a314f7); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2c155398bb259ca8bbb2a40244a314f7)): ?>
<?php $component = $__componentOriginal2c155398bb259ca8bbb2a40244a314f7; ?>
<?php unset($__componentOriginal2c155398bb259ca8bbb2a40244a314f7); ?>
<?php endif; ?>
             <?php $__env->endSlot(); ?>
         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf9d340f3d6b60a185b72c8cb01544576)): ?>
<?php $attributes = $__attributesOriginalf9d340f3d6b60a185b72c8cb01544576; ?>
<?php unset($__attributesOriginalf9d340f3d6b60a185b72c8cb01544576); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf9d340f3d6b60a185b72c8cb01544576)): ?>
<?php $component = $__componentOriginalf9d340f3d6b60a185b72c8cb01544576; ?>
<?php unset($__componentOriginalf9d340f3d6b60a185b72c8cb01544576); ?>
<?php endif; ?>

        <!--[if BLOCK]><![endif]--><?php if(isMerchantActive()): ?>
            <?php if (isset($component)) { $__componentOriginal6e9a6401f582226b66b449404d1f35ff = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal6e9a6401f582226b66b449404d1f35ff = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.alert','data' => ['type' => 'warning','class' => 'mt-6','message' => 'Votre établissement est actif. Vous ne pouvez pas modifier les informations de votre établissement.']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.alert'); ?>
<?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(['type' => 'warning','class' => 'mt-6','message' => 'Votre établissement est actif. Vous ne pouvez pas modifier les informations de votre établissement.']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal6e9a6401f582226b66b449404d1f35ff)): ?>
<?php $attributes = $__attributesOriginal6e9a6401f582226b66b449404d1f35ff; ?>
<?php unset($__attributesOriginal6e9a6401f582226b66b449404d1f35ff); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal6e9a6401f582226b66b449404d1f35ff)): ?>
<?php $component = $__componentOriginal6e9a6401f582226b66b449404d1f35ff; ?>
<?php unset($__componentOriginal6e9a6401f582226b66b449404d1f35ff); ?>
<?php endif; ?>
        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->

        <div class="flex flex-col lg:flex-row gap-6 mt-6">
            <div class="w-full lg:w-8/12 space-y-6">
                <form wire:submit.prevent="saveGeneral">
                    <?php if (isset($component)) { $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.card','data' => ['title' => 'Informations générales','subtitle' => 'Informations de base de l\'établissement']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.card'); ?>
<?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' => 'Informations générales','subtitle' => 'Informations de base de l\'établissement']); ?>
                        
                         <?php $__env->slot('action', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginalac6661fed774446d7f43710fce788e85 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalac6661fed774446d7f43710fce788e85 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.flash','data' => ['model' => 'successGeneral','timeout' => 3000]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.flash'); ?>
<?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(['model' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('successGeneral'),'timeout' => 3000]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $attributes = $__attributesOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__attributesOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $component = $__componentOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__componentOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>

                        <div class="space-y-4">
                            <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Nom de l\'établissement','required' => true,'wire:model.defer' => 'merchant_name','name' => 'merchant_name','mb' => 'mb-4','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Nom de l\'établissement','required' => true,'wire:model.defer' => 'merchant_name','name' => 'merchant_name','mb' => 'mb-4','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                            <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Slogan','wire:model.defer' => 'merchant_slogan','name' => 'merchant_slogan','mb' => 'mb-4','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Slogan','wire:model.defer' => 'merchant_slogan','name' => 'merchant_slogan','mb' => 'mb-4','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                            <?php
                                $merchantTypes = $merchantTypes;
                            ?>
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                <?php if (isset($component)) { $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.select','data' => ['label' => 'Type d\'établissement','required' => true,'wire:model.defer' => 'merchant_type','name' => 'merchant_type','options' => $merchantTypes,'mb' => 'mb-0','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.select'); ?>
<?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(['label' => 'Type d\'établissement','required' => true,'wire:model.defer' => 'merchant_type','name' => 'merchant_type','options' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($merchantTypes),'mb' => 'mb-0','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $attributes = $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $component = $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
                                <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'CNOP','wire:model.defer' => 'merchant_cnop','name' => 'merchant_cnop','mb' => 'mb-0','hint' => 'CNOP de l\'établissement','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'CNOP','wire:model.defer' => 'merchant_cnop','name' => 'merchant_cnop','mb' => 'mb-0','hint' => 'CNOP de l\'établissement','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                            </div>
                        </div>

                        <!--[if BLOCK]><![endif]--><?php if(!$disabled): ?>
                         <?php $__env->slot('footer', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginal26cec1ed531c681893e5ab894ddc394f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal26cec1ed531c681893e5ab894ddc394f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.button','data' => ['type' => 'submit','class' => 'w-full','disabled' => $loadingGeneral,'leftIcon' => 'floppy-disk']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.button'); ?>
<?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(['type' => 'submit','class' => 'w-full','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($loadingGeneral),'leftIcon' => 'floppy-disk']); ?>
                                <!--[if BLOCK]><![endif]--><?php if($loadingGeneral): ?>
                                    Enregistrement...
                                <?php else: ?>
                                    Enregistrer les modifications
                                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $attributes = $__attributesOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $component = $__componentOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__componentOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $attributes = $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $component = $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
                </form>

                <form wire:submit.prevent="saveAddress">
                    <?php if (isset($component)) { $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.card','data' => ['title' => 'Adresse et localisation','subtitle' => 'Informations de localisation de l\'établissement']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.card'); ?>
<?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' => 'Adresse et localisation','subtitle' => 'Informations de localisation de l\'établissement']); ?>
                         <?php $__env->slot('action', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginalac6661fed774446d7f43710fce788e85 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalac6661fed774446d7f43710fce788e85 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.flash','data' => ['model' => 'successAddress','timeout' => 3000]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.flash'); ?>
<?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(['model' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('successAddress'),'timeout' => 3000]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $attributes = $__attributesOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__attributesOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $component = $__componentOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__componentOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>

                        <div class="space-y-4">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                <?php
                                    $provinces = $provinces;
                                    $cities = $cities;
                                ?>
                                <?php if (isset($component)) { $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.select','data' => ['label' => 'Province','required' => true,'placeholder' => 'Sélectionner une province','options' => $provinces,'optionValue' => 'id','optionLabel' => 'name','wire:model.live' => 'merchant_province_id','name' => 'merchant_province_id','mb' => 'mb-0','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.select'); ?>
<?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(['label' => 'Province','required' => true,'placeholder' => 'Sélectionner une province','options' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($provinces),'optionValue' => 'id','optionLabel' => 'name','wire:model.live' => 'merchant_province_id','name' => 'merchant_province_id','mb' => 'mb-0','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $attributes = $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $component = $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
                                <?php if (isset($component)) { $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.select','data' => ['label' => 'Ville','required' => true,'placeholder' => 'Sélectionner une ville','options' => $cities,'optionValue' => 'id','optionLabel' => 'name','wire:model.defer' => 'merchant_city_id','name' => 'merchant_city_id','mb' => 'mb-0','disabled' => empty($cities) || $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.select'); ?>
<?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(['label' => 'Ville','required' => true,'placeholder' => 'Sélectionner une ville','options' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($cities),'optionValue' => 'id','optionLabel' => 'name','wire:model.defer' => 'merchant_city_id','name' => 'merchant_city_id','mb' => 'mb-0','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(empty($cities) || $disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $attributes = $__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__attributesOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5)): ?>
<?php $component = $__componentOriginal28fab7d9d5c3c41515d89d13c880bac5; ?>
<?php unset($__componentOriginal28fab7d9d5c3c41515d89d13c880bac5); ?>
<?php endif; ?>
                            </div>

                            <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Adresse','wire:model.defer' => 'merchant_address','name' => 'merchant_address','mb' => 'mb-0','placeholder' => 'Adresse complète de l\'établissement','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Adresse','wire:model.defer' => 'merchant_address','name' => 'merchant_address','mb' => 'mb-0','placeholder' => 'Adresse complète de l\'établissement','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                            <div class="flex gap-4 items-end">
                                <div class="flex-1">
                                    <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Latitude','wire:model.defer' => 'merchant_latitude','name' => 'merchant_latitude','mb' => 'mb-0','readonly' => true,'hint' => 'Cliquez sur la carte pour définir la position','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Latitude','wire:model.defer' => 'merchant_latitude','name' => 'merchant_latitude','mb' => 'mb-0','readonly' => true,'hint' => 'Cliquez sur la carte pour définir la position','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                                </div>
                                <div class="flex-1">
                                    <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Longitude','wire:model.defer' => 'merchant_longitude','name' => 'merchant_longitude','mb' => 'mb-0','readonly' => true,'hint' => 'Cliquez sur la carte pour définir la position','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Longitude','wire:model.defer' => 'merchant_longitude','name' => 'merchant_longitude','mb' => 'mb-0','readonly' => true,'hint' => 'Cliquez sur la carte pour définir la position','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                                </div>
                                <!--[if BLOCK]><![endif]--><?php if(!$disabled): ?>
                                    <!--[if BLOCK]><![endif]--><?php if (! (app()->environment('production'))): ?>
                                    <div class="flex-1">
                                        <?php if (isset($component)) { $__componentOriginal26cec1ed531c681893e5ab894ddc394f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal26cec1ed531c681893e5ab894ddc394f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.button','data' => ['type' => 'button','disabled' => $locationLoading,'leftIcon' => 'location','class' => 'w-full','onclick' => 'useCurrentLocation()']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.button'); ?>
<?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(['type' => 'button','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($locationLoading),'leftIcon' => 'location','class' => 'w-full','onclick' => 'useCurrentLocation()']); ?>
                                            <!--[if BLOCK]><![endif]--><?php if($locationLoading): ?>
                                                Récupération...
                                            <?php else: ?>
                                                Ma position
                                            <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $attributes = $__attributesOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $component = $__componentOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__componentOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
                                    </div>
                                    <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                            </div>

                            <div class="space-y-2">
                                <label class="block text-sm font-medium text-gray-700">Carte de localisation</label>
                                <!--[if BLOCK]><![endif]--><?php if(app()->environment('production')): ?>
                                    <div class="rounded-md bg-amber-50 text-amber-800 text-sm p-3 mb-2">
                                        La géolocalisation automatique n'est pas disponible en production. Cliquez sur la carte pour définir l'emplacement exact de votre établissement.
                                    </div>
                                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                <div class="border border-gray-300 rounded-lg overflow-hidden relative" wire:ignore>
                                    <div id="merchant-map" class="h-96 w-full bg-gray-100 flex items-center justify-center">
                                        <div class="text-gray-500">
                                            <div class="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600 mx-auto mb-2"></div>
                                            <p class="text-sm">Chargement de la carte...</p>
                                        </div>
                                    </div>
                                </div>
                                <p class="text-sm text-gray-500">Cliquez sur la carte pour définir l'emplacement exact de votre établissement</p>
                            </div>
                        </div>

                        <!--[if BLOCK]><![endif]--><?php if(!$disabled): ?>
                         <?php $__env->slot('footer', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginal26cec1ed531c681893e5ab894ddc394f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal26cec1ed531c681893e5ab894ddc394f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.button','data' => ['type' => 'submit','class' => 'w-full','disabled' => $loadingAddress,'leftIcon' => 'floppy-disk']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.button'); ?>
<?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(['type' => 'submit','class' => 'w-full','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($loadingAddress),'leftIcon' => 'floppy-disk']); ?>
                                <!--[if BLOCK]><![endif]--><?php if($loadingAddress): ?>
                                    Enregistrement...
                                <?php else: ?>
                                    Enregistrer les modifications
                                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $attributes = $__attributesOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $component = $__componentOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__componentOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $attributes = $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $component = $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
                </form>

                <form wire:submit.prevent="saveContact">
                    <?php if (isset($component)) { $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.card','data' => ['title' => 'Informations de contact']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.card'); ?>
<?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' => 'Informations de contact']); ?>
                         <?php $__env->slot('action', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginalac6661fed774446d7f43710fce788e85 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalac6661fed774446d7f43710fce788e85 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.flash','data' => ['model' => 'successContact','timeout' => 3000]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.flash'); ?>
<?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(['model' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('successContact'),'timeout' => 3000]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $attributes = $__attributesOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__attributesOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalac6661fed774446d7f43710fce788e85)): ?>
<?php $component = $__componentOriginalac6661fed774446d7f43710fce788e85; ?>
<?php unset($__componentOriginalac6661fed774446d7f43710fce788e85); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>

                        <div class="space-y-4">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                                <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Téléphone','required' => true,'wire:model.defer' => 'merchant_phone','name' => 'merchant_phone','mb' => 'mb-0','placeholder' => '+243 123 456 789','hint' => 'Numéro de téléphone principal','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Téléphone','required' => true,'wire:model.defer' => 'merchant_phone','name' => 'merchant_phone','mb' => 'mb-0','placeholder' => '+243 123 456 789','hint' => 'Numéro de téléphone principal','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                                <?php if (isset($component)) { $__componentOriginal527c3366704d429cba72b24c330bec17 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal527c3366704d429cba72b24c330bec17 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.input','data' => ['label' => 'Email','required' => true,'type' => 'email','wire:model.defer' => 'merchant_email','name' => 'merchant_email','mb' => 'mb-0','placeholder' => 'contact@mapharmacie.com','hint' => 'Adresse email de contact','disabled' => $disabled]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.input'); ?>
<?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(['label' => 'Email','required' => true,'type' => 'email','wire:model.defer' => 'merchant_email','name' => 'merchant_email','mb' => 'mb-0','placeholder' => 'contact@mapharmacie.com','hint' => 'Adresse email de contact','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($disabled)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $attributes = $__attributesOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__attributesOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal527c3366704d429cba72b24c330bec17)): ?>
<?php $component = $__componentOriginal527c3366704d429cba72b24c330bec17; ?>
<?php unset($__componentOriginal527c3366704d429cba72b24c330bec17); ?>
<?php endif; ?>
                            </div>
                        </div>

                        <!--[if BLOCK]><![endif]--><?php if(!$disabled): ?>
                         <?php $__env->slot('footer', null, []); ?> 
                            <?php if (isset($component)) { $__componentOriginal26cec1ed531c681893e5ab894ddc394f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal26cec1ed531c681893e5ab894ddc394f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.basics.button','data' => ['type' => 'submit','class' => 'w-full','disabled' => $loadingContact,'leftIcon' => 'floppy-disk']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('basics.button'); ?>
<?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(['type' => 'submit','class' => 'w-full','disabled' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($loadingContact),'leftIcon' => 'floppy-disk']); ?>
                                <!--[if BLOCK]><![endif]--><?php if($loadingContact): ?>
                                    Enregistrement...
                                <?php else: ?>
                                    Enregistrer les modifications
                                <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $attributes = $__attributesOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__attributesOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal26cec1ed531c681893e5ab894ddc394f)): ?>
<?php $component = $__componentOriginal26cec1ed531c681893e5ab894ddc394f; ?>
<?php unset($__componentOriginal26cec1ed531c681893e5ab894ddc394f); ?>
<?php endif; ?>
                         <?php $__env->endSlot(); ?>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $attributes = $__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__attributesOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f)): ?>
<?php $component = $__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f; ?>
<?php unset($__componentOriginalc6553a56e7fe7b7a7297dae4cf77349f); ?>
<?php endif; ?>
                </form>
            </div>

            <div class="w-full lg:w-4/12 space-y-6">
                <?php if (isset($component)) { $__componentOriginal8a364d7c9d80dca879b8b27ef3055dd8 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal8a364d7c9d80dca879b8b27ef3055dd8 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.merchants.sidebar','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.merchants.sidebar'); ?>
<?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([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal8a364d7c9d80dca879b8b27ef3055dd8)): ?>
<?php $attributes = $__attributesOriginal8a364d7c9d80dca879b8b27ef3055dd8; ?>
<?php unset($__attributesOriginal8a364d7c9d80dca879b8b27ef3055dd8); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a364d7c9d80dca879b8b27ef3055dd8)): ?>
<?php $component = $__componentOriginal8a364d7c9d80dca879b8b27ef3055dd8; ?>
<?php unset($__componentOriginal8a364d7c9d80dca879b8b27ef3055dd8); ?>
<?php endif; ?>
            </div>
        </div>

    </div>

    <?php $__env->startPush('scripts'); ?>
    <!-- Use local Leaflet files for offline compatibility -->
    <link rel="stylesheet" href="<?php echo e(asset('plugins/leaflet/leaflet.css')); ?>" />
    <script src="<?php echo e(asset('plugins/leaflet/leaflet.js')); ?>"></script>
    <script>
        // Use window object to avoid variable conflicts
        window.merchantMap = window.merchantMap || {};
        window.merchantMap.map = null;
        window.merchantMap.marker = null;
        
        const defaultLat = <?php echo e($merchant_latitude ?? -2.8797); ?>;
        const defaultLng = <?php echo e($merchant_longitude ?? 23.6560); ?>;
        
        function initMerchantMap() {
            // Check if Leaflet is loaded
            if (typeof L === 'undefined') {
                console.error('Leaflet library not loaded. Attempting to load from CDN...');
                loadLeafletFromCDN();
                return;
            }
            
            // Remove existing map if any
            if (window.merchantMap.map) {
                window.merchantMap.map.remove();
                window.merchantMap.map = null;
                window.merchantMap.marker = null;
            }
            
            const mapElement = document.getElementById('merchant-map');
            if (!mapElement) return;
            
            try {
                // Clear loading state
                mapElement.innerHTML = '';
                mapElement.className = 'h-96 w-full';
                
                // Create a completely custom icon that doesn't rely on default paths
                const customIcon = L.divIcon({
                    html: `
                        <div style="
                            width: 32px; 
                            height: 32px; 
                            background-color: #4f46e5; 
                            border-radius: 50%; 
                            border: 2px solid white; 
                            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
                            display: flex; 
                            align-items: center; 
                            justify-content: center;
                            font-size: 16px;
                        ">
                            <i class="ph ph-map-pin text-white"></i>
                        </div>
                    `,
                    className: 'custom-marker-icon',
                    iconSize: [32, 32],
                    iconAnchor: [16, 16],
                    popupAnchor: [0, -16]
                });
                
                console.log('Custom marker icon created');
                
                window.merchantMap.map = L.map('merchant-map').setView([defaultLat, defaultLng], 4);
                L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 
                    attribution: '© OpenStreetMap contributors' 
                }).addTo(window.merchantMap.map);
                
                window.merchantMap.marker = L.marker([defaultLat, defaultLng], { 
                    icon: customIcon,
                    draggable: <?php echo e(!$disabled ? 'true' : 'false'); ?> 
                }).addTo(window.merchantMap.map);
                
                console.log('Marker created with custom icon');
                
                window.merchantMap.marker.on('dragend', function(event) { 
                    const p = event.target.getLatLng(); 
                    updateLivewireCoordinates(p.lat, p.lng); 
                });
                
                window.merchantMap.map.on('click', function(event) { 
                    if (<?php echo e(!$disabled ? 'true' : 'false'); ?>) { 
                        const lat = event.latlng.lat; 
                        const lng = event.latlng.lng; 
                        window.merchantMap.marker.setLatLng([lat, lng]); 
                        updateLivewireCoordinates(lat, lng); 
                    } 
                });
                
                // Force map to invalidate size after initialization
                setTimeout(() => {
                    if (window.merchantMap.map) {
                        window.merchantMap.map.invalidateSize();
                    }
                }, 100);
            } catch (error) {
                console.error('Error initializing map:', error);
                mapElement.innerHTML = '<div class="flex items-center justify-center h-full bg-gray-100 text-gray-500"><p>Erreur lors du chargement de la carte.</p></div>';
            }
        }
        
        function loadLeafletFromCDN() {
            console.log('Loading Leaflet from CDN as fallback...');
            
            // Load CSS
            const cssLink = document.createElement('link');
            cssLink.rel = 'stylesheet';
            cssLink.href = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';
            document.head.appendChild(cssLink);
            
            // Load JS
            const script = document.createElement('script');
            script.src = 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js';
            script.onload = function() {
                console.log('Leaflet loaded from CDN successfully');
                // Retry map initialization (Phosphor icon will be used)
                setTimeout(() => initMerchantMap(), 100);
            };
            script.onerror = function() {
                console.error('Failed to load Leaflet from CDN');
                const mapElement = document.getElementById('merchant-map');
                if (mapElement) {
                    mapElement.innerHTML = '<div class="flex items-center justify-center h-full bg-gray-100 text-gray-500"><p>Erreur: Impossible de charger la carte. Vérifiez votre connexion internet.</p></div>';
                }
            };
            document.head.appendChild(script);
        }
        
        function updateLivewireCoordinates(lat, lng) {
            const parent = document.getElementById('merchant-map')?.closest('[wire\\:id]');
            if (parent) { 
                const id = parent.getAttribute('wire:id'); 
                const c = Livewire.find(id); 
                if (c) { 
                    c.set('merchant_latitude', lat.toFixed(6)); 
                    c.set('merchant_longitude', lng.toFixed(6)); 
                    return; 
                } 
            }
            const latInput = document.querySelector('input[name="merchant_latitude"]'); 
            const lngInput = document.querySelector('input[name="merchant_longitude"]'); 
            if (latInput && lngInput) { 
                latInput.value = lat.toFixed(6); 
                lngInput.value = lng.toFixed(6); 
                latInput.dispatchEvent(new Event('input', { bubbles: true })); 
                lngInput.dispatchEvent(new Event('input', { bubbles: true })); 
            }
        }
        
        function useCurrentLocation() { 
            if (!navigator.geolocation) { 
                alert('La géolocalisation n\'est pas supportée par votre navigateur.'); 
                return; 
            } 
            navigator.geolocation.getCurrentPosition(function(pos) { 
                const lat = pos.coords.latitude; 
                const lng = pos.coords.longitude; 
                if (window.merchantMap.marker && window.merchantMap.map) {
                    window.merchantMap.marker.setLatLng([lat, lng]); 
                    window.merchantMap.map.setView([lat, lng], 13); 
                    updateLivewireCoordinates(lat, lng); 
                }
            }, function() { 
                alert('Impossible d\'obtenir votre position actuelle.'); 
            }); 
        }
        
        // Initialize on DOMContentLoaded
        document.addEventListener('DOMContentLoaded', function() { 
            console.log('DOMContentLoaded - initializing map');
            initMerchantMap(); 
        });
        
        // Re-initialize on Livewire navigation
        document.addEventListener('livewire:navigate', function() { 
            console.log('Livewire navigate detected, reinitializing map...');
            setTimeout(() => {
                console.log('Attempting to reinitialize map after navigation');
                initMerchantMap();
            }, 200); 
        });
        
        document.addEventListener('livewire:navigated', function() { 
            console.log('Livewire navigated detected, reinitializing map...');
            setTimeout(() => {
                console.log('Attempting to reinitialize map after navigation');
                initMerchantMap();
            }, 200); 
        });
        
        // Listen for when Livewire is loaded
        document.addEventListener('livewire:initialized', function() { 
            console.log('Livewire initialized');
        });
        
        // Listen for Livewire load
        document.addEventListener('livewire:load', function() { 
            console.log('Livewire load - initializing map');
            setTimeout(() => initMerchantMap(), 100);
        });
    </script>

    <?php $__env->stopPush(); ?>
    <style>
        .leaflet-container {
            z-index: 0;
        }
        
        /* Custom Phosphor marker styling */
        .custom-phosphor-marker {
            background: transparent !important;
            border: none !important;
        }
        
        .custom-phosphor-marker div {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }
        
        /* Ensure Phosphor icons are loaded */
        .ph {
            font-family: 'Phosphor', sans-serif;
        }
    </style>
</div>
<?php /**PATH D:\WORK\MAARIFA\ANGO\DESKTOP\V4\ango-desktop\resources\views/livewire/merchant/edit.blade.php ENDPATH**/ ?>