@graupl/navigation-shelf 1.0.0-beta.19 → 1.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/component/navigation-shelf.css +1 -1
- package/dist/css/component/navigation-shelf.css.map +1 -1
- package/dist/css/component.css +1 -1
- package/dist/css/component.css.map +1 -1
- package/dist/css/navigation-shelf.css +1 -1
- package/dist/css/navigation-shelf.css.map +1 -1
- package/dist/js/component/navigation-shelf.cjs.js +2 -2
- package/dist/js/component/navigation-shelf.cjs.js.map +1 -1
- package/dist/js/component/navigation-shelf.es.js +2 -2
- package/dist/js/component/navigation-shelf.es.js.map +1 -1
- package/dist/js/component/navigation-shelf.iife.js +2 -2
- package/dist/js/component/navigation-shelf.iife.js.map +1 -1
- package/dist/js/generator/navigation-shelf.cjs.js +2 -2
- package/dist/js/generator/navigation-shelf.cjs.js.map +1 -1
- package/dist/js/generator/navigation-shelf.es.js +2 -2
- package/dist/js/generator/navigation-shelf.es.js.map +1 -1
- package/dist/js/generator/navigation-shelf.iife.js +2 -2
- package/dist/js/generator/navigation-shelf.iife.js.map +1 -1
- package/dist/js/navigation-shelf.js +2 -2
- package/dist/js/navigation-shelf.js.map +1 -1
- package/package.json +1 -1
- package/src/js/navigation-shelf/NavigationShelf.js +513 -306
- package/src/scss/component/navigation-shelf/_defaults.scss +2 -0
- package/src/scss/component/navigation-shelf/_index.scss +5 -0
- package/src/scss/component/navigation-shelf/_variables.scss +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-shelf.js","names":["isValidInstance","contructor","elements","elementsType","TypeError","key","elementType","name","status","error","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidHoverType","validTypes","includes","join","isTag","tagName","HTMLElement","tag","toLowerCase","check","isValidState","validStates","isValidEvent","validEvents","isValidSideType","values","type","TypeError","validTypes","key","includes","join","status","error","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Tab","Object","find","preventEvent","preventDefault","stopPropagation","addClass","className","element","length","classList","add","removeClass","remove","selectAllFocusableElements","context","document","querySelector","elements","Array","from","querySelectorAll","tabbableElements","filter","check","getAttribute","selectFirstFocusableElement","selectLastFocusableElement","selectNextFocusableElement","index","indexOf","selectPreviousFocusableElement","isValidType","initializeStorage","type","window","Graupl","getStorage","setStorage","data","clearStorage","pushToStorage","key","value","getFromStorage","removeFromStorage","isValidClassList","isValidType","isValidInstance","isValidState","isValidEvent","isValidSideType","keyPress","preventEvent","addClass","removeClass","selectFirstFocusableElement","storage","NavigationShelf","_dom","shelf","controller","lockController","hoverController","sideController","dependents","_selectors","_classes","locked","unlocked","hover","noHover","left","right","open","close","transistion","_transitionDuration","_openDuration","_closeDuration","_focusState","_currentEvent","_hover","_hoverDelay","_enterDelay","_leaveDelay","_hoverTimeout","_locked","_softLocked","_side","_otherSide","_open","_expandEvent","CustomEvent","bubbles","detail","_collapseEvent","_lockEvent","_unlockEvent","_shiftEvent","_enableHoverEvent","_disableHoverEvent","_prefix","_key","_errors","constructor","shelfElement","controllerElement","lockControllerElement","hoverControllerElement","sideControllerElement","dependentSelector","lockedClass","unlockedClass","hoverClass","noHoverClass","leftClass","rightClass","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","hoverDelay","enterDelay","leaveDelay","side","prefix","initialize","transition","_validate","Error","errors","join","_setTransitionDurations","_generateKey","_setDOMElements","_setIds","_setAriaAttributes","_handleFocus","_handleClick","_handleHover","_handleKeydown","_handleKeyup","dom","getAttribute","_expand","_collapse","_enableHover","_disableHover","_shiftSide","initializeStorage","pushToStorage","id","error","console","selectors","classes","focusState","currentEvent","isLocked","otherSide","key","isSoftLocked","isOpen","dependentLockedClass","value","dependentLocked","dependentUnlockedClass","dependentUnlocked","check","htmlElements","htmlElementChecks","HTMLElement","status","push","message","Object","keys","classChecks","transitionDurationCheck","openDurationCheck","closeDurationCheck","hoverCheck","hoverDelayCheck","enterDelayCheck","leaveDelayCheck","prefixCheck","lockedCheck","sideCheck","_setDOMElementType","elementType","base","overwrite","strict","Array","isArray","domElements","from","querySelectorAll","filteredElements","filter","item","parentElement","domElement","querySelector","_resetDOMElementType","document","regenerate","Math","random","toString","replace","substring","setAttribute","_hoverType","_clearTimeout","clearTimeout","_setTimeout","callback","delay","setTimeout","addEventListener","event","relatedTarget","contains","element","values","passive","button","toggle","toggleHover","toggleLock","toggleSide","target","pointerType","focus","style","setProperty","emit","requestAnimationFrame","dispatchEvent","_lock","forEach","dependent","_unlock","toClass","fromClass","force","unlock","lock","toLeft","toRight","enableHover","disableHover","wsRE","attrName","doc","document","attr","element","op","value","attrSelector","id","TypeError","test","RangeError","checkElement","itemToCheck","Element","getElements","selector","context","elements","Document","DocumentFragment","querySelectorAll","Array","prototype","slice","call","filterAndModify","apply","filter","selected","matches","updateAttribute","add","remove","result","trim","split","forEach","item","indexOf","push","attribute","join","once","find","NavigationShelf","once","generate","options","context","document","navigationShelfSelector","forEach","shelfElement","navigationShelfOptions","dataset","grauplNavigationShelfOptions","JSON","parse","replace","controllerElement","querySelector","lockControllerElement","hoverControllerElement","sideControllerElement","initialize","generate","document","addEventListener"],"sources":["../../../core/src/js/validate.js","../../src/js/validate.js","../../../core/src/js/eventHandlers.js","../../../core/src/js/domHelpers.js","../../../core/src/js/storage.js","../../src/js/navigation-shelf/NavigationShelf.js","../../../../node_modules/@drupal/once/src/once.js","../../src/js/navigation-shelf/generator.js","../../src/js/navigation-shelf/index.js"],"sourcesContent":["/**\n * Check to see if the provided elements have a specific contructor.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking instanceof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {object} contructor - The constructor to check for.\n * @param {object} elements - The element(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidInstance(contructor, elements) {\n try {\n if (typeof elements !== \"object\") {\n const elementsType = typeof elements;\n\n throw new TypeError(\n `Elements given to isValidInstance() must be inside of an object. \"${elementsType}\" given.`\n );\n }\n\n for (const key in elements) {\n if (!(elements[key] instanceof contructor)) {\n const elementType = typeof elements[key];\n throw new TypeError(\n `${key} must be an instance of ${contructor.name}. \"${elementType}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are of a specific type.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking typeof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} type - The type to check for.\n * @param {object} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidType(type, values) {\n try {\n if (typeof values !== \"object\") {\n const valuesType = typeof values;\n\n throw new TypeError(\n `Values given to isValidType() must be inside of an object. \"${valuesType}\" given.`\n );\n }\n\n for (const key in values) {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(`${key} must be a ${type}. \"${valueType}\" given.`);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided values are valid query selectors.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isQuerySelector(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isQuerySelector() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n try {\n if (values[key] === null) {\n throw new Error();\n }\n\n document.querySelector(values[key]);\n } catch {\n throw new TypeError(\n `${key} must be a valid query selector. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided value is either a string or an array of strings.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string, string[]>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidClassList(values) {\n try {\n if (typeof values !== \"object\" || Array.isArray(values)) {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidClassList() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n const type = typeof values[key];\n\n if (type !== \"string\") {\n if (Array.isArray(values[key])) {\n values[key].forEach((value) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `${key} must be a string or an array of strings. An array containing non-strings given.`\n );\n }\n });\n } else {\n throw new TypeError(\n `${key} must be a string or an array of strings. \"${type}\" given.`\n );\n }\n } else {\n const obj = {};\n obj[key] = values[key];\n\n isQuerySelector(obj);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid hover types.\n *\n * Available types are: `\"off\"`, `\"on\"`, and `\"dynamic\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidHoverType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidHoverType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"off\", \"on\", \"dynamic\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided elements are using a specific tag.\n *\n * The elements must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `true` if the check is successful.\n *\n * @param {string} tagName - The name of the tag.\n * @param {Object<HTMLElement>} elements - The element(s) to check.\n * @return {boolean} - The result of the check.\n */\nexport function isTag(tagName, elements) {\n if (\n isValidType(\"string\", { tagName }).status &&\n isValidInstance(HTMLElement, elements).status\n ) {\n const tag = tagName.toLowerCase();\n let check = true;\n\n for (const key in elements) {\n if (elements[key].tagName.toLowerCase() !== tag) check = false;\n }\n\n return check;\n } else {\n return false;\n }\n}\n\n/**\n * Check to see if the provided values are valid focus states for a menu.\n *\n * Available states are: `\"none\"`, `\"self\"`, and `\"child\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidState(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidState() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validStates = [\"none\", \"self\", \"child\"];\n\n for (const key in values) {\n if (!validStates.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validStates.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid event types for a menu.\n *\n * Available events are: `\"none\"`, `\"mouse\"`, `\"keyboard\"`, and `\"character\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidEvent(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidEvent() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validEvents = [\"none\", \"mouse\", \"keyboard\", \"character\"];\n\n for (const key in values) {\n if (!validEvents.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validEvents.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * Check to see if the provided values are valid side types.\n *\n * Available types are: `\"left\"` and `\"right\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidSideType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidSideType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"left\", \"right\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * Retrieves the pressed key from an event.\n *\n * @param {KeyboardEvent} event - The keyboard event.\n * @return {string} - The name of the key or an empty string.\n */\nexport function keyPress(event) {\n try {\n // Use event.key or event.keyCode to support older browsers.\n const key = event.key || event.keyCode;\n const keys = {\n Enter: key === \"Enter\" || key === 13,\n Space: key === \" \" || key === \"Spacebar\" || key === 32,\n Escape: key === \"Escape\" || key === \"Esc\" || key === 27,\n ArrowUp: key === \"ArrowUp\" || key === \"Up\" || key === 38,\n ArrowRight: key === \"ArrowRight\" || key === \"Right\" || key === 39,\n ArrowDown: key === \"ArrowDown\" || key === \"Down\" || key === 40,\n ArrowLeft: key === \"ArrowLeft\" || key === \"Left\" || key === 37,\n Home: key === \"Home\" || key === 36,\n End: key === \"End\" || key === 35,\n Tab: key === \"Tab\" || key === 9,\n };\n\n return Object.keys(keys).find((key) => keys[key] === true) || \"\";\n } catch {\n // Return an empty string if something goes wrong.\n return \"\";\n }\n}\n\n/**\n * Stops an event from taking action.\n *\n * @param {Event} event - The event.\n */\nexport function preventEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n","/**\n * Add a class or array of classes to an element.\n *\n * @param {string|string[]} className - The class or classes to add.\n * @param {HTMLElement} element - The element to add the class to.\n */\nexport function addClass(className, element) {\n // Gracefully handle empty strings or arrays.\n if (className === \"\" || className.length === 0) {\n return;\n }\n\n if (typeof className === \"string\") {\n element.classList.add(className);\n } else {\n element.classList.add(...className);\n }\n}\n\n/**\n * Remove a class or array of classes from an element.\n *\n * @param {string|string[]} className - The class or classes to remove.\n * @param {HTMLElement} element - The element to remove the class from.\n */\nexport function removeClass(className, element) {\n // Gracefully handle empty strings or arrays.\n if (className === \"\" || className.length === 0) {\n return;\n }\n\n if (typeof className === \"string\") {\n element.classList.remove(className);\n } else {\n element.classList.remove(...className);\n }\n}\n\n/**\n * Select all focusable elements within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement[]} - An array of focusable elements.\n */\nexport function selectAllFocusableElements(context = document) {\n const querySelector =\n \"a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),[tabindex]\";\n const elements = Array.from(context.querySelectorAll(querySelector));\n\n const tabbableElements = elements.filter((element) => {\n let check = true;\n\n if (element.getAttribute(\"tabindex\") === \"-1\") check = false;\n\n return check;\n });\n\n return tabbableElements;\n}\n\n/**\n * Select the first focusable element within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The first focusable element or false if none found.\n */\nexport function selectFirstFocusableElement(context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n\n return tabbableElements[0] || false;\n}\n\n/**\n * Select the last focusable element within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The last focusable element or false if none found.\n */\nexport function selectLastFocusableElement(context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n\n return tabbableElements[tabbableElements.length - 1] || false;\n}\n\n/**\n * Select the next focusable element relative to the given element within a context.\n *\n * @param {HTMLElement} element - The reference element.\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The next focusable element or false if none found.\n */\nexport function selectNextFocusableElement(element, context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n const index = tabbableElements.indexOf(element);\n\n return index === tabbableElements.length - 1\n ? false\n : tabbableElements[index + 1];\n}\n\n/**\n * Select the previous focusable element relative to the given element within a context.\n *\n * @param {HTMLElement} element - The reference element.\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The previous focusable element or false if none found.\n */\nexport function selectPreviousFocusableElement(element, context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n const index = tabbableElements.indexOf(element);\n\n return index === 0 ? false : tabbableElements[index - 1];\n}\n","/**\n * @file\n * Provides a system to get and store Graupl data in the browser.\n */\n\nimport { isValidType } from \"./validate.js\";\n\n/**\n * Initializes the storage system.\n *\n * @param {?string} [type = null] - The type of storage to initialize.\n */\nexport function initializeStorage(type = null) {\n window.Graupl = window.Graupl || {};\n\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = window.Graupl[type] || {};\n }\n}\n\n/**\n * Get the storage object.\n *\n * @param {?string} type - The type of storage to get.\n * @return {object} - The storage object.\n */\nexport function getStorage(type = null) {\n if (isValidType(\"string\", { type })) {\n return window.Graupl[type];\n }\n\n return window.Graupl;\n}\n\n/**\n * Set the storage object of a given type.\n *\n * @param {string} type - The type of storage to set.\n * @param {object} data - The data to set.\n */\nexport function setStorage(type, data = {}) {\n if (isValidType(\"string\", { type }) && isValidType(\"object\", { data })) {\n window.Graupl[type] = data;\n }\n}\n\n/**\n * Clear the storage object of a given type.\n *\n * @param {string} type - The type of storage to clear.\n */\nexport function clearStorage(type) {\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = {};\n }\n}\n\n/**\n * Push a value to the storage object.\n *\n * @param {string} type - The type of storage to push to.\n * @param {string} key - The key to use for the value.\n * @param {*} value - The value to store.\n */\nexport function pushToStorage(type, key, value) {\n if (isValidType(\"string\", { type, key })) {\n window.Graupl[type][key] = value;\n }\n}\n\n/**\n * Get a value from the storage object.\n *\n * @param {string }type - The type of storage to get from.\n * @param {string }key - The key to get the value from.\n * @return {*} - The value from the storage object.\n */\nexport function getFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n return window.Graupl[type][key];\n }\n\n return null;\n}\n\n/**\n * Remove a value from the storage object.\n *\n * @param {string} type - The type of storage to remove from.\n * @param {string} key - The key to remove the value from.\n */\nexport function removeFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n delete window.Graupl[type][key];\n }\n}\n\nexport default {\n initializeStorage,\n getStorage,\n setStorage,\n clearStorage,\n pushToStorage,\n getFromStorage,\n removeFromStorage,\n};\n","import {\n isValidClassList,\n isValidType,\n isValidInstance,\n isValidState,\n isValidEvent,\n} from \"@graupl/core/src/validate.js\";\nimport { isValidSideType } from \"../validate.js\";\nimport { keyPress, preventEvent } from \"@graupl/core/src/eventHandlers.js\";\nimport {\n addClass,\n removeClass,\n selectFirstFocusableElement,\n} from \"@graupl/core/src/domHelpers.js\";\nimport storage from \"@graupl/core/src/storage.js\";\n\nclass NavigationShelf {\n /**\n * The DOM elements within the shelf.\n *\n * @protected\n *\n * @type {Object<HTMLElement,HTMLElement[]>}\n *\n * @property {HTMLElement} shelf - The shelf element.\n * @property {HTMLElement} controller - The toggle for this shelf.\n * @property {HTMLElement} lockController - The toggle for locking this shelf.\n * @property {HTMLElement} hoverController - The toggle for hoverability of this shelf.\n * @property {HTMLElement} sideController - The toggle for the side controller of this shelf.\n * @property {HTMLElement[]} dependents - The list of dependent elements that should be updated when the shelf is opened or closed.\n */\n _dom = {\n shelf: null,\n controller: null,\n lockController: null,\n hoverController: null,\n sideController: null,\n dependents: [],\n };\n\n /**\n * The query selectors used by the shelf to populate the dom.\n *\n * @protected\n *\n * @type {Object<string>}\n *\n * @property {string} dependents - The query selector for dependent elements.\n */\n _selectors = {\n dependents: \"\",\n };\n\n /**\n * The class(es) to apply to the shelf and dependent elements in various scenarios.\n *\n * @protected\n *\n * @type {Object<string,string[]>}\n *\n * @property {string|string[]} locked - The class(es) to apply to the shelf and dependent elements when the shelf is locked.\n * @property {string|string[]} unlocked - The class(es) to apply to the shelf and dependent elements when the shelf is unlocked.\n * @property {string|string[]} hover - The class(es) to apply to the shelf element when the shelf is hoverable.\n * @property {string|string[]} noHover - The class(es) to apply to the shelf element when the shelf is not hoverable.\n * @property {string|string[]} left - The class(es) to apply to the shelf and dependent elements when the shelf is on the left side.\n * @property {string|string[]} right - The class(es) to apply to the shelf and dependent elements when the shelf is on the right side.\n * @property {string|string[]} open - The class(es) to apply to the shelf when the shelf is open.\n * @property {string|string[]} close - The class(es) to apply to the shelf when the shelf is closed.\n * @property {string|string[]} transition - The class(es) to apply to the shelf and dependent elements when the shelf is transitioning between states.\n */\n _classes = {\n locked: \"locked\",\n unlocked: \"unlocked\",\n hover: \"hoverable\",\n noHover: \"not-hoverable\",\n left: \"left-side\",\n right: \"right-side\",\n open: \"show\",\n close: \"hide\",\n transistion: \"transitioning\",\n };\n\n /**\n * The duration time (in milliseconds) for the transition between open and closed states.\n *\n * @protected\n *\n * @type {number}\n */\n _transitionDuration = 250;\n\n /**\n * The duration time (in milliseconds) for the transition from closed to open states.\n *\n * @protected\n *\n * @type {number}\n */\n _openDuration = -1;\n\n /**\n * The duration time (in milliseconds) for the transition from open to closed states.\n *\n * @protected\n *\n * @type {number}\n */\n _closeDuration = -1;\n\n /**\n * The current state of the shelf's focus.\n *\n * @protected\n *\n * @type {string}\n */\n _focusState = \"none\";\n\n /**\n * This last event triggered on the shelf.\n *\n * @protected\n *\n * @type {string}\n */\n _currentEvent = \"none\";\n\n /**\n * A flag to indicate if the shelf is hoverable.\n *\n * @protected\n *\n * @type {boolean}\n */\n _hover = false;\n\n /**\n * The delay time (in milliseconds) used for pointerenter/pointerleave events to take place.\n *\n * @protected\n *\n * @type {number}\n */\n _hoverDelay = 250;\n\n /**\n * The delay time (in milliseconds) used for pointerenter events to take place.\n *\n * @protected\n *\n * @type {number}\n */\n _enterDelay = -1;\n\n /**\n * The delay time (in milliseconds) used for pointerleave events to take place.\n *\n * @protected\n *\n * @type {number}\n */\n _leaveDelay = -1;\n\n /**\n * A variable to hold the hover timeout function.\n *\n * @protected\n *\n * @type {?Function}\n */\n _hoverTimeout = null;\n\n /**\n * A flag to indicate if the navigation shelf is locked.\n *\n * @protected\n *\n * @type {boolean}\n */\n _locked = false;\n\n /**\n * A flag to check in the navigation shelf can dynamically close based on if the shelf has been manually interacted with already.\n *\n * @protected\n *\n * @type {boolean}\n */\n _softLocked = false;\n\n /**\n * The side of the screen the navigation shelf is on.\n *\n * @protected\n *\n * @type {string}\n */\n _side = \"left\";\n\n /**\n * The opposite side of the screen the naigation shelf is on.\n *\n * @protected\n *\n * @type {string}\n */\n _otherSide = \"right\";\n\n /**\n * The open state of the shelf.\n *\n * @protected\n *\n * @type {boolean}\n */\n _open = false;\n\n /**\n * The event that is triggered when the shelf expands.\n *\n * @protected\n *\n * @event grauplNavigationShelfExpand\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _expandEvent = new CustomEvent(\"grauplNavigationShelfExpand\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf collapses.\n *\n * @protected\n *\n * @event grauplNavigationShelfCollapse\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _collapseEvent = new CustomEvent(\"grauplNavigationShelfCollapse\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf is locked.\n *\n * @protected\n *\n * @event grauplNavigationShelfLock\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _lockEvent = new CustomEvent(\"grauplNavigationShelfLock\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf is unlocked.\n *\n * @protected\n *\n * @event grauplNavigationShelfUnlock\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _unlockEvent = new CustomEvent(\"grauplNavigationShelfUnlock\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf has shifted sides.\n *\n * @protected\n *\n * @event grauplNavigationShelfShift\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _shiftEvent = new CustomEvent(\"grauplNavigationShelfShift\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * The event that is triggered when the shelf's hoverability is enabled.\n *\n * @protected\n *\n * @event grauplNavigationShelfEnableHoverable\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _enableHoverEvent = new CustomEvent(\"grauplNavigationShelfEnableHoverable\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * The event that is triggered when the shelf's hoverability is disabled.\n *\n * @protected\n *\n * @event grauplNavigationShelfDisableHover\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _disableHoverEvent = new CustomEvent(\"grauplNavigationShelfDisableHover\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * The prefix to use for CSS custom properties.\n *\n * @protected\n *\n * @type {string}\n */\n _prefix = \"graupl-\";\n\n /**\n * The key used to generate IDs throughout the navigation shelf.\n *\n * @protected\n *\n * @type {string}\n */\n _key = \"\";\n\n /**\n * errors - The list of errors found during validation.\n *\n * @protected\n *\n * @type {string[]}\n */\n _errors = [];\n\n constructor({\n shelfElement,\n controllerElement,\n lockControllerElement,\n hoverControllerElement,\n sideControllerElement,\n dependentSelector = \".shelf-aware\",\n lockedClass = \"locked\",\n unlockedClass = \"unlocked\",\n hoverClass = \"hoverable\",\n noHoverClass = \"not-hoverable\",\n leftClass = \"left-side\",\n rightClass = \"right-side\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 250,\n openDuration = -1,\n closeDuration = -1,\n hover = false,\n hoverDelay = 250,\n enterDelay = -1,\n leaveDelay = -1,\n locked = false,\n side = \"left\",\n prefix = \"graupl-\",\n initialize = false,\n }) {\n // Set DOM elements.\n this._dom.shelf = shelfElement;\n this._dom.controller = controllerElement || null;\n this._dom.lockController = lockControllerElement || null;\n this._dom.hoverController = hoverControllerElement || null;\n this._dom.sideController = sideControllerElement || null;\n\n // Set DOM selectors.\n this._selectors.dependents = dependentSelector;\n\n // Set classes.\n this._classes.locked = lockedClass || \"\";\n this._classes.unlocked = unlockedClass || \"\";\n this._classes.hover = hoverClass || \"\";\n this._classes.noHover = noHoverClass || \"\";\n this._classes.left = leftClass || \"\";\n this._classes.right = rightClass || \"\";\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set transition duration.\n this._transitionDuration = transitionDuration;\n this._openDuration = openDuration;\n this._closeDuration = closeDuration;\n\n // Set locked state.\n this._locked = locked;\n\n // Set side.\n this._side = side;\n\n // Set prefix.\n this._prefix = prefix || \"\";\n\n // Set hover settings.\n this._hover = hover;\n this._hoverDelay = hoverDelay;\n this._enterDelay = enterDelay;\n this._leaveDelay = leaveDelay;\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initialize the navigation shelf.\n */\n initialize() {\n try {\n if (!this._validate()) {\n throw new Error(\n `Graupl Navigation Shelf: cannot initialize navigation shelf. The following errors have been found:\\n - ${this.errors.join(\n \"\\n - \"\n )}`\n );\n }\n\n this._setTransitionDurations();\n\n // Set up the DOM.\n this._generateKey();\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n\n // Set up the event listeners.\n this._handleFocus();\n this._handleClick();\n this._handleHover();\n this._handleKeydown();\n this._handleKeyup();\n\n // Ensure the initial open state of the shelf.\n if (this.dom.controller.getAttribute(\"aria-expanded\") === \"true\") {\n this._expand(false);\n } else {\n this._collapse(false);\n }\n\n // Ensure the initial hoverability of the shelf.\n if (this.hover) {\n this._enableHover(false);\n } else {\n this._disableHover(false);\n }\n\n // Ensure the initial side of the shelf.\n this._shiftSide(false);\n\n // Set up the storage.\n storage.initializeStorage(\"navigation-shelves\");\n storage.pushToStorage(\"navigation-shelves\", this.dom.shelf.id, this);\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * The DOM elements within the shelf.\n *\n * @readonly\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n *\n * @see _dom\n */\n get dom() {\n return this._dom;\n }\n\n /**\n * The query selectors used by the shelf to populate the DOM.\n *\n * @readonly\n *\n * @type {Object<string>}\n *\n * @see _selectors\n */\n get selectors() {\n return this._selectors;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements in various scenarios.\n *\n * @readonly\n *\n * @type {Object<string, string[]>}\n *\n * @see _classes\n */\n get classes() {\n return this._classes;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is locked.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get lockedClass() {\n return this._classes.locked;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is unlocked.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get unlockedClass() {\n return this._classes.unlocked;\n }\n\n /**\n * The class(es) to apply to the shelf element when the shelf is hoverable.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get hoverClass() {\n return this._classes.hover;\n }\n\n /**\n * The class(es) to apply to the shelf element when the shelf is not hoverable.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get noHoverClass() {\n return this._classes.noHover;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is on the left side.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get leftClass() {\n return this._classes.left;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is on the right side.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get rightClass() {\n return this._classes.right;\n }\n\n /**\n * The class(es) to apply to the shelf when the shelf is open.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get openClass() {\n return this._classes.open;\n }\n\n /**\n * The class(es) to apply to the shelf when the shelf is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get closeClass() {\n return this._classes.close;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is transitioning between states.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get transitionClass() {\n return this._classes.transition;\n }\n\n /**\n * The duration time (in milliseconds) for the transition between open and closed states.\n *\n * Setting this value will also set the --am-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _transitionDuration\n */\n get transitionDuration() {\n return this._transitionDuration;\n }\n\n /**\n * The duration time (in milliseconds) for the transition from closed to open states.\n *\n * If openDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --am-open-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _openDuration\n */\n get openDuration() {\n if (this._openDuration === -1) return this.transitionDuration;\n\n return this._openDuration;\n }\n\n /**\n * The duration time (in milliseconds) for the transition from open to closed states.\n *\n * If closeDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --am-close-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _closeDuration\n */\n get closeDuration() {\n if (this._closeDuration === -1) return this.transitionDuration;\n\n return this._closeDuration;\n }\n\n /**\n * The current state of the shelf's focus.\n *\n * @type {string}\n *\n * @see _focusState\n */\n get focusState() {\n return this._focusState;\n }\n\n /**\n * The last event triggered on the shelf.\n *\n * @type {string}\n *\n * @see _currentEvent\n */\n get currentEvent() {\n return this._currentEvent;\n }\n\n /**\n * A flag to indicate if the shelf is hoverable.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _hover\n */\n get hover() {\n return this._hover;\n }\n\n /**\n * The delay time (in milliseconds) used for pointerenter/pointerleave events to take place.\n *\n * @type {number}\n *\n * @see _hoverDelay\n */\n get hoverDelay() {\n return this._hoverDelay;\n }\n\n /**\n * The delay time (in milliseconds) used for pointerenter events to take place.\n *\n * If enterDelay is set to -1, the hoverDelay value will be used instead.\n *\n * @type {number}\n *\n * @see _enterDelay\n */\n get enterDelay() {\n if (this._enterDelay === -1) return this.hoverDelay;\n\n return this._enterDelay;\n }\n\n /**\n * The delay time (in milliseconds) used for pointerleave events to take place.\n *\n * If leaveDelay is set to -1, the hoverDelay value will be used instead.\n *\n * @type {number}\n *\n * @see _leaveDelay\n */\n get leaveDelay() {\n if (this._leaveDelay === -1) return this.hoverDelay;\n\n return this._leaveDelay;\n }\n\n /**\n * The prefix to use for CSS custom properties.\n *\n * @type {string}\n *\n * @see _prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * A flag to indicate if the navigation shelf is locked.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get isLocked() {\n return this._locked;\n }\n\n /**\n * The side of the screen the navigation shelf is on.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _side\n */\n get side() {\n return this._side;\n }\n\n /**\n * The opposite side of the screen the navigation shelf is on.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _otherSide\n */\n get otherSide() {\n return this._otherSide;\n }\n\n /**\n * The key used to generate IDs throughout the accordion.\n *\n * @type {string}\n *\n * @see _key\n */\n get key() {\n return this._key;\n }\n\n /**\n * A flag to check if the shelf can dynamically hover.\n *\n * @type {boolean}\n *\n * @see _softLocked\n */\n get isSoftLocked() {\n return this._softLocked;\n }\n\n /**\n * The open state on the shelf.\n *\n * @type {boolean}\n *\n * @see _open\n */\n get isOpen() {\n return this._open;\n }\n\n /**\n * An array of error messages generated by the shelf.\n *\n * @readonly\n *\n * @type {string[]}\n *\n * @see _errors\n */\n get errors() {\n return this._errors;\n }\n\n set dependentLockedClass(value) {\n isValidClassList({ dependentLockedClass: value });\n if (this._classes.dependentLocked !== value) {\n this._classes.dependentLocked = value;\n }\n }\n\n set dependentUnlockedClass(value) {\n isValidClassList({ dependentUnlockedClass: value });\n if (this._classes.dependentUnlocked !== value) {\n this._classes.dependentUnlocked = value;\n }\n }\n\n set openClass(value) {\n isValidClassList({ openClass: value });\n\n if (this._classes.open !== value) {\n this._classes.open = value;\n }\n }\n\n set closeClass(value) {\n isValidClassList({ closeClass: value });\n\n if (this._classes.close !== value) {\n this._classes.close = value;\n }\n }\n\n set transitionClass(value) {\n isValidClassList({ transitionClass: value });\n\n if (this._classes.transition !== value) {\n this._classes.transition = value;\n }\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._transitionDuration !== value) {\n this._transitionDuration = value;\n this._setTransitionDurations();\n }\n }\n\n set openDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._openDuration !== value) {\n this._openDuration = value;\n this._setTransitionDurations();\n }\n }\n\n set closeDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._closeDuration !== value) {\n this._closeDuration = value;\n this._setTransitionDurations();\n }\n }\n\n set focusState(value) {\n isValidState({ value });\n\n if (this._focusState !== value) {\n this._focusState = value;\n }\n }\n\n set currentEvent(value) {\n isValidEvent({ value });\n\n if (this._currentEvent !== value) {\n this._currentEvent = value;\n }\n }\n\n set hoverDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._hoverDelay !== value) {\n this._hoverDelay = value;\n }\n }\n\n set enterDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._enterDelay !== value) {\n this._enterDelay = value;\n }\n }\n\n set leaveDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._leaveDelay !== value) {\n this._leaveDelay = value;\n }\n }\n\n set prefix(value) {\n isValidType(\"string\", { value });\n\n if (this._prefix !== value) {\n this._prefix = value;\n }\n }\n\n set key(value) {\n isValidType(\"string\", { value });\n\n if (this._key !== value) {\n this._key = value;\n }\n }\n\n set isSoftLocked(value) {\n isValidType(\"boolean\", { value });\n\n if (this._softLocked !== value) {\n this._softLocked = value;\n }\n }\n\n /**\n * Validates all aspects of the shelf to ensure proper functionality.\n *\n * @protected\n *\n * @return {boolean} - The result of the validation.\n */\n _validate() {\n let check = true;\n\n // HTML element checks.\n const htmlElements = {\n shelfElement: this._dom.shelf,\n controllerElement: this._dom.controller,\n };\n\n if (this._dom.lockController) {\n htmlElements.lockControllerElement = this._dom.lockController;\n }\n if (this._dom.hoverController) {\n htmlElements.hoverControllerElement = this._dom.hoverController;\n }\n if (this._dom.sideController) {\n htmlElements.sideControllerElement = this._dom.sideController;\n }\n\n const htmlElementChecks = isValidInstance(HTMLElement, htmlElements);\n\n if (!htmlElementChecks.status) {\n this._errors.push(htmlElementChecks.error.message);\n check = false;\n }\n\n // Class list checks.\n const classes = {};\n for (const key of Object.keys(this.classes)) {\n if (this._classes[key] === \"\") continue;\n\n classes[`${key}Class`] = this._classes[key];\n }\n const classChecks = isValidClassList(classes);\n\n if (!classChecks.status) {\n this._errors.push(classChecks.error.message);\n check = false;\n }\n\n // Transition duration check.\n const transitionDurationCheck = isValidType(\"number\", {\n transitionDuration: this._transitionDuration,\n });\n\n if (!transitionDurationCheck.status) {\n this._errors.push(transitionDurationCheck.error.message);\n check = false;\n }\n\n // Open duration check.\n const openDurationCheck = isValidType(\"number\", {\n openDuration: this._openDuration,\n });\n\n if (!openDurationCheck.status) {\n this._errors.push(openDurationCheck.error.message);\n check = false;\n }\n\n // Close duration check.\n const closeDurationCheck = isValidType(\"number\", {\n closeDuration: this._closeDuration,\n });\n\n if (!closeDurationCheck.status) {\n this._errors.push(closeDurationCheck.error.message);\n check = false;\n }\n\n // Hover check.\n const hoverCheck = isValidType(\"boolean\", { hover: this._hover });\n\n if (!hoverCheck.status) {\n this._errors.push(hoverCheck.error.message);\n check = false;\n }\n\n // Hover delay check.\n const hoverDelayCheck = isValidType(\"number\", {\n hoverDelay: this._hoverDelay,\n });\n\n if (!hoverDelayCheck.status) {\n this._errors.push(hoverDelayCheck.error.message);\n check = false;\n }\n\n // Enter delay check.\n const enterDelayCheck = isValidType(\"number\", {\n enterDelay: this._enterDelay,\n });\n\n if (!enterDelayCheck.status) {\n this._errors.push(enterDelayCheck.error.message);\n check = false;\n }\n\n // Leave delay check.\n const leaveDelayCheck = isValidType(\"number\", {\n leaveDelay: this._leaveDelay,\n });\n\n if (!leaveDelayCheck.status) {\n this._errors.push(leaveDelayCheck.error.message);\n check = false;\n }\n\n // Prefix check.\n const prefixCheck = isValidType(\"string\", { prefix: this._prefix });\n\n if (!prefixCheck.status) {\n this._errors.push(prefixCheck.error.message);\n check = false;\n }\n\n // Locked check.\n const lockedCheck = isValidType(\"boolean\", { locked: this._locked });\n if (!lockedCheck.status) {\n this._errors.push(lockedCheck.error.message);\n check = false;\n }\n\n // Side check.\n const sideCheck = isValidSideType({ side: this._side });\n if (!sideCheck.status) {\n this._errors.push(sideCheck.error.message);\n check = false;\n }\n\n return check;\n }\n\n /**\n * Sets DOM elements within the shelf.\n *\n * The shelf, controller, lockController, and hoverController elements _cannot_ be set through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to populate.\n * @param {HTMLElement} [base = this.dom.shelf] - The element used as the base for the querySelector.\n * @param {boolean} [overwrite = true] - A flag to set if the existing elements will be overwritten.\n * @param {boolean} [strict = true] - A flag to set if the elements must be direct children of the base.\n */\n _setDOMElementType(\n elementType,\n base = this.dom.shelf,\n overwrite = true,\n strict = true\n ) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (\n elementType === \"shelf\" ||\n elementType === \"controller\" ||\n elementType === \"lockController\" ||\n elementType === \"hoverController\"\n ) {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" element cannot be set through _setDOMElementType.`\n );\n }\n\n if (base !== this.dom.shelf) isValidInstance(HTMLElement, { base });\n\n if (Array.isArray(this._dom[elementType])) {\n // Get all the elements matching the selector in the base.\n const domElements = Array.from(\n base.querySelectorAll(this.selectors[elementType])\n );\n\n // Filter the elements so only direct children of the base are kept.\n const filteredElements = domElements.filter((item) =>\n strict ? item.parentElement === base : true\n );\n\n if (overwrite) {\n this._dom[elementType] = filteredElements;\n } else {\n this._dom[elementType] = [\n ...this._dom[elementType],\n ...filteredElements,\n ];\n }\n } else {\n // Get the single element matching the selector in the base.\n const domElement = base.querySelector(this.selectors[elementType]);\n\n // Ensure the element is a direct child of the base.\n if (domElement && domElement.parentElement !== base) {\n return;\n }\n\n if (overwrite) {\n this._dom[elementType] = domElement;\n }\n }\n } else {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" is not a valid element type within the navigation shelf.`\n );\n }\n }\n\n /**\n * Resets DOM elements within the menu.\n *\n * The shelf, controller, lockController, and hoverController elements _cannot_ be set through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to clear.\n */\n _resetDOMElementType(elementType) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (\n elementType === \"shelf\" ||\n elementType === \"controller\" ||\n elementType === \"lockController\" ||\n elementType === \"hoverController\"\n ) {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" element cannot be reset through _resetDOMElementType.`\n );\n }\n\n if (Array.isArray(this._dom[elementType])) {\n this._dom[elementType] = [];\n } else {\n this._dom[elementType] = null;\n }\n } else {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" is not a valid element type within the navigation shelf.`\n );\n }\n }\n\n /**\n * Sets all DOM elements within the shelf.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"dependents\", document, true, false);\n }\n\n /**\n * Generates a key for the navigation shelf.\n *\n * @param {boolean} [regenerate = false] - A flag to determine if the key should be regenerated.\n */\n _generateKey(regenerate = false) {\n if (this.key === \"\" || regenerate) {\n this.key = Math.random()\n .toString(36)\n .replace(/[^a-z]+/g, \"\")\n .substring(0, 10);\n }\n }\n\n /**\n * Sets the IDs of the navigation shelf and it's elements if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - navigation shelf: `navigation-shelf-${key}`\n * - navigation shelf toggle: `navigation-shelf-toggle-${key}`\n * - navigation shelf lock toggle: `navigation-shelf-lock-toggle-${key}`\n * - navigation shelf hover toggle: `navigation-shelf-hover-toggle-${key}`\n */\n _setIds() {\n this.dom.shelf.id = this.dom.shelf.id || `navigation-shelf-${this.key}`;\n if (this.dom.controller) {\n this.dom.controller.id =\n this.dom.controller.id || `navigation-shelf-toggle-${this.key}`;\n }\n if (this.dom.lockController) {\n this.dom.lockController.id =\n this.dom.lockController.id ||\n `navigation-shelf-lock-toggle-${this.key}`;\n }\n if (this.dom.hoverController) {\n this.dom.hoverController.id =\n this.dom.hoverController.id ||\n `navigation-shelf-hover-toggle-${this.key}`;\n }\n }\n\n /**\n * Sets the aria attributes for the navigation shelf.\n */\n _setAriaAttributes() {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-controls\", this.dom.shelf.id);\n\n if (this.dom.controller.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n }\n\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n this.dom.lockController.setAttribute(\n \"aria-pressed\",\n this._locked ? \"true\" : \"false\"\n );\n }\n\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n this.dom.hoverController.setAttribute(\n \"aria-pressed\",\n this._hoverType === \"on\" ? \"true\" : \"false\"\n );\n }\n\n if (this.dom.sideController) {\n this.dom.sideController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n }\n }\n\n /**\n * Clears the hover timeout.\n *\n * @protected\n */\n _clearTimeout() {\n clearTimeout(this._hoverTimeout);\n }\n\n /**\n * Sets the hover timeout.\n *\n * @protected\n *\n * @param {Function} callback - The callback function to execute.\n * @param {number} delay - The delay time in milliseconds.\n */\n _setTimeout(callback, delay) {\n isValidType(\"function\", { callback });\n isValidType(\"number\", { delay });\n\n this._hoverTimeout = setTimeout(callback, delay);\n }\n\n _handleFocus() {\n this.dom.shelf.addEventListener(\"focusin\", () => {\n this.focusState = \"self\";\n this.open();\n });\n\n this.dom.shelf.addEventListener(\"focusout\", (event) => {\n if (\n event.relatedTarget === null ||\n this.dom.shelf.contains(event.relatedTarget)\n )\n return;\n\n this.focusState = \"none\";\n this.close();\n });\n }\n\n _handleClick() {\n // Prevent pointer down events on all controlled elements.\n for (const element of Object.values(this.dom)) {\n if (!element) continue;\n if (Array.isArray(element)) continue;\n\n element.addEventListener(\n \"pointerdown\",\n () => {\n this.currentEvent = \"mouse\";\n this._clearTimeout();\n },\n { passive: true }\n );\n }\n\n // Toggle the shelf when the controlled is clicked.\n if (this.dom.controller) {\n this.dom.controller.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.toggle();\n\n if (this.isOpen) {\n this.focusState = \"self\";\n this.isSoftLocked = true;\n }\n });\n }\n\n // Toggle hoverability when the hover controller is clicked.\n if (this.dom.hoverController) {\n this.dom.hoverController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleHover();\n\n if (this.hover) {\n this.open();\n }\n });\n }\n\n // Toggle shelf lock when the lock controller is clicked.\n if (this.dom.lockController) {\n this.dom.lockController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleLock();\n });\n }\n\n // Toggle shifting sides when the side controller is clicked.\n if (this.dom.sideController) {\n this.dom.sideController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleSide();\n });\n }\n\n // Catch all to open if shelf if there is a click inside of it.\n this.dom.shelf.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n this.focusState = \"self\";\n this.isSoftLocked = true;\n this.open();\n });\n\n // Close the shelf if a click happens outside of it.\n document.addEventListener(\"pointerup\", (event) => {\n if (this.focusState === \"none\") return;\n if (this.isLocked) return;\n if (\n this.dom.shelf === event.target ||\n this.dom.shelf.contains(event.target)\n )\n return;\n\n this.currentEvent = \"mouse\";\n this.close();\n });\n }\n\n _handleHover() {\n this.dom.shelf.addEventListener(\"pointerenter\", (event) => {\n if (event.pointerType === \"pen\" || event.pointerType === \"touch\") return;\n if (this.isLocked || this.isSoftLocked) return;\n if (!this.hover) return;\n\n this.currentEvent = \"mouse\";\n\n if (this.enterDelay > 0) {\n this._clearTimeout();\n this._setTimeout(() => {\n if (!this.isOpen) {\n this.open();\n }\n }, this.enterDelay);\n } else {\n this.open();\n }\n });\n\n this.dom.shelf.addEventListener(\"pointerleave\", (event) => {\n if (event.pointerType === \"pen\" || event.pointerType === \"touch\") return;\n if (this.isLocked || this.isSoftLocked) return;\n if (!this.hover) return;\n\n this.currentEvent = \"mouse\";\n\n if (this.leaveDelay > 0) {\n this._clearTimeout();\n this._setTimeout(() => {\n if (this.isOpen) {\n this.close();\n }\n }, this.leaveDelay);\n } else {\n this.close();\n }\n });\n }\n\n _handleKeydown() {\n // Prevent keydown events on the shelf if they are `Escape`.\n this.dom.shelf.addEventListener(\"keydown\", (event) => {\n const key = keyPress(event);\n\n if (key === \"Escape\") {\n preventEvent(event);\n }\n });\n\n // Prevent keydown events on all controller elements if they are `Space` or `Enter`.\n for (const element of Object.values(this.dom)) {\n if (!element) continue;\n if (Array.isArray(element)) continue;\n if (element === this.dom.shelf) continue;\n\n element.addEventListener(\"keydown\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n }\n });\n }\n }\n\n _handleKeyup() {\n // Close the shelf on `Escape`.\n this.dom.shelf.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Escape\") {\n this.close();\n }\n });\n\n // Toggle the shelf on `Space` or `Enter` on the controller.\n if (this.dom.controller) {\n this.dom.controller.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggle();\n\n if (this.isOpen) {\n const element = selectFirstFocusableElement(this.dom.shelf);\n element.focus();\n }\n }\n });\n }\n\n // Toggle hover on `Space` or `Enter` on the hover controller.\n if (this.dom.hoverController) {\n this.dom.hoverController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleHover();\n }\n });\n }\n\n // Toggle lock on `Space` or `Enter` on the lock controller.\n if (this.dom.lockController) {\n this.dom.lockController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleLock();\n }\n });\n }\n\n // Shift sides on `Space` or `Enter` on the side controller.\n if (this.dom.sideController) {\n this.dom.sideController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleSide();\n }\n });\n }\n }\n\n /**\n * Sets the transition durations of the shelf as a CSS custom properties.\n *\n * The custom properties are:\n * - `--graupl-transition-duration`,\n * - `--graupl-open-transition-duration`, and\n * - `--graupl-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the shelf's prefix value.\n *\n * @protected\n */\n _setTransitionDurations() {\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n _expand(emit = true) {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"true\");\n }\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the close class,\n // add the open class, and finally remove the transition class.\n if (this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.closeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.openClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.shelf);\n }, this.openDuration);\n });\n });\n });\n } else {\n // Add the open class\n addClass(this.openClass, this.dom.shelf);\n\n // Remove the close class.\n removeClass(this.closeClass, this.dom.shelf);\n }\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._expandEvent);\n }\n }\n\n _collapse(emit = true) {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n this.isSoftLocked = false;\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the open class,\n // add the close class, and finally remove the transition class.\n if (this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.openClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.closeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.shelf);\n }, this.closeDuration);\n });\n });\n });\n } else {\n // Add the close class\n addClass(this.closeClass, this.dom.shelf);\n\n // Remove the open class.\n removeClass(this.openClass, this.dom.shelf);\n }\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._collapseEvent);\n }\n }\n\n _lock(emit = true) {\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-pressed\", \"true\");\n }\n\n // Add the locked class\n addClass(this.lockedClass, this.dom.shelf);\n\n // Add the locked class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(this.lockedClass, dependent);\n });\n\n // Remove the unlocked class.\n removeClass(this.unlockedClass, this.dom.shelf);\n\n // Remove the unlocked class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(this.unlockedClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._lockEvent);\n }\n }\n\n _unlock(emit = true) {\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-pressed\", \"false\");\n }\n\n // Add the unlocked class\n addClass(this.unlockedClass, this.dom.shelf);\n\n // Add the unlocked class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(this.unlockedClass, dependent);\n });\n\n // Remove the locked class.\n removeClass(this.lockedClass, this.dom.shelf);\n\n // Remove the locked class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(this.lockedClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._unlockEvent);\n }\n }\n\n _shiftSide(emit = true) {\n const toClass = this._classes[this.side];\n const fromClass = this._classes[this.otherSide];\n\n // Add the to class\n addClass(toClass, this.dom.shelf);\n\n // Add the to class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(toClass, dependent);\n });\n\n // Remove the from class.\n removeClass(fromClass, this.dom.shelf);\n\n // Remove the from class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(fromClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._shiftEvent);\n }\n }\n\n _enableHover(emit = true) {\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-pressed\", \"true\");\n }\n\n addClass(this.hoverClass, this.dom.shelf);\n\n removeClass(this.noHoverClass, this.dom.shelf);\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._enableHoverEvent);\n }\n }\n\n _disableHover(emit = true) {\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-pressed\", \"false\");\n }\n\n addClass(this.noHoverClass, this.dom.shelf);\n\n removeClass(this.hoverClass, this.dom.shelf);\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._disableHoverEvent);\n }\n }\n\n open(force = false) {\n // Only open if the shelf is closed.\n if (this.isOpen && !force) return;\n\n this._expand();\n\n // Set the open flag.\n this._open = true;\n }\n\n close(force = false) {\n // Only close if the shelf is open.\n if (!this.isOpen && !force) return;\n\n this.unlock();\n this._collapse();\n\n // Set the open flag.\n this._open = false;\n }\n\n toggle() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n lock() {\n // Only lock if the shelf is unlocked.\n if (this.isLocked) return;\n\n this._lock();\n\n // Set the locked flag.\n this._locked = true;\n\n // Open the shelf.\n this.open(true);\n }\n\n unlock() {\n // Only unlock if the shelf is locked.\n if (!this.isLocked) return;\n\n this._unlock();\n\n // Set the locked flag.\n this._locked = false;\n }\n\n toggleLock() {\n if (this.isLocked) {\n this.unlock();\n } else {\n this.lock();\n }\n }\n\n toLeft() {\n if (this.side === \"left\") return;\n\n this._side = \"left\";\n this._otherSide = \"right\";\n this._shiftSide();\n }\n\n toRight() {\n if (this.side === \"right\") return;\n\n this._side = \"right\";\n this._otherSide = \"left\";\n this._shiftSide();\n }\n\n toggleSide() {\n if (this.side === \"left\") {\n this.toRight();\n } else {\n this.toLeft();\n }\n }\n\n enableHover() {\n if (this.hover) return;\n\n this._enableHover();\n\n this._hover = true;\n }\n\n disableHover() {\n if (!this.hover) return;\n\n this._disableHover();\n\n this._hover = false;\n }\n\n toggleHover() {\n if (this.hover) {\n this.disableHover();\n } else {\n this.enableHover();\n }\n }\n}\n\nexport default NavigationShelf;\n","/**\n * Mark DOM elements as processed to prevent multiple initializations.\n *\n * @module @drupal/once\n *\n * @example <!-- Use as a module -->\n * <script type=\"module\">\n * import once from 'https://unpkg.com/@drupal/once/src/once.js';\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n *\n * @example <!-- Use as a regular script -->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n * @example <!-- Using a single element as input-->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * // once methods always return an array, to simplify the use with a single\n * // element use destructuring or the shift method.\n * const [myElement] = once('my-once-id', document.body);\n * const myElement = once('my-once-id', document.body).shift();\n * </script>\n */\n\n/**\n * Illegal spaces in ids.\n *\n * @private\n *\n * @type {RegExp}\n */\nconst wsRE = /[\\11\\12\\14\\15\\40]+/;\n\n/**\n * Name of the HTML attribute containing an element's once ids.\n *\n * @private\n *\n * @type {string}\n */\nconst attrName = 'data-once';\n\n/**\n * Shortcut to access the html element.\n *\n * @private\n *\n * @type {HTMLElement}\n */\nconst doc = document;\n\n/**\n * Helper to access element attributes.\n *\n * @private\n *\n * @param {Element} element\n * The Element to access the data-once attribute from.\n * @param {string} op\n * The action to take on the element.\n * @param {string} [value]\n * Optional value for setAttribute.\n *\n * @return {string|undefined|null|boolean}\n * Result of the attribute method.\n */\nfunction attr(element, op, value) {\n return element[`${op}Attribute`](attrName, value);\n}\n\n/**\n * Return the attribute selector.\n *\n * @private\n *\n * @param {string} id\n * The id passed by a call to a once() function.\n *\n * @return {string}\n * The full CSS attribute selector.\n *\n * @throws {TypeError|RangeError}\n */\nfunction attrSelector(id) {\n // Verify the validity of the once id.\n if (typeof id !== 'string') {\n throw new TypeError('once ID must be a string');\n }\n if (id === '' || wsRE.test(id)) {\n throw new RangeError('once ID must not be empty or contain spaces');\n }\n // The id is valid, return the full CSS selector.\n return `[${attrName}~=\"${id}\"]`;\n}\n\n/**\n * Verifies that an item is an instance of Element.\n *\n * This function is used during filtering to ensure only DOM elements are\n * processed. once() makes use of get/setAttribute, which are methods\n * inherited from the Element object, so only of Element can be used.\n *\n * @private\n *\n * @param {*} itemToCheck\n * The item to check.\n *\n * @return {boolean}\n * True if the item is an instance of Element\n *\n * @throws {TypeError}\n */\nfunction checkElement(itemToCheck) {\n if (!(itemToCheck instanceof Element)) {\n throw new TypeError('The element must be an instance of Element');\n }\n return true;\n}\n\n/**\n * Process arguments, query the DOM if necessary.\n *\n * @private\n *\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array with the processed Id and the list of elements to process.\n */\nfunction getElements(selector, context = doc) {\n // Assume selector is an array-like value.\n let elements = selector;\n\n // If selector is null it is most likely because of a call to querySelector\n // that didn't return a result.\n if (selector === null) {\n elements = [];\n }\n // The selector is undefined, error out.\n else if (!selector) {\n throw new TypeError('Selector must not be empty');\n }\n // Context doesn't implement querySelectorAll, error out.\n else if (\n !(\n context instanceof Document ||\n context instanceof DocumentFragment ||\n context instanceof Element\n )\n ) {\n throw new TypeError(\n 'Context must be an object of type \"Document\", \"DocumentFragment\", or \"Element\".',\n );\n }\n // This is a selector, query the elements.\n else if (typeof selector === 'string') {\n elements = context.querySelectorAll(selector);\n }\n // This is a single element.\n else if (selector instanceof Element) {\n elements = [selector];\n }\n\n // Make sure an array is returned and not a NodeList or an Array-like object.\n return Array.prototype.slice.call(elements);\n}\n\n/**\n * A helper for applying DOM changes to a filtered set of elements.\n *\n * This makes it possible to filter items that are not instances of Element,\n * then modify their DOM attributes in a single array traversal.\n *\n * @private\n *\n * @param {string} selector\n * A CSS selector to check against to each element in the array.\n * @param {Array.<Element>} elements\n * A NodeList or array of elements passed by a call to a once() function.\n * @param {function} [apply]\n * An optional function to apply on all matched elements.\n *\n * @return {Array.<Element>}\n * The array of elements that match the CSS selector.\n */\nfunction filterAndModify(selector, elements, apply) {\n return elements.filter((element) => {\n const selected = checkElement(element) && element.matches(selector);\n if (selected && apply) {\n apply(element);\n }\n return selected;\n });\n}\n\n/**\n * Add or remove an item from a list of once values.\n *\n * This function removes duplicates while adding or removing a once id in a\n * single array traversal.\n *\n * @private\n *\n * @param {Element} element\n * A space separated string of once ids from a data-drupal-once attribute.\n * @param {string} [add]\n * The once id to add to the list of values.\n * @param {string} [remove]\n * The once id to remove from the list of values.\n *\n * @return {undefined}\n * Nothing to return this is a callback in a foreach.\n */\nfunction updateAttribute(element, { add, remove }) {\n const result = [];\n if (attr(element, 'has')) {\n attr(element, 'get')\n .trim()\n .split(wsRE)\n .forEach((item) => {\n if (result.indexOf(item) < 0 && item !== remove) {\n result.push(item);\n }\n });\n }\n if (add) {\n result.push(add);\n }\n const attribute = result.join(' ');\n attr(element, attribute === '' ? 'remove' : 'set', attribute);\n}\n\n/**\n * Ensures a JavaScript callback is only executed once on a set of elements.\n *\n * Filters a NodeList or array of elements, removing those already processed\n * by a callback with a given id.\n * This method adds a `data-once` attribute on DOM elements. The value of\n * this attribute identifies if a given callback has been executed on that\n * element.\n *\n * @global\n *\n * @example <caption>Basic usage</caption>\n * const elements = once('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once('my-once-id', document.querySelector('#some-id'));\n * @example <caption>Using a single element</caption>\n * // Once always returns an array, even when passing a single element. Some\n * // forms that can be used to keep code readable.\n * // Destructuring:\n * const [myElement] = once('my-once-id', document.body);\n * // By changing the resulting array, es5 compatible.\n * const myElement = once('my-once-id', document.body).shift();\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array of elements that have not yet been processed by a once call\n * with a given id.\n */\nfunction once(id, selector, context) {\n return filterAndModify(\n `:not(${attrSelector(id)})`,\n getElements(selector, context),\n (element) => updateAttribute(element, { add: id }),\n );\n}\n\n/**\n * Removes a once id from an element's data-drupal-once attribute value.\n *\n * If a once id is removed from an element's data-drupal-once attribute value,\n * the JavaScript callback associated with that id can be executed on that\n * element again.\n *\n * @method once.remove\n *\n * @example <caption>Basic usage</caption>\n * const elements = once.remove('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.remove('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.remove('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.remove('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.remove('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.remove('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of a once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that had been processed by the provided id,\n * and are now able to be processed again.\n */\nonce.remove = (id, selector, context) => {\n return filterAndModify(\n attrSelector(id),\n getElements(selector, context),\n (element) => updateAttribute(element, { remove: id }),\n );\n};\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Behaves like {@link once} and {@link once.remove} without changing the DOM.\n * To select all DOM nodes processed by a given id, use {@link once.find}.\n *\n * @method once.filter\n *\n * @example <caption>Basic usage</caption>\n * const filteredElements = once.filter('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.filter('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.filter('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.filter('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.filter('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.filter('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.filter = (id, selector, context) =>\n filterAndModify(attrSelector(id), getElements(selector, context));\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Query the 'context' element for elements that already have the\n * corresponding once id value.\n *\n * @method once.find\n *\n * @example <caption>Basic usage</caption>\n * const oncedElements = once.find('my-once-id');\n * @example <caption>Input parameters accepted</caption>\n * // Call without parameters, return all elements with a `data-once` attribute.\n * once.find();\n * // Call without a context.\n * once.find('my-once-id');\n * // Call with a context.\n * once.find('my-once-id', document.head);\n *\n * @param {string} [id]\n * The id of the once call.\n * @param {Document|DocumentFragment|Element} [context=document]\n * Scope of the search for matching elements.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.find = (id, context) =>\n getElements(!id ? `[${attrName}]` : attrSelector(id), context);\n\nexport default once;\n","import NavigationShelf from \"./NavigationShelf.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n navigationShelfSelector = \".navigation-shelf\"\n) => {\n once(\n \"graupl-navigation-shelf-generator\",\n navigationShelfSelector,\n context\n ).forEach((shelfElement) => {\n const navigationShelfOptions = shelfElement.dataset\n .grauplNavigationShelfOptions\n ? JSON.parse(\n shelfElement.dataset.grauplNavigationShelfOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new NavigationShelf({\n shelfElement,\n controllerElement:\n context.querySelector(\".navigation-shelf-toggle\") || null,\n lockControllerElement:\n context.querySelector(\".navigation-shelf-lock-toggle\") || null,\n hoverControllerElement:\n context.querySelector(\".navigation-shelf-hover-toggle\") || null,\n sideControllerElement:\n context.querySelector(\".navigation-shelf-side-toggle\") || null,\n initialize: true,\n ...options,\n ...navigationShelfOptions,\n });\n });\n};\n\nexport default generate;\n","import generate from \"./generator.js\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n generate();\n});\n"],"x_google_ignoreList":[6],"mappings":"YAeA,SAAgB+G,EAAgB9G,EAAYiV,EAAU,CACpD,GAAI,CACF,GAAA,OAAWA,GAAa,SAAU,CAChC,MAAM/U,EAAAA,OAAsB+U,EAE5B,MAAM,IAAIT,UACR,qEAAqEtU,CAAAA,UACvE,CACF,CAEA,UAAW+N,KAAOgH,EAChB,GAAA,EAAMA,EAAShH,CAAAA,YAAgBjO,GAAa,CAC1C,MAAM8P,EAAAA,OAAqBmF,EAAShH,CAAAA,EACpC,MAAM,IAAIuG,UACR,GAAGvG,CAAAA,2BAA8BjO,EAAWM,IAAAA,MAAUwP,CAAAA,UACxD,CACF,CAGF,MAAO,CACLjB,OAAQ,GACRpB,MAAO,IACR,CACF,OAAQA,EAAO,CACd,MAAO,CACLoB,OAAQ,GACRpB,MAAAA,CACD,CACH,CACF,CAiBA,SAAgB5G,EAAYb,EAAMkM,EAAQ,CACxC,GAAI,CACF,GAAA,OAAWA,GAAW,SAAU,CAC9B,MAAMtR,EAAAA,OAAoBsR,EAE1B,MAAM,IAAIsC,UACR,+DAA+D5T,CAAAA,UACjE,C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AAA,CACF,CAAA,CACF,ECjCDa,SAASC,iBAAiB,mBAAoB,IAAM,CAClDF,EAAAA,CACD,CAAA"}
|
|
1
|
+
{"version":3,"file":"navigation-shelf.js","names":["isValidInstance","constructor","elements","elementsType","TypeError","key","elementType","name","status","error","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidHoverType","validTypes","includes","join","isTag","tagName","HTMLElement","tag","toLowerCase","check","isValidState","validStates","isValidEvent","validEvents","isValidSideType","values","type","TypeError","validTypes","key","includes","join","status","error","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Tab","Object","find","preventEvent","preventDefault","stopPropagation","addClass","className","element","length","classList","add","removeClass","remove","selectAllFocusableElements","context","document","querySelector","elements","Array","from","querySelectorAll","tabbableElements","filter","check","getAttribute","selectFirstFocusableElement","selectLastFocusableElement","selectNextFocusableElement","index","indexOf","selectPreviousFocusableElement","isValidType","initializeStorage","type","window","Graupl","getStorage","setStorage","data","clearStorage","pushToStorage","key","value","getFromStorage","removeFromStorage","TransactionalValue","constructor","initialValue","options","_equals","equals","Object","is","_current","_committed","value","val","committed","isDirty","commit","reset","update","fn","isValidClassList","isValidType","isValidInstance","isValidState","isValidEvent","isValidSideType","keyPress","preventEvent","addClass","removeClass","selectFirstFocusableElement","storage","TransactionalValue","NavigationShelf","_dom","shelf","controller","lockController","hoverController","sideController","dependents","_selectors","_classes","locked","unlocked","hover","noHover","left","right","open","close","transistion","initialize","_durations","transition","_delays","enter","leave","_focusState","_currentEvent","_hover","_hoverTimeout","_locked","_softLocked","_side","_otherSide","_open","_breakpointWidth","_observer","_expandEvent","CustomEvent","bubbles","detail","_collapseEvent","_lockEvent","_unlockEvent","_shiftEvent","_enableHoverEvent","_disableHoverEvent","_initialized","_prefix","_key","_errors","constructor","shelfElement","controllerElement","lockControllerElement","hoverControllerElement","sideControllerElement","dependentSelector","lockedClass","unlockedClass","hoverClass","noHoverClass","leftClass","rightClass","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","hoverDelay","enterDelay","leaveDelay","side","prefix","initializeClass","_validate","Error","errors","join","_setTransitionDurations","_generateKey","_setDOMElements","_setIds","_setAriaAttributes","_handleFocus","_handleClick","_handleHover","_handleKeydown","_handleKeyup","_handleResize","dom","getAttribute","isLocked","_expand","_lock","_collapse","_enableHover","_disableHover","_shiftSide","initializeStorage","pushToStorage","id","error","console","selectors","value","focusState","currentEvent","shouldBeLocked","committed","otherSide","key","isSoftLocked","isOpen","check","htmlElements","htmlElementChecks","HTMLElement","status","push","message","classes","Object","keys","classChecks","durations","durationChecks","hoverCheck","delays","delayChecks","prefixCheck","lockedCheck","sideCheck","_setDOMElementType","elementType","base","overwrite","strict","Array","isArray","domElements","from","querySelectorAll","filteredElements","filter","item","parentElement","domElement","querySelector","_resetDOMElementType","document","regenerate","Math","random","toString","replace","substring","setAttribute","_hoverType","_clearTimeout","clearTimeout","_setTimeout","callback","delay","setTimeout","width","ResizeObserver","entries","requestAnimationFrame","entry","boxSize","contentBoxSize","inlineSize","contentRect","belowBreakpoint","aboveBreakpoint","preserveLock","reset","lock","force","observe","body","addEventListener","event","relatedTarget","contains","element","values","passive","button","toggle","toggleHover","toggleLock","toggleSide","target","pointerType","focus","style","setProperty","emit","dispatchEvent","forEach","dependent","_unlock","toClass","fromClass","unlock","updateLock","commit","toLeft","toRight","enableHover","disableHover","wsRE","attrName","doc","document","attr","element","op","value","attrSelector","id","TypeError","test","RangeError","checkElement","itemToCheck","Element","getElements","selector","context","elements","Document","DocumentFragment","querySelectorAll","Array","prototype","slice","call","filterAndModify","apply","filter","selected","matches","updateAttribute","add","remove","result","trim","split","forEach","item","indexOf","push","attribute","join","once","find","NavigationShelf","once","generate","options","context","document","navigationShelfSelector","forEach","shelfElement","navigationShelfOptions","dataset","grauplNavigationShelfOptions","JSON","parse","replace","controllerElement","querySelector","lockControllerElement","hoverControllerElement","sideControllerElement","initialize","generate","document","addEventListener"],"sources":["../../../core/src/js/validate.js","../../src/js/validate.js","../../../core/src/js/eventHandlers.js","../../../core/src/js/domHelpers.js","../../../core/src/js/storage.js","../../../core/src/js/TransactionalValue.js","../../src/js/navigation-shelf/NavigationShelf.js","../../../../node_modules/@drupal/once/src/once.js","../../src/js/navigation-shelf/generator.js","../../src/js/navigation-shelf/index.js"],"sourcesContent":["/**\n * Check to see if the provided elements have a specific constructor.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking instanceof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {object} constructor - The constructor to check for.\n * @param {object} elements - The element(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidInstance(constructor, elements) {\n try {\n if (typeof elements !== \"object\") {\n const elementsType = typeof elements;\n\n throw new TypeError(\n `Elements given to isValidInstance() must be inside of an object. \"${elementsType}\" given.`\n );\n }\n\n for (const key in elements) {\n if (!(elements[key] instanceof constructor)) {\n const elementType = typeof elements[key];\n throw new TypeError(\n `${key} must be an instance of ${constructor.name}. \"${elementType}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are of a specific type.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking typeof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} type - The type to check for.\n * @param {object} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidType(type, values) {\n try {\n if (typeof values !== \"object\") {\n const valuesType = typeof values;\n\n throw new TypeError(\n `Values given to isValidType() must be inside of an object. \"${valuesType}\" given.`\n );\n }\n\n for (const key in values) {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(`${key} must be a ${type}. \"${valueType}\" given.`);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided values are valid query selectors.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isQuerySelector(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isQuerySelector() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n try {\n if (values[key] === null) {\n throw new Error();\n }\n\n document.querySelector(values[key]);\n } catch {\n throw new TypeError(\n `${key} must be a valid query selector. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided value is either a string or an array of strings.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string, string[]>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidClassList(values) {\n try {\n if (typeof values !== \"object\" || Array.isArray(values)) {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidClassList() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n const type = typeof values[key];\n\n if (type !== \"string\") {\n if (Array.isArray(values[key])) {\n values[key].forEach((value) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `${key} must be a string or an array of strings. An array containing non-strings given.`\n );\n }\n });\n } else {\n throw new TypeError(\n `${key} must be a string or an array of strings. \"${type}\" given.`\n );\n }\n } else {\n const obj = {};\n obj[key] = values[key];\n\n isQuerySelector(obj);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid hover types.\n *\n * Available types are: `\"off\"`, `\"on\"`, and `\"dynamic\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidHoverType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidHoverType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"off\", \"on\", \"dynamic\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided elements are using a specific tag.\n *\n * The elements must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `true` if the check is successful.\n *\n * @param {string} tagName - The name of the tag.\n * @param {Object<HTMLElement>} elements - The element(s) to check.\n * @return {boolean} - The result of the check.\n */\nexport function isTag(tagName, elements) {\n if (\n isValidType(\"string\", { tagName }).status &&\n isValidInstance(HTMLElement, elements).status\n ) {\n const tag = tagName.toLowerCase();\n let check = true;\n\n for (const key in elements) {\n if (elements[key].tagName.toLowerCase() !== tag) check = false;\n }\n\n return check;\n } else {\n return false;\n }\n}\n\n/**\n * Check to see if the provided values are valid focus states for a menu.\n *\n * Available states are: `\"none\"`, `\"self\"`, and `\"child\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidState(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidState() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validStates = [\"none\", \"self\", \"child\"];\n\n for (const key in values) {\n if (!validStates.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validStates.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid event types for a menu.\n *\n * Available events are: `\"none\"`, `\"mouse\"`, `\"keyboard\"`, and `\"character\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidEvent(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidEvent() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validEvents = [\"none\", \"mouse\", \"keyboard\", \"character\"];\n\n for (const key in values) {\n if (!validEvents.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validEvents.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * Check to see if the provided values are valid side types.\n *\n * Available types are: `\"left\"` and `\"right\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidSideType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidSideType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"left\", \"right\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * Retrieves the pressed key from an event.\n *\n * @param {KeyboardEvent} event - The keyboard event.\n * @return {string} - The name of the key or an empty string.\n */\nexport function keyPress(event) {\n try {\n // Use event.key or event.keyCode to support older browsers.\n const key = event.key || event.keyCode;\n const keys = {\n Enter: key === \"Enter\" || key === 13,\n Space: key === \" \" || key === \"Spacebar\" || key === 32,\n Escape: key === \"Escape\" || key === \"Esc\" || key === 27,\n ArrowUp: key === \"ArrowUp\" || key === \"Up\" || key === 38,\n ArrowRight: key === \"ArrowRight\" || key === \"Right\" || key === 39,\n ArrowDown: key === \"ArrowDown\" || key === \"Down\" || key === 40,\n ArrowLeft: key === \"ArrowLeft\" || key === \"Left\" || key === 37,\n Home: key === \"Home\" || key === 36,\n End: key === \"End\" || key === 35,\n Tab: key === \"Tab\" || key === 9,\n };\n\n return Object.keys(keys).find((key) => keys[key] === true) || \"\";\n } catch {\n // Return an empty string if something goes wrong.\n return \"\";\n }\n}\n\n/**\n * Stops an event from taking action.\n *\n * @param {Event} event - The event.\n */\nexport function preventEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n","/**\n * Add a class or array of classes to an element.\n *\n * @param {string|string[]} className - The class or classes to add.\n * @param {HTMLElement} element - The element to add the class to.\n */\nexport function addClass(className, element) {\n // Gracefully handle empty strings or arrays.\n if (className === \"\" || className.length === 0) {\n return;\n }\n\n if (typeof className === \"string\") {\n element.classList.add(className);\n } else {\n element.classList.add(...className);\n }\n}\n\n/**\n * Remove a class or array of classes from an element.\n *\n * @param {string|string[]} className - The class or classes to remove.\n * @param {HTMLElement} element - The element to remove the class from.\n */\nexport function removeClass(className, element) {\n // Gracefully handle empty strings or arrays.\n if (className === \"\" || className.length === 0) {\n return;\n }\n\n if (typeof className === \"string\") {\n element.classList.remove(className);\n } else {\n element.classList.remove(...className);\n }\n}\n\n/**\n * Select all focusable elements within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement[]} - An array of focusable elements.\n */\nexport function selectAllFocusableElements(context = document) {\n const querySelector =\n \"a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),[tabindex]\";\n const elements = Array.from(context.querySelectorAll(querySelector));\n\n const tabbableElements = elements.filter((element) => {\n let check = true;\n\n if (element.getAttribute(\"tabindex\") === \"-1\") check = false;\n\n return check;\n });\n\n return tabbableElements;\n}\n\n/**\n * Select the first focusable element within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The first focusable element or false if none found.\n */\nexport function selectFirstFocusableElement(context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n\n return tabbableElements[0] || false;\n}\n\n/**\n * Select the last focusable element within a given context.\n *\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The last focusable element or false if none found.\n */\nexport function selectLastFocusableElement(context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n\n return tabbableElements[tabbableElements.length - 1] || false;\n}\n\n/**\n * Select the next focusable element relative to the given element within a context.\n *\n * @param {HTMLElement} element - The reference element.\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The next focusable element or false if none found.\n */\nexport function selectNextFocusableElement(element, context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n const index = tabbableElements.indexOf(element);\n\n return index === tabbableElements.length - 1\n ? false\n : tabbableElements[index + 1];\n}\n\n/**\n * Select the previous focusable element relative to the given element within a context.\n *\n * @param {HTMLElement} element - The reference element.\n * @param {HTMLElement} [context = document] - The context in which to search for focusable elements.\n * @return {HTMLElement|boolean} - The previous focusable element or false if none found.\n */\nexport function selectPreviousFocusableElement(element, context = document) {\n const tabbableElements = selectAllFocusableElements(context);\n const index = tabbableElements.indexOf(element);\n\n return index === 0 ? false : tabbableElements[index - 1];\n}\n","/**\n * @file\n * Provides a system to get and store Graupl data in the browser.\n */\n\nimport { isValidType } from \"./validate.js\";\n\n/**\n * Initializes the storage system.\n *\n * @param {?string} [type = null] - The type of storage to initialize.\n */\nexport function initializeStorage(type = null) {\n window.Graupl = window.Graupl || {};\n\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = window.Graupl[type] || {};\n }\n}\n\n/**\n * Get the storage object.\n *\n * @param {?string} type - The type of storage to get.\n * @return {object} - The storage object.\n */\nexport function getStorage(type = null) {\n if (isValidType(\"string\", { type })) {\n return window.Graupl[type];\n }\n\n return window.Graupl;\n}\n\n/**\n * Set the storage object of a given type.\n *\n * @param {string} type - The type of storage to set.\n * @param {object} data - The data to set.\n */\nexport function setStorage(type, data = {}) {\n if (isValidType(\"string\", { type }) && isValidType(\"object\", { data })) {\n window.Graupl[type] = data;\n }\n}\n\n/**\n * Clear the storage object of a given type.\n *\n * @param {string} type - The type of storage to clear.\n */\nexport function clearStorage(type) {\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = {};\n }\n}\n\n/**\n * Push a value to the storage object.\n *\n * @param {string} type - The type of storage to push to.\n * @param {string} key - The key to use for the value.\n * @param {*} value - The value to store.\n */\nexport function pushToStorage(type, key, value) {\n if (isValidType(\"string\", { type, key })) {\n window.Graupl[type][key] = value;\n }\n}\n\n/**\n * Get a value from the storage object.\n *\n * @param {string }type - The type of storage to get from.\n * @param {string }key - The key to get the value from.\n * @return {*} - The value from the storage object.\n */\nexport function getFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n return window.Graupl[type][key];\n }\n\n return null;\n}\n\n/**\n * Remove a value from the storage object.\n *\n * @param {string} type - The type of storage to remove from.\n * @param {string} key - The key to remove the value from.\n */\nexport function removeFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n delete window.Graupl[type][key];\n }\n}\n\nexport default {\n initializeStorage,\n getStorage,\n setStorage,\n clearStorage,\n pushToStorage,\n getFromStorage,\n removeFromStorage,\n};\n","/**\n * A utility class that maintains a \"current\" value and a \"committed\" value.\n *\n * Useful when you need to:\n * - Track in-progress edits and revert to the last saved state.\n * - Compare pending and committed states.\n * - Know if a value has changed since last commit.\n *\n * @example\n * // Managing a form field\n * const username = new TransactionalValue(\"Nick\");\n * username.value = \"NickDJM\";\n * if (username.isDirty) {\n * console.log(\"Unsaved changes detected\");\n * username.commit(); // saves the new value\n * }\n *\n * @example\n * // Reverting edits\n * const counter = new TransactionalValue(10);\n * counter.value = 15;\n * counter.reset(); // reverts to 10\n */\nexport class TransactionalValue {\n /**\n * Creates a new TransactionalValue instance.\n *\n * @param {*} initialValue - The starting (and initially committed) value.\n * @param {{ equals?: function(*, *): boolean }} [options] - Optional config.\n * @param {function(*, *): boolean} [options.equals] - Custom equality comparator. Defaults to `Object.is`.\n */\n constructor(initialValue, options = {}) {\n /**\n * A comparator function used to check equality between\n * the current and committed values.\n *\n * @private\n *\n * @type {function(*, *): boolean}\n */\n this._equals = options.equals || Object.is;\n\n /**\n * The current, editable value.\n *\n * @private\n *\n * @type {*}\n */\n this._current = initialValue;\n\n /**\n * The last committed (baseline) value.\n *\n * @private\n *\n * @type {*}\n */\n this._committed = initialValue;\n }\n\n /**\n * Gets the current editable value.\n *\n * @return {*} The current value.\n *\n * @see _current\n */\n get value() {\n return this._current;\n }\n\n /**\n * Sets the current editable value.\n *\n * @param {*} val - The new value.\n */\n set value(val) {\n this._current = val;\n }\n\n /**\n * Gets the last committed (baseline) value.\n *\n * @readonly\n *\n * @return {*} The last committed value.\n *\n * @see _committed\n */\n get committed() {\n return this._committed;\n }\n\n /**\n * Checks whether the current value differs from the committed one.\n *\n * @readonly\n *\n * @return {boolean} `true` if current and committed values differ.\n */\n get isDirty() {\n return !this._equals(this._current, this._committed);\n }\n\n /**\n * Commits the current value, setting it as the new baseline.\n *\n * @return {TransactionalValue} The current instance.\n */\n commit() {\n this._committed = this._current;\n return this;\n }\n\n /**\n * Resets the current value to the committed baseline.\n *\n * @return {TransactionalValue} The current instance.\n */\n reset() {\n this._current = this._committed;\n return this;\n }\n\n /**\n * Applies a functional update to the current value.\n *\n * @param {function(*): *} fn - A function that receives the previous value and returns the new one.\n * @return {TransactionalValue} The current instance.\n *\n * @example\n * const t = new TransactionalValue(1);\n * t.update(n => n + 1); // 2\n */\n update(fn) {\n this._current = fn(this._current);\n return this;\n }\n}\n","import {\n isValidClassList,\n isValidType,\n isValidInstance,\n isValidState,\n isValidEvent,\n} from \"@graupl/core/src/validate.js\";\nimport { isValidSideType } from \"../validate.js\";\nimport { keyPress, preventEvent } from \"@graupl/core/src/eventHandlers.js\";\nimport {\n addClass,\n removeClass,\n selectFirstFocusableElement,\n} from \"@graupl/core/src/domHelpers.js\";\nimport storage from \"@graupl/core/src/storage.js\";\nimport { TransactionalValue } from \"@graupl/core/src/TransactionalValue.js\";\n\nclass NavigationShelf {\n /**\n * The DOM elements within the shelf.\n *\n * @protected\n *\n * @type {Object<HTMLElement,HTMLElement[]>}\n *\n * @property {HTMLElement} shelf - The shelf element.\n * @property {HTMLElement} controller - The toggle for this shelf.\n * @property {HTMLElement} lockController - The toggle for locking this shelf.\n * @property {HTMLElement} hoverController - The toggle for hoverability of this shelf.\n * @property {HTMLElement} sideController - The toggle for the side controller of this shelf.\n * @property {HTMLElement[]} dependents - The list of dependent elements that should be updated when the shelf is opened or closed.\n */\n _dom = {\n shelf: null,\n controller: null,\n lockController: null,\n hoverController: null,\n sideController: null,\n dependents: [],\n };\n\n /**\n * The query selectors used by the shelf to populate the dom.\n *\n * @protected\n *\n * @type {Object<string>}\n *\n * @property {string} dependents - The query selector for dependent elements.\n */\n _selectors = {\n dependents: \"\",\n };\n\n /**\n * The class(es) to apply to the shelf and dependent elements in various scenarios.\n *\n * @protected\n *\n * @type {Object<string,string[]>}\n *\n * @property {string|string[]} locked - The class(es) to apply to the shelf and dependent elements when the shelf is locked.\n * @property {string|string[]} unlocked - The class(es) to apply to the shelf and dependent elements when the shelf is unlocked.\n * @property {string|string[]} hover - The class(es) to apply to the shelf element when the shelf is hoverable.\n * @property {string|string[]} noHover - The class(es) to apply to the shelf element when the shelf is not hoverable.\n * @property {string|string[]} left - The class(es) to apply to the shelf and dependent elements when the shelf is on the left side.\n * @property {string|string[]} right - The class(es) to apply to the shelf and dependent elements when the shelf is on the right side.\n * @property {string|string[]} open - The class(es) to apply to the shelf when the shelf is open.\n * @property {string|string[]} close - The class(es) to apply to the shelf when the shelf is closed.\n * @property {string|string[]} transition - The class(es) to apply to the shelf and dependent elements when the shelf is transitioning between states.\n * @property {string|string[]} initialize - The class(es) to apply to the shelf when the shelf is initializing.\n */\n _classes = {\n locked: \"locked\",\n unlocked: \"unlocked\",\n hover: \"hoverable\",\n noHover: \"not-hoverable\",\n left: \"left-side\",\n right: \"right-side\",\n open: \"show\",\n close: \"hide\",\n transistion: \"transitioning\",\n initialize: \"initializing\",\n };\n\n /**\n * The duration times (in milliseconds) for various things throughout the navigation shelf.\n *\n * @protected\n *\n * @type {Object<number>}\n *\n * @property {number} transition - The duration time (in milliseconds) for the transition between open and closed states.\n * @property {number} open - The duration time (in milliseconds) for the transition from closed to open states.\n * @property {number} close - The duration time (in milliseconds) for the transition from open to closed states.\n */\n _durations = {\n transition: 250,\n open: -1,\n close: -1,\n };\n\n /**\n * The delay times (in milliseconds) for various things throughout the navigation shelf.\n *\n * @protected\n *\n * @type {Object<number>}\n *\n * @property {number} hover - The delay time (in milliseconds) used for pointerenter/pointerleave events to take place.\n * @property {number} enter - The delay time (in milliseconds) used for pointerenter events to take place.\n * @property {number} leave - The delay time (in milliseconds) used for pointerleave events to take place.\n */\n _delays = {\n hover: 250,\n enter: -1,\n leave: -1,\n };\n\n /**\n * The current state of the shelf's focus.\n *\n * @protected\n *\n * @type {string}\n */\n _focusState = \"none\";\n\n /**\n * This last event triggered on the shelf.\n *\n * @protected\n *\n * @type {string}\n */\n _currentEvent = \"none\";\n\n /**\n * A flag to indicate if the shelf is hoverable.\n *\n * @protected\n *\n * @type {boolean}\n */\n _hover = false;\n\n /**\n * A variable to hold the hover timeout function.\n *\n * @protected\n *\n * @type {?Function}\n */\n _hoverTimeout = null;\n\n /**\n * A flag to indicate if the navigation shelf is locked.\n *\n * @protected\n *\n * @type {TransactionalValue<boolean>}\n */\n _locked = new TransactionalValue(false);\n\n /**\n * A flag to check in the navigation shelf can dynamically close based on if the shelf has been manually interacted with already.\n *\n * @protected\n *\n * @type {boolean}\n */\n _softLocked = false;\n\n /**\n * The side of the screen the navigation shelf is on.\n *\n * @protected\n *\n * @type {string}\n */\n _side = \"left\";\n\n /**\n * The opposite side of the screen the naigation shelf is on.\n *\n * @protected\n *\n * @type {string}\n */\n _otherSide = \"right\";\n\n /**\n * The open state of the shelf.\n *\n * @protected\n *\n * @type {boolean}\n */\n _open = false;\n\n /**\n * The width of the screen (in pixels) that the menu will automatically open/close itself.\n *\n * @protected\n *\n * @type {number}\n */\n _breakpointWidth = 1180;\n\n /**\n * This ResizeObserver for the navigation shelf.\n *\n * @protected\n *\n * @type {ResizeObserver|null}\n */\n _observer = null;\n\n /**\n * The event that is triggered when the shelf expands.\n *\n * @protected\n *\n * @event grauplNavigationShelfExpand\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _expandEvent = new CustomEvent(\"grauplNavigationShelfExpand\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf collapses.\n *\n * @protected\n *\n * @event grauplNavigationShelfCollapse\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _collapseEvent = new CustomEvent(\"grauplNavigationShelfCollapse\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf is locked.\n *\n * @protected\n *\n * @event grauplNavigationShelfLock\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _lockEvent = new CustomEvent(\"grauplNavigationShelfLock\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf is unlocked.\n *\n * @protected\n *\n * @event grauplNavigationShelfUnlock\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _unlockEvent = new CustomEvent(\"grauplNavigationShelfUnlock\", {\n bubbles: true,\n detail: { shelf: this },\n });\n\n /**\n * The event that is triggered when the shelf has shifted sides.\n *\n * @protected\n *\n * @event grauplNavigationShelfShift\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _shiftEvent = new CustomEvent(\"grauplNavigationShelfShift\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * The event that is triggered when the shelf's hoverability is enabled.\n *\n * @protected\n *\n * @event grauplNavigationShelfEnableHoverable\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _enableHoverEvent = new CustomEvent(\"grauplNavigationShelfEnableHoverable\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * The event that is triggered when the shelf's hoverability is disabled.\n *\n * @protected\n *\n * @event grauplNavigationShelfDisableHover\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event.\n * @property {Object<NavigationShelf>} detail - The details object containing the NavigationShelf itself.\n */\n _disableHoverEvent = new CustomEvent(\"grauplNavigationShelfDisableHover\", {\n bubbles: true,\n detail: {\n shelf: this,\n },\n });\n\n /**\n * A flag to indicate if the shelf has been initialized.\n *\n * @protected\n *\n * @type {boolean}\n */\n _initialized = false;\n\n /**\n * The prefix to use for CSS custom properties.\n *\n * @protected\n *\n * @type {string}\n */\n _prefix = \"graupl-\";\n\n /**\n * The key used to generate IDs throughout the navigation shelf.\n *\n * @protected\n *\n * @type {string}\n */\n _key = \"\";\n\n /**\n * errors - The list of errors found during validation.\n *\n * @protected\n *\n * @type {string[]}\n */\n _errors = [];\n\n constructor({\n shelfElement,\n controllerElement,\n lockControllerElement,\n hoverControllerElement,\n sideControllerElement,\n dependentSelector = \".shelf-aware\",\n lockedClass = \"locked\",\n unlockedClass = \"unlocked\",\n hoverClass = \"hoverable\",\n noHoverClass = \"not-hoverable\",\n leftClass = \"left-side\",\n rightClass = \"right-side\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 250,\n openDuration = -1,\n closeDuration = -1,\n hover = false,\n hoverDelay = 250,\n enterDelay = -1,\n leaveDelay = -1,\n locked = false,\n side = \"left\",\n prefix = \"graupl-\",\n initializeClass = \"initializing\",\n initialize = false,\n } = {}) {\n // Set DOM elements.\n this._dom.shelf = shelfElement;\n this._dom.controller = controllerElement || null;\n this._dom.lockController = lockControllerElement || null;\n this._dom.hoverController = hoverControllerElement || null;\n this._dom.sideController = sideControllerElement || null;\n\n // Set DOM selectors.\n this._selectors.dependents = dependentSelector;\n\n // Set classes.\n this._classes.locked = lockedClass || \"\";\n this._classes.unlocked = unlockedClass || \"\";\n this._classes.hover = hoverClass || \"\";\n this._classes.noHover = noHoverClass || \"\";\n this._classes.left = leftClass || \"\";\n this._classes.right = rightClass || \"\";\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n this._classes.initialize = initializeClass || \"\";\n\n // Set transition duration.\n this._durations.transition = transitionDuration;\n this._durations.open = openDuration;\n this._durations.close = closeDuration;\n\n // Set locked state.\n this._locked = new TransactionalValue(locked);\n\n // Set side.\n this._side = side;\n\n // Set prefix.\n this._prefix = prefix || \"\";\n\n // Set hover settings.\n this._hover = hover;\n this._delays.hover = hoverDelay;\n this._delays.enter = enterDelay;\n this._delays.leave = leaveDelay;\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initialize the navigation shelf.\n */\n initialize() {\n try {\n if (!this._validate()) {\n throw new Error(\n `Graupl Navigation Shelf: cannot initialize navigation shelf. The following errors have been found:\\n - ${this.errors.join(\n \"\\n - \"\n )}`\n );\n }\n\n this._setTransitionDurations();\n\n // Set up the DOM.\n this._generateKey();\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n\n // Set up the event listeners.\n this._handleFocus();\n this._handleClick();\n this._handleHover();\n this._handleKeydown();\n this._handleKeyup();\n this._handleResize();\n\n // Ensure the initial open state of the shelf.\n if (\n this.dom.controller.getAttribute(\"aria-expanded\") === \"true\" ||\n this.isLocked\n ) {\n this._expand(false, false);\n\n if (this.isLocked) {\n this._lock(false);\n }\n } else {\n this._collapse(false, false);\n }\n\n // Ensure the initial hoverability of the shelf.\n if (this.hover) {\n this._enableHover(false);\n } else {\n this._disableHover(false);\n }\n\n // Ensure the initial side of the shelf.\n this._shiftSide(false);\n\n // Set up the storage.\n storage.initializeStorage(\"navigation-shelves\");\n storage.pushToStorage(\"navigation-shelves\", this.dom.shelf.id, this);\n\n // Set the initialized flag to true.\n this._initialized = true;\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * The DOM elements within the shelf.\n *\n * @readonly\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n *\n * @see _dom\n */\n get dom() {\n return this._dom;\n }\n\n /**\n * The query selectors used by the shelf to populate the DOM.\n *\n * @readonly\n *\n * @type {Object<string>}\n *\n * @see _selectors\n */\n get selectors() {\n return this._selectors;\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is locked.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get lockedClass() {\n return this._classes.locked;\n }\n\n set lockedClass(value) {\n isValidClassList({ lockedClass: value });\n\n if (this._classes.locked !== value) {\n this._classes.locked = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is unlocked.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get unlockedClass() {\n return this._classes.unlocked;\n }\n\n set unlockedClass(value) {\n isValidClassList({ unlockedClass: value });\n\n if (this._classes.unlocked !== value) {\n this._classes.unlocked = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf element when the shelf is hoverable.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get hoverClass() {\n return this._classes.hover;\n }\n\n set hoverClass(value) {\n isValidClassList({ hoverClass: value });\n\n if (this._classes.hover !== value) {\n this._classes.hover = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf element when the shelf is not hoverable.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get noHoverClass() {\n return this._classes.noHover;\n }\n\n set noHoverClass(value) {\n isValidClassList({ noHoverClass: value });\n\n if (this._classes.noHover !== value) {\n this._classes.noHover = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is on the left side.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get leftClass() {\n return this._classes.left;\n }\n\n set leftClass(value) {\n isValidClassList({ leftClass: value });\n\n if (this._classes.left !== value) {\n this._classes.left = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is on the right side.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get rightClass() {\n return this._classes.right;\n }\n\n set rightClass(value) {\n isValidClassList({ rightClass: value });\n\n if (this._classes.right !== value) {\n this._classes.right = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf when the shelf is open.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get openClass() {\n return this._classes.open;\n }\n\n set openClass(value) {\n isValidClassList({ openClass: value });\n\n if (this._classes.open !== value) {\n this._classes.open = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf when the shelf is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get closeClass() {\n return this._classes.close;\n }\n\n set closeClass(value) {\n isValidClassList({ closeClass: value });\n\n if (this._classes.close !== value) {\n this._classes.close = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf and dependent elements when the shelf is transitioning between states.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get transitionClass() {\n return this._classes.transition;\n }\n\n set transitionClass(value) {\n isValidClassList({ transitionClass: value });\n\n if (this._classes.transition !== value) {\n this._classes.transition = value;\n }\n }\n\n /**\n * The class(es) to apply to the shelf when the shelf is initializing.\n *\n * @type {string|string[]}\n *\n * @see _classes\n */\n get initializeClass() {\n return this._classes.initialize;\n }\n\n set initializeClass(value) {\n isValidClassList({ initializeClass: value });\n\n if (this._classes.initialize !== value) {\n this._classes.initialize = value;\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition between open and closed states.\n *\n * Setting this value will also set the --am-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _durations\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setTransitionDurations();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from closed to open states.\n *\n * If openDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --am-open-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _durations\n */\n get openDuration() {\n if (this._durations.open === -1) return this.transitionDuration;\n\n return this._durations.open;\n }\n\n set openDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._durations.open !== value) {\n this._durations.open = value;\n this._setTransitionDurations();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from open to closed states.\n *\n * If closeDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --am-close-transition-duration CSS custom property on the shelf.\n *\n * @type {number}\n *\n * @see _durations\n */\n get closeDuration() {\n if (this._durations.close === -1) return this.transitionDuration;\n\n return this._durations.close;\n }\n\n set closeDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._durations.close !== value) {\n this._durations.close = value;\n this._setTransitionDurations();\n }\n }\n\n /**\n * The current state of the shelf's focus.\n *\n * @type {string}\n *\n * @see _focusState\n */\n get focusState() {\n return this._focusState;\n }\n\n set focusState(value) {\n isValidState({ value });\n\n if (this._focusState !== value) {\n this._focusState = value;\n }\n }\n\n /**\n * The last event triggered on the shelf.\n *\n * @type {string}\n *\n * @see _currentEvent\n */\n get currentEvent() {\n return this._currentEvent;\n }\n\n set currentEvent(value) {\n isValidEvent({ value });\n\n if (this._currentEvent !== value) {\n this._currentEvent = value;\n }\n }\n\n /**\n * A flag to indicate if the shelf is hoverable.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _hover\n */\n get hover() {\n return this._hover;\n }\n\n /**\n * The delay time (in milliseconds) used for pointerenter/pointerleave events to take place.\n *\n * @type {number}\n *\n * @see _delays\n */\n get hoverDelay() {\n return this._delays.hover;\n }\n\n set hoverDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._delays.hover !== value) {\n this._delays.hover = value;\n }\n }\n\n /**\n * The delay time (in milliseconds) used for pointerenter events to take place.\n *\n * If enterDelay is set to -1, the hoverDelay value will be used instead.\n *\n * @type {number}\n *\n * @see _delays\n */\n get enterDelay() {\n if (this._delays.enter === -1) return this.hoverDelay;\n\n return this._delays.enter;\n }\n\n set enterDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._delays.enter !== value) {\n this._delays.enter = value;\n }\n }\n\n /**\n * The delay time (in milliseconds) used for pointerleave events to take place.\n *\n * If leaveDelay is set to -1, the hoverDelay value will be used instead.\n *\n * @type {number}\n *\n * @see _delays\n */\n get leaveDelay() {\n if (this._delays.leave === -1) return this.hoverDelay;\n\n return this._delays.leave;\n }\n\n set leaveDelay(value) {\n isValidType(\"number\", { value });\n\n if (this._delays.leave !== value) {\n this._delays.leave = value;\n }\n }\n\n /**\n * The prefix to use for CSS custom properties.\n *\n * @type {string}\n *\n * @see _prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n set prefix(value) {\n isValidType(\"string\", { value });\n\n if (this._prefix !== value) {\n this._prefix = value;\n }\n }\n\n /**\n * A flag to indicate if the navigation shelf is locked.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get isLocked() {\n return this._locked.value;\n }\n\n /**\n * The committed lock preference for the navigation shelf.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get shouldBeLocked() {\n return this._locked.committed;\n }\n\n /**\n * The side of the screen the navigation shelf is on.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _side\n */\n get side() {\n return this._side;\n }\n\n /**\n * The opposite side of the screen the navigation shelf is on.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _otherSide\n */\n get otherSide() {\n return this._otherSide;\n }\n\n /**\n * The key used to generate IDs throughout the accordion.\n *\n * @type {string}\n *\n * @see _key\n */\n get key() {\n return this._key;\n }\n\n set key(value) {\n isValidType(\"string\", { value });\n\n if (this._key !== value) {\n this._key = value;\n }\n }\n\n /**\n * A flag to check if the shelf can dynamically hover.\n *\n * @type {boolean}\n *\n * @see _softLocked\n */\n get isSoftLocked() {\n return this._softLocked;\n }\n\n set isSoftLocked(value) {\n isValidType(\"boolean\", { value });\n\n if (this._softLocked !== value) {\n this._softLocked = value;\n }\n }\n\n /**\n * The open state on the shelf.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _open\n */\n get isOpen() {\n return this._open;\n }\n\n /**\n * An array of error messages generated by the shelf.\n *\n * @readonly\n *\n * @type {string[]}\n *\n * @see _errors\n */\n get errors() {\n return this._errors;\n }\n\n /**\n * Validates all aspects of the shelf to ensure proper functionality.\n *\n * @protected\n *\n * @return {boolean} - The result of the validation.\n */\n _validate() {\n let check = true;\n\n // HTML element checks.\n const htmlElements = {\n shelfElement: this._dom.shelf,\n controllerElement: this._dom.controller,\n };\n\n if (this._dom.lockController) {\n htmlElements.lockControllerElement = this._dom.lockController;\n }\n if (this._dom.hoverController) {\n htmlElements.hoverControllerElement = this._dom.hoverController;\n }\n if (this._dom.sideController) {\n htmlElements.sideControllerElement = this._dom.sideController;\n }\n\n const htmlElementChecks = isValidInstance(HTMLElement, htmlElements);\n\n if (!htmlElementChecks.status) {\n this._errors.push(htmlElementChecks.error.message);\n check = false;\n }\n\n // Class list checks.\n const classes = {};\n for (const key of Object.keys(this._classes)) {\n if (this._classes[key] === \"\") continue;\n\n classes[`${key}Class`] = this._classes[key];\n }\n const classChecks = isValidClassList(classes);\n\n if (!classChecks.status) {\n this._errors.push(classChecks.error.message);\n check = false;\n }\n\n // Duration checks.\n const durations = {};\n for (const key of Object.keys(this._durations)) {\n if (this._durations[key] === \"\") continue;\n\n durations[`${key}Duration`] = this._durations[key];\n }\n const durationChecks = isValidType(\"number\", durations);\n\n if (!durationChecks.status) {\n this._errors.push(durationChecks.error.message);\n check = false;\n }\n\n // Hover check.\n const hoverCheck = isValidType(\"boolean\", { hover: this._hover });\n\n if (!hoverCheck.status) {\n this._errors.push(hoverCheck.error.message);\n check = false;\n }\n\n // Delay checks.\n const delays = {};\n for (const key of Object.keys(this._delays)) {\n if (this._delays[key] === \"\") continue;\n\n delays[`${key}Delay`] = this._delays[key];\n }\n const delayChecks = isValidType(\"number\", delays);\n\n if (!delayChecks.status) {\n this._errors.push(delayChecks.error.message);\n check = false;\n }\n\n // Prefix check.\n const prefixCheck = isValidType(\"string\", { prefix: this._prefix });\n\n if (!prefixCheck.status) {\n this._errors.push(prefixCheck.error.message);\n check = false;\n }\n\n // Locked check.\n const lockedCheck = isValidType(\"boolean\", { locked: this._locked.value });\n if (!lockedCheck.status) {\n this._errors.push(lockedCheck.error.message);\n check = false;\n }\n\n // Side check.\n const sideCheck = isValidSideType({ side: this._side });\n if (!sideCheck.status) {\n this._errors.push(sideCheck.error.message);\n check = false;\n }\n\n return check;\n }\n\n /**\n * Sets DOM elements within the shelf.\n *\n * The shelf, controller, lockController, and hoverController elements _cannot_ be set through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to populate.\n * @param {Object<HTMLElement,boolean>} [options = {}] - The options for setting the DOM element type.\n * @param {HTMLElement} [options.base = this.dom.shelf] - The element used as the base for the querySelector.\n * @param {boolean} [options.overwrite = true] - A flag to set if the existing elements will be overwritten.\n * @param {boolean} [options.strict = true] - A flag to set if the elements must be direct children of the base.\n */\n _setDOMElementType(\n elementType,\n { base = this.dom.shelf, overwrite = true, strict = true } = {}\n ) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (\n elementType === \"shelf\" ||\n elementType === \"controller\" ||\n elementType === \"lockController\" ||\n elementType === \"hoverController\"\n ) {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" element cannot be set through _setDOMElementType.`\n );\n }\n\n if (base !== this.dom.shelf) isValidInstance(HTMLElement, { base });\n\n if (Array.isArray(this._dom[elementType])) {\n // Get all the elements matching the selector in the base.\n const domElements = Array.from(\n base.querySelectorAll(this.selectors[elementType])\n );\n\n // Filter the elements so only direct children of the base are kept.\n const filteredElements = domElements.filter((item) =>\n strict ? item.parentElement === base : true\n );\n\n if (overwrite) {\n this._dom[elementType] = filteredElements;\n } else {\n this._dom[elementType] = [\n ...this._dom[elementType],\n ...filteredElements,\n ];\n }\n } else {\n // Get the single element matching the selector in the base.\n const domElement = base.querySelector(this.selectors[elementType]);\n\n // Ensure the element is a direct child of the base.\n if (domElement && domElement.parentElement !== base) {\n return;\n }\n\n if (overwrite) {\n this._dom[elementType] = domElement;\n }\n }\n } else {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" is not a valid element type within the navigation shelf.`\n );\n }\n }\n\n /**\n * Resets DOM elements within the menu.\n *\n * The shelf, controller, lockController, and hoverController elements _cannot_ be set through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to clear.\n */\n _resetDOMElementType(elementType) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (\n elementType === \"shelf\" ||\n elementType === \"controller\" ||\n elementType === \"lockController\" ||\n elementType === \"hoverController\"\n ) {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" element cannot be reset through _resetDOMElementType.`\n );\n }\n\n if (Array.isArray(this._dom[elementType])) {\n this._dom[elementType] = [];\n } else {\n this._dom[elementType] = null;\n }\n } else {\n throw new Error(\n `Graupl Navigation Shelf: \"${elementType}\" is not a valid element type within the navigation shelf.`\n );\n }\n }\n\n /**\n * Sets all DOM elements within the shelf.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"dependents\", { base: document, strict: false });\n }\n\n /**\n * Generates a key for the navigation shelf.\n *\n * @param {boolean} [regenerate = false] - A flag to determine if the key should be regenerated.\n */\n _generateKey(regenerate = false) {\n if (this.key === \"\" || regenerate) {\n this.key = Math.random()\n .toString(36)\n .replace(/[^a-z]+/g, \"\")\n .substring(0, 10);\n }\n }\n\n /**\n * Sets the IDs of the navigation shelf and it's elements if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - navigation shelf: `navigation-shelf-${key}`\n * - navigation shelf toggle: `navigation-shelf-toggle-${key}`\n * - navigation shelf lock toggle: `navigation-shelf-lock-toggle-${key}`\n * - navigation shelf hover toggle: `navigation-shelf-hover-toggle-${key}`\n */\n _setIds() {\n this.dom.shelf.id = this.dom.shelf.id || `navigation-shelf-${this.key}`;\n if (this.dom.controller) {\n this.dom.controller.id =\n this.dom.controller.id || `navigation-shelf-toggle-${this.key}`;\n }\n if (this.dom.lockController) {\n this.dom.lockController.id =\n this.dom.lockController.id ||\n `navigation-shelf-lock-toggle-${this.key}`;\n }\n if (this.dom.hoverController) {\n this.dom.hoverController.id =\n this.dom.hoverController.id ||\n `navigation-shelf-hover-toggle-${this.key}`;\n }\n }\n\n /**\n * Sets the aria attributes for the navigation shelf.\n */\n _setAriaAttributes() {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-controls\", this.dom.shelf.id);\n\n if (this.dom.controller.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n }\n\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n this.dom.lockController.setAttribute(\n \"aria-pressed\",\n this.isLocked ? \"true\" : \"false\"\n );\n }\n\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n this.dom.hoverController.setAttribute(\n \"aria-pressed\",\n this._hoverType === \"on\" ? \"true\" : \"false\"\n );\n }\n\n if (this.dom.sideController) {\n this.dom.sideController.setAttribute(\"aria-controls\", this.dom.shelf.id);\n }\n }\n\n /**\n * Clears the hover timeout.\n *\n * @protected\n */\n _clearTimeout() {\n clearTimeout(this._hoverTimeout);\n }\n\n /**\n * Sets the hover timeout.\n *\n * @protected\n *\n * @param {Function} callback - The callback function to execute.\n * @param {number} delay - The delay time in milliseconds.\n */\n _setTimeout(callback, delay) {\n isValidType(\"function\", { callback });\n isValidType(\"number\", { delay });\n\n this._hoverTimeout = setTimeout(callback, delay);\n }\n\n /**\n * Observes body size changes and keeps the shelf aligned with the configured breakpoint.\n *\n * @protected\n */\n _handleResize() {\n if (this._breakpointWidth <= 0) {\n return;\n }\n\n let width = 0;\n\n this._observer = new ResizeObserver((entries) => {\n requestAnimationFrame(() => {\n for (const entry of entries) {\n const boxSize = Array.isArray(entry.contentBoxSize)\n ? entry.contentBoxSize[0]\n : entry.contentBoxSize;\n const inlineSize =\n boxSize && typeof boxSize.inlineSize === \"number\"\n ? boxSize.inlineSize\n : entry.contentRect.width;\n\n if (typeof inlineSize !== \"number\") continue;\n\n if (width === inlineSize) continue;\n\n const belowBreakpoint = inlineSize <= this._breakpointWidth;\n const aboveBreakpoint = inlineSize > this._breakpointWidth;\n\n if (belowBreakpoint && this.isOpen) {\n this.close({\n preserveLock: this.shouldBeLocked,\n });\n } else if (aboveBreakpoint && this.shouldBeLocked && !this.isOpen) {\n this._locked.reset();\n this.lock({ force: true });\n }\n\n width = inlineSize;\n }\n });\n });\n this._observer.observe(document.body);\n }\n\n _handleFocus() {\n this.dom.shelf.addEventListener(\"focusin\", () => {\n this.focusState = \"self\";\n this.open();\n });\n\n this.dom.shelf.addEventListener(\"focusout\", (event) => {\n if (\n event.relatedTarget === null ||\n this.dom.shelf.contains(event.relatedTarget)\n )\n return;\n\n this.focusState = \"none\";\n\n if (!this.isLocked) {\n this.close();\n }\n });\n }\n\n _handleClick() {\n // Prevent pointer down events on all controlled elements.\n for (const element of Object.values(this.dom)) {\n if (!element) continue;\n if (Array.isArray(element)) continue;\n\n element.addEventListener(\n \"pointerdown\",\n () => {\n this.currentEvent = \"mouse\";\n this._clearTimeout();\n },\n { passive: true }\n );\n }\n\n // Toggle the shelf when the controlled is clicked.\n if (this.dom.controller) {\n this.dom.controller.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.toggle({ preserveLock: false });\n\n if (this.isOpen) {\n this.focusState = \"self\";\n this.isSoftLocked = true;\n }\n });\n }\n\n // Toggle hoverability when the hover controller is clicked.\n if (this.dom.hoverController) {\n this.dom.hoverController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleHover();\n\n if (this.hover) {\n this.open();\n }\n });\n }\n\n // Toggle shelf lock when the lock controller is clicked.\n if (this.dom.lockController) {\n this.dom.lockController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleLock();\n });\n }\n\n // Toggle shifting sides when the side controller is clicked.\n if (this.dom.sideController) {\n this.dom.sideController.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n preventEvent(event);\n this.focusState = \"self\";\n this.toggleSide();\n });\n }\n\n // Catch all to open if shelf if there is a click inside of it.\n this.dom.shelf.addEventListener(\"pointerup\", (event) => {\n if (event.button !== 0) return;\n\n this.currentEvent = \"mouse\";\n this.focusState = \"self\";\n this.isSoftLocked = true;\n this.open();\n });\n\n // Close the shelf if a click happens outside of it.\n document.addEventListener(\"pointerup\", (event) => {\n if (this.focusState === \"none\") return;\n if (this.isLocked) return;\n if (\n this.dom.shelf === event.target ||\n this.dom.shelf.contains(event.target)\n )\n return;\n\n this.currentEvent = \"mouse\";\n this.close();\n });\n }\n\n _handleHover() {\n this.dom.shelf.addEventListener(\"pointerenter\", (event) => {\n if (event.pointerType === \"pen\" || event.pointerType === \"touch\") return;\n if (this.isLocked || this.isSoftLocked) return;\n if (!this.hover) return;\n\n this.currentEvent = \"mouse\";\n\n if (this.enterDelay > 0) {\n this._clearTimeout();\n this._setTimeout(() => {\n if (!this.isOpen) {\n this.open();\n }\n }, this.enterDelay);\n } else {\n this.open();\n }\n });\n\n this.dom.shelf.addEventListener(\"pointerleave\", (event) => {\n if (event.pointerType === \"pen\" || event.pointerType === \"touch\") return;\n if (this.isLocked || this.isSoftLocked) return;\n if (!this.hover) return;\n\n this.currentEvent = \"mouse\";\n\n if (this.leaveDelay > 0) {\n this._clearTimeout();\n this._setTimeout(() => {\n if (this.isOpen) {\n this.close();\n }\n }, this.leaveDelay);\n } else {\n this.close();\n }\n });\n }\n\n _handleKeydown() {\n // Prevent keydown events on the shelf if they are `Escape`.\n this.dom.shelf.addEventListener(\"keydown\", (event) => {\n const key = keyPress(event);\n\n if (key === \"Escape\") {\n preventEvent(event);\n }\n });\n\n // Prevent keydown events on all controller elements if they are `Space` or `Enter`.\n for (const element of Object.values(this.dom)) {\n if (!element) continue;\n if (Array.isArray(element)) continue;\n if (element === this.dom.shelf) continue;\n\n element.addEventListener(\"keydown\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n }\n });\n }\n }\n\n _handleKeyup() {\n // Close the shelf on `Escape`.\n this.dom.shelf.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Escape\") {\n this.close();\n }\n });\n\n // Toggle the shelf on `Space` or `Enter` on the controller.\n if (this.dom.controller) {\n this.dom.controller.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggle();\n\n if (this.isOpen) {\n const element = selectFirstFocusableElement(this.dom.shelf);\n element.focus();\n }\n }\n });\n }\n\n // Toggle hover on `Space` or `Enter` on the hover controller.\n if (this.dom.hoverController) {\n this.dom.hoverController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleHover();\n }\n });\n }\n\n // Toggle lock on `Space` or `Enter` on the lock controller.\n if (this.dom.lockController) {\n this.dom.lockController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleLock();\n }\n });\n }\n\n // Shift sides on `Space` or `Enter` on the side controller.\n if (this.dom.sideController) {\n this.dom.sideController.addEventListener(\"keyup\", (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n this.toggleSide();\n }\n });\n }\n }\n\n /**\n * Sets the transition durations of the shelf as a CSS custom properties.\n *\n * The custom properties are:\n * - `--graupl-transition-duration`,\n * - `--graupl-open-transition-duration`, and\n * - `--graupl-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the shelf's prefix value.\n *\n * @protected\n */\n _setTransitionDurations() {\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.shelf.style.setProperty(\n `--${this.prefix}navigation-shelf-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n _expand({ emit = true, transition = true } = {}) {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"true\");\n }\n\n // If the shelf hasn't been initialized, we need to add the initialize class\n // before opening the shelf for the first time.\n //\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the close class,\n // add the open class, and finally remove the transition class.\n if (!this._initialized) {\n addClass(this.initializeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.openClass, this.dom.shelf);\n\n removeClass(this.closeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.initializeClass, this.dom.shelf);\n });\n });\n } else if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.closeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.openClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.shelf);\n }, this.openDuration);\n });\n });\n });\n } else {\n // Add the open class\n addClass(this.openClass, this.dom.shelf);\n\n // Remove the close class.\n removeClass(this.closeClass, this.dom.shelf);\n }\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._expandEvent);\n }\n }\n\n _collapse(emit = true, transition = true) {\n if (this.dom.controller) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n this.isSoftLocked = false;\n\n // If the shelf hasn't been initialized, we need to add the initialize class\n // before closing the shelf for the first time.\n //\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the open class,\n // add the close class, and finally remove the transition class.\n if (!this._initialized) {\n addClass(this.initializeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.closeClass, this.dom.shelf);\n\n removeClass(this.openClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.initializeClass, this.dom.shelf);\n });\n });\n } else if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n removeClass(this.openClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n addClass(this.closeClass, this.dom.shelf);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.shelf);\n }, this.closeDuration);\n });\n });\n });\n } else {\n // Add the close class\n addClass(this.closeClass, this.dom.shelf);\n\n // Remove the open class.\n removeClass(this.openClass, this.dom.shelf);\n }\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._collapseEvent);\n }\n }\n\n /**\n * Applies the locked state styling and dispatches the lock event.\n *\n * @protected\n *\n * @param {Object<boolean>} [options = {}] - Options for the lock side effects.\n * @param {boolean} [options.emit = true] - Whether to emit the lock event.\n */\n _lock({ emit = true } = {}) {\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-pressed\", \"true\");\n }\n\n // Add the locked class\n addClass(this.lockedClass, this.dom.shelf);\n\n // Add the locked class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(this.lockedClass, dependent);\n });\n\n // Remove the unlocked class.\n removeClass(this.unlockedClass, this.dom.shelf);\n\n // Remove the unlocked class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(this.unlockedClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._lockEvent);\n }\n }\n\n /**\n * Applies the unlocked state styling and dispatches the unlock event.\n *\n * @protected\n *\n * @param {Object<boolean>} [options = {}] - Options for the unlock side effects.\n * @param {boolean} [options.emit = true] - Whether to emit the unlock event.\n */\n _unlock({ emit = true } = {}) {\n if (this.dom.lockController) {\n this.dom.lockController.setAttribute(\"aria-pressed\", \"false\");\n }\n\n // Add the unlocked class\n addClass(this.unlockedClass, this.dom.shelf);\n\n // Add the unlocked class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(this.unlockedClass, dependent);\n });\n\n // Remove the locked class.\n removeClass(this.lockedClass, this.dom.shelf);\n\n // Remove the locked class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(this.lockedClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._unlockEvent);\n }\n }\n\n /**\n * Updates all dependent elements to reflect the shelf side.\n *\n * @protected\n *\n * @param {Object<boolean>} [options = {}] - Options for shifting side.\n * @param {boolean} [options.emit=true] - Whether to emit the shift event.\n */\n _shiftSide({ emit = true } = {}) {\n const toClass = this._classes[this.side];\n const fromClass = this._classes[this.otherSide];\n\n // Add the to class\n addClass(toClass, this.dom.shelf);\n\n // Add the to class to dependent elements.\n this.dom.dependents.forEach((dependent) => {\n addClass(toClass, dependent);\n });\n\n // Remove the from class.\n removeClass(fromClass, this.dom.shelf);\n\n // Remove the from class from dependent elements.\n this.dom.dependents.forEach((dependent) => {\n removeClass(fromClass, dependent);\n });\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._shiftEvent);\n }\n }\n\n /**\n * Enables hover mode on the shelf.\n *\n * @protected\n *\n * @param {Object<boolean>} [options = {}] - Options for enabling hoverability.\n * @param {boolean} [options.emit = true] - Whether to emit the enable hover event.\n */\n _enableHover({ emit = true } = {}) {\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-pressed\", \"true\");\n }\n\n addClass(this.hoverClass, this.dom.shelf);\n\n removeClass(this.noHoverClass, this.dom.shelf);\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._enableHoverEvent);\n }\n }\n\n /**\n * Disables hover mode on the shelf.\n *\n * @protected\n *\n * @param {Object<boolean>} [options = {}] - Options for disabling hoverability.\n * @param {boolean} [options.emit = true] - Whether to emit the disable hover event.\n */\n _disableHover({ emit = true } = {}) {\n if (this.dom.hoverController) {\n this.dom.hoverController.setAttribute(\"aria-pressed\", \"false\");\n }\n\n addClass(this.noHoverClass, this.dom.shelf);\n\n removeClass(this.hoverClass, this.dom.shelf);\n\n if (emit) {\n this.dom.shelf.dispatchEvent(this._disableHoverEvent);\n }\n }\n\n /**\n * Opens the shelf.\n *\n * @param {Object<boolean>} [options = {}] - Options for opening the shelf.\n * @param {boolean} [options.force = false] - Whether to force the open action.\n */\n open({ force = false } = {}) {\n // Only open if the shelf is closed.\n if (this.isOpen && !force) return;\n\n this._expand();\n\n // Set the open flag.\n this._open = true;\n }\n\n /**\n * Closes the shelf and optionally preserves the committed lock state.\n *\n * @param {Object<boolean>} [options = {}] - Options for closing the shelf.\n * @param {boolean} [options.force = false] - Whether to force the close action.\n * @param {boolean} [options.preserveLock = true] - Whether to keep the current lock preference unchanged.\n */\n close({ force = false, preserveLock = true } = {}) {\n // Only close if the shelf is open.\n if (!this.isOpen && !force) return;\n\n this.unlock({ updateLock: !preserveLock });\n this._collapse();\n\n // Set the open flag.\n this._open = false;\n }\n\n /**\n * Toggles the shelf open or closed.\n *\n * @param {Object<boolean>} [options = {}] - Options for toggling the shelf.\n * @param {boolean} [options.force = false] - Whether to force the transition.\n * @param {boolean} [options.preserveLock = true] - Whether to keep the current lock preference unchanged when closing.\n */\n toggle({ force = false, preserveLock = true } = {}) {\n if (this.isOpen) {\n this.close({ force, preserveLock });\n } else {\n this.open({ force });\n }\n }\n\n /**\n * Locks the shelf and ensures it remains open.\n *\n * @param {Object<boolean>} [options = {}] - Options for locking the shelf.\n * @param {boolean} [options.emit = true] - Whether to force the lock even if already locked.\n */\n lock({ force = false } = {}) {\n // Only lock if the shelf is unlocked.\n if (this.isLocked && !force) return;\n\n this._locked.value = true;\n this._lock();\n\n // Commit the locked preference.\n this._locked.commit();\n\n // Open the shelf.\n this.open({ force: true });\n }\n\n /**\n * Unlocks the shelf.\n *\n * @param {Object<boolean>} [options = {}] - Options for unlocking the shelf.\n * @param {boolean} [options.updateLock = true] - Whether to commit the unlocked state as the new preference.\n */\n unlock({ updateLock = true } = {}) {\n // Only unlock if the shelf is locked.\n if (!this.isLocked) {\n this._locked.value = false;\n\n if (updateLock) {\n this._locked.commit();\n }\n\n return;\n }\n\n this._locked.value = false;\n this._unlock();\n\n if (updateLock) {\n this._locked.commit();\n }\n }\n\n toggleLock() {\n if (this.isLocked) {\n this.unlock();\n } else {\n this.lock();\n }\n }\n\n toLeft() {\n if (this.side === \"left\") return;\n\n this._side = \"left\";\n this._otherSide = \"right\";\n this._shiftSide();\n }\n\n toRight() {\n if (this.side === \"right\") return;\n\n this._side = \"right\";\n this._otherSide = \"left\";\n this._shiftSide();\n }\n\n toggleSide() {\n if (this.side === \"left\") {\n this.toRight();\n } else {\n this.toLeft();\n }\n }\n\n enableHover() {\n if (this.hover) return;\n\n this._enableHover();\n\n this._hover = true;\n }\n\n disableHover() {\n if (!this.hover) return;\n\n this._disableHover();\n\n this._hover = false;\n }\n\n toggleHover() {\n if (this.hover) {\n this.disableHover();\n } else {\n this.enableHover();\n }\n }\n}\n\nexport default NavigationShelf;\n","/**\n * Mark DOM elements as processed to prevent multiple initializations.\n *\n * @module @drupal/once\n *\n * @example <!-- Use as a module -->\n * <script type=\"module\">\n * import once from 'https://unpkg.com/@drupal/once/src/once.js';\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n *\n * @example <!-- Use as a regular script -->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n * @example <!-- Using a single element as input-->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * // once methods always return an array, to simplify the use with a single\n * // element use destructuring or the shift method.\n * const [myElement] = once('my-once-id', document.body);\n * const myElement = once('my-once-id', document.body).shift();\n * </script>\n */\n\n/**\n * Illegal spaces in ids.\n *\n * @private\n *\n * @type {RegExp}\n */\nconst wsRE = /[\\11\\12\\14\\15\\40]+/;\n\n/**\n * Name of the HTML attribute containing an element's once ids.\n *\n * @private\n *\n * @type {string}\n */\nconst attrName = 'data-once';\n\n/**\n * Shortcut to access the html element.\n *\n * @private\n *\n * @type {HTMLElement}\n */\nconst doc = document;\n\n/**\n * Helper to access element attributes.\n *\n * @private\n *\n * @param {Element} element\n * The Element to access the data-once attribute from.\n * @param {string} op\n * The action to take on the element.\n * @param {string} [value]\n * Optional value for setAttribute.\n *\n * @return {string|undefined|null|boolean}\n * Result of the attribute method.\n */\nfunction attr(element, op, value) {\n return element[`${op}Attribute`](attrName, value);\n}\n\n/**\n * Return the attribute selector.\n *\n * @private\n *\n * @param {string} id\n * The id passed by a call to a once() function.\n *\n * @return {string}\n * The full CSS attribute selector.\n *\n * @throws {TypeError|RangeError}\n */\nfunction attrSelector(id) {\n // Verify the validity of the once id.\n if (typeof id !== 'string') {\n throw new TypeError('once ID must be a string');\n }\n if (id === '' || wsRE.test(id)) {\n throw new RangeError('once ID must not be empty or contain spaces');\n }\n // The id is valid, return the full CSS selector.\n return `[${attrName}~=\"${id}\"]`;\n}\n\n/**\n * Verifies that an item is an instance of Element.\n *\n * This function is used during filtering to ensure only DOM elements are\n * processed. once() makes use of get/setAttribute, which are methods\n * inherited from the Element object, so only of Element can be used.\n *\n * @private\n *\n * @param {*} itemToCheck\n * The item to check.\n *\n * @return {boolean}\n * True if the item is an instance of Element\n *\n * @throws {TypeError}\n */\nfunction checkElement(itemToCheck) {\n if (!(itemToCheck instanceof Element)) {\n throw new TypeError('The element must be an instance of Element');\n }\n return true;\n}\n\n/**\n * Process arguments, query the DOM if necessary.\n *\n * @private\n *\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array with the processed Id and the list of elements to process.\n */\nfunction getElements(selector, context = doc) {\n // Assume selector is an array-like value.\n let elements = selector;\n\n // If selector is null it is most likely because of a call to querySelector\n // that didn't return a result.\n if (selector === null) {\n elements = [];\n }\n // The selector is undefined, error out.\n else if (!selector) {\n throw new TypeError('Selector must not be empty');\n }\n // Context doesn't implement querySelectorAll, error out.\n else if (\n !(\n context instanceof Document ||\n context instanceof DocumentFragment ||\n context instanceof Element\n )\n ) {\n throw new TypeError(\n 'Context must be an object of type \"Document\", \"DocumentFragment\", or \"Element\".',\n );\n }\n // This is a selector, query the elements.\n else if (typeof selector === 'string') {\n elements = context.querySelectorAll(selector);\n }\n // This is a single element.\n else if (selector instanceof Element) {\n elements = [selector];\n }\n\n // Make sure an array is returned and not a NodeList or an Array-like object.\n return Array.prototype.slice.call(elements);\n}\n\n/**\n * A helper for applying DOM changes to a filtered set of elements.\n *\n * This makes it possible to filter items that are not instances of Element,\n * then modify their DOM attributes in a single array traversal.\n *\n * @private\n *\n * @param {string} selector\n * A CSS selector to check against to each element in the array.\n * @param {Array.<Element>} elements\n * A NodeList or array of elements passed by a call to a once() function.\n * @param {function} [apply]\n * An optional function to apply on all matched elements.\n *\n * @return {Array.<Element>}\n * The array of elements that match the CSS selector.\n */\nfunction filterAndModify(selector, elements, apply) {\n return elements.filter((element) => {\n const selected = checkElement(element) && element.matches(selector);\n if (selected && apply) {\n apply(element);\n }\n return selected;\n });\n}\n\n/**\n * Add or remove an item from a list of once values.\n *\n * This function removes duplicates while adding or removing a once id in a\n * single array traversal.\n *\n * @private\n *\n * @param {Element} element\n * A space separated string of once ids from a data-drupal-once attribute.\n * @param {string} [add]\n * The once id to add to the list of values.\n * @param {string} [remove]\n * The once id to remove from the list of values.\n *\n * @return {undefined}\n * Nothing to return this is a callback in a foreach.\n */\nfunction updateAttribute(element, { add, remove }) {\n const result = [];\n if (attr(element, 'has')) {\n attr(element, 'get')\n .trim()\n .split(wsRE)\n .forEach((item) => {\n if (result.indexOf(item) < 0 && item !== remove) {\n result.push(item);\n }\n });\n }\n if (add) {\n result.push(add);\n }\n const attribute = result.join(' ');\n attr(element, attribute === '' ? 'remove' : 'set', attribute);\n}\n\n/**\n * Ensures a JavaScript callback is only executed once on a set of elements.\n *\n * Filters a NodeList or array of elements, removing those already processed\n * by a callback with a given id.\n * This method adds a `data-once` attribute on DOM elements. The value of\n * this attribute identifies if a given callback has been executed on that\n * element.\n *\n * @global\n *\n * @example <caption>Basic usage</caption>\n * const elements = once('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once('my-once-id', document.querySelector('#some-id'));\n * @example <caption>Using a single element</caption>\n * // Once always returns an array, even when passing a single element. Some\n * // forms that can be used to keep code readable.\n * // Destructuring:\n * const [myElement] = once('my-once-id', document.body);\n * // By changing the resulting array, es5 compatible.\n * const myElement = once('my-once-id', document.body).shift();\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array of elements that have not yet been processed by a once call\n * with a given id.\n */\nfunction once(id, selector, context) {\n return filterAndModify(\n `:not(${attrSelector(id)})`,\n getElements(selector, context),\n (element) => updateAttribute(element, { add: id }),\n );\n}\n\n/**\n * Removes a once id from an element's data-drupal-once attribute value.\n *\n * If a once id is removed from an element's data-drupal-once attribute value,\n * the JavaScript callback associated with that id can be executed on that\n * element again.\n *\n * @method once.remove\n *\n * @example <caption>Basic usage</caption>\n * const elements = once.remove('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.remove('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.remove('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.remove('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.remove('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.remove('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of a once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that had been processed by the provided id,\n * and are now able to be processed again.\n */\nonce.remove = (id, selector, context) => {\n return filterAndModify(\n attrSelector(id),\n getElements(selector, context),\n (element) => updateAttribute(element, { remove: id }),\n );\n};\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Behaves like {@link once} and {@link once.remove} without changing the DOM.\n * To select all DOM nodes processed by a given id, use {@link once.find}.\n *\n * @method once.filter\n *\n * @example <caption>Basic usage</caption>\n * const filteredElements = once.filter('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.filter('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.filter('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.filter('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.filter('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.filter('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.filter = (id, selector, context) =>\n filterAndModify(attrSelector(id), getElements(selector, context));\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Query the 'context' element for elements that already have the\n * corresponding once id value.\n *\n * @method once.find\n *\n * @example <caption>Basic usage</caption>\n * const oncedElements = once.find('my-once-id');\n * @example <caption>Input parameters accepted</caption>\n * // Call without parameters, return all elements with a `data-once` attribute.\n * once.find();\n * // Call without a context.\n * once.find('my-once-id');\n * // Call with a context.\n * once.find('my-once-id', document.head);\n *\n * @param {string} [id]\n * The id of the once call.\n * @param {Document|DocumentFragment|Element} [context=document]\n * Scope of the search for matching elements.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.find = (id, context) =>\n getElements(!id ? `[${attrName}]` : attrSelector(id), context);\n\nexport default once;\n","import NavigationShelf from \"./NavigationShelf.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n navigationShelfSelector = \".navigation-shelf\"\n) => {\n once(\n \"graupl-navigation-shelf-generator\",\n navigationShelfSelector,\n context\n ).forEach((shelfElement) => {\n const navigationShelfOptions = shelfElement.dataset\n .grauplNavigationShelfOptions\n ? JSON.parse(\n shelfElement.dataset.grauplNavigationShelfOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new NavigationShelf({\n shelfElement,\n controllerElement:\n context.querySelector(\".navigation-shelf-toggle\") || null,\n lockControllerElement:\n context.querySelector(\".navigation-shelf-lock-toggle\") || null,\n hoverControllerElement:\n context.querySelector(\".navigation-shelf-hover-toggle\") || null,\n sideControllerElement:\n context.querySelector(\".navigation-shelf-side-toggle\") || null,\n initialize: true,\n ...options,\n ...navigationShelfOptions,\n });\n });\n};\n\nexport default generate;\n","import generate from \"./generator.js\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n generate();\n});\n"],"x_google_ignoreList":[7],"mappings":"YAeA,SAAgBiI,EAAgB6D,EAAasL,EAAU,CACrD,GAAI,CACF,GAAI,OAAOA,GAAa,SAAU,CAChC,MAAMjX,EAAe,OAAOiX,EAE5B,MAAM,IAAIT,UACR,qEAAqExW,CAAAA,UAAY,EAIrF,UAAWwP,KAAOyH,EAChB,GAAI,EAAEA,EAASzH,CAAAA,YAAgB7D,GAAc,CAC3C,MAAMoF,EAAc,OAAOkG,EAASzH,CAAAA,EACpC,MAAM,IAAIgH,UACR,GAAGhH,CAAAA,2BAA8B7D,EAAYvL,IAAAA,MAAU2Q,CAAAA,UAAW,EAKxE,MAAO,CACLhB,OAAQ,GACRhB,MAAO,YAEFA,EAAO,C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