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nB,EAASI,KAElC,IAAIgB,EAAqBhD,EAAoBsB,EAAEjF,EAAiBuF,GAAWvF,EAAgBuF,QAAWzB,EACtG,GAA0B,IAAvB6C,EAGF,GAAGA,EACFhB,EAASiB,KAAKD,EAAmB,QAC3B,CAGL,IAAIE,EAAUC,OAAO,KAAOnD,EAAoBiC,EAAEL,IAAUhE,KAAKtB,GAAeqF,IAE/E,MADgC,IAA7BtF,EAAgBuF,KAAgBvF,EAAgBuF,QAAWzB,GACxDwB,CAAC,IAEJuB,EAAUzF,QAAQ2F,KAAK,CAACF,EAAS,IAAIzF,SAASC,GAAasF,EAAqB3G,EAAgBuF,GAAW,CAAClE,OAChHsE,EAASiB,KAAKD,EAAmB,GAAKE,EAExC,CACD,E,gOY5CF,MAAMG,ECHI,GDGgBC,gBAAc,cCLGC,EDKQC,UCJb,IAAGD,EAAQE,MAAM,KAAK,KAAO,KAD5D,IAAoCF,E,gBDO3C,MAAMG,UAAmB/G,EAAAA,YAAY,mCACnCS,KAAOiG,EAD4B,yDAInClG,oBACE,MAAAL,MAAMK,mBAANL,MAAMK,oBAIN,EAAAJ,KAAA,MAAiB,IAAI4G,sBAClBC,IAAkB,MACjB,SAAIA,EAAc,KAAd,EAAkBC,iBACpB9G,KAAKG,YAAY,CAAE4G,YAAc,SACjC,EAAA/G,KAAA,MAAegH,aAChB,GAEH,CAAEC,UAAW,CAAC,OAEhB,EAAAjH,KAAA,MAAekH,QAAQlH,KACxB,CAEDmH,uBAAuB,MACrB,WAAAnH,KAAA,UAAgBgH,YACjB,CAEDxG,SACgBR,KAAKsC,eAEnBtC,KAAKG,YAAY,CAAE4G,YAAc,SAAQT,KAC1C,EAGEc,eAAe1C,IAAI4B,IACtBc,eAAeC,OAAOf,EAAKK,E","sources":["webpack://dh-avslort/webpack/runtime/create fake namespace object","webpack://dh-avslort/webpack/runtime/import chunk loading","webpack://dh-avslort/./node_modules/@nrk/dh-server-libs/base-element.js","webpack://dh-avslort/./node_modules/@nrk/dh-server-libs/src/base-element.js","webpack://dh-avslort/./node_modules/@nrk/dh-server-libs/src/get-context-id.js","webpack://dh-avslort/webpack/bootstrap","webpack://dh-avslort/webpack/runtime/define property getters","webpack://dh-avslort/webpack/runtime/ensure chunk","webpack://dh-avslort/webpack/runtime/get javascript chunk filename","webpack://dh-avslort/webpack/runtime/get mini-css chunk filename","webpack://dh-avslort/webpack/runtime/hasOwnProperty shorthand","webpack://dh-avslort/webpack/runtime/make namespace object","webpack://dh-avslort/webpack/runtime/publicPath","webpack://dh-avslort/./src/heiboks/client.ts","webpack://dh-avslort/./src/lib/get-element-tag.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\t344: 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","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","// 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-\" + \"376838a732d73e3f6b47\" + \".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/avslort/static/\";","import { BaseElement } from '@nrk/dh-server-libs/base-element'\nimport { getElementTag } from '../lib/get-element-tag'\n\nimport hydrate from './components/hydrate'\n\nconst tag = getElementTag(__APP_NAME__, 'heiboks', __APP_VERSION__)\n\nclass AppElement extends BaseElement {\n name = tag\n #observer\n\n connectedCallback() {\n super.connectedCallback?.()\n\n // Log views\n // eslint-disable-next-line compat/compat\n this.#observer = new IntersectionObserver(\n (intersections) => {\n if (intersections[0]?.isIntersecting) {\n this.sendGaEvent({ eventAction: `VIEW` })\n this.#observer.disconnect()\n }\n },\n { threshold: [0.99] }\n )\n this.#observer.observe(this)\n }\n\n disconnectedCallback() {\n this.#observer?.disconnect()\n }\n\n render() {\n hydrate(this, this.preloadedState)\n\n this.sendGaEvent({ eventAction: `MOUNT:${tag}` })\n }\n}\n\nif (!customElements.get(tag)) {\n customElements.define(tag, AppElement)\n}\n","export function getElementTag(name, entry, version) {\n const formattedVersion = version ? `v${version.split('.')[0]}` : ''\n return `${name}-${entry}-${formattedVersion}`\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","__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__","version","__APP_VERSION__","split","AppElement","IntersectionObserver","intersections","isIntersecting","eventAction","disconnect","threshold","observe","disconnectedCallback","customElements","define"],"sourceRoot":""}