%- hijack_if_ember_cli! -%>
<%= content_for?(:title) ? yield(:title) : SiteSetting.title %>
<%= render partial: "layouts/head" %>
<%= discourse_csrf_tags %>
<%= render partial: "common/discourse_stylesheet" %>
<%- if SiteSetting.enable_escaped_fragments? %>
<%- end %>
<%- if shared_session_key %>
<%- end %>
<%= build_plugin_html 'server:before-script-load' %>
<%= preload_script 'browser-detect' %>
<%= preload_script "locales/#{I18n.locale}" %>
<%- if ExtraLocalesController.client_overrides_exist? %>
<%= preload_script_url ExtraLocalesController.url('overrides') %>
<%- end %>
<%= preload_script "vendor" %>
<%= preload_script "application" %>
<%- Discourse.find_plugin_js_assets(include_official: allow_plugins?, include_unofficial: allow_third_party_plugins?, request: request).each do |file| %>
<%= preload_script file %>
<%- end %>
<%- if staff? %>
<%= preload_script_url ExtraLocalesController.url('admin') %>
<%= preload_script "admin" %>
<%- end %>
<%- unless customization_disabled? %>
<%= theme_translations_lookup %>
<%= theme_js_lookup %>
<%= theme_lookup("head_tag") %>
<%- end %>
<%= render_google_tag_manager_head_code %>
<%= render_google_universal_analytics_code %>
<%- if include_ios_native_app_banner? %>
<%- end %>
<%= yield :head %>
<%= build_plugin_html 'server:before-head-close' %>
<%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %>
<%- if authentication_data %>
<%- end %>
<%= render_google_tag_manager_body_code %>
<%- unless customization_disabled? %>
<%= theme_lookup("header") %>
<%- end %>
<%- if allow_plugins? %>
<%= build_plugin_html 'server:header' %>
<%- end %>
<% unless current_user %>
<% end %>
<%= preload_script "start-discourse" %>
<%= yield :data %>
<%= preload_script 'browser-update' %>
<%- unless customization_disabled? %>
<%= theme_lookup("body_tag") %>
<%- end %>
<%- if allow_plugins? %>
<%= build_plugin_html 'server:before-body-close' %>
<%- end %>