<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="favicon.ico">
    <title>Trilium Notes</title>
</head>
<body class="desktop heading-style-<%= headingStyle %>">
<noscript>Trilium requires JavaScript to be enabled.</noscript>

<script>
    // hide body to reduce flickering on the startup. This is done through JS and not CSS to not hide <noscript>
    document.getElementsByTagName("body")[0].style.display = "none";
</script>

<div id="toast-container" class="d-flex flex-column justify-content-center align-items-center"></div>

<div class="dropdown-menu dropdown-menu-sm" id="context-menu-container"></div>

<%- include('dialogs/add_link.ejs') %>
<%- include('dialogs/branch_prefix.ejs') %>
<%- include('dialogs/export.ejs') %>
<%- include('dialogs/import.ejs') %>
<%- include('dialogs/jump_to_note.ejs') %>
<%- include('dialogs/markdown_import.ejs') %>
<%- include('dialogs/note_revisions.ejs') %>
<%- include('dialogs/options.ejs') %>
<%- include('dialogs/protected_session_password.ejs') %>
<%- include('dialogs/recent_changes.ejs') %>
<%- include('dialogs/info.ejs') %>
<%- include('dialogs/prompt.ejs') %>
<%- include('dialogs/confirm.ejs') %>
<%- include('dialogs/clone_to.ejs') %>
<%- include('dialogs/move_to.ejs') %>
<%- include('dialogs/backend_log.ejs') %>
<%- include('dialogs/include_note.ejs') %>
<%- include('dialogs/sort_child_notes.ejs') %>
<%- include('dialogs/delete_notes.ejs') %>
<%- include('dialogs/password_not_set.ejs') %>
<%- include('dialogs/note_type_chooser.ejs') %>

<script type="text/javascript">
    global = globalThis; /* fixes https://github.com/webpack/webpack/issues/10035 */

    window.baseApiUrl = 'api/';
    window.device = "desktop";
    window.glob = {
        activeDialog: null,
        maxEntityChangeIdAtLoad: <%= maxEntityChangeIdAtLoad %>,
        maxEntityChangeSyncIdAtLoad: <%= maxEntityChangeSyncIdAtLoad %>,
        instanceName: '<%= instanceName %>',
        csrfToken: '<%= csrfToken %>',
        isDev: <%= isDev %>,
        appCssNoteIds: <%- JSON.stringify(appCssNoteIds) %>,
        isMainWindow: <%= isMainWindow %>,
        extraHoistedNoteId: '<%= extraHoistedNoteId %>',
        isProtectedSessionAvailable: <%= isProtectedSessionAvailable %>,
        triliumVersion: "<%= triliumVersion %>"
    };
</script>

<style>
    .note-split {
        max-width: <%= maxContentWidth %>px;
    }
</style>

<!-- Required for correct loading of scripts in Electron -->
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>

<script src="libraries/jquery.min.js"></script>

<link href="libraries/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="libraries/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Include Fancytree library and skip -->
<link href="stylesheets/tree.css" rel="stylesheet">
<script src="libraries/fancytree/jquery.fancytree-all-deps.min.js"></script>

<script src="libraries/jquery.hotkeys.js"></script>

<script src="libraries/autocomplete.jquery.min.js"></script>

<script src="libraries/dayjs.min.js"></script>

<script src="libraries/split.min.js"></script>

<link href="stylesheets/ckeditor-theme.css" rel="stylesheet">
<link href="api/fonts" rel="stylesheet">
<link href="stylesheets/theme-light.css" rel="stylesheet">

<% if (themeCssUrl) { %>
<link href="<%= themeCssUrl %>" rel="stylesheet">
<% } %>

<link href="stylesheets/style.css" rel="stylesheet">

<script>
    $("body").show();
</script>

<script src="app/desktop.js" crossorigin type="module"></script>

<link rel="stylesheet" type="text/css" href="libraries/boxicons/css/boxicons.min.css">

</body>
</html>
