{"version":3,"file":"index.054eb8e3.mjs","sources":["../src/index.js"],"sourcesContent":["// Dynamically loads libraries and bootstrap the application\n(async ()=>{\n    // Add a loader here if any\n    const root = document.getElementById('root')\n    if(root) root.innerHTML= `<div style=\"align-self: center\">loading!</div>`;\n\n    try {\n        // Load app\n        const [\n            appModule,\n            css,\n            siteConfig,\n        ] = await Promise.all([\n            import(\"./app.jsx\"),\n            import(\"./style.pcss\"),\n            // Loaded seperately such that this file can be replaced by a simple http server\n            import(\"./app-config.js\").catch(\n                err=>{\n                    console.error(err);\n                    return {};// Fallback to defaults\n                }\n            ),\n        ]);\n\n        console.log(\"Bootstrapped, ready to go!\");\n\n        // Wait for DOM to be ready\n        if(document.readyState === 'loading') {\n            await new Promise((resolve)=>document.addEventListener('DOMContentLoaded', resolve));\n        }\n\n        // Load the css\n        const cssTag = document.createElement('style');\n        cssTag.innerHTML = css.stylesheet;\n        document.head.append(cssTag);\n\n        // Start the app!\n        appModule.startApp({\n            ...(siteConfig?.default ?? siteConfig ?? {}),\n        });\n    }catch(err){\n        console.error(err);\n    }\n})()\n"],"names":["root","document","getElementById","innerHTML","appModule","css","siteConfig","Promise","all","import","catch","err","console","error","log","readyState","resolve","addEventListener","cssTag","createElement","stylesheet","head","append","startApp","default"],"mappings":"AACA,WAEI,MAAMA,EAAOC,SAASC,eAAe,QAClCF,IAAMA,EAAKG,UAAY,kDAE1B,IAEI,MACIC,EACAC,EACAC,SACMC,QAAQC,IAAI,CAClBC,OAAmB,sBACnBA,OAAsB,wBAEtBA,OAAyB,oBAACC,OACtBC,IACIC,QAAQC,MAAMF,GACP,QAKnBC,QAAQE,IAAI,8BAGe,YAAxBb,SAASc,kBACF,IAAIR,SAASS,GAAUf,SAASgB,iBAAiB,mBAAoBD,KAI/E,MAAME,EAASjB,SAASkB,cAAc,SACtCD,EAAOf,UAAYE,EAAIe,WACvBnB,SAASoB,KAAKC,OAAOJ,GAGrBd,EAAUmB,SAAS,IACXjB,GAAYkB,SAAWlB,GAAc,IAEhD,CAAA,MAAMK,GACHC,QAAQC,MAAMF,EAClB,CACH,EA1CD"}