{"version":3,"file":"theme-d343a6a4.js","sources":["../../node_modules/mburger-webcomponent/dist/mburger/js/index.js","../../node_modules/mburger-webcomponent/dist/mburger/index.js","../../node_modules/mmenu-js/dist/core/oncanvas/options.js","../../node_modules/mmenu-js/dist/core/oncanvas/configs.js","../../node_modules/mmenu-js/dist/_modules/helpers.js","../../node_modules/mmenu-js/dist/_modules/i18n.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/de.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/fa.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/nl.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/pt_br.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/ru.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/sk.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/uk.js","../../node_modules/mmenu-js/dist/core/oncanvas/translations/index.js","../../node_modules/mmenu-js/dist/_modules/dom.js","../../node_modules/mmenu-js/dist/_modules/matchmedia.js","../../node_modules/mmenu-js/dist/core/oncanvas/mmenu.oncanvas.js","../../node_modules/mmenu-js/dist/core/offcanvas/options.js","../../node_modules/mmenu-js/dist/core/offcanvas/configs.js","../../node_modules/mmenu-js/dist/core/offcanvas/mmenu.offcanvas.js","../../node_modules/mmenu-js/dist/core/scrollbugfix/options.js","../../node_modules/mmenu-js/dist/_modules/support.js","../../node_modules/mmenu-js/dist/core/scrollbugfix/mmenu.scrollbugfix.js","../../node_modules/mmenu-js/dist/core/theme/options.js","../../node_modules/mmenu-js/dist/core/theme/mmenu.theme.js","../../node_modules/mmenu-js/dist/addons/backbutton/options.js","../../node_modules/mmenu-js/dist/addons/backbutton/mmenu.backbutton.js","../../node_modules/mmenu-js/dist/addons/counters/options.js","../../node_modules/mmenu-js/dist/addons/counters/mmenu.counters.js","../../node_modules/mmenu-js/dist/addons/iconbar/options.js","../../node_modules/mmenu-js/dist/addons/iconbar/mmenu.iconbar.js","../../node_modules/mmenu-js/dist/addons/iconpanels/_options.js","../../node_modules/mmenu-js/dist/addons/iconpanels/mmenu.iconpanels.js","../../node_modules/mmenu-js/dist/addons/navbars/configs.js","../../node_modules/mmenu-js/dist/addons/navbars/options.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.breadcrumbs.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.close.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.prev.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.searchfield.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.title.js","../../node_modules/mmenu-js/dist/addons/navbars/navbar.tabs.js","../../node_modules/mmenu-js/dist/addons/navbars/mmenu.navbars.js","../../node_modules/mmenu-js/dist/addons/pagescroll/options.js","../../node_modules/mmenu-js/dist/addons/pagescroll/configs.js","../../node_modules/mmenu-js/dist/addons/pagescroll/mmenu.pagescroll.js","../../node_modules/mmenu-js/dist/addons/searchfield/options.js","../../node_modules/mmenu-js/dist/addons/searchfield/configs.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/de.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/fa.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/nl.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/pt_br.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/ru.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/sk.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/uk.js","../../node_modules/mmenu-js/dist/addons/searchfield/translations/index.js","../../node_modules/mmenu-js/dist/addons/searchfield/mmenu.searchfield.js","../../node_modules/mmenu-js/dist/addons/sectionindexer/options.js","../../node_modules/mmenu-js/dist/addons/sectionindexer/mmenu.sectionindexer.js","../../node_modules/mmenu-js/dist/addons/setselected/options.js","../../node_modules/mmenu-js/dist/addons/setselected/mmenu.setselected.js","../../node_modules/mmenu-js/dist/addons/sidebar/options.js","../../node_modules/mmenu-js/dist/addons/sidebar/mmenu.sidebar.js","../../node_modules/mmenu-js/src/mmenu.js","../../node_modules/alpinejs/dist/module.esm.js","../../node_modules/@alpinejs/persist/dist/module.esm.js","../../node_modules/@glidejs/glide/dist/glide.esm.js","../../modules/block/b--banner-cases/B__BannerCases.js","../../node_modules/sister/src/sister.js","../../node_modules/ms/index.js","../../node_modules/debug/src/common.js","../../node_modules/debug/src/browser.js","../../node_modules/youtube-player/dist/constants/PlayerStates.js","../../node_modules/youtube-player/dist/FunctionStateMap.js","../../node_modules/youtube-player/dist/eventNames.js","../../node_modules/youtube-player/dist/functionNames.js","../../node_modules/youtube-player/dist/YouTubePlayer.js","../../node_modules/load-script/index.js","../../node_modules/youtube-player/dist/loadYouTubeIframeApi.js","../../node_modules/youtube-player/dist/index.js","../../modules/block/b--hero/B__Hero.js","../../modules/block/b--banner-testimonials/B__BannerTestimonials.js","../../node_modules/mixitup/dist/mixitup.js","../../modules/block/b--cards-titles-mixitup/B__CardsTitlesMixItUp.js","../../modules/block/alpine.load.js","../../modules/component/c--card-person/C__CardPerson.js","../../modules/component/alpine.load.js","../../modules/page/alpine.load.js","../../modules/general/g--spinner/directive.js","../../modules/general/alpine.load.js","../../assets/js/theme.js"],"sourcesContent":["var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _instances, _barsNode, _menuNode, _menuObserver, _offClick, _offKeyup, _disconnectMenu;\nconst on = (el, ev, cb) => {\n el.addEventListener(ev, cb);\n return () => {\n el.removeEventListener(ev, cb);\n };\n};\nexport default class extends HTMLElement {\n constructor(template) {\n super();\n _instances.add(this);\n /** Node for the hamburger bars. */\n _barsNode.set(this, void 0);\n /** Node for the menu. */\n _menuNode.set(this, void 0);\n /** Observer for the menu node. */\n _menuObserver.set(this, null);\n /** Function to remove click even listener for the hamburber. */\n _offClick.set(this, null);\n /** Function to remove keyUp even listener for the hamburber. */\n _offKeyup.set(this, null);\n //\tAttach shadowRoot\n this.attachShadow({ mode: 'open' });\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n __classPrivateFieldSet(this, _barsNode, this.shadowRoot.querySelector('[part=\"bars\"]'), \"f\");\n }\n static get observedAttributes() {\n return ['menu'];\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (name == 'menu') {\n if (oldValue) {\n __classPrivateFieldGet(this, _instances, \"m\", _disconnectMenu).call(this);\n }\n /** Node for the new menu. */\n const menuNode = document.querySelector(`#mm-${newValue}`) ||\n document.querySelector(`#${newValue}`);\n if (!menuNode) {\n return;\n }\n __classPrivateFieldSet(this, _menuNode, menuNode, \"f\");\n // for mmenu.js\n if (menuNode.matches('.mm-menu')) {\n this.connectMenu('class', () => __classPrivateFieldGet(this, _menuNode, \"f\").classList.contains('mm-menu--opened'), () => __classPrivateFieldGet(this, _menuNode, \"f\")['mmApi'].open(), () => __classPrivateFieldGet(this, _menuNode, \"f\")['mmApi'].close());\n }\n // for mmenu-light\n else if (menuNode.matches('.mm')) {\n this.connectMenu('class', () => __classPrivateFieldGet(this, _menuNode, \"f\").classList.contains('mm--open'), () => __classPrivateFieldGet(this, _menuNode, \"f\").classList.add('mm--open'), () => __classPrivateFieldGet(this, _menuNode, \"f\").classList.remove('mm--open'));\n }\n }\n }\n connectedCallback() {\n const menu = this.getAttribute('menu');\n if (menu) {\n // To ensure all JS was fired, a requestAnimationFrame on DOMContentLoaded...\n document.addEventListener('DOMContentLoaded', () => {\n requestAnimationFrame(() => {\n this.attributeChangedCallback('menu', '', menu);\n });\n });\n }\n }\n disconnectedCallback() {\n __classPrivateFieldGet(this, _instances, \"m\", _disconnectMenu).call(this);\n }\n /**\n * Set the icons state.\n * @param {string} state The state to set, either \"cross\" or \"bars\".\n */\n set state(state) {\n __classPrivateFieldGet(this, _barsNode, \"f\").classList[state === 'cross' ? 'add' : 'remove']('is-cross');\n }\n /**\n * Get the icons tate.\n * @returns {string} The state of the icon, can be \"cross\" or \"bars\".\n */\n get state() {\n return __classPrivateFieldGet(this, _barsNode, \"f\").matches('.is-cross') ? 'cross' : 'bars';\n }\n /**\n * Connect the hamburger to a menu\n * @param {string} attribute The attribute to observe.\n * @param {Function} isOpen Function to test whether or not the menu is opened.\n * @param {Function} open Function that opens the menu.\n * @param {Function} close Function that closes the menu.\n */\n connectMenu(attribute, isOpen, open, close) {\n if (!__classPrivateFieldGet(this, _menuNode, \"f\")) {\n return;\n }\n // Remove previous.\n __classPrivateFieldGet(this, _instances, \"m\", _disconnectMenu).call(this);\n /** Set the state for the hamburber. */\n const setState = () => {\n this.state = isOpen() ? 'cross' : 'bars';\n };\n /** Toggle menu open / close */\n const toggle = () => {\n if (this.state === 'bars') {\n open();\n }\n else {\n close();\n }\n };\n // Create new observer.\n __classPrivateFieldSet(this, _menuObserver, new MutationObserver(mutationsList => {\n for (const mutation of mutationsList) {\n if (mutation.attributeName === attribute) {\n setState();\n }\n }\n }), \"f\");\n // Observe menu.\n __classPrivateFieldGet(this, _menuObserver, \"f\").observe(__classPrivateFieldGet(this, _menuNode, \"f\"), {\n attributes: true\n });\n // Immediately check menu.\n setState();\n // Click / Enter the hamburber.\n __classPrivateFieldSet(this, _offClick, on(this, 'click', toggle), \"f\");\n __classPrivateFieldSet(this, _offKeyup, on(this, 'keyup', (event) => {\n if (event.key === 'Enter') {\n toggle();\n }\n }), \"f\");\n }\n}\n_barsNode = new WeakMap(), _menuNode = new WeakMap(), _menuObserver = new WeakMap(), _offClick = new WeakMap(), _offKeyup = new WeakMap(), _instances = new WeakSet(), _disconnectMenu = function _disconnectMenu() {\n var _a, _b, _c;\n // Disconnect previous observer.\n (_a = __classPrivateFieldGet(this, _menuObserver, \"f\")) === null || _a === void 0 ? void 0 : _a.disconnect();\n // Remove previous event listener.\n (_b = __classPrivateFieldGet(this, _offClick, \"f\")) === null || _b === void 0 ? void 0 : _b.call(this);\n (_c = __classPrivateFieldGet(this, _offKeyup, \"f\")) === null || _c === void 0 ? void 0 : _c.call(this);\n};\n","/*\n * mburger webcomponent\n * mmenujs.com/mburger\n *\n * Copyright (c) Fred Heusschen\n * frebsite.nl\n *\n * License: CC-BY-4.0\n * http://creativecommons.org/licenses/by/4.0/\n */\nimport WebComponent from './js/index.js';\nconst webcomponentName = 'mm-burger';\nconst template = document.createElement('template');\ntemplate.innerHTML = `\n \n \n \n \n \n\n\n\n`;\ncustomElements.define(webcomponentName, class extends WebComponent {\n constructor() {\n super(template);\n }\n});\n","const options = {\n hooks: {},\n navbar: {\n add: true,\n title: 'Menu',\n titleLink: 'parent'\n },\n slidingSubmenus: true\n};\nexport default options;\n","const configs = {\n classNames: {\n divider: 'Divider',\n nolistview: 'NoListview',\n nopanel: 'NoPanel',\n panel: 'Panel',\n selected: 'Selected',\n vertical: 'Vertical'\n },\n language: null,\n panelNodetype: ['ul', 'ol', 'div'],\n screenReader: {\n closeSubmenu: 'Close submenu',\n openSubmenu: 'Open submenu',\n toggleSubmenu: 'Toggle submenu'\n }\n};\nexport default configs;\n","/**\n * Deep extend an object with the given defaults.\n * Note that the extended object is not a clone, meaning the original object will also be updated.\n *\n * @param \t{object}\torignl\tThe object to extend to.\n * @param \t{object}\tdfault\tThe object to extend from.\n * @return\t{object}\t\t\tThe extended \"orignl\" object.\n */\nexport const extend = (orignl, dfault) => {\n if (type(orignl) != 'object') {\n orignl = {};\n }\n if (type(dfault) != 'object') {\n dfault = {};\n }\n for (let k in dfault) {\n if (!dfault.hasOwnProperty(k)) {\n continue;\n }\n if (typeof orignl[k] == 'undefined') {\n orignl[k] = dfault[k];\n }\n else if (type(orignl[k]) == 'object') {\n extend(orignl[k], dfault[k]);\n }\n }\n return orignl;\n};\n/**\n * Detect the touch / dragging direction on a touch device.\n *\n * @param {HTMLElement} surface The element to monitor for touch events.\n * @return {object} Object with \"get\" function.\n */\nexport const touchDirection = (surface) => {\n let direction = '';\n let prevPosition = null;\n surface.addEventListener('touchstart', (evnt) => {\n if (evnt.touches.length === 1) {\n direction = '';\n prevPosition = evnt.touches[0].pageY;\n }\n });\n surface.addEventListener('touchend', (evnt) => {\n if (evnt.touches.length === 0) {\n direction = '';\n prevPosition = null;\n }\n });\n surface.addEventListener('touchmove', (evnt) => {\n direction = '';\n if (prevPosition &&\n evnt.touches.length === 1) {\n const currentPosition = evnt.changedTouches[0].pageY;\n if (currentPosition > prevPosition) {\n direction = 'down';\n }\n else if (currentPosition < prevPosition) {\n direction = 'up';\n }\n prevPosition = currentPosition;\n }\n });\n return {\n get: () => direction,\n };\n};\n/**\n * Get the type of any given variable. Improvement of \"typeof\".\n *\n * @param \t{any}\t\tvariable\tThe variable.\n * @return\t{string}\t\t\t\tThe type of the variable in lowercase.\n */\nexport const type = (variable) => {\n return {}.toString\n .call(variable)\n .match(/\\s([a-zA-Z]+)/)[1]\n .toLowerCase();\n};\n/**\n * Get a (page wide) unique ID.\n */\nexport const uniqueId = () => {\n return `mm-${__id++}`;\n};\nlet __id = 0;\n/**\n * Get a prefixed ID from a possibly orifinal ID.\n * @param id The possibly original ID.\n */\nexport const cloneId = (id) => {\n if (id.slice(0, 9) == 'mm-clone-') {\n return id;\n }\n return `mm-clone-${id}`;\n};\n/**\n * Get the original ID from a possibly prefixed ID.\n * @param id The possibly prefixed ID.\n */\nexport const originalId = (id) => {\n if (id.slice(0, 9) == 'mm-clone-') {\n return id.slice(9);\n }\n return id;\n};\n","import { extend } from './helpers';\nconst translations = {};\n/**\n * Show all translations.\n * @return {object}\tThe translations.\n */\nexport const show = () => {\n return translations;\n};\n/**\n * Add translations to a language.\n * @param {object} text Object of key/value translations.\n * @param {string} language The translated language.\n */\nexport const add = (text, language) => {\n if (typeof translations[language] === 'undefined') {\n translations[language] = {};\n }\n extend(translations[language], text);\n};\n/**\n * Find a translated text in a language.\n * @param {string} text The text to find the translation for.\n * @param {string} language The language to search in.\n * @return {string} The translated text.\n */\nexport const get = (text, language) => {\n if (typeof language === 'string' &&\n typeof translations[language] !== 'undefined') {\n return translations[language][text] || text;\n }\n return text;\n};\n","export default {\n 'Close submenu': 'Untermenü schließen',\n 'Menu': 'Menü',\n 'Open submenu': 'Untermenü öffnen',\n 'Toggle submenu': 'Untermenü wechseln'\n};\n","export default {\n 'Close submenu': 'بستن زیرمنو',\n 'Menu': 'منو',\n 'Open submenu': 'بازکردن زیرمنو',\n 'Toggle submenu': 'سوییچ زیرمنو'\n};\n","export default {\n 'Close submenu': 'Submenu sluiten',\n 'Menu': 'Menu',\n 'Open submenu': 'Submenu openen',\n 'Toggle submenu': 'Submenu wisselen'\n};\n","export default {\n 'Close submenu': 'Fechar submenu',\n 'Menu': 'Menu',\n 'Open submenu': 'Abrir submenu',\n 'Toggle submenu': 'Alternar submenu'\n};\n","export default {\n 'Close submenu': 'Закрыть подменю',\n 'Menu': 'Меню',\n 'Open submenu': 'Открыть подменю',\n 'Toggle submenu': 'Переключить подменю'\n};\n","export default {\n 'Close submenu': 'Zatvoriť submenu',\n 'Menu': 'Menu',\n 'Open submenu': 'Otvoriť submenu',\n 'Toggle submenu': 'Prepnúť submenu'\n};\n","export default {\n 'Close submenu': 'Закрити підменю',\n 'Menu': 'Меню',\n 'Open submenu': 'Відкрити підменю',\n 'Toggle submenu': 'Перемкнути підменю'\n};\n","import { add } from '../../../_modules/i18n';\nimport de from './de';\nimport fa from './fa';\nimport nl from './nl';\nimport pt_br from './pt_br';\nimport ru from './ru';\nimport sk from './sk';\nimport uk from './uk';\nexport default function () {\n add(de, 'de');\n add(fa, 'fa');\n add(nl, 'nl');\n add(pt_br, 'pt_br');\n add(ru, 'ru');\n add(sk, 'sk');\n add(uk, 'uk');\n}\n","/**\n * Create an element with classname.\n *\n * @param \t{string}\t\tselector\tThe nodeName and classnames for the element to create.\n * @return\t{HTMLElement}\t\t\t\tThe created element.\n */\nexport const create = (selector) => {\n const args = selector.split('.'), elem = document.createElement(args.shift());\n elem.classList.add(...args);\n return elem;\n};\n/**\n * Find all elements matching the selector.\n * Basically the same as element.querySelectorAll() but it returns an actuall array.\n *\n * @param \t{HTMLElement} \telement Element to search in.\n * @param \t{string}\t\tfilter\tThe filter to match.\n * @return\t{array}\t\t\t\t\tArray of elements that match the filter.\n */\nexport const find = (element, filter) => {\n return filter.length ? [].slice.call(element.querySelectorAll(filter)) : [];\n};\n/**\n * Find all child elements matching the (optional) selector.\n *\n * @param \t{HTMLElement} \telement Element to search in.\n * @param \t{string}\t\tfilter\tThe filter to match.\n * @return\t{array}\t\t\t\t\tArray of child elements that match the filter.\n */\nexport const children = (element, filter) => {\n const children = Array.prototype.slice.call(element.children);\n return filter\n ? children.filter((child) => child.matches(filter))\n : children;\n};\n/**\n * Find all text from direct child element.\n *\n * @param \t{HTMLElement} \telement Element to search in.\n * @return\t{string}\t\t\t\tThe text.\n */\nexport const childText = (element) => {\n return element\n ? [].slice.call(element.childNodes)\n .filter(node => node.nodeType === Node.TEXT_NODE)\n .map(node => node.nodeValue.trim())\n .join(' ')\n : '';\n};\n/**\n * Find text excluding text from within child elements.\n * @param {HTMLElement} element Element to search in.\n * @return {string} The text.\n */\nexport const text = (element) => {\n return [].slice.call(element.childNodes)\n .filter((child) => !child.ariaHidden)\n .map((child) => child.textContent)\n .join(' ');\n};\n/**\n * Find all preceding elements matching the selector.\n *\n * @param \t{HTMLElement} \telement Element to start searching from.\n * @param \t{string}\t\tfilter\tThe filter to match.\n * @return\t{array}\t\t\t\t\tArray of preceding elements that match the selector.\n */\nexport const parents = (element, filter) => {\n /** Array of preceding elements that match the selector. */\n let parents = [];\n /** Array of preceding elements that match the selector. */\n let parent = element.parentElement;\n while (parent) {\n parents.push(parent);\n parent = parent.parentElement;\n }\n return filter\n ? parents.filter((parent) => parent.matches(filter))\n : parents;\n};\n/**\n * Find all previous siblings matching the selecotr.\n *\n * @param \t{HTMLElement} \telement Element to start searching from.\n * @param \t{string}\t\tfilter\tThe filter to match.\n * @return\t{array}\t\t\t\t\tArray of previous siblings that match the selector.\n */\nexport const prevAll = (element, filter) => {\n /** Array of previous siblings that match the selector. */\n let previous = [];\n /** Current element in the loop */\n let current = element.previousElementSibling;\n while (current) {\n if (!filter || current.matches(filter)) {\n previous.push(current);\n }\n current = current.previousElementSibling;\n }\n return previous;\n};\n/**\n * Get an element offset relative to the document.\n *\n * @param \t{HTMLElement}\t element \t\t\tElement to start measuring from.\n * @param \t{string}\t\t [direction=top] \tOffset top or left.\n * @return\t{number}\t\t\t\t\t\t\tThe element offset relative to the document.\n */\nexport const offset = (element, direction) => {\n return (element.getBoundingClientRect()[direction] +\n document.body[direction === 'left' ? 'scrollLeft' : 'scrollTop']);\n};\n/**\n * Filter out non-listitem listitems.\n * @param {array} listitems \tElements to filter.\n * @return {array}\t\t\t\tThe filtered set of listitems.\n */\nexport const filterLI = (listitems) => {\n return listitems.filter((listitem) => !listitem.matches('.mm-hidden'));\n};\n/**\n * Find anchors in listitems (excluding anchor that open a sub-panel).\n * @param {array} \tlistitems \tElements to filter.\n * @return {array}\t\t\t\tThe found set of anchors.\n */\nexport const filterLIA = (listitems) => {\n let anchors = [];\n filterLI(listitems).forEach((listitem) => {\n anchors.push(...children(listitem, 'a.mm-listitem__text'));\n });\n return anchors.filter((anchor) => !anchor.matches('.mm-btn--next'));\n};\n/**\n * Refactor a classname on multiple elements.\n * @param {HTMLElement} element \tElement to refactor.\n * @param {string}\t\toldClass \tClassname to remove.\n * @param {string}\t\tnewClass \tClassname to add.\n */\nexport const reClass = (element, oldClass, newClass) => {\n if (element.matches('.' + oldClass)) {\n element.classList.add(newClass);\n }\n};\n","/** Collection of callback functions for media querys. */\nlet listeners = {};\n/**\n * Bind functions to a matchMedia listener (subscriber).\n *\n * @param {string|number} \tquery \tMedia query to match or number for min-width.\n * @param {function} \t\tyes \tFunction to invoke when the media query matches.\n * @param {function} \t\tno \t\tFunction to invoke when the media query doesn't match.\n */\nexport const add = (query, yes, no) => {\n if (typeof query == 'number') {\n query = '(min-width: ' + query + 'px)';\n }\n listeners[query] = listeners[query] || [];\n listeners[query].push({ yes, no });\n};\n/**\n * Initialize the matchMedia listener.\n */\nexport const watch = () => {\n for (let query in listeners) {\n let mqlist = window.matchMedia(query);\n fire(query, mqlist);\n mqlist.onchange = (evnt) => {\n fire(query, mqlist);\n };\n }\n};\n/**\n * Invoke the \"yes\" or \"no\" function for a matchMedia listener (publisher).\n *\n * @param {string} \t\t\tquery \tMedia query to check for.\n * @param {MediaQueryList} \tmqlist \tMedia query list to check with.\n */\nexport const fire = (query, mqlist) => {\n var fn = mqlist.matches ? 'yes' : 'no';\n for (let m = 0; m < listeners[query].length; m++) {\n listeners[query][m][fn]();\n }\n};\n","var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n};\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n};\nvar _panelObserver, _listviewObserver, _listitemObserver;\nimport OPTIONS from './options';\nimport CONFIGS from './configs';\nimport translate from './translations';\nimport * as DOM from '../../_modules/dom';\nimport * as i18n from '../../_modules/i18n';\nimport * as media from '../../_modules/matchmedia';\nimport { extend, type, uniqueId, } from '../../_modules/helpers';\n// Add the translations.\ntranslate();\n/**\n * Class for a mobile menu.\n */\nexport default class Mmenu {\n /**\n * Create a mobile menu.\n * @param {HTMLElement|string} \tmenu\t\tThe menu node.\n * @param {object} \t\t\t\t[option]\tOptions for the menu.\n * @param {object} \t\t\t\t[configs]\tConfiguration options for the menu.\n */\n constructor(menu, options, configs) {\n /** MutationObserver for adding a listview to a panel. */\n _panelObserver.set(this, void 0);\n /** MutationObserver for adding a listitem to a listview. */\n _listviewObserver.set(this, void 0);\n /** MutationObserver for adding a listview to a listitem. */\n _listitemObserver.set(this, void 0);\n //\tExtend options and configuration from defaults.\n this.opts = extend(options, OPTIONS);\n this.conf = extend(configs, CONFIGS);\n //\tMethods to expose in the API.\n this._api = [\n 'i18n',\n 'bind',\n 'openPanel',\n 'closePanel',\n 'setSelected',\n ];\n //\tStorage objects for nodes and hooks.\n this.node = {};\n this.hook = {};\n //\tGet menu node from string or element.\n this.node.menu =\n typeof menu == 'string' ? document.querySelector(menu) : menu;\n if (typeof this._deprecatedWarnings == 'function') {\n this._deprecatedWarnings();\n }\n this.trigger('init:before');\n this._initObservers();\n this._initAddons();\n this._initHooks();\n this._initAPI();\n this._initMenu();\n this._initPanels();\n this._initOpened();\n media.watch();\n this.trigger('init:after');\n return this;\n }\n /**\n * Open a panel.\n * @param {HTMLElement} panel Panel to open.\n * @param {boolean} [animation=true] Whether or not to use an animation.\n * @param {boolean} [setfocus=true] Whether or not to set focus to the panel.\n */\n openPanel(panel, animation = true, setfocus = true) {\n //\tFind panel.\n if (!panel) {\n return;\n }\n panel = panel.closest('.mm-panel');\n //\tInvoke \"before\" hook.\n this.trigger('openPanel:before', [panel, {\n animation,\n setfocus\n }]);\n /** Wrapping listitem (for a vertical panel) */\n const listitem = panel.closest('.mm-listitem--vertical');\n //\tOpen a \"vertical\" panel.\n if (listitem) {\n listitem.classList.add('mm-listitem--opened');\n /** The parent panel */\n const parent = listitem.closest('.mm-panel');\n this.openPanel(parent);\n //\tOpen a \"horizontal\" panel.\n }\n else {\n /** Currently opened panel. */\n const current = DOM.children(this.node.pnls, '.mm-panel--opened')[0];\n // Ensure current panel stays on top while closing it.\n if (panel.matches('.mm-panel--parent') && current) {\n current.classList.add('mm-panel--highest');\n }\n // Remove opened, parent, animation and highest classes from all panels.\n const remove = ['mm-panel--opened', 'mm-panel--parent'];\n const add = [];\n if (animation) {\n remove.push('mm-panel--noanimation');\n }\n else {\n add.push('mm-panel--noanimation');\n }\n DOM.children(this.node.pnls, '.mm-panel').forEach(pnl => {\n pnl.classList.add(...add);\n pnl.classList.remove(...remove);\n if (pnl !== current) {\n pnl.classList.remove('mm-panel--highest');\n }\n // Set inert attribute.\n if (pnl === panel) {\n pnl.removeAttribute('inert');\n }\n else {\n pnl.setAttribute('inert', 'true');\n }\n });\n // Open new panel.\n panel.classList.add('mm-panel--opened');\n /** The parent panel */\n let parent = DOM.find(this.node.pnls, `#${panel.dataset.mmParent}`)[0];\n //\tSet parent panels as \"parent\".\n while (parent) {\n parent = parent.closest('.mm-panel');\n parent.classList.add('mm-panel--parent');\n parent = DOM.find(this.node.pnls, `#${parent.dataset.mmParent}`)[0];\n }\n }\n //\tInvoke \"after\" hook.\n this.trigger('openPanel:after', [panel, {\n animation,\n setfocus\n }]);\n }\n /**\n * Close a panel.\n * @param {HTMLElement} panel Panel to close.\n * @param {boolean} [animation=true] Whether or not to use an animation.\n * @param {boolean} [setfocus=true] Whether or not to set focus to the panel.\n */\n closePanel(panel, animation = true, setfocus = true) {\n if (!panel) {\n return;\n }\n if (!panel.matches('.mm-panel--opened') &&\n !panel.parentElement.matches('.mm-listitem--opened')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('closePanel:before', [panel]);\n //\tClose a \"vertical\" panel.\n if (panel.parentElement.matches('.mm-listitem--vertical')) {\n panel.parentElement.classList.remove('mm-listitem--opened');\n // Close a \"horizontal\" panel...\n }\n else {\n // ... open its parent...\n if (panel.dataset.mmParent) {\n const parent = DOM.find(this.node.pnls, `#${panel.dataset.mmParent}`)[0];\n this.openPanel(parent, animation, setfocus);\n // ... or the last opened\n }\n else {\n const lastPanel = DOM.children(this.node.pnls, '.mm-panel--parent').pop();\n if (lastPanel && lastPanel !== panel) {\n this.openPanel(lastPanel, animation, setfocus);\n // ... or the first panel.\n }\n else {\n const firstPanel = DOM.children(this.node.pnls, '.mm-panel')[0];\n if (firstPanel && firstPanel !== panel) {\n this.openPanel(firstPanel, animation, setfocus);\n }\n }\n }\n }\n //\tInvoke \"after\" hook.\n this.trigger('closePanel:after', [panel]);\n }\n /**\n * Toggle a panel opened/closed.\n * @param {HTMLElement} panel Panel to open or close.\n */\n togglePanel(panel) {\n const listitem = panel.parentElement;\n /** The function to invoke (open or close). */\n let fn = 'openPanel';\n //\tToggle only works for \"vertical\" panels.\n if (listitem.matches('.mm-listitem--opened') ||\n panel.matches('.mm-panel--opened')) {\n fn = 'closePanel';\n }\n this[fn](panel);\n }\n /**\n * Display a listitem as being \"selected\".\n * @param {HTMLElement} listitem Listitem to mark.\n */\n setSelected(listitem) {\n //\tInvoke \"before\" hook.\n this.trigger('setSelected:before', [listitem]);\n //\tRemove the selected class from all listitems.\n DOM.find(this.node.menu, '.mm-listitem--selected').forEach((li) => {\n li.classList.remove('mm-listitem--selected');\n });\n //\tAdd the selected class to the provided listitem.\n listitem.classList.add('mm-listitem--selected');\n //\tInvoke \"after\" hook.\n this.trigger('setSelected:after', [listitem]);\n }\n /**\n * Bind functions to a hook (subscriber).\n * @param {string} \t\thook The hook.\n * @param {function} \tfunc The function.\n */\n bind(hook, func) {\n //\tCreate an array for the hook if it does not yet excist.\n this.hook[hook] = this.hook[hook] || [];\n //\tPush the function to the array.\n this.hook[hook].push(func);\n }\n /**\n * Invoke the functions bound to a hook (publisher).\n * @param {string} \thook \tThe hook.\n * @param {array}\t[args] \tArguments for the function.\n */\n trigger(hook, args) {\n if (this.hook[hook]) {\n for (var h = 0, l = this.hook[hook].length; h < l; h++) {\n this.hook[hook][h].apply(this, args);\n }\n }\n }\n /**\n * Create the observers.\n */\n _initObservers() {\n __classPrivateFieldSet(this, _panelObserver, new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.addedNodes.forEach((listview) => {\n if (listview.matches(this.conf.panelNodetype.join(', '))) {\n this._initListview(listview);\n }\n });\n });\n }));\n __classPrivateFieldSet(this, _listviewObserver, new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.addedNodes.forEach((listitem) => {\n this._initListitem(listitem);\n });\n });\n }));\n __classPrivateFieldSet(this, _listitemObserver, new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n mutation.addedNodes.forEach((subpanel) => {\n if (subpanel === null || subpanel === void 0 ? void 0 : subpanel.matches(this.conf.panelNodetype.join(', '))) {\n this._initSubPanel(subpanel);\n }\n });\n });\n }));\n }\n /**\n * Create the API.\n */\n _initAPI() {\n //\tWe need this=that because:\n //\t1) the \"arguments\" object can not be referenced in an arrow function in ES3 and ES5.\n const that = this;\n this.API = {};\n this._api.forEach((fn) => {\n this.API[fn] = function () {\n return that[fn].apply(that, arguments); // 1)\n };\n });\n //\tStore the API in the HTML node for external usage.\n this.node.menu['mmApi'] = this.API;\n }\n /**\n * Bind the hooks specified in the options (publisher).\n */\n _initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }\n /**\n * Initialize all available add-ons.\n */\n _initAddons() {\n //\tInvoke \"before\" hook.\n this.trigger('initAddons:before');\n for (let addon in Mmenu.addons) {\n Mmenu.addons[addon].call(this);\n }\n //\tInvoke \"after\" hook.\n this.trigger('initAddons:after');\n }\n /**\n * Initialize the menu.\n */\n _initMenu() {\n //\tInvoke \"before\" hook.\n this.trigger('initMenu:before');\n //\tAdd class to the wrapper.\n this.node.wrpr = this.node.wrpr || this.node.menu.parentElement;\n this.node.wrpr.classList.add('mm-wrapper');\n //\tAdd class to the menu.\n this.node.menu.classList.add('mm-menu');\n //\tAdd an ID to the menu if it does not yet have one.\n this.node.menu.id = this.node.menu.id || uniqueId();\n this.node.menu.setAttribute('aria-label', this.i18n(this.opts.navbar.title || 'Menu'));\n this.node.menu.setAttribute('aria-modal', 'true');\n this.node.menu.setAttribute('role', 'dialog');\n /** All panel nodes in the menu. */\n const panels = DOM.children(this.node.menu).filter((panel) => panel.matches(this.conf.panelNodetype.join(', ')));\n //\tWrap the panels in a node.\n this.node.pnls = DOM.create('div.mm-panels');\n this.node.menu.append(this.node.pnls);\n // Initiate all panel like nodes\n panels.forEach((panel) => {\n this._initPanel(panel);\n });\n //\tInvoke \"after\" hook.\n this.trigger('initMenu:after');\n }\n /**\n * Initialize panels.\n */\n _initPanels() {\n //\tInvoke \"before\" hook.\n this.trigger('initPanels:before');\n //\tOpen / close panels.\n this.node.menu.addEventListener('click', event => {\n var _a, _b;\n /** The href attribute for the clicked anchor. */\n const href = ((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('a[href]')) === null || _b === void 0 ? void 0 : _b.getAttribute('href')) || '';\n if (href.slice(0, 1) === '#') {\n try {\n /** The targeted panel */\n const panel = DOM.find(this.node.menu, href)[0];\n if (panel) {\n event.preventDefault();\n this.togglePanel(panel);\n }\n }\n catch (err) { }\n }\n }, {\n // useCapture to ensure the logical order.\n capture: true\n });\n //\tInvoke \"after\" hook.\n this.trigger('initPanels:after');\n }\n /**\n * Initialize a single panel.\n * @param {HTMLElement} \t\tpanel \tPanel to initialize.\n * @return {HTMLElement|null} \t\t\tInitialized panel.\n */\n _initPanel(panel) {\n var _a;\n if (panel.matches('.mm-panel')) {\n return;\n }\n //\tRefactor panel classnames\n DOM.reClass(panel, this.conf.classNames.panel, 'mm-panel');\n DOM.reClass(panel, this.conf.classNames.nopanel, 'mm-nopanel');\n //\tStop if not supposed to be a panel.\n if (panel.matches('.mm-nopanel')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('initPanel:before', [panel]);\n // Must have an ID\n panel.id = panel.id || uniqueId();\n //\tWrap UL/OL in DIV\n if (panel.matches('ul, ol')) {\n /** The panel. */\n const wrapper = DOM.create('div');\n // Transport the ID\n wrapper.id = panel.id;\n panel.removeAttribute('id');\n // Transport \"mm-\" prefixed classnames.\n [].slice\n .call(panel.classList)\n .filter((classname) => classname.slice(0, 3) === 'mm-')\n .forEach((classname) => {\n wrapper.classList.add(classname);\n panel.classList.remove(classname);\n });\n // Transport \"mm\" prefixed data attributes.\n Object.keys(panel.dataset)\n .filter((attr) => attr.slice(0, 2) === 'mm')\n .forEach(attr => {\n wrapper.dataset[attr] = panel.dataset[attr];\n delete panel.dataset[attr];\n });\n //\tWrap the listview in the panel.\n panel.before(wrapper);\n wrapper.append(panel);\n panel = wrapper;\n }\n panel.classList.add('mm-panel');\n // Append to the panels node if not vertically expanding\n if (!((_a = panel.parentElement) === null || _a === void 0 ? void 0 : _a.matches('.mm-listitem--vertical'))) {\n this.node.pnls.append(panel);\n }\n // Initialize tha navbar.\n this._initNavbar(panel);\n // Initialize the listview(s).\n DOM.children(panel, 'ul, ol').forEach((listview) => {\n this._initListview(listview);\n });\n // Observe the panel for added listviews.\n __classPrivateFieldGet(this, _panelObserver).observe(panel, {\n childList: true,\n });\n //\tInvoke \"after\" hook.\n this.trigger('initPanel:after', [panel]);\n return panel;\n }\n /**\n * Initialize a navbar.\n * @param {HTMLElement} panel Panel for the navbar.\n */\n _initNavbar(panel) {\n //\tOnly one navbar per panel.\n if (DOM.children(panel, '.mm-navbar').length) {\n return;\n }\n /** The parent listitem. */\n let parentListitem = null;\n /** The parent panel. */\n let parentPanel = null;\n // The parent listitem and parent panel\n if (panel.dataset.mmParent) {\n parentListitem = DOM.find(this.node.pnls, `#${panel.dataset.mmParent}`)[0];\n parentPanel = parentListitem.closest('.mm-panel');\n while (parentPanel.closest('.mm-listitem--vertical')) {\n parentPanel = parentPanel.parentElement.closest('.mm-panel');\n }\n }\n // No navbar needed for vertical submenus.\n if (parentListitem === null || parentListitem === void 0 ? void 0 : parentListitem.matches('.mm-listitem--vertical')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('initNavbar:before', [panel]);\n /** The navbar element. */\n const navbar = DOM.create('div.mm-navbar');\n // Hide navbar if specified in options.\n if (!this.opts.navbar.add) {\n navbar.classList.add('mm-hidden');\n }\n // Add the back button.\n if (parentPanel) {\n /** The back button. */\n const prev = DOM.create('a.mm-btn.mm-btn--prev.mm-navbar__btn');\n prev.href = `#${parentPanel.id}`;\n prev.setAttribute('aria-label', this.i18n(this.conf.screenReader.closeSubmenu));\n navbar.append(prev);\n }\n /** The anchor that opens the panel. */\n let opener = null;\n // The anchor is in a listitem.\n if (parentListitem) {\n opener = DOM.children(parentListitem, '.mm-listitem__text')[0];\n }\n // The anchor is in a panel.\n else if (parentPanel) {\n opener = DOM.find(parentPanel, 'a[href=\"#' + panel.id + '\"]')[0];\n }\n // Add the title.\n /** The title */\n const title = DOM.create('a.mm-navbar__title');\n title.tabIndex = -1;\n title.setAttribute('aria-hidden', 'true');\n switch (this.opts.navbar.titleLink) {\n case 'anchor':\n if (opener) {\n title.href = opener.getAttribute('href');\n }\n break;\n case 'parent':\n if (parentPanel) {\n title.href = `#${parentPanel.id}`;\n }\n break;\n }\n /** Text in the title */\n const titleText = DOM.create('span');\n titleText.innerHTML =\n panel.dataset.mmTitle ||\n DOM.childText(opener) ||\n this.i18n(this.opts.navbar.title || 'Menu');\n // Add to DOM\n panel.prepend(navbar);\n navbar.append(title);\n title.append(titleText);\n //\tInvoke \"after\" hook.\n this.trigger('initNavbar:after', [panel]);\n }\n /**\n * Initialize a listview.\n * @param {HTMLElement} listview Listview to initialize.\n */\n _initListview(listview) {\n // Assert UL\n if (!['htmlulistelement', 'htmlolistelement'].includes(type(listview))) {\n return;\n }\n if (listview.matches('.mm-listview')) {\n return;\n }\n DOM.reClass(listview, this.conf.classNames.nolistview, 'mm-nolistview');\n if (listview.matches('.mm-nolistview')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('initListview:before', [listview]);\n listview.classList.add('mm-listview');\n // Initiate the listitem(s).\n DOM.children(listview).forEach((listitem) => {\n this._initListitem(listitem);\n });\n // Observe the listview for added listitems.\n __classPrivateFieldGet(this, _listviewObserver).observe(listview, {\n childList: true,\n });\n //\tInvoke \"after\" hook.\n this.trigger('initListview:after', [listview]);\n }\n /**\n * Initialte a listitem.\n * @param {HTMLElement} listitem Listitem to initiate.\n */\n _initListitem(listitem) {\n // Assert LI\n if (!['htmllielement'].includes(type(listitem))) {\n return;\n }\n if (listitem.matches('.mm-listitem')) {\n return;\n }\n DOM.reClass(listitem, this.conf.classNames.divider, 'mm-divider');\n if (listitem.matches('.mm-divider')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('initListitem:before', [listitem]);\n listitem.classList.add('mm-listitem');\n DOM.reClass(listitem, this.conf.classNames.selected, 'mm-listitem--selected');\n DOM.children(listitem, 'a, span').forEach((text) => {\n text.classList.add('mm-listitem__text');\n });\n // Initiate the subpanel.\n DOM.children(listitem, this.conf.panelNodetype.join(', ')).forEach((subpanel) => {\n this._initSubPanel(subpanel);\n });\n // Observe the listitem for added listviews.\n __classPrivateFieldGet(this, _listitemObserver).observe(listitem, {\n childList: true,\n });\n //\tInvoke \"after\" hook.\n this.trigger('initListitem:after', [listitem]);\n }\n /**\n * Initiate a subpanel.\n * @param {HTMLElement} subpanel Subpanel to initiate.\n */\n _initSubPanel(subpanel) {\n if (subpanel.matches('.mm-panel')) {\n return;\n }\n /** The parent element for the panel. */\n const listitem = subpanel.parentElement;\n /** Whether or not the listitem expands vertically */\n const vertical = subpanel.matches('.' + this.conf.classNames.vertical) ||\n !this.opts.slidingSubmenus;\n // Make it expand vertically\n if (vertical) {\n listitem.classList.add('mm-listitem--vertical');\n }\n // Force an ID\n listitem.id = listitem.id || uniqueId();\n subpanel.id = subpanel.id || uniqueId();\n // Store parent/child relation\n listitem.dataset.mmChild = subpanel.id;\n subpanel.dataset.mmParent = listitem.id;\n /** The open link. */\n let button = DOM.children(listitem, '.mm-btn')[0];\n // Init item text\n if (!button) {\n button = DOM.create('a.mm-btn.mm-btn--next.mm-listitem__btn');\n DOM.children(listitem, 'a, span').forEach((text) => {\n // If the item has no link,\n // Replace the item with the open link.\n if (text.matches('span')) {\n button.classList.add('mm-listitem__text');\n button.innerHTML = text.innerHTML;\n listitem.insertBefore(button, text.nextElementSibling);\n text.remove();\n }\n // Otherwise, insert the button after the text.\n else {\n listitem.insertBefore(button, text.nextElementSibling);\n }\n });\n button.setAttribute('aria-label', this.i18n(this.conf.screenReader[listitem.matches('.mm-listitem--vertical')\n ? 'toggleSubmenu'\n : 'openSubmenu']));\n }\n button.href = `#${subpanel.id}`;\n this._initPanel(subpanel);\n }\n /**\n * Find and open the correct panel after creating the menu.\n */\n _initOpened() {\n //\tInvoke \"before\" hook.\n this.trigger('initOpened:before');\n /** The selected listitem(s). */\n const listitem = DOM.find(this.node.pnls, '.mm-listitem--selected').pop();\n /**\tThe current opened panel. */\n let panel = DOM.children(this.node.pnls, '.mm-panel')[0];\n if (listitem) {\n this.setSelected(listitem);\n panel = listitem.closest('.mm-panel');\n }\n //\tOpen the current opened panel.\n this.openPanel(panel, false, false);\n //\tInvoke \"after\" hook.\n this.trigger('initOpened:after');\n }\n /**\n * Get the translation for a text.\n * @param {string} text \tText to translate.\n * @return {string}\t\t The translated text.\n */\n i18n(text) {\n return i18n.get(text, this.conf.language);\n }\n /**\n * Get all translations for the given language.\n * @return {object}\tThe translations.\n */\n static i18n(text = {}, language = '') {\n if (text && language) {\n i18n.add(text, language);\n }\n else {\n return i18n.show();\n }\n }\n}\n_panelObserver = new WeakMap(), _listviewObserver = new WeakMap(), _listitemObserver = new WeakMap();\n/**\tAvailable add-ons for the plugin. */\nMmenu.addons = {};\n/**\tGlobally used HTML elements. */\nMmenu.node = {};\n/** Globally used v. */\nMmenu.vars = {};\n","const options = {\n use: true,\n position: 'left'\n};\nexport default options;\n","const configs = {\n clone: false,\n menu: {\n insertMethod: 'append',\n insertSelector: 'body'\n },\n page: {\n nodetype: 'div',\n selector: null,\n noSelector: []\n },\n screenReader: {\n closeMenu: 'Close menu',\n openMenu: 'Open menu',\n }\n};\nexport default configs;\n","import Mmenu from './../oncanvas/mmenu.oncanvas';\nimport OPTIONS from './options';\nimport CONFIGS from './configs';\nimport * as DOM from '../../_modules/dom';\nimport { extend, uniqueId, cloneId, originalId, } from '../../_modules/helpers';\nconst possiblePositions = [\n 'left',\n 'left-front',\n 'right',\n 'right-front',\n 'top',\n 'bottom'\n];\nexport default function () {\n this.opts.offCanvas = this.opts.offCanvas || {};\n this.conf.offCanvas = this.conf.offCanvas || {};\n //\tExtend options.\n const options = extend(this.opts.offCanvas, OPTIONS);\n const configs = extend(this.conf.offCanvas, CONFIGS);\n if (!options.use) {\n return;\n }\n if (!possiblePositions.includes(options.position)) {\n options.position = possiblePositions[0];\n }\n //\tAdd methods to the API.\n this._api.push('open', 'close', 'setPage', 'position');\n // Clone menu and prepend it to the .\n this.bind('initMenu:before', () => {\n //\tClone if needed.\n if (configs.clone) {\n //\tClone the original menu and store it.\n this.node.menu = this.node.menu.cloneNode(true);\n //\tPrefix all ID's in the cloned menu.\n if (this.node.menu.id) {\n this.node.menu.id = cloneId(this.node.menu.id);\n }\n DOM.find(this.node.menu, '[id]').forEach((elem) => {\n elem.id = cloneId(elem.id);\n });\n }\n this.node.wrpr = document.querySelector(configs.menu.insertSelector);\n //\tPrepend to the \n this.node.wrpr[configs.menu.insertMethod](this.node.menu);\n });\n //\tSetup the UI blocker.\n if (!Mmenu.node.blck) {\n this.bind('initMenu:before', () => {\n /** The UI blocker node. */\n const blocker = DOM.create('a.mm-wrapper__blocker.mm-blocker.mm-slideout');\n blocker.id = uniqueId();\n blocker.setAttribute('aria-label', this.i18n(configs.screenReader.closeMenu));\n blocker.setAttribute('inert', 'true');\n //\tAppend the blocker node to the body.\n document.querySelector(configs.menu.insertSelector).append(blocker);\n //\tStore the blocker node.\n Mmenu.node.blck = blocker;\n });\n }\n this.bind('initMenu:after', () => {\n //\tSetup the page.\n this.setPage(Mmenu.node.page);\n //\tSetup the menu.\n this.node.menu.classList.add('mm-menu--offcanvas');\n this.node.menu.setAttribute('inert', 'true');\n if (possiblePositions.includes(options.position)) {\n this.node.wrpr.classList.add(`mm-wrapper--position-${options.position}`);\n this.node.menu.classList.add(`mm-menu--position-${options.position}`);\n }\n //\tOpen if url hash equals menu id (usefull when user clicks the hamburger icon before the menu is created)\n let hash = window.location.hash;\n if (hash) {\n let id = originalId(this.node.menu.id);\n if (id && id == hash.slice(1)) {\n setTimeout(() => {\n this.open();\n }, 1000);\n }\n }\n });\n //\tOpen / close the menu.\n document.addEventListener('click', event => {\n var _a;\n /** THe href attribute for the clicked anchor. */\n const href = (_a = event.target.closest('a')) === null || _a === void 0 ? void 0 : _a.getAttribute('href');\n switch (href) {\n //\tOpen menu if the clicked anchor links to the menu.\n case `#${originalId(this.node.menu.id)}`:\n event.preventDefault();\n this.open();\n break;\n //\tClose menu if the clicked anchor links to the page.\n case `#${originalId(Mmenu.node.page.id)}`:\n event.preventDefault();\n this.close();\n break;\n }\n });\n //\tClose the menu with ESC key.\n document.addEventListener('keyup', (event) => {\n if (event.key == 'Escape') {\n this.close();\n }\n });\n}\n/**\n * Open the menu.\n */\nMmenu.prototype.open = function () {\n if (this.node.menu.matches('.mm-menu--opened')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('open:before');\n //\tOpen\n this.node.wrpr.classList.add('mm-wrapper--opened', `mm-wrapper--position-${this.opts.offCanvas.position}`);\n this.node.menu.classList.add('mm-menu--opened');\n this.node.menu.removeAttribute('inert');\n Mmenu.node.blck.removeAttribute('inert');\n Mmenu.node.page.setAttribute('inert', 'true');\n // Store the last focesed element.\n this.node.open = document.activeElement;\n //\tInvoke \"after\" hook.\n this.trigger('open:after');\n};\n/**\n * Close the menu.\n */\nMmenu.prototype.close = function () {\n var _a;\n if (!this.node.menu.matches('.mm-menu--opened')) {\n return;\n }\n //\tInvoke \"before\" hook.\n this.trigger('close:before');\n this.node.wrpr.classList.remove('mm-wrapper--opened', `mm-wrapper--position-${this.opts.offCanvas.position}`);\n this.node.menu.classList.remove('mm-menu--opened');\n this.node.menu.setAttribute('inert', 'true');\n Mmenu.node.blck.setAttribute('inert', 'true');\n Mmenu.node.page.removeAttribute('inert');\n /** Element to focus. */\n const focus = this.node.open || document.querySelector(`[href=\"#${this.node.menu.id}\"]`) || null;\n (_a = focus) === null || _a === void 0 ? void 0 : _a.focus();\n // Prevent html/body from scrolling due to focus.\n document.body.scrollLeft = 0;\n document.documentElement.scrollLeft = 0;\n //\tInvoke \"after\" hook.\n this.trigger('close:after');\n};\n/**\n * Set the \"page\" node.\n *\n * @param {HTMLElement} page Element to set as the page.\n */\nMmenu.prototype.setPage = function (page) {\n /** Offcanvas config */\n const configs = this.conf.offCanvas;\n //\tIf no page was specified, find it.\n if (!page) {\n /** Array of elements that are / could be \"the page\". */\n let pages = typeof configs.page.selector == 'string'\n ? DOM.find(document.body, configs.page.selector)\n : DOM.children(document.body, configs.page.nodetype);\n //\tFilter out elements that are absolutely not \"the page\".\n pages = pages.filter((page) => !page.matches('.mm-menu, .mm-wrapper__blocker'));\n //\tFilter out elements that are configured to not be \"the page\".\n if (configs.page.noSelector.length) {\n pages = pages.filter((page) => !page.matches(configs.page.noSelector.join(', ')));\n }\n //\tWrap multiple pages in a single element.\n if (pages.length > 1) {\n let wrapper = DOM.create('div');\n pages[0].before(wrapper);\n pages.forEach((page) => {\n wrapper.append(page);\n });\n pages = [wrapper];\n }\n page = pages[0];\n }\n //\tInvoke \"before\" hook.\n this.trigger('setPage:before', [page]);\n // Set the classes\n page.classList.add('mm-page', 'mm-slideout');\n // Set the ID.\n page.id = page.id || uniqueId();\n //\tSync the blocker to target the page.\n Mmenu.node.blck.setAttribute('href', `#${page.id}`);\n //\tStore the page node.\n Mmenu.node.page = page;\n //\tInvoke \"after\" hook.\n this.trigger('setPage:after', [page]);\n};\n","const options = {\n fix: true\n};\nexport default options;\n","/** Whether or not touch gestures are supported by the browser. */\nexport const touch = 'ontouchstart' in window ||\n (navigator.msMaxTouchPoints ? true : false) ||\n false;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport * as support from '../../_modules/support';\nimport { extend, touchDirection } from '../../_modules/helpers';\nexport default function () {\n //\tThe scrollBugFix add-on fixes a scrolling bug\n //\t\t1) on touch devices\n //\t\t2) in an off-canvas menu\n if (!support.touch || // 1\n !this.opts.offCanvas.use // 2\n ) {\n return;\n }\n this.opts.scrollBugFix = this.opts.scrollBugFix || {};\n //\tExtend options.\n const options = extend(this.opts.scrollBugFix, OPTIONS);\n if (!options.fix) {\n return;\n }\n /** The touch-direction instance. */\n const touchDir = touchDirection(this.node.menu);\n // Prevent the page from scrolling when scrolling in the menu.\n this.node.menu.addEventListener('scroll', evnt => {\n evnt.preventDefault();\n evnt.stopPropagation();\n }, {\n // Make sure to tell the browser the event will be prevented.\n passive: false,\n });\n // Prevent the page from scrolling when dragging in the menu.\n this.node.menu.addEventListener('touchmove', evnt => {\n let wrapper = evnt.target.closest('.mm-panel, .mm-iconbar__top, .mm-iconbar__bottom');\n if (wrapper && wrapper.closest('.mm-listitem--vertical')) {\n wrapper = DOM.parents(wrapper, '.mm-panel').pop();\n }\n if (wrapper) {\n // When dragging a non-scrollable panel/iconbar,\n // we can simply stopPropagation.\n if (wrapper.scrollHeight === wrapper.offsetHeight) {\n evnt.stopPropagation();\n }\n // When dragging a scrollable panel/iconbar,\n // that is fully scrolled up (or down).\n // It will not trigger the scroll event when dragging down (or up) (because you can't scroll up (or down)),\n // so we need to match the dragging direction with the scroll position before preventDefault and stopPropagation,\n // otherwise the panel would not scroll at all in any direction.\n else if (\n // When scrolled up and dragging down\n (wrapper.scrollTop == 0 && touchDir.get() == 'down') ||\n // When scrolled down and dragging up\n (wrapper.scrollHeight ==\n wrapper.scrollTop + wrapper.offsetHeight &&\n touchDir.get() == 'up')) {\n evnt.stopPropagation();\n }\n // When dragging anything other than a panel/iconbar.\n }\n else {\n evnt.stopPropagation();\n }\n }, {\n // Make sure to tell the browser the event can be prevented.\n passive: false,\n });\n // Some small additional improvements\n //\tScroll the current opened panel to the top when opening the menu.\n this.bind('open:after', () => {\n var panel = DOM.children(this.node.pnls, '.mm-panel--opened')[0];\n if (panel) {\n panel.scrollTop = 0;\n }\n });\n //\tFix issue after device rotation change.\n window.addEventListener('orientationchange', (evnt) => {\n var panel = DOM.children(this.node.pnls, '.mm-panel--opened')[0];\n if (panel) {\n panel.scrollTop = 0;\n //\tApparently, changing the overflow-scrolling property triggers some event :)\n panel.style['-webkit-overflow-scrolling'] = 'auto';\n panel.style['-webkit-overflow-scrolling'] = 'touch';\n }\n });\n}\n","const options = 'light';\nexport default options;\n","import Mmenu from '../../core/oncanvas/mmenu.oncanvas';\nimport OPTIONS from './options';\n/** A list of available themes. */\nconst possibleThemes = [\n 'light',\n 'dark',\n 'white',\n 'black',\n 'light-contrast',\n 'dark-contrast',\n 'white-contrast',\n 'black-contrast'\n];\nexport default function () {\n this.opts.theme = this.opts.theme || OPTIONS;\n const theme = this.opts.theme;\n if (!possibleThemes.includes(theme)) {\n this.opts.theme = possibleThemes[0];\n }\n this._api.push('theme');\n this.bind('initMenu:after', () => {\n this.theme(this.opts.theme);\n });\n}\n/**\n * Get or set the theme for the menu.\n *\n * @param {string} [position] The theme for the menu.\n */\nMmenu.prototype.theme = function (theme = null) {\n /** The previously used theme */\n const oldTheme = this.opts.theme;\n if (theme) {\n if (possibleThemes.includes(theme)) {\n this.node.menu.classList.remove(`mm-menu--theme-${oldTheme}`);\n this.node.menu.classList.add(`mm-menu--theme-${theme}`);\n this.opts.theme = theme;\n }\n }\n else {\n return oldTheme;\n }\n};\n","const options = {\n close: false,\n open: false\n};\nexport default options;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.backButton = this.opts.backButton || {};\n if (!this.opts.offCanvas.use) {\n return;\n }\n //\tExtend options.\n const options = extend(this.opts.backButton, OPTIONS);\n const _menu = `#${this.node.menu.id}`;\n //\tClose menu\n if (options.close) {\n var states = [];\n const setStates = () => {\n states = [_menu];\n DOM.children(this.node.pnls, '.mm-panel--opened, .mm-panel--parent').forEach((panel) => {\n states.push('#' + panel.id);\n });\n };\n this.bind('open:after', () => {\n history.pushState(null, document.title, _menu);\n });\n this.bind('open:after', setStates);\n this.bind('openPanel:after', setStates);\n this.bind('close:after', () => {\n states = [];\n history.back();\n history.pushState(null, document.title, location.pathname + location.search);\n });\n window.addEventListener('popstate', (evnt) => {\n if (this.node.menu.matches('.mm-menu--opened')) {\n if (states.length) {\n states = states.slice(0, -1);\n var hash = states[states.length - 1];\n if (hash == _menu) {\n this.close();\n }\n else {\n this.openPanel(this.node.menu.querySelector(hash));\n history.pushState(null, document.title, _menu);\n }\n }\n }\n });\n }\n if (options.open) {\n window.addEventListener('popstate', (evnt) => {\n if (!this.node.menu.matches('.mm-menu--opened') && location.hash == _menu) {\n this.open();\n }\n });\n }\n}\n","const options = {\n add: false\n};\nexport default options;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.counters = this.opts.counters || {};\n //\tExtend options.\n const options = extend(this.opts.counters, OPTIONS);\n if (!options.add) {\n return;\n }\n /**\n * Counting the visible listitems and setting it to the counter element.\n * @param {HTMLElement} panel Panel to count LIs in.\n */\n const count = (panel) => {\n /** Parent panel for the mutated listitem. */\n const parent = this.node.pnls.querySelector(`#${panel.dataset.mmParent}`);\n if (!parent) {\n return;\n }\n /** The counter for the listitem. */\n const counter = parent.querySelector('.mm-counter');\n if (!counter) {\n return;\n }\n /** The listitems */\n const listitems = [];\n DOM.children(panel, '.mm-listview').forEach((listview) => {\n listitems.push(...DOM.children(listview, '.mm-listitem'));\n });\n counter.innerHTML = DOM.filterLI(listitems).length.toString();\n };\n /** Mutation observer the the listitems. */\n const listitemObserver = new MutationObserver((mutationsList) => {\n mutationsList.forEach((mutation) => {\n if (mutation.attributeName == 'class') {\n count(mutation.target.closest('.mm-panel'));\n }\n });\n });\n //\tAdd the counters after a listview is initiated.\n this.bind('initListview:after', (listview) => {\n /** The panel where the listview is in. */\n const panel = listview.closest('.mm-panel');\n /** The parent LI for the panel */\n const parent = this.node.pnls.querySelector(`#${panel.dataset.mmParent}`);\n if (!parent) {\n return;\n }\n /** The button inside the parent LI */\n const button = DOM.children(parent, '.mm-btn')[0];\n if (!button) {\n return;\n }\n //\tCheck if no counter already excists.\n if (!DOM.children(button, '.mm-counter').length) {\n /** The counter for the listitem. */\n const counter = DOM.create('span.mm-counter');\n counter.setAttribute('aria-hidden', 'true');\n button.prepend(counter);\n }\n // Count immediately.\n count(panel);\n });\n // Count when LI classname changes.\n this.bind('initListitem:after', (listitem) => {\n /** The panel where the listitem is in. */\n const panel = listitem.closest('.mm-panel');\n if (!panel) {\n return;\n }\n /** The parent LI for the panel. */\n const parent = this.node.pnls.querySelector(`#${panel.dataset.mmParent}`);\n if (!parent) {\n return;\n }\n listitemObserver.observe(listitem, {\n attributes: true\n });\n });\n}\n","const options = {\n use: false,\n top: [],\n bottom: [],\n position: 'left',\n type: 'default'\n};\nexport default options;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport * as media from '../../_modules/matchmedia';\nimport { type, extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.iconbar = this.opts.iconbar || {};\n //\tExtend options.\n const options = extend(this.opts.iconbar, OPTIONS);\n if (!options.use) {\n return;\n }\n let iconbar;\n ['top', 'bottom'].forEach((position, n) => {\n let ctnt = options[position];\n //\tExtend shorthand options\n if (type(ctnt) != 'array') {\n ctnt = [ctnt];\n }\n //\tCreate node\n const part = DOM.create('div.mm-iconbar__' + position);\n //\tAdd content\n for (let c = 0, l = ctnt.length; c < l; c++) {\n if (typeof ctnt[c] == 'string') {\n part.innerHTML += ctnt[c];\n }\n else {\n part.append(ctnt[c]);\n }\n }\n if (part.children.length) {\n if (!iconbar) {\n iconbar = DOM.create('div.mm-iconbar');\n }\n iconbar.append(part);\n }\n });\n //\tAdd to menu\n if (iconbar) {\n //\tAdd the iconbar.\n this.bind('initMenu:after', () => {\n this.node.menu.prepend(iconbar);\n });\n //\tEn-/disable the iconbar.\n let classname = 'mm-menu--iconbar-' + options.position;\n let enable = () => {\n this.node.menu.classList.add(classname);\n };\n let disable = () => {\n this.node.menu.classList.remove(classname);\n };\n if (typeof options.use == 'boolean') {\n this.bind('initMenu:after', enable);\n }\n else {\n media.add(options.use, enable, disable);\n }\n //\tTabs\n if (options.type == 'tabs') {\n iconbar.classList.add('mm-iconbar--tabs');\n iconbar.addEventListener('click', (evnt) => {\n const anchor = evnt.target.closest('.mm-iconbar__tab');\n if (!anchor) {\n return;\n }\n if (anchor.matches('.mm-iconbar__tab--selected')) {\n evnt.stopImmediatePropagation();\n return;\n }\n try {\n const panel = DOM.find(this.node.menu, `${anchor.getAttribute('href')}.mm-panel`)[0];\n if (panel) {\n evnt.preventDefault();\n evnt.stopImmediatePropagation();\n this.openPanel(panel, false);\n }\n }\n catch (err) { }\n });\n const selectTab = (panel) => {\n DOM.find(iconbar, 'a').forEach((anchor) => {\n anchor.classList.remove('mm-iconbar__tab--selected');\n });\n const anchor = DOM.find(iconbar, '[href=\"#' + panel.id + '\"]')[0];\n if (anchor) {\n anchor.classList.add('mm-iconbar__tab--selected');\n }\n else {\n const parent = DOM.find(this.node.pnls, `#${panel.dataset.mmParent}`)[0];\n if (parent) {\n selectTab(parent.closest('.mm-panel'));\n }\n }\n };\n this.bind('openPanel:before', selectTab);\n }\n }\n}\n","const options = {\n add: false,\n blockPanel: true,\n visible: 3\n};\nexport default options;\n","import OPTIONS from './_options';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.iconPanels = this.opts.iconPanels || {};\n //\tExtend options.\n const options = extend(this.opts.iconPanels, OPTIONS);\n let keepFirst = false;\n if (options.visible == 'first') {\n keepFirst = true;\n options.visible = 1;\n }\n options.visible = Math.min(3, Math.max(1, options.visible));\n options.visible++;\n //\tAdd the iconpanels\n if (options.add) {\n this.bind('initMenu:after', () => {\n this.node.menu.classList.add('mm-menu--iconpanel');\n });\n /** The classnames that can be set to a panel */\n const classnames = [\n 'mm-panel--iconpanel-0',\n 'mm-panel--iconpanel-1',\n 'mm-panel--iconpanel-2',\n 'mm-panel--iconpanel-3'\n ];\n // Show only the main panel.\n if (keepFirst) {\n this.bind('initMenu:after', () => {\n var _a;\n (_a = DOM.children(this.node.pnls, '.mm-panel')[0]) === null || _a === void 0 ? void 0 : _a.classList.add('mm-panel--iconpanel-first');\n });\n // Show parent panel(s).\n }\n else {\n this.bind('openPanel:after', (panel) => {\n // Do nothing when opening a vertical submenu\n if (panel.closest('.mm-listitem--vertical')) {\n return;\n }\n let panels = DOM.children(this.node.pnls, '.mm-panel');\n //\tFilter out panels that are not opened.\n panels = panels.filter((panel) => panel.matches('.mm-panel--parent'));\n //\tAdd the current panel to the list.\n panels.push(panel);\n //\tSlice the opened panels to the max visible amount.\n panels = panels.slice(-options.visible);\n //\tAdd the \"iconpanel\" classnames.\n panels.forEach((panel, p) => {\n panel.classList.remove('mm-panel--iconpanel-first', ...classnames);\n panel.classList.add(`mm-panel--iconpanel-${p}`);\n });\n });\n }\n // this.bind('initPanel:after', (panel: HTMLElement) => {\n // if (!panel.closest('.mm-listitem--vertical') &&\n // !DOM.children(panel, '.mm-panel__blocker')[0]\n // ) {\n // const blocker = DOM.create('div.mm-blocker.mm-panel__blocker') as HTMLElement;\n // panel.prepend(blocker);\n // }\n // });\n }\n}\n","const configs = {\n breadcrumbs: {\n separator: '/',\n removeFirst: false\n }\n};\nexport default configs;\n","/**\n * Extend shorthand options.\n *\n * @param {object} options The options to extend.\n * @return {object}\t\t\tThe extended options.\n */\nexport function extendShorthandOptions(options) {\n if (typeof options == 'boolean' && options) {\n options = {};\n }\n if (typeof options != 'object') {\n options = {};\n }\n if (typeof options.content == 'undefined') {\n options.content = ['prev', 'title'];\n }\n if (!(options.content instanceof Array)) {\n options.content = [options.content];\n }\n if (typeof options.use == 'undefined') {\n options.use = true;\n }\n return options;\n}\n;\n","import * as DOM from '../../_modules/dom';\nexport default function (navbar) {\n //\tAdd content\n var breadcrumbs = DOM.create('div.mm-navbar__breadcrumbs');\n navbar.append(breadcrumbs);\n this.bind('initNavbar:after', (panel) => {\n if (panel.querySelector('.mm-navbar__breadcrumbs')) {\n return;\n }\n DOM.children(panel, '.mm-navbar')[0].classList.add('mm-hidden');\n var crumbs = [], breadcrumbs = DOM.create('span.mm-navbar__breadcrumbs'), current = panel, first = true;\n while (current) {\n current = current.closest('.mm-panel');\n if (!current.parentElement.matches('.mm-listitem--vertical')) {\n let title = DOM.find(current, '.mm-navbar__title span')[0];\n if (title) {\n let text = title.textContent;\n if (text.length) {\n crumbs.unshift(first\n ? `${text}`\n : `${text}`);\n }\n }\n first = false;\n }\n current = DOM.find(this.node.pnls, `#${current.dataset.mmParent}`)[0];\n }\n if (this.conf.navbars.breadcrumbs.removeFirst) {\n crumbs.shift();\n }\n breadcrumbs.innerHTML = crumbs.join('' +\n this.conf.navbars.breadcrumbs.separator +\n '');\n DOM.children(panel, '.mm-navbar')[0].append(breadcrumbs);\n });\n //\tUpdate for to opened panel\n this.bind('openPanel:before', (panel) => {\n var crumbs = panel.querySelector('.mm-navbar__breadcrumbs');\n breadcrumbs.innerHTML = crumbs ? crumbs.innerHTML : '';\n });\n}\n","import * as DOM from '../../_modules/dom';\nexport default function (navbar) {\n /** The close button. */\n const close = DOM.create('a.mm-btn.mm-btn--close.mm-navbar__btn');\n close.setAttribute('aria-label', this.i18n(this.conf.offCanvas.screenReader.closeMenu));\n //\tAdd the button to the navbar.\n navbar.append(close);\n //\tUpdate to target the page node.\n this.bind('setPage:after', (page) => {\n close.href = `#${page.id}`;\n });\n}\n","import * as DOM from '../../_modules/dom';\nexport default function (navbar) {\n /** The prev button. */\n let prev = DOM.create('a.mm-btn.mm-hidden');\n //\tAdd button to navbar.\n navbar.append(prev);\n // Hide navbar in the panel.\n this.bind('initNavbar:after', (panel) => {\n DOM.children(panel, '.mm-navbar')[0].classList.add('mm-hidden');\n });\n // Update the button href when opening a panel.\n this.bind('openPanel:before', (panel) => {\n if (panel.parentElement.matches('.mm-listitem--vertical')) {\n return;\n }\n prev.classList.add('mm-hidden');\n /** Original button in the panel. */\n const original = panel.querySelector('.mm-navbar__btn.mm-btn--prev');\n if (original) {\n /** Clone of the original button in the panel. */\n const clone = original.cloneNode(true);\n prev.after(clone);\n prev.remove();\n prev = clone;\n }\n });\n}\n","import * as DOM from '../../_modules/dom';\nimport { uniqueId } from '../../_modules/helpers';\nexport default function (navbar) {\n /** Empty wrapper for the searchfield. */\n let wrapper = DOM.create('div.mm-navbar__searchfield');\n wrapper.id = uniqueId();\n //\tAdd button to navbar.\n navbar.append(wrapper);\n this.opts.searchfield = this.opts.searchfield || {};\n this.opts.searchfield.add = true;\n this.opts.searchfield.addTo = `#${wrapper.id}`;\n}\n","import * as DOM from '../../_modules/dom';\nexport default function (navbar) {\n /** The title node in the navbar. */\n let title = DOM.create('a.mm-navbar__title');\n //\tAdd title to the navbar.\n navbar.append(title);\n //\tUpdate the title to the opened panel.\n this.bind('openPanel:before', (panel) => {\n //\tDo nothing in a vertically expanding panel.\n if (panel.parentElement.matches('.mm-listitem--vertical')) {\n return;\n }\n /** Original title in the panel. */\n const original = panel.querySelector('.mm-navbar__title');\n if (original) {\n /** Clone of the original title in the panel. */\n const clone = original.cloneNode(true);\n title.after(clone);\n title.remove();\n title = clone;\n }\n });\n}\n","import * as DOM from '../../_modules/dom';\nexport default function (navbar) {\n navbar.classList.add('mm-navbar--tabs');\n navbar.closest('.mm-navbars').classList.add('mm-navbars--has-tabs');\n DOM.children(navbar, 'a').forEach(anchor => {\n anchor.classList.add('mm-navbar__tab');\n });\n /**\n * Mark a tab as selected.\n * @param {HTMLElement} panel Opened panel.\n */\n function selectTab(panel) {\n /** The tab that links to the opened panel. */\n const anchor = DOM.children(navbar, `.mm-navbar__tab[href=\"#${panel.id}\"]`)[0];\n if (anchor) {\n anchor.classList.add('mm-navbar__tab--selected');\n // @ts-ignore\n anchor.ariaExpanded = 'true';\n }\n else {\n /** The parent listitem. */\n const parent = DOM.find(this.node.pnls, `#${panel.dataset.mmParent}`)[0];\n if (parent) {\n selectTab.call(this, parent.closest('.mm-panel'));\n }\n }\n }\n this.bind('openPanel:before', (panel) => {\n // Remove selected class.\n DOM.children(navbar, 'a').forEach(anchor => {\n anchor.classList.remove('mm-navbar__tab--selected');\n // @ts-ignore\n anchor.ariaExpanded = 'false';\n });\n selectTab.call(this, panel);\n });\n this.bind('initPanels:after', () => {\n //\tAdd animation class to panel.\n navbar.addEventListener('click', event => {\n var _a, _b, _c;\n /** The href for the clicked tab. */\n const href = (_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('.mm-navbar__tab')) === null || _b === void 0 ? void 0 : _b.getAttribute('href');\n try {\n (_c = DOM.find(this.node.pnls, `${href}.mm-panel`)[0]) === null || _c === void 0 ? void 0 : _c.classList.add('mm-panel--noanimation');\n }\n catch (err) { }\n }, {\n // useCapture to ensure the logical order.\n capture: true\n });\n });\n}\n","import CONFIGS from './configs';\nimport { extendShorthandOptions } from './options';\nimport { extend } from '../../_modules/helpers';\nimport * as DOM from '../../_modules/dom';\nimport * as media from '../../_modules/matchmedia';\nimport breadcrumbs from './navbar.breadcrumbs';\nimport close from './navbar.close';\nimport prev from './navbar.prev';\nimport searchfield from './navbar.searchfield';\nimport title from './navbar.title';\nimport tabs from './navbar.tabs';\nNavbars.navbarContents = {\n breadcrumbs,\n close,\n prev,\n searchfield,\n title,\n};\nNavbars.navbarTypes = {\n tabs,\n};\nexport default function Navbars() {\n this.opts.navbars = this.opts.navbars || [];\n this.conf.navbars = this.conf.navbars || {};\n //\tExtend options.\n extend(this.conf.navbars, CONFIGS);\n let navs = this.opts.navbars;\n if (typeof navs == 'undefined') {\n return;\n }\n if (!(navs instanceof Array)) {\n navs = [navs];\n }\n if (!navs.length) {\n return;\n }\n var navbars = {};\n navs.forEach((options) => {\n options = extendShorthandOptions(options);\n if (!options.use) {\n return;\n }\n //\tCreate the navbar element.\n const navbar = DOM.create('div.mm-navbar');\n //\tGet the position for the navbar.\n let { position } = options;\n //\tRestrict the position to either \"bottom\" or \"top\" (default).\n if (position !== 'bottom') {\n position = 'top';\n }\n //\tCreate the wrapper for the navbar position.\n if (!navbars[position]) {\n navbars[position] = DOM.create('div.mm-navbars.mm-navbars--' + position);\n }\n navbars[position].append(navbar);\n //\tAdd content to the navbar.\n for (let c = 0, l = options.content.length; c < l; c++) {\n const ctnt = options.content[c];\n //\tThe content is a string.\n if (typeof ctnt == 'string') {\n const func = Navbars.navbarContents[ctnt];\n //\tThe content refers to one of the navbar-presets (\"prev\", \"title\", etc).\n if (typeof func == 'function') {\n //\tCall the preset function.\n func.call(this, navbar);\n //\tThe content is just HTML.\n }\n else {\n //\tAdd the HTML.\n // Wrap the HTML in a single node\n let node = DOM.create('span');\n node.innerHTML = ctnt;\n // If there was only a single node, use that.\n const children = DOM.children(node);\n if (children.length == 1) {\n node = children[0];\n }\n navbar.append(node);\n }\n //\tThe content is not a string, it must be an element.\n }\n else {\n navbar.append(ctnt);\n }\n }\n //\tThe type option is set.\n if (typeof options.type == 'string') {\n //\tThe function refers to one of the navbar-presets (\"tabs\").\n const func = Navbars.navbarTypes[options.type];\n if (typeof func == 'function') {\n //\tCall the preset function.\n func.call(this, navbar);\n }\n }\n //\tEn-/disable the navbar.\n let enable = () => {\n navbar.classList.remove('mm-hidden');\n };\n let disable = () => {\n navbar.classList.add('mm-hidden');\n };\n if (typeof options.use == 'boolean') {\n this.bind('initMenu:after', enable);\n }\n else {\n media.add(options.use, enable, disable);\n }\n });\n //\tAdd to menu.\n this.bind('initMenu:after', () => {\n for (let position in navbars) {\n this.node.pnls[position == 'bottom' ? 'after' : 'before'](navbars[position]);\n }\n });\n}\n","const options = {\n scroll: false,\n update: false\n};\nexport default options;\n","const configs = {\n scrollOffset: 0,\n updateOffset: 50\n};\nexport default configs;\n","import Mmenu from '../../core/oncanvas/mmenu.oncanvas';\nimport OPTIONS from './options';\nimport CONFIGS from './configs';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.pageScroll = this.opts.pageScroll || {};\n this.conf.pageScroll = this.conf.pageScroll || {};\n //\tExtend options.\n const options = extend(this.opts.pageScroll, OPTIONS);\n const configs = extend(this.conf.pageScroll, CONFIGS);\n /** The currently \"active\" section */\n var section;\n function scrollTo() {\n if (section) {\n // section.scrollIntoView({ behavior: 'smooth' });\n window.scrollTo({\n top: section.getBoundingClientRect().top +\n document.scrollingElement.scrollTop -\n configs.scrollOffset,\n behavior: 'smooth'\n });\n }\n section = null;\n }\n function anchorInPage(href) {\n try {\n if (href.slice(0, 1) == '#') {\n return DOM.find(Mmenu.node.page, href)[0];\n }\n }\n catch (err) { }\n return null;\n }\n if (this.opts.offCanvas.use && options.scroll) {\n //\tScroll to section after clicking menu item.\n this.bind('close:after', () => {\n scrollTo();\n });\n this.node.menu.addEventListener('click', event => {\n var _a, _b;\n const href = ((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest('a[href]')) === null || _b === void 0 ? void 0 : _b.getAttribute('href')) || '';\n section = anchorInPage(href);\n if (section) {\n event.preventDefault();\n //\tIf the sidebar add-on is \"expanded\"...\n if (this.node.menu.matches('.mm-menu--sidebar-expanded') &&\n this.node.wrpr.matches('.mm-wrapper--sidebar-expanded')) {\n //\t... scroll the page to the section.\n scrollTo();\n //\t... otherwise...\n }\n else {\n //\t... close the menu.\n this.close();\n }\n }\n });\n }\n //\tUpdate selected menu item after scrolling.\n if (options.update) {\n let scts = [];\n this.bind('initListview:after', (listview) => {\n const listitems = DOM.children(listview, '.mm-listitem');\n DOM.filterLIA(listitems).forEach(anchor => {\n const section = anchorInPage(anchor.getAttribute('href'));\n if (section) {\n scts.unshift(section);\n }\n });\n });\n let _selected = -1;\n window.addEventListener('scroll', evnt => {\n const scrollTop = window.scrollY;\n for (var s = 0; s < scts.length; s++) {\n if (scts[s].offsetTop < scrollTop + configs.updateOffset) {\n if (_selected !== s) {\n _selected = s;\n let panel = DOM.children(this.node.pnls, '.mm-panel--opened')[0];\n let listitems = DOM.find(panel, '.mm-listitem');\n let anchors = DOM.filterLIA(listitems);\n anchors = anchors.filter(anchor => anchor.matches('[href=\"#' + scts[s].id + '\"]'));\n if (anchors.length) {\n this.setSelected(anchors[0].parentElement);\n }\n }\n break;\n }\n }\n }, {\n passive: true\n });\n }\n}\n","const options = {\n add: false,\n addTo: 'panels',\n noResults: 'No results found.',\n placeholder: 'Search',\n search: true,\n searchIn: 'panels',\n splash: '',\n title: 'Search',\n};\nexport default options;\n","const configs = {\n cancel: true,\n clear: true,\n form: {},\n input: {},\n panel: {},\n submit: false\n};\nexport default configs;\n","export default {\n 'cancel': 'abbrechen',\n 'Cancel searching': 'Suche abbrechen',\n 'Clear searchfield': 'Suchfeld löschen',\n 'No results found.': 'Keine Ergebnisse gefunden.',\n 'Search': 'Suche',\n};\n","export default {\n 'cancel': 'انصراف',\n 'Cancel searching': 'لغو جستجو',\n 'Clear searchfield': 'پاک کردن فیلد جستجو',\n 'No results found.': 'نتیجه‌ای یافت نشد.',\n 'Search': 'جستجو',\n};\n","export default {\n 'cancel': 'annuleren',\n 'Cancel searching': 'Zoeken annuleren',\n 'Clear searchfield': 'Zoekveld leeg maken',\n 'No results found.': 'Geen resultaten gevonden.',\n 'Search': 'Zoeken',\n};\n","export default {\n 'cancel': 'cancelar',\n 'Cancel searching': 'Cancelar pesquisa',\n 'Clear searchfield': 'Limpar campo de pesquisa',\n 'No results found.': 'Nenhum resultado encontrado.',\n 'Search': 'Buscar',\n};\n","export default {\n 'cancel': 'отменить',\n 'Cancel searching': 'Отменить поиск',\n 'Clear searchfield': 'Очистить поле поиска',\n 'No results found.': 'Ничего не найдено.',\n 'Search': 'Найти',\n};\n","export default {\n 'cancel': 'zrušiť',\n 'Cancel searching': 'Zrušiť vyhľadávanie',\n 'Clear searchfield': 'Vymazať pole vyhľadávania',\n 'No results found.': 'Neboli nájdené žiadne výsledky.',\n 'Search': 'Vyhľadávanie',\n};\n","export default {\n 'cancel': 'скасувати',\n 'Cancel searching': 'Скасувати пошук',\n 'Clear searchfield': 'Очистити поле пошуку',\n 'No results found.': 'Нічого не знайдено.',\n 'Search': 'Пошук',\n};\n","import { add } from '../../../_modules/i18n';\nimport de from './de';\nimport fa from './fa';\nimport nl from './nl';\nimport pt_br from './pt_br';\nimport ru from './ru';\nimport sk from './sk';\nimport uk from './uk';\nexport default function () {\n add(de, 'de');\n add(fa, 'fa');\n add(nl, 'nl');\n add(pt_br, 'pt_br');\n add(ru, 'ru');\n add(sk, 'sk');\n add(uk, 'uk');\n}\n","import OPTIONS from './options';\nimport CONFIGS from './configs';\nimport translate from './translations';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\n// Add the translations.\ntranslate();\nexport default function () {\n this.opts.searchfield = this.opts.searchfield || {};\n this.conf.searchfield = this.conf.searchfield || {};\n //\tExtend options.\n const options = extend(this.opts.searchfield, OPTIONS);\n const configs = extend(this.conf.searchfield, CONFIGS);\n if (!options.add) {\n return;\n }\n switch (options.addTo) {\n case 'panels':\n options.addTo = '.mm-panel';\n break;\n case 'searchpanel':\n options.addTo = '.mm-panel--search';\n break;\n }\n switch (options.searchIn) {\n case 'panels':\n options.searchIn = '.mm-panel';\n break;\n }\n // Add a searchfield to panels matching the \"addTo\" querySelector.\n this.bind('initPanel:after', (panel) => {\n if (panel.matches(options.addTo) &&\n !panel.closest('.mm-listitem--vertical')) {\n initPanel.call(this, panel);\n }\n });\n this.bind('initMenu:after', () => {\n // Create the resultspanel.\n const resultspanel = createResultsPanel.call(this);\n initPanel.call(this, resultspanel);\n // Add a searchfield to anything other than a panel (most likely a navbar).\n DOM.find(this.node.menu, options.addTo).forEach(wrapper => {\n if (!wrapper.matches('.mm-panel')) {\n /** The searchform. */\n const form = createSearchfield.call(this, true);\n // Add the form to the panel.\n wrapper.append(form);\n /** The input node. */\n const input = DOM.find(form, 'input')[0];\n // Bind events for opening and closing the resultspanel.\n // With a splash...\n if (options.splash.length) {\n // Open on focus.\n input.addEventListener('focusin', () => {\n this.openPanel(resultspanel, false, false);\n });\n // Show cancel button if searchpanel is opened.\n this.bind('openPanel:after', (panel) => {\n if (panel.matches('.mm-panel--search')) {\n form.classList.add('mm-searchfield--cancelable');\n }\n else {\n form.classList.remove('mm-searchfield--cancelable');\n }\n });\n // ...without splash.\n }\n else {\n // Open resultspanel when searching.\n this.bind('search:after', () => {\n this.openPanel(resultspanel, false, false);\n });\n // Close resultspanel when resetting.\n input.addEventListener('focusout', () => {\n if (!input.value.length) {\n this.closePanel(resultspanel, false);\n }\n });\n }\n // Initialize searching.\n initSearch.call(this, form);\n }\n });\n });\n //\tBlur searchfield\n this.bind('close:before', () => {\n DOM.find(this.node.menu, '.mm-searchfield input').forEach((input) => {\n input.blur();\n });\n });\n}\n/**\n * Create the searchpanel.\n * @param {Mmenu} this\n */\nconst createResultsPanel = function () {\n /** Options for the searchfield. */\n const options = this.opts.searchfield;\n /** Configs for the searchfield. */\n const configs = this.conf.searchfield;\n /** The panel. */\n let panel = DOM.children(this.node.pnls, '.mm-panel--search')[0];\n //\tOnly once\n if (panel) {\n return panel;\n }\n panel = DOM.create('div.mm-panel--search');\n //\tAdd attributes to the panel. \n _addAttributes(panel, configs.panel);\n // Add a title to the panel.\n if (options.title.length) {\n panel.dataset.mmTitle = this.i18n(options.title);\n }\n // Add a listview to the panel.\n panel.append(DOM.create('ul'));\n this._initPanel(panel);\n return panel;\n};\n/**\n * Add a searchfield, splash message and no-results message to a panel.\n * @param {Mmenu} this\n * @param {HTMLElement} panel The panel to initialise.\n */\nconst initPanel = function (panel) {\n /** Options for the searchfield. */\n const options = this.opts.searchfield;\n //\tCreate the searchfield.\n if (panel.matches(options.addTo)) {\n /** Whether or not the panel is the resultspanel */\n const isResultspanel = panel.matches('.mm-panel--search');\n // Only one per panel.\n if (!DOM.find(panel, '.mm-searchfield').length) {\n /** The searchform. */\n const form = createSearchfield.call(this, isResultspanel);\n if (isResultspanel) {\n form.classList.add('mm-searchfield--cancelable');\n }\n // Add the form to the panel.\n panel.prepend(form);\n // Initialize searching.\n initSearch.call(this, form);\n }\n }\n //\tCreate the splash content.\n if (options.splash.length &&\n panel.matches('.mm-panel--search')) {\n // Only one per panel.\n if (!DOM.find(panel, '.mm-panel__splash').length) {\n /** The splash content node. */\n const splash = DOM.create('div.mm-panel__splash');\n splash.innerHTML = options.splash;\n panel.append(splash);\n }\n }\n // Add no results message.\n if (options.noResults.length) {\n //\tOnly once per panel.\n if (!DOM.find(panel, '.mm-panel__noresults').length) {\n /** The no results message node. */\n const message = DOM.create('div.mm-panel__noresults');\n message.innerHTML = this.i18n(options.noResults);\n panel.append(message);\n }\n }\n};\n/**\n * Create the searchfield.\n * @param {Mmenu} this\n * @param {boolean} [addCancel=false] Whether or not to add the cancel button\n */\nconst createSearchfield = function (addCancel = false) {\n /** Options for the searchfield. */\n const options = this.opts.searchfield;\n /** Configs for the searchfield. */\n const configs = this.conf.searchfield;\n /** The form node. */\n const form = DOM.create('form.mm-searchfield');\n //\tAdd attributes to the form\n _addAttributes(form, configs.form);\n /** The fieldset node. */\n const field = DOM.create('div.mm-searchfield__input');\n form.append(field);\n /** The input node. */\n const input = DOM.create('input');\n field.append(input);\n //\tAdd attributes to the input\n input.type = 'text';\n input.autocomplete = 'off';\n input.placeholder = this.i18n(options.placeholder);\n input.setAttribute('aria-label', this.i18n(options.placeholder));\n _addAttributes(input, configs.input);\n //\tAdd a button to submit to the form.\n if (configs.submit) {\n /** The submit button. */\n const submit = DOM.create('button.mm-btnreset.mm-btn.mm-btn--next.mm-searchfield__btn');\n submit.type = 'submit';\n field.append(submit);\n }\n //\tAdd a button to clear the searchfield.\n else if (configs.clear) {\n /** The reset button. */\n const reset = DOM.create('button.mm-btnreset.mm-btn.mm-btn--close.mm-searchfield__btn');\n reset.type = 'reset';\n reset.setAttribute('aria-label', this.i18n('Clear searchfield'));\n field.append(reset);\n // Apparently, resetting a form doesn't trigger any event on the input,\n // so we manually dispatch the event, one frame later :/\n form.addEventListener('reset', () => {\n window.requestAnimationFrame(() => {\n input.dispatchEvent(new Event('input'));\n });\n });\n }\n // Add a button to close the searchpanel.\n if (configs.cancel && addCancel) {\n /** The cancel button. */\n const cancel = DOM.create('a.mm-searchfield__cancel');\n cancel.href = '#';\n cancel.setAttribute('aria-label', this.i18n('Cancel searching'));\n cancel.textContent = this.i18n('cancel');\n form.append(cancel);\n // Close the search panel.\n cancel.addEventListener('click', event => {\n event.preventDefault();\n this.closePanel(DOM.children(this.node.pnls, '.mm-panel--search')[0], false);\n });\n }\n return form;\n};\n/**\n * Initialize the searching.\n * @param {Mmenu} this\n * @param {HTMLElement} form The searchform.\n */\nconst initSearch = function (form) {\n /** Options for the searchfield. */\n const options = this.opts.searchfield;\n /** The panel the results will be in. */\n const resultspanel = form.closest('.mm-panel') || DOM.find(this.node.pnls, '.mm-panel--search')[0];\n /** The input node. */\n const input = DOM.find(form, 'input')[0];\n /** Where to search. */\n let searchIn = resultspanel.matches('.mm-panel--search')\n ? DOM.children(this.node.pnls, options.searchIn)\n : [resultspanel];\n // Filter out the resultspanel\n searchIn = searchIn.filter(panel => !panel.matches('.mm-panel--search'));\n /** Search */\n const search = () => {\n /** The searchquery */\n const query = input.value.toLowerCase().trim();\n if (query.length) {\n form.classList.add('mm-searchfield--searching');\n }\n else {\n form.classList.remove('mm-searchfield--searching');\n }\n if (!options.search) {\n return;\n }\n /** All listitems */\n const listitems = [];\n searchIn.forEach(panel => {\n // Scroll all panels to top.\n panel.scrollTop = 0;\n // Find listitems.\n listitems.push(...DOM.find(panel, '.mm-listitem'));\n });\n //\tSearch\n if (query.length) {\n // Trigger event.\n this.trigger('search:before');\n resultspanel.classList.add('mm-panel--searching');\n //\tAdd data attribute to the matching listitems.\n listitems.forEach((listitem) => {\n const text = DOM.children(listitem, '.mm-listitem__text')[0];\n if (!text || DOM.text(text).toLowerCase().indexOf(query) > -1) {\n listitem.dataset.mmSearchresult = query;\n }\n });\n /** The number of matching results. */\n let count = 0;\n // Resultspanel: Copy results to resultspanel.\n if (resultspanel.matches('.mm-panel--search')) {\n count = _searchResultsPanel(resultspanel, query, searchIn);\n // Search per panel: Hide the non-matching listitems.\n }\n else {\n count = _searchPerPanel(query, searchIn);\n }\n resultspanel.classList[count == 0 ? 'add' : 'remove']('mm-panel--noresults');\n // Trigger event.\n this.trigger('search:after');\n // Don't search, reset all.\n }\n else {\n // Trigger event.\n this.trigger('clear:before');\n resultspanel.classList.remove('mm-panel--searching', 'mm-panel--noresults');\n // Resultspanel.\n if (resultspanel.matches('.mm-panel--search')) {\n _resetResultsPanel(resultspanel);\n if (!options.splash) {\n this.closePanel(resultspanel, false, false);\n }\n // Search per panel: Show all listitems and dividers.\n }\n else {\n _resetPerPanel(searchIn);\n }\n // Trigger event.\n this.trigger('clear:after');\n }\n };\n input.addEventListener('input', search);\n search();\n};\nconst _searchResultsPanel = (resultspanel, query, searchIn) => {\n /** The listview for the results/ */\n const listview = DOM.find(resultspanel, '.mm-listview')[0];\n // Clear listview.\n listview.innerHTML = '';\n /** Amount of resutls found. */\n let count = 0;\n searchIn.forEach(panel => {\n /** The results in this panel. */\n const results = DOM.find(panel, `[data-mm-searchresult=\"${query}\"]`);\n count += results.length;\n if (results.length) {\n /** Title for the panel. */\n const title = DOM.find(panel, '.mm-navbar__title')[0];\n // Add a divider to indicate in what panel the results are.\n if (title) {\n const divider = DOM.create('li.mm-divider');\n divider.innerHTML = title.innerHTML;\n listview.append(divider);\n }\n // Add the results\n results.forEach((result) => {\n const clone = result.cloneNode(true);\n listview.append(clone);\n });\n }\n });\n // Remove inline subpanels.\n DOM.find(listview, '.mm-panel').forEach(panel => {\n panel.remove();\n });\n // Remove ID's and data-attributes\n ['id', 'data-mm-parent', 'data-mm-child'].forEach(attr => {\n DOM.find(listview, `[${attr}]`).forEach(elem => {\n elem.removeAttribute(attr);\n });\n });\n // Remove \"opened\" class\n DOM.find(listview, '.mm-listitem--opened').forEach(listitem => {\n listitem.classList.remove('mm-listitem--opened');\n });\n return count;\n};\nconst _resetResultsPanel = (resultspanel) => {\n /** The listview for the results. */\n const listview = DOM.find(resultspanel, '.mm-listview')[0];\n // Clear listview.\n listview.innerHTML = '';\n};\nconst _searchPerPanel = (query, searchIn) => {\n /** Amount of resutls found. */\n let count = 0;\n searchIn.forEach(panel => {\n /** The results in this panel. */\n const results = DOM.find(panel, `[data-mm-searchresult=\"${query}\"]`);\n count += results.length;\n if (results.length) {\n // Add first preceeding divider to the results.\n results.forEach(result => {\n const divider = DOM.prevAll(result, '.mm-divider')[0];\n if (divider) {\n divider.dataset.mmSearchresult = query;\n }\n });\n }\n DOM.find(panel, '.mm-listitem, .mm-divider').forEach(item => {\n // Hide all\n item.classList.add('mm-hidden');\n // Show matching + its parents.\n if (item.dataset.mmSearchresult === query) {\n [item, ...DOM.parents(item, '.mm-listitem')].forEach(item2 => {\n item2.classList.remove('mm-hidden');\n });\n }\n });\n });\n return count;\n};\nconst _resetPerPanel = (searchIn) => {\n searchIn.forEach((panel) => {\n DOM.find(panel, '.mm-listitem, .mm-divider').forEach(item => {\n item.classList.remove('mm-hidden');\n });\n });\n};\n/**\n * Add array of attributes to an element.\n * @param {HTMLEement} element The element to add the attributes to.\n * @param {Object} attributes The attributes to add.\n */\nconst _addAttributes = (element, attributes) => {\n if (attributes) {\n Object.keys(attributes).forEach(a => {\n element[a] = attributes[a];\n });\n }\n};\n","const options = {\n add: false,\n addTo: 'panels'\n};\nexport default options;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport * as support from '../../_modules/support';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.sectionIndexer = this.opts.sectionIndexer || {};\n //\tExtend options.\n const options = extend(this.opts.sectionIndexer, OPTIONS);\n if (!options.add) {\n return;\n }\n this.bind('initPanels:after', () => {\n //\tAdd the indexer, only if it does not allready excists\n if (!this.node.indx) {\n let buttons = '';\n 'abcdefghijklmnopqrstuvwxyz'.split('').forEach(letter => {\n buttons += '' + letter + '';\n });\n let indexer = DOM.create('div.mm-sectionindexer');\n indexer.innerHTML = buttons;\n this.node.pnls.prepend(indexer);\n this.node.indx = indexer;\n //\tPrevent default behavior when clicking an anchor\n this.node.indx.addEventListener('click', evnt => {\n const anchor = evnt.target;\n if (anchor.matches('a')) {\n evnt.preventDefault();\n }\n });\n //\tScroll onMouseOver / onTouchStart\n let mouseOverEvent = evnt => {\n if (!evnt.target.matches('a')) {\n return;\n }\n const letter = evnt.target.textContent;\n const panel = DOM.children(this.node.pnls, '.mm-panel--opened')[0];\n let newTop = -1, oldTop = panel.scrollTop;\n panel.scrollTop = 0;\n DOM.find(panel, '.mm-divider')\n .filter(divider => !divider.matches('.mm-hidden'))\n .forEach(divider => {\n if (newTop < 0 &&\n letter ==\n divider.textContent\n .trim()\n .slice(0, 1)\n .toLowerCase()) {\n newTop = divider.offsetTop;\n }\n });\n panel.scrollTop = newTop > -1 ? newTop : oldTop;\n };\n if (support.touch) {\n this.node.indx.addEventListener('touchstart', mouseOverEvent);\n this.node.indx.addEventListener('touchmove', mouseOverEvent);\n }\n else {\n this.node.indx.addEventListener('mouseover', mouseOverEvent);\n }\n }\n //\tShow or hide the indexer\n this.bind('openPanel:before', (panel) => {\n const active = DOM.find(panel, '.mm-divider').filter(divider => !divider.matches('.mm-hidden')).length;\n this.node.indx.classList[active ? 'add' : 'remove']('mm-sectionindexer--active');\n });\n });\n}\n","const options = {\n current: true,\n hover: false,\n parent: false\n};\nexport default options;\n","import OPTIONS from './options';\nimport * as DOM from '../../_modules/dom';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n this.opts.setSelected = this.opts.setSelected || {};\n //\tExtend options.\n const options = extend(this.opts.setSelected, OPTIONS);\n //\tFind current by URL\n if (options.current == 'detect') {\n const findCurrent = (url) => {\n url = url.split('?')[0].split('#')[0];\n const anchor = this.node.menu.querySelector('a[href=\"' + url + '\"], a[href=\"' + url + '/\"]');\n if (anchor) {\n this.setSelected(anchor.parentElement);\n }\n else {\n const arr = url.split('/').slice(0, -1);\n if (arr.length) {\n findCurrent(arr.join('/'));\n }\n }\n };\n this.bind('initMenu:after', () => {\n findCurrent.call(this, window.location.href);\n });\n //\tRemove current selected item\n }\n else if (!options.current) {\n this.bind('initListview:after', (listview) => {\n DOM.children(listview, '.mm-listitem--selected').forEach((listitem) => {\n listitem.classList.remove('mm-listitem--selected');\n });\n });\n }\n //\tAdd :hover effect on items\n if (options.hover) {\n this.bind('initMenu:after', () => {\n this.node.menu.classList.add('mm-menu--selected-hover');\n });\n }\n //\tSet parent item selected for submenus\n if (options.parent) {\n this.bind('openPanel:after', (panel) => {\n //\tRemove all\n DOM.find(this.node.pnls, '.mm-listitem--selected-parent').forEach((listitem) => {\n listitem.classList.remove('mm-listitem--selected-parent');\n });\n //\tMove up the DOM tree\n let current = panel;\n while (current) {\n let li = DOM.find(this.node.pnls, `#${current.dataset.mmParent}`)[0];\n current = li === null || li === void 0 ? void 0 : li.closest('.mm-panel');\n if (li && !li.matches('.mm-listitem--vertical')) {\n li.classList.add('mm-listitem--selected-parent');\n }\n }\n });\n this.bind('initMenu:after', () => {\n this.node.menu.classList.add('mm-menu--selected-parent');\n });\n }\n}\n","const options = {\n collapsed: {\n use: false,\n },\n expanded: {\n use: false,\n initial: 'open'\n }\n};\nexport default options;\n","import Mmenu from '../../core/oncanvas/mmenu.oncanvas';\nimport OPTIONS from './options';\nimport * as media from '../../_modules/matchmedia';\nimport { extend } from '../../_modules/helpers';\nexport default function () {\n // Only for off-canvas menus.\n if (!this.opts.offCanvas.use) {\n return;\n }\n this.opts.sidebar = this.opts.sidebar || {};\n //\tExtend options.\n const options = extend(this.opts.sidebar, OPTIONS);\n //\tCollapsed\n if (options.collapsed.use) {\n //\tMake the menu collapsable.\n this.bind('initMenu:after', () => {\n this.node.menu.classList.add('mm-menu--sidebar-collapsed');\n });\n /** Enable the collapsed sidebar */\n let enable = () => {\n this.node.wrpr.classList.add('mm-wrapper--sidebar-collapsed');\n };\n /** Disable the collapsed sidebar */\n let disable = () => {\n this.node.wrpr.classList.remove('mm-wrapper--sidebar-collapsed');\n };\n if (typeof options.collapsed.use === 'boolean') {\n this.bind('initMenu:after', enable);\n }\n else {\n media.add(options.collapsed.use, enable, disable);\n }\n }\n //\tExpanded\n if (options.expanded.use) {\n //\tMake the menu expandable\n this.bind('initMenu:after', () => {\n this.node.menu.classList.add('mm-menu--sidebar-expanded');\n });\n let expandedEnabled = false;\n /** Enable the expanded sidebar */\n let enable = () => {\n expandedEnabled = true;\n this.node.wrpr.classList.add('mm-wrapper--sidebar-expanded');\n this.node.menu.removeAttribute('aria-modal');\n this.open();\n Mmenu.node.page.removeAttribute('inert');\n };\n /** Disable the expanded sidebar */\n let disable = () => {\n expandedEnabled = false;\n this.node.wrpr.classList.remove('mm-wrapper--sidebar-expanded');\n this.node.menu.setAttribute('aria-modal', 'true');\n this.close();\n };\n if (typeof options.expanded.use == 'boolean') {\n this.bind('initMenu:after', enable);\n }\n else {\n media.add(options.expanded.use, enable, disable);\n }\n // Store exanded state when opening and closing the menu.\n this.bind('close:after', () => {\n if (expandedEnabled) {\n window.sessionStorage.setItem('mmenuExpandedState', 'closed');\n }\n });\n this.bind('open:after', () => {\n if (expandedEnabled) {\n window.sessionStorage.setItem('mmenuExpandedState', 'open');\n Mmenu.node.page.removeAttribute('inert');\n }\n });\n // Set the initial state\n let initialState = options.expanded.initial;\n const state = window.sessionStorage.getItem('mmenuExpandedState');\n switch (state) {\n case 'open':\n case 'closed':\n initialState = state;\n break;\n }\n if (initialState === 'closed') {\n this.bind('init:after', () => {\n this.close();\n });\n }\n }\n}\n","/*!\n * mmenu.js\n * mmenujs.com\n *\n * Copyright (c) Fred Heusschen\n * frebsite.nl\n */\n\n//\tCore\nimport Mmenu from '../dist/core/oncanvas/mmenu.oncanvas';\n\n//\tCore add-ons\nimport offcanvas from '../dist/core/offcanvas/mmenu.offcanvas';\nimport scrollBugFix from '../dist/core/scrollbugfix/mmenu.scrollbugfix';\nimport theme from '../dist/core/theme/mmenu.theme';\n\n//\tAdd-ons\nimport backButton from '../dist/addons/backbutton/mmenu.backbutton';\nimport counters from '../dist/addons/counters/mmenu.counters';\nimport iconbar from '../dist/addons/iconbar/mmenu.iconbar';\nimport iconPanels from '../dist/addons/iconpanels/mmenu.iconpanels';\nimport navbars from '../dist/addons/navbars/mmenu.navbars';\nimport pageScroll from '../dist/addons/pagescroll/mmenu.pagescroll';\nimport searchfield from '../dist/addons/searchfield/mmenu.searchfield';\nimport sectionIndexer from '../dist/addons/sectionindexer/mmenu.sectionindexer';\nimport setSelected from '../dist/addons/setselected/mmenu.setselected';\nimport sidebar from '../dist/addons/sidebar/mmenu.sidebar';\n\n\nMmenu.addons = {\n //\tCore add-ons\n offcanvas,\n scrollBugFix,\n theme,\n\n //\tAdd-ons\n backButton,\n counters,\n iconbar,\n iconPanels,\n navbars,\n pageScroll,\n searchfield,\n sectionIndexer,\n setSelected,\n sidebar\n};\n\n// Export module\nexport default Mmenu;\n\n//\tGlobal namespace\nif (window) {\n window.Mmenu = Mmenu;\n}","// packages/alpinejs/src/scheduler.js\nvar flushPending = false;\nvar flushing = false;\nvar queue = [];\nfunction scheduler(callback) {\n queueJob(callback);\n}\nfunction queueJob(job) {\n if (!queue.includes(job))\n queue.push(job);\n queueFlush();\n}\nfunction dequeueJob(job) {\n let index = queue.indexOf(job);\n if (index !== -1)\n queue.splice(index, 1);\n}\nfunction queueFlush() {\n if (!flushing && !flushPending) {\n flushPending = true;\n queueMicrotask(flushJobs);\n }\n}\nfunction flushJobs() {\n flushPending = false;\n flushing = true;\n for (let i = 0; i < queue.length; i++) {\n queue[i]();\n }\n queue.length = 0;\n flushing = false;\n}\n\n// packages/alpinejs/src/reactivity.js\nvar reactive;\nvar effect;\nvar release;\nvar raw;\nvar shouldSchedule = true;\nfunction disableEffectScheduling(callback) {\n shouldSchedule = false;\n callback();\n shouldSchedule = true;\n}\nfunction setReactivityEngine(engine) {\n reactive = engine.reactive;\n release = engine.release;\n effect = (callback) => engine.effect(callback, {scheduler: (task) => {\n if (shouldSchedule) {\n scheduler(task);\n } else {\n task();\n }\n }});\n raw = engine.raw;\n}\nfunction overrideEffect(override) {\n effect = override;\n}\nfunction elementBoundEffect(el) {\n let cleanup2 = () => {\n };\n let wrappedEffect = (callback) => {\n let effectReference = effect(callback);\n if (!el._x_effects) {\n el._x_effects = new Set();\n el._x_runEffects = () => {\n el._x_effects.forEach((i) => i());\n };\n }\n el._x_effects.add(effectReference);\n cleanup2 = () => {\n if (effectReference === void 0)\n return;\n el._x_effects.delete(effectReference);\n release(effectReference);\n };\n return effectReference;\n };\n return [wrappedEffect, () => {\n cleanup2();\n }];\n}\n\n// packages/alpinejs/src/mutation.js\nvar onAttributeAddeds = [];\nvar onElRemoveds = [];\nvar onElAddeds = [];\nfunction onElAdded(callback) {\n onElAddeds.push(callback);\n}\nfunction onElRemoved(el, callback) {\n if (typeof callback === \"function\") {\n if (!el._x_cleanups)\n el._x_cleanups = [];\n el._x_cleanups.push(callback);\n } else {\n callback = el;\n onElRemoveds.push(callback);\n }\n}\nfunction onAttributesAdded(callback) {\n onAttributeAddeds.push(callback);\n}\nfunction onAttributeRemoved(el, name, callback) {\n if (!el._x_attributeCleanups)\n el._x_attributeCleanups = {};\n if (!el._x_attributeCleanups[name])\n el._x_attributeCleanups[name] = [];\n el._x_attributeCleanups[name].push(callback);\n}\nfunction cleanupAttributes(el, names) {\n if (!el._x_attributeCleanups)\n return;\n Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {\n if (names === void 0 || names.includes(name)) {\n value.forEach((i) => i());\n delete el._x_attributeCleanups[name];\n }\n });\n}\nvar observer = new MutationObserver(onMutate);\nvar currentlyObserving = false;\nfunction startObservingMutations() {\n observer.observe(document, {subtree: true, childList: true, attributes: true, attributeOldValue: true});\n currentlyObserving = true;\n}\nfunction stopObservingMutations() {\n flushObserver();\n observer.disconnect();\n currentlyObserving = false;\n}\nvar recordQueue = [];\nvar willProcessRecordQueue = false;\nfunction flushObserver() {\n recordQueue = recordQueue.concat(observer.takeRecords());\n if (recordQueue.length && !willProcessRecordQueue) {\n willProcessRecordQueue = true;\n queueMicrotask(() => {\n processRecordQueue();\n willProcessRecordQueue = false;\n });\n }\n}\nfunction processRecordQueue() {\n onMutate(recordQueue);\n recordQueue.length = 0;\n}\nfunction mutateDom(callback) {\n if (!currentlyObserving)\n return callback();\n stopObservingMutations();\n let result = callback();\n startObservingMutations();\n return result;\n}\nvar isCollecting = false;\nvar deferredMutations = [];\nfunction deferMutations() {\n isCollecting = true;\n}\nfunction flushAndStopDeferringMutations() {\n isCollecting = false;\n onMutate(deferredMutations);\n deferredMutations = [];\n}\nfunction onMutate(mutations) {\n if (isCollecting) {\n deferredMutations = deferredMutations.concat(mutations);\n return;\n }\n let addedNodes = [];\n let removedNodes = [];\n let addedAttributes = new Map();\n let removedAttributes = new Map();\n for (let i = 0; i < mutations.length; i++) {\n if (mutations[i].target._x_ignoreMutationObserver)\n continue;\n if (mutations[i].type === \"childList\") {\n mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));\n mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));\n }\n if (mutations[i].type === \"attributes\") {\n let el = mutations[i].target;\n let name = mutations[i].attributeName;\n let oldValue = mutations[i].oldValue;\n let add2 = () => {\n if (!addedAttributes.has(el))\n addedAttributes.set(el, []);\n addedAttributes.get(el).push({name, value: el.getAttribute(name)});\n };\n let remove = () => {\n if (!removedAttributes.has(el))\n removedAttributes.set(el, []);\n removedAttributes.get(el).push(name);\n };\n if (el.hasAttribute(name) && oldValue === null) {\n add2();\n } else if (el.hasAttribute(name)) {\n remove();\n add2();\n } else {\n remove();\n }\n }\n }\n removedAttributes.forEach((attrs, el) => {\n cleanupAttributes(el, attrs);\n });\n addedAttributes.forEach((attrs, el) => {\n onAttributeAddeds.forEach((i) => i(el, attrs));\n });\n for (let node of removedNodes) {\n if (addedNodes.includes(node))\n continue;\n onElRemoveds.forEach((i) => i(node));\n if (node._x_cleanups) {\n while (node._x_cleanups.length)\n node._x_cleanups.pop()();\n }\n }\n addedNodes.forEach((node) => {\n node._x_ignoreSelf = true;\n node._x_ignore = true;\n });\n for (let node of addedNodes) {\n if (removedNodes.includes(node))\n continue;\n if (!node.isConnected)\n continue;\n delete node._x_ignoreSelf;\n delete node._x_ignore;\n onElAddeds.forEach((i) => i(node));\n node._x_ignore = true;\n node._x_ignoreSelf = true;\n }\n addedNodes.forEach((node) => {\n delete node._x_ignoreSelf;\n delete node._x_ignore;\n });\n addedNodes = null;\n removedNodes = null;\n addedAttributes = null;\n removedAttributes = null;\n}\n\n// packages/alpinejs/src/scope.js\nfunction scope(node) {\n return mergeProxies(closestDataStack(node));\n}\nfunction addScopeToNode(node, data2, referenceNode) {\n node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];\n return () => {\n node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);\n };\n}\nfunction refreshScope(element, scope2) {\n let existingScope = element._x_dataStack[0];\n Object.entries(scope2).forEach(([key, value]) => {\n existingScope[key] = value;\n });\n}\nfunction closestDataStack(node) {\n if (node._x_dataStack)\n return node._x_dataStack;\n if (typeof ShadowRoot === \"function\" && node instanceof ShadowRoot) {\n return closestDataStack(node.host);\n }\n if (!node.parentNode) {\n return [];\n }\n return closestDataStack(node.parentNode);\n}\nfunction mergeProxies(objects) {\n let thisProxy = new Proxy({}, {\n ownKeys: () => {\n return Array.from(new Set(objects.flatMap((i) => Object.keys(i))));\n },\n has: (target, name) => {\n return objects.some((obj) => obj.hasOwnProperty(name));\n },\n get: (target, name) => {\n return (objects.find((obj) => {\n if (obj.hasOwnProperty(name)) {\n let descriptor = Object.getOwnPropertyDescriptor(obj, name);\n if (descriptor.get && descriptor.get._x_alreadyBound || descriptor.set && descriptor.set._x_alreadyBound) {\n return true;\n }\n if ((descriptor.get || descriptor.set) && descriptor.enumerable) {\n let getter = descriptor.get;\n let setter = descriptor.set;\n let property = descriptor;\n getter = getter && getter.bind(thisProxy);\n setter = setter && setter.bind(thisProxy);\n if (getter)\n getter._x_alreadyBound = true;\n if (setter)\n setter._x_alreadyBound = true;\n Object.defineProperty(obj, name, {\n ...property,\n get: getter,\n set: setter\n });\n }\n return true;\n }\n return false;\n }) || {})[name];\n },\n set: (target, name, value) => {\n let closestObjectWithKey = objects.find((obj) => obj.hasOwnProperty(name));\n if (closestObjectWithKey) {\n closestObjectWithKey[name] = value;\n } else {\n objects[objects.length - 1][name] = value;\n }\n return true;\n }\n });\n return thisProxy;\n}\n\n// packages/alpinejs/src/interceptor.js\nfunction initInterceptors(data2) {\n let isObject2 = (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null;\n let recurse = (obj, basePath = \"\") => {\n Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, {value, enumerable}]) => {\n if (enumerable === false || value === void 0)\n return;\n let path = basePath === \"\" ? key : `${basePath}.${key}`;\n if (typeof value === \"object\" && value !== null && value._x_interceptor) {\n obj[key] = value.initialize(data2, path, key);\n } else {\n if (isObject2(value) && value !== obj && !(value instanceof Element)) {\n recurse(value, path);\n }\n }\n });\n };\n return recurse(data2);\n}\nfunction interceptor(callback, mutateObj = () => {\n}) {\n let obj = {\n initialValue: void 0,\n _x_interceptor: true,\n initialize(data2, path, key) {\n return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);\n }\n };\n mutateObj(obj);\n return (initialValue) => {\n if (typeof initialValue === \"object\" && initialValue !== null && initialValue._x_interceptor) {\n let initialize = obj.initialize.bind(obj);\n obj.initialize = (data2, path, key) => {\n let innerValue = initialValue.initialize(data2, path, key);\n obj.initialValue = innerValue;\n return initialize(data2, path, key);\n };\n } else {\n obj.initialValue = initialValue;\n }\n return obj;\n };\n}\nfunction get(obj, path) {\n return path.split(\".\").reduce((carry, segment) => carry[segment], obj);\n}\nfunction set(obj, path, value) {\n if (typeof path === \"string\")\n path = path.split(\".\");\n if (path.length === 1)\n obj[path[0]] = value;\n else if (path.length === 0)\n throw error;\n else {\n if (obj[path[0]])\n return set(obj[path[0]], path.slice(1), value);\n else {\n obj[path[0]] = {};\n return set(obj[path[0]], path.slice(1), value);\n }\n }\n}\n\n// packages/alpinejs/src/magics.js\nvar magics = {};\nfunction magic(name, callback) {\n magics[name] = callback;\n}\nfunction injectMagics(obj, el) {\n Object.entries(magics).forEach(([name, callback]) => {\n Object.defineProperty(obj, `$${name}`, {\n get() {\n let [utilities, cleanup2] = getElementBoundUtilities(el);\n utilities = {interceptor, ...utilities};\n onElRemoved(el, cleanup2);\n return callback(el, utilities);\n },\n enumerable: false\n });\n });\n return obj;\n}\n\n// packages/alpinejs/src/utils/error.js\nfunction tryCatch(el, expression, callback, ...args) {\n try {\n return callback(...args);\n } catch (e) {\n handleError(e, el, expression);\n }\n}\nfunction handleError(error2, el, expression = void 0) {\n Object.assign(error2, {el, expression});\n console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression ? 'Expression: \"' + expression + '\"\\n\\n' : \"\"}`, el);\n setTimeout(() => {\n throw error2;\n }, 0);\n}\n\n// packages/alpinejs/src/evaluator.js\nvar shouldAutoEvaluateFunctions = true;\nfunction dontAutoEvaluateFunctions(callback) {\n let cache = shouldAutoEvaluateFunctions;\n shouldAutoEvaluateFunctions = false;\n callback();\n shouldAutoEvaluateFunctions = cache;\n}\nfunction evaluate(el, expression, extras = {}) {\n let result;\n evaluateLater(el, expression)((value) => result = value, extras);\n return result;\n}\nfunction evaluateLater(...args) {\n return theEvaluatorFunction(...args);\n}\nvar theEvaluatorFunction = normalEvaluator;\nfunction setEvaluator(newEvaluator) {\n theEvaluatorFunction = newEvaluator;\n}\nfunction normalEvaluator(el, expression) {\n let overriddenMagics = {};\n injectMagics(overriddenMagics, el);\n let dataStack = [overriddenMagics, ...closestDataStack(el)];\n if (typeof expression === \"function\") {\n return generateEvaluatorFromFunction(dataStack, expression);\n }\n let evaluator = generateEvaluatorFromString(dataStack, expression, el);\n return tryCatch.bind(null, el, expression, evaluator);\n}\nfunction generateEvaluatorFromFunction(dataStack, func) {\n return (receiver = () => {\n }, {scope: scope2 = {}, params = []} = {}) => {\n let result = func.apply(mergeProxies([scope2, ...dataStack]), params);\n runIfTypeOfFunction(receiver, result);\n };\n}\nvar evaluatorMemo = {};\nfunction generateFunctionFromString(expression, el) {\n if (evaluatorMemo[expression]) {\n return evaluatorMemo[expression];\n }\n let AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor;\n let rightSideSafeExpression = /^[\\n\\s]*if.*\\(.*\\)/.test(expression) || /^(let|const)\\s/.test(expression) ? `(() => { ${expression} })()` : expression;\n const safeAsyncFunction = () => {\n try {\n return new AsyncFunction([\"__self\", \"scope\"], `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);\n } catch (error2) {\n handleError(error2, el, expression);\n return Promise.resolve();\n }\n };\n let func = safeAsyncFunction();\n evaluatorMemo[expression] = func;\n return func;\n}\nfunction generateEvaluatorFromString(dataStack, expression, el) {\n let func = generateFunctionFromString(expression, el);\n return (receiver = () => {\n }, {scope: scope2 = {}, params = []} = {}) => {\n func.result = void 0;\n func.finished = false;\n let completeScope = mergeProxies([scope2, ...dataStack]);\n if (typeof func === \"function\") {\n let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression));\n if (func.finished) {\n runIfTypeOfFunction(receiver, func.result, completeScope, params, el);\n func.result = void 0;\n } else {\n promise.then((result) => {\n runIfTypeOfFunction(receiver, result, completeScope, params, el);\n }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0);\n }\n }\n };\n}\nfunction runIfTypeOfFunction(receiver, value, scope2, params, el) {\n if (shouldAutoEvaluateFunctions && typeof value === \"function\") {\n let result = value.apply(scope2, params);\n if (result instanceof Promise) {\n result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value));\n } else {\n receiver(result);\n }\n } else {\n receiver(value);\n }\n}\n\n// packages/alpinejs/src/directives.js\nvar prefixAsString = \"x-\";\nfunction prefix(subject = \"\") {\n return prefixAsString + subject;\n}\nfunction setPrefix(newPrefix) {\n prefixAsString = newPrefix;\n}\nvar directiveHandlers = {};\nfunction directive(name, callback) {\n directiveHandlers[name] = callback;\n}\nfunction directives(el, attributes, originalAttributeOverride) {\n attributes = Array.from(attributes);\n if (el._x_virtualDirectives) {\n let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));\n let staticAttributes = attributesOnly(vAttributes);\n vAttributes = vAttributes.map((attribute) => {\n if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n return {\n name: `x-bind:${attribute.name}`,\n value: `\"${attribute.value}\"`\n };\n }\n return attribute;\n });\n attributes = attributes.concat(vAttributes);\n }\n let transformedAttributeMap = {};\n let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);\n return directives2.map((directive2) => {\n return getDirectiveHandler(el, directive2);\n });\n}\nfunction attributesOnly(attributes) {\n return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));\n}\nvar isDeferringHandlers = false;\nvar directiveHandlerStacks = new Map();\nvar currentHandlerStackKey = Symbol();\nfunction deferHandlingDirectives(callback) {\n isDeferringHandlers = true;\n let key = Symbol();\n currentHandlerStackKey = key;\n directiveHandlerStacks.set(key, []);\n let flushHandlers = () => {\n while (directiveHandlerStacks.get(key).length)\n directiveHandlerStacks.get(key).shift()();\n directiveHandlerStacks.delete(key);\n };\n let stopDeferring = () => {\n isDeferringHandlers = false;\n flushHandlers();\n };\n callback(flushHandlers);\n stopDeferring();\n}\nfunction getElementBoundUtilities(el) {\n let cleanups = [];\n let cleanup2 = (callback) => cleanups.push(callback);\n let [effect3, cleanupEffect] = elementBoundEffect(el);\n cleanups.push(cleanupEffect);\n let utilities = {\n Alpine: alpine_default,\n effect: effect3,\n cleanup: cleanup2,\n evaluateLater: evaluateLater.bind(evaluateLater, el),\n evaluate: evaluate.bind(evaluate, el)\n };\n let doCleanup = () => cleanups.forEach((i) => i());\n return [utilities, doCleanup];\n}\nfunction getDirectiveHandler(el, directive2) {\n let noop = () => {\n };\n let handler3 = directiveHandlers[directive2.type] || noop;\n let [utilities, cleanup2] = getElementBoundUtilities(el);\n onAttributeRemoved(el, directive2.original, cleanup2);\n let fullHandler = () => {\n if (el._x_ignore || el._x_ignoreSelf)\n return;\n handler3.inline && handler3.inline(el, directive2, utilities);\n handler3 = handler3.bind(handler3, el, directive2, utilities);\n isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler3) : handler3();\n };\n fullHandler.runCleanups = cleanup2;\n return fullHandler;\n}\nvar startingWith = (subject, replacement) => ({name, value}) => {\n if (name.startsWith(subject))\n name = name.replace(subject, replacement);\n return {name, value};\n};\nvar into = (i) => i;\nfunction toTransformedAttributes(callback = () => {\n}) {\n return ({name, value}) => {\n let {name: newName, value: newValue} = attributeTransformers.reduce((carry, transform) => {\n return transform(carry);\n }, {name, value});\n if (newName !== name)\n callback(newName, name);\n return {name: newName, value: newValue};\n };\n}\nvar attributeTransformers = [];\nfunction mapAttributes(callback) {\n attributeTransformers.push(callback);\n}\nfunction outNonAlpineAttributes({name}) {\n return alpineAttributeRegex().test(name);\n}\nvar alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\\\b`);\nfunction toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {\n return ({name, value}) => {\n let typeMatch = name.match(alpineAttributeRegex());\n let valueMatch = name.match(/:([a-zA-Z0-9\\-:]+)/);\n let modifiers = name.match(/\\.[^.\\]]+(?=[^\\]]*$)/g) || [];\n let original = originalAttributeOverride || transformedAttributeMap[name] || name;\n return {\n type: typeMatch ? typeMatch[1] : null,\n value: valueMatch ? valueMatch[1] : null,\n modifiers: modifiers.map((i) => i.replace(\".\", \"\")),\n expression: value,\n original\n };\n };\n}\nvar DEFAULT = \"DEFAULT\";\nvar directiveOrder = [\n \"ignore\",\n \"ref\",\n \"data\",\n \"id\",\n \"radio\",\n \"tabs\",\n \"switch\",\n \"disclosure\",\n \"menu\",\n \"listbox\",\n \"list\",\n \"item\",\n \"combobox\",\n \"bind\",\n \"init\",\n \"for\",\n \"mask\",\n \"model\",\n \"modelable\",\n \"transition\",\n \"show\",\n \"if\",\n DEFAULT,\n \"teleport\"\n];\nfunction byPriority(a, b) {\n let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;\n let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;\n return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);\n}\n\n// packages/alpinejs/src/utils/dispatch.js\nfunction dispatch(el, name, detail = {}) {\n el.dispatchEvent(new CustomEvent(name, {\n detail,\n bubbles: true,\n composed: true,\n cancelable: true\n }));\n}\n\n// packages/alpinejs/src/nextTick.js\nvar tickStack = [];\nvar isHolding = false;\nfunction nextTick(callback = () => {\n}) {\n queueMicrotask(() => {\n isHolding || setTimeout(() => {\n releaseNextTicks();\n });\n });\n return new Promise((res) => {\n tickStack.push(() => {\n callback();\n res();\n });\n });\n}\nfunction releaseNextTicks() {\n isHolding = false;\n while (tickStack.length)\n tickStack.shift()();\n}\nfunction holdNextTicks() {\n isHolding = true;\n}\n\n// packages/alpinejs/src/utils/walk.js\nfunction walk(el, callback) {\n if (typeof ShadowRoot === \"function\" && el instanceof ShadowRoot) {\n Array.from(el.children).forEach((el2) => walk(el2, callback));\n return;\n }\n let skip = false;\n callback(el, () => skip = true);\n if (skip)\n return;\n let node = el.firstElementChild;\n while (node) {\n walk(node, callback, false);\n node = node.nextElementSibling;\n }\n}\n\n// packages/alpinejs/src/utils/warn.js\nfunction warn(message, ...args) {\n console.warn(`Alpine Warning: ${message}`, ...args);\n}\n\n// packages/alpinejs/src/lifecycle.js\nfunction start() {\n if (!document.body)\n warn(\"Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `