@graupl/graupl 1.0.0-beta.44 → 1.0.0-beta.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/component/breadcrumb.css +1 -1
- package/dist/css/component/breadcrumb.css.map +1 -1
- package/dist/css/component/tabs.css +1 -1
- package/dist/css/component/tabs.css.map +1 -1
- package/dist/css/component/tooltip.css +2 -0
- package/dist/css/component/tooltip.css.map +1 -0
- package/dist/css/component.css +1 -1
- package/dist/css/component.css.map +1 -1
- package/dist/css/graupl.css +1 -1
- package/dist/css/graupl.css.map +1 -1
- package/dist/js/breadcrumb.js +2 -2
- package/dist/js/breadcrumb.js.map +1 -1
- package/dist/js/carousel.js +2 -2
- package/dist/js/carousel.js.map +1 -1
- package/dist/js/component/breadcrumb.cjs.js +2 -2
- package/dist/js/component/breadcrumb.cjs.js.map +1 -1
- package/dist/js/component/breadcrumb.es.js +2 -2
- package/dist/js/component/breadcrumb.es.js.map +1 -1
- package/dist/js/component/breadcrumb.iife.js +2 -2
- package/dist/js/component/breadcrumb.iife.js.map +1 -1
- package/dist/js/component/carousel.cjs.js +2 -2
- package/dist/js/component/carousel.cjs.js.map +1 -1
- package/dist/js/component/carousel.es.js +2 -2
- package/dist/js/component/carousel.es.js.map +1 -1
- package/dist/js/component/carousel.iife.js +2 -2
- package/dist/js/component/carousel.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/component/tooltip.cjs.js +5 -0
- package/dist/js/component/tooltip.cjs.js.map +1 -0
- package/dist/js/component/tooltip.es.js +5 -0
- package/dist/js/component/tooltip.es.js.map +1 -0
- package/dist/js/component/tooltip.iife.js +5 -0
- package/dist/js/component/tooltip.iife.js.map +1 -0
- package/dist/js/disclosure.js +2 -2
- package/dist/js/disclosure.js.map +1 -1
- package/dist/js/generator/breadcrumb.cjs.js +2 -2
- package/dist/js/generator/breadcrumb.cjs.js.map +1 -1
- package/dist/js/generator/breadcrumb.es.js +2 -2
- package/dist/js/generator/breadcrumb.es.js.map +1 -1
- package/dist/js/generator/breadcrumb.iife.js +2 -2
- package/dist/js/generator/breadcrumb.iife.js.map +1 -1
- package/dist/js/generator/carousel.cjs.js +2 -2
- package/dist/js/generator/carousel.cjs.js.map +1 -1
- package/dist/js/generator/carousel.es.js +2 -2
- package/dist/js/generator/carousel.es.js.map +1 -1
- package/dist/js/generator/carousel.iife.js +2 -2
- package/dist/js/generator/carousel.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/generator/tooltip.cjs.js +5 -0
- package/dist/js/generator/tooltip.cjs.js.map +1 -0
- package/dist/js/generator/tooltip.es.js +5 -0
- package/dist/js/generator/tooltip.es.js.map +1 -0
- package/dist/js/generator/tooltip.iife.js +5 -0
- package/dist/js/generator/tooltip.iife.js.map +1 -0
- package/dist/js/graupl.js +2 -2
- package/dist/js/graupl.js.map +1 -1
- package/dist/js/tooltip.js +5 -0
- package/dist/js/tooltip.js.map +1 -0
- package/package.json +1 -1
- package/scss/component/tooltip.scss +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.cjs.js","names":["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","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Character","isNaN","match","Tab","Asterisk","Object","find","preventEvent","preventDefault","stopPropagation","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","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","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"],"sources":["../../../packages/core/src/js/domHelpers.js","../../../packages/core/src/js/eventHandlers.js","../../../packages/core/src/js/validate.js","../../../packages/core/src/js/storage/StorageManager.js","../../../packages/core/src/js/Component.js","../../../packages/core/src/js/carousel/Carousel.js"],"sourcesContent":["/**\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 * 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 * 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 * @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 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"],"mappings":"AAMA,SAAgBA,EAASC,EAAWC,EAAS,CA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,YAAc,CAAA,EAOzCiC,gBAAiB,CACf,KAAK1E,SAAW,CAAC,KAAKA,SAEtB,KAAK6B,gBAAAA"}
|
|
1
|
+
{"version":3,"file":"carousel.cjs.js","names":["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","keyPress","event","key","keyCode","keys","Enter","Space","Escape","ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End","Character","isNaN","match","Tab","Asterisk","Object","find","preventEvent","preventDefault","stopPropagation","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","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","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","dom","forEach","item","setAttribute","activateFirstItem","booleans","booleanChecks","shouldThrow","status","_errors","errors","_valid","strings","stringChecks","value","currentItem","length","tabs","querySelectorAll","selectors","carouselTab","index","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","removeAttribute","deactivateCurrentItem","currentIndex","dataset","grauplAction","requestAnimationFrame","setTimeout","activateLastItem"],"sources":["../../../packages/core/src/js/domHelpers.js","../../../packages/core/src/js/eventHandlers.js","../../../packages/core/src/js/validate.js","../../../packages/core/src/js/storage/StorageManager.js","../../../packages/core/src/js/Component.js","../../../packages/core/src/js/carousel/Carousel.js"],"sourcesContent":["/**\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 * 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 * 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 * @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 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 // Make sure all carousel items are inert so they are not focusable until activated.\n this.dom.carouselItems.forEach((item) => {\n item.setAttribute(\"inert\", \"true\");\n });\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 this.currentCarouselItem.removeAttribute(\"inert\");\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 this.currentCarouselItem.setAttribute(\"inert\", true);\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"],"mappings":"AAMA,SAAgBA,EAASC,EAAWC,EAAS,CAEvCD,IAAc,IAAMA,EAAUE,SAAW,IAIzC,OAAOF,GAAc,SACvBC,EAAQE,UAAUC,IAAIJ,CAAAA,EAEtBC,EAAQE,UAAUC,IAAI,GAAGJ,CAAAA,GAU7B,SAAgBK,EAAYL,EAAWC,EAAS,CAE1CD,IAAc,IAAMA,EAAUE,SAAW,IAIzC,OAAOF,GAAc,SACvBC,EAAQE,UAAUG,OAAON,CAAAA,EAEzBC,EAAQE,UAAUG,OAAO,GAAGN,CAAAA,GC5BhC,SAAgB0B,EAASC,EAAO,CAC9B,GAAI,CAEF,MAAMC,EAAMD,EAAMC,KAAOD,EAAME,QACzBC,EAAO,CACXC,MAAOH,IAAQ,SAAWA,IAAQ,GAClCI,MAAOJ,IAAQ,KAAOA,IAAQ,YAAcA,IAAQ,GACpDK,OAAQL,IAAQ,UAAYA,IAAQ,OAASA,IAAQ,GACrDM,QAASN,IAAQ,WAAaA,IAAQ,MAAQA,IAAQ,GACtDO,WAAYP,IAAQ,cAAgBA,IAAQ,SAAWA,IAAQ,GAC/DQ,UAAWR,IAAQ,aAAeA,IAAQ,QAAUA,IAAQ,GAC5DS,UAAWT,IAAQ,aAAeA,IAAQ,QAAUA,IAAQ,GAC5DU,KAAM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