<!-- Copyright (C) 2005-2024 Splunk Inc. All Rights Reserved. -->
<!-- NOTE: this file removed most if not all the CSS and JS related tags so that this page -->
<!-- gets loaded blazingly fast and customer get redirected without even attempting to load those expensive files.-->
<%!
import sys
from splunk.clilib.bundle_paths import make_splunkhome_path
sys.path.append(make_splunkhome_path(['etc', 'apps', 'SA-ITOA', 'lib']))
sys.path = list(set(sys.path))
from feature_flagging.license_retriever import LicenseRetriever
from feature_flagging.suite_content import SuiteContent

if cherrypy.config['product_type'] == 'hunk':
	faviconFile = 'favicon_hunk.ico'
elif cherrypy.config['product_type'] == 'enterprise':
	faviconFile = 'favicon.ico'
else:
	faviconFile = 'favicon.ico'
%>\

<%
lic_retriever = LicenseRetriever(cherrypy.session.get('sessionKey'))

suite = None
try:
	suite = lic_retriever.get_suite()
except:
	# in case any error occurs with reading suite information, treat it as the standard suite
	suite = SuiteContent.least_permissible_suite()

homepage = 'entity_overview'
if suite == SuiteContent.least_permissible_suite():
	homepage = 'entity_overview'
elif suite == SuiteContent.most_permissible_suite():
	homepage = 'homeview'
%>
<!doctype html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<!-- Always attempt to redirect -->
	<meta http-equiv="refresh" content="0; URL=${make_url('/app/itsi/%s' % homepage)}" />
	<title>${_('Loading...')}</title>
	<meta name="description" content="listen to your data" />
	<meta name="author" content="Splunk Inc." />
	<meta name="viewport" content="width=1024, initial-scale=1.0" />
	<link rel="shortcut icon" href="${make_url('/static/img/' + faviconFile)}" />
	<link rel="apple-touch-icon-precomposed" sizes="57x57" href="${make_url('/static/img/bookmark/apple-icon-57x57-precomposed.png')}" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="${make_url('/static/img/bookmark/apple-icon-72x72-precomposed.png')}" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="${make_url('/static/img/bookmark/apple-icon-114x114-precomposed.png')}" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="${make_url('/static/img/bookmark/apple-icon-144x144-precomposed.png')}" />
	<meta name="msapplication-TileColor" content="#65A637">
	<meta name="msapplication-TileImage" content="${make_url('/static/img/bookmark/ms-tileicon-144x144.png')}">
</head>
<body>
	${next.body() if hasattr(next, 'body') else ''}
	<%
	config_qs = dict(autoload=1)
	if hasattr(cherrypy.request, 'guest_pass') and cherrypy.request.guest_pass:
		config_qs['guest_pass'] = 1
	%>
	<script src="${make_url('/config', _qs=config_qs)}"></script>
	<script>
	__splunkd_partials__ = ${json_decode(splunkd)};
	</script>
</body>
</html>
