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sB,EAAEpF,EAAiB0F,IAAY1F,EAAgB0F,IACrE1F,EAAgB0F,GAAS,KAE1B1F,EAAgByG,EAAIG,IAAM,CAC3B,EAID9C,EAAoB0B,EAAEqB,EAAI,CAACnB,EAASI,KAElC,IAAIgB,EAAqBhD,EAAoBsB,EAAEpF,EAAiB0F,GAAW1F,EAAgB0F,QAAWzB,EACtG,GAA0B,IAAvB6C,EAGF,GAAGA,EACFhB,EAASiB,KAAKD,EAAmB,QAC3B,CAGL,IAAIE,EAAUC,OAAO,KAAOnD,EAAoBiC,EAAEL,IAAUnE,KAAKtB,GAAewF,IAE/E,MADgC,IAA7BzF,EAAgB0F,KAAgB1F,EAAgB0F,QAAWzB,GACxDwB,CAAC,IAEJuB,EAAU5F,QAAQ8F,KAAK,CAACF,EAAS,IAAI5F,SAASC,GAAayF,EAAqB9G,EAAgB0F,GAAW,CAACrE,OAChHyE,EAASiB,KAAKD,EAAmB,GAAKE,EAExC,CACD,E,gCchDF,MCGMG,GAAMzD,E,MAAAA,eAAc0D,aAAcC,SAExC,MAAMC,UAAmBhH,EAAAA,YAAY,mCACnCS,KAAOoG,CAAG,CAEVjG,SACE,IAAIqG,GAAiB,EAgBrB7G,KAAKG,YAAY,CAAE2G,YAAc,SAAQL,MAEvBzG,KAAK+G,cAAc,gBAC3BC,iBAAiB,SAAS,KAClChH,KAAKG,YAAY,CAAE2G,YAAa,QAASG,WAAY,cAAe,IAUrD,IAAIC,sBA5BIC,IAClBN,GACHM,EAAQ7C,SAAS8C,IACXA,EAAMC,iBACRrH,KAAKG,YAAY,CACf2G,YAAa,eACbG,WAAY,8BAEdJ,GAAiB,EACnB,GAEJ,GAU0B,CAC1BS,KAAM,KACNC,WAAY,MACZC,UAAW,IAKJC,QAAQzH,KACnB,EAGG0H,eAAe7C,IAAI4B,IACtBiB,eAAeC,OAAOlB,EAAKG,E","sources":["webpack://hei-boksen/webpack/runtime/create fake namespace object","webpack://hei-boksen/webpack/runtime/import chunk loading","webpack://hei-boksen/./node_modules/@nrk/dh-server-libs/base-element.js","webpack://hei-boksen/./node_modules/@nrk/dh-server-libs/get-element-tag.js","webpack://hei-boksen/./node_modules/@nrk/dh-server-libs/src/base-element.js","webpack://hei-boksen/./node_modules/@nrk/dh-server-libs/src/get-context-id.js","webpack://hei-boksen/./node_modules/@nrk/dh-server-libs/src/get-element-tag.js","webpack://hei-boksen/webpack/bootstrap","webpack://hei-boksen/webpack/runtime/define property getters","webpack://hei-boksen/webpack/runtime/ensure chunk","webpack://hei-boksen/webpack/runtime/get javascript chunk filename","webpack://hei-boksen/webpack/runtime/get mini-css chunk filename","webpack://hei-boksen/webpack/runtime/hasOwnProperty shorthand","webpack://hei-boksen/webpack/runtime/make namespace object","webpack://hei-boksen/webpack/runtime/publicPath","webpack://hei-boksen/./src/components/App.module.css?7844","webpack://hei-boksen/./src/client.ts"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\nvar installChunk = (data) => {\n\tvar {ids, modules, runtime} = data;\n\t// add \"modules\" to the modules object,\n\t// then flag all \"ids\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in modules) {\n\t\tif(__webpack_require__.o(modules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = modules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tfor(;i < ids.length; i++) {\n\t\tchunkId = ids[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[ids[i]] = 0;\n\t}\n\n}\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// import() 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[1]);\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 = import(\"./\" + __webpack_require__.u(chunkId)).then(installChunk, (e) => {\n\t\t\t\t\t\tif(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t\t\tvar promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))])\n\t\t\t\t\tpromises.push(installedChunkData[1] = promise);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no external install chunk\n\n// no on chunks loaded","module.exports = require('./src/base-element.js')\n","module.exports = require('./src/get-element-tag')\n","const { getContextId } = require('./get-context-id')\n\nlet _coreAnalyticsPromise = undefined\nfunction getCoreAnalytics() {\n if (!_coreAnalyticsPromise) {\n if ('coreAnalytics' in window) {\n _coreAnalyticsPromise = Promise.resolve(window['coreAnalytics'])\n } else {\n _coreAnalyticsPromise = import('@nrk/core-analytics' /* webpackChunkName: \"ca\" */).then(\n (m) => m.default\n )\n }\n }\n return _coreAnalyticsPromise\n}\n\nclass BaseElement extends HTMLElement {\n constructor() {\n super()\n this.sendError = this.sendError.bind(this)\n this.sendGaEvent = this.sendGaEvent.bind(this)\n }\n connectedCallback() {\n if (!this.name) throw Error('Name not provided')\n this.setupTracker()\n if (typeof this.render === 'function') this.render()\n }\n\n setupTracker() {\n this.coreAnalyticsTracker = new Promise((resolve) => {\n getCoreAnalytics().then((coreAnalytics) => {\n const tracker = coreAnalytics.create()\n\n tracker('initialize', {\n container: this,\n parentId: this.metadata.parentId || getContextId(window.location.href),\n ga: this.dataset.gaPropertyId,\n })\n\n tracker('context', {\n title: this.metadata.title,\n contentId: this.metadata.selfId,\n publishDate: this.metadata.published,\n })\n\n resolve(tracker)\n })\n })\n }\n\n async sendError(message) {\n // error reporter has been removed\n }\n\n async sendGaEvent(event) {\n const tracker = await this.coreAnalyticsTracker\n tracker('event', {\n ga: {\n eventCategory: `dh-modul-${this.name}`,\n ...event,\n },\n })\n }\n\n get metadata() {\n return this.dataset.metadata ? JSON.parse(this.dataset.metadata) : {}\n }\n\n get preloadedState() {\n return this.dataset.preloadedState ? JSON.parse(this.dataset.preloadedState) : null\n }\n\n get errorTracking() {\n return {\n url: '',\n enabled: false,\n }\n }\n}\n\nmodule.exports.BaseElement = BaseElement\n","const POLOPOLY_ID_REGEX = /[1-9]{1,2}\\.\\d+/g\n\nfunction extractPolopolyIdFromString(str) {\n const matches = str.match(POLOPOLY_ID_REGEX)\n if (matches && matches.length) {\n return matches[0]\n }\n return null\n}\n\nfunction getContextId(url) {\n return extractPolopolyIdFromString(url)\n}\n\nmodule.exports.getContextId = getContextId\n","/**\n * Creates a valid custom element name that is versioned (major)\n */\nfunction getElementTag(name, version) {\n const formattedVersion = version ? `-v${version.split('.')[0]}` : ''\n return name + formattedVersion\n}\n\nmodule.exports.getElementTag = getElementTag\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\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.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 \"\" + \"ca\" + \"-chunk-\" + \"6982dd97eb92be027cca\" + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// 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 = \"https://static.nrk.no/dh/module/hei-boksen/static/\";","// extracted by mini-css-extract-plugin\nexport default {\"root\":\"hei-boksen-v1-root-tqQbo\",\"app\":\"hei-boksen-v1-app-w_itd\",\"box\":\"hei-boksen-v1-box-fec3k\",\"title\":\"hei-boksen-v1-title-M9t2c\",\"content\":\"hei-boksen-v1-content-NJ39s\",\"byline\":\"hei-boksen-v1-byline-fqbW0\",\"byline__author\":\"hei-boksen-v1-byline__author-GxOZm\",\"bylineAuthor\":\"hei-boksen-v1-byline__author-GxOZm\",\"byline__image\":\"hei-boksen-v1-byline__image-pHA1T\",\"bylineImage\":\"hei-boksen-v1-byline__image-pHA1T\",\"byline__text\":\"hei-boksen-v1-byline__text-zfK8t\",\"bylineText\":\"hei-boksen-v1-byline__text-zfK8t\",\"byline__name\":\"hei-boksen-v1-byline__name-I5dzN\",\"bylineName\":\"hei-boksen-v1-byline__name-I5dzN\",\"byline__role\":\"hei-boksen-v1-byline__role-iWelk\",\"bylineRole\":\"hei-boksen-v1-byline__role-iWelk\",\"byline__cta\":\"hei-boksen-v1-byline__cta-GUjUH\",\"bylineCta\":\"hei-boksen-v1-byline__cta-GUjUH\"};","import { BaseElement } from '@nrk/dh-server-libs/base-element'\nimport { getElementTag } from '@nrk/dh-server-libs/get-element-tag'\nimport './components/App.module.css'\n\nconst tag = getElementTag(__APP_NAME__, __APP_VERSION__)\n\nclass AppElement extends BaseElement {\n name = tag\n\n render() {\n let hasIntersected = false\n\n const handleIntersect = (entries: IntersectionObserverEntry[]) => {\n if (!hasIntersected) {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this.sendGaEvent({\n eventAction: 'intersecting',\n eventLabel: 'Bruker har sett heiboksen',\n })\n hasIntersected = true\n }\n })\n }\n }\n\n this.sendGaEvent({ eventAction: `MOUNT:${tag}` })\n\n const emailLink = this.querySelector('a.nrk-button')\n emailLink.addEventListener('click', () => {\n this.sendGaEvent({ eventAction: 'click', eventLabel: 'send-email' })\n })\n\n const intersectionOptions = {\n root: null,\n rootMargin: '0px',\n threshold: 1.0,\n }\n\n // eslint-disable-next-line compat/compat\n const observer = new IntersectionObserver(handleIntersect, intersectionOptions)\n observer.observe(this)\n }\n}\n\nif (!customElements.get(tag)) {\n customElements.define(tag, AppElement)\n}\n"],"names":["leafPrototypes","getProto","installedChunks","installChunk","module","exports","getContextId","_coreAnalyticsPromise","BaseElement","HTMLElement","constructor","super","this","sendError","bind","sendGaEvent","connectedCallback","name","Error","setupTracker","render","coreAnalyticsTracker","Promise","resolve","window","then","m","default","coreAnalytics","tracker","create","container","parentId","metadata","location","href","ga","dataset","gaPropertyId","title","contentId","selfId","publishDate","published","async","message","event","eventCategory","JSON","parse","preloadedState","errorTracking","url","enabled","POLOPOLY_ID_REGEX","str","matches","match","length","extractPolopolyIdFromString","getElementTag","version","split","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","Object","getPrototypeOf","obj","t","value","mode","__esModule","ns","r","def","current","indexOf","getOwnPropertyNames","forEach","key","d","definition","o","defineProperty","enumerable","get","f","e","chunkId","all","keys","reduce","promises","u","miniCssF","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","p","data","ids","modules","runtime","i","j","installedChunkData","push","promise","import","race","tag","__APP_NAME__","__APP_VERSION__","AppElement","hasIntersected","eventAction","querySelector","addEventListener","eventLabel","IntersectionObserver","entries","entry","isIntersecting","root","rootMargin","threshold","observe","customElements","define"],"sourceRoot":""}