{"version":3,"sources":["webpack:///elementQuery-9cf0bb.js","webpack:///webpack/bootstrap 9cf0bbcdd2073430a138","webpack:///./src/client/elementQuery.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","332","333","throttle","fn","threshholdMs","last","deferTimer","_len","arguments","length","args","Array","_key","now","Date","clearTimeout","setTimeout","window","nrkValgStaticSizeElements","parseSizes","queryUnparsed","split","map","size","operands","width","parseInt","sizeElement","element","requestAnimationFrame","elementWidth","clientWidth","getAttribute","filter","className","sizeElements","divs","document","querySelectorAll","handleResize","frame","cancelAnimationFrame","addEventListener","nrkValgStaticSizeElement"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,ODMMC,IACA,SAAUvB,EAAQD,EAAS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ules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 332);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 332:\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(333);\n\n\n/***/ }),\n\n/***/ 333:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/* eslint-disable no-inner-declarations */\n\nfunction throttle(fn, threshholdMs) {\n var last = void 0;\n var deferTimer = void 0;\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var now = Date.now();\n if (last && now < last + threshholdMs) {\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(undefined, args);\n }, threshholdMs);\n } else {\n last = now;\n fn.apply(undefined, args);\n }\n };\n}\n\nif (!window.nrkValgStaticSizeElements) {\n var parseSizes = function parseSizes(queryUnparsed) {\n return queryUnparsed.split(',').map(function (size) {\n var operands = size.split('=');\n return { name: operands[0], width: parseInt(operands[1], 10) };\n });\n };\n\n var sizeElement = function sizeElement(element) {\n requestAnimationFrame(function () {\n var elementWidth = element.clientWidth;\n var queryUnparsed = element.getAttribute('data-element-query') || '';\n var size = parseSizes(queryUnparsed).filter(function (size) {\n return size.width <= elementWidth;\n })[0];\n element.className = size ? size.name : '';\n });\n };\n\n var sizeElements = function sizeElements() {\n var divs = document.querySelectorAll('[data-element-query]');\n var i = void 0;\n for (i = 0; i < divs.length; ++i) {\n sizeElement(divs[i]);\n }\n };\n\n var handleResize = function handleResize() {\n if (frame) {\n cancelAnimationFrame(frame);\n }\n frame = requestAnimationFrame(sizeElements);\n };\n\n var frame = void 0;\n\n\n window.addEventListener('resize', throttle(handleResize, 50));\n window.addEventListener('orientationchange', throttle(handleResize, 50));\n window.nrkValgStaticSizeElement = sizeElement;\n window.nrkValgStaticSizeElements = sizeElements;\n}\n\n// Resize elements initially (for Kurator)\nwindow.nrkValgStaticSizeElements();\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// elementQuery-9cf0bb.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 332);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9cf0bbcdd2073430a138","/* eslint-disable no-inner-declarations */\n\nfunction throttle(fn, threshholdMs) {\n let last\n let deferTimer\n return (...args) => {\n const now = Date.now()\n if (last && now < last + threshholdMs) {\n clearTimeout(deferTimer)\n deferTimer = setTimeout(() => {\n last = now\n fn(...args)\n }, threshholdMs)\n } else {\n last = now\n fn(...args)\n }\n }\n}\n\nif (!window.nrkValgStaticSizeElements) {\n function parseSizes(queryUnparsed) {\n return queryUnparsed.split(',').map(size => {\n const operands = size.split('=')\n return {name: operands[0], width: parseInt(operands[1], 10)}\n })\n }\n\n function sizeElement(element) {\n requestAnimationFrame(() => {\n const elementWidth = element.clientWidth\n const queryUnparsed = element.getAttribute('data-element-query') || ''\n const size = parseSizes(queryUnparsed).filter(size => {\n return size.width <= elementWidth\n })[0]\n element.className = size ? size.name : ''\n })\n }\n\n function sizeElements() {\n const divs = document.querySelectorAll('[data-element-query]')\n let i\n for (i = 0; i < divs.length; ++i) {\n sizeElement(divs[i])\n }\n }\n\n let frame\n function handleResize() {\n if (frame) {\n cancelAnimationFrame(frame)\n }\n frame = requestAnimationFrame(sizeElements)\n }\n\n window.addEventListener('resize', throttle(handleResize, 50))\n window.addEventListener('orientationchange', throttle(handleResize, 50))\n window.nrkValgStaticSizeElement = sizeElement\n window.nrkValgStaticSizeElements = sizeElements\n}\n\n// Resize elements initially (for Kurator)\nwindow.nrkValgStaticSizeElements()\n\n\n\n// WEBPACK FOOTER //\n// ./src/client/elementQuery.js"],"sourceRoot":""}