<!DOCTYPE html>
<html>
<head>
    <!-- The first thing in any HTML file should be the charset -->
    <meta charset="utf-8"/>

    <!-- Make the page mobile compatible -->
    <meta name="viewport" content="width=device-width, initial-scale=1"/>

    <!-- Allow installing the app to the homescreen -->
    <meta name="mobile-web-app-capable" content="yes"/>

    <!-- iOS home screen icons -->
    <link rel="apple-touch-icon" sizes="120x120" href="<%= '${staticResourceContextPath}' %>/jsbuilt/images/oli-icon.png"/>
    <link rel="apple-touch-icon" sizes="152x152" href="<%= '${staticResourceContextPath}' %>/jsbuilt/images/oli-icon.png"/>
    <link rel="apple-touch-icon" sizes="167x167" href="<%= '${staticResourceContextPath}' %>/jsbuilt/images/oli-icon.png"/>
    <link rel="apple-touch-icon" sizes="180x180" href="<%= '${staticResourceContextPath}' %>/jsbuilt/images/oli-icon.png"/>
    <link rel="icon" href="<%= '${staticResourceContextPath}' %>/jsbuilt/images/oli-icon.png"/>
    <% for (var dep in htmlWebpackPlugin.options.externalCSS) { %>
    <link rel="stylesheet" type="text/css" href="<%= htmlWebpackPlugin.options.externalCSS[dep] %>"><% } %>
</head>
<body>
<!-- Display a message if JS has been disabled on the browser. -->
<noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>,
    please <strong>enable JS</strong> to make this app work.
</noscript>

<!-- The app hooks into this div -->
<div id="root" style="height: 100%">
    <div class="sk-cube-grid">
        <div class="sk-cube sk-cube1"></div>
        <div class="sk-cube sk-cube2"></div>
        <div class="sk-cube sk-cube3"></div>
        <div class="sk-cube sk-cube4"></div>
        <div class="sk-cube sk-cube5"></div>
        <div class="sk-cube sk-cube6"></div>
        <div class="sk-cube sk-cube7"></div>
        <div class="sk-cube sk-cube8"></div>
        <div class="sk-cube sk-cube9"></div>
    </div>
</div>


<script>
<%=
'   <#setting number_format="0.##">\n' +
'   const permissions = [];\n' +
'   <#list actionUser.permissions as item>\n' +
'   permissions.push(${item});\n' +
'   </#list>\n' +
'   const msaWebConf = { \n' +
'   <#if webBasePathMap??> \n' +
'   <#list webBasePathMap?keys as key>\n' +
'       "${key}":<#if webBasePathMap[key]??> "${webBasePathMap[key]}" <#else> "" </#if>,\n' +
'   </#list>\n' +
'   }; \n' +    
'  </#if> \n' +
'   const metaInfo = { \n' +
'   <#if metaInfo??> \n' +
'   <#list metaInfo?keys as key>\n' +
'       "${key}":<#if metaInfo[key]??> "${metaInfo[key]}" <#else> "" </#if>,\n' +
'   </#list>\n' +
'  </#if> \n' +
'   }; \n' +
'   <#assign permissions = actionUser.permissions>\n' +
'   global = { \n' +
'            contextPath: "${contextPath}", \n' +
'            namespaceUrl: "${namespaceUrl}", \n' +
'            staticResourceContextPath: "${staticResourceContextPath}", \n' +
'            username: "${actionUser.userName}", \n' +
'            fullName: "${actionUser.fullName}", \n' +
'            branchCode: <#if actionUser.branchCode?has_content> "${actionUser.branchCode}" <#else> "" </#if>, \n' +
'            branchName: <#if actionUser.branchName?has_content> "${actionUser.branchName}" <#else> "" </#if>, \n' +
'            lastLogon: <#if actionUser.loginSince??> new Date("${(actionUser.loginSince?datetime)!}") <#else> \n' +
'            new Date() </#if>, \n' +
'            permissions: permissions, \n' +
'            appVersion: \'${appVersion}\', \n' +
'            msaWebConf: msaWebConf, \n' +
'            metaInfo: metaInfo, \n' +
'            domainName: metaInfo.domain, \n' +
'            platform: "MSA", \n' +
'        }; \n'
%>
</script>

<script type="application/javascript">
    window.__webpack_public_path__ = window.global.staticResourceContextPath + "/jsbuilt/";
</script>
<% for (var dep in htmlWebpackPlugin.options.externalJS) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.externalJS[dep] %>"></script>
<% } %>
</body>
</html>
