
/**
 */
namespace _zeitbild.frontend_web
{
	
	/**
	 */
	export async function main(
	) : Promise<void>
	{
		// conf
		await _zeitbild.frontend_web.conf.init(
			"conf.json"
		);
		
		// init
		lib_plankton.log.conf_push(
			[
				lib_plankton.log.channel_make({"kind": "console", "data": {"threshold": "info"}}),
			]
		);
		await _zeitbild.frontend_web.backend.init(
		);
		await lib_plankton.translate.initialize(
			{
				"verbosity": 1,
				"packages": [
					JSON.parse(await lib_plankton.file.read("data/localization/deu.loc.json")),
					JSON.parse(await lib_plankton.file.read("data/localization/eng.loc.json")),
				],
				"order": ["deu", "eng"],
				"autopromote": false,
			}
		);
		lib_plankton.zoo_page.init(
			document.querySelector("main"),
			{
				"fallback": {
					"name": "login",
					"parameters": {}
				}
			}
		);
		lib_plankton.zoo_page.add_nav_entry(
			{"name": "login", "parameters": {}},
			{"label": lib_plankton.translate.get("page.login.title")}
		);
		lib_plankton.zoo_page.add_nav_entry(
			{"name": "events", "parameters": {}},
			{"label": lib_plankton.translate.get("page.events.title")}
		);
		lib_plankton.zoo_page.add_nav_entry(
			{"name": "calendar_add", "parameters": {}},
			{"label": lib_plankton.translate.get("page.calendar_add.title")}
		);
		lib_plankton.zoo_page.add_nav_entry(
			{"name": "event_add", "parameters": {}},
			{"label": lib_plankton.translate.get("page.event_add.title")}
		);
		lib_plankton.zoo_page.add_nav_entry(
			{"name": "logout", "parameters": {}},
			{"label": lib_plankton.translate.get("page.logout.title")}
		);
		
		// exec
		lib_plankton.zoo_page.start();
		
		return Promise.resolve<void>(undefined);
	}
	
}

