{"version":3,"file":"main.bundle.js","sources":["../../../Frontend/utils/onDocumentReady.util.ts","../../../Frontend/js/index.ts"],"sourcesContent":["type ReadyCallback = () => void | Promise\r\n\r\nconst callbacks: ReadyCallback[] = []\r\nlet isReady = false\r\n\r\nfunction tryAndCatch(callback: ReadyCallback) {\r\n try {\r\n Promise.resolve(callback()).catch(function (error) {\r\n console.error(error)\r\n })\r\n } catch (error) {\r\n console.error(error)\r\n }\r\n}\r\n\r\n/**\r\n * Triggered when document is ready\r\n */\r\nfunction ready() {\r\n isReady = true\r\n callbacks.forEach((cb) => tryAndCatch(cb))\r\n}\r\n\r\n/**\r\n * Register a function to run when document is ready\r\n */\r\nexport function onDocumentReady(callback: ReadyCallback) {\r\n if (isReady) {\r\n tryAndCatch(callback)\r\n } else {\r\n callbacks.push(callback)\r\n }\r\n}\r\n\r\nfunction handler() {\r\n ready()\r\n document.removeEventListener(\"DOMContentLoaded\", handler)\r\n}\r\n\r\n// Based on jquery's `$(document).ready`\r\n// if the ready state is not loading, `DOMContentLoader` has already fired so trigger ready\r\n// else setup the listener to run once it is loaded\r\nif (document.readyState !== \"loading\") {\r\n ready()\r\n} else {\r\n document.addEventListener(\"DOMContentLoaded\", handler)\r\n}\r\n","// Gebruik deze file voor scripts die nodig zijn op alle pagina's van de website\r\nimport { setupAccordion } from \"./components/accordion.component\"\r\nimport { autoPlay } from \"./components/autoplayfallback.component\"\r\nimport { setupDynamicSubMenu } from \"./components/dynamicSubMenu.component\"\r\nimport { setupImageSliders } from \"./components/imageSlider.component\"\r\n// import { setupInfobar } from \"./components/infobar.component\"\r\nimport { setupMobileMenu } from \"./components/mobileMenu.component\"\r\nimport { playPause } from \"./components/playpause.component\"\r\nimport { setupScrollFader } from \"./components/scrollFader.component\"\r\nimport { setupNavigationVisibility } from \"./components/showHideNavigation.component\"\r\nimport { setupSubMenu } from \"./components/submenu.component\"\r\nimport { InitVideoPlayer } from \"./components/videoPlay.component\"\r\nimport { onDocumentReady } from \"~/utils/onDocumentReady.util\"\r\n\r\nonDocumentReady(() => {\r\n InitVideoPlayer()\r\n autoPlay()\r\n playPause()\r\n setupScrollFader()\r\n setupMobileMenu()\r\n setupSubMenu()\r\n setupImageSliders()\r\n setupNavigationVisibility()\r\n setupAccordion()\r\n setupDynamicSubMenu()\r\n // setupInfobar()\r\n})\r\n"],"names":["callbacks","isReady","tryAndCatch","callback","error","ready","cb","onDocumentReady","handler","autoPlay","playPause","setupScrollFader","setupMobileMenu","setupSubMenu","setupImageSliders","setupNavigationVisibility","setupAccordion","setupDynamicSubMenu"],"mappings":"4nBAEA,MAAMA,EAA6B,CAAC,EACpC,IAAIC,EAAU,GAEd,SAASC,EAAYC,EAAyB,CACxC,GAAA,CACF,QAAQ,QAAQA,EAAS,CAAC,EAAE,MAAM,SAAUC,EAAO,CACjD,QAAQ,MAAMA,CAAK,CAAA,CACpB,QACMA,EAAO,CACd,QAAQ,MAAMA,CAAK,CAAA,CAEvB,CAKA,SAASC,GAAQ,CACLJ,EAAA,GACVD,EAAU,QAASM,GAAOJ,EAAYI,CAAE,CAAC,CAC3C,CAKO,SAASC,EAAgBJ,EAAyB,CACnDF,EACFC,EAAYC,CAAQ,EAEpBH,EAAU,KAAKG,CAAQ,CAE3B,CAEA,SAASK,GAAU,CACXH,EAAA,EACG,SAAA,oBAAoB,mBAAoBG,CAAO,CAC1D,CAKI,SAAS,aAAe,UACpBH,EAAA,EAEG,SAAA,iBAAiB,mBAAoBG,CAAO,EC/BvDD,EAAgB,IAAM,CAEXE,EAAA,EACCC,EAAA,EACOC,EAAA,EACDC,EAAA,EACHC,EAAA,EACKC,EAAA,EACQC,EAAA,EACXC,EAAA,EACKC,EAAA,CAEtB,CAAC"}