<!DOCTYPE html>
<html>
@if(isset($titleExt))
    @include('layout.head',['titleExt'=>$titleExt])
@else
    @include('layout.head')
@endif

<body class="ui-widget-content">

    <div id="appLoader">
        <div class="d-flex justify-content-center">
            <div>
                <img class="mb-4" src="{{asset('images/pictures/Eurestlogo1.png')}}">
            </div>
        </div>
        <div class="d-flex justify-content-center">
            <strong style="padding-right: 1em;">Loading</strong>

            <div class="spinner-border" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div>
    </div>
    <div class="xcontainer">

</div>

<style>
    #appLoader{
        width: 200px;
        height: 200px;
        #background-color: green;
        position: absolute;
        right: 0;
        left: 0;
        top: 0;
        bottom: 0;
        margin: auto;
    }
</style>

<div class="d-none" id="appContent">
@include('layout.confirmModal')

<!-- Site wrapper -->
    @include('layout.speedButtonNavBar')
<div class="headerYSpace"></div>
    <main role="main" class="mainContent">
    @yield('content')
    </main>
</div>
</body>

<script src="{{mix('js/customize.js')}}"></script>
{{--
<script src="{{mix('js/customize.js')}}"></script>
<script src="{{asset('js/customize.php')}}"></script>
--}}

<script src="{{mix('/js/app.js')}}"></script>
<script src="{{mix('/js/admin.js')}}"></script>
<script src="{{mix('/js/module.js')}}"></script>
<script src="{{mix('/js/components.js')}}"></script>
<script>
    //----------------------------------------------------------------------

    Inputmask.extendAliases({
        'phoneNumber': {
            //regex: "^[\/+][0-9]{1,2}[-][0-9]{1,2}[ ][0-9]{3}[ ][0-9]{3,4}",
            mask: '{{App\Rules\PhoneRule::$inputMaskPatter}}',
            greedy:false
        }
    });
    $(document).ready( function() {
        window.APP = new Emegrendeles({
            'key':'ertek','myVar':'modified value',
            Url:{
                contactPopup:{
                    show:'{{route("admin.contact.show","*contactId*")}}',
                    update:'{{route("admin.contact.update","*contactId*")}}',
                },
                addressPopup:{
                    show:'{{route("admin.address.show","*id*")}}',
                    update:'{{route("admin.address.update","*id*")}}',
                }
            },
            contactPopup:{
                'defaultStatus':'{{\App\Enums\DbStatusFieldEnum::active}}'
            },
            addressPopup:{
                'defaultStatus':'{{\App\Enums\DbStatusFieldEnum::active}}'
            },
        });
        APP.initNavBar();

        APP.setApiToken('{{csrf_token()}}');

        APP.loadMainContent('{{route('dashboard.index')}}');
        $('#appLoader').toggleClass('d-none');
        $('#appContent').toggleClass('d-none');
        //alert('doc ready');
    });
</script>
@yield('script')

</html>
