{"version":3,"file":"HKKF.bundle.js","sources":["webpack://HKKF/./Src/Scripts/architecture/componentRepository.js","webpack://HKKF/webpack/bootstrap","webpack://HKKF/webpack/runtime/define property getters","webpack://HKKF/webpack/runtime/ensure chunk","webpack://HKKF/webpack/runtime/get javascript chunk filename","webpack://HKKF/webpack/runtime/global","webpack://HKKF/webpack/runtime/hasOwnProperty shorthand","webpack://HKKF/webpack/runtime/load script","webpack://HKKF/webpack/runtime/make namespace object","webpack://HKKF/webpack/runtime/publicPath","webpack://HKKF/webpack/runtime/jsonp chunk loading","webpack://HKKF/./Src/Scripts/index.js"],"sourcesContent":["export default class ComponentRepository {\r\n constructor(componentSourceMap) {\r\n // The property name is the key used to instantiate the component.\r\n // The property value is the path of the file (navigated from the scripts folder) excluded the file ending.\r\n // The order they appear in the sourcemap will affect the order they are instantiated in.\r\n // Shared components should generally be instantiated before controllers.\r\n this.componentSourceMap = componentSourceMap;\r\n\r\n this.componentClassPromiseMap = {}; // Will hold promises for all for classes needed to instantiate components\r\n this.globalInstances = {}; // Will hold components with a data-component-id, that can be queried globally\r\n this.loadedComponents = {}; // Will hold all loaded component instances\r\n\r\n // initializedPromise will resolve when the load function has run and all components have been initialized.\r\n this.initializedPromiseResolve = null;\r\n this.initializedPromiseReject = null;\r\n this.initializedPromise = new Promise((resolve, reject) => {\r\n this.initializedPromiseResolve = resolve;\r\n this.initializedPromiseReject = reject;\r\n });\r\n\r\n // Load all classes required for the components on the current page.\r\n for (const componentKey in this.componentSourceMap) {\r\n if (document.querySelector('[data-component=\"' + componentKey + '\"]')) {\r\n this.loadComponentClass(componentKey);\r\n }\r\n }\r\n\r\n this.load();\r\n }\r\n\r\n /*\r\n * Iterates all elements in the DOM with the 'data-component' attribute,\r\n * and instantiates the corresponding component.\r\n * Returns a promise that will resolve when all components have been instantiated or have failed.\r\n */\r\n load() {\r\n const loadComponentsPromiseArray = [];\r\n\r\n document.querySelectorAll('[data-component]').forEach(c => {\r\n const componentKey = c.getAttribute('data-component');\r\n const componentId = c.getAttribute('data-component-id');\r\n const componentArgs = c.getAttribute('data-component-args');\r\n\r\n\r\n\r\n if (this.componentClassPromiseMap[componentKey]) {\r\n const loadPromise = new Promise((resolve, reject) => {\r\n this.componentClassPromiseMap[componentKey]\r\n .then(Component => {\r\n let args = null;\r\n if (componentArgs) {\r\n args = JSON.parse(componentArgs);\r\n }\r\n\r\n const newComponentInstance = new Component(c, args);\r\n\r\n if (!this.loadedComponents[componentKey]) {\r\n this.loadedComponents[componentKey] = [];\r\n }\r\n this.loadedComponents[componentKey].push(newComponentInstance);\r\n\r\n // If the component has a component ID, add it to globalInstances\r\n if (componentId) {\r\n this.globalInstances[componentId] = newComponentInstance;\r\n }\r\n\r\n resolve(newComponentInstance);\r\n })\r\n .catch(error => {\r\n console.error('Error instantiating component: ', componentKey, error);\r\n reject();\r\n });\r\n });\r\n loadComponentsPromiseArray.push(loadPromise);\r\n } else {\r\n console.warn('unable to find component: ', componentKey);\r\n }\r\n });\r\n\r\n return Promise.all(loadComponentsPromiseArray)\r\n .then(() => {\r\n this.initializedPromiseResolve();\r\n });\r\n }\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * the class corresponsing the component key.\r\n */\r\n loadComponentClass(key) {\r\n if (this.componentClassPromiseMap[key]) {\r\n return this.componentClassPromiseMap[key];\r\n }\r\n\r\n this.componentClassPromiseMap[key] = this.componentSourceMap[key]()\r\n .then(componentLoad => {\r\n return componentLoad.default;\r\n });\r\n return this.componentClassPromiseMap[key];\r\n }\r\n\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * a specific instance of a component, based on its ID.\r\n */\r\n getGlobalInstance(instanceId) {\r\n return this.initializedPromise\r\n .then(() => {\r\n return instanceId ? this.globalInstances[instanceId] : undefined;\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * all instances of a specific type.\r\n */\r\n getInstancesOfType(key) {\r\n return this.initializedPromise\r\n .then(() => {\r\n return this.loadedComponents[key];\r\n });\r\n }\r\n}\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"Src_Scripts_components_top-navigation_js\":\"846922073da49c9f50a3\",\"Src_Scripts_components_tab-section_js\":\"f285c2043381cf8a41fc\",\"Src_Scripts_components_dropdown_js\":\"f87932f44add14e326e5\",\"vendors-node_modules_swiper_swiper_esm_js\":\"75abf9e4107ac1d6de32\",\"Src_Scripts_components_slider-section-slider_js\":\"bf1d7bc3b371d1ca06c7\",\"Src_Scripts_components_image-slider_js\":\"d87edc5ba1108469640c\",\"Src_Scripts_components_overview-controller_js\":\"a9a9e999894eadaaf03f\",\"Src_Scripts_components_search-page_js\":\"9af8630cbe61e1b07f89\",\"vendors-node_modules_vimeo_player_dist_player_es_js\":\"c96215699b0ae8a29111\",\"Src_Scripts_components_media-with-video_js\":\"ec148e3b02856c71a59c\",\"Src_Scripts_components_slideshow_js\":\"51b573c5c33e840b00c7\",\"Src_Scripts_components_email-validation_js\":\"2ad8e0b45c5d171604e3\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","var inProgress = {};\nvar dataWebpackPrefix = \"HKKF:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => fn(event));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/Frontend/Scripts/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"HKKF\": 0\n};\n\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => {\n\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n\t\t\t\t\t});\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no deferred startup\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tparentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkHKKF\"] = globalThis[\"webpackChunkHKKF\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = webpackJsonpCallback;","import ComponentRepository from './architecture/componentRepository';\r\n\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n // Define all components here.\r\n // The property name is the key used to instantiate the component.\r\n // The property value is the path of the file (navigated from the scripts folder) excluded the file ending.\r\n // The order they appear in the sourcemap will affect the order they are instantiated in.\r\n // Shared components should generally be instantiated before controllers.\r\n const componentSourceMap = {\r\n 'top-navigation': () => import('./components/top-navigation'),\r\n /*'my-test-component': () => import('./components/my-test-component'),*/\r\n /*'example-controller': () => import('./controllers/example-controller'),*/\r\n 'tab-section': () => import('./components/tab-section'),\r\n 'dropdown': () => import('./components/dropdown'),\r\n 'slider-section-slider': () => import('./components/slider-section-slider'),\r\n 'image-slider': () => import('./components/image-slider'),\r\n 'overview-controller': () => import('./components/overview-controller'),\r\n 'search-page': () => import('./components/search-page'),\r\n 'media-with-video': () => import('./components/media-with-video'),\r\n 'slideshow': () => import('./components/slideshow'),\r\n 'email-validation': () => import('./components/email-validation'),\r\n };\r\n\r\n // Instantiate the component repository - This will ensure that all components needed for the current page are loaded.\r\n let cr;\r\n window.cr = cr = new ComponentRepository(componentSourceMap);\r\n\r\n //******** BELOW is only to demonstrate functions from the ComponentRepository and will typically not be called here in the index file.\r\n\r\n // Get the instance by the component-id 'main-nav'\r\n /*cr.getGlobalInstance('main-nav')\r\n .then(mainNavInstance => {\r\n console.log('main-nav instance', mainNavInstance);\r\n });*/\r\n\r\n // Get all instances of the component type 'my-test-component'\r\n /*cr.getInstancesOfType('my-test-component')\r\n .then(myTestComponentInstances => {\r\n console.log('here are all instances of \"my-test-component\" class', myTestComponentInstances);\r\n });*/\r\n\r\n // Get the class by the type 'my-test-component'\r\n // This function can be used to instantiate components for markup that is dynamically loaded without the need to know what is loaded.\r\n /*cr.loadComponentClass('my-test-component')\r\n .then(ComponentClass => {\r\n console.log('here is a referencee to \"my-test-component\" class', ComponentClass);\r\n });*/\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AA5HA;AACA;A;;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzFA;AACA;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA;AACA;AAeA;AACA;AAIA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AAAA;AACA;AACA;AACA;AACA;;;;A","sourceRoot":""}