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L,wCAAyDA,2CAC7D,CAAE/H,OAAO,IAIb,MAAMgI,EAAkBrO,iBAAiBzH,SAAS6F,MAAMiQ,gBACxD,IAAIC,EAAY/V,SAASsC,cAAc,4BAClCyT,IACHA,EAAY/V,SAASc,cAAc,QACnCiV,EAAUnU,aAAa,OAAQ,eAC/B5B,SAASsC,cAAc,QAAQwD,YAAYiQ,IAE7CA,EAAUnU,aAAa,UAAWkU,EACpC,CAEA,YAAIE,GAAW,IAAAC,EACb,OAAOC,KAAKC,MAAmC,OAA9BF,EAAC3Y,KAAKuF,aAAa,aAAWoT,EAAI,KACrD,EAGGT,eAAerY,IAAIgY,IACtBK,eAAeC,OAAON,EAAKO","sources":["webpack://dh-stilbar-artikkel/./node_modules/@nrk/core-toggle/core-toggle.cjs.js","webpack://dh-stilbar-artikkel/./node_modules/balance-text/balancetext.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-server-libs/get-element-tag.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-server-libs/html.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-server-libs/src/get-element-tag.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-server-libs/src/html-tagged-template-literal.js","webpack://dh-stilbar-artikkel/webpack/bootstrap","webpack://dh-stilbar-artikkel/webpack/runtime/compat get default export","webpack://dh-stilbar-artikkel/webpack/runtime/define property getters","webpack://dh-stilbar-artikkel/webpack/runtime/global","webpack://dh-stilbar-artikkel/webpack/runtime/hasOwnProperty shorthand","webpack://dh-stilbar-artikkel/./src/components/ordforklaring/ordforklaring-tooltip.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/core-icons/core-icons.mjs","webpack://dh-stilbar-artikkel/./src/components/stilbar-artikkel.module.css?f43b","webpack://dh-stilbar-artikkel/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://dh-stilbar-artikkel/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://dh-stilbar-artikkel/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://dh-stilbar-artikkel/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-basis-common/dist/index.esm.js","webpack://dh-stilbar-artikkel/./node_modules/@nrk/dh-basis-levende-stillbilde/dist/index.esm.js","webpack://dh-stilbar-artikkel/./src/lib/levende-stillbilde.ts","webpack://dh-stilbar-artikkel/./src/client.js"],"sourcesContent":["/*! @nrk/core-toggle v4.0.3 - Copyright (c) 2017-2022 NRK */\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nvar IS_BROWSER = typeof window !== 'undefined';\nvar HAS_NAVIGATOR = IS_BROWSER && typeof window.navigator !== 'undefined';\nvar IS_ANDROID = HAS_NAVIGATOR && /(android)/i.test(navigator.userAgent); // Bad, but needed\n\nvar IS_IOS = HAS_NAVIGATOR && /iPad|iPhone|iPod/.test(String(navigator.platform));\n// Mock HTMLElement for Node\n\nif (!IS_BROWSER && !global.HTMLElement) {\n global.HTMLElement = /*#__PURE__*/function () {\n function _class() {\n _classCallCheck(this, _class);\n }\n\n return _createClass(_class);\n }();\n}\n/**\n* closest\n* @param {Element} element Element to traverse up from\n* @param {String} selector A selector to search for matching parents or element itself\n* @return {Element|null} Element which is the closest ancestor matching selector\n*/\n\nvar closest = function () {\n var proto = typeof window === 'undefined' ? {} : window.Element.prototype;\n var match = proto.matches || proto.msMatchesSelector || proto.webkitMatchesSelector;\n return proto.closest ? function (el, css) {\n return el.closest(css);\n } : function (el, css) {\n // IE jumps to shadow SVG DOM on clicking an SVG defined by .\n // If so, jump back to element and traverse real DOM\n if (el.correspondingUseElement) el = el.correspondingUseElement;\n\n for (; el; el = el.parentElement) {\n if (match.call(el, css)) return el;\n }\n\n return null;\n };\n}();\n/**\n* dispatchEvent - with infinite loop prevention\n* @param {Element} element The target object\n* @param {String} name The event name\n* @param {Object} detail Detail object (bubbles and cancelable is set to true)\n* @return {Boolean} Whether the event was canceled. Returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n*/\n\nfunction dispatchEvent(element, name) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var ignore = \"prevent_recursive_dispatch_maximum_callstack\".concat(name);\n var event;\n if (element[ignore]) return true; // We are already processing this event, so skip sending a new one\n else element[ignore] = true; // Add name to dispatching ignore\n\n if (typeof window.CustomEvent === 'function') {\n event = new window.CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: detail\n });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(name, true, true, detail);\n } // IE reports incorrect event.defaultPrevented\n // but correct return value on element.dispatchEvent\n\n\n var result = element.dispatchEvent(event);\n element[ignore] = null; // Remove name from dispatching ignore\n\n return result; // Follow W3C standard for return value\n}\n/**\n* getUUID\n* @return {String} A generated unique ID\n*/\n\nfunction getUUID() {\n return Date.now().toString(36) + Math.random().toString(36).slice(2, 5);\n}\n/**\n * toggleAttribute (Ponyfill for IE and Edge, fixes #299)\n * @link https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute\n * @param {Element} el Single DOM Element\n * @param {String} name The name of the attribute to be toggled\n * @param {Boolean} force Force attribute to be added or removed regardless of previous state\n */\n\nfunction toggleAttribute(el, name) {\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !this.hasAttribute(name);\n if (!force === el.hasAttribute(name)) el[force ? 'setAttribute' : 'removeAttribute'](name, '');\n return force;\n}\n\nvar SCROLLER = IS_BROWSER && document.createElement('div');\n\nvar CoreToggle = /*#__PURE__*/function (_HTMLElement) {\n _inherits(CoreToggle, _HTMLElement);\n\n var _super = _createSuper(CoreToggle);\n\n function CoreToggle() {\n _classCallCheck(this, CoreToggle);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(CoreToggle, [{\n key: \"connectedCallback\",\n value: function connectedCallback() {\n if (IS_IOS) document.documentElement.style.cursor = 'pointer'; // Fix iOS events for closing popups (https://stackoverflow.com/a/16006333/8819615)\n\n if (!IS_ANDROID) this.setAttribute('aria-labelledby', this.button.id = this.button.id || getUUID()); // Andriod reads only label instead of content\n\n this.value = this.button.textContent; // Set up aria-label\n\n this.setAttribute('role', 'group'); // Help Edge\n\n this.button.setAttribute('aria-expanded', this._open = !this.hidden);\n this.button.setAttribute('aria-controls', this.id = this.id || getUUID());\n document.addEventListener('keydown', this, true); // Use capture to enable checking defaultPrevented (from ESC key) in parents\n\n document.addEventListener('click', this);\n }\n }, {\n key: \"disconnectedCallback\",\n value: function disconnectedCallback() {\n this._button = null;\n document.removeEventListener('keydown', this, true);\n document.removeEventListener('click', this);\n handleAutoposition(this, true);\n }\n }, {\n key: \"attributeChangedCallback\",\n value: function attributeChangedCallback() {\n if (this._open === this.hidden) {\n // this._open comparison ensures actual change\n this.button.setAttribute('aria-expanded', this._open = !this.hidden);\n\n try {\n this.querySelector('[autofocus]').focus();\n } catch (err) {}\n\n handleAutoposition(this, this.hidden);\n dispatchEvent(this, 'toggle');\n }\n }\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n if (event.defaultPrevented) return;\n if (event.type === 'resize' || event.type === 'scroll') return this.updatePosition();\n\n if (event.type === 'keydown' && event.keyCode === 27) {\n var isButton = event.target.getAttribute && event.target.getAttribute('aria-expanded') === 'true';\n var isHiding = isButton ? event.target === this.button : closest(event.target, this.nodeName) === this;\n\n if (isHiding) {\n this.hidden = true;\n this.button.focus(); // Move focus back to button\n\n return event.preventDefault(); // Prevent closing maximized Safari and other coreToggles\n }\n }\n\n if (event.type === 'click') {\n var btn = closest(event.target, 'a,button');\n if (btn && !btn.hasAttribute('aria-expanded') && closest(event.target, this.nodeName) === this) dispatchEvent(this, 'toggle.select', btn);else if (btn && btn.getAttribute('aria-controls') === this.id) this.hidden = !this.hidden;else if (this.popup && !this.contains(event.target)) this.hidden = true; // Click in content or outside\n }\n }\n /**\n * updatePosition Exposed for _very_ niche situations, use sparingly\n * @param {HTMLElement} contentEl Reference to the core-toggle element\n */\n\n }, {\n key: \"updatePosition\",\n value: function updatePosition() {\n var _this = this;\n\n if (this._skipPosition || !this.button) return; // Avoid infinite loops for mutationObserver\n\n this._skipPosition = true;\n this.style.position = 'fixed'; // Set viewModel before reading dimensions\n\n var triggerRect = this.button.getBoundingClientRect();\n var contentRect = this.getBoundingClientRect();\n var hasSpaceRight = triggerRect.left + contentRect.width < window.innerWidth;\n var hasSpaceLeft = triggerRect.right - contentRect.width >= 0;\n var hasSpaceUnder = triggerRect.bottom + contentRect.height < window.innerHeight;\n var hasSpaceOver = triggerRect.top - contentRect.height > 0;\n var leftVal = Math.round((window.innerWidth - contentRect.width) / 2); // Center on screen\n\n if (contentRect.width > window.innerWidth) {\n leftVal = 0; // Content wider than screen. Anchor to left screen edge to show as much as possible\n } else if (hasSpaceRight) {\n leftVal = triggerRect.left; // Anchor to left side\n } else if (hasSpaceLeft) {\n leftVal = triggerRect.right - contentRect.width; // Anchor to right side\n } // Always place under when no hasSpaceOver, as no OS can scroll further up than window.scrollY = 0\n\n\n var placeUnder = hasSpaceUnder || !hasSpaceOver;\n var scroll = placeUnder ? window.pageYOffset + triggerRect.bottom + contentRect.height + 30 : 0;\n this.style.left = \"\".concat(leftVal, \"px\");\n this.style.top = \"\".concat(Math.round(placeUnder ? triggerRect.bottom : triggerRect.top - contentRect.height), \"px\");\n SCROLLER.style.cssText = \"position:absolute;padding:1px;top:\".concat(Math.round(scroll), \"px\");\n setTimeout(function () {\n return _this._skipPosition = null;\n }); // Timeout to flush event queue before we can resume acting on mutations\n }\n }, {\n key: \"button\",\n get: function get() {\n if (this._button && (this._button.getAttribute('data-for') || this._button.getAttribute('for')) === this.id) return this._button; // Speed up\n\n return (this._button = this.id && document.querySelector(\"[for=\\\"\".concat(this.id, \"\\\"],[data-for=\\\"\").concat(this.id, \"\\\"]\"))) || this.previousElementSibling;\n } // aria-haspopup triggers forms mode in JAWS, therefore store as custom attr\n\n }, {\n key: \"popup\",\n get: function get() {\n return this.getAttribute('data-popup') === 'true' || this.getAttribute('data-popup') || this.hasAttribute('data-popup');\n },\n set: function set(val) {\n this[val === false ? 'removeAttribute' : 'setAttribute']('data-popup', val);\n }\n }, {\n key: \"autoposition\",\n get: function get() {\n return this.hasAttribute('autoposition');\n },\n set: function set(val) {\n toggleAttribute(this, 'autoposition', val);\n } // Must set attribute for IE11\n\n }, {\n key: \"hidden\",\n get: function get() {\n return this.hasAttribute('hidden');\n },\n set: function set(val) {\n toggleAttribute(this, 'hidden', val);\n } // Set this.button aria-label, so that visible button text can be augmentet with intention of button\n // Example: Button text: \"01.02.2019\", aria-label: \"01.02.2019, Choose date\"\n // Does not update aria-label if not already set to something else than this.popup\n\n }, {\n key: \"value\",\n get: function get() {\n return this.button.value || this.button.textContent;\n },\n set: function set() {\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n if (!this.button || !this.popup.length) return;\n var button = this.button;\n var popup = (button.getAttribute('aria-label') || \",\".concat(this.popup)).split(',')[1];\n var label = data.textContent || data || ''; // data can be Element, Object or String\n\n if (popup === this.popup) {\n var target = button.querySelector('span') || button; // Use span to preserve embedded HTML and SVG\n\n button.value = data.value || label;\n target[data.innerHTML ? 'innerHTML' : 'textContent'] = data.innerHTML || label;\n button.setAttribute('aria-label', \"\".concat(button.textContent, \",\").concat(this.popup));\n }\n }\n }], [{\n key: \"observedAttributes\",\n get: function get() {\n return ['hidden', 'autoposition'];\n }\n }]);\n\n return CoreToggle;\n}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));\n\nfunction handleAutoposition(self, teardown) {\n if (teardown) {\n if (self._positionObserver) self._positionObserver.disconnect();\n if (SCROLLER.parentNode) SCROLLER.parentNode.removeChild(SCROLLER);\n self.style.position = self._positionObserver = null;\n window.removeEventListener('scroll', self, true); // Use capture to also listen for elements with overflow\n\n window.removeEventListener('resize', self);\n } else if (self.autoposition) {\n // Attach MutationObserver if supported\n if (!self._positionObserver) self._positionObserver = window.MutationObserver && new window.MutationObserver(self.updatePosition.bind(self));\n if (self._positionObserver) self._positionObserver.observe(self, {\n childList: true,\n subtree: true,\n attributes: true\n });\n document.body.appendChild(SCROLLER);\n window.addEventListener('scroll', self, true); // Use capture to also listen for elements with overflow\n\n window.addEventListener('resize', self);\n self.updatePosition(); // Initial trigger\n }\n}\n\nmodule.exports = CoreToggle;\n","/*\n * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License. *\n */\n/**\n * balancetext.js\n *\n * Author: Randy Edmunds\n */\n\n/* global define, module */\n\n/*\n * Copyright (c) 2007-2009 unscriptable.com and John M. Hann\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the “Software”), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n *\n * Except as contained in this notice, the name(s) of the above\n * copyright holders (unscriptable.com and John M. Hann) shall not be\n * used in advertising or otherwise to promote the sale, use or other\n * dealings in this Software without prior written authorization.\n *\n * http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/\n *\n * Tested to work on (lowest browser):\n * - Sarari 4\n * - Chrome 16\n * - Firefox 10\n * - IE 9\n * - Edge 13\n */\n\n(function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define([], factory);\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.balanceText = factory();\n }\n}(this, () => {\n /**\n * Line breaking global vars\n */\n let breakMatches, wsnwMatches, wsnwOffset;\n\n /**\n * Selectors and elements to watch;\n * calling $.balanceText(elements) adds \"elements\" to this list.\n */\n const watching = {\n sel: [], // default class to watch\n el: [],\n };\n\n /**\n * Have handlers been initialized?\n */\n let handlersInitialized = false;\n\n /**\n * Is this a polyfill?\n */\n let polyfilled = false;\n\n\n /**\n * Do nothing\n */\n function noop() { }\n\n /**\n * Loop that works with array-likes\n * @param {Array-like} elements - List of elements to run a function on\n * @param {Function} callback - The function to call on each supplied element\n */\n function forEach(elements, callback) {\n Array.prototype.forEach.call(elements, callback);\n }\n\n /**\n * Polyfill for $(document).ready()\n *\n * @param {Function} fn - The function to execute when the document is ready\n */\n function ready(fn) {\n if (document.readyState !== \"loading\") {\n fn();\n } else if (document.addEventListener) {\n document.addEventListener(\"DOMContentLoaded\", fn);\n } else {\n document.attachEvent(\"onreadystatechange\", () => {\n if (document.readyState !== \"loading\") {\n fn();\n }\n });\n }\n }\n\n /**\n * Debounces a function over a threshold\n *\n * @param {Function} func - The function to debounce\n * @param {number} threshold - time in ms\n * @param {boolean} execAsap - when true, execute immediately\n * @param args\n * @return {Function} Debounced function\n */\n function debounce(func, threshold, execAsap, ...args) {\n let timeout;\n\n return function () {\n const obj = this;\n\n function delayed() {\n if (!execAsap) {\n func.apply(obj, args);\n }\n timeout = null;\n }\n\n if (timeout) {\n clearTimeout(timeout);\n } else if (execAsap) {\n func.apply(obj, args);\n }\n timeout = setTimeout(delayed, threshold || 100);\n };\n }\n\n /**\n * Determine whether the document supports TextWrap\n * @return {boolean}\n */\n function hasTextWrap() {\n if (typeof window === \"undefined\") {\n return false;\n }\n const { style } = document.documentElement;\n return style.textWrap || style.WebkitTextWrap || style.MozTextWrap || style.MsTextWrap;\n }\n\n /**\n * Object for tracking next whitespace params\n */\n // eslint-disable-next-line camelcase\n function NextWS_params() {\n this.reset();\n }\n\n NextWS_params.prototype.reset = function () {\n this.index = 0;\n this.width = 0;\n };\n\n /**\n * Check if index is contained in previously calculated list of white-space:nowrap ranges\n *\n * @param {number} index - the index of the character to check\n * @return {boolean}\n */\n function isWhiteSpaceNoWrap(index) {\n // Is index inside 1 of the ranges?\n // start and end are breakable, but not inside range\n return wsnwMatches.some(range => (range.start < index && index < range.end));\n }\n\n /**\n * Recursively calculate white-space:nowrap offsets for line.\n *\n * @param {Node} el - the element to act on\n * @param {boolean} includeTag - include length of tag itself\n */\n function recursiveCalcNoWrapOffsetsForLine(el, includeTag) {\n if (el.nodeType === el.ELEMENT_NODE) {\n // Found an embedded tag\n const style = window.getComputedStyle(el);\n if (style.whiteSpace === \"nowrap\") {\n // Tag with white-space:nowrap - add match, skip children\n const len = el.outerHTML.length;\n wsnwMatches.push({ start: wsnwOffset, end: wsnwOffset + len });\n wsnwOffset += len;\n } else {\n // Tag without white-space:nowrap - recursively check children of tag\n forEach(el.childNodes, (child) => {\n recursiveCalcNoWrapOffsetsForLine(child, true);\n });\n if (includeTag) {\n // Length of opening tag, attributes, and closing tag\n wsnwOffset += (el.outerHTML.length - el.innerHTML.length);\n }\n }\n } else if (el.nodeType === el.COMMENT_NODE) {\n wsnwOffset += el.length + 7; // delimiter: \n } else if (el.nodeType === el.PROCESSING_INSTRUCTION_NODE) {\n wsnwOffset += el.length + 2; // delimiter: < >\n } else {\n // Text node: add length\n wsnwOffset += el.length;\n }\n }\n\n /**\n * Calculate white-space:nowrap offsets for line.\n *\n * @param {Node} el - the element to act on\n * @param {string} oldWS - \"old\" whitespace setting for temporarily resetting\n * @param {number} lineCharOffset - char offset of current line from start of text\n */\n function calcNoWrapOffsetsForLine(el, oldWS, lineCharOffset) {\n // For first line (lineCharOffset === 0), calculate start and end offsets for each\n // white-space:nowrap element in the line.\n if (lineCharOffset === 0) {\n // Reset whiteSpace setting when breakMatches is being calculated\n // so white-space:nowrap can be detected in text\n el.style.whiteSpace = oldWS;\n\n wsnwOffset = 0;\n wsnwMatches = [];\n recursiveCalcNoWrapOffsetsForLine(el, false);\n\n // Restore temporary whitespace setting to recalc width\n el.style.whiteSpace = \"nowrap\";\n } else {\n // For all other lines, update the offsets for current line\n // 1. Ignore matches less than offset\n // 2. Subtract offset from remaining matches\n const newMatches = [];\n wsnwMatches.forEach((match) => {\n if (match.start > lineCharOffset) {\n newMatches.push({ start: match.start - lineCharOffset, end: match.end - lineCharOffset });\n }\n });\n wsnwMatches = newMatches;\n }\n }\n\n /**\n * Strip balance-text tags from an element inserted in previous run\n *\n * @param {Node} el - the element to act on\n */\n function removeTags(el) {\n // Remove soft-hyphen breaks\n let brs = el.querySelectorAll('br[data-owner=\"balance-text-hyphen\"]');\n forEach(brs, (br) => {\n br.outerHTML = \"\";\n });\n\n // Replace other breaks with whitespace\n brs = el.querySelectorAll('br[data-owner=\"balance-text\"]');\n forEach(brs, (br) => {\n br.outerHTML = \" \";\n });\n\n // Restore hyphens inserted for soft-hyphens\n let spans = el.querySelectorAll('span[data-owner=\"balance-text-softhyphen\"]');\n if (spans.length > 0) {\n forEach(spans, (span) => {\n const textNode = document.createTextNode(\"\\u00ad\");\n span.parentNode.insertBefore(textNode, span);\n span.parentNode.removeChild(span);\n });\n }\n\n // Remove spans inserted for justified text\n spans = el.querySelectorAll('span[data-owner=\"balance-text-justify\"]');\n if (spans.length > 0) {\n let txt = \"\";\n forEach(spans, (span) => {\n txt += span.textContent;\n span.parentNode.removeChild(span);\n });\n el.innerHTML = txt;\n }\n }\n\n /**\n * Checks to see if we should justify the balanced text with the\n * element based on the textAlign property in the computed CSS\n *\n * @param {Node} el - element to check\n * @return {boolean}\n */\n const isJustified = function (el) {\n const style = el.currentStyle || window.getComputedStyle(el, null);\n return (style.textAlign === \"justify\");\n };\n\n /**\n * Add whitespace after words in text to justify the string to\n * the specified size.\n * @param {Node} el - the element to justify\n * @param {string} txt - text string\n * @param {number} conWidth - container width\n * @return {string} Justified text\n */\n function justify(el, txt, conWidth) {\n txt = txt.trim();\n const words = txt.split(\" \").length;\n txt = `${txt} `;\n\n // if we don't have at least 2 words, no need to justify.\n if (words < 2) {\n return txt;\n }\n\n // Find width of text in the DOM\n const tmp = document.createElement(\"span\");\n tmp.innerHTML = txt;\n el.appendChild(tmp);\n const size = tmp.offsetWidth;\n tmp.parentNode.removeChild(tmp);\n\n // Figure out our word spacing and return the element\n const wordSpacing = Math.floor((conWidth - size) / (words - 1));\n tmp.style.wordSpacing = `${wordSpacing}px`;\n tmp.setAttribute(\"data-owner\", \"balance-text-justify\");\n\n const div = document.createElement(\"div\");\n div.appendChild(tmp);\n return div.innerHTML;\n }\n\n /**\n * Returns true iff char at index is a break char outside of HTML < > tags.\n * Break char can be: whitespace (except non-breaking-space: u00a0),\n * hypen, emdash (u2014), endash (u2013), or soft-hyphen (u00ad).\n *\n * @param {string} txt - the text to check\n * @param {number} index - the index of the character to check\n * @return {boolean}\n */\n function isBreakChar(txt, index) {\n const re = /([^\\S\\u00a0]|-|\\u2014|\\u2013|\\u00ad)(?![^<]*>)/g;\n let match;\n\n if (!breakMatches) {\n // Only calc break matches once per line\n breakMatches = [];\n match = re.exec(txt);\n while (match !== null) {\n if (!isWhiteSpaceNoWrap(match.index)) {\n breakMatches.push(match.index);\n }\n match = re.exec(txt);\n }\n }\n\n return breakMatches.indexOf(index) !== -1;\n }\n\n /**\n * In the current implementation, an index is a break\n * opportunity in txt iff it is:\n * - 0 or txt.length\n * - index of a non-whitespace char immediately preceded by a\n * whitespace, hyphen, soft-hyphen, em-dash, or en-dash char.\n *\n * Thus, it doesn't honour \"white-space\" or any other Unicode\n * line-breaking classes.)\n *\n * @precondition 0 <= index && index <= txt.length\n *\n * @param {string} txt - the text to check\n * @param {number} index - the index to check\n * @return {boolean}\n */\n function isBreakOpportunity(txt, index) {\n return ((index === 0) || (index === txt.length) ||\n (isBreakChar(txt, index - 1) && !isBreakChar(txt, index)));\n }\n\n /**\n * Finds the first break opportunity (@see isBreakOpportunity)\n * in txt that's both after-or-equal-to index c in the direction dir\n * and resulting in line width equal to or past clamp(desWidth,\n * 0, conWidth) in direction dir. Sets ret.index and ret.width\n * to the corresponding index and line width (from the start of\n * txt to ret.index).\n *\n * @param {Node} el - element\n * @param {string} txt - text string\n * @param {number} conWidth - container width\n * @param {number} desWidth - desired width\n * @param {number} dir - direction (-1 or +1)\n * @param {number} c - char index (0 <= c && c <= txt.length)\n * @param {Object} ret - return {index: {number}, width: {number}} of previous/next break\n */\n function findBreakOpportunity(el, txt, conWidth, desWidth, dir, c, ret) {\n let w;\n\n if (txt && typeof txt === \"string\") {\n for (;;) {\n while (!isBreakOpportunity(txt, c)) {\n c += dir;\n }\n\n el.innerHTML = txt.substr(0, c);\n w = el.offsetWidth;\n\n if (dir < 0) {\n if ((w <= desWidth) || (w <= 0) || (c === 0)) {\n break;\n }\n } else if ((desWidth <= w) || (conWidth <= w) || (c === txt.length)) {\n break;\n }\n\n c += dir;\n }\n }\n ret.index = c;\n ret.width = w;\n }\n\n /**\n * Detects the width of a non-breaking space character, given the height of\n * the element with no-wrap applied.\n *\n * @param {Node} el - element\n * @param {number} h - height\n * @return {number}\n */\n function getSpaceWidth(el, h) {\n const container = document.createElement(\"div\");\n\n container.style.display = \"block\";\n container.style.position = \"absolute\";\n container.style.bottom = 0;\n container.style.right = 0;\n container.style.width = 0;\n container.style.height = 0;\n container.style.margin = 0;\n container.style.padding = 0;\n container.style.visibility = \"hidden\";\n container.style.overflow = \"hidden\";\n\n const space = document.createElement(\"span\");\n\n space.style.fontSize = \"2000px\";\n space.innerHTML = \" \";\n\n container.appendChild(space);\n\n el.appendChild(container);\n\n const dims = space.getBoundingClientRect();\n container.parentNode.removeChild(container);\n\n const spaceRatio = dims.height / dims.width;\n\n return (h / spaceRatio);\n }\n\n /**\n * Get a list of elements regardless of input\n *\n * @param {string|Node|Array-like} elements - The selector to query, one or more elements\n * @return {Array<{Node}>}\n */\n function getElementsList(elements) {\n if (!elements) {\n return [];\n }\n\n // is selector\n if (typeof elements === \"string\") {\n return document.querySelectorAll(elements);\n }\n\n // is single element\n if (elements.tagName && elements.querySelectorAll) {\n return [elements];\n }\n\n return elements;\n }\n\n /**\n * When a browser has native support for the text-wrap property,\n * the text balanceText plugin will let the browser handle it natively,\n * otherwise it will apply its own text balancing code.\n *\n * @param {string|Node|Array-like} elements - the list of elements to balance\n */\n function balanceText(elements) {\n forEach(getElementsList(elements), (el) => {\n // In a lower level language, this algorithm takes time\n // comparable to normal text layout other than the fact\n // that we do two passes instead of one, so we should\n // be able to do without this limit.\n const maxTextWidth = 5000;\n\n // strip balance-text generated tags\n removeTags(el);\n\n // save settings\n const oldWS = el.style.whiteSpace;\n const oldFloat = el.style.float;\n const oldDisplay = el.style.display;\n const oldPosition = el.style.position;\n const oldLH = el.style.lineHeight;\n\n // remove line height before measuring container size\n el.style.lineHeight = \"normal\";\n\n const containerWidth = el.offsetWidth;\n const containerHeight = el.offsetHeight;\n\n // temporary settings\n el.style.whiteSpace = \"nowrap\";\n el.style.float = \"none\";\n el.style.display = \"inline\";\n el.style.position = \"static\";\n\n let nowrapWidth = el.offsetWidth;\n const nowrapHeight = el.offsetHeight;\n\n // An estimate of the average line width reduction due\n // to trimming trailing space that we expect over all\n // lines other than the last.\n const spaceWidth = ((oldWS === \"pre-wrap\") ? 0 : getSpaceWidth(el, nowrapHeight));\n\n if (containerWidth > 0 && // prevent divide by zero\n nowrapWidth > containerWidth && // text is more than 1 line\n nowrapWidth < maxTextWidth) { // text is less than arbitrary limit (make this a param?)\n let remainingText = el.innerHTML;\n let newText = \"\";\n let lineText = \"\";\n const shouldJustify = isJustified(el);\n const totLines = Math.round(containerHeight / nowrapHeight);\n let remLines = totLines;\n let lineCharOffset = 0;\n\n // loop vars\n let desiredWidth, guessIndex, le, ge, splitIndex, isHyphen, isSoftHyphen;\n\n // Determine where to break:\n while (remLines > 1) {\n // clear whitespace match cache for each line\n breakMatches = null;\n\n // Must calc white-space:nowrap offsets before first call to findBreakOpportunity()\n calcNoWrapOffsetsForLine(el, oldWS, lineCharOffset);\n\n desiredWidth = Math.round((nowrapWidth + spaceWidth) / remLines - spaceWidth);\n\n // Guessed char index\n guessIndex = Math.round((remainingText.length + 1) / remLines) - 1;\n\n le = new NextWS_params();\n\n // Find a breaking space somewhere before (or equal to) desired width,\n // not necessarily the closest to the desired width.\n findBreakOpportunity(el, remainingText, containerWidth, desiredWidth, -1, guessIndex, le);\n\n // Find first breaking char after (or equal to) desired width.\n ge = new NextWS_params();\n guessIndex = le.index;\n findBreakOpportunity(el, remainingText, containerWidth, desiredWidth, +1, guessIndex, ge);\n\n // Find first breaking char before (or equal to) desired width.\n le.reset();\n guessIndex = ge.index;\n findBreakOpportunity(el, remainingText, containerWidth, desiredWidth, -1, guessIndex, le);\n\n // Find closest string to desired length\n if (le.index === 0) {\n splitIndex = ge.index;\n } else if ((containerWidth < ge.width) || (le.index === ge.index)) {\n splitIndex = le.index;\n } else {\n splitIndex = ((Math.abs(desiredWidth - le.width) < Math.abs(ge.width - desiredWidth))\n ? le.index\n : ge.index);\n }\n\n // Break string\n lineText = remainingText.substr(0, splitIndex).replace(/\\s$/, \"\");\n\n isSoftHyphen = Boolean(lineText.match(/\\u00ad$/));\n if (isSoftHyphen) {\n // Replace soft-hyphen causing break with explicit hyphen\n lineText = lineText.replace(/\\u00ad$/, '-');\n }\n\n if (shouldJustify) {\n newText += justify(el, lineText, containerWidth);\n } else {\n newText += lineText;\n isHyphen = isSoftHyphen || Boolean(lineText.match(/(-|\\u2014|\\u2013)$/));\n newText += isHyphen ? '
'\n : '
';\n }\n remainingText = remainingText.substr(splitIndex);\n lineCharOffset = splitIndex;\n\n // update counters\n remLines--;\n el.innerHTML = remainingText;\n nowrapWidth = el.offsetWidth;\n }\n\n if (shouldJustify) {\n el.innerHTML = newText + justify(el, remainingText, containerWidth);\n } else {\n el.innerHTML = newText + remainingText;\n }\n }\n\n // restore settings\n el.style.whiteSpace = oldWS;\n el.style.float = oldFloat;\n el.style.display = oldDisplay;\n el.style.position = oldPosition;\n el.style.lineHeight = oldLH;\n });\n }\n\n /**\n * Call the balanceText plugin on elements that it's watching.\n */\n function updateWatched() {\n const selectors = watching.sel.join(\",\");\n const selectedElements = getElementsList(selectors);\n const elements = Array.prototype.concat.apply(watching.el, selectedElements);\n balanceText(elements);\n }\n\n /**\n * Initialize the events for which to re-apply BalanceText. They are:\n * - Document ready\n * - Document full load\n * - Window resize\n */\n function initHandlers() {\n if (handlersInitialized) {\n return;\n }\n\n // Apply on DOM ready\n ready(updateWatched);\n\n // Reapply on full load\n window.addEventListener(\"load\", updateWatched);\n\n // Reapply on resize\n window.addEventListener(\"resize\", debounce(updateWatched));\n\n handlersInitialized = true;\n }\n\n /**\n * Apply the BalanceText routine on the document and watch the list\n * of elements. On window resize, re-apply BalanceText to the given elements\n *\n * @param {string|Node|Array-like} elements - the elements to watch after applying BalanceText\n */\n function balanceTextAndWatch(elements) {\n if (typeof elements === \"string\") {\n watching.sel.push(elements);\n } else {\n forEach(getElementsList(elements), (el) => {\n watching.el.push(el);\n });\n }\n\n initHandlers();\n updateWatched();\n }\n\n /**\n * Stop watching elements\n *\n * @param {string|Node|Array-like} elements\n */\n function unwatch(elements) {\n if (typeof elements === \"string\") {\n watching.sel = watching.sel.filter(el => el !== elements);\n } else {\n elements = getElementsList(elements);\n watching.el = watching.el.filter(el => elements.indexOf(el) === -1);\n }\n }\n\n /**\n * Treat this app as a polyfill. Watch for changes to the .balance-text selector\n */\n function polyfill() {\n if (polyfilled) {\n return;\n }\n\n watching.sel.push(\".balance-text\");\n initHandlers();\n polyfilled = true;\n }\n\n /**\n * Public interface\n *\n * @param {string|Node|Array-like} elements - elements to balance\n * @param {Object} options - processing options\n * - {boolean} watch - watch elements for resize\n */\n function publicInterface(elements, options) {\n if (!elements) {\n // empty call means polyfill (watch for changes)\n polyfill();\n } else if (options && options.watch === true) {\n balanceTextAndWatch(elements);\n } else if (options && options.watch === false) {\n unwatch(elements);\n } else {\n balanceText(elements);\n }\n }\n\n publicInterface.updateWatched = updateWatched;\n\n if (hasTextWrap()) {\n noop.updateWatched = noop;\n return noop;\n }\n return publicInterface;\n}));\n","module.exports = require('./src/get-element-tag')\n","module.exports = require('./src/html-tagged-template-literal.js')\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","/**\n * Concats a template literal and interpolates values correctly, as well as removes formatting whitespace and HTML comments\n */\nfunction html(strings, ...interpolations) {\n let str = strings[0]\n for (let i = 0; i < interpolations.length; i++) {\n str += interpolations[i]\n str += strings[i + 1]\n }\n\n return str.replace(/>\\s+<')\n}\n\nmodule.exports.html = html\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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\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__.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))","import { html } from '@nrk/dh-server-libs/html'\nimport { nrkClose } from '@nrk/core-icons'\nimport CoreToggle from '@nrk/core-toggle'\n\nexport class OrdforklaringTooltip extends HTMLElement {\n connectedCallback() {\n const childNodes = [...this.childNodes]\n const begrep = this.getAttribute('begrep') || this.innerText\n const forklaring = this.getAttribute('forklaring')\n if (!forklaring) {\n return\n }\n /* core toggle does not support shadow dom */\n const elm = document.createElement('div')\n elm.innerHTML = html`\n `\n const button = elm.querySelector('button')\n button.append(...childNodes)\n this.replaceChildren(...elm.childNodes)\n\n this.closeButton.addEventListener('click', this.handleClose)\n }\n\n handleClose = () => {\n this.toggleElement.setAttribute('hidden', '')\n }\n\n get toggleElement() {\n return this.querySelector('core-toggle')\n }\n\n get closeButton() {\n return this.querySelector('core-toggle button')\n }\n}\n\n/**\n * Patched CoreToggle\n *\n * Makes sure element is not placed outside the viewport on the left side.\n */\nexport class OrdforklaringToggle extends CoreToggle {\n updatePosition() {\n if (this._skipPosition || !this.button) return\n\n this.style.position = 'fixed'\n\n /* Fetch bounding client rects before calling super to avoid layout thrashing */\n const triggerRect = this.button.getBoundingClientRect()\n const contentRect = this.getBoundingClientRect()\n\n super.updatePosition()\n\n /* Center element under trigger button */\n const centeredLeft = triggerRect.left + triggerRect.width / 2 - contentRect.width / 2\n\n this.style.left = `0`\n this.style.left = `clamp(var(--_mobile-padding, 0px), ${centeredLeft}px, calc(${window.innerWidth}px - 300px - var(--_mobile-padding, 0px)))`\n this.style.right = `var(--_mobile-padding, 0px)`\n }\n}\n","export const nrk360 = ''\nexport const nrk404 = ''\nexport const nrkAlarmClock = ''\nexport const nrkArrangeList = ''\nexport const nrkArrowDown = ''\nexport const nrkArrowDropdown = ''\nexport const nrkArrowLeftLong = ''\nexport const nrkArrowLeft = ''\nexport const nrkArrowNested = ''\nexport const nrkArrowRightLong = ''\nexport const nrkArrowRight = ''\nexport const nrkArrowUp = ''\nexport const nrkArticle = ''\nexport const nrkBack = ''\nexport const nrkBellActive = ''\nexport const nrkBell = ''\nexport const nrkBookmarkActive = ''\nexport const nrkBookmark = ''\nexport const nrkBroadcast = ''\nexport const nrkBulletSquare = ''\nexport const nrkBulletedList = ''\nexport const nrkCalendar = ''\nexport const nrkCategoryActive = ''\nexport const nrkCategory = ''\nexport const nrkCheckActive = ''\nexport const nrkCheckRadioUnchecked = ''\nexport const nrkCheck = ''\nexport const nrkCheckboxActive = ''\nexport const nrkCheckbox = ''\nexport const nrkChevronDown = ''\nexport const nrkChevronLeft = ''\nexport const nrkChevronRight = ''\nexport const nrkChevronUp = ''\nexport const nrkClock = ''\nexport const nrkCloseActive = ''\nexport const nrkClose = ''\nexport const nrkComment = ''\nexport const nrkDialogue = ''\nexport const nrkDice1Active = ''\nexport const nrkDice1 = ''\nexport const nrkDice2Active = ''\nexport const nrkDice2 = ''\nexport const nrkDice3Active = ''\nexport const nrkDice3 = ''\nexport const nrkDice4Active = ''\nexport const nrkDice4 = ''\nexport const nrkDice5Active = ''\nexport const nrkDice5 = ''\nexport const nrkDice6Active = ''\nexport const nrkDice6 = ''\nexport const nrkDownload = ''\nexport const nrkDownloaded = ''\nexport const nrkDuration = ''\nexport const nrkEdit = ''\nexport const nrkEllipsisActive = ''\nexport const nrkEllipsis = ''\nexport const nrkFullscreenActive = ''\nexport const nrkFullscreen = ''\nexport const nrkGallery = ''\nexport const nrkGeoActive = ''\nexport const nrkGeo = ''\nexport const nrkGeopointActive = ''\nexport const nrkGeopoint = ''\nexport const nrkGlobe = ''\nexport const nrkHardwareCamera = ''\nexport const nrkHardwareComputer = ''\nexport const nrkHardwareGame = ''\nexport const nrkHardwareHeadphones = ''\nexport const nrkHardwareLaptop = ''\nexport const nrkHardwareMicrophone = ''\nexport const nrkHardwareMobile = ''\nexport const nrkHardwarePrinter = ''\nexport const nrkHardwareRadio = ''\nexport const nrkHardwareSmartSpeaker = ''\nexport const nrkHardwareSmartWatch = ''\nexport const nrkHardwareSpeaker = ''\nexport const nrkHardwareTablet = ''\nexport const nrkHardwareTv = ''\nexport const nrkHardwareWatch = ''\nexport const nrkHeartActive = ''\nexport const nrkHeart = ''\nexport const nrkHelp = ''\nexport const nrkHomeActive = ''\nexport const nrkHome = ''\nexport const nrkInfo = ''\nexport const nrkLatestNewsActive = ''\nexport const nrkLatestNews = ''\nexport const nrkLink = ''\nexport const nrkListActive = ''\nexport const nrkList = ''\nexport const nrkLockActive = ''\nexport const nrkLock = ''\nexport const nrkLogout = ''\nexport const nrkLongreadActive = ''\nexport const nrkLongread = ''\nexport const nrkLyn = ''\nexport const nrkMat = ''\nexport const nrkMedia404Notfound = ''\nexport const nrkMediaAgelimit12 = ''\nexport const nrkMediaAgelimit15 = ''\nexport const nrkMediaAgelimit18 = ''\nexport const nrkMediaAgelimit6 = ''\nexport const nrkMediaAgelimit9 = ''\nexport const nrkMediaAgelimitA = ''\nexport const nrkMediaAirplayActive = ''\nexport const nrkMediaAirplay = ''\nexport const nrkMediaBeamNote = ''\nexport const nrkMediaChromecast1 = ''\nexport const nrkMediaChromecast2 = ''\nexport const nrkMediaChromecast3 = ''\nexport const nrkMediaChromecastActive = ''\nexport const nrkMediaChromecast = ''\nexport const nrkMediaCompleted = ''\nexport const nrkMediaDirekteActive = ''\nexport const nrkMediaDirekteAnimatedActive = ''\nexport const nrkMediaDirekteGolive = ''\nexport const nrkMediaDirekteNotlive = ''\nexport const nrkMediaDirekte = ''\nexport const nrkMediaDirektetvActive = ''\nexport const nrkMediaDirektetv = ''\nexport const nrkMediaFfw15sec = ''\nexport const nrkMediaFfw30sec = ''\nexport const nrkMediaFfw5sec = ''\nexport const nrkMediaFfw = ''\nexport const nrkMediaIndexQuaverTiny = ''\nexport const nrkMediaJumpto = ''\nexport const nrkMediaMediaComplete = ''\nexport const nrkMediaMediaIncomplete = ''\nexport const nrkMediaNext = ''\nexport const nrkMediaNy = ''\nexport const nrkMediaPause = ''\nexport const nrkMediaPictureInPictureActive = ''\nexport const nrkMediaPictureInPicture = ''\nexport const nrkMediaPlayFail = ''\nexport const nrkMediaPlay = ''\nexport const nrkMediaPlaylistAddLater = ''\nexport const nrkMediaPlaylistAddNext = ''\nexport const nrkMediaPlaylistAdd = ''\nexport const nrkMediaPlaylistAdded = ''\nexport const nrkMediaPlaylistRemove = ''\nexport const nrkMediaPlaylist = ''\nexport const nrkMediaPrevious = ''\nexport const nrkMediaProgramguideActive = ''\nexport const nrkMediaProgramguide = ''\nexport const nrkMediaQuaverActive = ''\nexport const nrkMediaQuaverOff = ''\nexport const nrkMediaQuaver = ''\nexport const nrkMediaRwd15sec = ''\nexport const nrkMediaRwd30sec = ''\nexport const nrkMediaRwd5sec = ''\nexport const nrkMediaRwd = ''\nexport const nrkMediaSoundwave = ''\nexport const nrkMediaSpeed0_8x = ''\nexport const nrkMediaSpeed1_25x = ''\nexport const nrkMediaSpeed1_5x = ''\nexport const nrkMediaSpeed1x = ''\nexport const nrkMediaSpeed2x = ''\nexport const nrkMediaStop = ''\nexport const nrkMediaSubtitlesActive = ''\nexport const nrkMediaSubtitlesUnavailable = ''\nexport const nrkMediaSubtitles = ''\nexport const nrkMediaTheaterActive = ''\nexport const nrkMediaTheater = ''\nexport const nrkMediaTilgjengelighetGeoblocked = ''\nexport const nrkMediaTilgjengelighetIkkelengertilgjengelig = ''\nexport const nrkMediaTilgjengelighetKommer = ''\nexport const nrkMediaTilgjengelighetSnartutilgjengelig = ''\nexport const nrkMediaVolume1 = ''\nexport const nrkMediaVolume2 = ''\nexport const nrkMediaVolume3 = ''\nexport const nrkMediaVolumeMuted = ''\nexport const nrkMening = ''\nexport const nrkMinus = ''\nexport const nrkMoreActive = ''\nexport const nrkMore = ''\nexport const nrkNewChat = ''\nexport const nrkNote1Off = ''\nexport const nrkNote1 = ''\nexport const nrkNote2 = ''\nexport const nrkOffline = ''\nexport const nrkOpenInNew = ''\nexport const nrkPerson = ''\nexport const nrkPlus = ''\nexport const nrkPoll = ''\nexport const nrkProgress = ''\nexport const nrkQuiz = ''\nexport const nrkRefresh = ''\nexport const nrkReload = ''\nexport const nrkReorder = ''\nexport const nrkRotate = ''\nexport const nrkSearchActive = ''\nexport const nrkSearch = ''\nexport const nrkSettingsActive = ''\nexport const nrkSettings = ''\nexport const nrkSleep = ''\nexport const nrkSomeEmail = ''\nexport const nrkSomeEmbed = ''\nexport const nrkSomeFacebook = ''\nexport const nrkSomeGoogle = ''\nexport const nrkSomeInstagram = ''\nexport const nrkSomePinterest = ''\nexport const nrkSomeShareIos = ''\nexport const nrkSomeShare = ''\nexport const nrkSomeSnapchat = ''\nexport const nrkSomeTommelnedActive = ''\nexport const nrkSomeTommelned = ''\nexport const nrkSomeTommeloppActive = ''\nexport const nrkSomeTommelopp = ''\nexport const nrkSomeTwitter = ''\nexport const nrkSomeYoutube = ''\nexport const nrkSpinner = ''\nexport const nrkStarActive = ''\nexport const nrkStar = ''\nexport const nrkSuperEmojiPoopAngry = ''\nexport const nrkTilgjengelighetHorbarhet = ''\nexport const nrkTilgjengelighetLydtekst = ''\nexport const nrkTilgjengelighetSynstolking = ''\nexport const nrkTilgjengelighetTegnspraak = ''\nexport const nrkTilgjengelighet = ''\nexport const nrkTrashActive = ''\nexport const nrkTrash = ''\nexport const nrkUnlockActive = ''\nexport const nrkUnlock = ''\nexport const nrkUpload = ''\nexport const nrkUserLoggedinActive = ''\nexport const nrkUserLoggedin = ''\nexport const nrkUserNotloggedinActive = ''\nexport const nrkUserNotloggedin = ''\nexport const nrkWarning = ''","// extracted by mini-css-extract-plugin\nexport default {\"balance-text\":\"dh-sa-balance-text\",\"balanceText\":\"dh-sa-balance-text\",\"article\":\"dh-sa-article\",\"section\":\"dh-sa-section\",\"section-backdrop\":\"dh-sa-section-backdrop\",\"sectionBackdrop\":\"dh-sa-section-backdrop\",\"text\":\"dh-sa-text\",\"large-text\":\"dh-sa-large-text\",\"largeText\":\"dh-sa-large-text\",\"extra-large-text\":\"dh-sa-extra-large-text\",\"extraLargeText\":\"dh-sa-extra-large-text\"};","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _defineProperty from '@babel/runtime/helpers/defineProperty';\n\n/* eslint-disable compat/compat */\nfunction getDefaultRoot() {\n /*\n Use document if supported\n IntersectionObserver will otherwise default to top level document,\n and IntersectionObserver will not work as expected in an iframe.\n https://github.com/w3c/IntersectionObserver/issues/372\n */\n\n /*\n Safari does not throw error on root: document, but does not trigger events as expected\n returning null for now until better feature detection is possible\n */\n return null;\n\n /*\n try {\n // eslint-disable-next-line no-new\n new IntersectionObserver(() => {}, { root: document })\n return document\n } catch (e) {\n return null\n }\n */\n}\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nvar defaultConfig = {\n rootMargin: '0px 0px 0px 0px',\n threshold: [0, 0.5, 1],\n root: getDefaultRoot()\n};\nclass ElementIntersectionObserver {\n constructor(elements, onChange, config) {\n _defineProperty(this, \"intersections\", void 0);\n _defineProperty(this, \"elements\", void 0);\n this.elements = elements.slice(0);\n this.intersections = elements.map(target => ({\n target,\n isIntersecting: false,\n ratio: null\n }));\n this.intersectionObserver = new IntersectionObserver(entries => {\n var intersections = this.intersections.slice(0);\n entries.forEach(entry => {\n var idx = elements.indexOf(entry.target);\n intersections.splice(idx, 1, {\n target: entry.target,\n isIntersecting: entry.isIntersecting,\n ratio: entry.intersectionRatio\n });\n });\n this.intersections = intersections;\n onChange(this.intersections);\n }, _objectSpread(_objectSpread({}, defaultConfig), config));\n elements.forEach(elm => this.intersectionObserver.observe(elm));\n }\n disconnect() {\n // Unregister trigger elements\n this.elements.forEach(elm => this.intersectionObserver.unobserve(elm));\n\n // Disconnect intersection observer\n this.intersectionObserver.disconnect();\n }\n}\n\nfunction toggleAttribute(el, name, boolValue) {\n if (!el) {\n return;\n }\n var nextValue;\n if (typeof boolValue !== 'undefined') {\n nextValue = !!boolValue;\n } else {\n nextValue = el.hasAttribute(name);\n }\n if (nextValue) {\n el.setAttribute(name, '');\n } else {\n el.removeAttribute(name);\n }\n}\nfunction setAttribute(el, name, nextValue) {\n if (!el) {\n return;\n }\n if (nextValue) {\n el.setAttribute(name, nextValue);\n } else {\n el.removeAttribute(name);\n }\n}\nvar closest = (() => {\n var proto = typeof window === 'undefined' ? {} : window.Element.prototype;\n var match = proto.matches || proto.msMatchesSelector || proto.webkitMatchesSelector;\n if (proto.closest) {\n return (el, css) => el.closest(css);\n } else {\n return (el, css) => {\n for (; el; el = el.parentElement) if (match.call(el, css)) return el;\n return null;\n };\n }\n})();\nfunction addStyle(nodeName, css) {\n var key = \"style-\".concat(nodeName.toLowerCase());\n var min = css.replace(/\\/\\*[^!][^*]*\\*\\//g, '').replace(/\\s*(^|[:;,{}]|$)\\s*/g, '$1');\n document.getElementById(key) || document.head.insertAdjacentHTML('afterbegin', \"\"));\n}\nfunction toArray(nodeList) {\n return [].slice.call(nodeList);\n}\nfunction dispatchEvent(element, name) {\n var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var ignore = \"prevent_recursive_dispatch_maximum_callstack\".concat(name);\n var event;\n if (element[ignore]) return true;\n // We are already processing this event, so skip sending a new one\n else element[ignore] = true; // Add name to dispatching ignore\n\n if (typeof window.CustomEvent === 'function') {\n event = new window.CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail\n });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(name, true, true, detail);\n }\n // IE reports incorrect event.defaultPrevented\n // but correct return value on element.dispatchEvent\n var result = element.dispatchEvent(event);\n element[ignore] = null; // Remove name from dispatching ignore\n\n return result; // Follow W3C standard for return value\n}\n\nfunction easeOutQuint(t) {\n return 1 + --t * t * t * t * t;\n}\nclass VerticalScroll {\n constructor(container) {\n _defineProperty(this, \"container\", void 0);\n this.container = container;\n }\n cancel() {\n this._cancelled = true;\n }\n to(top) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var callback = arguments.length > 2 ? arguments[2] : undefined;\n var from = this.container.scrollTop;\n var distance = top - from;\n var startTime = null;\n var loop = currentTime => {\n if (this._cancelled) {\n return;\n }\n if (!startTime) {\n startTime = currentTime - 1;\n }\n var timeElapsed = currentTime - startTime;\n if (timeElapsed < duration) {\n this.container.scrollTop = from + distance * easeOutQuint(timeElapsed / duration);\n window.requestAnimationFrame(loop);\n } else {\n this.container.scrollTop = top;\n callback && callback();\n }\n };\n\n // eslint-disable-next-line compat/compat\n window.requestAnimationFrame(loop);\n }\n}\nclass HorizontalScroll {\n constructor(container) {\n _defineProperty(this, \"container\", void 0);\n this.container = container;\n }\n cancel() {\n this._cancelled = true;\n }\n to(left) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var callback = arguments.length > 2 ? arguments[2] : undefined;\n var from = this.container.scrollLeft;\n var distance = left - from;\n var startTime = null;\n var loop = currentTime => {\n if (this._cancelled) {\n return;\n }\n if (!startTime) {\n startTime = currentTime - 1;\n }\n var timeElapsed = currentTime - startTime;\n if (timeElapsed < duration) {\n this.container.scrollLeft = from + distance * easeOutQuint(timeElapsed / duration);\n window.requestAnimationFrame(loop);\n } else {\n this.container.scrollLeft = left;\n callback && callback();\n }\n };\n\n // eslint-disable-next-line compat/compat\n window.requestAnimationFrame(loop);\n }\n}\n\nfunction testReducedMotion() {\n if (typeof window !== 'undefined') {\n return !!window.matchMedia && window.matchMedia('(prefers-reduced-motion)').matches;\n }\n return false;\n}\n\nvar MAX_SAFE_INTEGER = 9007199254740991;\nfunction withinRange(current) {\n var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var stop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MAX_SAFE_INTEGER;\n return current >= start && current <= stop;\n}\nfunction withinStops(currentTime, stops, targetStop) {\n var nrOfStops = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n var uniqueStops = stops.filter(unique);\n var targetTime = stops[targetStop];\n var prevTime = uniqueStops[uniqueStops.indexOf(targetTime) - nrOfStops];\n var nextTime = uniqueStops[uniqueStops.indexOf(targetTime) + nrOfStops];\n return withinRange(currentTime, prevTime, nextTime);\n}\nfunction unique(value, index, self) {\n return self.indexOf(value) === index;\n}\n\n/*\n * 'loading=\"lazy\"' is defined in terms of IntersectionObserver and the initial root.\n * As a result images with 'loading=\"lazy\"' inside a scroll container will not load\n * until they at least have one pixel visible in the viewport.\n *\n * This will hopefully fixed in a future version of the spec:\n * https://github.com/w3c/IntersectionObserver/issues/431\n *\n * scroll-container-lazy-load observes images and a scroll container.\n * Once images are close to intersecting it will change 'loading=\"lazy\"' to 'loading=\"eager\"'.\n * */\nfunction loadImage(image) {\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n}\nfunction connectScrollContainerLazyLoad(container, images) {\n var containerIntersecting = false;\n var deferredImages = [];\n\n // eslint-disable-next-line compat/compat\n var containerObserver = new IntersectionObserver(entries => {\n containerIntersecting = entries === null || entries === void 0 ? void 0 : entries[0].isIntersecting;\n if (containerIntersecting) {\n deferredImages.forEach(image => loadImage(image));\n deferredImages = [];\n }\n }, {\n root: getDefaultRoot(),\n threshold: [0.0]\n });\n containerObserver.observe(container);\n\n // eslint-disable-next-line compat/compat\n var imageObserver = new IntersectionObserver(entries => {\n for (var entry of entries) {\n if (entry.isIntersecting) {\n var image = entry.target;\n imageObserver.unobserve(image);\n if (containerIntersecting) {\n loadImage(image);\n } else {\n /* Defer loading of if the container is not intersecting the viewport */\n deferredImages.push(image);\n }\n }\n }\n }, {\n root: container,\n rootMargin: '300px',\n threshold: 0.0\n });\n for (var image of images) {\n imageObserver.observe(image);\n }\n return () => {\n containerObserver.disconnect();\n imageObserver.disconnect();\n };\n}\n\nfunction debounce(fn, delay) {\n var timeout;\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n clearTimeout(timeout);\n timeout = setTimeout(() => fn(...args), delay);\n };\n}\n\nexport { ElementIntersectionObserver, HorizontalScroll, VerticalScroll, addStyle, closest, connectScrollContainerLazyLoad, debounce, dispatchEvent, setAttribute, testReducedMotion, toArray, toggleAttribute, withinRange, withinStops };\n//# sourceMappingURL=index.esm.js.map\n","import _defineProperty from '@babel/runtime/helpers/defineProperty';\nimport { dispatchEvent, testReducedMotion, toArray, toggleAttribute } from '@nrk/dh-basis-common';\n\nvar STATE_ATTR = 'data-state';\nvar VIEWPORT_POSITION_ATTR = 'data-viewport-position';\nvar DISABLE_FORCED_ATTRIBUTES_ATTR = 'disable-forced-attributes';\nvar IS_PAUSED = 'is-paused';\nvar AUTOPLAY_BLOCKED = 'autoplay-blocked';\nvar READY_STATE = {\n HAVE_NOTHING: 0,\n HAVE_METADATA: 1,\n HAVE_CURRENT_DATA: 2,\n HAVE_FUTURE_DATA: 3,\n HAVE_ENOUGH_DATA: 4 // Can play through\n};\nvar isVisible = child => !!child.offsetParent;\nclass LevendeStillbilde extends HTMLElement {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"_disconnecting\", false);\n _defineProperty(this, \"_visibleVideoElement\", void 0);\n _defineProperty(this, \"_handlePlayChange\", e => {\n if (e.type === 'play') {\n dispatchEvent(this, 'dh-basis-autoplay-succeeded');\n }\n if (e.target === this._visibleVideoElement) {\n this.isPaused = this._visibleVideoElement.paused;\n }\n });\n _defineProperty(this, \"_updatePlayState\", () => {\n if (!this._visibleVideoElement) {\n return;\n }\n if (this._shouldPlay()) {\n this._playVideo();\n } else {\n this._pauseVideo();\n }\n });\n _defineProperty(this, \"_handleResize\", () => {\n this._updateVisibleVideoElement();\n });\n }\n static get observedAttributes() {\n return [STATE_ATTR, DISABLE_FORCED_ATTRIBUTES_ATTR, VIEWPORT_POSITION_ATTR];\n }\n connectedCallback() {\n this._setVideoAttributes();\n this._setEventListeners();\n this._updateVisibleVideoElement();\n }\n disconnectedCallback() {\n this._disconnecting = true;\n this._removeEventListeners();\n }\n attributeChangedCallback(name, prevValue, newValue) {\n var valueChanged = prevValue !== newValue;\n if (name === STATE_ATTR || name === VIEWPORT_POSITION_ATTR) {\n if (valueChanged) {\n this._updateVisibleVideoElement();\n this._updatePlayState();\n if (name === VIEWPORT_POSITION_ATTR && newValue === 'IN-VIEWPORT') {\n this._preload();\n }\n }\n }\n }\n _setEventListeners() {\n window.addEventListener('resize', this._handleResize);\n this.videoElements.forEach(el => {\n el.addEventListener('pause', this._handlePlayChange);\n el.addEventListener('play', this._handlePlayChange);\n el.addEventListener('canplaythrough', this._updatePlayState);\n });\n }\n _removeEventListeners() {\n window.removeEventListener('resize', this._handleResize);\n this.videoElements.forEach(el => {\n el.removeEventListener('pause', this._handlePlayChange);\n el.removeEventListener('play', this._handlePlayChange);\n el.removeEventListener('canplaythrough', this._updatePlayState);\n });\n }\n _updateVisibleVideoElement() {\n // eslint-disable-next-line compat/compat\n requestAnimationFrame(() => {\n var nextVisibleVideo = this.videoElements.find(isVisible);\n if (nextVisibleVideo !== this._visibleVideoElement) {\n // Pause previous video\n this._pauseVideo();\n this._visibleVideoElement = nextVisibleVideo;\n if (this._shouldPreload()) {\n this._preload();\n }\n this._updatePlayState();\n }\n });\n }\n _setVideoAttributes() {\n if (!this.disableForcedAttributes) {\n this.videoElements.forEach(el => {\n el.setAttribute('playsInline', '');\n el.setAttribute('loop', '');\n el.setAttribute('disableRemotePlayback', '');\n el.setAttribute('x-webkit-airplay', 'deny');\n });\n }\n }\n _shouldPlay() {\n var _this$_visibleVideoEl;\n /*\n * Safari 14-15.5 hides poster on play, leaving a transparent element until enough data is available to play through.\n * We have to wait for the canplaythrough event and readystate = READY_STATE.HAVE_ENOUGH_DATA before calling `.play()`\n * */\n return ((_this$_visibleVideoEl = this._visibleVideoElement) === null || _this$_visibleVideoEl === void 0 ? void 0 : _this$_visibleVideoEl.readyState) >= READY_STATE.HAVE_ENOUGH_DATA && this.state === 'ACTIVE' && this.viewportPosition === 'IN-VIEWPORT';\n }\n _shouldPreload() {\n return this.viewportPosition === 'IN-VIEWPORT';\n }\n _preload() {\n var _this$_visibleVideoEl2;\n if (((_this$_visibleVideoEl2 = this._visibleVideoElement) === null || _this$_visibleVideoEl2 === void 0 ? void 0 : _this$_visibleVideoEl2.readyState) < READY_STATE.HAVE_ENOUGH_DATA) {\n var _this$_visibleVideoEl3;\n (_this$_visibleVideoEl3 = this._visibleVideoElement) === null || _this$_visibleVideoEl3 === void 0 || _this$_visibleVideoEl3.load();\n }\n }\n _playVideo() {\n dispatchEvent(this, 'dh-basis-autoplay-attempted');\n var reducedMotion = testReducedMotion();\n var videoElement = this._visibleVideoElement;\n if (videoElement.paused && !reducedMotion && !this.autoplayBlocked) {\n var playPromise = videoElement.play() || Promise.resolve();\n playPromise.catch(e => {\n console.error(e);\n this.autoplayBlocked = true;\n });\n }\n }\n _pauseVideo() {\n var videoElement = this._visibleVideoElement;\n if (videoElement && !videoElement.paused) {\n videoElement.pause();\n }\n }\n get videoElements() {\n return toArray(this.querySelectorAll('video'));\n }\n get disableForcedAttributes() {\n return this.hasAttribute(DISABLE_FORCED_ATTRIBUTES_ATTR);\n }\n get state() {\n return this.getAttribute(STATE_ATTR);\n }\n set state(val) {\n this.setAttribute(STATE_ATTR, val);\n }\n get isPaused() {\n return this.getAttribute(IS_PAUSED);\n }\n set isPaused(val) {\n if (val) {\n this.setAttribute(IS_PAUSED, '');\n } else {\n this.removeAttribute(IS_PAUSED);\n }\n }\n get autoplayBlocked() {\n return this.hasAttribute(AUTOPLAY_BLOCKED) || false;\n }\n set autoplayBlocked(val) {\n toggleAttribute(this, AUTOPLAY_BLOCKED, val);\n }\n get viewportPosition() {\n return this.getAttribute(VIEWPORT_POSITION_ATTR);\n }\n set viewportPosition(val) {\n this.setAttribute(VIEWPORT_POSITION_ATTR, val);\n }\n}\n\nexport { LevendeStillbilde as default };\n//# sourceMappingURL=index.esm.js.map\n","import LevendeStillbilde from '@nrk/dh-basis-levende-stillbilde'\nconst VIEWPORT_POSITION_ATTR = 'data-viewport-position'\n\ndeclare global {\n interface HTMLElement {\n connectedCallback(): void\n disconnectedCallback(): void\n }\n}\n\nexport class SALevendeStillbilde extends LevendeStillbilde {\n #observer\n connectedCallback() {\n super.connectedCallback()\n this.#observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const player: HTMLElement = this as any\n const elementViewportPosition = player.getAttribute(VIEWPORT_POSITION_ATTR)\n if (entry.isIntersecting && elementViewportPosition === 'OUT-OF-VIEWPORT') {\n player.setAttribute(VIEWPORT_POSITION_ATTR, 'IN-VIEWPORT')\n }\n if (!entry.isIntersecting && elementViewportPosition === 'IN-VIEWPORT') {\n player.setAttribute(VIEWPORT_POSITION_ATTR, 'OUT-OF-VIEWPORT')\n }\n }\n },\n {\n threshold: 0.5,\n },\n )\n this.#observer.observe(this)\n }\n\n disconnectedCallback() {\n this.#observer.disconnect()\n super.disconnectedCallback()\n }\n}\n","import { getElementTag } from '@nrk/dh-server-libs/get-element-tag'\nimport balanceText from 'balance-text'\nimport {\n OrdforklaringToggle,\n OrdforklaringTooltip,\n} from './components/ordforklaring/ordforklaring-tooltip.js'\nimport styles from './components/stilbar-artikkel.module.css'\nimport './components/grid.module.css'\nimport './components/logo/logo.module.css'\nimport './components/ordforklaring/ordforklaring-tooltip.module.css'\nimport './components/polopoly/overrides/article.module.css'\nimport './components/polopoly/overrides/section.module.css'\nimport './components/polopoly/overrides/email.module.css'\nimport './components/polopoly/overrides/fact.css'\nimport './components/polopoly/overrides/heiboksen.css'\nimport './components/sanity/overrides/chatlog.module.css'\nimport './components/sanity/overrides/lydlogg.module.css'\nimport './components/footer/footer.module.css'\nimport './components/pakker/bilde-og-tekstpakke.module.css'\nimport './components/pakker/tekstboks.module.css'\nimport { SALevendeStillbilde } from './lib/levende-stillbilde.ts'\n\n// import hydrate from './components/hydrate'\n\nconst tag = getElementTag(__APP_NAME__, __APP_VERSION__)\n\nfunction safeDefine(elementName, constructor) {\n if (typeof customElements.get(elementName) === 'undefined') {\n customElements.define(elementName, constructor)\n }\n}\n\nclass AppElement extends HTMLElement {\n name = tag\n\n connectedCallback() {\n safeDefine('ordforklaring-tooltip', OrdforklaringTooltip)\n safeDefine('core-toggle', OrdforklaringToggle)\n safeDefine('dhsa-levende-stillbilde', SALevendeStillbilde)\n\n // TODO: Remove polyfill once Safari supports text-wrap: balance\n // https://caniuse.com/css-text-wrap-balance\n if (!CSS.supports('text-wrap', 'balance')) {\n /*\n The following selector is a bit cryptic.\n\n 1. We exclude elements that has a parent `.disable-balance-polyfill` class,\n using `.${styles.balanceText}:not(:is(.disable-balance-polyfill .${styles.balanceText}))`\n\n (The balanceText class must be repeated for performance)\n\n 2. We exclude elements that contain manual `
` elements:\n\n Balance text fails if the element contains `
` elements it doesn't control.\n We could select all elements that does not contain `
` with this selector: `.balance-text:not(:has(br))`\n\n Unfortunately balance-text injects its own `
` elements.\n We need to exclude these: `.balance-text:not(:has(br:not([data-owner])))`\n */\n balanceText(\n `.${styles.balanceText}:not(:is(.disable-balance-polyfill .${styles.balanceText})):not(:is(:has(br:not([data-owner]))))`,\n { watch: true },\n )\n }\n\n const backgroundColor = getComputedStyle(document.body).backgroundColor\n let themeMeta = document.querySelector(\"meta[name='theme-color']\")\n if (!themeMeta) {\n themeMeta = document.createElement('meta')\n themeMeta.setAttribute('name', 'theme-color')\n document.querySelector('head').appendChild(themeMeta)\n }\n themeMeta.setAttribute('content', backgroundColor)\n }\n\n get features() {\n return JSON.parse(this.getAttribute('features') ?? '{}')\n }\n}\n\nif (!customElements.get(tag)) {\n customElements.define(tag, AppElement)\n}\n"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","bind","__proto__","_setPrototypeOf","p","_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","Function","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","has","get","set","Wrapper","this","constructor","create","value","_possibleConstructorReturn","self","ReferenceError","_assertThisInitialized","IS_BROWSER","window","HAS_NAVIGATOR","navigator","IS_ANDROID","test","userAgent","IS_IOS","String","platform","g","HTMLElement","_class","proto","match","closest","Element","matches","msMatchesSelector","webkitMatchesSelector","el","css","correspondingUseElement","parentElement","dispatchEvent","element","name","event","detail","ignore","concat","CustomEvent","bubbles","cancelable","document","createEvent","initCustomEvent","result","getUUID","Date","now","Math","random","slice","toggleAttribute","force","hasAttribute","SCROLLER","createElement","CoreToggle","_HTMLElement","subClass","superClass","_inherits","Derived","hasNativeReflectConstruct","_super","Super","NewTarget","documentElement","style","cursor","setAttribute","button","id","textContent","_open","hidden","addEventListener","_button","removeEventListener","handleAutoposition","querySelector","focus","err","defaultPrevented","type","updatePosition","keyCode","getAttribute","nodeName","preventDefault","btn","popup","contains","_this","_skipPosition","position","triggerRect","getBoundingClientRect","contentRect","hasSpaceRight","left","width","innerWidth","hasSpaceLeft","right","hasSpaceUnder","bottom","height","innerHeight","hasSpaceOver","top","leftVal","round","placeUnder","scroll","pageYOffset","cssText","setTimeout","previousElementSibling","val","data","split","label","innerHTML","teardown","_positionObserver","disconnect","parentNode","removeChild","autoposition","MutationObserver","observe","childList","subtree","attributes","body","appendChild","module","exports","breakMatches","wsnwMatches","wsnwOffset","watching","sel","handlersInitialized","polyfilled","noop","forEach","elements","callback","Array","NextWS_params","reset","isWhiteSpaceNoWrap","index","some","range","start","end","recursiveCalcNoWrapOffsetsForLine","includeTag","nodeType","ELEMENT_NODE","getComputedStyle","whiteSpace","len","outerHTML","childNodes","child","COMMENT_NODE","PROCESSING_INSTRUCTION_NODE","calcNoWrapOffsetsForLine","oldWS","lineCharOffset","newMatches","isJustified","currentStyle","textAlign","justify","txt","conWidth","words","trim","tmp","size","offsetWidth","wordSpacing","floor","div","isBreakChar","re","exec","isBreakOpportunity","findBreakOpportunity","desWidth","dir","c","ret","w","substr","getElementsList","querySelectorAll","tagName","balanceText","brs","br","spans","span","textNode","createTextNode","insertBefore","removeTags","oldFloat","float","oldDisplay","display","oldPosition","oldLH","lineHeight","containerWidth","containerHeight","offsetHeight","nowrapWidth","nowrapHeight","spaceWidth","h","container","margin","padding","visibility","overflow","space","fontSize","dims","getSpaceWidth","remainingText","newText","lineText","shouldJustify","desiredWidth","guessIndex","le","ge","splitIndex","isHyphen","isSoftHyphen","remLines","abs","replace","updateWatched","selectedElements","join","initHandlers","readyState","attachEvent","func","threshold","execAsap","timeout","obj","clearTimeout","debounce","publicInterface","options","watch","balanceTextAndWatch","filter","unwatch","textWrap","WebkitTextWrap","MozTextWrap","MsTextWrap","hasTextWrap","getElementTag","version","html","strings","interpolations","str","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","globalThis","prop","hasOwnProperty","OrdforklaringTooltip","handleClose","toggleElement","connectedCallback","begrep","innerText","forklaring","elm","_t","_","append","replaceChildren","closeButton","OrdforklaringToggle","super","centeredLeft","_typeof","Symbol","iterator","toPropertyKey","t","r","toPrimitive","Number","STATE_ATTR","VIEWPORT_POSITION_ATTR","DISABLE_FORCED_ATTRIBUTES_ATTR","IS_PAUSED","AUTOPLAY_BLOCKED","READY_STATE","isVisible","offsetParent","LevendeStillbilde","_visibleVideoElement","isPaused","paused","_shouldPlay","_playVideo","_pauseVideo","_updateVisibleVideoElement","observedAttributes","_setVideoAttributes","_setEventListeners","disconnectedCallback","_disconnecting","_removeEventListeners","attributeChangedCallback","prevValue","newValue","_updatePlayState","_preload","_handleResize","videoElements","_handlePlayChange","requestAnimationFrame","nextVisibleVideo","find","_shouldPreload","disableForcedAttributes","_this$_visibleVideoEl","state","viewportPosition","_this$_visibleVideoEl2","_this$_visibleVideoEl3","load","reducedMotion","matchMedia","videoElement","autoplayBlocked","play","Promise","resolve","catch","console","error","pause","nodeList","removeAttribute","boolValue","_observer","_classPrivateFieldLooseKey","SALevendeStillbilde","_classPrivateFieldLooseBase","IntersectionObserver","entries","entry","player","elementViewportPosition","isIntersecting","tag","__APP_NAME__","__APP_VERSION__","safeDefine","elementName","customElements","define","AppElement","CSS","supports","styles","backgroundColor","themeMeta","features","_this$getAttribute","JSON","parse"],"sourceRoot":""}