{"version":3,"file":"js/decidim_dev.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;;;;;;;;;;;;;;AC7CA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;ACJA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AAMA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAOA;AACA;AAEA;AACA;AAMA;AACA;AAgBA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACvKA;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;ACJA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AElDA;AACA;AACA;AACA;AACA","sources":["webpack://decidim-sassari/../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-core-0.27.2/app/packs/src/decidim/icon.js","webpack://decidim-sassari/../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/entrypoints/decidim_dev.js","webpack://decidim-sassari/../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/src/decidim/dev/accessibility.js","webpack://decidim-sassari/../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/entrypoints/decidim_dev.scss?2de6","webpack://decidim-sassari/../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/images/ sync ^\\.\\/.*$","webpack://decidim-sassari/webpack/bootstrap","webpack://decidim-sassari/webpack/runtime/chunk loaded","webpack://decidim-sassari/webpack/runtime/compat get default export","webpack://decidim-sassari/webpack/runtime/define property getters","webpack://decidim-sassari/webpack/runtime/hasOwnProperty shorthand","webpack://decidim-sassari/webpack/runtime/make namespace object","webpack://decidim-sassari/webpack/runtime/node module decorator","webpack://decidim-sassari/webpack/runtime/publicPath","webpack://decidim-sassari/webpack/runtime/jsonp chunk loading","webpack://decidim-sassari/webpack/before-startup","webpack://decidim-sassari/webpack/startup","webpack://decidim-sassari/webpack/after-startup"],"sourcesContent":["const DEFAULT_ATTRIBUTES = {\n role: \"img\",\n \"aria-hidden\": \"true\"\n};\n\n/**\n * Generates a Decidim icon element and returns it as a string.\n * @param {String} iconKey - the key of the icon to be generated\n * @param {Object} attributes - extra attributes to define for the icon SVG\n * @param {int} wait - number of milliseconds to wait before executing the function.\n * @private\n * @returns {Void} - Returns nothing.\n */\nexport default function icon(iconKey, attributes = {}) {\n const iconAttributes = $.extend(DEFAULT_ATTRIBUTES, attributes);\n const title = iconAttributes.title || iconAttributes.ariaLabel;\n Reflect.deleteProperty(iconAttributes, \"title\");\n\n const htmlAttributes = {\n \"class\": `icon icon--${iconKey}`\n };\n Object.keys(iconAttributes).forEach((key) => {\n // Convert the key to dash-format.\n const newKey = key.replace(/([A-Z])/g, (ucw) => `-${ucw[0].toLowerCase()}`);\n if (typeof htmlAttributes[key] === \"undefined\") {\n htmlAttributes[newKey] = iconAttributes[key];\n } else {\n htmlAttributes[newKey] = `${htmlAttributes[newKey]} ${iconAttributes[key]}`;\n }\n });\n\n const iconsPath = window.Decidim.config.get(\"icons_path\");\n const elHtml = ``;\n const $el = $(elHtml);\n if (title) {\n $el.prepend(`${title}`);\n } else {\n // This keeps accessibility audit tools happy\n $el.prepend(`${iconKey}`);\n // Force hidden if title is not defined\n htmlAttributes[\"aria-hidden\"] = \"true\";\n }\n $el.attr(htmlAttributes);\n\n return $(\"
\").append($el).html();\n}\n","// Images\nrequire.context(\"../images\", true)\n\n// CSS\nimport \"entrypoints/decidim_dev.scss\";\n\nimport \"src/decidim/dev/accessibility\";\n","import axe from \"axe-core\"\nimport icon from \"src/decidim/icon\"\n\nconst positionIndicators = () => {\n $(\".decidim-accessibility-indicator\").each((_i, el) => {\n const $indicator = $(el);\n const $target = $indicator.data(\"accessibility-target\");\n const offset = $target.offset();\n\n $indicator.css({\n top: offset.top - 30,\n left: offset.left - 30\n });\n });\n};\n\nconst moveScreenTo = ($target) => {\n // Scroll the view where the indicator is visible\n const targetTop = $target.offset().top;\n const screenHeight = $(window).height();\n const screenTop = $(window).scrollTop();\n const screenBottom = screenTop + screenHeight;\n if (targetTop < screenTop || targetTop > screenBottom) {\n $(window).scrollTop(targetTop - Math.round(screenHeight / 2));\n }\n\n // Scroll horizontally so that the element is visible (240 is the\n // accessibility sidebar width).\n const targetLeft = $target.offset().left;\n const screenWidth = $(window).width() - 240;\n const screenLeft = $(window).scrollLeft() + 240;\n const screenRight = screenLeft + screenWidth;\n if (targetLeft < screenLeft || targetLeft > screenRight) {\n $(window).scrollLeft(targetLeft - Math.round(screenWidth / 2));\n }\n};\n\nconst htmlEncode = (text) => {\n return $(\"
\").text(text).html();\n};\n\n$(() => {\n const $badge = $(`\n
\n
WAI WCAG
\n
\n
\n `);\n const $report = $('
');\n\n let resizeTimeout = null;\n $(window).on(\"resize\", () => {\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(() => {\n positionIndicators();\n }, 500);\n });\n\n $badge.on(\"click\", () => {\n $(\"body\").toggleClass(\"decidim-accessibility-report-open\");\n positionIndicators();\n });\n\n axe.run().then((results) => {\n $(\"body\").prepend($report).prepend($badge);\n\n if (results.violations.length < 1) {\n $badge.addClass(\"decidim-accessibility-success\");\n $(\".decidim-accessibility-info\", $badge).append(icon(\"check\"));\n $report.append(`\n
\n
\n No accessibility violations found\n
\n
\n `);\n return;\n }\n\n $badge.addClass(\"decidim-accessibility-violation\");\n $(\".decidim-accessibility-info\", $badge).append(icon(\"warning\")).append(`\n \n ${results.violations.length}\n \n `);\n\n results.violations.forEach((violation) => {\n const $item = $(`\n
\n
\n ${violation.id} - ${htmlEncode(violation.help)}\n
\n
\n
Impact: ${violation.impact}
\n
\n ${htmlEncode(violation.description)}\n
\n
\n Nodes:\n
\n
\n
\n `);\n const $violationNodes = $(\"\");\n $(\".decidim-accessibility-report-item-nodes\", $item).append($violationNodes);\n\n violation.nodes.forEach((node) => {\n node.target.forEach((target) => {\n // The selectors can have IDs starting with numbers which may not\n // be correctly indicated by axe. E.g. if the selector is `#123aa`,\n // axe might report it as `#\\31 23aa`. It always adds `#\\3` and a\n // space after the following number.\n const selector = target.replace(/#\\\\3([0-9]) /g, \"#$1\")\n const $target = $(selector);\n const $indicator = $(`\n
${icon(\"warning\")}
\n `);\n $indicator.data(\"accessibility-target\", $target);\n $target.data(\"accessibility-indicator\", $indicator);\n $target.attr(\"data-accessibility-violation\", true);\n $(\"body\").append($indicator);\n\n const $link = $(`${selector}`);\n $link.data(\"accessibility-target\", $target);\n\n $violationNodes.append($(\"
  • \").append($link));\n\n $indicator.on(\"click\", () => {\n clearTimeout($item.data(\"blink-timeout\"));\n clearTimeout($link.data(\"blink-timeout\"));\n\n $item.addClass(\"decidim-accessibility-report-item-blink\");\n $item.data(\"blink-timeout\", setTimeout(() => {\n $item.removeClass(\"decidim-accessibility-report-item-blink\");\n }, 1000));\n $link.addClass(\"decidim-accessibility-report-item-nodes-item-blink\");\n $link.data(\"blink-timeout\", setTimeout(() => {\n $link.removeClass(\"decidim-accessibility-report-item-nodes-item-blink\");\n }, 1000));\n });\n });\n });\n\n $(\".decidim-accessibility-report-item-nodes a\", $item).on(\"click\", (ev) => {\n ev.preventDefault();\n const $target = $(ev.target).data(\"accessibility-target\");\n const $indicator = $target.data(\"accessibility-indicator\");\n clearTimeout($indicator.data(\"blink-timeout\"));\n\n moveScreenTo($target);\n\n setTimeout(() => {\n // From base color to blink color (1s)\n $indicator.addClass(\"decidim-accessibility-indicator-blink\")\n $target.attr(\"data-accessibility-violation\", \"blink\");\n\n // From blink color to base color (1s)\n $indicator.data(\"blink-timeout\", setTimeout(() => {\n $indicator.removeClass(\"decidim-accessibility-indicator-blink\");\n $target.attr(\"data-accessibility-violation\", true);\n }, 1000));\n }, 10);\n });\n\n $report.append($item);\n });\n });\n});\n","// extracted by mini-css-extract-plugin\nexport {};","var map = {\n\t\"./decidim/decidim_dev_dummy.svg\": \"../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/images/decidim/decidim_dev_dummy.svg\",\n\t\"./decidim/gamification/badges/decidim_gamification_badges_test.svg\": \"../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_test.svg\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/images sync recursive ^\\\\.\\\\/.*$\";","// 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\tid: moduleId,\n\t\tloaded: false,\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// Flag the module as loaded\n\tmodule.loaded = true;\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","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(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__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(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__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/decidim-packs/\";","// 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\t\"decidim_dev\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkdecidim_sassari\"] = self[\"webpackChunkdecidim_sassari\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"vendors-node_modules_axe-core_axe_js\"], function() { return __webpack_require__(\"../../../root/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/decidim-dev-0.27.2/app/packs/entrypoints/decidim_dev.js\"); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":[],"sourceRoot":""}