<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <script src="//code.jquery.com/jquery-3.3.1.min.js"></script>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
    <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
    
    @if(empty($meta_tags))
      @yield('meta')
    @else
      @foreach ($meta_tags as $key => $value)
        <meta name="{{$value->name}}" content="{{$value->content}}">
      @endforeach
    @endif
    <!-- share -->
    @yield('sharing-meta')

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
	<title>
    @if(isset($page) && $page == 'home')
      {{$masterName}}
    @else
      @yield('title') | {{$masterName}}
    @endif
	</title>

	<script type="text/javascript">
		window.Laravel = {!! json_encode([
		    'csrfToken' => csrf_token(),
		]); !!}
	</script>

	<link rel="shortcut icon" href="{{ asset($storage_url.'img/'.$masterFavicon) }}?{{ $masterFavicon }}" type="image/x-icon" />
	<link rel="stylesheet" type="text/css" href="{{ asset($asset_url.'css/app.css') }}">
	<!--<link rel="shortcut icon" href="{{ asset($storage_url.'img/'.$masterFavicon) }}" type="image/x-icon" />-->
	<!--<link rel="icon" href="{{ asset($storage_url.'img/'.$masterFavicon) }}" type="image/x-icon" />-->

  {{-- social media icons --}}
  <link rel="stylesheet" href="https://d1azc1qln24ryf.cloudfront.net/114779/Socicon/style-cf.css?u8vidh">

  @php
    $x = array_count_values($webFont);
  @endphp

  @foreach ($x as $key => $value)
    @if ($key != "")
      <link href="//fonts.googleapis.com/css?family={{ $key }}" rel="stylesheet" type="text/css">
    @endif
  @endforeach

  @include('layouts.masterCSS')

  @yield('style')
  <style>
    .pac-container {
      z-index: 1060 !important;
    }
    .display-none {
      display: none;
    }
  </style>
  @routes
</head>
<body>
  
  @if($mtMode == 1)
    @include('components.maintenace')
  @else
    @include('components.body')
  @endif
  
  {{-- share buttons --}}
  <!-- Go to www.addthis.com/dashboard to customize your tools -->
  <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5ad6faa20f412048"></script>


	<script type="text/javascript" src="{{ asset($asset_url.'messages.js') }}"></script>
  <script type="text/javascript" src="{{ asset($asset_url.'js/app.js') }}"></script>
  <script src="{{ asset($asset_url.'js/jquery.inview.js') }}"></script>
  <script src="{{ asset($asset_url.'js/backend/ajax-loading.js') }}"></script>

  <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
  <script src="{{ asset($asset_url.'js/jquery.addressPickerByGiro.js') }}"></script>
  <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAc0QKxqa--xttbeNG2Iz0DqpilY33smL4&libraries=places"></script>

  <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
  <script>

    $(document).ready(function(){
      $.get( '{{ route('updateBubble') }}', function( data ) {
        if(data == 0){
          $("#show_cart span.label").hide();
        }else{
          $("#show_cart span.label").show().html(data);
        }
      });
    });

    $('#modal_cart').on('shown.bs.modal', function () {
      $("#cart_content").load("{{route('cart')}}");
    });

    $('#modal_cart').on('hidden.bs.modal', function () {
      $("#cart_content").html('<h3><i class="fa fa-spinner fa-spin fa-lg" aria-hidden="true"></i></h3>');
    });

    //Ajax loading spinner initiate
    var loading = $.loading({
      //set the loading html wrap tag id
      id         : 'ajaxLoading',
      //wrap tag z-index
      zIndex     : '2000',
      //wrap tag background
      background : 'rgba(0, 0, 0, 0.7)',
      //min show time
      minTime    : 200,
      //wrap tag border-radius
      radius     : '4px',
      //wrap width
      width      : '85px',
      height     : '85px',

      //loading img/gif
      imgPath    : '{{asset("images/Spinner.gif")}}',
      imgWidth   : '70px',
      imgHeight  : '70px',

      //loading text
      tip        : '',
      //text font size
      fontSize   : '14px',
      //text font color
      fontColor  : '#fff'
    });
    loading.ajax(false);//disable
  </script>
  @yield('script')
  @yield('cart-script')
</body>
</html>
