@graupl/core 1.0.0-beta.43 → 1.0.0-beta.44
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/js/accordion.js.map +1 -1
- package/dist/js/alert.js +1 -1
- package/dist/js/alert.js.map +1 -1
- package/dist/js/component/accordion.cjs.js.map +1 -1
- package/dist/js/component/accordion.es.js.map +1 -1
- package/dist/js/component/accordion.iife.js.map +1 -1
- package/dist/js/component/alert.cjs.js +1 -1
- package/dist/js/component/alert.cjs.js.map +1 -1
- package/dist/js/component/alert.es.js +1 -1
- package/dist/js/component/alert.es.js.map +1 -1
- package/dist/js/component/alert.iife.js +1 -1
- package/dist/js/component/alert.iife.js.map +1 -1
- package/dist/js/component/disclosure.cjs.js +2 -2
- package/dist/js/component/disclosure.cjs.js.map +1 -1
- package/dist/js/component/disclosure.es.js +2 -2
- package/dist/js/component/disclosure.es.js.map +1 -1
- package/dist/js/component/disclosure.iife.js +2 -2
- package/dist/js/component/disclosure.iife.js.map +1 -1
- package/dist/js/disclosure.js +2 -2
- package/dist/js/disclosure.js.map +1 -1
- package/dist/js/generator/accordion.cjs.js.map +1 -1
- package/dist/js/generator/accordion.es.js.map +1 -1
- package/dist/js/generator/accordion.iife.js.map +1 -1
- package/dist/js/generator/alert.cjs.js +1 -1
- package/dist/js/generator/alert.cjs.js.map +1 -1
- package/dist/js/generator/alert.es.js +1 -1
- package/dist/js/generator/alert.es.js.map +1 -1
- package/dist/js/generator/alert.iife.js +1 -1
- package/dist/js/generator/alert.iife.js.map +1 -1
- package/dist/js/generator/disclosure.cjs.js +2 -2
- package/dist/js/generator/disclosure.cjs.js.map +1 -1
- package/dist/js/generator/disclosure.es.js +2 -2
- package/dist/js/generator/disclosure.es.js.map +1 -1
- package/dist/js/generator/disclosure.iife.js +2 -2
- package/dist/js/generator/disclosure.iife.js.map +1 -1
- package/dist/js/graupl.js +2 -2
- package/dist/js/graupl.js.map +1 -1
- package/package.json +1 -1
- package/src/js/accordion/AccordionItem.js +2 -2
- package/src/js/alert/Alert.js +3 -3
- package/src/js/disclosure/Disclosure.js +497 -42
package/dist/js/graupl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graupl.js","names":["isValidInstance","contructor","elements","shouldThrow","result","status","errors","elementsType","TypeError","key","elementType","name","error","push","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidState","validStates","includes","join","isValidEvent","validEvents","isValidHoverType","validTypes","isTag","tagName","HTMLElement","tag","toLowerCase","isValidEventType","eventType","component","Object","prototype","hasOwnProperty","call","events","constructor","keys","hasValidRootDOMElement","_dom","_rootDOMElement","addClass","className","element","length","classList","add","removeClass","remove","selectAllFocusableElements","context","document","fn","querySelector","elements","Array","from","querySelectorAll","tabbableElements","filter","check","getAttribute","selectFirstFocusableElement","selectLastFocusableElement","selectNextFocusableElement","index","indexOf","selectPreviousFocusableElement","TransactionalValue","_equals","Object","is","_current","_committed","constructor","initialValue","equals","value","val","committed","isDirty","commit","reset","update","fn","isValidType","isValidInstance","StorageManager","_scope","_type","_storage","_crush","constructor","scope","type","crush","initialize","window","storage","shouldThrow","status","get","key","typeCheck","Error","message","keyCheck","set","data","dataCheck","clear","dispose","isValidInstance","isValidType","isValidClassList","isQuerySelector","isValidState","isValidEvent","isValidEventType","hasValidRootDOMElement","StorageManager","addClass","removeClass","Component","_dom","_rootDOMElement","_protectedDOMElements","_selectors","_elements","_classes","initialize","_durations","_delays","_focusState","_currentEvent","_breakpoint","_mediaQueryString","_mediaQueryList","_mediaQueryListEventCallback","event","matches","_intervals","_timeouts","_listeners","_events","CustomEvent","detail","component","preinitialize","postinitialize","validate","prevalidate","postvalidate","_prefix","_key","_name","_storageKey","_shouldStore","_id","_valid","_initialized","_errors","constructor","prefix","key","initializeClass","_validate","Error","name","errors","map","error","message","join","rootDOMElement","_dispatchEvent","_generateKey","_setDOMElements","_setIds","_setAriaAttributes","_setCustomProps","_createChildElements","_handleMediaMatch","_handleFocus","_handleHover","_handleClick","_handleKeydown","_handleKeyup","_store","console","init","dom","document","documentElement","selectors","elements","classes","durations","delays","intervals","timeouts","listeners","events","value","focusState","currentEvent","shouldFocus","check","breakpoint","mediaQuery","id","isValid","isInitialized","rootDOMElementCheck","shouldThrow","status","Object","keys","length","domElements","domKey","Array","isArray","forEach","element","index","domChecks","HTMLElement","querySelectors","querySelector","querySelectorChecks","className","classListChecks","durationName","durationChecks","delayName","delayChecks","strings","elementType","stringChecks","regenerate","Math","random","toString","replace","substring","_setDOMElementType","context","overwrite","strict","includes","from","querySelectorAll","filteredElements","filter","item","parentElement","_resetDOMElementType","window","matchMedia","_addEventListener","storage","GrauplStorage","scope","set","type","data","_unstore","clear","_setInterval","callback","delay","_clearInterval","setInterval","clearInterval","_clearIntervals","_setTimeout","_clearTimeout","setTimeout","clearTimeout","_clearTimeouts","_registerEvent","bubbles","eventName","charAt","toUpperCase","slice","eventType","dispatchEvent","listener","options","addEventListener","push","_removeEventListener","removeEventListener","registeredListener","i","JSON","stringify","splice","_removeEventListeners","focus","blur","dispose","isTag","addClass","removeClass","TransactionalValue","Component","AccordionItem","_rootDOMElement","_protectedDOMElements","_open","_locked","_name","_storageKey","_shouldStore","constructor","accordionItemElement","accordionItemToggleElement","accordionItemHeaderElement","accordionItemContentElement","parentAccordion","prefix","key","_dom","item","toggle","header","content","_elements","parent","_registerEvent","detail","_addEventListener","rootDOMElement","dom","getAttribute","show","force","emit","transition","hide","isOpen","value","isLocked","_setIds","elements","index","accordionItems","indexOf","id","_setAriaAttributes","shouldThrow","status","setAttribute","_reveal","closeClass","openClass","transitionClass","openDuration","requestAnimationFrame","style","height","getBoundingClientRect","_setTimeout","removeAttribute","_dispatchEvent","_conceal","closeDuration","preserveState","commit","allowExpandMultiple","unlockSiblings","closeSiblings","allowCollapseAll","openAccordionItems","length","lock","focus","blur","unlock","forEach","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Character","isNaN","match","Tab","Asterisk","Object","find","preventEvent","preventDefault","stopPropagation","AccordionItem","keyPress","preventEvent","isValidType","isValidClassList","Component","Accordion","_rootDOMElement","_optionalKeySupport","_expandMultiple","_collapseAll","_currentChild","_storageKey","_name","constructor","accordionElement","accordionItemsSelector","accordionItemTogglesSelector","accordionItemHeadersSelector","accordionItemContentsSelector","accordionControlContainerSelector","accordionControlsSelector","expandControllerSelector","collapseControllerSelector","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","optionalKeySupport","allowExpandMultiple","allowCollapseAll","automaticActivation","prefix","key","initializeClass","initialize","_dom","accordion","accordionItems","accordionItemToggles","accordionItemHeaders","accordionItemContents","accordionControlContainer","accordionControls","expandController","collapseController","_selectors","_elements","_classes","open","close","transition","_durations","_automatic","_addEventListener","rootDOMElement","dom","length","forEach","control","setAttribute","booleans","booleanChecks","status","_errors","errors","_valid","value","_setCustomProps","currentChild","elements","currentAccordionItem","openAccordionItems","filter","item","isOpen","removeAttribute","_setIds","id","_id","style","setProperty","_setDOMElements","_setDOMElementType","context","_resetDOMElementType","accordionItem","overwrite","strict","_createChildElements","index","accordionItemElement","accordionItemToggleElement","accordionItemHeaderElement","accordionItemContentElement","parentAccordion","push","_handleFocus","toggle","_handleClick","currentEvent","openChildren","closeChildren","_handleKeydown","accordionToggle","event","toggleKeys","includes","optionalKeys","controllerKeys","_handleKeyup","focusFirstChild","focusLastChild","focusNextChild","focusPreviousChild","focusCurrentChild","focus","focusChild","blurCurrentChild","blur","show","hide","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","Accordion","once","generate","options","context","document","accordionSelector","forEach","accordionElement","accordionOptions","dataset","grauplAccordionOptions","JSON","parse","replace","initialize","isValidClassList","isValidType","addClass","removeClass","keyPress","preventEvent","TransactionalValue","Component","Alert","_rootDOMElement","_protectedDOMElements","_hidden","_storageKey","_name","constructor","alertElement","controllerElement","showClass","hideClass","transitionClass","transitionDuration","showDuration","hideDuration","isHidden","prefix","key","initializeClass","initialize","_dom","alert","controller","_classes","show","hide","transition","_durations","value","commit","_registerEvent","detail","_addEventListener","rootDOMElement","_conseal","emit","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","_setCustomProps","_setIds","dom","id","_id","_reveal","requestAnimationFrame","_setTimeout","removeAttribute","_dispatchEvent","setAttribute","style","setProperty","_handleClick","_handleKeydown","event","_handleKeyup","force","preserveState","focusState","Alert","once","generate","options","context","document","alertSelector","forEach","alertElement","alertOptions","dataset","grauplAlertOptions","JSON","parse","replace","controllerElement","querySelector","initialize","addClass","removeClass","preventEvent","keyPress","isTag","isValidClassList","isValidType","Component","Carousel","_rootDOMElement","_currentItem","_autoplay","_playText","_pauseText","_currentAction","_storageKey","_name","constructor","carouselElement","carouselItemsSelector","carouselItemContainerSelector","carouselControlsSelector","carouselControlContainerSelector","carouselTabsSelector","carouselTabContainerSelector","autoplaySelector","nextSelector","previousSelector","activeClass","previousClass","nextClass","playClass","pauseClass","autoplay","transitionDelay","transitionDuration","playText","pauseText","prefix","key","initializeClass","initialize","_dom","carousel","carouselItems","carouselItemContainer","carouselControls","carouselControlContainer","carouselTabs","carouselTabContainer","next","previous","_selectors","_classes","active","play","pause","_delays","transition","_durations","_addEventListener","rootDOMElement","_handleAutoplay","activateFirstItem","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","strings","stringChecks","value","currentItem","dom","length","tabs","querySelectorAll","selectors","carouselTab","forEach","item","index","setAttribute","currentCarouselItem","currentCarouselTab","_setTransitionDuration","currentAction","_setDOMElements","_setDOMElementType","context","_setIds","id","tab","_id","_setAriaAttributes","getAttribute","_setCustomProps","style","setProperty","_setInterval","activateNextItem","_clearInterval","_handleFocus","_handleClick","activatePreviousItem","toggleAutoplay","activateItem","_handleHover","_handleKeydown","control","event","_handleKeyup","activateCurrentItem","deactivateCurrentItem","currentIndex","dataset","grauplAction","requestAnimationFrame","setTimeout","activateLastItem","Carousel","once","generate","options","context","document","carouselSelector","forEach","carouselElement","carouselOptions","dataset","grauplCarouselOptions","JSON","parse","replace","initialize","once","generate","options","context","document","navigationSelector","forEach","navigationElement","MenuConstructor","dataset","grauplMenuType","DisclosureMenu","window","undefined","console","warn","menuOptions","grauplMenuOptions","JSON","parse","replace","menuElement","querySelector","controllerElement","containerElement","menuItemSelector","menuLinkSelector","submenuItemSelector","submenuToggleSelector","isValidClassList","isValidType","isTag","addClass","removeClass","keyPress","preventEvent","TransactionalValue","Component","Disclosure","_rootDOMElement","_protectedDOMElements","_open","_shouldOpen","_closeOnBlur","_storageKey","_name","_mediaQueryListEventCallback","event","matches","isOpen","close","preserveState","hasOpened","shouldOpen","open","constructor","disclosureElement","controllerElement","disclosureContentSelector","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","closeOnBlur","minWidth","autoOpen","mediaQuery","prefix","key","initializeClass","initialize","_dom","disclosure","controller","_selectors","content","_classes","transition","_durations","_breakpoint","_mediaQueryString","_registerEvent","detail","_addEventListener","rootDOMElement","dom","getAttribute","window","matchMedia","_expand","emit","_collapse","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","value","_setCustomProps","breakpoint","committed","_setIds","id","_id","_setAriaAttributes","setAttribute","style","setProperty","_setDOMElements","_resetDOMElementType","_setDOMElementType","context","transitionlass","requestAnimationFrame","setTimeout","removeAttribute","_dispatchEvent","innert","_handleFocus","currentEvent","relatedTarget","contains","_handleClick","button","toggle","document","focusState","target","_handleKeydown","_handleKeyup","force","commit","preview","Disclosure","once","generate","options","context","document","disclosureSelector","controllerSelector","forEach","disclosureElement","disclosureOptions","dataset","grauplDisclosureOptions","JSON","parse","replace","targettedControllerSelector","id","controllerElement","console","warn","remove","initialize","accordionGenerator","alertGenerator","carouselGenerator","navigationGenerator","disclosureGenerator","document","addEventListener"],"sources":["../../src/js/validate.js","../../src/js/domHelpers.js","../../src/js/TransactionalValue.js","../../src/js/storage/StorageManager.js","../../src/js/Component.js","../../src/js/accordion/AccordionItem.js","../../src/js/eventHandlers.js","../../src/js/accordion/Accordion.js","../../../../node_modules/@drupal/once/src/once.js","../../src/js/accordion/generator.js","../../src/js/alert/Alert.js","../../src/js/alert/generator.js","../../src/js/carousel/Carousel.js","../../src/js/carousel/generator.js","../../src/js/navigation/generator.js","../../src/js/disclosure/Disclosure.js","../../src/js/disclosure/generator.js","../../src/js/main.js"],"sourcesContent":["/**\n * @file\n * Validation helper functions.\n */\n\n/* global Component */\n\n/**\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidInstance(\n contructor,\n elements,\n { shouldThrow = true } = {}\n) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidType(type, values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(\n `${key} must be a ${type}. \"${valueType}\" given.`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isQuerySelector(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidClassList(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidState(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidEvent(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the provided values are valid hover types for a menu.\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidHoverType(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 `{ status: 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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isTag(tagName, elements, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n if (\n isValidType(\"string\", { tagName }, { shouldThrow: true }).status &&\n isValidInstance(HTMLElement, elements, { shouldThrow: true }).status\n ) {\n const tag = tagName.toLowerCase();\n\n for (const key in elements) {\n try {\n if (elements[key].tagName.toLowerCase() !== tag) {\n throw new TypeError(\n `${key} must be a <${tag}> element. <${elements[\n key\n ].tagName.toLowerCase()}> given.`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the provided event type is valid for dispatching.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} eventType - The event type to check.\n * @param {Component} component - The component to check.\n * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidEventType(\n eventType,\n component,\n { shouldThrow = true } = {}\n) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n if (!Object.prototype.hasOwnProperty.call(component.events, eventType)) {\n throw new TypeError(\n `Event type \"${eventType}\" is not valid for ${component.constructor.name}. Valid event types are: \"${Object.keys(component.events).join('\", ')}\".`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the component has a valid root DOM element.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Component} component - The component to check.\n * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow=true] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function hasValidRootDOMElement(component, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n // Check to make sure the root DOM element exists in _dom.\n if (\n !Object.prototype.hasOwnProperty.call(\n component._dom,\n component._rootDOMElement\n )\n ) {\n throw new Error(\n `The root DOM element \"${component._rootDOMElement}\" does not exist in the ${component.constructor.name}'s _dom property. It must be one of the following: \"${Object.keys(\n component._dom\n ).join('\", \"')}\".`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement[]} - An array of focusable elements.\n */\nexport function selectAllFocusableElements(context = document, fn = null) {\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 if (fn !== null) {\n return tabbableElements.filter(fn);\n } else {\n return tabbableElements;\n }\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The first focusable element or false if none found.\n */\nexport function selectFirstFocusableElement(context = document, fn = null) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The last focusable element or false if none found.\n */\nexport function selectLastFocusableElement(context = document, fn = null) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The next focusable element or false if none found.\n */\nexport function selectNextFocusableElement(\n element,\n context = document,\n fn = null\n) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The previous focusable element or false if none found.\n */\nexport function selectPreviousFocusableElement(\n element,\n context = document,\n fn = null\n) {\n const tabbableElements = selectAllFocusableElements(context, fn);\n const index = tabbableElements.indexOf(element);\n\n return index === 0 ? false : tabbableElements[index - 1];\n}\n","/**\n * @file\n * Provides a utility class for managing transactional values.\n */\n\n/**\n * A utility class that maintains a \"current\" value and a \"committed\" value.\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 */\nclass TransactionalValue {\n /**\n * A comparator function used to check equality between\n * the current and committed values.\n *\n * @protected\n *\n * @type {function(*, *): boolean}\n */\n _equals = Object.is;\n\n /**\n * The current, editable value.\n *\n * @protected\n *\n * @type {*}\n */\n _current;\n\n /**\n * The last committed (baseline) value.\n *\n * @protected\n *\n * @type {*}\n */\n _committed;\n\n /**\n * Creates a new TransactionalValue instance.\n *\n * @param {*} initialValue - The starting (and initially committed) value.\n * @param {object} [options = {}] - Options for configuring the instance.\n * @param {function(*, *): boolean} [options.equals = Object.is] - Custom equality comparator. Defaults to `Object.is`.\n */\n constructor(initialValue, { equals = Object.is } = {}) {\n this._equals = equals || Object.is;\n this._current = initialValue;\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 value.\n *\n * @readonly\n *\n * @type {*}\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 * Will be `true` if the values are different, `false` otherwise.\n *\n * @readonly\n *\n * @type {boolean}\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\nexport default TransactionalValue;\n","/**\n * @file\n * Provides a system to get and store data in the browser.\n */\n\nimport { isValidType, isValidInstance } from \"../validate.js\";\n\n/**\n * Class representing a storage system.\n */\nclass StorageManager {\n /**\n * The scope of the storage.\n *\n * @protected\n *\n * @type {string}\n */\n _scope;\n\n /**\n * The type of storage.\n *\n * @protected\n *\n * @type {string}\n */\n _type = \"_default\";\n\n /**\n * The storage object.\n *\n * @protected\n *\n * @type {object}\n */\n _storage = {};\n\n /**\n * Whether to crush the storage instance if it already exists.\n *\n * @protected\n *\n * @type {boolean}\n */\n _crush = false;\n\n /**\n * Creates a Storage instance.\n *\n * @param {object} [options = {}] - The options for the storage.\n * @param {string} options.scope - The scope of the storage.\n * @param {?string} [options.type = null] - The type of storage.\n * @param {boolean} [options.crush = false] - Whether to crush the storage instance if it already exists.\n * @param {boolean} [options.initialize = true] - Whether to initialize the storage.\n */\n constructor({ scope, type = null, crush = false, initialize = true } = {}) {\n this._scope = scope;\n this._type = type || \"_default\";\n this._crush = crush;\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initialize the storage.\n */\n initialize() {\n // Try to make sure the storage instance won't crush other instances of StorageManager with the same scope.\n try {\n if (!this._crush && typeof window[this.scope] !== \"undefined\") {\n if (\n isValidInstance(\n StorageManager,\n { storage: window[this.scope] },\n { shouldThrow: false }\n ).status ||\n (typeof window[this.scope].storage !== \"undefined\" &&\n typeof window[this.scope].scope !== \"undefined\" &&\n typeof window[this.scope].type !== \"undefined\")\n ) {\n this._storage = window[this.scope].storage;\n }\n }\n } catch {\n // Do nothing.\n } finally {\n window[this.scope] = this;\n }\n }\n\n /**\n * The scope of the storage.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _scope\n */\n get scope() {\n return this._scope;\n }\n\n /**\n * The type of storage.\n *\n * @type {string}\n *\n * @see _type\n */\n get type() {\n return this._type;\n }\n\n set type(type) {\n if (isValidType(\"string\", { type })) {\n this._type = type;\n }\n }\n\n /**\n * The storage object.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _storage\n */\n get storage() {\n return this._storage;\n }\n\n /**\n * Get the storage object.\n *\n * @param {object} [options = {}] - The options for getting the storage.\n * @param {string} [options.type = this.type] - The type of storage to get.\n * @param {?string} [options.key = null] - The key to get the value from.\n * @return {object} - The storage object.\n */\n get({ type = this.type, key = null } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (!this.storage[type]) {\n throw new Error(\n `StorageManager (${this.scope}): Type \"${type}\" is not initialized.`\n );\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n return this.storage[type][key];\n }\n\n return this.storage[type];\n }\n\n /**\n * Set the storage object.\n *\n * @param {object} [options = {}] - The options for setting the storage.\n * @param {string} [options.type = this.type] - The type of storage to set.\n * @param {?string} [options.key = null] - The key to set the value to.\n * @param {object} [options.data = {}] - The data to set.\n */\n set({ type = this.type, key = null, data = {} } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n const dataCheck = isValidType(\"object\", { data });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (!dataCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${dataCheck.message}`);\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n if (!this._storage[type]) {\n this._storage[type] = {};\n }\n\n this._storage[type][key] = data;\n } else {\n this._storage[type] = data;\n }\n }\n\n /**\n * Remove a value from the storage object.\n *\n * @param {object} [options = {}] - The options for removing from storage.\n * @param {string} [options.type = this.type] - The type of storage to remove from.\n * @param {?string} [options.key = null] - The key to remove the value from.\n */\n clear({ type = this.type, key = null } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n delete this.storage[type][key];\n } else {\n delete this.storage[type];\n }\n }\n\n dispose() {\n delete this._storage;\n delete this;\n }\n}\n\nexport default StorageManager;\n","/**\n * @file\n * A generic component class.\n */\n\nimport {\n isValidInstance,\n isValidType,\n isValidClassList,\n isQuerySelector,\n isValidState,\n isValidEvent,\n isValidEventType,\n hasValidRootDOMElement,\n} from \"./validate.js\";\nimport StorageManager from \"./storage/StorageManager.js\";\nimport { addClass, removeClass } from \"./domHelpers.js\";\n\nclass Component {\n /**\n * The DOM elements within the component.\n *\n * @protected\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n */\n _dom = {};\n\n /**\n * The root DOM element of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _rootDOMElement = \"\";\n\n /**\n * The DOM elements within the component that cannot be reset or generated by the component itself.\n *\n * @protected\n *\n * @type {string[]}\n */\n _protectedDOMElements = [];\n\n /**\n * The query selectors used by the component.\n *\n * @protected\n *\n * @type {Object<string>}\n */\n _selectors = {};\n\n /**\n * The instantiated elements within the component.\n *\n * @protected\n *\n * @type {object}\n */\n _elements = {};\n\n /**\n * The CSS classes to apply when the component is in various states.\n *\n * @protected\n *\n * @type {Object<string, string[]>}\n */\n _classes = {\n initialize: \"\",\n };\n\n /**\n * The duration times (in milliseconds) for various aspects throughout the component.\n *\n * @protected\n *\n * @type {Object<number>}\n */\n _durations = {};\n\n /**\n * The delay times (in milliseconds) for various aspects throughout the component.\n *\n * @protected\n *\n * @type {Object<number>}\n */\n _delays = {};\n\n /**\n * The current state of the component's focus.\n *\n * @protected\n *\n * @type {string}\n */\n _focusState = \"none\";\n\n /**\n * The last type of event triggered within the component.\n *\n * @protected\n *\n * @type {string}\n */\n _currentEvent = \"none\";\n\n /**\n * The breakoint that the component will call media query list events.\n *\n * @protected\n *\n * @type {string}\n */\n _breakpoint = \"\";\n\n /**\n * The media query to use to trigger media query list events.\n *\n * @type {string}\n */\n _mediaQueryString = \"\";\n\n /**\n * This MediaQueryList for the component.\n *\n * @protected\n *\n * @type {MediaQueryList|null}\n */\n _mediaQueryList = null;\n\n /**\n * A callback for media query list events.\n *\n * @protected\n *\n * @type {Function}\n *\n * @param {MediaQueryListEvent} event - The event.\n */\n _mediaQueryListEventCallback = (event) => {\n // Add functionality to handle media matches.\n if (event.matches) {\n // Do something.\n } else {\n // Do something else.\n }\n };\n\n /**\n * Intervals throughout the component.\n *\n * @protected\n *\n * @type {Object<Function>}\n */\n _intervals = {};\n\n /**\n * Timeouts throughout the component.\n *\n * @protected\n *\n * @type {Object<Function>}\n */\n _timeouts = {};\n\n /**\n * Event listeners throughout the component.\n *\n * @protected\n *\n * @type {object[]}\n */\n _listeners = [];\n\n /**\n * Custom events that can be triggered throughout the component.\n *\n * @protected\n *\n * @type {Object<CustomEvent>}\n */\n _events = {\n initialize: new CustomEvent(\"grauplComponentInitialize\", {\n detail: { component: this },\n }),\n preinitialize: new CustomEvent(\"grauplComponentPreinitialize\", {\n detail: { component: this },\n }),\n postinitialize: new CustomEvent(\"grauplComponentPostinitialize\", {\n detail: { component: this },\n }),\n validate: new CustomEvent(\"grauplComponentValidate\", {\n detail: { component: this },\n }),\n prevalidate: new CustomEvent(\"grauplComponentPrevalidate\", {\n detail: { component: this },\n }),\n postvalidate: new CustomEvent(\"grauplComponentPostvalidate\", {\n detail: { component: this },\n }),\n };\n\n /**\n * The prefix used for CSS custom properties and attributes.\n *\n * @protected\n *\n * @type {string}\n */\n _prefix = \"graupl-\";\n\n /**\n * The key used to generate IDs throughout the component.\n *\n * @protected\n *\n * @type {string}\n */\n _key = \"\";\n\n /**\n * The component name of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _name = \"Component\";\n\n /**\n * The key used for storage.\n *\n * @protected\n *\n * @type {string}\n */\n _storageKey = \"components\";\n\n /**\n * A flag to check if the component should be stored in the StorageManager.\n */\n _shouldStore = true;\n\n /**\n * The main ID of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _id = \"\";\n\n /**\n * The validity state of the component.\n *\n * @protected\n *\n * @type {boolean}\n */\n _valid = true;\n\n /**\n * The initialized state of the component.\n *\n * @protected\n *\n * @type {boolean}\n */\n _initialized = false;\n\n /**\n * The errors found throughout the component.\n *\n * @protected\n *\n * @type {Error[]}\n */\n _errors = [];\n\n /**\n * Constructs a new component.\n *\n * @param {object} [options = {}] - The options for generating the component.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the component.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the component is initializing.\n */\n constructor({\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n } = {}) {\n // Set the classes.\n this._classes.initialize = initializeClass || \"\";\n\n // Set the prefix and key.\n this._prefix = prefix || \"\";\n this._key = key || \"\";\n }\n\n /**\n * Initialize the component.\n */\n initialize() {\n try {\n if (!this._validate()) {\n throw new Error(\n `Graupl ${this.name}: Cannot initialize component. The following errors have been found:\\n - ${this.errors\n .map((error) => error.message)\n .join(\"\\n - \")}`\n );\n }\n\n addClass(this.initializeClass, this.rootDOMElement);\n\n this._dispatchEvent(\"preinitialize\", this.rootDOMElement);\n\n // Generate the key.\n this._generateKey();\n\n // Set up the DOM.\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n this._setCustomProps();\n\n // Set up child elements.\n this._createChildElements();\n\n // Handle events.\n this._handleMediaMatch();\n this._handleFocus();\n this._handleHover();\n this._handleClick();\n this._handleKeydown();\n this._handleKeyup();\n\n this._dispatchEvent(\"initialize\", this.rootDOMElement);\n\n // Store the component.\n this._store();\n\n removeClass(this.initializeClass, this.rootDOMElement);\n\n this._initialized = true;\n\n this._dispatchEvent(\"postinitialize\", this.rootDOMElement);\n } catch (error) {\n console.error(error);\n }\n }\n init() {\n this.initialize();\n }\n\n /**\n * The DOM elements within the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _dom\n */\n get dom() {\n return this._dom;\n }\n\n /**\n * The root DOM element of the component.\n *\n * @readonly\n *\n * @type {HTMLElement}\n *\n * @see _rootDOMElement\n */\n get rootDOMElement() {\n return this._dom[this._rootDOMElement] || document.documentElement;\n }\n\n /**\n * The query selectors used by the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _selectors\n */\n get selectors() {\n return this._selectors;\n }\n\n /**\n * The instantiated elements within the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _elements\n */\n get elements() {\n return this._elements;\n }\n\n /**\n * The CSS classes to apply when the component is in various states.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _classes\n */\n get classes() {\n return this._classes;\n }\n\n /**\n * The duration times (in milliseconds) for various aspects throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _durations\n */\n get durations() {\n return this._durations;\n }\n\n /**\n * The delay times (in milliseconds) for various aspects throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _delays\n */\n get delays() {\n return this._delays;\n }\n\n /**\n * Intervals throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _intervals\n */\n get intervals() {\n return this._intervals;\n }\n\n /**\n * Timeouts throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _timeouts\n */\n get timeouts() {\n return this._timeouts;\n }\n\n /**\n * Event listeners throughout the component.\n *\n * @readonly\n *\n * @type {object[]}\n *\n * @see _listeners\n */\n get listeners() {\n return this._listeners;\n }\n\n /**\n * Custom events that can be triggered throughout the component.\n *\n * @readonly\n *\n * @type {Error[]}\n *\n * @see _events\n */\n get events() {\n return this._events;\n }\n\n /**\n * The class(es) to apply when the component is initializing.\n *\n * @type {string|string[]}\n *\n * @see _classes.initialize\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 current state of the component'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({ focusState: value });\n\n if (this._focusState !== value) {\n this._focusState = value;\n }\n }\n\n /**\n * The last type of event triggered within the component.\n *\n * @type {string}\n *\n * @see _currentEvent\n */\n get currentEvent() {\n return this._currentEvent;\n }\n\n set currentEvent(value) {\n isValidEvent({ currentEvent: value });\n\n if (this._currentEvent !== value) {\n this._currentEvent = value;\n }\n }\n\n /**\n * A flag to check if the disclosure's focus methods should _actually_ move the focus in the DOM.\n *\n * This will be `false` unless any of the following criteria are met:\n * - The disclosure's current event is \"keyboard\".\n *\n * @readonly\n *\n * @type {boolean}\n */\n get shouldFocus() {\n let check = false;\n\n if (this.currentEvent === \"keyboard\") {\n check = true;\n }\n\n return check;\n }\n\n /**\n * The breakoint that the component will call media query list events.\n *\n * @type {string}\n *\n * @see _breakpoint\n */\n get breakpoint() {\n return this._breakpoint;\n }\n\n set breakpoint(value) {\n isValidType(\"string\", { breakpoint: value });\n\n if (this._breakpoint !== value) {\n this._breakpoint = value;\n }\n }\n\n /**\n * The media query to use to trigger media query list events.\n *\n * @type {string}\n *\n * @see _mediaQueryString\n */\n get mediaQuery() {\n if (this._mediaQueryString !== \"\") {\n return this._mediaQueryString;\n }\n\n if (this._breakpoint === \"\") {\n return \"\";\n }\n\n return `(width <= ${this._breakpoint})`;\n }\n\n set mediaQuery(value) {\n isValidType(\"string\", { mediaQuery: value });\n\n if (this._mediaQueryString !== value) {\n this._mediaQueryString = value;\n }\n }\n\n /**\n * The prefix used for CSS custom properties and attributes.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * The key used to generate IDs throughout the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _key\n */\n get key() {\n return this._key;\n }\n\n /**\n * The component name of the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _name\n */\n get name() {\n return this._name;\n }\n\n /**\n * The main ID of the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _id\n */\n get id() {\n return this._id;\n }\n\n /**\n * The validity state of the component.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _valid\n */\n get isValid() {\n return this._valid;\n }\n\n /**\n * The initialized state of the component.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _initialized\n */\n get isInitialized() {\n return this._initialized;\n }\n\n /**\n * An array to hold error messages.\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 component to ensure proper functionality.\n *\n * Keys are altered to match the arguments passed in during creation where possible.\n *\n * @protected\n *\n * @return {boolean} - The result of the validation checks.\n */\n _validate() {\n this._dispatchEvent(\"prevalidate\", this.rootDOMElement);\n\n // _rootDOMElement check.\n const rootDOMElementCheck = hasValidRootDOMElement(this, {\n shouldThrow: false,\n });\n\n // Handle _rootDOMElement check failure.\n if (!rootDOMElementCheck.status) {\n this._errors = [...this._errors, ...rootDOMElementCheck.errors];\n this._valid = false;\n }\n\n // DOM checks.\n if (Object.keys(this._dom).length > 0) {\n const domElements = {};\n\n // Loop through and add \"Element\" to the end of each key in _dom.\n for (const domKey of Object.keys(this._dom)) {\n // If we're dealing with an array, we need to check each element in the array.\n if (Array.isArray(this._dom[domKey])) {\n this._dom[domKey].forEach((element, index) => {\n domElements[`${domKey}Element[${index}]`] = element;\n });\n } else if (this._dom[domKey] !== null) {\n domElements[`${domKey}Element`] = this._dom[domKey];\n }\n }\n\n // Check the DOM elements.\n const domChecks = isValidInstance(HTMLElement, domElements, {\n shouldThrow: false,\n });\n\n // Handle DOM check failure.\n if (!domChecks.status) {\n this._errors = [...this._errors, ...domChecks.errors];\n this._valid = false;\n }\n }\n\n // Query selector checks.\n if (Object.keys(this._selectors).length > 0) {\n const querySelectors = {};\n\n // Loop through and add \"Selector\" to the end of each key in _selectors.\n for (const querySelector of Object.keys(this._selectors)) {\n querySelectors[`${querySelector}Selector`] =\n this._selectors[querySelector];\n }\n\n // Check the query selectors.\n const querySelectorChecks = isQuerySelector(querySelectors, {\n shouldThrow: false,\n });\n\n // Handle query selector check failure.\n if (!querySelectorChecks.status) {\n this._errors = [...this._errors, ...querySelectorChecks.errors];\n this._valid = false;\n }\n }\n\n // Class list checks.\n if (Object.keys(this._classes).length > 0) {\n const classes = {};\n\n // Loop through and add \"Class\" to the end of each key in _classes.\n for (const className of Object.keys(this._classes)) {\n if (this._classes[className] === \"\") {\n continue;\n }\n\n classes[`${className}Class`] = this._classes[className];\n }\n\n // Check the class lists.\n const classListChecks = isValidClassList(classes, { shouldThrow: false });\n\n // Handle class list check failure.\n if (!classListChecks.status) {\n this._errors = [...this._errors, ...classListChecks.errors];\n this._valid = false;\n }\n }\n\n // Duration checks.\n if (Object.keys(this._durations).length > 0) {\n const durations = {};\n\n // Loop through and add \"Duration\" to the end of each key in _durations.\n for (const durationName of Object.keys(this._durations)) {\n durations[`${durationName}Duration`] = this._durations[durationName];\n }\n\n // Check the durations.\n const durationChecks = isValidType(\"number\", durations, {\n shouldThrow: false,\n });\n\n // Handle duration check failure.\n if (!durationChecks.status) {\n this._errors = [...this._errors, ...durationChecks.errors];\n this._valid = false;\n }\n }\n\n // Delay checks.\n if (Object.keys(this.delays).length > 0) {\n const delays = {};\n\n // Loop through and add \"Delay\" to the end of each key in delays.\n for (const delayName of Object.keys(this.delays)) {\n delays[`${delayName}Delay`] = this.delays[delayName];\n }\n\n // Check the delays.\n const delayChecks = isValidType(\"number\", delays, { shouldThrow: false });\n\n // Handle delay check failure.\n if (!delayChecks.status) {\n this._errors = [...this._errors, ...delayChecks.errors];\n this._valid = false;\n }\n }\n\n // String checks.\n const strings = {\n _storageKey: this._storageKey,\n key: this._key,\n prefix: this._prefix,\n mediaQuery: this._mediaQueryString,\n breakpoint: this._breakpoint,\n };\n\n this._protectedDOMElements.forEach((elementType) => {\n strings[`_protectedDOMElementType[${elementType}]`] = elementType;\n });\n // Check the strings.\n const stringChecks = isValidType(\"string\", strings, { shouldThrow: false });\n\n // Handle string check failure.\n if (!stringChecks.status) {\n this._errors = [...this._errors, ...stringChecks.errors];\n this._valid = false;\n }\n\n this._dispatchEvent(\"validate\", this.rootDOMElement);\n\n this._dispatchEvent(\"postvalidate\", this.rootDOMElement);\n\n return this._valid;\n }\n\n /**\n * Generates a key for the component.\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 IDs throughout the component.\n */\n _setIds() {\n // Add functionality to set IDs throughout the component.\n }\n\n /**\n * Sets ARIA attributes throughout the component.\n */\n _setAriaAttributes() {\n // Add functionality to set attributes throughout the component.\n }\n\n /**\n * Sets custom props throughout the component.\n */\n _setCustomProps() {\n // Add functionality to set custom props throughout the component.\n }\n\n /**\n * Sets DOM elements throughout the component.\n *\n * Elements listed in _protectedDOMElements cannot be set using 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.context] - The element used as the base context 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 = false] - A flag to set if the elements must be direct children of the base.\n */\n _setDOMElementType(\n elementType,\n { context, overwrite = true, strict = false } = {}\n ) {\n // Make sure the element type is valid.\n if (typeof this.selectors[elementType] !== \"string\") {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" is not a valid element type.`\n );\n }\n\n // Make sure the element type can actually be set through this method.\n if (\n this._rootDOMElement === elementType ||\n this._protectedDOMElements.includes(elementType)\n ) {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" element cannot be set through _setDOMElementType because it is a protected element.`\n );\n }\n\n // Make sure the context element is actually an HTMLELement.\n isValidInstance(HTMLElement, { context });\n\n // Get the all elements matching the selector in the context.\n const domElements = Array.from(\n context.querySelectorAll(this.selectors[elementType])\n );\n\n // Filter the elements so if `strict` is true, only direct children of the context are kept.\n const filteredElements = domElements.filter((item) =>\n strict ? item.parentElement === context : true\n );\n\n if (Array.isArray(this._dom[elementType])) {\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 this._dom[elementType] = filteredElements[0] || null;\n }\n }\n\n /**\n * Resets DOM elements throughout the component.\n *\n * Elements listed in _protectedDOMElements cannot be reset using this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to clear.\n */\n _resetDOMElementType(elementType) {\n // Make sure the element type is valid.\n if (typeof this.selectors[elementType] !== \"string\") {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" is not a valid element type.`\n );\n }\n\n // Make sure the element type can actually be reset through this method.\n if (\n this._rootDOMElement === elementType ||\n this._protectedDOMElements.includes(elementType)\n ) {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" element cannot be reset through _resetDOMElementType because it is a protected element.`\n );\n }\n\n if (Array.isArray(this._dom[elementType])) {\n this._dom[elementType] = [];\n } else {\n this._dom[elementType] = null;\n }\n }\n\n /**\n * Sets all DOM elements throughout the component.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n // Add functionality to set DOM Elements throughout the component.\n }\n\n /**\n * Creates and initializes child elements throughout the component.\n *\n * @protected\n */\n _createChildElements() {\n // Add functionality to handle creating child elements throughout the component.\n }\n\n /**\n * Handles media match events throughout the component.\n *\n * @protected\n */\n _handleMediaMatch() {\n if (this.mediaQuery === \"\") {\n return;\n }\n\n this._mediaQueryList = window.matchMedia(this.mediaQuery);\n this._addEventListener(\n \"change\",\n this._mediaQueryList,\n this._mediaQueryListEventCallback\n );\n this._mediaQueryListEventCallback(this._mediaQueryList);\n }\n\n /**\n * Handles focus events through the component.\n *\n * @protected\n */\n _handleFocus() {\n // Add functionality to handle focus events throughout the component.\n }\n\n /**\n * Handles click events through the component.\n *\n * @protected\n */\n _handleClick() {\n // Add functionality to handle click events throughout the component.\n }\n\n /**\n * Handles hover events through the component.\n *\n * @protected\n */\n _handleHover() {\n // Add functionality to handle hover events throughout the component.\n }\n\n /**\n * Handles keydown events through the component.\n *\n * @protected\n */\n _handleKeydown() {\n // Add functionality to handle keydown events throughout the component.\n }\n\n /**\n * Handles keyup events through the component.\n *\n * @protected\n */\n _handleKeyup() {\n // Add functionality to handle keyup events throughout the component.\n }\n\n /**\n * Stores the component into the global Graupl storage object.\n *\n * @protected\n */\n _store() {\n // Make sure the component should be stored.\n if (!this._shouldStore) {\n return;\n }\n\n // Set up the storage.\n if (\n !isValidInstance(\n StorageManager,\n { storage: window.GrauplStorage },\n { shouldThrow: false }\n ).status\n ) {\n new StorageManager({ scope: \"GrauplStorage\" });\n }\n\n // Store the menu\n window.GrauplStorage.set({\n key: this.id !== \"\" ? this.id : this.key,\n type: this._storageKey,\n data: this,\n });\n }\n\n /**\n * Removes the component from the global Graupl storage object.\n *\n * @protected\n */\n _unstore() {\n // Make sure the component should be stored.\n if (!this._shouldStore) {\n return;\n }\n\n if (\n !isValidInstance(\n StorageManager,\n { storage: window.GrauplStorage },\n { shouldThrow: false }\n ).status\n ) {\n return;\n }\n\n window.GrauplStorage.clear({\n key: this.id !== \"\" ? this.id : this.key,\n type: this._storageKey,\n });\n }\n\n /**\n * Sets an interval within the component.\n *\n * @protected\n *\n * @param {Function} [callback] - The callback function.\n * @param {number} [delay] - The time (in milliseconds) of the delay.\n * @param {string} [scope = _default] - The scope of the interval (used to store the interval in _intervals).\n */\n _setInterval(callback, delay, scope = \"_default\") {\n this._clearInterval(scope);\n\n this._intervals[scope] = setInterval(callback, delay);\n }\n\n /**\n * Clears an interval within the component.\n *\n * @protected\n *\n * @param {string} [scope = _default] - The scope of the interval (used to get the interval from _intervals).\n */\n _clearInterval(scope = \"_default\") {\n clearInterval(this._intervals[scope]);\n }\n\n /**\n * Clears all intervals within the component.\n *\n * @protected\n */\n _clearIntervals() {\n for (const scope of Object.keys(this._intervals)) {\n this._clearInterval(scope);\n }\n }\n\n /**\n * Sets a timeout within the component.\n *\n * @protected\n *\n * @param {Function} [callback] - The callback function.\n * @param {number} [delay] - The time (in milliseconds) of the delay.\n * @param {string} [scope = _default] - The scope of the timeout (used to store the timeout in _timeouts).\n */\n _setTimeout(callback, delay, scope = \"_default\") {\n this._clearTimeout(scope);\n\n this._timeouts[scope] = setTimeout(callback, delay);\n }\n\n /**\n * Clears a timeout within the component.\n *\n * @protected\n *\n * @param {string} [scope = _default] - The scope of the timeout (used to get the timeout from _timeouts).\n */\n _clearTimeout(scope = \"_default\") {\n clearTimeout(this._timeouts[scope]);\n }\n\n /**\n * Clears all timeouts within the component.\n *\n * @protected\n */\n _clearTimeouts() {\n for (const scope of Object.keys(this._timeouts)) {\n this._clearTimeout(scope);\n }\n }\n\n /**\n * Registers a new event type within the component.\n *\n * @protected\n *\n * @param {string} name - The name of the new event type.\n * @param {object} [options = {}] - The options for the new event type.\n * @param {boolean} [options.bubbles = true] - A flag to set if the event bubbles.\n * @param {object} [options.detail = {}] - Additional details to include in the event.\n */\n _registerEvent(name, { bubbles = true, detail = {} } = {}) {\n isValidType(\"string\", { name });\n isValidType(\"boolean\", { bubbles });\n isValidType(\"object\", { detail });\n\n const eventName = `graupl${this.name}${name.charAt(0).toUpperCase()}${name.slice(\n 1\n )}`;\n\n this._events[name] = new CustomEvent(eventName, {\n bubbles,\n detail: { component: this, ...detail },\n });\n }\n\n /**\n * Dispatch a custom event on an element in the DOM.\n *\n * @param {string} eventType - The type of the event to dispatch.\n * @param {HTMLElement} element - The element to dispatch the event on.\n */\n _dispatchEvent(eventType, element) {\n // Make sure the event type exists.\n isValidEventType(eventType, this);\n\n // Make sure the element is actually an HTML Element.\n isValidInstance(HTMLElement, { element });\n\n // Dispatch the event.\n element.dispatchEvent(this.events[eventType]);\n }\n\n /**\n * Add an event listener to an element and register it within the component.\n *\n * @param {string} type - The type of event to listen for.\n * @param {HTMLElement} element - The element to add the listener to.\n * @param {Function} listener - The listener callback.\n * @param {object|boolean} [options = {}] - Options to pass to the listener.\n */\n _addEventListener(type, element, listener, options = {}) {\n // Add the listener.\n element.addEventListener(type, listener, options);\n\n // Store it in the component.\n this._listeners.push({\n type,\n element,\n listener,\n options,\n });\n }\n\n /**\n * Remove an event listener from an element and unregister it within the component.\n *\n * @param {string} type - The type of event to remove.\n * @param {HTMLElement} element - The element to remove the listener from.\n * @param {Function} listener - The listener callback.\n * @param {object|boolean} [options = {}] - Options to pass to the listener.\n */\n _removeEventListener(type, element, listener, options = {}) {\n // Remove the listener.\n element.removeEventListener(type, listener, options);\n\n // Find the listener in the component's listener storage.\n let index = -1;\n\n this._listeners.forEach((registeredListener, i) => {\n if (\n registeredListener.type === type &&\n registeredListener.element === element &&\n registeredListener.listener === listener &&\n JSON.stringify(registeredListener.options) === JSON.stringify(options)\n ) {\n index = i;\n }\n });\n\n // Remove it from the component's listener storage.\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Removes all event listeners registered in the component.\n *\n * This can be filtered by type and/or element.\n *\n * @protected\n *\n * @param {object} [options = {}] - Options for removing listeners.\n * @param {?string} [options.type = null] - The type of event to remove. If null, all types are removed.\n * @param {?HTMLElement} [options.element = null] - The element to remove listeners from. If null, all elements are removed.\n */\n _removeEventListeners({ type = null, element = null } = {}) {\n const listeners = [...this._listeners];\n\n listeners.forEach((listener) => {\n if (type !== null && listener.type !== type) return;\n if (element !== null && listener.element !== element) return;\n\n this._removeEventListener(\n listener.type,\n listener.element,\n listener.listener,\n listener.options\n );\n });\n }\n\n /**\n * Focus the component.\n *\n * Sets the components's focus state to \"self\" and\n * focusses the component if the component's shouldFocus\n * value is `true`.\n */\n focus() {\n this.focusState = \"self\";\n\n if (this.shouldFocus) {\n this.rootDOMElement.focus();\n }\n }\n\n /**\n * Unfocus the component.\n *\n * Sets the component's focus state to \"none\"\n * and blurs the component if the component's shouldFocus\n * value is `true`.\n */\n blur() {\n this.focusState = \"none\";\n\n if (this.shouldFocus) {\n this.rootDOMElement.blur();\n }\n }\n\n /**\n * Disposes of the current instantiated component.\n *\n * Removes all timeouts and event listeners, removes the component from the global storage, and delete's the object.\n */\n dispose() {\n this._clearIntervals();\n this._clearTimeouts();\n this._removeEventListeners();\n this._unstore();\n\n delete this;\n }\n}\n\nexport default Component;\n","/**\n * @file\n * The Accordion item class.\n */\n\n/* global Accordion */\n\nimport { isTag } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * @event grauplAccordionItemExpand\n * Fired when the accordion item is Expanded.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<AccordionItem>} detail - The event details.\n * @property {AccordionItem} detail.toggle - The accordion item that was Expanded.\n */\n\n/**\n * @event grauplAccordionItemCollapse\n * Fired when the accordion item is collapsed.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<AccordionItem>} detail - The event details.\n * @property {AccordionItem} detail.toggle - The accordion item that was collapsed.\n */\n\n/**\n * The Accordion item component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the accordion item.\n * @property {HTMLElement} _dom.item - The accordion item element.\n * @property {HTMLElement} _dom.toggle - The controller element.\n * @property {HTMLElement} _dom.header - The header element.\n * @property {HTMLElement} _dom.content - The content element.\n * @property {string} _rootDOMElement - The root DOM element of the accordion item.\n * @property {string[]} _protectedDOMElements - The DOM elements within the accordion item that cannot be reset or generated by the accordion item itself.\n * @property {Object<Accordion>} _elements - The instantiated elements within the accordion item.\n * @property {Accordion} _elements.parent - The parent accordion containing this item.\n * @property {TransactionalValue} _open - The open state of the accordion item.\n * @property {TransactionalValue} _locked - The locked state of the accordion item.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the accordion item.\n * @property {grauplAccordionItemExpand} _events.expand - The event triggered when the accordion item is expanded.\n * @property {grauplAccordionItemCollapse} _events.collapse - The event triggered when the accordion item is collapsed.\n * @property {Object<string>} _selectors - The query selectors used by the accordion item.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the accordion item is in various states.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the accordion item.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the accordion item.\n * @property {string} _focusState - The current state of the accordion item's focus.\n * @property {string} _currentEvent - The last type of event triggered within the accordion item.\n * @property {string} _breakpoint - The breakpoint that the accordion item will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the accordion item.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the accordion item.\n * @property {Object<Function>} _timeouts - Timeouts throughout the accordion item.\n * @property {object[]} _listeners - Event listeners throughout the accordion item.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the accordion item.\n * @property {string} _name - The component name of the accordion item.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {string} _id - The main ID of the accordion item.\n * @property {boolean} _valid - The validity state of the accordion item.\n * @property {boolean} _initialized - The initialized state of the accordion item.\n * @property {string[]} _errors - The errors found throughout the accordion item.\n */\nclass AccordionItem extends Component {\n _rootDOMElement = \"item\";\n _protectedDOMElements = [\"toggle\", \"header\", \"content\"];\n _open = new TransactionalValue(false);\n _locked = new TransactionalValue(false);\n _name = \"AccordionItem\";\n _storageKey = \"accordionItems\";\n _shouldStore = false;\n\n /**\n * Constructs a new AccordionItem.\n *\n * @param {object} options - The options object.\n * @param {HTMLElement} options.accordionItemElement - The accordion item element.\n * @param {HTMLElement} options.accordionItemToggleElement - The toggle element.\n * @param {HTMLElement} options.accordionItemHeaderElement - The header element.\n * @param {HTMLElement} options.accordionItemContentElement - The content element.\n * @param {Accordion} [options.parentAccordion = null] - The accordion containing this item.\n */\n constructor({\n accordionItemElement,\n accordionItemToggleElement,\n accordionItemHeaderElement,\n accordionItemContentElement,\n parentAccordion = null,\n }) {\n super({\n prefix: parentAccordion.prefix,\n key: parentAccordion.key,\n });\n\n // Set DOM elements.\n this._dom.item = accordionItemElement;\n this._dom.toggle = accordionItemToggleElement;\n this._dom.header = accordionItemHeaderElement;\n this._dom.content = accordionItemContentElement;\n\n // Set the accordion elements.\n this._elements.parent = parentAccordion;\n\n // Register custom events.\n this._registerEvent(\"expand\", {\n detail: {\n item: this,\n },\n });\n this._registerEvent(\"collapse\", {\n detail: {\n item: this,\n },\n });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Set the initial state of the accordion item.\n if (this.dom.toggle.getAttribute(\"aria-expanded\") === \"true\") {\n this.show({ force: true, emit: false, transition: false });\n } else {\n this.hide({ force: true, emit: false, transition: false });\n }\n }\n );\n }\n\n /**\n * The open state of the accordion item.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _open\n */\n get isOpen() {\n return this._open.value;\n }\n\n /**\n * The locked state of the accordion item.\n *\n * If locked, the accordion item cannot be closed.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get isLocked() {\n return this._locked.value;\n }\n\n /**\n * Sets the IDs for the accordion item and its elements if they don't exist.\n *\n * The generated IDs use the parent accordion's key and follows the pattern:\n * - Accordion item: `accordion-item-{key}-{index}`\n * - Accordion item toggle: `accordion-item-toggle-{key}-{index}`\n * - Accordion item content: `accordion-item-content-{key}-{index}`\n */\n _setIds() {\n // Get the required information for IDs.\n const { key } = this.elements.parent;\n const index = this.elements.parent.dom.accordionItems.indexOf(\n this.dom.item\n );\n\n this.dom.item.id = this.dom.item.id || `accordion-item-${key}-${index}`;\n this.dom.toggle.id =\n this.dom.toggle.id || `accordion-item-toggle-${key}-${index}`;\n this.dom.header.id =\n this.dom.header.id || `accordion-item-header-${key}-${index}`;\n this.dom.content.id =\n this.dom.content.id || `accordion-item-content-${key}-${index}`;\n }\n\n /**\n * Sets the ARIA attributes for the accordion item and its elements.\n */\n _setAriaAttributes() {\n // Set the ARIA attributes for the accordion item toggle.\n // If the toggle is not a button, then set the role to \"button\".\n if (\n !isTag(\"button\", { toggle: this.dom.toggle }, { shouldThrow: false })\n .status\n ) {\n this.dom.toggle.setAttribute(\"role\", \"button\");\n }\n\n // If aria-expanded is not explicitly set to \"true\", then set it to \"false\".\n if (this.dom.toggle.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.toggle.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Set the aria-controls attribute for the toggle.\n this.dom.toggle.setAttribute(\"aria-controls\", this.dom.content.id);\n\n // Set the ARIA attributes for the accordion item content.\n // If the content is not a section, then set the role to \"region\".\n if (\n !isTag(\"section\", { content: this.dom.content }, { shouldThrow: false })\n .status\n ) {\n this.dom.content.setAttribute(\"role\", \"region\");\n }\n\n // Set the aria-labelledby attribute for the content.\n this.dom.content.setAttribute(\"aria-labelledby\", this.dom.toggle.id);\n }\n\n /**\n * Reveal the accordion item.\n *\n * Sets the accordion item's `aria-expanded` to \"true\", adds the\n * open class to the item, and removes the closed class from the item.\n *\n * @protected\n *\n * @fires grauplAccordionItemExpand\n *\n * @param {Object<boolean>} [options = {}] - Options for revealing the accordion item.\n * @param {boolean} [options.emit = true] - Emit the activate event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _reveal({ emit = true, transition = true } = {}) {\n const { closeClass, openClass, transitionClass, openDuration } =\n this.elements.parent;\n\n // Set aria-selected to true when hiding accordion item.\n this.dom.toggle.setAttribute(\"aria-expanded\", \"true\");\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the hide class,\n // add the show class, and finally remove the transition class.\n //\n // If `transition` is false, then it doesn't matter if the transition class\n // is set. Do not use the transition.\n if (transition && transitionClass !== \"\") {\n addClass(transitionClass, this.dom.item);\n\n requestAnimationFrame(() => {\n removeClass(closeClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n addClass(openClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height + this.dom.content.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n this._setTimeout(() => {\n removeClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = \"\";\n }, openDuration);\n });\n });\n });\n } else {\n // Add the show class\n addClass(openClass, this.dom.item);\n\n // Remove the hide class.\n removeClass(closeClass, this.dom.item);\n }\n\n this.dom.content.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"expand\", this.dom.item);\n }\n }\n\n /**\n * Conseals the accordion item.\n *\n * Sets the accordion item's `aria-expanded` to \"false\", adds the\n * close class to the item, and removes the open class from the item.\n *\n * @protected\n *\n * @fires grauplAccordionItemCollapse\n *\n * @param {Object<boolean>} [options = {}] - Options for concealing the accordion item.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once concealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _conceal({ emit = true, transition = true } = {}) {\n const { closeClass, openClass, transitionClass, closeDuration } =\n this.elements.parent;\n\n // Set aria-selected to false when hiding accordion item.\n this.dom.toggle.setAttribute(\"aria-expanded\", \"false\");\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the show class,\n // add the hide class, and finally remove the transition class.\n //\n // If `transition` is false, then it doesn't matter if the transition class\n // is set. Do not use the transition.\n if (transition && transitionClass !== \"\") {\n addClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.item.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n removeClass(openClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n addClass(closeClass, this.dom.item);\n\n requestAnimationFrame(() => {\n this._setTimeout(() => {\n removeClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = \"\";\n }, closeDuration);\n });\n });\n });\n } else {\n // Add the hide class\n addClass(closeClass, this.dom.item);\n\n // Remove the show class.\n removeClass(openClass, this.dom.item);\n }\n\n this.dom.content.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"collapse\", this.dom.item);\n }\n }\n\n /**\n * Shows the accordion item.\n *\n * @param {Object<boolean>} [options = {}] - The options for showing the accordion item.\n * @param {boolean} [options.force = false] - Whether to force the open action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n show({\n force = false,\n preserveState = false,\n emit = true,\n transition = true,\n } = {}) {\n if (this.isOpen && !force) return;\n\n this._reveal({ emit, transition });\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n\n // If the parent accordion only allows a single item to be open at a time,\n // then close all other items.\n if (!this.elements.parent.allowExpandMultiple) {\n this.unlockSiblings();\n this.closeSiblings();\n }\n\n // If the parent accordion requires at least one item to be open, and this\n // is the only open item, then lock it. Otherwise, unlock all siblings.\n if (!this.elements.parent.allowCollapseAll) {\n if (this.elements.parent.openAccordionItems.length <= 1) {\n this.lock();\n } else {\n this.unlockSiblings();\n }\n }\n }\n\n /**\n * Hides the accordion item.\n *\n * @param {Object<boolean>} [options = {}] - The options for hiding the accordion item.\n * @param {boolean} [options.force = false] - Whether to force the hide action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once consealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n hide({\n force = false,\n preserveState = false,\n emit = true,\n transition = true,\n } = {}) {\n if (!this.isOpen && !force) return;\n\n if (\n !this.elements.parent.allowCollapseAll &&\n this.elements.parent.openAccordionItems.length <= 1\n ) {\n return;\n }\n\n this._conceal({ emit, transition });\n\n // Set the open state.\n this._open.value = false;\n\n if (!preserveState) {\n this._open.commit();\n }\n\n // If the parent accordion requires at least one item to be open, and this was\n // the second to last open item, then lock to last open item.\n if (\n !this.elements.parent.allowCollapseAll &&\n this.elements.parent.openAccordionItems.length === 1\n ) {\n this.elements.parent.openAccordionItems[0].lock();\n }\n }\n\n /**\n * Toggle the accordion item.\n */\n toggle() {\n this.isOpen ? this.hide() : this.show();\n }\n\n /**\n * Focuses the accordion item.\n */\n focus() {\n this.dom.toggle.focus();\n }\n\n /**\n * Blurs the accordion item.\n */\n blur() {\n this.dom.toggle.blur();\n }\n\n /**\n * Locks the accordion item.\n */\n lock() {\n this._locked.value = true;\n this._locked.commit();\n this.dom.toggle.setAttribute(\"disabled\", \"true\");\n }\n\n /**\n * Unlocks the accordion item.\n */\n unlock() {\n this._locked.value = false;\n this._locked.commit();\n this.dom.toggle.removeAttribute(\"disabled\");\n }\n\n /**\n * Closes the siblings of the accordion item.\n */\n closeSiblings() {\n if (this.elements.parent) {\n this.elements.parent.elements.accordionItems.forEach((item) => {\n if (item !== this) {\n item.hide();\n }\n });\n }\n }\n\n /**\n * Unlocks the siblings of the accordion item.\n */\n unlockSiblings() {\n if (this.elements.parent) {\n this.elements.parent.elements.accordionItems.forEach((item) => {\n if (item !== this) {\n item.unlock();\n }\n });\n }\n }\n}\n\nexport default AccordionItem;\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 Character: isNaN(key) && !!key.match(/^[a-zA-Z]{1}$/),\n Tab: key === \"Tab\" || key === 9,\n Asterisk: key === \"*\" || key === 56,\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 * @file\n * The Accordion class.\n */\n\nimport AccordionItem from \"./AccordionItem.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport { isValidType, isValidClassList } from \"../validate.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The Accordion component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement, HTMLElement[]>} _dom - The DOM elements within the accordion.\n * @property {HTMLElement} _dom.accordion - The accordion element.\n * @property {HTMLElement[]} _dom.accordionItems - An array of accordion items.\n * @property {HTMLElement[]} _dom.accordionItemToggles - An array of accordion item toggles.\n * @property {HTMLElement[]} _dom.accordionItemHeaders - An array of accordion headers.\n * @property {HTMLElement[]} _dom.accordionItemContents - An array of accordion item contents.\n * @property {HTMLElement} _dom.accordionControlContainer - The accordion control container.\n * @property {HTMLElement[]} _dom.accordionControls - The accordion controls.\n * @property {HTMLElement[]} _dom.expandController - The expand all controller(s).\n * @property {HTMLElement[]} _dom.collapseController - The collapse all controller(s).\n * @property {string} _rootDOMElement - The root DOM element of the accordion.\n * @property {string[]} _protectedDOMElements - The DOM elements within the accordion that cannot be reset or generated by the accordion itself.\n * @property {Object<string>} _selectors - The query selectors used by the accordion.\n * @property {string} _selectors.accordionItems - The query selector for accordion items.\n * @property {string} _selectors.accordionItemToggles - The query selector for accordion toggles.\n * @property {string} _selectors.accordionItemHeaders - The query selector for accordion headers.\n * @property {string} _selectors.accordionItemContents - The query selector for accordion contents.\n * @property {string} _selectors.accordionControlContainer - The querySelector for the accordion control container.\n * @property {string} _selectors.accordionControls - The query selector string for accordion controls.\n * @property {string} _selectors.expandController - The query selector string for the expand all controller(s).\n * @property {string} _selectors.collapseController - The query selector string for the collapse all controller(s).\n * @property {Object<AccordionItem[]>} _elements - The list of accordion items.\n * @property {AccordionItem[]} _elements.accordionItems - The list of accordion items.\n * @property {Object<string, string[]>} _classes - The classes to apply when the accordions are in various states.\n * @property {string|string[]} _classes.open - The class(es) to apply when the accordion item is open.\n * @property {string|string[]} _classes.close - The class(es) to apply when the accordion item is closed.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the accordion item is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the accordion item is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various things throughout the accordion.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between open and closed states.\n * @property {number} _durations.open - The duration time (in milliseconds) for the transition from closed to open states.\n * @property {number} _durations.close - The duration time (in milliseconds) for the transition from open to closed states.\n * @property {boolean} _optionalKeySupport - A flag to decide if the accordion items can be navigated by arrows.\n * @property {boolean} _expandMultiple - A flag to decide if multiple accordion items can be open at the same time.\n * @property {boolean} _collapseAll - A flag to decide if all accordion items can be closed at the same time.\n * @property {number} _currentChild - The index of the current child node.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the accordion.\n * @property {string} _focusState - The current state of the accordion's focus.\n * @property {string} _currentEvent - The last type of event triggered within the accordion.\n * @property {string} _breakpoint - The breakpoint that the accordion will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the accordion.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the accordion.\n * @property {Object<Function>} _timeouts - Timeouts throughout the accordion.\n * @property {object[]} _listeners - Event listeners throughout the accordion.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the accordion.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the accordion.\n * @property {string} _name - The component name of the accordion.\n * @property {string} _id - The main ID of the accordion.\n * @property {boolean} _valid - The validity state of the accordion.\n * @property {boolean} _initialized - The initialized state of the accordion.\n * @property {Error[]} _errors - The errors found throughout the accordion.\n */\nclass Accordion extends Component {\n _rootDOMElement = \"accordion\";\n _optionalKeySupport = true;\n _expandMultiple = true;\n _collapseAll = true;\n _currentChild = 0;\n _storageKey = \"accordions\";\n _name = \"Accordion\";\n\n /**\n * Constructs a new `Accordion`.\n *\n * @param {object} options - The options for generating the accordion.\n * @param {HTMLElement} [options.accordionElement] - The accordion element in the DOM.\n * @param {string} [options.accordionItemsSelector = .accordion-item] - The query selector string for accordion items.\n * @param {string} [options.accordionItemTogglesSelector = .accordion-item-toggle] - The query selector string for accordion toggle.\n * @param {string} [options.accordionItemHeadersSelector = .accordion-item-header] - The query selector string for accordion header.\n * @param {string} [options.accordionItemContentsSelector = .accordion-item-content] - The query selector string for accordion content.\n * @param {string} [options.accordionControlContainerSelector = .accordion-control-container] - The query selector string for the accordion control container.\n * @param {string} [options.accordionControlsSelector = .accordion-control] - The query selector string for accordion controls.\n * @param {string} [options.expandControllerSelector = .expand-all] - The query selector string for the expand all controller(s).\n * @param {string} [options.collapseControllerSelector = .collapse-all] - The query selector string for the collapse all controller(s).\n * @param {?(string|string[])} [options.openClass = show] - The class to apply when a accordion is \"open\".\n * @param {?(string|string[])} [options.closeClass = hide] - The class to apply when a accordion is \"closed\".\n * @param {?(string|string[])} [options.transitionClass = transitioning] - The class to apply when a accordion is transitioning between \"open\" and \"closed\" states.\n * @param {number} [options.transitionDuration = 300] - The duration of the transition between \"open\" and \"closed\" states (in milliseconds).\n * @param {number} [options.openDuration = -1] - The duration of the transition from \"closed\" to \"open\" states (in milliseconds).\n * @param {number} [options.closeDuration = -1] - The duration of the transition from \"open\" to \"closed\" states (in milliseconds).\n * @param {boolean} [options.optionalKeySupport = false] - A flag to determine if accordions can be navigated with arrows.\n * @param {boolean} [options.allowExpandMultiple = true] - A flag to determine if multiple accordions can be open at the same time.\n * @param {boolean} [options.allowCollapseAll = true] - A flag to determine if no accordions can be open at the same time.\n * @param {boolean} [options.automaticActivation = false] - A flag to set if focusing a accordion item toggle will automatically activate it.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the accordion.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the accordion is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the accordion immediately upon creation.\n */\n constructor({\n accordionElement,\n accordionItemsSelector = \".accordion-item\",\n accordionItemTogglesSelector = \".accordion-item-toggle\",\n accordionItemHeadersSelector = \".accordion-item-header\",\n accordionItemContentsSelector = \".accordion-item-content\",\n accordionControlContainerSelector = \".accordion-control-container\",\n accordionControlsSelector = \".accordion-control\",\n expandControllerSelector = \".expand-all\",\n collapseControllerSelector = \".collapse-all\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 300,\n openDuration = -1,\n closeDuration = -1,\n optionalKeySupport = false,\n allowExpandMultiple = true,\n allowCollapseAll = true,\n automaticActivation = false,\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n }) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set DOM elements.\n this._dom.accordion = accordionElement;\n this._dom.accordionItems = [];\n this._dom.accordionItemToggles = [];\n this._dom.accordionItemHeaders = [];\n this._dom.accordionItemContents = [];\n this._dom.accordionControlContainer = null;\n this._dom.accordionControls = [];\n this._dom.expandController = [];\n this._dom.collapseController = [];\n\n // Set the query selectors.\n this._selectors.accordionItems = accordionItemsSelector;\n this._selectors.accordionItemToggles = accordionItemTogglesSelector;\n this._selectors.accordionItemHeaders = accordionItemHeadersSelector;\n this._selectors.accordionItemContents = accordionItemContentsSelector;\n this._selectors.accordionControlContainer =\n accordionControlContainerSelector;\n this._selectors.accordionControls = accordionControlsSelector;\n this._selectors.expandController = expandControllerSelector;\n this._selectors.collapseController = collapseControllerSelector;\n\n // Set the elements.\n this._elements.accordionItems = [];\n\n // Set the classes.\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.open = openDuration;\n this._durations.close = closeDuration;\n\n // Set automatic activation.\n this._automatic = automaticActivation;\n\n // Set optional key support.\n this._optionalKeySupport = optionalKeySupport;\n\n // Set expand rules.\n this._expandMultiple = allowExpandMultiple;\n this._collapseAll = allowCollapseAll;\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle enabling/disabling controls based on options.\n if (this.dom.expandController.length > 0 && !this.allowExpandMultiple) {\n this.dom.expandController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n if (this.dom.collapseController.length > 0 && !this.allowCollapseAll) {\n this.dom.collapseController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n automaticActivation: this._automatic,\n optionalKeySupport: this._optionalKeySupport,\n allowExpandMultiple: this._expandMultiple,\n allowCollapseAll: this._collapseAll,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans);\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply when the accordion is open.\n *\n * @type {string|string[]}\n *\n * @see _classes.open\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 when the accordion is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.close\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 when the accordion is transitioning between open and closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 duration time (in milliseconds) for the transition between open and closed states.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\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 will be used instead.\n *\n * @type {number}\n *\n * @see _durations.open\n */\n get openDuration() {\n return this._durations.open === -1\n ? this.transitionDuration\n : this._durations.open;\n }\n\n set openDuration(value) {\n isValidType(\"number\", { openDuration: value });\n\n if (this._durations.open !== value) {\n this._durations.open = value;\n this._setCustomProps();\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 will be used instead.\n *\n * @type {number}\n *\n * @see _durations.close\n */\n get closeDuration() {\n return this._durations.close === -1\n ? this.transitionDuration\n : this._durations.close;\n }\n\n set closeDuration(value) {\n isValidType(\"number\", { closeDuration: value });\n\n if (this._durations.close !== value) {\n this._durations.close = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The current index of the accordion item.\n *\n * @readonly\n *\n * @type {number}\n *\n * @see _currentChild\n */\n get currentChild() {\n return this._currentChild;\n }\n\n set currentChild(value) {\n isValidType(\"number\", { currentChild: value });\n\n if (\n this._currentChild !== value &&\n value >= 0 &&\n value < this.elements.accordionItems.length\n ) {\n this._currentChild = value;\n }\n }\n\n /**\n * A flag to decide if the accordion items can be navigated by arrows.\n *\n * @type {boolean}\n *\n * @see _optionalKeySupport\n */\n get optionalKeySupport() {\n return this._optionalKeySupport;\n }\n\n set optionalKeySupport(value) {\n isValidType(\"boolean\", { optionalKeySupport: value });\n\n if (this._optionalKeySupport !== value) {\n this._optionalKeySupport = value;\n }\n }\n\n /**\n * The currently selected accordion item.\n *\n * @readonly\n *\n * @type {AccordionItem}\n */\n get currentAccordionItem() {\n return this.elements.accordionItems[this.currentChild];\n }\n\n /**\n * The currently open accordion items.\n *\n * @readonly\n *\n * @type {AccordionItem[]}\n */\n get openAccordionItems() {\n return this.elements.accordionItems.filter((item) => item.isOpen);\n }\n\n /**\n * A flag to decide if multiple accordion items can be open at the same time.\n *\n * @type {boolean}\n *\n * @see _expandMultiple\n */\n get allowExpandMultiple() {\n return this._expandMultiple;\n }\n\n set allowExpandMultiple(value) {\n isValidType(\"boolean\", { allowExpandMultiple: value });\n\n if (this._expandMultiple !== value) {\n this._expandMultiple = value;\n\n if (this.dom.expandController.length > 0) {\n if (value) {\n this.dom.expandController.forEach((control) => {\n control.removeAttribute(\"disabled\");\n });\n } else {\n this.dom.expandController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n }\n }\n\n /**\n * A flag to decide if all accordion items can be closed at the same time.\n *\n * @type {boolean}\n *\n * @see _collapseAll\n */\n get allowCollapseAll() {\n return this._collapseAll;\n }\n\n set allowCollapseAll(value) {\n isValidType(\"boolean\", { allowCollapseAll: value });\n\n if (this._collapseAll !== value) {\n this._collapseAll = value;\n\n if (this.dom.collapseController.length > 0) {\n if (value) {\n this.dom.collapseController.forEach((control) => {\n control.removeAttribute(\"disabled\");\n });\n } else {\n this.dom.collapseController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n }\n }\n\n /**\n * Sets the IDs of the accordion and it's children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - accordion: `accordion-${key}`\n *\n * @protected\n */\n _setIds() {\n this.dom.accordion.id = this.dom.accordion.id || `accordion-${this.key}`;\n\n this._id = this.dom.accordion.id;\n }\n\n /**\n * Sets custom props throughout the accordion.\n *\n * The custom properties are:\n * - `--graupl-accordion-transition-duration`,\n * - `--graupl-accordion-open-transition-duration`, and\n * - `--graupl-accordion-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the accordion's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n /**\n * Sets all DOM elements within the accordion.\n *\n * Utilizes _setDOMElementType and\n * _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"accordionItems\", { context: this.dom.accordion });\n this._resetDOMElementType(\"accordionItemToggles\");\n this._setDOMElementType(\"accordionControlContainer\", {\n context: this.dom.accordion,\n });\n\n if (this.dom.accordionControlContainer) {\n this._setDOMElementType(\"accordionControls\", {\n context: this.dom.accordionControlContainer,\n });\n this._setDOMElementType(\"expandController\", {\n context: this.dom.accordionControlContainer,\n });\n this._setDOMElementType(\"collapseController\", {\n context: this.dom.accordionControlContainer,\n });\n }\n\n this.dom.accordionItems.forEach((accordionItem) => {\n this._setDOMElementType(\"accordionItemToggles\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n this._setDOMElementType(\"accordionItemHeaders\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n this._setDOMElementType(\"accordionItemContents\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n });\n }\n\n /**\n * Creates and initializes all accordion items.\n *\n * @protected\n */\n _createChildElements() {\n this.dom.accordionItems.forEach((accordionItem, index) => {\n const item = new AccordionItem({\n accordionItemElement: accordionItem,\n accordionItemToggleElement: this.dom.accordionItemToggles[index],\n accordionItemHeaderElement: this.dom.accordionItemHeaders[index],\n accordionItemContentElement: this.dom.accordionItemContents[index],\n parentAccordion: this,\n });\n\n item.initialize();\n\n this.elements.accordionItems.push(item);\n });\n }\n\n /**\n * Handles focus events throughout the accordion for proper use.\n *\n * - Adds a `focus` listener to every accordion item so when it gains focus,\n * it will set the accordion's current child to the index of the item.\n *\n * @protected\n */\n _handleFocus() {\n this.elements.accordionItems.forEach((accordionItem, index) => {\n this._addEventListener(\"focus\", accordionItem.dom.toggle, () => {\n this.currentChild = index;\n });\n });\n }\n\n /**\n * Handles click events throughout the accordion item for proper use.\n *\n * - Adds a `click` listener to the accordion item toggles that will toggle each accordion item.\n *\n * @protected\n */\n _handleClick() {\n this.elements.accordionItems.forEach((accordionItem, index) => {\n this._addEventListener(\"click\", accordionItem.dom.toggle, () => {\n this.currentChild = index;\n this.currentEvent = \"mouse\";\n accordionItem.toggle();\n });\n });\n\n // Clicks for the accordion controls.\n this.dom.expandController.forEach((control) => {\n this._addEventListener(\"click\", control, () => {\n this.currentEvent = \"mouse\";\n if (this.allowExpandMultiple) {\n this.openChildren();\n }\n });\n });\n this.dom.collapseController.forEach((control) => {\n this._addEventListener(\"click\", control, () => {\n this.currentEvent = \"mouse\";\n if (this.allowCollapseAll) {\n this.closeChildren();\n }\n });\n });\n }\n\n /**\n * Handles keydown events throughout the accordion item for proper use.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to all accordion item toggles.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n * - _If_ optionalKeySupport is enabled, blocks propagation on the following keys:\n * - \"ArrowDown\", \"ArrowUp\", \"Home\", and \"End\".\n * - Adds a `keydown` listener to all accordion controls.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n */\n _handleKeydown() {\n this.dom.accordionItemToggles.forEach((accordionToggle) => {\n this._addEventListener(\"keydown\", accordionToggle, (event) => {\n const key = keyPress(event);\n const toggleKeys = [\"Space\", \"Enter\"];\n\n if (toggleKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n } else if (this.optionalKeySupport) {\n const optionalKeys = [\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"];\n\n if (optionalKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n }\n }\n });\n });\n\n this.dom.accordionControls.forEach((control) => {\n this._addEventListener(\"keydown\", control, (event) => {\n const key = keyPress(event);\n const controllerKeys = [\"Space\", \"Enter\"];\n\n if (controllerKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n }\n });\n });\n }\n\n /**\n * Handles keyup events throughout the accordion item for proper use.\n *\n * Adds the follow keybindings (explanations are taken from the WAI ARIA Practices Guide Accordion Pattern):\n *\n * - `Enter` or `Space`:\n * - When focus is on the accordion header for a collapsed panel, expands the associated panel. If the implementation allows only one panel to be expanded, and if another panel is expanded, collapses that panel.\n * - When focus is on the accordion header for an expanded panel, collapses the panel if the implementation supports collapsing. Some implementations require one panel to be expanded at all times and allow only one panel to be expanded; so, they do not support a collapse function.\n * - When focus is on the accordion expand all control, expands all panels. If the implementation allows only one panel to be expanded, does nothing.\n * - WHen focus is on the accordion collapse all control, collapses all panels. If the implementation requires one panel to be expanded at all times, does nothing.\n * - `Accordion`: Moves focus to the next focusable element; all focusable elements in the accordion are included in the page `Accordion` sequence.\n * - `Shift + Accordion`: Moves focus to the previous focusable element; all focusable elements in the accordion are included in the page `Accordion` sequence.\n * - `Down Arrow` (Optional): If focus is on an accordion header, moves focus to the next accordion header. If focus is on the last accordion header, either does nothing or moves focus to the first accordion header.\n * - `Up Arrow` (Optional): If focus is on an accordion header, moves focus to the previous accordion header. If focus is on the first accordion header, either does nothing or moves focus to the last accordion header.\n * - `Home` (Optional): When focus is on an accordion header, moves focus to the first accordion header.\n * - `End` (Optional): When focus is on an accordion header, moves focus to the last accordion header.\n *\n * Note: When the above explanations mention \"accordion header\", they are referring to the accordion item toggle.\n */\n _handleKeyup() {\n this.dom.accordionItemToggles.forEach((accordionToggle) => {\n this._addEventListener(\"keyup\", accordionToggle, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n this.currentAccordionItem.toggle();\n\n break;\n }\n\n if (this.optionalKeySupport) {\n switch (key) {\n case \"Home\":\n preventEvent(event);\n this.focusFirstChild();\n\n break;\n case \"End\":\n preventEvent(event);\n this.focusLastChild();\n\n break;\n case \"ArrowDown\":\n preventEvent(event);\n this.focusNextChild();\n\n break;\n case \"ArrowUp\":\n preventEvent(event);\n this.focusPreviousChild();\n\n break;\n }\n }\n });\n });\n\n this.dom.expandController.forEach((control) => {\n this._addEventListener(\"keyup\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n\n if (this.allowExpandMultiple) {\n this.openChildren();\n }\n }\n });\n });\n\n this.dom.collapseController.forEach((control) => {\n this._addEventListener(\"keyup\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n\n if (this.allowCollapseAll) {\n this.closeChildren();\n }\n }\n });\n });\n }\n\n /**\n * Focus the accordion's current child.\n */\n focusCurrentChild() {\n if (this.currentChild !== -1) {\n this.currentAccordionItem.focus();\n }\n }\n\n /**\n * Focuses the accordion's child at a given index.\n *\n * @param {number} index - The index of the child to focus.\n */\n focusChild(index) {\n this.blurCurrentChild();\n this.currentChild = index;\n this.focusCurrentChild();\n }\n\n /**\n * Focuses the accordion's first child.\n */\n focusFirstChild() {\n this.focusChild(0);\n }\n\n /**\n * Focus the accordion's last child.\n */\n focusLastChild() {\n this.focusChild(this.elements.accordionItems.length - 1);\n }\n\n /**\n * Focus the accordion's next child.\n */\n focusNextChild() {\n if (this.currentChild < this.elements.accordionItems.length - 1) {\n this.focusChild(this.currentChild + 1);\n } else {\n this.focusCurrentChild();\n }\n }\n\n /**\n * Focus the accordion's previous child.\n */\n focusPreviousChild() {\n if (this.currentChild > 0) {\n this.focusChild(this.currentChild - 1);\n } else {\n this.focusCurrentChild();\n }\n }\n\n /**\n * Blurs the accordion's current child.\n */\n blurCurrentChild() {\n if (this.currentChild !== -1) {\n this.currentAccordionItem.blur();\n }\n }\n\n /**\n * Open all accordion items.\n */\n openChildren() {\n this.elements.accordionItems.forEach((item) => item.show());\n }\n\n /**\n * Close all accordion items.\n */\n closeChildren() {\n this.elements.accordionItems.forEach((item) => item.hide());\n }\n}\n\nexport default Accordion;\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 Accordion from \"./Accordion.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n accordionSelector = \".accordion\"\n) => {\n once(\"graupl-accordion-generator\", accordionSelector, context).forEach(\n (accordionElement) => {\n const accordionOptions = accordionElement.dataset.grauplAccordionOptions\n ? JSON.parse(\n accordionElement.dataset.grauplAccordionOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Accordion({\n accordionElement,\n initialize: true,\n ...options,\n ...accordionOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Alert class.\n */\n\nimport { isValidClassList, isValidType } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * @event grauplAlertShow\n * Fired when the alert is shown.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<Alert>} detail - The detail object.\n * @property {Alert} detail.alert - The alert that was shown.\n */\n\n/**\n * @event grauplAlertHide\n * Fired when the alert is hidden.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<Alert>} detail - The detail object.\n * @property {Alert} detail.alert - The alert that was hidden.\n */\n\n/**\n * The Alert component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the alert.\n * @property {HTMLElement} _dom.alert - The alert element.\n * @property {HTMLElement} _dom.controller - The alert controller element.\n * @property {string} _rootDOMElement - The root DOM element of the alert.\n * @property {string[]} _protectedDOMElements - The DOM elements within the alert that cannot be reset or generated by the alert itself.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the alert is in various states.\n * @property {string|string[]} _classes.show - The class(es) to apply when the alert is shown.\n * @property {string|string[]} _classes.hide - The class(es) to apply when the alert is hidden.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the alert is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the alert is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the alert.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between shown and hidden states.\n * @property {number} _durations.show - The duration time (in milliseconds) for the transition from hidden to shown states.\n * @property {number} _durations.hide - The duration time (in milliseconds) for the transition from shown to hidden states.\n * @property {TransactionalValue<boolean>} _hidden - The hidden state of the alert.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the alert.\n * @property {grauplAlertShow} _events.show - The event triggered when the alert is shown.\n * @property {grauplAlertHide} _events.hide - The event triggered when the alert is hidden.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<string>} _selectors - The query selectors used by the alert.\n * @property {Object<Alert>} _elements - The instantiated elements within the alert.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the alert.\n * @property {string} _focusState - The current state of the alert's focus.\n * @property {string} _currentEvent - The last type of event triggered within the alert.\n * @property {string} _breakpoint - The breakpoint that the alert will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the alert.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the alert.\n * @property {Object<Function>} _timeouts - Timeouts throughout the alert.\n * @property {object[]} _listeners - Event listeners throughout the alert.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the alert.\n * @property {string} _name - The component name of the alert.\n * @property {string} _id - The main ID of the alert.\n * @property {boolean} _valid - The validity state of the alert.\n * @property {boolean} _initialized - The initialized state of the alert.\n * @property {string[]} _errors - The errors found throughout the alert.\n */\nclass Alert extends Component {\n _rootDOMElement = \"alert\";\n _protectedDOMElements = [\"controller\"];\n _hidden = new TransactionalValue(false);\n _storageKey = \"alerts\";\n _name = \"Alert\";\n\n /**\n * Constructs a new `Alert`.\n *\n * @param {object} [options = {}] - The options object.\n * @param {HTMLElement} options.alertElement - The alert element.\n * @param {?HTMLElement} [options.controllerElement = null] - The controller element.\n * @param {string|string[]|null} [options.showClass = show] - The class(es) to apply when the alert is shown.\n * @param {string|string[]|null} [options.hideClass = hide] - The class(es) to apply when the alert is hidden.\n * @param {string|string[]|null} [options.transitionClass = transitioning] - The class(es) to apply when the alert is transitioning between states.\n * @param {number} [options.transitionDuration = 150] - The duration of the transition between \"shown\" and \"hidden\" states (in milliseconds).\n * @param {boolean} [options.showDuration = -1] - The duration of the transition from \"hidden\" to \"shown\" states (in milliseconds).\n * @param {boolean} [options.hideDuration = -1] - The duration of the transition from \"shown\" to \"hidden\" states (in milliseconds).\n * @param {boolean} [options.isHidden = false] - A flag to determine the initial state of the alert.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the alert.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the alert is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the alert immediately upon creation.\n */\n constructor({\n alertElement,\n controllerElement = null,\n showClass = \"show\",\n hideClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 150,\n showDuration = -1,\n hideDuration = -1,\n isHidden = false,\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n } = {}) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set the DOM elements.\n this._dom.alert = alertElement;\n this._dom.controller = controllerElement;\n\n // Set the classes.\n this._classes.show = showClass || \"\";\n this._classes.hide = hideClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.show = showDuration;\n this._durations.hide = hideDuration;\n\n // Set hidden.\n this._hidden.value = isHidden;\n this._hidden.commit();\n\n // Register custom events.\n this._registerEvent(\"show\", {\n detail: {\n alert: this,\n },\n });\n this._registerEvent(\"hide\", {\n detail: {\n alert: this,\n },\n });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle hiding the alert by default.\n if (this.isHidden) {\n this._conseal({ emit: false, transition: false });\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n isHidden: this._hidden.value,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class to use to show the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.show\n */\n get showClass() {\n return this._classes.show;\n }\n\n set showClass(value) {\n isValidClassList({ showClass: value });\n\n if (this._classes.show !== value) {\n this._classes.show = value;\n }\n }\n\n /**\n * The class to use to hide the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.hide\n */\n get hideClass() {\n return this._classes.hide;\n }\n\n set hideClass(value) {\n isValidClassList({ hideClass: value });\n\n if (this._classes.hide !== value) {\n this._classes.hide = value;\n }\n }\n\n /**\n * The class to use when transitioning the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 time in milliseconds the transition will take.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from hidden to shown states.\n *\n * If showDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --graupl-show-transition-duration CSS custom property on the alert.\n *\n * @type {number}\n *\n * @see _durations.show\n */\n get showDuration() {\n if (this._durations.show === -1) return this.transitionDuration;\n\n return this._durations.show;\n }\n\n set showDuration(value) {\n isValidType(\"number\", { showDuration: value });\n\n if (this._durations.show !== value) {\n this._durations.show = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from shown to hidden states.\n *\n * If hideDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --graupl-close-transition-duration CSS custom property on the alert.\n *\n * @type {number}\n *\n * @see _durations.hide\n */\n get hideDuration() {\n if (this._durations.hide === -1) return this.transitionDuration;\n\n return this._durations.hide;\n }\n\n set hideDuration(value) {\n isValidType(\"number\", { hideDuration: value });\n\n if (this._durations.hide !== value) {\n this._durations.hide = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The hidden state of the alert.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _hidden\n */\n get isHidden() {\n return this._hidden.value;\n }\n\n /**\n * Sets the IDs of the alert and its children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - alert: `alert-${key}`\n * - controller: `alert-controller-${key}`\n */\n _setIds() {\n this.dom.alert.id = this.dom.alert.id || `alert-${this.key}`;\n this.dom.controller.id =\n this.dom.controller.id || `alert-controller-${this.key}`;\n\n this._id = this.dom.alert.id;\n }\n\n /**\n * Reveals the alert.\n *\n * Adds the show class and removes the hide class from the alert.\n *\n * @protected\n *\n * @fires grauplAlertShow\n *\n * @param {Object<boolean>} [options = {}] - Options for revealing the alert.\n * @param {boolean} [options.emit = true] - Emit the show event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _reveal({ emit = true, transition = true } = {}) {\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the hide class,\n // add the show class, and finally remove the transition class.\n if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n removeClass(this.hideClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n addClass(this.showClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n this._setTimeout(\n () => removeClass(this.transitionClass, this.dom.alert),\n this.showDuration\n );\n });\n });\n });\n } else {\n // Add the show class\n addClass(this.showClass, this.dom.alert);\n\n // Remove the hide class.\n removeClass(this.hideClass, this.dom.alert);\n }\n\n this.dom.alert.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"show\", this.dom.alert);\n }\n }\n\n /**\n * Conceals the alert.\n *\n * Adds the hide class and removes the show class from the alert.\n *\n * @protected\n *\n * @fires grauplAlertHide\n *\n * @param {Object<boolean>} [options = {}] - Options for concealing the alert.\n * @param {boolean} [options.emit = true] - Emit the show event once concealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _conseal({ emit = true, transition = true } = {}) {\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the show class,\n // add the hide class, and finally remove the transition class.\n if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n removeClass(this.showClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n addClass(this.hideClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n this._setTimeout(\n () => removeClass(this.transitionClass, this.dom.alert),\n this.hideDuration\n );\n });\n });\n });\n } else {\n // Add the hide class\n addClass(this.hideClass, this.dom.alert);\n\n // Remove the show class.\n removeClass(this.showClass, this.dom.alert);\n }\n\n this.dom.alert.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"hide\", this.dom.alert);\n }\n }\n\n /**\n * Sets custom props throughout the alert.\n *\n * The custom properties are:\n * - `--graupl-alert-transition-duration`,\n * - `--graupl-alert-show-transition-duration`, and\n * - `--graupl-alert-hide-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the alert's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-show-transition-duration`,\n `${this.showDuration}ms`\n );\n\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-hide-transition-duration`,\n `${this.hideDuration}ms`\n );\n }\n\n /**\n * Handles click events throughout the alert for proper use.\n *\n * - Adds a `click` listener to the controller that will hide the alert.\n *\n * @protected\n */\n _handleClick() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"click\", this.dom.controller, () => this.hide());\n }\n\n /**\n * Handles keydown events throughout the alert for proper use.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to the controller (if it exists).\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n */\n _handleKeydown() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"keydown\", this.dom.controller, (event) => {\n const key = keyPress(event);\n\n // Prevent default behavior for space and enter keys.\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n }\n });\n }\n\n /**\n * Handles keyup events throughout the alert for proper use.\n *\n * - Adds a `keyup` listener to the controller (if it exists).\n * - Hides the alert when the user hits \"Space\" or \"Enter\".\n */\n _handleKeyup() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"keyup\", this.dom.controller, (event) => {\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n this.hide();\n }\n });\n }\n\n /**\n * Shows the alert.\n *\n * Sets the alert's focus state to \"self\", calls reveal, and sets isHidden to `false`.\n *\n * @param {Object<boolean>} [options = {}] - Options for showing the alert.\n * @param {boolean} [options.force = false] - Whether to force the show action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the hidden state.\n */\n show({ force = false, preserveState = false } = {}) {\n if (!this.isHidden && !force) return;\n\n // Set the focus state.\n this.focusState = \"self\";\n\n // Reveal the alert.\n this._reveal();\n\n // Set the hidden state.\n this._hidden.value = false;\n\n if (!preserveState) {\n this._hidden.commit();\n }\n }\n\n /**\n * Hides the alert.\n *\n * Sets the alert's focus state to \"none\", calls conceal, and sets isHidden to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for hiding the alert.\n * @param {boolean} [options.force = false] - Whether to force the hide action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the hidden state.\n */\n hide({ force = false, preserveState = false } = {}) {\n if (this.isHidden && !force) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Conceal the alert.\n this._conseal();\n\n // Set the hidden state.\n this._hidden.value = true;\n\n if (!preserveState) {\n this._hidden.commit();\n }\n }\n}\n\nexport default Alert;\n","import Alert from \"./Alert.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n alertSelector = \".alert\"\n) => {\n once(\"graupl-alert-generator\", alertSelector, context).forEach(\n (alertElement) => {\n const alertOptions = alertElement.dataset.grauplAlertOptions\n ? JSON.parse(\n alertElement.dataset.grauplAlertOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Alert({\n alertElement,\n controllerElement:\n alertElement.querySelector(\".alert-dismisser\") || null,\n initialize: true,\n ...options,\n ...alertOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Carousel class.\n */\n\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { preventEvent, keyPress } from \"../eventHandlers.js\";\nimport { isTag, isValidClassList, isValidType } from \"../validate.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The Carousel component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement, HTMLElement[]>} _dom - The DOM elements within the carousel.\n * @property {HTMLElement} _dom.carousel - The carousel element.\n * @property {HTMLElement[]} _dom.carouselItems - The carousel items.\n * @property {HTMLElement} _dom.carouselItemContainer - The carousel item container.\n * @property {HTMLElement[]} _dom.carouselControls - The carousel controls.\n * @property {HTMLElement} _dom.carouselControlContainer - The carousel control container.\n * @property {HTMLElement[]} _dom.carouselTabs - The carousel tabs.\n * @property {HTMLElement} _dom.carouselTabContainer - The carousel tab container.\n * @property {HTMLElement} _dom.autoplay - The autoplay button.\n * @property {HTMLElement} _dom.next - The next button.\n * @property {HTMLElement} _dom.previous - The previous button.\n * @property {string} _rootDOMElement - The root DOM element of the carousel.\n * @property {string[]} _protectedDOMElements - The DOM elements within the carousel that cannot be reset or generated by the carousel itself.\n * @property {Object<string>} _selectors - The query selectors used by the carousel.\n * @property {string} _selectors.carouselItems - The query selector string for carousel items.\n * @property {string} _selectors.carouselItemContainer - The query selector string for the carousel item container.\n * @property {string} _selectors.carouselControls - The query selector string for carousel controls.\n * @property {string} _selectors.carouselControlContainer - The query selector string for the carousel control container.\n * @property {string} _selectors.carouselTabs - The query selector string for the carousel tabs.\n * @property {string} _selectors.carouselTabContainer - The query selector string for the carousel tab container.\n * @property {string} _selectors.autoplay - The query selector string for the autoplay button.\n * @property {string} _selectors.next - The query selector string for the next button.\n * @property {string} _selectors.previous - The query selector string for the previous button.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the carousel is in various states.\n * @property {string|string[]} _classes.active - The class(es) to apply when a carousel item is active.\n * @property {string|string[]} _classes.previous - The class(es) to apply to a carousel item that is the previously active item.\n * @property {string|string[]} _classes.next - The class(es) to apply to a carousel item that is the next active item.\n * @property {string|string[]} _classes.play - The class(es) to apply to the autoplay button when the carousel is paused.\n * @property {string|string[]} _classes.pause - The class(es) to apply to the autoplay button when the carousel is playing.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the carousel is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the carousel.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between carousel items.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the carousel.\n * @property {number} _delays.transition - The delay time (in milliseconds) for the transition between carousel items.\n * @property {number} _currentItem - The index of the currently active carousel item.\n * @property {boolean} _autoplay - A flag to indicate if the carousel is currently playing.\n * @property {string} _playText - The label for the autoplay button when the carousel is paused.\n * @property {string} _pauseText - The label for the autoplay button when the carousel is playing.\n * @property {string} _currentAction - The current action being performed by the carousel.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the carousel.\n * @property {Object<object>} _elements - The instantiated elements within the carousel.\n * @property {string} _focusState - The current state of the carousel's focus.\n * @property {string} _currentEvent - The last type of event triggered within the carousel.\n * @property {string} _breakpoint - The breakpoint that the carousel will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the carousel.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the carousel.\n * @property {Object<Function>} _timeouts - Timeouts throughout the carousel.\n * @property {object[]} _listeners - Event listeners throughout the carousel.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the carousel.\n * @property {string} _name - The component name of the carousel.\n * @property {string} _id - The main ID of the carousel.\n * @property {boolean} _valid - The validity state of the carousel.\n * @property {boolean} _initialized - The initialized state of the carousel.\n * @property {string[]} _errors - The errors found throughout the carousel.\n */\nclass Carousel extends Component {\n _rootDOMElement = \"carousel\";\n _currentItem = 0;\n _autoplay = true;\n _playText = \"Play\";\n _pauseText = \"Pause\";\n _currentAction = \"next\";\n _storageKey = \"carousels\";\n _name = \"Carousel\";\n\n /**\n * Constructs a new `Carousel`.\n *\n * @param {object} options - The options for the generated carousel.\n * @param {HTMLElement} options.carouselElement - The carousel element in the DOM.\n * @param {string} [options.carouselItemsSelector = .carousel-item] - The query selector string for carousel items.\n * @param {string} [options.carouselItemContainerSelector = .carousel-item-container] - The query selector string for the carousel item container.\n * @param {string} [options.carouselControlsSelector = .carousel-control] - The query selector string for carousel controls.\n * @param {string} [options.carouselControlContainerSelector = .carousel-control-container] - The query selector string for carousel control container.\n * @param {string} [options.carouselTabsSelector = .carousel-tab] - The query selector string for carousel tabs.\n * @param {string} [options.carouselTabContainerSelector = .carousel-tab-container] - The query selector string for the carousel tab container.\n * @param {string} [options.autoplaySelector = .autoplay] - The query selector string for the autoplay button.\n * @param {string} [options.nextSelector = .next] - The query selector string for the next button.\n * @param {string} [options.previousSelector = .previous] - The query selector string for the previous button.\n * @param {?(string|string[])} [options.activeClass = active] - The class(es) to apply when a carousel item is active.\n * @param {?(string|string[])} [options.previousClass = previous] - The class(es) to apply to a carousel item that is the previously active item.\n * @param {?(string|string[])} [options.nextClass = next] - The class(es) to apply to a carousel item that is the next active item.\n * @param {?(string|string[])} [options.playClass = play] - The class(es) to apply to the autoplay button when the carousel is paused.\n * @param {?(string|string[])} [options.pauseClass = pause] - The class(es) to apply to the autoplay button when the carousel is playing.\n * @param {boolean} [options.autoplay = true] - A flag to indicate if the carousel should autoplay.\n * @param {number} [options.transitionDelay = 10000] - A flag to initialize the carousel immediately upon creation.\n * @param {number} [options.transitionDuration = 500] - The duration time (in milliseconds) for the transition between carousel items.\n * @param {?string} [options.playText = Play] - The text to use for the play button.\n * @param {?string} [options.pauseText = Pause] - The text to use for the pause button.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the carousel.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the carousel is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the carousel immediately upon creation.\n */\n constructor({\n carouselElement,\n carouselItemsSelector = \".carousel-item\",\n carouselItemContainerSelector = \".carousel-item-container\",\n carouselControlsSelector = \".carousel-control\",\n carouselControlContainerSelector = \".carousel-control-container\",\n carouselTabsSelector = \".carousel-tab\",\n carouselTabContainerSelector = \".carousel-tab-container\",\n autoplaySelector = \".autoplay\",\n nextSelector = \".next\",\n previousSelector = \".previous\",\n activeClass = \"active\",\n previousClass = \"previous\",\n nextClass = \"next\",\n playClass = \"play\",\n pauseClass = \"pause\",\n autoplay = true,\n transitionDelay = 10000,\n transitionDuration = 500,\n playText = \"Play\",\n pauseText = \"Pause\",\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n }) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set DOM elements.\n this._dom.carousel = carouselElement;\n this._dom.carouselItems = [];\n this._dom.carouselItemContainer = null;\n this._dom.carouselControls = [];\n this._dom.carouselControlContainer = null;\n this._dom.carouselTabs = [];\n this._dom.carouselTabContainer = null;\n this._dom.autoplay = null;\n this._dom.next = null;\n this._dom.previous = null;\n\n // Set query selectors.\n this._selectors.carouselItems = carouselItemsSelector;\n this._selectors.carouselItemContainer = carouselItemContainerSelector;\n this._selectors.carouselControls = carouselControlsSelector;\n this._selectors.carouselControlContainer = carouselControlContainerSelector;\n this._selectors.carouselTabs = carouselTabsSelector;\n this._selectors.carouselTabContainer = carouselTabContainerSelector;\n this._selectors.autoplay = autoplaySelector;\n this._selectors.next = nextSelector;\n this._selectors.previous = previousSelector;\n\n // Set class names.\n this._classes.active = activeClass || \"\";\n this._classes.previous = previousClass || \"\";\n this._classes.next = nextClass || \"\";\n this._classes.play = playClass || \"\";\n this._classes.pause = pauseClass || \"\";\n\n // Set flags.\n this._autoplay = autoplay;\n\n // Set transition options.\n this._delays.transition = transitionDelay;\n this._durations.transition = transitionDuration;\n\n // Set labels.\n this._playText = playText || \"\";\n this._pauseText = pauseText || \"\";\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle events.\n this._handleAutoplay();\n\n // Activate the first item.\n this.activateFirstItem();\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n autoplay: this._autoplay,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n\n // String checks.\n const strings = {\n playText: this._playText,\n pauseText: this._pauseText,\n };\n\n // Check the strings.\n const stringChecks = isValidType(\"string\", strings, {\n shouldThrow: false,\n });\n\n // Handle string check failures.\n if (!stringChecks.status) {\n this._errors = [...this._errors, ...stringChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply when a carousel item is active.\n *\n * @type {string|string[]}\n *\n * @see _classes.active\n */\n get activeClass() {\n return this._classes.active;\n }\n\n set activeClass(value) {\n isValidClassList({ activeClass: value });\n\n if (this._classes.active !== value) {\n this._classes.active = value;\n }\n }\n\n /**\n * The class(es) to apply to a carousel item that is the next active item.\n *\n * @type {string|string[]}\n *\n * @see _classes.previous\n */\n get previousClass() {\n return this._classes.previous;\n }\n\n set previousClass(value) {\n isValidClassList({ previousClass: value });\n\n if (this._classes.previous !== value) {\n this._classes.previous = value;\n }\n }\n\n /**\n * The class(es) to apply to a carousel item that is the next active item.\n *\n * @type {string|string[]}\n *\n * @see _classes.next\n */\n get nextClass() {\n return this._classes.next;\n }\n\n set nextClass(value) {\n isValidClassList({ nextClass: value });\n\n if (this._classes.next !== value) {\n this._classes.next = value;\n }\n }\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is paused.\n *\n * @type {string|string[]}\n *\n * @see _classes.play\n */\n get playClass() {\n return this._classes.play;\n }\n\n set playClass(value) {\n isValidClassList({ playClass: value });\n\n if (this._classes.play !== value) {\n this._classes.play = value;\n }\n }\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is playing.\n *\n * @type {string|string[]}\n *\n * @see _classes.pause\n */\n get pauseClass() {\n return this._classes.pause;\n }\n\n set pauseClass(value) {\n isValidClassList({ pauseClass: value });\n\n if (this._classes.pause !== value) {\n this._classes.pause = value;\n }\n }\n\n /**\n * The index of the currently active carousel item.\n *\n * @type {number}\n *\n * @see _currentItem\n */\n get currentItem() {\n return this._currentItem;\n }\n\n set currentItem(value) {\n isValidType(\"number\", { currentItem: value });\n\n if (value === this.currentItem) {\n return;\n }\n\n if (value < 0) {\n this._currentItem = 0;\n } else if (value >= this.dom.carouselItems.length) {\n this._currentItem = this.dom.carouselItems.length - 1;\n } else {\n this._currentItem = value;\n }\n\n // Keep the aria selected in sync with the current item.\n const tabs = this._dom.carousel.querySelectorAll(\n this.selectors.carouselTab\n );\n if (tabs) {\n this.dom.carouselItems.forEach((item, index) => {\n item.setAttribute(\"aria-selected\", index === this._currentItem);\n });\n }\n }\n\n /**\n * The currently active carousel item.\n *\n * @readonly\n *\n * @type {HTMLElement}\n */\n get currentCarouselItem() {\n return this.dom.carouselItems[this.currentItem];\n }\n\n /**\n * The currently active carousel tab.\n *\n * @readonly\n *\n * @type {HTMLElement}\n */\n get currentCarouselTab() {\n return this.dom.carouselTabs[this.currentItem];\n }\n\n /**\n * A flag to indicate if the carousel is currently playing.\n *\n * @type {boolean}\n *\n * @see _autoplay\n */\n get autoplay() {\n return this._autoplay;\n }\n\n set autoplay(value) {\n isValidType(\"boolean\", { autoplay: value });\n\n if (this._autoplay !== value) {\n this._autoplay = value;\n }\n }\n\n /**\n * The delay in milliseconds before transitioning slides.\n *\n * @type {number}\n *\n * @see _delays.transition\n */\n get transitionDelay() {\n return this._delays.transition;\n }\n\n set transitionDelay(value) {\n isValidType(\"number\", { transitionDelay: value });\n\n if (value !== this.transitionDelay && value >= 0) {\n this._delays.transition = value;\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition between carousel items.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value && value >= 0) {\n this._durations.transition = value;\n this._setTransitionDuration();\n }\n }\n\n /**\n * The label for the autoplay button when the carousel is paused.\n *\n * @type {string}\n *\n * @see _playText\n */\n get playText() {\n return this._playText;\n }\n\n set playText(value) {\n isValidType(\"string\", { playText: value });\n\n if (this._playText !== value) {\n this._playText = value;\n }\n }\n\n /**\n * The label for the autoplay button when the carousel is playing.\n *\n * @type {string}\n *\n * @see _pauseText\n */\n get pauseText() {\n return this._pauseText;\n }\n\n set pauseText(value) {\n isValidType(\"string\", { pauseText: value });\n\n if (this._pauseText !== value) {\n this._pauseText = value;\n }\n }\n\n /**\n * The current action being performed by the carousel.\n *\n * @type {string}\n *\n * @see _currentAction\n */\n get currentAction() {\n return this._currentAction;\n }\n\n /**\n * Sets all DOM elements within the carousel.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"carouselItemContainer\", {\n context: this.dom.carousel,\n });\n this._setDOMElementType(\"carouselControlContainer\", {\n context: this.dom.carousel,\n });\n this._setDOMElementType(\"carouselTabContainer\", {\n context: this.dom.carousel,\n });\n\n if (this.dom.carouselItemContainer) {\n this._setDOMElementType(\"carouselItems\", {\n context: this.dom.carouselItemContainer,\n });\n }\n if (this.dom.carouselControlContainer) {\n this._setDOMElementType(\"carouselControls\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"autoplay\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"next\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"previous\", {\n context: this.dom.carouselControlContainer,\n });\n }\n\n if (this._dom.carouselTabContainer) {\n this._setDOMElementType(\"carouselTabs\", {\n context: this.dom.carouselTabContainer,\n });\n }\n }\n\n /**\n * Sets the IDs of the carousel and its children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - carousel: `carousel-${key}`\n * - carousel items: `carousel-item-${key}-${index}`\n * - carousel tabs: `carousel-tab-${key}-${index}`\n */\n _setIds() {\n this.dom.carousel.id = this.dom.carousel.id || `carousel-${this.key}`;\n\n this.dom.carouselItems.forEach((item, index) => {\n item.id = item.id || `carousel-item-${this.key}-${index}`;\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n tab.id = tab.id || `carousel-tab-${this.key}-${index}`;\n });\n\n this._id = this.dom.carousel.id;\n }\n\n /**\n * Sets ARIA attributes throughout the carousel.\n */\n _setAriaAttributes() {\n // Make sure the carousel has a proper role.\n // Sections and role=\"region\" are acceptable in certain cases, so\n // we only need to fallback to role=\"group\" if neither of those are present.\n if (\n !isTag(\"section\", { carousel: this.dom.carousel }, { shouldThrow: false })\n .status &&\n !this.dom.carousel.getAttribute(\"role\") !== \"region\"\n ) {\n this.dom.carousel.setAttribute(\"role\", \"group\");\n }\n\n // Set the role description for the carousel.\n this._dom.carousel.setAttribute(\"aria-roledescription\", \"carousel\");\n\n if (this.dom.carouselTabContainer) {\n this.dom.carouselTabContainer.setAttribute(\"role\", \"tablist\");\n }\n\n this.dom.carouselTabs.forEach((tab, index) => {\n if (!isTag(\"button\", { tab: tab }, { shouldThrow: false }).status) {\n tab.setAttribute(\"role\", \"button\");\n }\n\n tab.setAttribute(\"aria-selected\", index === 0);\n tab.setAttribute(\"aria-controls\", this.dom.carouselItems[index].id);\n });\n }\n\n /**\n * Sets the transition duration for the carousel as a CSS custom property.\n *\n * The custom property is set as `--graupl-carousel-transition-duration`.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.carousel.style.setProperty(\n `--${this.prefix}carousel-transition-duration`,\n `${this.transitionDuration}ms`\n );\n }\n\n /**\n * Handles the autoplay functionality of the carousel.\n *\n * - Adds the appropriate class to the autoplay button.\n * - Removes the appropriate class from the autoplay button.\n * - Sets the appropriate aria-label for the autoplay button.\n * - Sets the appropriate aria-live for the carousel.\n * - Sets/clears the interval for autoplaying the carousel.\n *\n * @protected\n */\n _handleAutoplay() {\n if (this.autoplay) {\n addClass(this.pauseClass, this.dom.autoplay);\n removeClass(this.playClass, this.dom.autoplay);\n\n this.dom.autoplay.setAttribute(\"aria-label\", this.pauseText);\n this.dom.carousel.setAttribute(\"aria-live\", \"off\");\n\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n } else {\n addClass(this.playClass, this.dom.autoplay);\n removeClass(this.pauseClass, this.dom.autoplay);\n\n this.dom.autoplay.setAttribute(\"aria-label\", this.playText);\n this.dom.carousel.setAttribute(\"aria-live\", \"polite\");\n\n this._clearInterval();\n }\n }\n\n /**\n * Handles the focus events throughout the carousel for proper use.\n *\n * - Adds a `focusin` listener to the carousel element to pause autoplay.\n * - Adds a `focusout` listener to the carousel element to resume autoplay.\n */\n _handleFocus() {\n // Pause autoplay when anything in the carousel is focused.\n this._addEventListener(\"focusin\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this._addEventListener(\"focusout\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n });\n }\n\n /**\n * Handles the click events throughout the carousel.\n *\n * - Adds a `click` listener to the next control to activate the next item.\n * - Adds a `click` listener to the previous control to activate the previous item.\n * - Adds a `click` listener to the autoplay control to toggle autoplay.\n * - Adds a `click` listener to each tab control to activate the corresponding item.\n */\n _handleClick() {\n this._addEventListener(\"click\", this.dom.next, () => {\n this.activateNextItem();\n });\n\n this._addEventListener(\"click\", this.dom.previous, () => {\n this.activatePreviousItem();\n });\n\n this._addEventListener(\"click\", this.dom.autoplay, () => {\n this.toggleAutoplay();\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n this._addEventListener(\"click\", tab, () => {\n if (this.currentItem > index) {\n this._currentAction = \"previous\";\n } else {\n this._currentAction = \"next\";\n }\n\n this.activateItem(index);\n });\n });\n }\n\n /**\n * Handles the hover events throughout the carousel for proper use.\n *\n * - Adds a `pointerover` listener to the carousel to pause autoplay.\n * - Adds a `pointerleave` listener to the carousel to resume autoplay.\n */\n _handleHover() {\n // Pause autoplay when anything in the carousel is hovered.\n this._addEventListener(\"pointerover\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this._addEventListener(\"pointerleave\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n });\n }\n\n /**\n * Handles keydown events throughout the carousel for proper use.\n *\n * - Adds a `keydown` listener to all control elements.\n * - Prevents Space and Enter key events.\n * - Adds a `keydown` listener to all tab elements.\n * - Prevents Space and Enter key events.\n */\n _handleKeydown() {\n this.dom.carouselControls.forEach((control) => {\n this._addEventListener(\"keydown\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n\n this.dom.carouselTabs.forEach((tab) => {\n this._addEventListener(\"keydown\", tab, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n }\n\n /**\n * Handles keyup events throughout the carousel for proper use.\n *\n * - Adds a `keyup` listener to all control elements.\n * - Activates the next/previous item depending on which control is pressed.\n * - Toggles autoplay if the autoplay control is pressed.\n *\n */\n _handleKeyup() {\n // Activate the next item if the space or enter key on the next control.\n this._addEventListener(\"keyup\", this.dom.next, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activateNextItem();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Activate the previous item if the space or enter key on the previous control.\n this._addEventListener(\"keyup\", this.dom.previous, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activatePreviousItem();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Toggle autoplay if the space or enter key on the autoplay control.\n this._addEventListener(\"keyup\", this.dom.autoplay, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.toggleAutoplay();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Activate the item if the space or enter key on the tab control.\n this.dom.carouselTabs.forEach((tab, index) => {\n this._addEventListener(\"keyup\", tab, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activateItem(index);\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n }\n\n /**\n * Activates the current carousel item.\n */\n activateCurrentItem() {\n addClass(this.activeClass, this.currentCarouselItem);\n\n if (this.currentCarouselTab) {\n this.currentCarouselTab.setAttribute(\"aria-selected\", true);\n addClass(this.activeClass, this.currentCarouselTab);\n }\n }\n\n /**\n * Deactivates the current carousel item.\n */\n deactivateCurrentItem() {\n removeClass(this.activeClass, this.currentCarouselItem);\n\n if (this.currentCarouselTab) {\n this.currentCarouselTab.setAttribute(\"aria-selected\", false);\n removeClass(this.activeClass, this.currentCarouselTab);\n }\n }\n\n /**\n * Activates the carousel item at a given index.\n *\n * @param {number} index - The index of the carousel item to activate.\n */\n activateItem(index) {\n const currentIndex = this.currentItem;\n\n this.dom.carousel.dataset.grauplAction = this._currentAction;\n\n if (this.autoplay) {\n this._clearInterval();\n }\n\n addClass(this.previousClass, this.currentCarouselItem);\n addClass(this.nextClass, this.dom.carouselItems[index]);\n\n requestAnimationFrame(() => {\n this.deactivateCurrentItem();\n this.currentItem = index;\n this.activateCurrentItem();\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.previousClass, this.dom.carouselItems[currentIndex]);\n removeClass(this.nextClass, this.currentCarouselItem);\n }, this.transitionDuration);\n });\n });\n\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n }\n\n /**\n * Activates the first carousel item.\n */\n activateFirstItem() {\n this.activateItem(0);\n }\n\n /**\n * Activates the last carousel item.\n */\n activateLastItem() {\n this.activateItem(this.dom.carouselItems.length - 1);\n }\n\n /**\n * Activates the next carousel item.\n */\n activateNextItem() {\n this._currentAction = \"next\";\n\n if (this.currentItem + 1 >= this.dom.carouselItems.length) {\n this.activateFirstItem();\n } else {\n this.activateItem(this.currentItem + 1);\n }\n }\n\n /**\n * Activates the previous carousel item.\n */\n activatePreviousItem() {\n this._currentAction = \"previous\";\n\n if (this.currentItem - 1 < 0) {\n this.activateLastItem();\n } else {\n this.activateItem(this.currentItem - 1);\n }\n }\n\n /**\n * Toggles autoplay on the carousel.\n */\n toggleAutoplay() {\n this.autoplay = !this.autoplay;\n\n this._handleAutoplay();\n }\n}\n\nexport default Carousel;\n","import Carousel from \"./Carousel.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n carouselSelector = \".carousel\"\n) => {\n once(\"graupl-carousel-generator\", carouselSelector, context).forEach(\n (carouselElement) => {\n const carouselOptions = carouselElement.dataset.grauplCarouselOptions\n ? JSON.parse(\n carouselElement.dataset.grauplCarouselOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Carousel({\n carouselElement,\n initialize: true,\n ...options,\n ...carouselOptions,\n });\n }\n );\n};\n\nexport default generate;\n","import once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n navigationSelector = \".navigation\"\n) => {\n once(\"graupl-navigation-generator\", navigationSelector, context).forEach(\n (navigationElement) => {\n const MenuConstructor =\n navigationElement.dataset.grauplMenuType || DisclosureMenu;\n\n if (window[MenuConstructor] === undefined) {\n console.warn(\n `Graupl navigation requires accessible-menu's ${MenuConstructor}. Please make sure to include it on this page.`\n );\n\n return;\n }\n\n const menuOptions = navigationElement.dataset.grauplMenuOptions\n ? JSON.parse(\n navigationElement.dataset.grauplMenuOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n const menuElement = navigationElement.querySelector(\".menu\");\n const controllerElement =\n navigationElement.querySelector(\".navigation-toggle\") || null;\n const containerElement = controllerElement ? navigationElement : null;\n new window[MenuConstructor]({\n menuElement,\n menuItemSelector: \".menu-item\",\n menuLinkSelector: \".menu-link\",\n submenuItemSelector: \".submenu-item\",\n submenuToggleSelector: \".submenu-toggle\",\n controllerElement,\n containerElement,\n ...options,\n ...menuOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Disclosure class.\n */\n\nimport { isValidClassList, isValidType, isTag } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The event that is triggered when the disclosure is shown.\n *\n * @event grauplDisclosureExpand\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event\n * @property {Object<Disclosure>} detail - The details object containing the disclosure itself.\n * @property {Disclosure} detail.disclosure - The disclosure.\n */\n\n/**\n * The event that is triggered when the disclosure is hidden.\n *\n * @event grauplDisclosureCollapse\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event\n * @property {Object<Disclosure>} detail - The details object containing the disclosure itself.\n * @property {Disclosure} detail.disclosure - The disclosure.\n */\n\n/**\n * The Disclosure component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the disclosure.\n * @property {HTMLElement} _dom.controller - The disclosure controller element.\n * @property {HTMLElement} _dom.disclosure - The disclosure element.\n * @property {HTMLElement} _dom.content - The disclosure content element.\n * @property {string} _rootDOMElement - The root DOM element of the disclosure.\n * @property {string[]} _protectedDOMElements - The DOM elements within the disclosure that cannot be reset or generated by the disclosure itself.\n * @property {Object<string>} _selectors - The query selectors used by the disclosure.\n * @property {string} _selectors.content - The query selector for the disclosure content.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the disclosure is in various states.\n * @property {string|string[]} _classes.open - The class(es) to apply when the disclosure is open.\n * @property {string|string[]} _classes.close - The class(es) to apply when the disclosure is closed.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the disclosure is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the disclosure is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the disclosure.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between open and closed states.\n * @property {number} _durations.open - The duration time (in milliseconds) for the transition from closed to open states.\n * @property {number} _durations.close - The duration time (in milliseconds) for the transition from open to closed states.\n * @property {TransactionalValue<boolean>} _open - The open state of the disclosure.\n * @property {boolean} _shouldOpen - A value to force the disclosure open when the breakpoint width is passed.\n * @property {boolean} _closeOnBlur - Whether to close the disclosure when it loses focus in the DOM.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the disclosure.\n * @property {grauplDisclosureExpand} _events.expand - The event triggered when the disclosure is expanded.\n * @property {grauplDisclosureCollapse} _events.collapse - The event triggered when the disclosure is collapsed.\n * @property {Object<object>} _elements - The instantiated elements within the disclosure.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the disclosure.\n * @property {string} _focusState - The current state of the disclosure's focus.\n * @property {string} _currentEvent - The last type of event triggered within the disclosure.\n * @property {string} _breakpoint - The breakpoint that the disclosure will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the disclosure.\n * @property {Object<Function>} _intervals - Intervals throughout the disclosure.\n * @property {Object<Function>} _timeouts - Timeouts throughout the disclosure.\n * @property {object[]} _listeners - Event listeners throughout the disclosure.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the disclosure.\n * @property {string} _name - The component name of the disclosure.\n * @property {string} _id - The main ID of the disclosure.\n * @property {boolean} _valid - The validity state of the disclosure.\n * @property {boolean} _initialized - The initialized state of the disclosure.\n * @property {string[]} _errors - The errors found throughout the disclosure.\n */\nclass Disclosure extends Component {\n _rootDOMElement = \"disclosure\";\n _protectedDOMElements = [\"controller\"];\n _open = new TransactionalValue(false);\n _shouldOpen = false;\n _closeOnBlur = false;\n _storageKey = \"disclosures\";\n _name = \"Disclosure\";\n _mediaQueryListEventCallback = (event) => {\n if (event.matches && this.isOpen) {\n this.close({ preserveState: true });\n } else if (\n !event.matches &&\n !this.isOpen &&\n (this.hasOpened || this.shouldOpen)\n ) {\n this.open();\n }\n };\n\n /**\n * Constructs a new `Disclosure`.\n *\n * @param {object} [options = {}] - The options for generating the disclosure.\n * @param {HTMLElement} options.disclosureElement - The disclosure element in the DOM.\n * @param {HTMLElement} options.controllerElement - The disclosure toggle element in the DOM.\n * @param {string} [options.disclosureContentSelector = .disclosure-content] - The query selector string for the disclosure content.\n * @param {?(string|string[])} [options.openClass = show] - The class to apply when a disclosure is \"open\".\n * @param {?(string|string[])} [options.closeClass = hide] - The class to apply when a disclosure is \"closed\".\n * @param {?(string|string[])} [options.transitionClass = transitioning] - The class to apply when a disclosure is transitioning between \"open\" and \"closed\" states.\n * @param {number} [options.transitionDuration = 250] - The duration of the transition between \"open\" and \"closed\" states (in milliseconds).\n * @param {boolean} [options.openDuration = -1] - The duration of the transition from \"closed\" to \"open\" states (in milliseconds).\n * @param {boolean} [options.closeDuration = -1] - The duration of the transition from \"open\" to \"closed\" states (in milliseconds).\n * @param {boolean} [options.closeOnBlur = false] - Whether to close the disclosure when it loses focus in the dom.\n * @param {?string} [options.minWidth = \"\"] - The width of the screen that the disclosure will automatically open/close itself.\n * @param {boolean} [options.autoOpen = false] - Whether to automatically open when above the minWidth.\n * @param {?string} [options.mediaQuery = \"\"] - The media query to use when automatically opening/closing the disclosure.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the disclosure.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the disclosure is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the disclosure immediately upon creation.\n */\n constructor({\n disclosureElement,\n controllerElement,\n disclosureContentSelector = \".disclosure-content\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 250,\n openDuration = -1,\n closeDuration = -1,\n closeOnBlur = false,\n minWidth = \"\",\n autoOpen = false,\n mediaQuery = \"\",\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n } = {}) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set the DOM elements.\n this._dom.disclosure = disclosureElement;\n this._dom.controller = controllerElement;\n\n // Set the DOM selectors.\n this._selectors.content = disclosureContentSelector;\n\n // Set the classes.\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.open = openDuration;\n this._durations.close = closeDuration;\n\n // Set close on blur.\n this._closeOnBlur = closeOnBlur;\n\n // Set collapse width and auto open functionality.\n this._breakpoint = minWidth || \"\";\n this._shouldOpen = autoOpen;\n this._mediaQueryString = mediaQuery || \"\";\n\n // Register custom events.\n this._registerEvent(\"expand\", { detail: { disclosure: this } });\n this._registerEvent(\"collapse\", { detail: { disclosure: this } });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle auto-opening disclosures with aria-expanded set to true or\n // those that _should_ open.\n if (\n this.dom.controller.getAttribute(\"aria-expanded\") === \"true\" ||\n (this.shouldOpen && !window.matchMedia(this.mediaQuery).matches)\n ) {\n this._expand({ emit: false, transition: false });\n } else {\n this._collapse({ emit: false, transition: false });\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n closeOnBlur: this._closeOnBlur,\n autoOpen: this._shouldOpen,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply when the disclosure is open.\n *\n * @type {string|string[]}\n *\n * @see _classes.open\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 when the disclosure is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.close\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 when the disclosure is transitioning between open and closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 duration time (in milliseconds) for the transition between open and closed states.\n *\n * Setting this value will also set the --graupl-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\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 --graupl-open-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.open\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\", { openDuration: value });\n\n if (this._durations.open !== value) {\n this._durations.open = value;\n this._setCustomProps();\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 --graupl-close-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.close\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\", { closeDuration: value });\n\n if (this._durations.close !== value) {\n this._durations.close = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The width of the screen that the disclosure will automatically open/close itself.\n *\n * This is just an alias for the generic \"breakpoint\" used in all components.\n *\n * @type {string}\n *\n * @see breakpoint\n */\n get minWidth() {\n return this.breakpoint;\n }\n\n set minWidth(value) {\n this.breakpoint = value;\n }\n\n /**\n * Whether to close the disclosure when it loses focus in the DOM.\n *\n * @type {boolean}\n *\n * @see _closeOnBlur\n */\n get closeOnBlur() {\n return this._closeOnBlur;\n }\n\n set closeOnBlur(value) {\n isValidType(\"boolean\", { closeOnBlur: value });\n\n if (this._closeOnBlur !== value) {\n this._closeOnBlur = value;\n }\n }\n\n /**\n * The open state of the disclosure.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _open\n */\n get isOpen() {\n return this._open.value;\n }\n\n /**\n * The open state of the disclosure that the user specifically triggered.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _open\n */\n get hasOpened() {\n return this._open.committed;\n }\n\n /**\n * A value to force opening regardless of user interaction.\n *\n * @type {boolean}\n *\n * @see _shouldOpen\n */\n get shouldOpen() {\n return this._shouldOpen;\n }\n\n set shouldOpen(value) {\n isValidType(\"boolean\", { shouldOpen: value });\n\n if (this._shouldOpen !== value) {\n this._shouldOpen = value;\n }\n }\n\n /**\n * Sets the IDs throughout the disclosure.\n *\n * The generated IDs use the key and follow the format:\n * - disclosure: `disclosure-${key}`\n * - controller: `disclosure-controller-${key}`\n *\n * @protected\n */\n _setIds() {\n this.dom.disclosure.id = this.dom.disclosure.id || `disclosure-${this.key}`;\n this.dom.controller.id =\n this.dom.controller.id || `disclosure-controller-${this.key}`;\n\n this._id = this.dom.disclosure.id;\n }\n\n /**\n * Sets ARIA attributes throughout the disclosure.\n *\n * The first steps are to ensure that the controller has `aria-expanded` set to \"false\"\n * if it's not already explicitly set to \"true\".\n *\n * Then, set the `aria-controls` attribute on the controller to the disclosure's ID.\n *\n * Finally, ensure the controller element has a role of \"button\" if it is not a native button element.\n *\n * @protected\n */\n _setAriaAttributes() {\n // If the controller element doesn't have aria-expanded set to true, set it to false.\n if (this.dom.controller.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Set the aria-controls attribute on the controller to the disclosure's ID.\n this.dom.controller.setAttribute(\"aria-controls\", this.dom.disclosure.id);\n\n // If the controller element is not a button, set its role to button.\n if (\n !isTag(\n \"button\",\n { controller: this.dom.controller },\n { shouldThrow: false }\n ).status\n ) {\n this.dom.controller.setAttribute(\"role\", \"button\");\n }\n }\n\n /**\n * Sets custom props throughout the disclosure.\n *\n * The custom properties are:\n * - `--graupl-disclosure-transition-duration`,\n * - `--graupl-disclosure-open-transition-duration`, and\n * - `--graupl-disclosure-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the disclosure's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n /**\n * Sets all DOM elements within the disclosure.\n *\n * Utilizes _setDOMElementType and\n * _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._resetDOMElementType(\"content\");\n this._setDOMElementType(\"content\", { context: this.dom.disclosure });\n }\n\n /**\n * Expands the disclosure.\n *\n * Sets the controller's `aria-expanded` to \"true\", adds the\n * open class to the disclosure, and removes the closed class from the disclosure.\n *\n * @protected\n *\n * @fires grauplDisclosureExpand\n *\n * @param {Object<boolean>} [options = {}] - Options for expanding the disclosure.\n * @param {boolean} [options.emit = true] - Emit the expand event once expanded.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _expand({ emit = true, transition = true } = {}) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"true\");\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 (transition && this.transitionlass !== \"\") {\n addClass(this.transitionClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n removeClass(this.closeClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n addClass(this.openClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.disclosure);\n }, this.openDuration);\n });\n });\n });\n } else {\n // Add the open class\n addClass(this.openClass, this.dom.disclosure);\n\n // Remove the close class.\n removeClass(this.closeClass, this.dom.disclosure);\n }\n\n this.dom.content.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"expand\", this.dom.controller);\n }\n }\n\n /**\n * Collapses the disclosure.\n *\n * Sets the controller's `aria-expanded` to \"false\", adds the\n * close class to the disclosure, and removes the open class from the disclosure.\n *\n * @protected\n *\n * @fires grauplDisclosureCollapse\n *\n * @param {Object<boolean>} [options = {}] - Options for collapsing the disclosure.\n * @param {boolean} [options.emit = true] - Emit the collapse event once collapsed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _collapse({ emit = true, transition = true } = {}) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"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 (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n removeClass(this.openClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n addClass(this.closeClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.disclosure);\n\n this.dom.content.innert = true;\n }, this.closeDuration);\n });\n });\n });\n } else {\n // Add the close class\n addClass(this.closeClass, this.dom.disclosure);\n\n // Remove the open class.\n removeClass(this.openClass, this.dom.disclosure);\n }\n\n this.dom.content.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"collapse\", this.dom.controller);\n }\n }\n\n /**\n * Handles focus events throughout the disclosure.\n *\n * - Adds a `focusout` listener to the disclosure so when the disclosure loses focus it will close.\n */\n _handleFocus() {\n this._addEventListener(\"focusout\", this.dom.disclosure, (event) => {\n if (\n !this.closeOnBlur ||\n this.currentEvent !== \"keyboard\" ||\n event.relatedTarget === null ||\n this.dom.disclosure.contains(event.relatedTarget) ||\n this.dom.controller === event.relatedTarget\n ) {\n return;\n }\n\n this.close();\n });\n }\n\n /**\n * Handles click events throughout the disclosure.\n *\n * - Adds a `click` listener to the controller that toggles the disclosure.\n * - Adds a `click` listener to the `document` so if the user clicks outside the disclosure it will close.\n */\n _handleClick() {\n this._addEventListener(\"click\", this.dom.controller, (event) => {\n this.currentEvent = \"mouse\";\n\n if (event.button !== 0) return;\n\n preventEvent(event);\n this.toggle();\n });\n\n this._addEventListener(\"click\", document, (event) => {\n if (this.focusState !== \"self\" || !this.closeOnBlur) return;\n\n this.currentEvent = \"mouse\";\n\n if (\n !this.dom.disclosure.contains(event.target) &&\n this.dom.controller !== event.target\n ) {\n this.close();\n }\n });\n }\n\n /**\n * Handles keydown events throughout the disclosure.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to the controller.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n * - Adds a `keydown` listener to the disclosure.\n * - Blocks propagation on \"Escape\" keys.\n */\n _handleKeydown() {\n this._addEventListener(\"keydown\", this.dom.controller, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n\n break;\n }\n });\n\n this._addEventListener(\"keydown\", this.dom.disclosure, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Escape\":\n preventEvent(event);\n\n break;\n }\n });\n }\n\n /**\n * Handles keyup events throughout the disclosure.\n *\n * - Adds a `keyup` listener to the controller.\n * - Toggles the disclosure on \"Space\" and \"Enter\" keys.\n * - Adds a `keyup` listener to the disclosure.\n * - Closes the disclosure on \"Escape\" keys.\n */\n _handleKeyup() {\n this._addEventListener(\"keyup\", this.dom.controller, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.toggle();\n\n preventEvent(event);\n\n break;\n }\n });\n\n this._addEventListener(\"keyup\", this.dom.disclosure, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Escape\":\n this.close();\n\n preventEvent(event);\n\n break;\n }\n });\n }\n\n /**\n * Opens the disclosure.\n *\n * Sets the disclosure's focus state to \"self\", calls expand, and sets isOpen to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for opening the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the open action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n open({ force = false, preserveState = false } = {}) {\n if (this.isOpen && !force) return;\n\n // Set the focus state.\n this.focusState = \"self\";\n\n // Expand the disclosure.\n this._expand();\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Opens the disclosure without entering it.\n *\n * Sets the disclosure's focus state to \"none\", calls expand, and sets isOpen to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for previewing the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the preview action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n preview({ force = false, preserveState = false } = {}) {\n if (this.isOpen && !force) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Expand the disclosure.\n this._expand();\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Closes the disclosure.\n *\n * Sets the disclosure's focus state to \"none\", calls collapse, and sets isOpen to `false`.\n *\n * @param {Object<boolean>} [options = {}] - Options for closing the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the close action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n close({ force = false, preserveState = false } = {}) {\n if (!this.isOpen && !force) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Collapse the disclosure.\n this._collapse();\n\n // Set the open state.\n this._open.value = false;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Toggles the open state of the disclosure.\n *\n * @param {Object<boolean>} [options = {}] - Options for toggling the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the open or close action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n toggle({ force = false, preserveState = false } = {}) {\n if (this.isOpen) {\n this.close({ force, preserveState });\n } else {\n this.open({ force, preserveState });\n }\n }\n}\n\nexport default Disclosure;\n","import Disclosure from \"./Disclosure.js\";\nimport once from \"@drupal/once\";\n\nconst generate = ({\n options = {},\n context = document,\n disclosureSelector = \".disclosure\",\n controllerSelector = \".disclosure-toggle\",\n} = {}) => {\n once(\"graupl-disclosure-generator\", disclosureSelector, context).forEach(\n (disclosureElement) => {\n const disclosureOptions = disclosureElement.dataset\n .grauplDisclosureOptions\n ? JSON.parse(\n disclosureElement.dataset.grauplDisclosureOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n const targettedControllerSelector = `${controllerSelector}[data-graupl-disclosure-target=\"${disclosureElement.id}\"]`;\n const [controllerElement] = once(\n \"graupl-disclosure-generator\",\n targettedControllerSelector,\n context\n );\n\n if (!controllerElement) {\n console.warn(\n `No controller found for disclosure with ID \"${disclosureElement.id}\". Please ensure there is an element with the selector \"${targettedControllerSelector}\".`\n );\n\n once.remove(\"graupl-disclosure-generator\", disclosureElement);\n\n return;\n }\n\n new Disclosure({\n disclosureElement,\n controllerElement,\n initialize: true,\n ...options,\n ...disclosureOptions,\n });\n }\n );\n};\n\nexport default generate;\n","import accordionGenerator from \"./accordion/generator.js\";\nimport alertGenerator from \"./alert/generator.js\";\nimport carouselGenerator from \"./carousel/generator.js\";\nimport navigationGenerator from \"./navigation/generator.js\";\nimport disclosureGenerator from \"./disclosure/generator.js\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n accordionGenerator();\n alertGenerator();\n carouselGenerator();\n navigationGenerator();\n disclosureGenerator();\n});\n"],"x_google_ignoreList":[8],"mappings":"YAwBA,SAAgBA,EACdC,EACAC,EACA,CAAEC,YAAAA,EAAc,EAAA,EAAS,CAAA,EACzB,CACA,MAAMC,EAAS,CACbC,OAAQ,GACRC,OAAQ,CAAA,GAGV,GAAI,CACF,GAAI,OAAOJ,GAAa,SAAU,CAChC,MAAMK,EAAe,OAAOL,EAE5B,MAAM,IAAIM,UACR,qEAAqED,CAAAA,UAAY,EAIrF,UAAWE,KAAOP,EAChB,GAAI,CACF,GAAI,EAAEA,EAASO,CAAAA,YAAgBR,GAAa,CAC1C,MAAMS,EAAc,OAAOR,EAASO,CAAAA,EACpC,MAAM,IAAID,UACR,GAAGC,CAAAA,2BAA8BR,EAAWU,IAAAA,MAAUD,CAAAA,UAAW,SAG9DE,EAAO,CACdR,EAAOC,OAAS,GAChBD,EAAOE,OAAOO,KAAKD,CAAAA,SAGhBA,EAAO,CACdR,EAAOC,OA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C,KACN,+CAA+CX,EAAkBQ,EAAAA,2DAA6DD,CAAAA,IAA2B,EAG3Jf,EAAKoB,OAAO,8BAA+BZ,CAAAA,EAE3C,OAGF,IAAIT,GAAW,CACbS,kBAAAA,EACAS,kBAAAA,EACAI,WAAY,GACZ,GAAGnB,EACH,GAAGO,EACJ,KCnCPkB,SAASC,iBAAiB,mBAAA,IAA0B,CAClDN,GAAAA,EACAC,GAAAA,EACAC,GAAAA,EACAC,GAAAA,EACAC,GAAAA"}
|
|
1
|
+
{"version":3,"file":"graupl.js","names":["isValidInstance","contructor","elements","shouldThrow","result","status","errors","elementsType","TypeError","key","elementType","name","error","push","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidState","validStates","includes","join","isValidEvent","validEvents","isValidHoverType","validTypes","isTag","tagName","HTMLElement","tag","toLowerCase","isValidEventType","eventType","component","Object","prototype","hasOwnProperty","call","events","constructor","keys","hasValidRootDOMElement","_dom","_rootDOMElement","addClass","className","element","length","classList","add","removeClass","remove","selectAllFocusableElements","context","document","fn","querySelector","elements","Array","from","querySelectorAll","tabbableElements","filter","check","getAttribute","selectFirstFocusableElement","selectLastFocusableElement","selectNextFocusableElement","index","indexOf","selectPreviousFocusableElement","TransactionalValue","_equals","Object","is","_current","_committed","constructor","initialValue","equals","value","val","committed","isDirty","commit","reset","update","fn","isValidType","isValidInstance","StorageManager","_scope","_type","_storage","_crush","constructor","scope","type","crush","initialize","window","storage","shouldThrow","status","get","key","typeCheck","Error","message","keyCheck","set","data","dataCheck","clear","dispose","isValidInstance","isValidType","isValidClassList","isQuerySelector","isValidState","isValidEvent","isValidEventType","hasValidRootDOMElement","StorageManager","addClass","removeClass","Component","_dom","_rootDOMElement","_protectedDOMElements","_selectors","_elements","_classes","initialize","_durations","_delays","_focusState","_currentEvent","_breakpoint","_mediaQueryString","_mediaQueryList","_mediaQueryListEventCallback","event","matches","_intervals","_timeouts","_listeners","_events","CustomEvent","detail","component","preinitialize","postinitialize","validate","prevalidate","postvalidate","_prefix","_key","_name","_storageKey","_shouldStore","_id","_valid","_initialized","_errors","constructor","prefix","key","initializeClass","_validate","Error","name","errors","map","error","message","join","rootDOMElement","_dispatchEvent","_generateKey","_setDOMElements","_setIds","_setAriaAttributes","_setCustomProps","_createChildElements","_handleMediaMatch","_handleFocus","_handleHover","_handleClick","_handleKeydown","_handleKeyup","_store","console","init","dom","document","documentElement","selectors","elements","classes","durations","delays","intervals","timeouts","listeners","events","value","focusState","currentEvent","shouldFocus","check","breakpoint","mediaQuery","id","isValid","isInitialized","rootDOMElementCheck","shouldThrow","status","Object","keys","length","domElements","domKey","Array","isArray","forEach","element","index","domChecks","HTMLElement","querySelectors","querySelector","querySelectorChecks","className","classListChecks","durationName","durationChecks","delayName","delayChecks","strings","elementType","stringChecks","regenerate","Math","random","toString","replace","substring","_setDOMElementType","context","overwrite","strict","includes","from","querySelectorAll","filteredElements","filter","item","parentElement","_resetDOMElementType","window","matchMedia","_addEventListener","storage","GrauplStorage","scope","set","type","data","_unstore","clear","_setInterval","callback","delay","_clearInterval","setInterval","clearInterval","_clearIntervals","_setTimeout","_clearTimeout","setTimeout","clearTimeout","_clearTimeouts","_registerEvent","bubbles","eventName","charAt","toUpperCase","slice","eventType","dispatchEvent","listener","options","addEventListener","push","_removeEventListener","removeEventListener","registeredListener","i","JSON","stringify","splice","_removeEventListeners","focus","blur","dispose","isTag","addClass","removeClass","TransactionalValue","Component","AccordionItem","_rootDOMElement","_protectedDOMElements","_open","_locked","_name","_storageKey","_shouldStore","constructor","accordionItemElement","accordionItemToggleElement","accordionItemHeaderElement","accordionItemContentElement","parentAccordion","prefix","key","_dom","item","toggle","header","content","_elements","parent","_registerEvent","detail","_addEventListener","rootDOMElement","dom","getAttribute","show","force","emit","transition","hide","isOpen","value","isLocked","_setIds","elements","index","accordionItems","indexOf","id","_setAriaAttributes","shouldThrow","status","setAttribute","_reveal","closeClass","openClass","transitionClass","openDuration","requestAnimationFrame","style","height","getBoundingClientRect","_setTimeout","removeAttribute","_dispatchEvent","_conceal","closeDuration","preserveState","commit","allowExpandMultiple","unlockSiblings","closeSiblings","allowCollapseAll","openAccordionItems","length","lock","focus","blur","unlock","forEach","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Character","isNaN","match","Tab","Asterisk","Object","find","preventEvent","preventDefault","stopPropagation","AccordionItem","keyPress","preventEvent","isValidType","isValidClassList","Component","Accordion","_rootDOMElement","_optionalKeySupport","_expandMultiple","_collapseAll","_currentChild","_storageKey","_name","constructor","accordionElement","accordionItemsSelector","accordionItemTogglesSelector","accordionItemHeadersSelector","accordionItemContentsSelector","accordionControlContainerSelector","accordionControlsSelector","expandControllerSelector","collapseControllerSelector","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","optionalKeySupport","allowExpandMultiple","allowCollapseAll","automaticActivation","prefix","key","initializeClass","initialize","_dom","accordion","accordionItems","accordionItemToggles","accordionItemHeaders","accordionItemContents","accordionControlContainer","accordionControls","expandController","collapseController","_selectors","_elements","_classes","open","close","transition","_durations","_automatic","_addEventListener","rootDOMElement","dom","length","forEach","control","setAttribute","booleans","booleanChecks","status","_errors","errors","_valid","value","_setCustomProps","currentChild","elements","currentAccordionItem","openAccordionItems","filter","item","isOpen","removeAttribute","_setIds","id","_id","style","setProperty","_setDOMElements","_setDOMElementType","context","_resetDOMElementType","accordionItem","overwrite","strict","_createChildElements","index","accordionItemElement","accordionItemToggleElement","accordionItemHeaderElement","accordionItemContentElement","parentAccordion","push","_handleFocus","toggle","_handleClick","currentEvent","openChildren","closeChildren","_handleKeydown","accordionToggle","event","toggleKeys","includes","optionalKeys","controllerKeys","_handleKeyup","focusFirstChild","focusLastChild","focusNextChild","focusPreviousChild","focusCurrentChild","focus","focusChild","blurCurrentChild","blur","show","hide","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","Accordion","once","generate","options","context","document","accordionSelector","forEach","accordionElement","accordionOptions","dataset","grauplAccordionOptions","JSON","parse","replace","initialize","isValidClassList","isValidType","addClass","removeClass","keyPress","preventEvent","TransactionalValue","Component","Alert","_rootDOMElement","_protectedDOMElements","_hidden","_storageKey","_name","constructor","alertElement","controllerElement","showClass","hideClass","transitionClass","transitionDuration","showDuration","hideDuration","isHidden","prefix","key","initializeClass","initialize","_dom","alert","controller","_classes","show","hide","transition","_durations","value","commit","_registerEvent","detail","_addEventListener","rootDOMElement","_conceal","emit","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","_setCustomProps","_setIds","dom","id","_id","_reveal","requestAnimationFrame","_setTimeout","removeAttribute","_dispatchEvent","setAttribute","style","setProperty","_handleClick","_handleKeydown","event","_handleKeyup","force","preserveState","focusState","Alert","once","generate","options","context","document","alertSelector","forEach","alertElement","alertOptions","dataset","grauplAlertOptions","JSON","parse","replace","controllerElement","querySelector","initialize","addClass","removeClass","preventEvent","keyPress","isTag","isValidClassList","isValidType","Component","Carousel","_rootDOMElement","_currentItem","_autoplay","_playText","_pauseText","_currentAction","_storageKey","_name","constructor","carouselElement","carouselItemsSelector","carouselItemContainerSelector","carouselControlsSelector","carouselControlContainerSelector","carouselTabsSelector","carouselTabContainerSelector","autoplaySelector","nextSelector","previousSelector","activeClass","previousClass","nextClass","playClass","pauseClass","autoplay","transitionDelay","transitionDuration","playText","pauseText","prefix","key","initializeClass","initialize","_dom","carousel","carouselItems","carouselItemContainer","carouselControls","carouselControlContainer","carouselTabs","carouselTabContainer","next","previous","_selectors","_classes","active","play","pause","_delays","transition","_durations","_addEventListener","rootDOMElement","_handleAutoplay","activateFirstItem","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","strings","stringChecks","value","currentItem","dom","length","tabs","querySelectorAll","selectors","carouselTab","forEach","item","index","setAttribute","currentCarouselItem","currentCarouselTab","_setTransitionDuration","currentAction","_setDOMElements","_setDOMElementType","context","_setIds","id","tab","_id","_setAriaAttributes","getAttribute","_setCustomProps","style","setProperty","_setInterval","activateNextItem","_clearInterval","_handleFocus","_handleClick","activatePreviousItem","toggleAutoplay","activateItem","_handleHover","_handleKeydown","control","event","_handleKeyup","activateCurrentItem","deactivateCurrentItem","currentIndex","dataset","grauplAction","requestAnimationFrame","setTimeout","activateLastItem","Carousel","once","generate","options","context","document","carouselSelector","forEach","carouselElement","carouselOptions","dataset","grauplCarouselOptions","JSON","parse","replace","initialize","once","generate","options","context","document","navigationSelector","forEach","navigationElement","MenuConstructor","dataset","grauplMenuType","DisclosureMenu","window","undefined","console","warn","menuOptions","grauplMenuOptions","JSON","parse","replace","menuElement","querySelector","controllerElement","containerElement","menuItemSelector","menuLinkSelector","submenuItemSelector","submenuToggleSelector","isValidClassList","isValidType","isTag","addClass","removeClass","keyPress","preventEvent","TransactionalValue","Component","Disclosure","_rootDOMElement","_protectedDOMElements","_open","_openInsideBreakpoint","_openOutsideBreakpoint","_closeInsideBreakpoint","_closeOutsideBreakpoint","_lockInsideBreakpoint","_lockOutsideBreakpoint","_unlockInsideBreakpoint","_unlockOutsideBreakpoint","_locked","_shouldOpen","_closeOnBlur","_storageKey","_name","_mediaQueryListEventCallback","event","matches","unlockInsideBreakpoint","unlock","isOpen","closeInsideBreakpoint","isLocked","close","preserveState","openInsideBreakpoint","open","lockInsideBreakpoint","lock","unlockOutsideBreakpoint","closeOutsideBreakpoint","openOutsideBreakpoint","lockOutsideBreakpoint","constructor","disclosureElement","controllerElement","disclosureContentSelector","lockedClass","unlockedClass","openClass","closeClass","transitionClass","transitionDuration","openDuration","closeDuration","closeOnBlur","minWidth","breakpoint","autoOpen","locked","mediaQuery","prefix","key","initializeClass","initialize","_dom","disclosure","controller","_selectors","content","_classes","unlocked","transition","_durations","console","warn","_breakpoint","_mediaQueryString","_registerEvent","detail","_addEventListener","rootDOMElement","dom","getAttribute","window","matchMedia","booleans","value","booleanChecks","shouldThrow","status","_errors","errors","_valid","_setCustomProps","hasOpened","committed","shouldOpen","shouldBeLocked","_setIds","id","_id","_setAriaAttributes","setAttribute","style","setProperty","_setDOMElements","_resetDOMElementType","_setDOMElementType","context","_reveal","emit","isInitialized","transitionlass","requestAnimationFrame","setTimeout","removeAttribute","_dispatchEvent","_conceal","innert","_lock","_unlock","_handleFocus","currentEvent","relatedTarget","contains","_handleClick","button","toggle","document","focusState","target","_handleKeydown","_handleKeyup","force","commit","preview","toggleLock","Disclosure","once","generate","options","context","document","disclosureSelector","controllerSelector","forEach","disclosureElement","disclosureOptions","dataset","grauplDisclosureOptions","JSON","parse","replace","targettedControllerSelector","id","controllerElement","console","warn","remove","initialize","accordionGenerator","alertGenerator","carouselGenerator","navigationGenerator","disclosureGenerator","document","addEventListener"],"sources":["../../src/js/validate.js","../../src/js/domHelpers.js","../../src/js/TransactionalValue.js","../../src/js/storage/StorageManager.js","../../src/js/Component.js","../../src/js/accordion/AccordionItem.js","../../src/js/eventHandlers.js","../../src/js/accordion/Accordion.js","../../../../node_modules/@drupal/once/src/once.js","../../src/js/accordion/generator.js","../../src/js/alert/Alert.js","../../src/js/alert/generator.js","../../src/js/carousel/Carousel.js","../../src/js/carousel/generator.js","../../src/js/navigation/generator.js","../../src/js/disclosure/Disclosure.js","../../src/js/disclosure/generator.js","../../src/js/main.js"],"sourcesContent":["/**\n * @file\n * Validation helper functions.\n */\n\n/* global Component */\n\n/**\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidInstance(\n contructor,\n elements,\n { shouldThrow = true } = {}\n) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidType(type, values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(\n `${key} must be a ${type}. \"${valueType}\" given.`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isQuerySelector(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidClassList(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidState(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidEvent(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the provided values are valid hover types for a menu.\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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidHoverType(values, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\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 try {\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 } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 `{ status: 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 * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isTag(tagName, elements, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n if (\n isValidType(\"string\", { tagName }, { shouldThrow: true }).status &&\n isValidInstance(HTMLElement, elements, { shouldThrow: true }).status\n ) {\n const tag = tagName.toLowerCase();\n\n for (const key in elements) {\n try {\n if (elements[key].tagName.toLowerCase() !== tag) {\n throw new TypeError(\n `${key} must be a <${tag}> element. <${elements[\n key\n ].tagName.toLowerCase()}> given.`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n }\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the provided event type is valid for dispatching.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} eventType - The event type to check.\n * @param {Component} component - The component to check.\n * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow = true ] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function isValidEventType(\n eventType,\n component,\n { shouldThrow = true } = {}\n) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n if (!Object.prototype.hasOwnProperty.call(component.events, eventType)) {\n throw new TypeError(\n `Event type \"${eventType}\" is not valid for ${component.constructor.name}. Valid event types are: \"${Object.keys(component.events).join('\", ')}\".`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\n}\n\n/**\n * Check to see if the component has a valid root DOM element.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Component} component - The component to check.\n * @param {object} [options = {}] - Additional options.\n * @param {boolean} [options.shouldThrow=true] - Whether to throw on error or return it.\n * @return {Object<boolean, Error[]>} - The result of the check.\n */\nexport function hasValidRootDOMElement(component, { shouldThrow = true } = {}) {\n const result = {\n status: true,\n errors: [],\n };\n\n try {\n // Check to make sure the root DOM element exists in _dom.\n if (\n !Object.prototype.hasOwnProperty.call(\n component._dom,\n component._rootDOMElement\n )\n ) {\n throw new Error(\n `The root DOM element \"${component._rootDOMElement}\" does not exist in the ${component.constructor.name}'s _dom property. It must be one of the following: \"${Object.keys(\n component._dom\n ).join('\", \"')}\".`\n );\n }\n } catch (error) {\n result.status = false;\n result.errors.push(error);\n }\n\n if (shouldThrow && !result.status) {\n throw result.errors[0];\n }\n\n return result;\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement[]} - An array of focusable elements.\n */\nexport function selectAllFocusableElements(context = document, fn = null) {\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 if (fn !== null) {\n return tabbableElements.filter(fn);\n } else {\n return tabbableElements;\n }\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The first focusable element or false if none found.\n */\nexport function selectFirstFocusableElement(context = document, fn = null) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The last focusable element or false if none found.\n */\nexport function selectLastFocusableElement(context = document, fn = null) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The next focusable element or false if none found.\n */\nexport function selectNextFocusableElement(\n element,\n context = document,\n fn = null\n) {\n const tabbableElements = selectAllFocusableElements(context, fn);\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 * @param {?function(HTMLElement): boolean} [fn = null] - An optional addition filter function to process out focusable elements.\n * @return {HTMLElement|boolean} - The previous focusable element or false if none found.\n */\nexport function selectPreviousFocusableElement(\n element,\n context = document,\n fn = null\n) {\n const tabbableElements = selectAllFocusableElements(context, fn);\n const index = tabbableElements.indexOf(element);\n\n return index === 0 ? false : tabbableElements[index - 1];\n}\n","/**\n * @file\n * Provides a utility class for managing transactional values.\n */\n\n/**\n * A utility class that maintains a \"current\" value and a \"committed\" value.\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 */\nclass TransactionalValue {\n /**\n * A comparator function used to check equality between\n * the current and committed values.\n *\n * @protected\n *\n * @type {function(*, *): boolean}\n */\n _equals = Object.is;\n\n /**\n * The current, editable value.\n *\n * @protected\n *\n * @type {*}\n */\n _current;\n\n /**\n * The last committed (baseline) value.\n *\n * @protected\n *\n * @type {*}\n */\n _committed;\n\n /**\n * Creates a new TransactionalValue instance.\n *\n * @param {*} initialValue - The starting (and initially committed) value.\n * @param {object} [options = {}] - Options for configuring the instance.\n * @param {function(*, *): boolean} [options.equals = Object.is] - Custom equality comparator. Defaults to `Object.is`.\n */\n constructor(initialValue, { equals = Object.is } = {}) {\n this._equals = equals || Object.is;\n this._current = initialValue;\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 value.\n *\n * @readonly\n *\n * @type {*}\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 * Will be `true` if the values are different, `false` otherwise.\n *\n * @readonly\n *\n * @type {boolean}\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\nexport default TransactionalValue;\n","/**\n * @file\n * Provides a system to get and store data in the browser.\n */\n\nimport { isValidType, isValidInstance } from \"../validate.js\";\n\n/**\n * Class representing a storage system.\n */\nclass StorageManager {\n /**\n * The scope of the storage.\n *\n * @protected\n *\n * @type {string}\n */\n _scope;\n\n /**\n * The type of storage.\n *\n * @protected\n *\n * @type {string}\n */\n _type = \"_default\";\n\n /**\n * The storage object.\n *\n * @protected\n *\n * @type {object}\n */\n _storage = {};\n\n /**\n * Whether to crush the storage instance if it already exists.\n *\n * @protected\n *\n * @type {boolean}\n */\n _crush = false;\n\n /**\n * Creates a Storage instance.\n *\n * @param {object} [options = {}] - The options for the storage.\n * @param {string} options.scope - The scope of the storage.\n * @param {?string} [options.type = null] - The type of storage.\n * @param {boolean} [options.crush = false] - Whether to crush the storage instance if it already exists.\n * @param {boolean} [options.initialize = true] - Whether to initialize the storage.\n */\n constructor({ scope, type = null, crush = false, initialize = true } = {}) {\n this._scope = scope;\n this._type = type || \"_default\";\n this._crush = crush;\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initialize the storage.\n */\n initialize() {\n // Try to make sure the storage instance won't crush other instances of StorageManager with the same scope.\n try {\n if (!this._crush && typeof window[this.scope] !== \"undefined\") {\n if (\n isValidInstance(\n StorageManager,\n { storage: window[this.scope] },\n { shouldThrow: false }\n ).status ||\n (typeof window[this.scope].storage !== \"undefined\" &&\n typeof window[this.scope].scope !== \"undefined\" &&\n typeof window[this.scope].type !== \"undefined\")\n ) {\n this._storage = window[this.scope].storage;\n }\n }\n } catch {\n // Do nothing.\n } finally {\n window[this.scope] = this;\n }\n }\n\n /**\n * The scope of the storage.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _scope\n */\n get scope() {\n return this._scope;\n }\n\n /**\n * The type of storage.\n *\n * @type {string}\n *\n * @see _type\n */\n get type() {\n return this._type;\n }\n\n set type(type) {\n if (isValidType(\"string\", { type })) {\n this._type = type;\n }\n }\n\n /**\n * The storage object.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _storage\n */\n get storage() {\n return this._storage;\n }\n\n /**\n * Get the storage object.\n *\n * @param {object} [options = {}] - The options for getting the storage.\n * @param {string} [options.type = this.type] - The type of storage to get.\n * @param {?string} [options.key = null] - The key to get the value from.\n * @return {object} - The storage object.\n */\n get({ type = this.type, key = null } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (!this.storage[type]) {\n throw new Error(\n `StorageManager (${this.scope}): Type \"${type}\" is not initialized.`\n );\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n return this.storage[type][key];\n }\n\n return this.storage[type];\n }\n\n /**\n * Set the storage object.\n *\n * @param {object} [options = {}] - The options for setting the storage.\n * @param {string} [options.type = this.type] - The type of storage to set.\n * @param {?string} [options.key = null] - The key to set the value to.\n * @param {object} [options.data = {}] - The data to set.\n */\n set({ type = this.type, key = null, data = {} } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n const dataCheck = isValidType(\"object\", { data });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (!dataCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${dataCheck.message}`);\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n if (!this._storage[type]) {\n this._storage[type] = {};\n }\n\n this._storage[type][key] = data;\n } else {\n this._storage[type] = data;\n }\n }\n\n /**\n * Remove a value from the storage object.\n *\n * @param {object} [options = {}] - The options for removing from storage.\n * @param {string} [options.type = this.type] - The type of storage to remove from.\n * @param {?string} [options.key = null] - The key to remove the value from.\n */\n clear({ type = this.type, key = null } = {}) {\n const typeCheck = isValidType(\"string\", { type });\n\n if (!typeCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${typeCheck.message}`);\n }\n\n if (key !== null) {\n const keyCheck = isValidType(\"string\", { key });\n\n if (!keyCheck.status) {\n throw new Error(`StorageManager (${this.scope}): ${keyCheck.message}`);\n }\n\n delete this.storage[type][key];\n } else {\n delete this.storage[type];\n }\n }\n\n dispose() {\n delete this._storage;\n delete this;\n }\n}\n\nexport default StorageManager;\n","/**\n * @file\n * A generic component class.\n */\n\nimport {\n isValidInstance,\n isValidType,\n isValidClassList,\n isQuerySelector,\n isValidState,\n isValidEvent,\n isValidEventType,\n hasValidRootDOMElement,\n} from \"./validate.js\";\nimport StorageManager from \"./storage/StorageManager.js\";\nimport { addClass, removeClass } from \"./domHelpers.js\";\n\nclass Component {\n /**\n * The DOM elements within the component.\n *\n * @protected\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n */\n _dom = {};\n\n /**\n * The root DOM element of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _rootDOMElement = \"\";\n\n /**\n * The DOM elements within the component that cannot be reset or generated by the component itself.\n *\n * @protected\n *\n * @type {string[]}\n */\n _protectedDOMElements = [];\n\n /**\n * The query selectors used by the component.\n *\n * @protected\n *\n * @type {Object<string>}\n */\n _selectors = {};\n\n /**\n * The instantiated elements within the component.\n *\n * @protected\n *\n * @type {object}\n */\n _elements = {};\n\n /**\n * The CSS classes to apply when the component is in various states.\n *\n * @protected\n *\n * @type {Object<string, string[]>}\n */\n _classes = {\n initialize: \"\",\n };\n\n /**\n * The duration times (in milliseconds) for various aspects throughout the component.\n *\n * @protected\n *\n * @type {Object<number>}\n */\n _durations = {};\n\n /**\n * The delay times (in milliseconds) for various aspects throughout the component.\n *\n * @protected\n *\n * @type {Object<number>}\n */\n _delays = {};\n\n /**\n * The current state of the component's focus.\n *\n * @protected\n *\n * @type {string}\n */\n _focusState = \"none\";\n\n /**\n * The last type of event triggered within the component.\n *\n * @protected\n *\n * @type {string}\n */\n _currentEvent = \"none\";\n\n /**\n * The breakoint that the component will call media query list events.\n *\n * @protected\n *\n * @type {string}\n */\n _breakpoint = \"\";\n\n /**\n * The media query to use to trigger media query list events.\n *\n * @type {string}\n */\n _mediaQueryString = \"\";\n\n /**\n * This MediaQueryList for the component.\n *\n * @protected\n *\n * @type {MediaQueryList|null}\n */\n _mediaQueryList = null;\n\n /**\n * A callback for media query list events.\n *\n * @protected\n *\n * @type {Function}\n *\n * @param {MediaQueryListEvent} event - The event.\n */\n _mediaQueryListEventCallback = (event) => {\n // Add functionality to handle media matches.\n if (event.matches) {\n // Do something.\n } else {\n // Do something else.\n }\n };\n\n /**\n * Intervals throughout the component.\n *\n * @protected\n *\n * @type {Object<Function>}\n */\n _intervals = {};\n\n /**\n * Timeouts throughout the component.\n *\n * @protected\n *\n * @type {Object<Function>}\n */\n _timeouts = {};\n\n /**\n * Event listeners throughout the component.\n *\n * @protected\n *\n * @type {object[]}\n */\n _listeners = [];\n\n /**\n * Custom events that can be triggered throughout the component.\n *\n * @protected\n *\n * @type {Object<CustomEvent>}\n */\n _events = {\n initialize: new CustomEvent(\"grauplComponentInitialize\", {\n detail: { component: this },\n }),\n preinitialize: new CustomEvent(\"grauplComponentPreinitialize\", {\n detail: { component: this },\n }),\n postinitialize: new CustomEvent(\"grauplComponentPostinitialize\", {\n detail: { component: this },\n }),\n validate: new CustomEvent(\"grauplComponentValidate\", {\n detail: { component: this },\n }),\n prevalidate: new CustomEvent(\"grauplComponentPrevalidate\", {\n detail: { component: this },\n }),\n postvalidate: new CustomEvent(\"grauplComponentPostvalidate\", {\n detail: { component: this },\n }),\n };\n\n /**\n * The prefix used for CSS custom properties and attributes.\n *\n * @protected\n *\n * @type {string}\n */\n _prefix = \"graupl-\";\n\n /**\n * The key used to generate IDs throughout the component.\n *\n * @protected\n *\n * @type {string}\n */\n _key = \"\";\n\n /**\n * The component name of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _name = \"Component\";\n\n /**\n * The key used for storage.\n *\n * @protected\n *\n * @type {string}\n */\n _storageKey = \"components\";\n\n /**\n * A flag to check if the component should be stored in the StorageManager.\n */\n _shouldStore = true;\n\n /**\n * The main ID of the component.\n *\n * @protected\n *\n * @type {string}\n */\n _id = \"\";\n\n /**\n * The validity state of the component.\n *\n * @protected\n *\n * @type {boolean}\n */\n _valid = true;\n\n /**\n * The initialized state of the component.\n *\n * @protected\n *\n * @type {boolean}\n */\n _initialized = false;\n\n /**\n * The errors found throughout the component.\n *\n * @protected\n *\n * @type {Error[]}\n */\n _errors = [];\n\n /**\n * Constructs a new component.\n *\n * @param {object} [options = {}] - The options for generating the component.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the component.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the component is initializing.\n */\n constructor({\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n } = {}) {\n // Set the classes.\n this._classes.initialize = initializeClass || \"\";\n\n // Set the prefix and key.\n this._prefix = prefix || \"\";\n this._key = key || \"\";\n }\n\n /**\n * Initialize the component.\n */\n initialize() {\n try {\n if (!this._validate()) {\n throw new Error(\n `Graupl ${this.name}: Cannot initialize component. The following errors have been found:\\n - ${this.errors\n .map((error) => error.message)\n .join(\"\\n - \")}`\n );\n }\n\n addClass(this.initializeClass, this.rootDOMElement);\n\n this._dispatchEvent(\"preinitialize\", this.rootDOMElement);\n\n // Generate the key.\n this._generateKey();\n\n // Set up the DOM.\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n this._setCustomProps();\n\n // Set up child elements.\n this._createChildElements();\n\n // Handle events.\n this._handleMediaMatch();\n this._handleFocus();\n this._handleHover();\n this._handleClick();\n this._handleKeydown();\n this._handleKeyup();\n\n this._dispatchEvent(\"initialize\", this.rootDOMElement);\n\n // Store the component.\n this._store();\n\n removeClass(this.initializeClass, this.rootDOMElement);\n\n this._initialized = true;\n\n this._dispatchEvent(\"postinitialize\", this.rootDOMElement);\n } catch (error) {\n console.error(error);\n }\n }\n init() {\n this.initialize();\n }\n\n /**\n * The DOM elements within the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _dom\n */\n get dom() {\n return this._dom;\n }\n\n /**\n * The root DOM element of the component.\n *\n * @readonly\n *\n * @type {HTMLElement}\n *\n * @see _rootDOMElement\n */\n get rootDOMElement() {\n return this._dom[this._rootDOMElement] || document.documentElement;\n }\n\n /**\n * The query selectors used by the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _selectors\n */\n get selectors() {\n return this._selectors;\n }\n\n /**\n * The instantiated elements within the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _elements\n */\n get elements() {\n return this._elements;\n }\n\n /**\n * The CSS classes to apply when the component is in various states.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _classes\n */\n get classes() {\n return this._classes;\n }\n\n /**\n * The duration times (in milliseconds) for various aspects throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _durations\n */\n get durations() {\n return this._durations;\n }\n\n /**\n * The delay times (in milliseconds) for various aspects throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _delays\n */\n get delays() {\n return this._delays;\n }\n\n /**\n * Intervals throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _intervals\n */\n get intervals() {\n return this._intervals;\n }\n\n /**\n * Timeouts throughout the component.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _timeouts\n */\n get timeouts() {\n return this._timeouts;\n }\n\n /**\n * Event listeners throughout the component.\n *\n * @readonly\n *\n * @type {object[]}\n *\n * @see _listeners\n */\n get listeners() {\n return this._listeners;\n }\n\n /**\n * Custom events that can be triggered throughout the component.\n *\n * @readonly\n *\n * @type {Error[]}\n *\n * @see _events\n */\n get events() {\n return this._events;\n }\n\n /**\n * The class(es) to apply when the component is initializing.\n *\n * @type {string|string[]}\n *\n * @see _classes.initialize\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 current state of the component'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({ focusState: value });\n\n if (this._focusState !== value) {\n this._focusState = value;\n }\n }\n\n /**\n * The last type of event triggered within the component.\n *\n * @type {string}\n *\n * @see _currentEvent\n */\n get currentEvent() {\n return this._currentEvent;\n }\n\n set currentEvent(value) {\n isValidEvent({ currentEvent: value });\n\n if (this._currentEvent !== value) {\n this._currentEvent = value;\n }\n }\n\n /**\n * A flag to check if the disclosure's focus methods should _actually_ move the focus in the DOM.\n *\n * This will be `false` unless any of the following criteria are met:\n * - The disclosure's current event is \"keyboard\".\n *\n * @readonly\n *\n * @type {boolean}\n */\n get shouldFocus() {\n let check = false;\n\n if (this.currentEvent === \"keyboard\") {\n check = true;\n }\n\n return check;\n }\n\n /**\n * The breakoint that the component will call media query list events.\n *\n * @type {string}\n *\n * @see _breakpoint\n */\n get breakpoint() {\n return this._breakpoint;\n }\n\n set breakpoint(value) {\n isValidType(\"string\", { breakpoint: value });\n\n if (this._breakpoint !== value) {\n this._breakpoint = value;\n }\n }\n\n /**\n * The media query to use to trigger media query list events.\n *\n * @type {string}\n *\n * @see _mediaQueryString\n */\n get mediaQuery() {\n if (this._mediaQueryString !== \"\") {\n return this._mediaQueryString;\n }\n\n if (this._breakpoint === \"\") {\n return \"\";\n }\n\n return `(width <= ${this._breakpoint})`;\n }\n\n set mediaQuery(value) {\n isValidType(\"string\", { mediaQuery: value });\n\n if (this._mediaQueryString !== value) {\n this._mediaQueryString = value;\n }\n }\n\n /**\n * The prefix used for CSS custom properties and attributes.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * The key used to generate IDs throughout the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _key\n */\n get key() {\n return this._key;\n }\n\n /**\n * The component name of the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _name\n */\n get name() {\n return this._name;\n }\n\n /**\n * The main ID of the component.\n *\n * @readonly\n *\n * @type {string}\n *\n * @see _id\n */\n get id() {\n return this._id;\n }\n\n /**\n * The validity state of the component.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _valid\n */\n get isValid() {\n return this._valid;\n }\n\n /**\n * The initialized state of the component.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _initialized\n */\n get isInitialized() {\n return this._initialized;\n }\n\n /**\n * An array to hold error messages.\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 component to ensure proper functionality.\n *\n * Keys are altered to match the arguments passed in during creation where possible.\n *\n * @protected\n *\n * @return {boolean} - The result of the validation checks.\n */\n _validate() {\n this._dispatchEvent(\"prevalidate\", this.rootDOMElement);\n\n // _rootDOMElement check.\n const rootDOMElementCheck = hasValidRootDOMElement(this, {\n shouldThrow: false,\n });\n\n // Handle _rootDOMElement check failure.\n if (!rootDOMElementCheck.status) {\n this._errors = [...this._errors, ...rootDOMElementCheck.errors];\n this._valid = false;\n }\n\n // DOM checks.\n if (Object.keys(this._dom).length > 0) {\n const domElements = {};\n\n // Loop through and add \"Element\" to the end of each key in _dom.\n for (const domKey of Object.keys(this._dom)) {\n // If we're dealing with an array, we need to check each element in the array.\n if (Array.isArray(this._dom[domKey])) {\n this._dom[domKey].forEach((element, index) => {\n domElements[`${domKey}Element[${index}]`] = element;\n });\n } else if (this._dom[domKey] !== null) {\n domElements[`${domKey}Element`] = this._dom[domKey];\n }\n }\n\n // Check the DOM elements.\n const domChecks = isValidInstance(HTMLElement, domElements, {\n shouldThrow: false,\n });\n\n // Handle DOM check failure.\n if (!domChecks.status) {\n this._errors = [...this._errors, ...domChecks.errors];\n this._valid = false;\n }\n }\n\n // Query selector checks.\n if (Object.keys(this._selectors).length > 0) {\n const querySelectors = {};\n\n // Loop through and add \"Selector\" to the end of each key in _selectors.\n for (const querySelector of Object.keys(this._selectors)) {\n querySelectors[`${querySelector}Selector`] =\n this._selectors[querySelector];\n }\n\n // Check the query selectors.\n const querySelectorChecks = isQuerySelector(querySelectors, {\n shouldThrow: false,\n });\n\n // Handle query selector check failure.\n if (!querySelectorChecks.status) {\n this._errors = [...this._errors, ...querySelectorChecks.errors];\n this._valid = false;\n }\n }\n\n // Class list checks.\n if (Object.keys(this._classes).length > 0) {\n const classes = {};\n\n // Loop through and add \"Class\" to the end of each key in _classes.\n for (const className of Object.keys(this._classes)) {\n if (this._classes[className] === \"\") {\n continue;\n }\n\n classes[`${className}Class`] = this._classes[className];\n }\n\n // Check the class lists.\n const classListChecks = isValidClassList(classes, { shouldThrow: false });\n\n // Handle class list check failure.\n if (!classListChecks.status) {\n this._errors = [...this._errors, ...classListChecks.errors];\n this._valid = false;\n }\n }\n\n // Duration checks.\n if (Object.keys(this._durations).length > 0) {\n const durations = {};\n\n // Loop through and add \"Duration\" to the end of each key in _durations.\n for (const durationName of Object.keys(this._durations)) {\n durations[`${durationName}Duration`] = this._durations[durationName];\n }\n\n // Check the durations.\n const durationChecks = isValidType(\"number\", durations, {\n shouldThrow: false,\n });\n\n // Handle duration check failure.\n if (!durationChecks.status) {\n this._errors = [...this._errors, ...durationChecks.errors];\n this._valid = false;\n }\n }\n\n // Delay checks.\n if (Object.keys(this.delays).length > 0) {\n const delays = {};\n\n // Loop through and add \"Delay\" to the end of each key in delays.\n for (const delayName of Object.keys(this.delays)) {\n delays[`${delayName}Delay`] = this.delays[delayName];\n }\n\n // Check the delays.\n const delayChecks = isValidType(\"number\", delays, { shouldThrow: false });\n\n // Handle delay check failure.\n if (!delayChecks.status) {\n this._errors = [...this._errors, ...delayChecks.errors];\n this._valid = false;\n }\n }\n\n // String checks.\n const strings = {\n _storageKey: this._storageKey,\n key: this._key,\n prefix: this._prefix,\n mediaQuery: this._mediaQueryString,\n breakpoint: this._breakpoint,\n };\n\n this._protectedDOMElements.forEach((elementType) => {\n strings[`_protectedDOMElementType[${elementType}]`] = elementType;\n });\n // Check the strings.\n const stringChecks = isValidType(\"string\", strings, { shouldThrow: false });\n\n // Handle string check failure.\n if (!stringChecks.status) {\n this._errors = [...this._errors, ...stringChecks.errors];\n this._valid = false;\n }\n\n this._dispatchEvent(\"validate\", this.rootDOMElement);\n\n this._dispatchEvent(\"postvalidate\", this.rootDOMElement);\n\n return this._valid;\n }\n\n /**\n * Generates a key for the component.\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 IDs throughout the component.\n */\n _setIds() {\n // Add functionality to set IDs throughout the component.\n }\n\n /**\n * Sets ARIA attributes throughout the component.\n */\n _setAriaAttributes() {\n // Add functionality to set attributes throughout the component.\n }\n\n /**\n * Sets custom props throughout the component.\n */\n _setCustomProps() {\n // Add functionality to set custom props throughout the component.\n }\n\n /**\n * Sets DOM elements throughout the component.\n *\n * Elements listed in _protectedDOMElements cannot be set using 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.context] - The element used as the base context 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 = false] - A flag to set if the elements must be direct children of the base.\n */\n _setDOMElementType(\n elementType,\n { context, overwrite = true, strict = false } = {}\n ) {\n // Make sure the element type is valid.\n if (typeof this.selectors[elementType] !== \"string\") {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" is not a valid element type.`\n );\n }\n\n // Make sure the element type can actually be set through this method.\n if (\n this._rootDOMElement === elementType ||\n this._protectedDOMElements.includes(elementType)\n ) {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" element cannot be set through _setDOMElementType because it is a protected element.`\n );\n }\n\n // Make sure the context element is actually an HTMLELement.\n isValidInstance(HTMLElement, { context });\n\n // Get the all elements matching the selector in the context.\n const domElements = Array.from(\n context.querySelectorAll(this.selectors[elementType])\n );\n\n // Filter the elements so if `strict` is true, only direct children of the context are kept.\n const filteredElements = domElements.filter((item) =>\n strict ? item.parentElement === context : true\n );\n\n if (Array.isArray(this._dom[elementType])) {\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 this._dom[elementType] = filteredElements[0] || null;\n }\n }\n\n /**\n * Resets DOM elements throughout the component.\n *\n * Elements listed in _protectedDOMElements cannot be reset using this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to clear.\n */\n _resetDOMElementType(elementType) {\n // Make sure the element type is valid.\n if (typeof this.selectors[elementType] !== \"string\") {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" is not a valid element type.`\n );\n }\n\n // Make sure the element type can actually be reset through this method.\n if (\n this._rootDOMElement === elementType ||\n this._protectedDOMElements.includes(elementType)\n ) {\n throw new Error(\n `Graupl ${this.name}: \"${elementType}\" element cannot be reset through _resetDOMElementType because it is a protected element.`\n );\n }\n\n if (Array.isArray(this._dom[elementType])) {\n this._dom[elementType] = [];\n } else {\n this._dom[elementType] = null;\n }\n }\n\n /**\n * Sets all DOM elements throughout the component.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n // Add functionality to set DOM Elements throughout the component.\n }\n\n /**\n * Creates and initializes child elements throughout the component.\n *\n * @protected\n */\n _createChildElements() {\n // Add functionality to handle creating child elements throughout the component.\n }\n\n /**\n * Handles media match events throughout the component.\n *\n * @protected\n */\n _handleMediaMatch() {\n if (this.mediaQuery === \"\") {\n return;\n }\n\n this._mediaQueryList = window.matchMedia(this.mediaQuery);\n this._addEventListener(\n \"change\",\n this._mediaQueryList,\n this._mediaQueryListEventCallback\n );\n this._mediaQueryListEventCallback(this._mediaQueryList);\n }\n\n /**\n * Handles focus events through the component.\n *\n * @protected\n */\n _handleFocus() {\n // Add functionality to handle focus events throughout the component.\n }\n\n /**\n * Handles click events through the component.\n *\n * @protected\n */\n _handleClick() {\n // Add functionality to handle click events throughout the component.\n }\n\n /**\n * Handles hover events through the component.\n *\n * @protected\n */\n _handleHover() {\n // Add functionality to handle hover events throughout the component.\n }\n\n /**\n * Handles keydown events through the component.\n *\n * @protected\n */\n _handleKeydown() {\n // Add functionality to handle keydown events throughout the component.\n }\n\n /**\n * Handles keyup events through the component.\n *\n * @protected\n */\n _handleKeyup() {\n // Add functionality to handle keyup events throughout the component.\n }\n\n /**\n * Stores the component into the global Graupl storage object.\n *\n * @protected\n */\n _store() {\n // Make sure the component should be stored.\n if (!this._shouldStore) {\n return;\n }\n\n // Set up the storage.\n if (\n !isValidInstance(\n StorageManager,\n { storage: window.GrauplStorage },\n { shouldThrow: false }\n ).status\n ) {\n new StorageManager({ scope: \"GrauplStorage\" });\n }\n\n // Store the menu\n window.GrauplStorage.set({\n key: this.id !== \"\" ? this.id : this.key,\n type: this._storageKey,\n data: this,\n });\n }\n\n /**\n * Removes the component from the global Graupl storage object.\n *\n * @protected\n */\n _unstore() {\n // Make sure the component should be stored.\n if (!this._shouldStore) {\n return;\n }\n\n if (\n !isValidInstance(\n StorageManager,\n { storage: window.GrauplStorage },\n { shouldThrow: false }\n ).status\n ) {\n return;\n }\n\n window.GrauplStorage.clear({\n key: this.id !== \"\" ? this.id : this.key,\n type: this._storageKey,\n });\n }\n\n /**\n * Sets an interval within the component.\n *\n * @protected\n *\n * @param {Function} [callback] - The callback function.\n * @param {number} [delay] - The time (in milliseconds) of the delay.\n * @param {string} [scope = _default] - The scope of the interval (used to store the interval in _intervals).\n */\n _setInterval(callback, delay, scope = \"_default\") {\n this._clearInterval(scope);\n\n this._intervals[scope] = setInterval(callback, delay);\n }\n\n /**\n * Clears an interval within the component.\n *\n * @protected\n *\n * @param {string} [scope = _default] - The scope of the interval (used to get the interval from _intervals).\n */\n _clearInterval(scope = \"_default\") {\n clearInterval(this._intervals[scope]);\n }\n\n /**\n * Clears all intervals within the component.\n *\n * @protected\n */\n _clearIntervals() {\n for (const scope of Object.keys(this._intervals)) {\n this._clearInterval(scope);\n }\n }\n\n /**\n * Sets a timeout within the component.\n *\n * @protected\n *\n * @param {Function} [callback] - The callback function.\n * @param {number} [delay] - The time (in milliseconds) of the delay.\n * @param {string} [scope = _default] - The scope of the timeout (used to store the timeout in _timeouts).\n */\n _setTimeout(callback, delay, scope = \"_default\") {\n this._clearTimeout(scope);\n\n this._timeouts[scope] = setTimeout(callback, delay);\n }\n\n /**\n * Clears a timeout within the component.\n *\n * @protected\n *\n * @param {string} [scope = _default] - The scope of the timeout (used to get the timeout from _timeouts).\n */\n _clearTimeout(scope = \"_default\") {\n clearTimeout(this._timeouts[scope]);\n }\n\n /**\n * Clears all timeouts within the component.\n *\n * @protected\n */\n _clearTimeouts() {\n for (const scope of Object.keys(this._timeouts)) {\n this._clearTimeout(scope);\n }\n }\n\n /**\n * Registers a new event type within the component.\n *\n * @protected\n *\n * @param {string} name - The name of the new event type.\n * @param {object} [options = {}] - The options for the new event type.\n * @param {boolean} [options.bubbles = true] - A flag to set if the event bubbles.\n * @param {object} [options.detail = {}] - Additional details to include in the event.\n */\n _registerEvent(name, { bubbles = true, detail = {} } = {}) {\n isValidType(\"string\", { name });\n isValidType(\"boolean\", { bubbles });\n isValidType(\"object\", { detail });\n\n const eventName = `graupl${this.name}${name.charAt(0).toUpperCase()}${name.slice(\n 1\n )}`;\n\n this._events[name] = new CustomEvent(eventName, {\n bubbles,\n detail: { component: this, ...detail },\n });\n }\n\n /**\n * Dispatch a custom event on an element in the DOM.\n *\n * @param {string} eventType - The type of the event to dispatch.\n * @param {HTMLElement} element - The element to dispatch the event on.\n */\n _dispatchEvent(eventType, element) {\n // Make sure the event type exists.\n isValidEventType(eventType, this);\n\n // Make sure the element is actually an HTML Element.\n isValidInstance(HTMLElement, { element });\n\n // Dispatch the event.\n element.dispatchEvent(this.events[eventType]);\n }\n\n /**\n * Add an event listener to an element and register it within the component.\n *\n * @param {string} type - The type of event to listen for.\n * @param {HTMLElement} element - The element to add the listener to.\n * @param {Function} listener - The listener callback.\n * @param {object|boolean} [options = {}] - Options to pass to the listener.\n */\n _addEventListener(type, element, listener, options = {}) {\n // Add the listener.\n element.addEventListener(type, listener, options);\n\n // Store it in the component.\n this._listeners.push({\n type,\n element,\n listener,\n options,\n });\n }\n\n /**\n * Remove an event listener from an element and unregister it within the component.\n *\n * @param {string} type - The type of event to remove.\n * @param {HTMLElement} element - The element to remove the listener from.\n * @param {Function} listener - The listener callback.\n * @param {object|boolean} [options = {}] - Options to pass to the listener.\n */\n _removeEventListener(type, element, listener, options = {}) {\n // Remove the listener.\n element.removeEventListener(type, listener, options);\n\n // Find the listener in the component's listener storage.\n let index = -1;\n\n this._listeners.forEach((registeredListener, i) => {\n if (\n registeredListener.type === type &&\n registeredListener.element === element &&\n registeredListener.listener === listener &&\n JSON.stringify(registeredListener.options) === JSON.stringify(options)\n ) {\n index = i;\n }\n });\n\n // Remove it from the component's listener storage.\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n /**\n * Removes all event listeners registered in the component.\n *\n * This can be filtered by type and/or element.\n *\n * @protected\n *\n * @param {object} [options = {}] - Options for removing listeners.\n * @param {?string} [options.type = null] - The type of event to remove. If null, all types are removed.\n * @param {?HTMLElement} [options.element = null] - The element to remove listeners from. If null, all elements are removed.\n */\n _removeEventListeners({ type = null, element = null } = {}) {\n const listeners = [...this._listeners];\n\n listeners.forEach((listener) => {\n if (type !== null && listener.type !== type) return;\n if (element !== null && listener.element !== element) return;\n\n this._removeEventListener(\n listener.type,\n listener.element,\n listener.listener,\n listener.options\n );\n });\n }\n\n /**\n * Focus the component.\n *\n * Sets the components's focus state to \"self\" and\n * focusses the component if the component's shouldFocus\n * value is `true`.\n */\n focus() {\n this.focusState = \"self\";\n\n if (this.shouldFocus) {\n this.rootDOMElement.focus();\n }\n }\n\n /**\n * Unfocus the component.\n *\n * Sets the component's focus state to \"none\"\n * and blurs the component if the component's shouldFocus\n * value is `true`.\n */\n blur() {\n this.focusState = \"none\";\n\n if (this.shouldFocus) {\n this.rootDOMElement.blur();\n }\n }\n\n /**\n * Disposes of the current instantiated component.\n *\n * Removes all timeouts and event listeners, removes the component from the global storage, and delete's the object.\n */\n dispose() {\n this._clearIntervals();\n this._clearTimeouts();\n this._removeEventListeners();\n this._unstore();\n\n delete this;\n }\n}\n\nexport default Component;\n","/**\n * @file\n * The Accordion item class.\n */\n\n/* global Accordion */\n\nimport { isTag } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * @event grauplAccordionItemExpand\n * Fired when the accordion item is Expanded.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<AccordionItem>} detail - The event details.\n * @property {AccordionItem} detail.toggle - The accordion item that was Expanded.\n */\n\n/**\n * @event grauplAccordionItemCollapse\n * Fired when the accordion item is collapsed.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<AccordionItem>} detail - The event details.\n * @property {AccordionItem} detail.toggle - The accordion item that was collapsed.\n */\n\n/**\n * The Accordion item component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the accordion item.\n * @property {HTMLElement} _dom.item - The accordion item element.\n * @property {HTMLElement} _dom.toggle - The controller element.\n * @property {HTMLElement} _dom.header - The header element.\n * @property {HTMLElement} _dom.content - The content element.\n * @property {string} _rootDOMElement - The root DOM element of the accordion item.\n * @property {string[]} _protectedDOMElements - The DOM elements within the accordion item that cannot be reset or generated by the accordion item itself.\n * @property {Object<Accordion>} _elements - The instantiated elements within the accordion item.\n * @property {Accordion} _elements.parent - The parent accordion containing this item.\n * @property {TransactionalValue} _open - The open state of the accordion item.\n * @property {TransactionalValue} _locked - The locked state of the accordion item.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the accordion item.\n * @property {grauplAccordionItemExpand} _events.expand - The event triggered when the accordion item is expanded.\n * @property {grauplAccordionItemCollapse} _events.collapse - The event triggered when the accordion item is collapsed.\n * @property {Object<string>} _selectors - The query selectors used by the accordion item.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the accordion item is in various states.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the accordion item.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the accordion item.\n * @property {string} _focusState - The current state of the accordion item's focus.\n * @property {string} _currentEvent - The last type of event triggered within the accordion item.\n * @property {string} _breakpoint - The breakpoint that the accordion item will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the accordion item.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the accordion item.\n * @property {Object<Function>} _timeouts - Timeouts throughout the accordion item.\n * @property {object[]} _listeners - Event listeners throughout the accordion item.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the accordion item.\n * @property {string} _name - The component name of the accordion item.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {string} _id - The main ID of the accordion item.\n * @property {boolean} _valid - The validity state of the accordion item.\n * @property {boolean} _initialized - The initialized state of the accordion item.\n * @property {string[]} _errors - The errors found throughout the accordion item.\n */\nclass AccordionItem extends Component {\n _rootDOMElement = \"item\";\n _protectedDOMElements = [\"toggle\", \"header\", \"content\"];\n _open = new TransactionalValue(false);\n _locked = new TransactionalValue(false);\n _name = \"AccordionItem\";\n _storageKey = \"accordionItems\";\n _shouldStore = false;\n\n /**\n * Constructs a new AccordionItem.\n *\n * @param {object} options - The options object.\n * @param {HTMLElement} options.accordionItemElement - The accordion item element.\n * @param {HTMLElement} options.accordionItemToggleElement - The toggle element.\n * @param {HTMLElement} options.accordionItemHeaderElement - The header element.\n * @param {HTMLElement} options.accordionItemContentElement - The content element.\n * @param {Accordion} [options.parentAccordion = null] - The accordion containing this item.\n */\n constructor({\n accordionItemElement,\n accordionItemToggleElement,\n accordionItemHeaderElement,\n accordionItemContentElement,\n parentAccordion = null,\n }) {\n super({\n prefix: parentAccordion.prefix,\n key: parentAccordion.key,\n });\n\n // Set DOM elements.\n this._dom.item = accordionItemElement;\n this._dom.toggle = accordionItemToggleElement;\n this._dom.header = accordionItemHeaderElement;\n this._dom.content = accordionItemContentElement;\n\n // Set the accordion elements.\n this._elements.parent = parentAccordion;\n\n // Register custom events.\n this._registerEvent(\"expand\", {\n detail: {\n item: this,\n },\n });\n this._registerEvent(\"collapse\", {\n detail: {\n item: this,\n },\n });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Set the initial state of the accordion item.\n if (this.dom.toggle.getAttribute(\"aria-expanded\") === \"true\") {\n this.show({ force: true, emit: false, transition: false });\n } else {\n this.hide({ force: true, emit: false, transition: false });\n }\n }\n );\n }\n\n /**\n * The open state of the accordion item.\n *\n * @readonly\n *\n * @type {object}\n *\n * @see _open\n */\n get isOpen() {\n return this._open.value;\n }\n\n /**\n * The locked state of the accordion item.\n *\n * If locked, the accordion item cannot be closed.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get isLocked() {\n return this._locked.value;\n }\n\n /**\n * Sets the IDs for the accordion item and its elements if they don't exist.\n *\n * The generated IDs use the parent accordion's key and follows the pattern:\n * - Accordion item: `accordion-item-{key}-{index}`\n * - Accordion item toggle: `accordion-item-toggle-{key}-{index}`\n * - Accordion item content: `accordion-item-content-{key}-{index}`\n */\n _setIds() {\n // Get the required information for IDs.\n const { key } = this.elements.parent;\n const index = this.elements.parent.dom.accordionItems.indexOf(\n this.dom.item\n );\n\n this.dom.item.id = this.dom.item.id || `accordion-item-${key}-${index}`;\n this.dom.toggle.id =\n this.dom.toggle.id || `accordion-item-toggle-${key}-${index}`;\n this.dom.header.id =\n this.dom.header.id || `accordion-item-header-${key}-${index}`;\n this.dom.content.id =\n this.dom.content.id || `accordion-item-content-${key}-${index}`;\n }\n\n /**\n * Sets the ARIA attributes for the accordion item and its elements.\n */\n _setAriaAttributes() {\n // Set the ARIA attributes for the accordion item toggle.\n // If the toggle is not a button, then set the role to \"button\".\n if (\n !isTag(\"button\", { toggle: this.dom.toggle }, { shouldThrow: false })\n .status\n ) {\n this.dom.toggle.setAttribute(\"role\", \"button\");\n }\n\n // If aria-expanded is not explicitly set to \"true\", then set it to \"false\".\n if (this.dom.toggle.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.toggle.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Set the aria-controls attribute for the toggle.\n this.dom.toggle.setAttribute(\"aria-controls\", this.dom.content.id);\n\n // Set the ARIA attributes for the accordion item content.\n // If the content is not a section, then set the role to \"region\".\n if (\n !isTag(\"section\", { content: this.dom.content }, { shouldThrow: false })\n .status\n ) {\n this.dom.content.setAttribute(\"role\", \"region\");\n }\n\n // Set the aria-labelledby attribute for the content.\n this.dom.content.setAttribute(\"aria-labelledby\", this.dom.toggle.id);\n }\n\n /**\n * Reveal the accordion item.\n *\n * Sets the accordion item's `aria-expanded` to \"true\", adds the\n * open class to the item, and removes the closed class from the item.\n *\n * @protected\n *\n * @fires grauplAccordionItemExpand\n *\n * @param {Object<boolean>} [options = {}] - Options for revealing the accordion item.\n * @param {boolean} [options.emit = true] - Emit the activate event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _reveal({ emit = true, transition = true } = {}) {\n const { closeClass, openClass, transitionClass, openDuration } =\n this.elements.parent;\n\n // Set aria-selected to true when hiding accordion item.\n this.dom.toggle.setAttribute(\"aria-expanded\", \"true\");\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the hide class,\n // add the show class, and finally remove the transition class.\n //\n // If `transition` is false, then it doesn't matter if the transition class\n // is set. Do not use the transition.\n if (transition && transitionClass !== \"\") {\n addClass(transitionClass, this.dom.item);\n\n requestAnimationFrame(() => {\n removeClass(closeClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n addClass(openClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height + this.dom.content.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n this._setTimeout(() => {\n removeClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = \"\";\n }, openDuration);\n });\n });\n });\n } else {\n // Add the show class\n addClass(openClass, this.dom.item);\n\n // Remove the hide class.\n removeClass(closeClass, this.dom.item);\n }\n\n this.dom.content.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"expand\", this.dom.item);\n }\n }\n\n /**\n * Conceals the accordion item.\n *\n * Sets the accordion item's `aria-expanded` to \"false\", adds the\n * close class to the item, and removes the open class from the item.\n *\n * @protected\n *\n * @fires grauplAccordionItemCollapse\n *\n * @param {Object<boolean>} [options = {}] - Options for concealing the accordion item.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once concealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _conceal({ emit = true, transition = true } = {}) {\n const { closeClass, openClass, transitionClass, closeDuration } =\n this.elements.parent;\n\n // Set aria-selected to false when hiding accordion item.\n this.dom.toggle.setAttribute(\"aria-expanded\", \"false\");\n\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the show class,\n // add the hide class, and finally remove the transition class.\n //\n // If `transition` is false, then it doesn't matter if the transition class\n // is set. Do not use the transition.\n if (transition && transitionClass !== \"\") {\n addClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.item.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n removeClass(openClass, this.dom.item);\n\n this.dom.item.style.height = `${this.dom.header.getBoundingClientRect().height}px`;\n\n requestAnimationFrame(() => {\n addClass(closeClass, this.dom.item);\n\n requestAnimationFrame(() => {\n this._setTimeout(() => {\n removeClass(transitionClass, this.dom.item);\n\n this.dom.item.style.height = \"\";\n }, closeDuration);\n });\n });\n });\n } else {\n // Add the hide class\n addClass(closeClass, this.dom.item);\n\n // Remove the show class.\n removeClass(openClass, this.dom.item);\n }\n\n this.dom.content.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"collapse\", this.dom.item);\n }\n }\n\n /**\n * Shows the accordion item.\n *\n * @param {Object<boolean>} [options = {}] - The options for showing the accordion item.\n * @param {boolean} [options.force = false] - Whether to force the open action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n show({\n force = false,\n preserveState = false,\n emit = true,\n transition = true,\n } = {}) {\n if (this.isOpen && !force) return;\n\n this._reveal({ emit, transition });\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n\n // If the parent accordion only allows a single item to be open at a time,\n // then close all other items.\n if (!this.elements.parent.allowExpandMultiple) {\n this.unlockSiblings();\n this.closeSiblings();\n }\n\n // If the parent accordion requires at least one item to be open, and this\n // is the only open item, then lock it. Otherwise, unlock all siblings.\n if (!this.elements.parent.allowCollapseAll) {\n if (this.elements.parent.openAccordionItems.length <= 1) {\n this.lock();\n } else {\n this.unlockSiblings();\n }\n }\n }\n\n /**\n * Hides the accordion item.\n *\n * @param {Object<boolean>} [options = {}] - The options for hiding the accordion item.\n * @param {boolean} [options.force = false] - Whether to force the hide action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n * @param {boolean} [options.emit = true] - Emit the deactivate event once concealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n hide({\n force = false,\n preserveState = false,\n emit = true,\n transition = true,\n } = {}) {\n if (!this.isOpen && !force) return;\n\n if (\n !this.elements.parent.allowCollapseAll &&\n this.elements.parent.openAccordionItems.length <= 1\n ) {\n return;\n }\n\n this._conceal({ emit, transition });\n\n // Set the open state.\n this._open.value = false;\n\n if (!preserveState) {\n this._open.commit();\n }\n\n // If the parent accordion requires at least one item to be open, and this was\n // the second to last open item, then lock to last open item.\n if (\n !this.elements.parent.allowCollapseAll &&\n this.elements.parent.openAccordionItems.length === 1\n ) {\n this.elements.parent.openAccordionItems[0].lock();\n }\n }\n\n /**\n * Toggle the accordion item.\n */\n toggle() {\n this.isOpen ? this.hide() : this.show();\n }\n\n /**\n * Focuses the accordion item.\n */\n focus() {\n this.dom.toggle.focus();\n }\n\n /**\n * Blurs the accordion item.\n */\n blur() {\n this.dom.toggle.blur();\n }\n\n /**\n * Locks the accordion item.\n */\n lock() {\n this._locked.value = true;\n this._locked.commit();\n this.dom.toggle.setAttribute(\"disabled\", \"true\");\n }\n\n /**\n * Unlocks the accordion item.\n */\n unlock() {\n this._locked.value = false;\n this._locked.commit();\n this.dom.toggle.removeAttribute(\"disabled\");\n }\n\n /**\n * Closes the siblings of the accordion item.\n */\n closeSiblings() {\n if (this.elements.parent) {\n this.elements.parent.elements.accordionItems.forEach((item) => {\n if (item !== this) {\n item.hide();\n }\n });\n }\n }\n\n /**\n * Unlocks the siblings of the accordion item.\n */\n unlockSiblings() {\n if (this.elements.parent) {\n this.elements.parent.elements.accordionItems.forEach((item) => {\n if (item !== this) {\n item.unlock();\n }\n });\n }\n }\n}\n\nexport default AccordionItem;\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 Character: isNaN(key) && !!key.match(/^[a-zA-Z]{1}$/),\n Tab: key === \"Tab\" || key === 9,\n Asterisk: key === \"*\" || key === 56,\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 * @file\n * The Accordion class.\n */\n\nimport AccordionItem from \"./AccordionItem.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport { isValidType, isValidClassList } from \"../validate.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The Accordion component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement, HTMLElement[]>} _dom - The DOM elements within the accordion.\n * @property {HTMLElement} _dom.accordion - The accordion element.\n * @property {HTMLElement[]} _dom.accordionItems - An array of accordion items.\n * @property {HTMLElement[]} _dom.accordionItemToggles - An array of accordion item toggles.\n * @property {HTMLElement[]} _dom.accordionItemHeaders - An array of accordion headers.\n * @property {HTMLElement[]} _dom.accordionItemContents - An array of accordion item contents.\n * @property {HTMLElement} _dom.accordionControlContainer - The accordion control container.\n * @property {HTMLElement[]} _dom.accordionControls - The accordion controls.\n * @property {HTMLElement[]} _dom.expandController - The expand all controller(s).\n * @property {HTMLElement[]} _dom.collapseController - The collapse all controller(s).\n * @property {string} _rootDOMElement - The root DOM element of the accordion.\n * @property {string[]} _protectedDOMElements - The DOM elements within the accordion that cannot be reset or generated by the accordion itself.\n * @property {Object<string>} _selectors - The query selectors used by the accordion.\n * @property {string} _selectors.accordionItems - The query selector for accordion items.\n * @property {string} _selectors.accordionItemToggles - The query selector for accordion toggles.\n * @property {string} _selectors.accordionItemHeaders - The query selector for accordion headers.\n * @property {string} _selectors.accordionItemContents - The query selector for accordion contents.\n * @property {string} _selectors.accordionControlContainer - The querySelector for the accordion control container.\n * @property {string} _selectors.accordionControls - The query selector string for accordion controls.\n * @property {string} _selectors.expandController - The query selector string for the expand all controller(s).\n * @property {string} _selectors.collapseController - The query selector string for the collapse all controller(s).\n * @property {Object<AccordionItem[]>} _elements - The list of accordion items.\n * @property {AccordionItem[]} _elements.accordionItems - The list of accordion items.\n * @property {Object<string, string[]>} _classes - The classes to apply when the accordions are in various states.\n * @property {string|string[]} _classes.open - The class(es) to apply when the accordion item is open.\n * @property {string|string[]} _classes.close - The class(es) to apply when the accordion item is closed.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the accordion item is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the accordion item is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various things throughout the accordion.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between open and closed states.\n * @property {number} _durations.open - The duration time (in milliseconds) for the transition from closed to open states.\n * @property {number} _durations.close - The duration time (in milliseconds) for the transition from open to closed states.\n * @property {boolean} _optionalKeySupport - A flag to decide if the accordion items can be navigated by arrows.\n * @property {boolean} _expandMultiple - A flag to decide if multiple accordion items can be open at the same time.\n * @property {boolean} _collapseAll - A flag to decide if all accordion items can be closed at the same time.\n * @property {number} _currentChild - The index of the current child node.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the accordion.\n * @property {string} _focusState - The current state of the accordion's focus.\n * @property {string} _currentEvent - The last type of event triggered within the accordion.\n * @property {string} _breakpoint - The breakpoint that the accordion will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the accordion.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the accordion.\n * @property {Object<Function>} _timeouts - Timeouts throughout the accordion.\n * @property {object[]} _listeners - Event listeners throughout the accordion.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the accordion.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the accordion.\n * @property {string} _name - The component name of the accordion.\n * @property {string} _id - The main ID of the accordion.\n * @property {boolean} _valid - The validity state of the accordion.\n * @property {boolean} _initialized - The initialized state of the accordion.\n * @property {Error[]} _errors - The errors found throughout the accordion.\n */\nclass Accordion extends Component {\n _rootDOMElement = \"accordion\";\n _optionalKeySupport = true;\n _expandMultiple = true;\n _collapseAll = true;\n _currentChild = 0;\n _storageKey = \"accordions\";\n _name = \"Accordion\";\n\n /**\n * Constructs a new `Accordion`.\n *\n * @param {object} options - The options for generating the accordion.\n * @param {HTMLElement} [options.accordionElement] - The accordion element in the DOM.\n * @param {string} [options.accordionItemsSelector = .accordion-item] - The query selector string for accordion items.\n * @param {string} [options.accordionItemTogglesSelector = .accordion-item-toggle] - The query selector string for accordion toggle.\n * @param {string} [options.accordionItemHeadersSelector = .accordion-item-header] - The query selector string for accordion header.\n * @param {string} [options.accordionItemContentsSelector = .accordion-item-content] - The query selector string for accordion content.\n * @param {string} [options.accordionControlContainerSelector = .accordion-control-container] - The query selector string for the accordion control container.\n * @param {string} [options.accordionControlsSelector = .accordion-control] - The query selector string for accordion controls.\n * @param {string} [options.expandControllerSelector = .expand-all] - The query selector string for the expand all controller(s).\n * @param {string} [options.collapseControllerSelector = .collapse-all] - The query selector string for the collapse all controller(s).\n * @param {?(string|string[])} [options.openClass = show] - The class to apply when a accordion is \"open\".\n * @param {?(string|string[])} [options.closeClass = hide] - The class to apply when a accordion is \"closed\".\n * @param {?(string|string[])} [options.transitionClass = transitioning] - The class to apply when a accordion is transitioning between \"open\" and \"closed\" states.\n * @param {number} [options.transitionDuration = 300] - The duration of the transition between \"open\" and \"closed\" states (in milliseconds).\n * @param {number} [options.openDuration = -1] - The duration of the transition from \"closed\" to \"open\" states (in milliseconds).\n * @param {number} [options.closeDuration = -1] - The duration of the transition from \"open\" to \"closed\" states (in milliseconds).\n * @param {boolean} [options.optionalKeySupport = false] - A flag to determine if accordions can be navigated with arrows.\n * @param {boolean} [options.allowExpandMultiple = true] - A flag to determine if multiple accordions can be open at the same time.\n * @param {boolean} [options.allowCollapseAll = true] - A flag to determine if no accordions can be open at the same time.\n * @param {boolean} [options.automaticActivation = false] - A flag to set if focusing a accordion item toggle will automatically activate it.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the accordion.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the accordion is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the accordion immediately upon creation.\n */\n constructor({\n accordionElement,\n accordionItemsSelector = \".accordion-item\",\n accordionItemTogglesSelector = \".accordion-item-toggle\",\n accordionItemHeadersSelector = \".accordion-item-header\",\n accordionItemContentsSelector = \".accordion-item-content\",\n accordionControlContainerSelector = \".accordion-control-container\",\n accordionControlsSelector = \".accordion-control\",\n expandControllerSelector = \".expand-all\",\n collapseControllerSelector = \".collapse-all\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 300,\n openDuration = -1,\n closeDuration = -1,\n optionalKeySupport = false,\n allowExpandMultiple = true,\n allowCollapseAll = true,\n automaticActivation = false,\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n }) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set DOM elements.\n this._dom.accordion = accordionElement;\n this._dom.accordionItems = [];\n this._dom.accordionItemToggles = [];\n this._dom.accordionItemHeaders = [];\n this._dom.accordionItemContents = [];\n this._dom.accordionControlContainer = null;\n this._dom.accordionControls = [];\n this._dom.expandController = [];\n this._dom.collapseController = [];\n\n // Set the query selectors.\n this._selectors.accordionItems = accordionItemsSelector;\n this._selectors.accordionItemToggles = accordionItemTogglesSelector;\n this._selectors.accordionItemHeaders = accordionItemHeadersSelector;\n this._selectors.accordionItemContents = accordionItemContentsSelector;\n this._selectors.accordionControlContainer =\n accordionControlContainerSelector;\n this._selectors.accordionControls = accordionControlsSelector;\n this._selectors.expandController = expandControllerSelector;\n this._selectors.collapseController = collapseControllerSelector;\n\n // Set the elements.\n this._elements.accordionItems = [];\n\n // Set the classes.\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.open = openDuration;\n this._durations.close = closeDuration;\n\n // Set automatic activation.\n this._automatic = automaticActivation;\n\n // Set optional key support.\n this._optionalKeySupport = optionalKeySupport;\n\n // Set expand rules.\n this._expandMultiple = allowExpandMultiple;\n this._collapseAll = allowCollapseAll;\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle enabling/disabling controls based on options.\n if (this.dom.expandController.length > 0 && !this.allowExpandMultiple) {\n this.dom.expandController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n if (this.dom.collapseController.length > 0 && !this.allowCollapseAll) {\n this.dom.collapseController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n automaticActivation: this._automatic,\n optionalKeySupport: this._optionalKeySupport,\n allowExpandMultiple: this._expandMultiple,\n allowCollapseAll: this._collapseAll,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans);\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply when the accordion is open.\n *\n * @type {string|string[]}\n *\n * @see _classes.open\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 when the accordion is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.close\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 when the accordion is transitioning between open and closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 duration time (in milliseconds) for the transition between open and closed states.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\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 will be used instead.\n *\n * @type {number}\n *\n * @see _durations.open\n */\n get openDuration() {\n return this._durations.open === -1\n ? this.transitionDuration\n : this._durations.open;\n }\n\n set openDuration(value) {\n isValidType(\"number\", { openDuration: value });\n\n if (this._durations.open !== value) {\n this._durations.open = value;\n this._setCustomProps();\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 will be used instead.\n *\n * @type {number}\n *\n * @see _durations.close\n */\n get closeDuration() {\n return this._durations.close === -1\n ? this.transitionDuration\n : this._durations.close;\n }\n\n set closeDuration(value) {\n isValidType(\"number\", { closeDuration: value });\n\n if (this._durations.close !== value) {\n this._durations.close = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The current index of the accordion item.\n *\n * @readonly\n *\n * @type {number}\n *\n * @see _currentChild\n */\n get currentChild() {\n return this._currentChild;\n }\n\n set currentChild(value) {\n isValidType(\"number\", { currentChild: value });\n\n if (\n this._currentChild !== value &&\n value >= 0 &&\n value < this.elements.accordionItems.length\n ) {\n this._currentChild = value;\n }\n }\n\n /**\n * A flag to decide if the accordion items can be navigated by arrows.\n *\n * @type {boolean}\n *\n * @see _optionalKeySupport\n */\n get optionalKeySupport() {\n return this._optionalKeySupport;\n }\n\n set optionalKeySupport(value) {\n isValidType(\"boolean\", { optionalKeySupport: value });\n\n if (this._optionalKeySupport !== value) {\n this._optionalKeySupport = value;\n }\n }\n\n /**\n * The currently selected accordion item.\n *\n * @readonly\n *\n * @type {AccordionItem}\n */\n get currentAccordionItem() {\n return this.elements.accordionItems[this.currentChild];\n }\n\n /**\n * The currently open accordion items.\n *\n * @readonly\n *\n * @type {AccordionItem[]}\n */\n get openAccordionItems() {\n return this.elements.accordionItems.filter((item) => item.isOpen);\n }\n\n /**\n * A flag to decide if multiple accordion items can be open at the same time.\n *\n * @type {boolean}\n *\n * @see _expandMultiple\n */\n get allowExpandMultiple() {\n return this._expandMultiple;\n }\n\n set allowExpandMultiple(value) {\n isValidType(\"boolean\", { allowExpandMultiple: value });\n\n if (this._expandMultiple !== value) {\n this._expandMultiple = value;\n\n if (this.dom.expandController.length > 0) {\n if (value) {\n this.dom.expandController.forEach((control) => {\n control.removeAttribute(\"disabled\");\n });\n } else {\n this.dom.expandController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n }\n }\n\n /**\n * A flag to decide if all accordion items can be closed at the same time.\n *\n * @type {boolean}\n *\n * @see _collapseAll\n */\n get allowCollapseAll() {\n return this._collapseAll;\n }\n\n set allowCollapseAll(value) {\n isValidType(\"boolean\", { allowCollapseAll: value });\n\n if (this._collapseAll !== value) {\n this._collapseAll = value;\n\n if (this.dom.collapseController.length > 0) {\n if (value) {\n this.dom.collapseController.forEach((control) => {\n control.removeAttribute(\"disabled\");\n });\n } else {\n this.dom.collapseController.forEach((control) => {\n control.setAttribute(\"disabled\", \"disabled\");\n });\n }\n }\n }\n }\n\n /**\n * Sets the IDs of the accordion and it's children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - accordion: `accordion-${key}`\n *\n * @protected\n */\n _setIds() {\n this.dom.accordion.id = this.dom.accordion.id || `accordion-${this.key}`;\n\n this._id = this.dom.accordion.id;\n }\n\n /**\n * Sets custom props throughout the accordion.\n *\n * The custom properties are:\n * - `--graupl-accordion-transition-duration`,\n * - `--graupl-accordion-open-transition-duration`, and\n * - `--graupl-accordion-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the accordion's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.accordion.style.setProperty(\n `--${this.prefix}accordion-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n /**\n * Sets all DOM elements within the accordion.\n *\n * Utilizes _setDOMElementType and\n * _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"accordionItems\", { context: this.dom.accordion });\n this._resetDOMElementType(\"accordionItemToggles\");\n this._setDOMElementType(\"accordionControlContainer\", {\n context: this.dom.accordion,\n });\n\n if (this.dom.accordionControlContainer) {\n this._setDOMElementType(\"accordionControls\", {\n context: this.dom.accordionControlContainer,\n });\n this._setDOMElementType(\"expandController\", {\n context: this.dom.accordionControlContainer,\n });\n this._setDOMElementType(\"collapseController\", {\n context: this.dom.accordionControlContainer,\n });\n }\n\n this.dom.accordionItems.forEach((accordionItem) => {\n this._setDOMElementType(\"accordionItemToggles\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n this._setDOMElementType(\"accordionItemHeaders\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n this._setDOMElementType(\"accordionItemContents\", {\n context: accordionItem,\n overwrite: false,\n strict: false,\n });\n });\n }\n\n /**\n * Creates and initializes all accordion items.\n *\n * @protected\n */\n _createChildElements() {\n this.dom.accordionItems.forEach((accordionItem, index) => {\n const item = new AccordionItem({\n accordionItemElement: accordionItem,\n accordionItemToggleElement: this.dom.accordionItemToggles[index],\n accordionItemHeaderElement: this.dom.accordionItemHeaders[index],\n accordionItemContentElement: this.dom.accordionItemContents[index],\n parentAccordion: this,\n });\n\n item.initialize();\n\n this.elements.accordionItems.push(item);\n });\n }\n\n /**\n * Handles focus events throughout the accordion for proper use.\n *\n * - Adds a `focus` listener to every accordion item so when it gains focus,\n * it will set the accordion's current child to the index of the item.\n *\n * @protected\n */\n _handleFocus() {\n this.elements.accordionItems.forEach((accordionItem, index) => {\n this._addEventListener(\"focus\", accordionItem.dom.toggle, () => {\n this.currentChild = index;\n });\n });\n }\n\n /**\n * Handles click events throughout the accordion item for proper use.\n *\n * - Adds a `click` listener to the accordion item toggles that will toggle each accordion item.\n *\n * @protected\n */\n _handleClick() {\n this.elements.accordionItems.forEach((accordionItem, index) => {\n this._addEventListener(\"click\", accordionItem.dom.toggle, () => {\n this.currentChild = index;\n this.currentEvent = \"mouse\";\n accordionItem.toggle();\n });\n });\n\n // Clicks for the accordion controls.\n this.dom.expandController.forEach((control) => {\n this._addEventListener(\"click\", control, () => {\n this.currentEvent = \"mouse\";\n if (this.allowExpandMultiple) {\n this.openChildren();\n }\n });\n });\n this.dom.collapseController.forEach((control) => {\n this._addEventListener(\"click\", control, () => {\n this.currentEvent = \"mouse\";\n if (this.allowCollapseAll) {\n this.closeChildren();\n }\n });\n });\n }\n\n /**\n * Handles keydown events throughout the accordion item for proper use.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to all accordion item toggles.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n * - _If_ optionalKeySupport is enabled, blocks propagation on the following keys:\n * - \"ArrowDown\", \"ArrowUp\", \"Home\", and \"End\".\n * - Adds a `keydown` listener to all accordion controls.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n */\n _handleKeydown() {\n this.dom.accordionItemToggles.forEach((accordionToggle) => {\n this._addEventListener(\"keydown\", accordionToggle, (event) => {\n const key = keyPress(event);\n const toggleKeys = [\"Space\", \"Enter\"];\n\n if (toggleKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n } else if (this.optionalKeySupport) {\n const optionalKeys = [\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"];\n\n if (optionalKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n }\n }\n });\n });\n\n this.dom.accordionControls.forEach((control) => {\n this._addEventListener(\"keydown\", control, (event) => {\n const key = keyPress(event);\n const controllerKeys = [\"Space\", \"Enter\"];\n\n if (controllerKeys.includes(key)) {\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n }\n });\n });\n }\n\n /**\n * Handles keyup events throughout the accordion item for proper use.\n *\n * Adds the follow keybindings (explanations are taken from the WAI ARIA Practices Guide Accordion Pattern):\n *\n * - `Enter` or `Space`:\n * - When focus is on the accordion header for a collapsed panel, expands the associated panel. If the implementation allows only one panel to be expanded, and if another panel is expanded, collapses that panel.\n * - When focus is on the accordion header for an expanded panel, collapses the panel if the implementation supports collapsing. Some implementations require one panel to be expanded at all times and allow only one panel to be expanded; so, they do not support a collapse function.\n * - When focus is on the accordion expand all control, expands all panels. If the implementation allows only one panel to be expanded, does nothing.\n * - WHen focus is on the accordion collapse all control, collapses all panels. If the implementation requires one panel to be expanded at all times, does nothing.\n * - `Accordion`: Moves focus to the next focusable element; all focusable elements in the accordion are included in the page `Accordion` sequence.\n * - `Shift + Accordion`: Moves focus to the previous focusable element; all focusable elements in the accordion are included in the page `Accordion` sequence.\n * - `Down Arrow` (Optional): If focus is on an accordion header, moves focus to the next accordion header. If focus is on the last accordion header, either does nothing or moves focus to the first accordion header.\n * - `Up Arrow` (Optional): If focus is on an accordion header, moves focus to the previous accordion header. If focus is on the first accordion header, either does nothing or moves focus to the last accordion header.\n * - `Home` (Optional): When focus is on an accordion header, moves focus to the first accordion header.\n * - `End` (Optional): When focus is on an accordion header, moves focus to the last accordion header.\n *\n * Note: When the above explanations mention \"accordion header\", they are referring to the accordion item toggle.\n */\n _handleKeyup() {\n this.dom.accordionItemToggles.forEach((accordionToggle) => {\n this._addEventListener(\"keyup\", accordionToggle, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n this.currentAccordionItem.toggle();\n\n break;\n }\n\n if (this.optionalKeySupport) {\n switch (key) {\n case \"Home\":\n preventEvent(event);\n this.focusFirstChild();\n\n break;\n case \"End\":\n preventEvent(event);\n this.focusLastChild();\n\n break;\n case \"ArrowDown\":\n preventEvent(event);\n this.focusNextChild();\n\n break;\n case \"ArrowUp\":\n preventEvent(event);\n this.focusPreviousChild();\n\n break;\n }\n }\n });\n });\n\n this.dom.expandController.forEach((control) => {\n this._addEventListener(\"keyup\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n\n if (this.allowExpandMultiple) {\n this.openChildren();\n }\n }\n });\n });\n\n this.dom.collapseController.forEach((control) => {\n this._addEventListener(\"keyup\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n this.currentEvent = \"keyboard\";\n\n if (this.allowCollapseAll) {\n this.closeChildren();\n }\n }\n });\n });\n }\n\n /**\n * Focus the accordion's current child.\n */\n focusCurrentChild() {\n if (this.currentChild !== -1) {\n this.currentAccordionItem.focus();\n }\n }\n\n /**\n * Focuses the accordion's child at a given index.\n *\n * @param {number} index - The index of the child to focus.\n */\n focusChild(index) {\n this.blurCurrentChild();\n this.currentChild = index;\n this.focusCurrentChild();\n }\n\n /**\n * Focuses the accordion's first child.\n */\n focusFirstChild() {\n this.focusChild(0);\n }\n\n /**\n * Focus the accordion's last child.\n */\n focusLastChild() {\n this.focusChild(this.elements.accordionItems.length - 1);\n }\n\n /**\n * Focus the accordion's next child.\n */\n focusNextChild() {\n if (this.currentChild < this.elements.accordionItems.length - 1) {\n this.focusChild(this.currentChild + 1);\n } else {\n this.focusCurrentChild();\n }\n }\n\n /**\n * Focus the accordion's previous child.\n */\n focusPreviousChild() {\n if (this.currentChild > 0) {\n this.focusChild(this.currentChild - 1);\n } else {\n this.focusCurrentChild();\n }\n }\n\n /**\n * Blurs the accordion's current child.\n */\n blurCurrentChild() {\n if (this.currentChild !== -1) {\n this.currentAccordionItem.blur();\n }\n }\n\n /**\n * Open all accordion items.\n */\n openChildren() {\n this.elements.accordionItems.forEach((item) => item.show());\n }\n\n /**\n * Close all accordion items.\n */\n closeChildren() {\n this.elements.accordionItems.forEach((item) => item.hide());\n }\n}\n\nexport default Accordion;\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 Accordion from \"./Accordion.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n accordionSelector = \".accordion\"\n) => {\n once(\"graupl-accordion-generator\", accordionSelector, context).forEach(\n (accordionElement) => {\n const accordionOptions = accordionElement.dataset.grauplAccordionOptions\n ? JSON.parse(\n accordionElement.dataset.grauplAccordionOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Accordion({\n accordionElement,\n initialize: true,\n ...options,\n ...accordionOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Alert class.\n */\n\nimport { isValidClassList, isValidType } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * @event grauplAlertShow\n * Fired when the alert is shown.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<Alert>} detail - The detail object.\n * @property {Alert} detail.alert - The alert that was shown.\n */\n\n/**\n * @event grauplAlertHide\n * Fired when the alert is hidden.\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - Whether the event bubbles.\n * @property {Object<Alert>} detail - The detail object.\n * @property {Alert} detail.alert - The alert that was hidden.\n */\n\n/**\n * The Alert component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the alert.\n * @property {HTMLElement} _dom.alert - The alert element.\n * @property {HTMLElement} _dom.controller - The alert controller element.\n * @property {string} _rootDOMElement - The root DOM element of the alert.\n * @property {string[]} _protectedDOMElements - The DOM elements within the alert that cannot be reset or generated by the alert itself.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the alert is in various states.\n * @property {string|string[]} _classes.show - The class(es) to apply when the alert is shown.\n * @property {string|string[]} _classes.hide - The class(es) to apply when the alert is hidden.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the alert is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the alert is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the alert.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between shown and hidden states.\n * @property {number} _durations.show - The duration time (in milliseconds) for the transition from hidden to shown states.\n * @property {number} _durations.hide - The duration time (in milliseconds) for the transition from shown to hidden states.\n * @property {TransactionalValue<boolean>} _hidden - The hidden state of the alert.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the alert.\n * @property {grauplAlertShow} _events.show - The event triggered when the alert is shown.\n * @property {grauplAlertHide} _events.hide - The event triggered when the alert is hidden.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<string>} _selectors - The query selectors used by the alert.\n * @property {Object<Alert>} _elements - The instantiated elements within the alert.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the alert.\n * @property {string} _focusState - The current state of the alert's focus.\n * @property {string} _currentEvent - The last type of event triggered within the alert.\n * @property {string} _breakpoint - The breakpoint that the alert will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the alert.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the alert.\n * @property {Object<Function>} _timeouts - Timeouts throughout the alert.\n * @property {object[]} _listeners - Event listeners throughout the alert.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the alert.\n * @property {string} _name - The component name of the alert.\n * @property {string} _id - The main ID of the alert.\n * @property {boolean} _valid - The validity state of the alert.\n * @property {boolean} _initialized - The initialized state of the alert.\n * @property {string[]} _errors - The errors found throughout the alert.\n */\nclass Alert extends Component {\n _rootDOMElement = \"alert\";\n _protectedDOMElements = [\"controller\"];\n _hidden = new TransactionalValue(false);\n _storageKey = \"alerts\";\n _name = \"Alert\";\n\n /**\n * Constructs a new `Alert`.\n *\n * @param {object} [options = {}] - The options object.\n * @param {HTMLElement} options.alertElement - The alert element.\n * @param {?HTMLElement} [options.controllerElement = null] - The controller element.\n * @param {string|string[]|null} [options.showClass = show] - The class(es) to apply when the alert is shown.\n * @param {string|string[]|null} [options.hideClass = hide] - The class(es) to apply when the alert is hidden.\n * @param {string|string[]|null} [options.transitionClass = transitioning] - The class(es) to apply when the alert is transitioning between states.\n * @param {number} [options.transitionDuration = 150] - The duration of the transition between \"shown\" and \"hidden\" states (in milliseconds).\n * @param {boolean} [options.showDuration = -1] - The duration of the transition from \"hidden\" to \"shown\" states (in milliseconds).\n * @param {boolean} [options.hideDuration = -1] - The duration of the transition from \"shown\" to \"hidden\" states (in milliseconds).\n * @param {boolean} [options.isHidden = false] - A flag to determine the initial state of the alert.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the alert.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the alert is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the alert immediately upon creation.\n */\n constructor({\n alertElement,\n controllerElement = null,\n showClass = \"show\",\n hideClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 150,\n showDuration = -1,\n hideDuration = -1,\n isHidden = false,\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n } = {}) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set the DOM elements.\n this._dom.alert = alertElement;\n this._dom.controller = controllerElement;\n\n // Set the classes.\n this._classes.show = showClass || \"\";\n this._classes.hide = hideClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.show = showDuration;\n this._durations.hide = hideDuration;\n\n // Set hidden.\n this._hidden.value = isHidden;\n this._hidden.commit();\n\n // Register custom events.\n this._registerEvent(\"show\", {\n detail: {\n alert: this,\n },\n });\n this._registerEvent(\"hide\", {\n detail: {\n alert: this,\n },\n });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle hiding the alert by default.\n if (this.isHidden) {\n this._conceal({ emit: false, transition: false });\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n isHidden: this._hidden.value,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class to use to show the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.show\n */\n get showClass() {\n return this._classes.show;\n }\n\n set showClass(value) {\n isValidClassList({ showClass: value });\n\n if (this._classes.show !== value) {\n this._classes.show = value;\n }\n }\n\n /**\n * The class to use to hide the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.hide\n */\n get hideClass() {\n return this._classes.hide;\n }\n\n set hideClass(value) {\n isValidClassList({ hideClass: value });\n\n if (this._classes.hide !== value) {\n this._classes.hide = value;\n }\n }\n\n /**\n * The class to use when transitioning the alert.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 time in milliseconds the transition will take.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from hidden to shown states.\n *\n * If showDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --graupl-show-transition-duration CSS custom property on the alert.\n *\n * @type {number}\n *\n * @see _durations.show\n */\n get showDuration() {\n if (this._durations.show === -1) return this.transitionDuration;\n\n return this._durations.show;\n }\n\n set showDuration(value) {\n isValidType(\"number\", { showDuration: value });\n\n if (this._durations.show !== value) {\n this._durations.show = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition from shown to hidden states.\n *\n * If hideDuration is set to -1, the transitionDuration value will be used instead.\n *\n * Setting this value will also set the --graupl-close-transition-duration CSS custom property on the alert.\n *\n * @type {number}\n *\n * @see _durations.hide\n */\n get hideDuration() {\n if (this._durations.hide === -1) return this.transitionDuration;\n\n return this._durations.hide;\n }\n\n set hideDuration(value) {\n isValidType(\"number\", { hideDuration: value });\n\n if (this._durations.hide !== value) {\n this._durations.hide = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The hidden state of the alert.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _hidden\n */\n get isHidden() {\n return this._hidden.value;\n }\n\n /**\n * Sets the IDs of the alert and its children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - alert: `alert-${key}`\n * - controller: `alert-controller-${key}`\n */\n _setIds() {\n this.dom.alert.id = this.dom.alert.id || `alert-${this.key}`;\n this.dom.controller.id =\n this.dom.controller.id || `alert-controller-${this.key}`;\n\n this._id = this.dom.alert.id;\n }\n\n /**\n * Reveals the alert.\n *\n * Adds the show class and removes the hide class from the alert.\n *\n * @protected\n *\n * @fires grauplAlertShow\n *\n * @param {Object<boolean>} [options = {}] - Options for revealing the alert.\n * @param {boolean} [options.emit = true] - Emit the show event once revealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _reveal({ emit = true, transition = true } = {}) {\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the hide class,\n // add the show class, and finally remove the transition class.\n if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n removeClass(this.hideClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n addClass(this.showClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n this._setTimeout(\n () => removeClass(this.transitionClass, this.dom.alert),\n this.showDuration\n );\n });\n });\n });\n } else {\n // Add the show class\n addClass(this.showClass, this.dom.alert);\n\n // Remove the hide class.\n removeClass(this.hideClass, this.dom.alert);\n }\n\n this.dom.alert.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"show\", this.dom.alert);\n }\n }\n\n /**\n * Conceals the alert.\n *\n * Adds the hide class and removes the show class from the alert.\n *\n * @protected\n *\n * @fires grauplAlertHide\n *\n * @param {Object<boolean>} [options = {}] - Options for concealing the alert.\n * @param {boolean} [options.emit = true] - Emit the show event once concealed.\n * @param {boolean} [options.transition = true] - Respect the transition class.\n */\n _conceal({ emit = true, transition = true } = {}) {\n // If we're dealing with transition classes, then we need to utilize\n // requestAnimationFrame to add the transition class, remove the show class,\n // add the hide class, and finally remove the transition class.\n if (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n removeClass(this.showClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n addClass(this.hideClass, this.dom.alert);\n\n requestAnimationFrame(() => {\n this._setTimeout(\n () => removeClass(this.transitionClass, this.dom.alert),\n this.hideDuration\n );\n });\n });\n });\n } else {\n // Add the hide class\n addClass(this.hideClass, this.dom.alert);\n\n // Remove the show class.\n removeClass(this.showClass, this.dom.alert);\n }\n\n this.dom.alert.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"hide\", this.dom.alert);\n }\n }\n\n /**\n * Sets custom props throughout the alert.\n *\n * The custom properties are:\n * - `--graupl-alert-transition-duration`,\n * - `--graupl-alert-show-transition-duration`, and\n * - `--graupl-alert-hide-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the alert's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-show-transition-duration`,\n `${this.showDuration}ms`\n );\n\n this.dom.alert.style.setProperty(\n `--${this.prefix}alert-hide-transition-duration`,\n `${this.hideDuration}ms`\n );\n }\n\n /**\n * Handles click events throughout the alert for proper use.\n *\n * - Adds a `click` listener to the controller that will hide the alert.\n *\n * @protected\n */\n _handleClick() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"click\", this.dom.controller, () => this.hide());\n }\n\n /**\n * Handles keydown events throughout the alert for proper use.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to the controller (if it exists).\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n */\n _handleKeydown() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"keydown\", this.dom.controller, (event) => {\n const key = keyPress(event);\n\n // Prevent default behavior for space and enter keys.\n if (key === \"Space\" || key === \"Enter\") {\n preventEvent(event);\n }\n });\n }\n\n /**\n * Handles keyup events throughout the alert for proper use.\n *\n * - Adds a `keyup` listener to the controller (if it exists).\n * - Hides the alert when the user hits \"Space\" or \"Enter\".\n */\n _handleKeyup() {\n if (this.dom.controller === null) {\n return;\n }\n\n this._addEventListener(\"keyup\", this.dom.controller, (event) => {\n const key = keyPress(event);\n\n if (key === \"Space\" || key === \"Enter\") {\n this.hide();\n }\n });\n }\n\n /**\n * Shows the alert.\n *\n * Sets the alert's focus state to \"self\", calls reveal, and sets isHidden to `false`.\n *\n * @param {Object<boolean>} [options = {}] - Options for showing the alert.\n * @param {boolean} [options.force = false] - Whether to force the show action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the hidden state.\n */\n show({ force = false, preserveState = false } = {}) {\n if (!this.isHidden && !force) return;\n\n // Set the focus state.\n this.focusState = \"self\";\n\n // Reveal the alert.\n this._reveal();\n\n // Set the hidden state.\n this._hidden.value = false;\n\n if (!preserveState) {\n this._hidden.commit();\n }\n }\n\n /**\n * Hides the alert.\n *\n * Sets the alert's focus state to \"none\", calls conceal, and sets isHidden to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for hiding the alert.\n * @param {boolean} [options.force = false] - Whether to force the hide action.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the hidden state.\n */\n hide({ force = false, preserveState = false } = {}) {\n if (this.isHidden && !force) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Conceal the alert.\n this._conceal();\n\n // Set the hidden state.\n this._hidden.value = true;\n\n if (!preserveState) {\n this._hidden.commit();\n }\n }\n}\n\nexport default Alert;\n","import Alert from \"./Alert.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n alertSelector = \".alert\"\n) => {\n once(\"graupl-alert-generator\", alertSelector, context).forEach(\n (alertElement) => {\n const alertOptions = alertElement.dataset.grauplAlertOptions\n ? JSON.parse(\n alertElement.dataset.grauplAlertOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Alert({\n alertElement,\n controllerElement:\n alertElement.querySelector(\".alert-dismisser\") || null,\n initialize: true,\n ...options,\n ...alertOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Carousel class.\n */\n\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { preventEvent, keyPress } from \"../eventHandlers.js\";\nimport { isTag, isValidClassList, isValidType } from \"../validate.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The Carousel component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement, HTMLElement[]>} _dom - The DOM elements within the carousel.\n * @property {HTMLElement} _dom.carousel - The carousel element.\n * @property {HTMLElement[]} _dom.carouselItems - The carousel items.\n * @property {HTMLElement} _dom.carouselItemContainer - The carousel item container.\n * @property {HTMLElement[]} _dom.carouselControls - The carousel controls.\n * @property {HTMLElement} _dom.carouselControlContainer - The carousel control container.\n * @property {HTMLElement[]} _dom.carouselTabs - The carousel tabs.\n * @property {HTMLElement} _dom.carouselTabContainer - The carousel tab container.\n * @property {HTMLElement} _dom.autoplay - The autoplay button.\n * @property {HTMLElement} _dom.next - The next button.\n * @property {HTMLElement} _dom.previous - The previous button.\n * @property {string} _rootDOMElement - The root DOM element of the carousel.\n * @property {string[]} _protectedDOMElements - The DOM elements within the carousel that cannot be reset or generated by the carousel itself.\n * @property {Object<string>} _selectors - The query selectors used by the carousel.\n * @property {string} _selectors.carouselItems - The query selector string for carousel items.\n * @property {string} _selectors.carouselItemContainer - The query selector string for the carousel item container.\n * @property {string} _selectors.carouselControls - The query selector string for carousel controls.\n * @property {string} _selectors.carouselControlContainer - The query selector string for the carousel control container.\n * @property {string} _selectors.carouselTabs - The query selector string for the carousel tabs.\n * @property {string} _selectors.carouselTabContainer - The query selector string for the carousel tab container.\n * @property {string} _selectors.autoplay - The query selector string for the autoplay button.\n * @property {string} _selectors.next - The query selector string for the next button.\n * @property {string} _selectors.previous - The query selector string for the previous button.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the carousel is in various states.\n * @property {string|string[]} _classes.active - The class(es) to apply when a carousel item is active.\n * @property {string|string[]} _classes.previous - The class(es) to apply to a carousel item that is the previously active item.\n * @property {string|string[]} _classes.next - The class(es) to apply to a carousel item that is the next active item.\n * @property {string|string[]} _classes.play - The class(es) to apply to the autoplay button when the carousel is paused.\n * @property {string|string[]} _classes.pause - The class(es) to apply to the autoplay button when the carousel is playing.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the carousel is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the carousel.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between carousel items.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the carousel.\n * @property {number} _delays.transition - The delay time (in milliseconds) for the transition between carousel items.\n * @property {number} _currentItem - The index of the currently active carousel item.\n * @property {boolean} _autoplay - A flag to indicate if the carousel is currently playing.\n * @property {string} _playText - The label for the autoplay button when the carousel is paused.\n * @property {string} _pauseText - The label for the autoplay button when the carousel is playing.\n * @property {string} _currentAction - The current action being performed by the carousel.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the carousel.\n * @property {Object<object>} _elements - The instantiated elements within the carousel.\n * @property {string} _focusState - The current state of the carousel's focus.\n * @property {string} _currentEvent - The last type of event triggered within the carousel.\n * @property {string} _breakpoint - The breakpoint that the carousel will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the carousel.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {Object<Function>} _intervals - Intervals throughout the carousel.\n * @property {Object<Function>} _timeouts - Timeouts throughout the carousel.\n * @property {object[]} _listeners - Event listeners throughout the carousel.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the carousel.\n * @property {string} _name - The component name of the carousel.\n * @property {string} _id - The main ID of the carousel.\n * @property {boolean} _valid - The validity state of the carousel.\n * @property {boolean} _initialized - The initialized state of the carousel.\n * @property {string[]} _errors - The errors found throughout the carousel.\n */\nclass Carousel extends Component {\n _rootDOMElement = \"carousel\";\n _currentItem = 0;\n _autoplay = true;\n _playText = \"Play\";\n _pauseText = \"Pause\";\n _currentAction = \"next\";\n _storageKey = \"carousels\";\n _name = \"Carousel\";\n\n /**\n * Constructs a new `Carousel`.\n *\n * @param {object} options - The options for the generated carousel.\n * @param {HTMLElement} options.carouselElement - The carousel element in the DOM.\n * @param {string} [options.carouselItemsSelector = .carousel-item] - The query selector string for carousel items.\n * @param {string} [options.carouselItemContainerSelector = .carousel-item-container] - The query selector string for the carousel item container.\n * @param {string} [options.carouselControlsSelector = .carousel-control] - The query selector string for carousel controls.\n * @param {string} [options.carouselControlContainerSelector = .carousel-control-container] - The query selector string for carousel control container.\n * @param {string} [options.carouselTabsSelector = .carousel-tab] - The query selector string for carousel tabs.\n * @param {string} [options.carouselTabContainerSelector = .carousel-tab-container] - The query selector string for the carousel tab container.\n * @param {string} [options.autoplaySelector = .autoplay] - The query selector string for the autoplay button.\n * @param {string} [options.nextSelector = .next] - The query selector string for the next button.\n * @param {string} [options.previousSelector = .previous] - The query selector string for the previous button.\n * @param {?(string|string[])} [options.activeClass = active] - The class(es) to apply when a carousel item is active.\n * @param {?(string|string[])} [options.previousClass = previous] - The class(es) to apply to a carousel item that is the previously active item.\n * @param {?(string|string[])} [options.nextClass = next] - The class(es) to apply to a carousel item that is the next active item.\n * @param {?(string|string[])} [options.playClass = play] - The class(es) to apply to the autoplay button when the carousel is paused.\n * @param {?(string|string[])} [options.pauseClass = pause] - The class(es) to apply to the autoplay button when the carousel is playing.\n * @param {boolean} [options.autoplay = true] - A flag to indicate if the carousel should autoplay.\n * @param {number} [options.transitionDelay = 10000] - A flag to initialize the carousel immediately upon creation.\n * @param {number} [options.transitionDuration = 500] - The duration time (in milliseconds) for the transition between carousel items.\n * @param {?string} [options.playText = Play] - The text to use for the play button.\n * @param {?string} [options.pauseText = Pause] - The text to use for the pause button.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the carousel.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the carousel is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the carousel immediately upon creation.\n */\n constructor({\n carouselElement,\n carouselItemsSelector = \".carousel-item\",\n carouselItemContainerSelector = \".carousel-item-container\",\n carouselControlsSelector = \".carousel-control\",\n carouselControlContainerSelector = \".carousel-control-container\",\n carouselTabsSelector = \".carousel-tab\",\n carouselTabContainerSelector = \".carousel-tab-container\",\n autoplaySelector = \".autoplay\",\n nextSelector = \".next\",\n previousSelector = \".previous\",\n activeClass = \"active\",\n previousClass = \"previous\",\n nextClass = \"next\",\n playClass = \"play\",\n pauseClass = \"pause\",\n autoplay = true,\n transitionDelay = 10000,\n transitionDuration = 500,\n playText = \"Play\",\n pauseText = \"Pause\",\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n }) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set DOM elements.\n this._dom.carousel = carouselElement;\n this._dom.carouselItems = [];\n this._dom.carouselItemContainer = null;\n this._dom.carouselControls = [];\n this._dom.carouselControlContainer = null;\n this._dom.carouselTabs = [];\n this._dom.carouselTabContainer = null;\n this._dom.autoplay = null;\n this._dom.next = null;\n this._dom.previous = null;\n\n // Set query selectors.\n this._selectors.carouselItems = carouselItemsSelector;\n this._selectors.carouselItemContainer = carouselItemContainerSelector;\n this._selectors.carouselControls = carouselControlsSelector;\n this._selectors.carouselControlContainer = carouselControlContainerSelector;\n this._selectors.carouselTabs = carouselTabsSelector;\n this._selectors.carouselTabContainer = carouselTabContainerSelector;\n this._selectors.autoplay = autoplaySelector;\n this._selectors.next = nextSelector;\n this._selectors.previous = previousSelector;\n\n // Set class names.\n this._classes.active = activeClass || \"\";\n this._classes.previous = previousClass || \"\";\n this._classes.next = nextClass || \"\";\n this._classes.play = playClass || \"\";\n this._classes.pause = pauseClass || \"\";\n\n // Set flags.\n this._autoplay = autoplay;\n\n // Set transition options.\n this._delays.transition = transitionDelay;\n this._durations.transition = transitionDuration;\n\n // Set labels.\n this._playText = playText || \"\";\n this._pauseText = pauseText || \"\";\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle events.\n this._handleAutoplay();\n\n // Activate the first item.\n this.activateFirstItem();\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n autoplay: this._autoplay,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n\n // String checks.\n const strings = {\n playText: this._playText,\n pauseText: this._pauseText,\n };\n\n // Check the strings.\n const stringChecks = isValidType(\"string\", strings, {\n shouldThrow: false,\n });\n\n // Handle string check failures.\n if (!stringChecks.status) {\n this._errors = [...this._errors, ...stringChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply when a carousel item is active.\n *\n * @type {string|string[]}\n *\n * @see _classes.active\n */\n get activeClass() {\n return this._classes.active;\n }\n\n set activeClass(value) {\n isValidClassList({ activeClass: value });\n\n if (this._classes.active !== value) {\n this._classes.active = value;\n }\n }\n\n /**\n * The class(es) to apply to a carousel item that is the next active item.\n *\n * @type {string|string[]}\n *\n * @see _classes.previous\n */\n get previousClass() {\n return this._classes.previous;\n }\n\n set previousClass(value) {\n isValidClassList({ previousClass: value });\n\n if (this._classes.previous !== value) {\n this._classes.previous = value;\n }\n }\n\n /**\n * The class(es) to apply to a carousel item that is the next active item.\n *\n * @type {string|string[]}\n *\n * @see _classes.next\n */\n get nextClass() {\n return this._classes.next;\n }\n\n set nextClass(value) {\n isValidClassList({ nextClass: value });\n\n if (this._classes.next !== value) {\n this._classes.next = value;\n }\n }\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is paused.\n *\n * @type {string|string[]}\n *\n * @see _classes.play\n */\n get playClass() {\n return this._classes.play;\n }\n\n set playClass(value) {\n isValidClassList({ playClass: value });\n\n if (this._classes.play !== value) {\n this._classes.play = value;\n }\n }\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is playing.\n *\n * @type {string|string[]}\n *\n * @see _classes.pause\n */\n get pauseClass() {\n return this._classes.pause;\n }\n\n set pauseClass(value) {\n isValidClassList({ pauseClass: value });\n\n if (this._classes.pause !== value) {\n this._classes.pause = value;\n }\n }\n\n /**\n * The index of the currently active carousel item.\n *\n * @type {number}\n *\n * @see _currentItem\n */\n get currentItem() {\n return this._currentItem;\n }\n\n set currentItem(value) {\n isValidType(\"number\", { currentItem: value });\n\n if (value === this.currentItem) {\n return;\n }\n\n if (value < 0) {\n this._currentItem = 0;\n } else if (value >= this.dom.carouselItems.length) {\n this._currentItem = this.dom.carouselItems.length - 1;\n } else {\n this._currentItem = value;\n }\n\n // Keep the aria selected in sync with the current item.\n const tabs = this._dom.carousel.querySelectorAll(\n this.selectors.carouselTab\n );\n if (tabs) {\n this.dom.carouselItems.forEach((item, index) => {\n item.setAttribute(\"aria-selected\", index === this._currentItem);\n });\n }\n }\n\n /**\n * The currently active carousel item.\n *\n * @readonly\n *\n * @type {HTMLElement}\n */\n get currentCarouselItem() {\n return this.dom.carouselItems[this.currentItem];\n }\n\n /**\n * The currently active carousel tab.\n *\n * @readonly\n *\n * @type {HTMLElement}\n */\n get currentCarouselTab() {\n return this.dom.carouselTabs[this.currentItem];\n }\n\n /**\n * A flag to indicate if the carousel is currently playing.\n *\n * @type {boolean}\n *\n * @see _autoplay\n */\n get autoplay() {\n return this._autoplay;\n }\n\n set autoplay(value) {\n isValidType(\"boolean\", { autoplay: value });\n\n if (this._autoplay !== value) {\n this._autoplay = value;\n }\n }\n\n /**\n * The delay in milliseconds before transitioning slides.\n *\n * @type {number}\n *\n * @see _delays.transition\n */\n get transitionDelay() {\n return this._delays.transition;\n }\n\n set transitionDelay(value) {\n isValidType(\"number\", { transitionDelay: value });\n\n if (value !== this.transitionDelay && value >= 0) {\n this._delays.transition = value;\n }\n }\n\n /**\n * The duration time (in milliseconds) for the transition between carousel items.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value && value >= 0) {\n this._durations.transition = value;\n this._setTransitionDuration();\n }\n }\n\n /**\n * The label for the autoplay button when the carousel is paused.\n *\n * @type {string}\n *\n * @see _playText\n */\n get playText() {\n return this._playText;\n }\n\n set playText(value) {\n isValidType(\"string\", { playText: value });\n\n if (this._playText !== value) {\n this._playText = value;\n }\n }\n\n /**\n * The label for the autoplay button when the carousel is playing.\n *\n * @type {string}\n *\n * @see _pauseText\n */\n get pauseText() {\n return this._pauseText;\n }\n\n set pauseText(value) {\n isValidType(\"string\", { pauseText: value });\n\n if (this._pauseText !== value) {\n this._pauseText = value;\n }\n }\n\n /**\n * The current action being performed by the carousel.\n *\n * @type {string}\n *\n * @see _currentAction\n */\n get currentAction() {\n return this._currentAction;\n }\n\n /**\n * Sets all DOM elements within the carousel.\n *\n * Utilizes _setDOMElementType and _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._setDOMElementType(\"carouselItemContainer\", {\n context: this.dom.carousel,\n });\n this._setDOMElementType(\"carouselControlContainer\", {\n context: this.dom.carousel,\n });\n this._setDOMElementType(\"carouselTabContainer\", {\n context: this.dom.carousel,\n });\n\n if (this.dom.carouselItemContainer) {\n this._setDOMElementType(\"carouselItems\", {\n context: this.dom.carouselItemContainer,\n });\n }\n if (this.dom.carouselControlContainer) {\n this._setDOMElementType(\"carouselControls\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"autoplay\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"next\", {\n context: this.dom.carouselControlContainer,\n });\n this._setDOMElementType(\"previous\", {\n context: this.dom.carouselControlContainer,\n });\n }\n\n if (this._dom.carouselTabContainer) {\n this._setDOMElementType(\"carouselTabs\", {\n context: this.dom.carouselTabContainer,\n });\n }\n }\n\n /**\n * Sets the IDs of the carousel and its children if they do not already exist.\n *\n * The generated IDs use the key and follow the format:\n * - carousel: `carousel-${key}`\n * - carousel items: `carousel-item-${key}-${index}`\n * - carousel tabs: `carousel-tab-${key}-${index}`\n */\n _setIds() {\n this.dom.carousel.id = this.dom.carousel.id || `carousel-${this.key}`;\n\n this.dom.carouselItems.forEach((item, index) => {\n item.id = item.id || `carousel-item-${this.key}-${index}`;\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n tab.id = tab.id || `carousel-tab-${this.key}-${index}`;\n });\n\n this._id = this.dom.carousel.id;\n }\n\n /**\n * Sets ARIA attributes throughout the carousel.\n */\n _setAriaAttributes() {\n // Make sure the carousel has a proper role.\n // Sections and role=\"region\" are acceptable in certain cases, so\n // we only need to fallback to role=\"group\" if neither of those are present.\n if (\n !isTag(\"section\", { carousel: this.dom.carousel }, { shouldThrow: false })\n .status &&\n !this.dom.carousel.getAttribute(\"role\") !== \"region\"\n ) {\n this.dom.carousel.setAttribute(\"role\", \"group\");\n }\n\n // Set the role description for the carousel.\n this._dom.carousel.setAttribute(\"aria-roledescription\", \"carousel\");\n\n if (this.dom.carouselTabContainer) {\n this.dom.carouselTabContainer.setAttribute(\"role\", \"tablist\");\n }\n\n this.dom.carouselTabs.forEach((tab, index) => {\n if (!isTag(\"button\", { tab: tab }, { shouldThrow: false }).status) {\n tab.setAttribute(\"role\", \"button\");\n }\n\n tab.setAttribute(\"aria-selected\", index === 0);\n tab.setAttribute(\"aria-controls\", this.dom.carouselItems[index].id);\n });\n }\n\n /**\n * Sets the transition duration for the carousel as a CSS custom property.\n *\n * The custom property is set as `--graupl-carousel-transition-duration`.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.carousel.style.setProperty(\n `--${this.prefix}carousel-transition-duration`,\n `${this.transitionDuration}ms`\n );\n }\n\n /**\n * Handles the autoplay functionality of the carousel.\n *\n * - Adds the appropriate class to the autoplay button.\n * - Removes the appropriate class from the autoplay button.\n * - Sets the appropriate aria-label for the autoplay button.\n * - Sets the appropriate aria-live for the carousel.\n * - Sets/clears the interval for autoplaying the carousel.\n *\n * @protected\n */\n _handleAutoplay() {\n if (this.autoplay) {\n addClass(this.pauseClass, this.dom.autoplay);\n removeClass(this.playClass, this.dom.autoplay);\n\n this.dom.autoplay.setAttribute(\"aria-label\", this.pauseText);\n this.dom.carousel.setAttribute(\"aria-live\", \"off\");\n\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n } else {\n addClass(this.playClass, this.dom.autoplay);\n removeClass(this.pauseClass, this.dom.autoplay);\n\n this.dom.autoplay.setAttribute(\"aria-label\", this.playText);\n this.dom.carousel.setAttribute(\"aria-live\", \"polite\");\n\n this._clearInterval();\n }\n }\n\n /**\n * Handles the focus events throughout the carousel for proper use.\n *\n * - Adds a `focusin` listener to the carousel element to pause autoplay.\n * - Adds a `focusout` listener to the carousel element to resume autoplay.\n */\n _handleFocus() {\n // Pause autoplay when anything in the carousel is focused.\n this._addEventListener(\"focusin\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this._addEventListener(\"focusout\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n });\n }\n\n /**\n * Handles the click events throughout the carousel.\n *\n * - Adds a `click` listener to the next control to activate the next item.\n * - Adds a `click` listener to the previous control to activate the previous item.\n * - Adds a `click` listener to the autoplay control to toggle autoplay.\n * - Adds a `click` listener to each tab control to activate the corresponding item.\n */\n _handleClick() {\n this._addEventListener(\"click\", this.dom.next, () => {\n this.activateNextItem();\n });\n\n this._addEventListener(\"click\", this.dom.previous, () => {\n this.activatePreviousItem();\n });\n\n this._addEventListener(\"click\", this.dom.autoplay, () => {\n this.toggleAutoplay();\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n this._addEventListener(\"click\", tab, () => {\n if (this.currentItem > index) {\n this._currentAction = \"previous\";\n } else {\n this._currentAction = \"next\";\n }\n\n this.activateItem(index);\n });\n });\n }\n\n /**\n * Handles the hover events throughout the carousel for proper use.\n *\n * - Adds a `pointerover` listener to the carousel to pause autoplay.\n * - Adds a `pointerleave` listener to the carousel to resume autoplay.\n */\n _handleHover() {\n // Pause autoplay when anything in the carousel is hovered.\n this._addEventListener(\"pointerover\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this._addEventListener(\"pointerleave\", this.dom.carousel, () => {\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n });\n }\n\n /**\n * Handles keydown events throughout the carousel for proper use.\n *\n * - Adds a `keydown` listener to all control elements.\n * - Prevents Space and Enter key events.\n * - Adds a `keydown` listener to all tab elements.\n * - Prevents Space and Enter key events.\n */\n _handleKeydown() {\n this.dom.carouselControls.forEach((control) => {\n this._addEventListener(\"keydown\", control, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n\n this.dom.carouselTabs.forEach((tab) => {\n this._addEventListener(\"keydown\", tab, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n }\n\n /**\n * Handles keyup events throughout the carousel for proper use.\n *\n * - Adds a `keyup` listener to all control elements.\n * - Activates the next/previous item depending on which control is pressed.\n * - Toggles autoplay if the autoplay control is pressed.\n *\n */\n _handleKeyup() {\n // Activate the next item if the space or enter key on the next control.\n this._addEventListener(\"keyup\", this.dom.next, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activateNextItem();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Activate the previous item if the space or enter key on the previous control.\n this._addEventListener(\"keyup\", this.dom.previous, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activatePreviousItem();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Toggle autoplay if the space or enter key on the autoplay control.\n this._addEventListener(\"keyup\", this.dom.autoplay, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.toggleAutoplay();\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n\n // Activate the item if the space or enter key on the tab control.\n this.dom.carouselTabs.forEach((tab, index) => {\n this._addEventListener(\"keyup\", tab, (event) => {\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.activateItem(index);\n\n // Prevent the default action of the event.\n preventEvent(event);\n\n break;\n }\n });\n });\n }\n\n /**\n * Activates the current carousel item.\n */\n activateCurrentItem() {\n addClass(this.activeClass, this.currentCarouselItem);\n\n if (this.currentCarouselTab) {\n this.currentCarouselTab.setAttribute(\"aria-selected\", true);\n addClass(this.activeClass, this.currentCarouselTab);\n }\n }\n\n /**\n * Deactivates the current carousel item.\n */\n deactivateCurrentItem() {\n removeClass(this.activeClass, this.currentCarouselItem);\n\n if (this.currentCarouselTab) {\n this.currentCarouselTab.setAttribute(\"aria-selected\", false);\n removeClass(this.activeClass, this.currentCarouselTab);\n }\n }\n\n /**\n * Activates the carousel item at a given index.\n *\n * @param {number} index - The index of the carousel item to activate.\n */\n activateItem(index) {\n const currentIndex = this.currentItem;\n\n this.dom.carousel.dataset.grauplAction = this._currentAction;\n\n if (this.autoplay) {\n this._clearInterval();\n }\n\n addClass(this.previousClass, this.currentCarouselItem);\n addClass(this.nextClass, this.dom.carouselItems[index]);\n\n requestAnimationFrame(() => {\n this.deactivateCurrentItem();\n this.currentItem = index;\n this.activateCurrentItem();\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.previousClass, this.dom.carouselItems[currentIndex]);\n removeClass(this.nextClass, this.currentCarouselItem);\n }, this.transitionDuration);\n });\n });\n\n if (this.autoplay) {\n this._setInterval(() => this.activateNextItem(), this.transitionDelay);\n }\n }\n\n /**\n * Activates the first carousel item.\n */\n activateFirstItem() {\n this.activateItem(0);\n }\n\n /**\n * Activates the last carousel item.\n */\n activateLastItem() {\n this.activateItem(this.dom.carouselItems.length - 1);\n }\n\n /**\n * Activates the next carousel item.\n */\n activateNextItem() {\n this._currentAction = \"next\";\n\n if (this.currentItem + 1 >= this.dom.carouselItems.length) {\n this.activateFirstItem();\n } else {\n this.activateItem(this.currentItem + 1);\n }\n }\n\n /**\n * Activates the previous carousel item.\n */\n activatePreviousItem() {\n this._currentAction = \"previous\";\n\n if (this.currentItem - 1 < 0) {\n this.activateLastItem();\n } else {\n this.activateItem(this.currentItem - 1);\n }\n }\n\n /**\n * Toggles autoplay on the carousel.\n */\n toggleAutoplay() {\n this.autoplay = !this.autoplay;\n\n this._handleAutoplay();\n }\n}\n\nexport default Carousel;\n","import Carousel from \"./Carousel.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n carouselSelector = \".carousel\"\n) => {\n once(\"graupl-carousel-generator\", carouselSelector, context).forEach(\n (carouselElement) => {\n const carouselOptions = carouselElement.dataset.grauplCarouselOptions\n ? JSON.parse(\n carouselElement.dataset.grauplCarouselOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Carousel({\n carouselElement,\n initialize: true,\n ...options,\n ...carouselOptions,\n });\n }\n );\n};\n\nexport default generate;\n","import once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n navigationSelector = \".navigation\"\n) => {\n once(\"graupl-navigation-generator\", navigationSelector, context).forEach(\n (navigationElement) => {\n const MenuConstructor =\n navigationElement.dataset.grauplMenuType || DisclosureMenu;\n\n if (window[MenuConstructor] === undefined) {\n console.warn(\n `Graupl navigation requires accessible-menu's ${MenuConstructor}. Please make sure to include it on this page.`\n );\n\n return;\n }\n\n const menuOptions = navigationElement.dataset.grauplMenuOptions\n ? JSON.parse(\n navigationElement.dataset.grauplMenuOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n const menuElement = navigationElement.querySelector(\".menu\");\n const controllerElement =\n navigationElement.querySelector(\".navigation-toggle\") || null;\n const containerElement = controllerElement ? navigationElement : null;\n new window[MenuConstructor]({\n menuElement,\n menuItemSelector: \".menu-item\",\n menuLinkSelector: \".menu-link\",\n submenuItemSelector: \".submenu-item\",\n submenuToggleSelector: \".submenu-toggle\",\n controllerElement,\n containerElement,\n ...options,\n ...menuOptions,\n });\n }\n );\n};\n\nexport default generate;\n","/**\n * @file\n * The Disclosure class.\n */\n\nimport { isValidClassList, isValidType, isTag } from \"../validate.js\";\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { keyPress, preventEvent } from \"../eventHandlers.js\";\nimport TransactionalValue from \"../TransactionalValue.js\";\nimport Component from \"../Component.js\";\n\n/**\n * The event that is triggered when the disclosure is shown.\n *\n * @event grauplDisclosureExpand\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event\n * @property {Object<Disclosure>} detail - The details object containing the disclosure itself.\n * @property {Disclosure} detail.disclosure - The disclosure.\n */\n\n/**\n * The event that is triggered when the disclosure is hidden.\n *\n * @event grauplDisclosureCollapse\n *\n * @type {CustomEvent}\n *\n * @property {boolean} bubbles - A flag to bubble the event\n * @property {Object<Disclosure>} detail - The details object containing the disclosure itself.\n * @property {Disclosure} detail.disclosure - The disclosure.\n */\n\n/**\n * The Disclosure component.\n *\n * @extends Component\n *\n * Protected fields are documented below.\n *\n * @property {Object<HTMLElement>} _dom - The DOM elements within the disclosure.\n * @property {HTMLElement} _dom.controller - The disclosure controller element.\n * @property {HTMLElement} _dom.disclosure - The disclosure element.\n * @property {HTMLElement} _dom.content - The disclosure content element.\n * @property {string} _rootDOMElement - The root DOM element of the disclosure.\n * @property {string[]} _protectedDOMElements - The DOM elements within the disclosure that cannot be reset or generated by the disclosure itself.\n * @property {Object<string>} _selectors - The query selectors used by the disclosure.\n * @property {string} _selectors.content - The query selector for the disclosure content.\n * @property {Object<string, string[]>} _classes - The CSS classes to apply when the disclosure is in various states.\n * @property {string|string[]} _classes.locked - The class(es) to apply when the disclosure is locked.\n * @property {string|string[]} _classes.unlocked - The class(es) to apply when the disclosure is unlocked.\n * @property {string|string[]} _classes.open - The class(es) to apply when the disclosure is open.\n * @property {string|string[]} _classes.close - The class(es) to apply when the disclosure is closed.\n * @property {string|string[]} _classes.transition - The class(es) to apply when the disclosure is transitioning between states.\n * @property {string|string[]} _classes.initialize - The class(es) to apply when the disclosure is initializing.\n * @property {Object<number>} _durations - The duration times (in milliseconds) for various aspects throughout the disclosure.\n * @property {number} _durations.transition - The duration time (in milliseconds) for the transition between open and closed states.\n * @property {number} _durations.open - The duration time (in milliseconds) for the transition from closed to open states.\n * @property {number} _durations.close - The duration time (in milliseconds) for the transition from open to closed states.\n * @property {TransactionalValue<boolean>} _open - The open state of the disclosure.\n * @property {boolean} _shouldOpen - A value to force the disclosure open when the breakpoint width is passed.\n * @property {boolean} _openInsideBreakpoint - A flag to open the disclosure when inside the breakpoint.\n * @property {boolean} _openOutsideBreakpoint - A flag to open the disclosure when outside the breakpoint.\n * @property {boolean} _closeInsideBreakpoint - A flag to close the disclosure when inside the breakpoint.\n * @property {boolean} _closeOutsideBreakpoint - A flag to close the disclosure when outside the breakpoint.\n * @property {boolean} _lockInsideBreakpoint - A flag to lock the disclosure in its current state when inside the breakpoint.\n * @property {boolean} _lockOutsideBreakpoint - A flag to lock the disclosure in its current state when outside the breakpoint.\n * @property {boolean} _unlockInsideBreakpoint - A flag to unlock the disclosure when inside the breakpoint.\n * @property {boolean} _unlockOutsideBreakpoint - A flag to unlock the disclosure when outside the breakpoint.\n * @property {TransactionalValue<boolean>} _locked - The locked state of the disclosure.\n * @property {boolean} _closeOnBlur - Whether to close the disclosure when it loses focus in the DOM.\n * @property {Function} _mediaQueryListEventCallback - The callback for media query list events.\n * @property {string} _storageKey - The key used for storage.\n * @property {boolean} _shouldStore - A flag to check if the component should be stored in the StorageManager.\n * @property {Object<CustomEvent>} _events - Custom events that can be triggered throughout the disclosure.\n * @property {grauplDisclosureExpand} _events.expand - The event triggered when the disclosure is expanded.\n * @property {grauplDisclosureCollapse} _events.collapse - The event triggered when the disclosure is collapsed.\n * @property {Object<object>} _elements - The instantiated elements within the disclosure.\n * @property {Object<number>} _delays - The delay times (in milliseconds) for various aspects throughout the disclosure.\n * @property {string} _focusState - The current state of the disclosure's focus.\n * @property {string} _currentEvent - The last type of event triggered within the disclosure.\n * @property {string} _breakpoint - The breakpoint that the disclosure will call media query list events.\n * @property {string} _mediaQueryString - The media query to use to trigger media query list events.\n * @property {MediaQueryList|null} _mediaQueryList - The MediaQueryList for the disclosure.\n * @property {Object<Function>} _intervals - Intervals throughout the disclosure.\n * @property {Object<Function>} _timeouts - Timeouts throughout the disclosure.\n * @property {object[]} _listeners - Event listeners throughout the disclosure.\n * @property {string} _prefix - The prefix used for CSS custom properties and attributes.\n * @property {string} _key - The key used to generate IDs throughout the disclosure.\n * @property {string} _name - The component name of the disclosure.\n * @property {string} _id - The main ID of the disclosure.\n * @property {boolean} _valid - The validity state of the disclosure.\n * @property {boolean} _initialized - The initialized state of the disclosure.\n * @property {string[]} _errors - The errors found throughout the disclosure.\n */\nclass Disclosure extends Component {\n _rootDOMElement = \"disclosure\";\n _protectedDOMElements = [\"controller\"];\n _open = new TransactionalValue(false);\n _openInsideBreakpoint = false;\n _openOutsideBreakpoint = false;\n _closeInsideBreakpoint = false;\n _closeOutsideBreakpoint = false;\n _lockInsideBreakpoint = false;\n _lockOutsideBreakpoint = false;\n _unlockInsideBreakpoint = false;\n _unlockOutsideBreakpoint = false;\n _locked = new TransactionalValue(false);\n _shouldOpen = false;\n _closeOnBlur = false;\n _storageKey = \"disclosures\";\n _name = \"Disclosure\";\n _mediaQueryListEventCallback = (event) => {\n if (event.matches) {\n if (this.unlockInsideBreakpoint) {\n this.unlock();\n }\n\n if (this.isOpen && this.closeInsideBreakpoint) {\n if (this.isLocked) {\n this.unlock();\n }\n this.close({ preserveState: true });\n } else if (!this.isOpen && this.openInsideBreakpoint) {\n if (this.isLocked) {\n this.unlock();\n }\n this.open();\n }\n\n if (this.lockInsideBreakpoint) {\n this.lock();\n }\n } else {\n if (this.unlockOutsideBreakpoint) {\n this.unlock();\n }\n\n if (this.isOpen && this.closeOutsideBreakpoint) {\n if (this.isLocked) {\n this.unlock();\n }\n this.close({ preserveState: true });\n } else if (!this.isOpen && this.openOutsideBreakpoint) {\n if (this.isLocked) {\n this.unlock();\n }\n this.open();\n }\n\n if (this.lockOutsideBreakpoint) {\n this.lock();\n }\n }\n };\n\n /**\n * Constructs a new `Disclosure`.\n *\n * @param {object} [options = {}] - The options for generating the disclosure.\n * @param {HTMLElement} options.disclosureElement - The disclosure element in the DOM.\n * @param {HTMLElement} options.controllerElement - The disclosure toggle element in the DOM.\n * @param {string} [options.disclosureContentSelector = .disclosure-content] - The query selector string for the disclosure content.\n * @param {?(string|string[])} [options.lockedClass = locked] - The class(es) to apply when the disclosure is locked.\n * @param {?(string|string[])} [options.unlockedClass = unlocked] - The class(es) to apply when the disclosure is unlocked.\n * @param {?(string|string[])} [options.openClass = show] - The class to apply when a disclosure is \"open\".\n * @param {?(string|string[])} [options.closeClass = hide] - The class to apply when a disclosure is \"closed\".\n * @param {?(string|string[])} [options.transitionClass = transitioning] - The class to apply when a disclosure is transitioning between \"open\" and \"closed\" states.\n * @param {number} [options.transitionDuration = 250] - The duration of the transition between \"open\" and \"closed\" states (in milliseconds).\n * @param {boolean} [options.openDuration = -1] - The duration of the transition from \"closed\" to \"open\" states (in milliseconds).\n * @param {boolean} [options.closeDuration = -1] - The duration of the transition from \"open\" to \"closed\" states (in milliseconds).\n * @param {boolean} [options.closeOnBlur = false] - Whether to close the disclosure when it loses focus in the dom.\n * @param {?string} [options.minWidth = \"\"] - The width of the screen that the disclosure will automatically open/close itself.\n * @param {boolean} [options.autoOpen = false] - Whether to automatically open when above the minWidth.\n * @param {?string} [options.breakpoint = \"\"] - The breakpoint that the disclosure will automatically open/close itself.\n * @param {boolean} [options.openInsideBreakpoint = false] - A flag to open the disclosure when inside the breakpoint.\n * @param {boolean} [options.openOutsideBreakpoint = false] - A flag to open the disclosure when outside the breakpoint.\n * @param {boolean} [options.closeInsideBreakpoint = false] - A flag to close the disclosure when inside the breakpoint.\n * @param {boolean} [options.closeOutsideBreakpoint = false] - A flag to close the disclosure when outside the breakpoint.\n * @param {boolean} [options.lockInsideBreakpoint = false] - A flag to lock the disclosure when inside the breakpoint.\n * @param {boolean} [options.lockOutsideBreakpoint = false] - A flag to lock the disclosure when outside the breakpoint.\n * @param {boolean} [options.unlockInsideBreakpoint = false] - A flag to unlock the disclosure when inside the breakpoint.\n * @param {boolean} [options.unlockOutsideBreakpoint = false] - A flag to unlock the disclosure when outside the breakpoint.\n * @param {boolean} [options.locked = false] - A flag to lock the disclosure in its current state.\n * @param {?string} [options.mediaQuery = \"\"] - The media query to use when automatically opening/closing the disclosure.\n * @param {?string} [options.prefix = graupl-] - The prefix used for CSS custom properties and attributes.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the disclosure.\n * @param {?(string|string[])} [options.initializeClass = initializing] - The class(es) to apply when the disclosure is initializing.\n * @param {boolean} [options.initialize = false] - A flag to initialize the disclosure immediately upon creation.\n */\n constructor({\n disclosureElement,\n controllerElement,\n disclosureContentSelector = \".disclosure-content\",\n lockedClass = \"locked\",\n unlockedClass = \"unlocked\",\n openClass = \"show\",\n closeClass = \"hide\",\n transitionClass = \"transitioning\",\n transitionDuration = 250,\n openDuration = -1,\n closeDuration = -1,\n closeOnBlur = false,\n minWidth = \"\",\n breakpoint = \"\",\n autoOpen = false,\n openInsideBreakpoint = false,\n openOutsideBreakpoint = false,\n closeInsideBreakpoint = false,\n closeOutsideBreakpoint = false,\n lockInsideBreakpoint = false,\n lockOutsideBreakpoint = false,\n unlockInsideBreakpoint = false,\n unlockOutsideBreakpoint = false,\n locked = false,\n mediaQuery = \"\",\n prefix = \"graupl-\",\n key = null,\n initializeClass = \"initializing\",\n initialize = false,\n } = {}) {\n super({\n prefix,\n key,\n initializeClass,\n });\n\n // Set the DOM elements.\n this._dom.disclosure = disclosureElement;\n this._dom.controller = controllerElement;\n\n // Set the DOM selectors.\n this._selectors.content = disclosureContentSelector;\n\n // Set the classes.\n this._classes.locked = lockedClass || \"\";\n this._classes.unlocked = unlockedClass || \"\";\n this._classes.open = openClass || \"\";\n this._classes.close = closeClass || \"\";\n this._classes.transition = transitionClass || \"\";\n\n // Set the durations.\n this._durations.transition = transitionDuration;\n this._durations.open = openDuration;\n this._durations.close = closeDuration;\n\n // Set close on blur.\n this._closeOnBlur = closeOnBlur;\n\n // @todo Remove minWidth and autoOpen options in favor of breakpoint, openInsideBreakpoint, openOutsideBreakpoint, closeInsideBreakpoint, and closeOutsideBreakpoint options.\n if (minWidth !== \"\") {\n console.warn(\n \"`minWidth` is deprecated and will be removed in a future release. Please set `breakpoint` instead.\"\n );\n\n if (breakpoint === \"\") {\n breakpoint = minWidth;\n }\n }\n\n if (autoOpen && breakpoint !== \"\") {\n console.warn(\n \"`autoOpen` is deprecated and will be removed in a future release. Please set `openOutsideBreakpoint` and `closeInsideBreakpoint` to `true` instead.\"\n );\n\n openOutsideBreakpoint = autoOpen;\n closeInsideBreakpoint = autoOpen;\n }\n\n // Set collapse width and auto open functionality.\n this._breakpoint = breakpoint || \"\";\n this._shouldOpen = autoOpen;\n this._openInsideBreakpoint = openInsideBreakpoint;\n this._openOutsideBreakpoint = openOutsideBreakpoint;\n this._closeInsideBreakpoint = closeInsideBreakpoint;\n this._closeOutsideBreakpoint = closeOutsideBreakpoint;\n this._lockInsideBreakpoint = lockInsideBreakpoint;\n this._lockOutsideBreakpoint = lockOutsideBreakpoint;\n this._unlockInsideBreakpoint = unlockInsideBreakpoint;\n this._unlockOutsideBreakpoint = unlockOutsideBreakpoint;\n this._mediaQueryString = mediaQuery || \"\";\n\n // Set the lock state.\n this._locked = new TransactionalValue(locked);\n\n // Register custom events.\n this._registerEvent(\"expand\", { detail: { disclosure: this } });\n this._registerEvent(\"collapse\", { detail: { disclosure: this } });\n this._registerEvent(\"lock\", { detail: { disclosure: this } });\n this._registerEvent(\"unlock\", { detail: { disclosure: this } });\n\n // Set up custom initialization.\n this._addEventListener(\n \"grauplComponentInitialize\",\n this.rootDOMElement,\n () => {\n // Handle auto-opening disclosures with aria-expanded set to true or\n // those that _should_ open.\n if (\n this.dom.controller.getAttribute(\"aria-expanded\") === \"true\" ||\n (this.openOutsideBreakpoint &&\n !window.matchMedia(this.mediaQuery).matches) ||\n (this.openInsideBreakpoint &&\n window.matchMedia(this.mediaQuery).matches)\n ) {\n this.open();\n } else {\n this.close();\n }\n\n // Handle auto-locking disclosures that should be locked.\n if (\n this.isLocked ||\n (this.lockInsideBreakpoint &&\n window.matchMedia(this.mediaQuery).matches) ||\n (this.lockOutsideBreakpoint &&\n !window.matchMedia(this.mediaQuery).matches)\n ) {\n this.lock();\n }\n }\n );\n\n // Set up custom validation.\n this._addEventListener(\n \"grauplComponentValidate\",\n this.rootDOMElement,\n () => {\n // Boolean checks.\n const booleans = {\n closeOnBlur: this._closeOnBlur,\n openInsideBreakpoint: this._openInsideBreakpoint,\n openOutsideBreakpoint: this._openOutsideBreakpoint,\n closeInsideBreakpoint: this._closeInsideBreakpoint,\n closeOutsideBreakpoint: this._closeOutsideBreakpoint,\n lockInsideBreakpoint: this._lockInsideBreakpoint,\n lockOutsideBreakpoint: this._lockOutsideBreakpoint,\n unlockInsideBreakpoint: this._unlockInsideBreakpoint,\n unlockOutsideBreakpoint: this._unlockOutsideBreakpoint,\n locked: this._locked.value,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans, {\n shouldThrow: false,\n });\n\n // Handle boolean check failure.\n if (!booleanChecks.status) {\n this._errors = [...this._errors, ...booleanChecks.errors];\n this._valid = false;\n }\n }\n );\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * The class(es) to apply to the disclosure.\n *\n * @type {string|string[]}\n *\n * @see _classes.locked\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 disclosure.\n *\n * @type {string|string[]}\n *\n * @see _classes.unlocked\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 when the disclosure is open.\n *\n * @type {string|string[]}\n *\n * @see _classes.open\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 when the disclosure is closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.close\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 when the disclosure is transitioning between open and closed.\n *\n * @type {string|string[]}\n *\n * @see _classes.transition\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 duration time (in milliseconds) for the transition between open and closed states.\n *\n * Setting this value will also set the --graupl-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.transition\n */\n get transitionDuration() {\n return this._durations.transition;\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { transitionDuration: value });\n\n if (this._durations.transition !== value) {\n this._durations.transition = value;\n this._setCustomProps();\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 --graupl-open-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.open\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\", { openDuration: value });\n\n if (this._durations.open !== value) {\n this._durations.open = value;\n this._setCustomProps();\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 --graupl-close-transition-duration CSS custom property on the disclosure.\n *\n * @type {number}\n *\n * @see _durations.close\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\", { closeDuration: value });\n\n if (this._durations.close !== value) {\n this._durations.close = value;\n this._setCustomProps();\n }\n }\n\n /**\n * The width of the screen that the disclosure will automatically open/close itself.\n *\n * This is just an alias for the generic \"breakpoint\" used in all components.\n *\n * @type {string}\n *\n * @see breakpoint\n */\n get minWidth() {\n console.warn(\n \"`minWidth` is deprecated and will be removed in a future release. Please use `breakpoint` instead.\"\n );\n\n return this.breakpoint;\n }\n\n set minWidth(value) {\n console.warn(\n \"`minWidth` is deprecated and will be removed in a future release. Please use `breakpoint` instead.\"\n );\n\n this.breakpoint = value;\n }\n\n /**\n * Whether to close the disclosure when it loses focus in the DOM.\n *\n * @type {boolean}\n *\n * @see _closeOnBlur\n */\n get closeOnBlur() {\n return this._closeOnBlur;\n }\n\n set closeOnBlur(value) {\n isValidType(\"boolean\", { closeOnBlur: value });\n\n if (this._closeOnBlur !== value) {\n this._closeOnBlur = value;\n }\n }\n\n /**\n * The open state of the disclosure.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _open\n */\n get isOpen() {\n return this._open.value;\n }\n\n /**\n * The open state of the disclosure that the user specifically triggered.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _open\n */\n get hasOpened() {\n return this._open.committed;\n }\n\n /**\n * A value to force opening regardless of user interaction.\n *\n * @type {boolean}\n *\n * @see _shouldOpen\n */\n get shouldOpen() {\n console.warn(\n \"`shouldOpen` is deprecated and will be removed in a future release. Please use `openOutsideBreakpoint` and `closeInsideBreakpoint` instead.\"\n );\n\n return this._shouldOpen;\n }\n\n set shouldOpen(value) {\n console.warn(\n \"`shouldOpen` is deprecated and will be removed in a future release. Please use `openOutsideBreakpoint` and `closeInsideBreakpoint` instead.\"\n );\n\n isValidType(\"boolean\", { shouldOpen: value });\n\n if (this._shouldOpen !== value) {\n this._shouldOpen = value;\n }\n }\n\n /**\n * A flag to open the disclosure when inside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _openInsideBreakpoint\n */\n get openInsideBreakpoint() {\n return this._openInsideBreakpoint;\n }\n\n set openInsideBreakpoint(value) {\n isValidType(\"boolean\", { openInsideBreakpoint: value });\n\n if (this._openInsideBreakpoint !== value) {\n this._openInsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to open the disclosure when outside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _openOutsideBreakpoint\n */\n get openOutsideBreakpoint() {\n return this._openOutsideBreakpoint;\n }\n\n set openOutsideBreakpoint(value) {\n isValidType(\"boolean\", { openOutsideBreakpoint: value });\n\n if (this._openOutsideBreakpoint !== value) {\n this._openOutsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to close the disclosure when inside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _closeInsideBreakpoint\n */\n get closeInsideBreakpoint() {\n return this._closeInsideBreakpoint;\n }\n\n set closeInsideBreakpoint(value) {\n isValidType(\"boolean\", { closeInsideBreakpoint: value });\n\n if (this._closeInsideBreakpoint !== value) {\n this._closeInsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to close the disclosure when outside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _closeOutsideBreakpoint\n */\n get closeOutsideBreakpoint() {\n return this._closeOutsideBreakpoint;\n }\n\n set closeOutsideBreakpoint(value) {\n isValidType(\"boolean\", { closeOutsideBreakpoint: value });\n\n if (this._closeOutsideBreakpoint !== value) {\n this._closeOutsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to lock the disclosure in its current state when inside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _lockInsideBreakpoint\n */\n get lockInsideBreakpoint() {\n return this._lockInsideBreakpoint;\n }\n\n set lockInsideBreakpoint(value) {\n isValidType(\"boolean\", { lockInsideBreakpoint: value });\n\n if (this._lockInsideBreakpoint !== value) {\n this._lockInsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to lock the disclosure in its current state when outside the breakpoint.\n *\n * @type {boolean}\n *\n * @see _lockOutsideBreakpoint\n */\n get lockOutsideBreakpoint() {\n return this._lockOutsideBreakpoint;\n }\n\n set lockOutsideBreakpoint(value) {\n isValidType(\"boolean\", { lockOutsideBreakpoint: value });\n\n if (this._lockOutsideBreakpoint !== value) {\n this._lockOutsideBreakpoint = value;\n }\n }\n\n /**\n * A flag to indicate if the disclosure 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 disclosure.\n *\n * @readonly\n *\n * @type {boolean}\n *\n * @see _locked\n */\n get shouldBeLocked() {\n return this._locked.committed;\n }\n\n /**\n * Sets the IDs throughout the disclosure.\n *\n * The generated IDs use the key and follow the format:\n * - disclosure: `disclosure-${key}`\n * - controller: `disclosure-controller-${key}`\n *\n * @protected\n */\n _setIds() {\n this.dom.disclosure.id = this.dom.disclosure.id || `disclosure-${this.key}`;\n this.dom.controller.id =\n this.dom.controller.id || `disclosure-controller-${this.key}`;\n\n this._id = this.dom.disclosure.id;\n }\n\n /**\n * Sets ARIA attributes throughout the disclosure.\n *\n * The first steps are to ensure that the controller has `aria-expanded` set to \"false\"\n * if it's not already explicitly set to \"true\".\n *\n * Then, set the `aria-controls` attribute on the controller to the disclosure's ID.\n *\n * Finally, ensure the controller element has a role of \"button\" if it is not a native button element.\n *\n * @protected\n */\n _setAriaAttributes() {\n // If the controller element doesn't have aria-expanded set to true, set it to false.\n if (this.dom.controller.getAttribute(\"aria-expanded\") !== \"true\") {\n this.dom.controller.setAttribute(\"aria-expanded\", \"false\");\n }\n\n // Set the aria-controls attribute on the controller to the disclosure's ID.\n this.dom.controller.setAttribute(\"aria-controls\", this.dom.disclosure.id);\n\n // If the controller element is not a button, set its role to button.\n if (\n !isTag(\n \"button\",\n { controller: this.dom.controller },\n { shouldThrow: false }\n ).status\n ) {\n this.dom.controller.setAttribute(\"role\", \"button\");\n }\n }\n\n /**\n * Sets custom props throughout the disclosure.\n *\n * The custom properties are:\n * - `--graupl-disclosure-transition-duration`,\n * - `--graupl-disclosure-open-transition-duration`, and\n * - `--graupl-disclosure-close-transition-duration`.\n *\n * The prefix of `graupl-` can be changed by setting the disclosure's prefix value.\n *\n * @protected\n */\n _setCustomProps() {\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-transition-duration`,\n `${this.transitionDuration}ms`\n );\n\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-open-transition-duration`,\n `${this.openDuration}ms`\n );\n\n this.dom.disclosure.style.setProperty(\n `--${this.prefix}disclosure-close-transition-duration`,\n `${this.closeDuration}ms`\n );\n }\n\n /**\n * Sets all DOM elements within the disclosure.\n *\n * Utilizes _setDOMElementType and\n * _resetDOMElementType.\n *\n * @protected\n */\n _setDOMElements() {\n this._resetDOMElementType(\"content\");\n this._setDOMElementType(\"content\", { context: this.dom.disclosure });\n }\n\n /**\n * Expands the disclosure.\n *\n * Sets the controller's `aria-expanded` to \"true\", adds the\n * open class to the disclosure, and removes the closed class from the disclosure.\n *\n * @protected\n *\n * @fires grauplDisclosureExpand\n *\n * @param {Object<boolean>} [options = {}] - Options for expanding the disclosure.\n * @param {boolean} [options.emit = this.isInitialized] - Emit the expand event once expanded.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n */\n _reveal({ emit = this.isInitialized, transition = this.isInitialized } = {}) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"true\");\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 (transition && this.transitionlass !== \"\") {\n addClass(this.transitionClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n removeClass(this.closeClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n addClass(this.openClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.disclosure);\n }, this.openDuration);\n });\n });\n });\n } else {\n // Add the open class\n addClass(this.openClass, this.dom.disclosure);\n\n // Remove the close class.\n removeClass(this.closeClass, this.dom.disclosure);\n }\n\n this.dom.content.removeAttribute(\"inert\");\n\n if (emit) {\n this._dispatchEvent(\"expand\", this.dom.controller);\n }\n }\n\n /**\n * Collapses the disclosure.\n *\n * Sets the controller's `aria-expanded` to \"false\", adds the\n * close class to the disclosure, and removes the open class from the disclosure.\n *\n * @protected\n *\n * @fires grauplDisclosureCollapse\n *\n * @param {Object<boolean>} [options = {}] - Options for collapsing the disclosure.\n * @param {boolean} [options.emit = this.isInitialized] - Emit the collapse event once collapsed.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n */\n _conceal({\n emit = this.isInitialized,\n transition = this.isInitialized,\n } = {}) {\n this.dom.controller.setAttribute(\"aria-expanded\", \"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 (transition && this.transitionClass !== \"\") {\n addClass(this.transitionClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n removeClass(this.openClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n addClass(this.closeClass, this.dom.disclosure);\n\n requestAnimationFrame(() => {\n setTimeout(() => {\n removeClass(this.transitionClass, this.dom.disclosure);\n\n this.dom.content.innert = true;\n }, this.closeDuration);\n });\n });\n });\n } else {\n // Add the close class\n addClass(this.closeClass, this.dom.disclosure);\n\n // Remove the open class.\n removeClass(this.openClass, this.dom.disclosure);\n }\n\n this.dom.content.setAttribute(\"inert\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"collapse\", this.dom.controller);\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 = this.isInitialized] - Whether to emit the lock event.\n */\n _lock({ emit = this.isInitialized } = {}) {\n // Add the locked class\n addClass(this.lockedClass, this.dom.disclosure);\n\n // Remove the unlocked class.\n removeClass(this.unlockedClass, this.dom.disclosure);\n\n this.dom.controller.setAttribute(\"disabled\", \"true\");\n\n if (emit) {\n this._dispatchEvent(\"lock\", this.dom.disclosure);\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 = this.isInitialized] - Whether to emit the unlock event.\n */\n _unlock({ emit = this.isInitialized } = {}) {\n // Add the unlocked class\n addClass(this.unlockedClass, this.dom.disclosure);\n\n // Remove the locked class.\n removeClass(this.lockedClass, this.dom.disclosure);\n\n this.dom.controller.removeAttribute(\"disabled\");\n\n if (emit) {\n this._dispatchEvent(\"unlock\", this.dom.disclosure);\n }\n }\n\n /**\n * Handles focus events throughout the disclosure.\n *\n * - Adds a `focusout` listener to the disclosure so when the disclosure loses focus it will close.\n */\n _handleFocus() {\n this._addEventListener(\"focusout\", this.dom.disclosure, (event) => {\n if (\n !this.closeOnBlur ||\n this.currentEvent !== \"keyboard\" ||\n event.relatedTarget === null ||\n this.dom.disclosure.contains(event.relatedTarget) ||\n this.dom.controller === event.relatedTarget\n ) {\n return;\n }\n\n this.close();\n });\n }\n\n /**\n * Handles click events throughout the disclosure.\n *\n * - Adds a `click` listener to the controller that toggles the disclosure.\n * - Adds a `click` listener to the `document` so if the user clicks outside the disclosure it will close.\n */\n _handleClick() {\n this._addEventListener(\"click\", this.dom.controller, (event) => {\n this.currentEvent = \"mouse\";\n\n if (event.button !== 0) return;\n\n preventEvent(event);\n this.toggle();\n });\n\n this._addEventListener(\"click\", document, (event) => {\n if (this.focusState !== \"self\" || !this.closeOnBlur) return;\n\n this.currentEvent = \"mouse\";\n\n if (\n !this.dom.disclosure.contains(event.target) &&\n this.dom.controller !== event.target\n ) {\n this.close();\n }\n });\n }\n\n /**\n * Handles keydown events throughout the disclosure.\n *\n * This method exists to assist the _handleKeyup method.\n *\n * - Adds a `keydown` listener to the controller.\n * - Blocks propagation on \"Space\" and \"Enter\" keys.\n * - Adds a `keydown` listener to the disclosure.\n * - Blocks propagation on \"Escape\" keys.\n */\n _handleKeydown() {\n this._addEventListener(\"keydown\", this.dom.controller, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n preventEvent(event);\n\n break;\n }\n });\n\n this._addEventListener(\"keydown\", this.dom.disclosure, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Escape\":\n preventEvent(event);\n\n break;\n }\n });\n }\n\n /**\n * Handles keyup events throughout the disclosure.\n *\n * - Adds a `keyup` listener to the controller.\n * - Toggles the disclosure on \"Space\" and \"Enter\" keys.\n * - Adds a `keyup` listener to the disclosure.\n * - Closes the disclosure on \"Escape\" keys.\n */\n _handleKeyup() {\n this._addEventListener(\"keyup\", this.dom.controller, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Space\":\n case \"Enter\":\n this.toggle();\n\n preventEvent(event);\n\n break;\n }\n });\n\n this._addEventListener(\"keyup\", this.dom.disclosure, (event) => {\n this.currentEvent = \"keyboard\";\n\n const key = keyPress(event);\n\n switch (key) {\n case \"Escape\":\n this.close();\n\n preventEvent(event);\n\n break;\n }\n });\n }\n\n /**\n * Opens the disclosure.\n *\n * Sets the disclosure's focus state to \"self\", calls expand, and sets isOpen to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for opening the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the open action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the expand event once opened.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n open({\n force = false,\n emit = this.isInitialized,\n transition = this.isInitialized,\n preserveState = false,\n } = {}) {\n if (this.isOpen && !force) return;\n if (this.isLocked) return;\n\n // Set the focus state.\n this.focusState = \"self\";\n\n // Expand the disclosure.\n this._reveal({ emit, transition });\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Opens the disclosure without entering it.\n *\n * Sets the disclosure's focus state to \"none\", calls expand, and sets isOpen to `true`.\n *\n * @param {Object<boolean>} [options = {}] - Options for previewing the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the preview action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the expand event once previewed.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n preview({\n force = false,\n emit = this.isInitialized,\n transition = this.isInitialized,\n preserveState = false,\n } = {}) {\n if (this.isOpen && !force) return;\n if (this.isLocked) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Expand the disclosure.\n this._reveal({ emit, transition });\n\n // Set the open state.\n this._open.value = true;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Closes the disclosure.\n *\n * Sets the disclosure's focus state to \"none\", calls collapse, and sets isOpen to `false`.\n *\n * @param {Object<boolean>} [options = {}] - Options for closing the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the close action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the collapse event once closed.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n close({\n force = false,\n emit = this.isInitialized,\n transition = this.isInitialized,\n preserveState = false,\n } = {}) {\n if (!this.isOpen && !force) return;\n if (this.isLocked) return;\n\n // Set the focus state.\n this.focusState = \"none\";\n\n // Collapse the disclosure.\n this._conceal({ emit, transition });\n\n // Set the open state.\n this._open.value = false;\n\n if (!preserveState) {\n this._open.commit();\n }\n }\n\n /**\n * Toggles the open state of the disclosure.\n *\n * @param {Object<boolean>} [options = {}] - Options for toggling the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the open or close action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the expand/collapse event once toggled.\n * @param {boolean} [options.transition = this.isInitialized] - Respect the transition class.\n * @param {boolean} [options.preserveState = false] - Whether to preserve the open state.\n */\n toggle({\n force = false,\n emit = this.isInitialized,\n transition = this.isInitialized,\n preserveState = false,\n } = {}) {\n if (this.isOpen) {\n this.close({ force, emit, transition, preserveState });\n } else {\n this.open({ force, emit, transition, preserveState });\n }\n }\n\n /**\n * Locks the disclosure.\n *\n * @param {Object<boolean>} [options = {}] - Options for locking the disclosure.\n * @param {boolean} [options.force = false] - Whether to force the lock action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the lock event.\n */\n lock({ force = false, emit = this.isInitialized } = {}) {\n // Only lock if the disclosure is unlocked.\n if (this.isLocked && !force) return;\n\n this._locked.value = true;\n this._lock({ emit });\n\n // Commit the locked preference.\n this._locked.commit();\n }\n\n /**\n * Unlocks the disclosure.\n *\n * @param {Object<boolean>} [options = {}] - Options for unlocking the disclosure.\n * @param {boolean} [options.force = true] - Whether to force the unlock action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the unlock event.\n */\n unlock({ force = false, emit = this.isInitialized } = {}) {\n // Only unlock if the disclosure is locked.\n if (!this.isLocked && !force) return;\n\n this._locked.value = false;\n this._unlock({ emit });\n\n this._locked.commit();\n }\n\n /**\n * Toggles the locked state of the disclosure.\n *\n * @param {Object<boolean>} [options = {}] - Options for toggling the lock state.\n * @param {boolean} [options.force = false] - Whether to force the toggle action.\n * @param {boolean} [options.emit = this.isInitialized] - Whether to emit the lock/unlock event.\n */\n toggleLock({ force = false, emit = this.isInitialized } = {}) {\n if (this.isLocked) {\n this.unlock({ force, emit });\n } else {\n this.lock({ force, emit });\n }\n }\n}\n\nexport default Disclosure;\n","import Disclosure from \"./Disclosure.js\";\nimport once from \"@drupal/once\";\n\nconst generate = ({\n options = {},\n context = document,\n disclosureSelector = \".disclosure\",\n controllerSelector = \".disclosure-toggle\",\n} = {}) => {\n once(\"graupl-disclosure-generator\", disclosureSelector, context).forEach(\n (disclosureElement) => {\n const disclosureOptions = disclosureElement.dataset\n .grauplDisclosureOptions\n ? JSON.parse(\n disclosureElement.dataset.grauplDisclosureOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n const targettedControllerSelector = `${controllerSelector}[data-graupl-disclosure-target=\"${disclosureElement.id}\"]`;\n const [controllerElement] = once(\n \"graupl-disclosure-generator\",\n targettedControllerSelector,\n context\n );\n\n if (!controllerElement) {\n console.warn(\n `No controller found for disclosure with ID \"${disclosureElement.id}\". Please ensure there is an element with the selector \"${targettedControllerSelector}\".`\n );\n\n once.remove(\"graupl-disclosure-generator\", disclosureElement);\n\n return;\n }\n\n new Disclosure({\n disclosureElement,\n controllerElement,\n initialize: true,\n ...options,\n ...disclosureOptions,\n });\n }\n );\n};\n\nexport default generate;\n","import accordionGenerator from \"./accordion/generator.js\";\nimport alertGenerator from \"./alert/generator.js\";\nimport carouselGenerator from \"./carousel/generator.js\";\nimport navigationGenerator from \"./navigation/generator.js\";\nimport disclosureGenerator from \"./disclosure/generator.js\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n accordionGenerator();\n alertGenerator();\n carouselGenerator();\n navigationGenerator();\n disclosureGenerator();\n});\n"],"x_google_ignoreList":[8],"mappings":"YAwBA,SAAgBA,EACdC,EACAC,EACA,CAAEC,YAAAA,EAAc,EAAA,EAAS,CAAA,EACzB,CACA,MAAMC,EAAS,CACbC,OAAQ,GACRC,OAAQ,CAAA,GAGV,GAAI,CACF,GAAI,OAAOJ,GAAa,SAAU,CAChC,MAAMK,EAAe,OAAOL,EAE5B,MAAM,IAAIM,UACR,qEAAqED,CAAAA,UAAY,EAIrF,UAAWE,KAAOP,EAChB,GAAI,CACF,GAAI,EAAEA,EAASO,CAAAA,YAAgBR,GAAa,CAC1C,MAAMS,EAAc,OAAOR,EAASO,CAAAA,EACpC,MAAM,IAAID,UACR,GAAGC,CAAAA,2BAA8BR,EAAWU,IAAAA,MAAUD,CAAAA,UAAW,SAG9DE,EAAO,CACdR,EAAOC,OAAS,GAChBD,EAAOE,OAAOO,KAAKD,CAAAA,SAGhBA,EAAO,CACdR,EAAOC,OAAS,GAChBD,EAAOE,OAAOO,KAAKD,CAAAA,EAGrB,GAAIT,GAAe,CAACC,EAAOC,OACzB,MAAMD,EAAOE,OAAO,CAAA,EAGtB,OAAOF,EAoBT,SAAgBU,EAAYC,EAAMC,EAAQ,CAAEb,YAAAA,EAAc,EAAA,EAAS,CAAA,EAAI,CACrE,MAAMC,EAAS,CACbC,OAAQ,GACRC,OAAQ,CAAA,GAGV,GAAI,CACF,GAAI,OAAOU,GAAW,SAAU,CA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