{#
/**
 * This file is part of FacturaScripts
 * Copyright (C) 2017-2024 Carlos Garcia Gomez <carlos@facturascripts.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see http://www.gnu.org/licenses/.
 */
#}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ constant('FS_LANG') | slice(0, 2) }}"
      xml:lang="{{ constant('FS_LANG') | slice(0, 2) }}">
<head>
    {% for item in getIncludeViews('MenuTemplate', 'HeadFirst') %}
        {% include item['path'] %}
    {% endfor %}
    {% block meta %}
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>{{ fsc.title | raw }}</title>
        <meta name="description" content="{{ trans('meta-description') }}"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta name="generator" content="FacturaScripts"/>
        <meta name="robots" content="noindex"/>
    {% endblock %}
    {% block icons %}
        <link rel="shortcut icon" href="{{ asset('Dinamic/Assets/Images/favicon.ico') }}"/>
        <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('Dinamic/Assets/Images/apple-icon-180x180.png') }}"/>
    {% endblock %}
    {% for item in getIncludeViews('MenuTemplate', 'CssBefore') %}
        {% include item['path'] %}
    {% endfor %}
    {% block css %}
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
        <link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet">
        <link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
        <link href="{{ asset('Dinamic/Assets/Vendor/glightbox/glightbox.min.css') }}" rel="stylesheet">
        <link href="{{ asset('Dinamic/Assets/Vendor/simplebar/simplebar.min.css') }}" rel="stylesheet">

        <link href="{{ asset('Dinamic/Assets/CSS/theme-rtl.min.css" type="text/css') }}" rel="stylesheet" id="style-rtl">
        <link href="{{ asset('Dinamic/Assets/CSS/theme.min.css') }}" type="text/css" rel="stylesheet" id="style-default">
        <link href="{{ asset('Dinamic/Assets/CSS/custom.css') }}?v=7" type="text/css" rel="stylesheet">

        {% include 'CSS/Custom.html.twig' %}

        <link href="{{ asset('Dinamic/Assets/CSS/user-rtl.min.css') }}" type="text/css" rel="stylesheet" id="user-style-rtl">
        <link href="{{ asset('Dinamic/Assets/CSS/user.min.css') }}" type="text/css" rel="stylesheet" id="user-style-default">
        <link href="{{ asset('Dinamic/Assets/Vendor/dropzone/dropzone.css') }}" rel="stylesheet">
    {% endblock %}
    {# Adds custom CSS assets #}
    {% for css in assetManager.get('css') %}
        <link rel="stylesheet" href="{{ css }}"/>
    {% endfor %}
    {% for item in getIncludeViews('MenuTemplate', 'CssAfter') %}
        {% include item['path'] %}
    {% endfor %}
    {% for item in getIncludeViews('MenuTemplate', 'JsHeadBefore') %}
        {% include item['path'] %}
    {% endfor %}
    {% block javascripts %}
        <script src="{{ asset('node_modules/jquery/dist/jquery.min.js') }}"></script>

        <script src="{{ asset('Dinamic/Assets/JS/customProTheme.js') }}"></script>
        
        <script src="{{ asset('Dinamic/Assets/JS/Custom.js') }}?v=6"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.6/umd/popper.min.js"></script>

        <!-- 
            Vamos a usar el antiguo para que sea compatible y no parece romper nada
            <script src="{{ asset('node_modules/bootstrap/dist/js/bootstrap.bundle.min.js') }}"></script>
        -->

        <script src="{{ asset('Dinamic/Assets/Vendor/bootstrap/bootstrap.min.js') }}"></script>
        <script src="{{ asset('node_modules/bootbox/dist/bootbox.min.js') }}"></script>
        <script src="{{ asset('node_modules/bootbox/dist/bootbox.locales.min.js') }}"></script>

        <script src="{{ asset('node_modules/@fortawesome/fontawesome-free/js/all.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/simplebar/simplebar.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/js/config.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/anchorjs/anchor.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/dayjs/dayjs.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/feather-icons/feather.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/fontawesome/all.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/glightbox/glightbox.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/is/is.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/lodash/lodash.min.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/list.js/list.min.js') }}"></script>
        <script src="https://polyfill.io/v3/polyfill.min.js?features=window.scroll"></script>
        <script src="{{ asset('Dinamic/Assets/JS/phoenix.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/JS/showcase.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/JS/ecommerce-dashboard.js') }}"></script>
        <script src="{{ asset('Dinamic/Assets/Vendor/dropzone/dropzone-min.js') }}"></script>

    {% endblock %}
    {# Adds custom JS assets #}
    {% for js in assetManager.get('js') %}
        <script src="{{ js }}"></script>
        <script>
            var phoenixIsRTL = window.config.config.phoenixIsRTL;
            if (phoenixIsRTL) {
                var linkDefault = document.getElementById('style-default');
                var userLinkDefault = document.getElementById('user-style-default');
                linkDefault.setAttribute('disabled', true);
                userLinkDefault.setAttribute('disabled', true);
                document.querySelector('html').setAttribute('dir', 'rtl');
            } else {
                var linkRTL = document.getElementById('style-rtl');
                var userLinkRTL = document.getElementById('user-style-rtl');
                linkRTL.setAttribute('disabled', true);
                userLinkRTL.setAttribute('disabled', true);
            }
        </script>
    {% endfor %}
    {% for item in getIncludeViews('MenuTemplate', 'JsHeadAfter') %}
        {% include item['path'] %}
    {% endfor %}
    {% if debugBarRender %}
        {{ debugBarRender.renderHead() | raw }}
    {% endif %}
    {% for item in getIncludeViews('MenuTemplate', 'HeadEnd') %}
        {% include item['path'] %}
    {% endfor %}
</head>
{% block fullBody %}
{% set menuSelection = settings("theme", "select_menu") %}
{% set bodyClasses = [] %}
{% if menuSelection == 'vertical' %}
  {% set bodyClasses = bodyClasses|merge(['with-vertical-menu']) %}
{% endif %}
<body class="{{ bodyClasses|join(' ') }}">
  {% if fsc.isPublic == 0 %}
    {% for item in getIncludeViews('MenuTemplate', 'BodyFirst') %}
        {% include item['path'] %}
    {% endfor %}
  {% endif %}

  {% if fsc.isPublic == 0 and menuSelection == 'vertical' %}
    {% include 'ProTheme/Menu/vertical.html.twig' %}
    <div class="content pt-3 contenidoPrincipal">
  {% else %}
    {% block navbar %}

        {% if settings("theme", "select_menu") == '' %}
          {% include 'ProTheme/Menu/horizontal.html.twig' %}
        {% endif %}

        {% if settings("theme", "select_menu") == 'vertical' %}
          {% include 'ProTheme/Menu/vertical.html.twig' %}
        {% endif %}

        {% if settings("theme", "select_menu") == 'horizontal' %}
          {% include 'ProTheme/Menu/horizontal.html.twig' %}
        {% endif %}
    {% endblock %}

    <div class="content pt-3 contenidoPrincipal">
  {% endif %}

  {% block messages %}
  {% if fsc.isPublic == 0 %}
      {% include 'Macro/Toasts.html.twig' %}
      {% from 'Macro/Utils.html.twig' import message as showMessage %}
      <div class="container-fluid mt-7">
          <div class="row">
              <div class="col-12">
                  {{ showMessage(log, ['error', 'critical'], 'danger') }}
                  {{ showMessage(log, ['warning'], 'warning') }}
                  {{ showMessage(log, ['notice'], 'success') }}
                  {{ showMessage(log, ['info'], 'info') }}
              </div>
          </div>
      </div>
  {% endif %}
  {% endblock %}

  {% block bodyHeaderOptions %}
  {% endblock %}

  {% block body %}
  {% endblock %}

    </div>

  {% for item in getIncludeViews('MenuTemplate', 'JsFooter') %}
      {% include item['path'] %}
  {% endfor %}
  {% for item in getIncludeViews('MenuTemplate', 'BodyEnd') %}
      {% include item['path'] %}
  {% endfor %}
  {% if debugBarRender %}
      {{ debugBarRender.render() | raw }}
  {% endif %}
  <!-- execution time: {{ executionTime() }} s -->
</body>
{% endblock %}
</html>
