<!DOCTYPE html>
<html>
{% block html_head %}
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>{% block html_title %}{{ customizeService.generateCustomTitle(page || path) }}{% endblock %}</title>
  <meta name="description" content="">
  <meta name="author" content="">

  <meta name="viewport" content="width=device-width,initial-scale=1">

  <meta name="apple-mobile-web-app-title" content="{{ appService.getAppTitle() | preventXss }}">

  {{ getConfig('crowi', 'customize:header') | default('') }}

  {% include '../widget/headers/favicon.html' %}

  {{ cdnScriptTagsByGroup('basis') }}

  {% if local_config.env.MATHJAX %}
    {% include '../widget/headers/mathjax.html' %}
  {% endif %}

  {% include '../widget/headers/drawio.html' %}

  {% include '../widget/headers/scripts-for-dev.html' %}

  <script src="{{ webpack_asset('js/boot.js') }}"></script>

  <script src="{{ webpack_asset('js/vendors.js') }}" defer></script>
  <script src="{{ webpack_asset('js/commons.js') }}" defer></script>
  {% if getConfig('crowi', 'plugin:isEnabledPlugins') %}
  <script src="{{ webpack_asset('js/plugin.js') }}" defer></script>
  {% endif %}
  {% block html_head_loading_legacy %}
    <script src="{{ webpack_asset('js/legacy.js') }}" defer></script>
  {% endblock %}
  {% block html_head_loading_app %}
    <script src="{{ webpack_asset('js/app.js') }}" defer></script>
  {% endblock %}

  <!-- styles -->
  {% include '../widget/headers/styles-for-app.html' %}
  {% block theme_css_block %}
    {% set themeName = getConfig('crowi', 'customize:theme') %}
    {% include '../widget/headers/styles-theme.html' with {themeName: themeName} %}
  {% endblock %}

  {{ cdnStyleTagsByGroup('basis') }}
  {{ cdnHighlightJsStyleTag(getConfig('crowi', 'customize:highlightJsStyle')) }}

  {% block html_additional_headers %}{% endblock %}

  <style>
    {{ customizeService.getCustomCss() }}
  </style>
</head>
{% endblock %}

{% block html_body %}
{% set additionalBodyClasses = []; %}
{% block html_additional_body_classes %}{% endblock %}
{% if getConfig('crowi', 'customize:isContainerFluid') %}
  {% set additionalBodyClasses = additionalBodyClasses|push('growi-layout-fluid') %}
{% endif %}
<body
  class="{% block html_base_css %}{% endblock %} growi {{ additionalBodyClasses|join(' ') }}"
  data-plugin-enabled="{{ getConfig('crowi', 'plugin:isEnabledPlugins') }}"
  {% block html_base_attr %}{% endblock %}
  data-csrftoken="{{ csrf() }}"
 >

<div id="growi-context-extractor"></div>

<div id="wrapper">

  {% block layout_head_nav %}
    <nav id="grw-navbar" class="navbar grw-navbar navbar-expand navbar-dark sticky-top mb-0 px-0"></nav>
  {% endblock  %} {# layout_head_nav #}

  {% block head_warn_breaking_changes %}{% include '../widget/alert_breaking_changes.html' %}{% endblock %}

  <div id="page-wrapper" class="page-wrapper d-flex d-print-block">
    {% block sidebar %}
    <div id="grw-sidebar-wrapper"></div>
    {% endblock %}

    <div class="flex-fill mw-0">
      {% block head_warn_alert_siteurl_undefined %}{% include '../widget/alert_siteurl_undefined.html' %}{% endblock %}
      {% block layout_main %}{% endblock %}
    </div>
  </div>

  <div id="grw-navbar-bottom-container"></div>

</div><!-- /#wrapper -->

{% block fixed-controls %}
<div id="grw-fab-container" data-testid="grw-fab-container"></div>
{% endblock %}

<div id="grw-hotkeys-manager"></div>

<div id="system-version"></div>

<div id="page-create-modal"></div>
<div id="page-delete-modal"></div>
<div id="empty-trash-modal"></div>
<div id="page-duplicate-modal"></div>
<div id="page-rename-modal"></div>
<div id="page-presentation-modal"></div>
<div id="page-accessories-modal"></div>
<div id="descendants-page-list-modal"></div>
<div id="page-put-back-modal"></div>
<div id="show-page-accessories-modal"></div>
<div id="shortcuts-modal"></div>


{% block body_end %}
{% endblock %}
</body>
{% endblock %}

<script type="application/json" id="growi-context-hydrate">
{{ local_config|json|safe|preventXss }}
</script>

{% if user != null %}
  <script type="application/json" id="growi-current-user">
  {{ user|json|safe|preventXss }}
  </script>
{% endif %}
{% if userUISettings != null %}
  <script type="application/json" id="growi-user-ui-settings">
  {{ userUISettings|json|safe }}
  </script>
{% endif %}
{% if targetAndAncestors != null %}
  <script type="application/json" id="growi-pagetree-target-and-ancestors">
  {{ targetAndAncestors|json|safe }}
  </script>
{% endif %}


{% block custom_script %}
<script>
  {{ customizeService.getCustomScript() }}
</script>
{% endblock %}

</html>
