@graupl/graupl 1.0.0-beta.25 → 1.0.0-beta.26
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/accordion.css +1 -1
- package/dist/css/component/accordion.css.map +1 -1
- package/dist/css/component/list.css +1 -1
- package/dist/css/component/list.css.map +1 -1
- 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/accordion.js +2 -2
- package/dist/js/accordion.js.map +1 -1
- package/dist/js/alert.js +2 -2
- package/dist/js/alert.js.map +1 -1
- package/dist/js/carousel.js +2 -2
- package/dist/js/carousel.js.map +1 -1
- package/dist/js/component/accordion.cjs.js +2 -2
- package/dist/js/component/accordion.cjs.js.map +1 -1
- package/dist/js/component/accordion.es.js +2 -2
- package/dist/js/component/accordion.es.js.map +1 -1
- package/dist/js/component/accordion.iife.js +2 -2
- package/dist/js/component/accordion.iife.js.map +1 -1
- package/dist/js/component/alert.cjs.js +2 -2
- package/dist/js/component/alert.cjs.js.map +1 -1
- package/dist/js/component/alert.es.js +2 -2
- package/dist/js/component/alert.es.js.map +1 -1
- package/dist/js/component/alert.iife.js +2 -2
- package/dist/js/component/alert.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/tabs.cjs.js +2 -2
- package/dist/js/component/tabs.cjs.js.map +1 -1
- package/dist/js/component/tabs.es.js +2 -2
- package/dist/js/component/tabs.es.js.map +1 -1
- package/dist/js/component/tabs.iife.js +2 -2
- package/dist/js/component/tabs.iife.js.map +1 -1
- package/dist/js/disclosure.js +2 -2
- package/dist/js/disclosure.js.map +1 -1
- package/dist/js/generator/accordion.cjs.js +2 -2
- package/dist/js/generator/accordion.cjs.js.map +1 -1
- package/dist/js/generator/accordion.es.js +2 -2
- package/dist/js/generator/accordion.es.js.map +1 -1
- package/dist/js/generator/accordion.iife.js +2 -2
- package/dist/js/generator/accordion.iife.js.map +1 -1
- package/dist/js/generator/alert.cjs.js +2 -2
- package/dist/js/generator/alert.cjs.js.map +1 -1
- package/dist/js/generator/alert.es.js +2 -2
- package/dist/js/generator/alert.es.js.map +1 -1
- package/dist/js/generator/alert.iife.js +2 -2
- package/dist/js/generator/alert.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/tabs.cjs.js +2 -2
- package/dist/js/generator/tabs.cjs.js.map +1 -1
- package/dist/js/generator/tabs.es.js +2 -2
- package/dist/js/generator/tabs.es.js.map +1 -1
- package/dist/js/generator/tabs.iife.js +2 -2
- package/dist/js/generator/tabs.iife.js.map +1 -1
- package/dist/js/graupl.js +2 -8
- package/dist/js/graupl.js.map +1 -1
- package/dist/js/navigation.js +1 -1
- package/dist/js/navigation.js.map +1 -1
- package/dist/js/tabs.js +2 -2
- package/dist/js/tabs.js.map +1 -1
- package/package.json +1 -1
|
@@ -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","Tab","Object","find","preventEvent","preventDefault","stopPropagation","isValidInstance","constructor","elements","elementsType","TypeError","key","elementType","name","status","error","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidHoverType","validTypes","includes","join","isTag","tagName","HTMLElement","tag","toLowerCase","check","isValidState","validStates","isValidEvent","validEvents","isValidType","initializeStorage","type","window","Graupl","getStorage","setStorage","data","clearStorage","pushToStorage","key","value","getFromStorage","removeFromStorage","addClass","removeClass","preventEvent","keyPress","storage","isQuerySelector","isTag","isValidClassList","isValidInstance","isValidType","Carousel","_dom","carousel","carouselItems","carouselItemContainer","carouselControls","carouselControlContainer","carouselTabs","carouselTabContainer","autoplay","next","previous","_selectors","_activeClass","_previousClass","_nextClass","_playClass","_pauseClass","_currentItem","_autoplay","_transitionDelay","_transitionDuration","_playText","_pauseText","_currentAction","_autoplayInterval","_prefix","_key","_errors","constructor","carouselElement","carouselItemSelector","carouselItemContainerSelector","carouselControlSelector","carouselControlContainerSelector","carouselTabSelector","carouselTabContainerSelector","autoplaySelector","nextSelector","previousSelector","activeClass","previousClass","nextClass","playClass","pauseClass","transitionDelay","transitionDuration","playText","pauseText","prefix","key","initialize","_validate","Error","errors","join","_generateKey","_setDOMElements","_setIds","_setAriaAttributes","activateFirstItem","_handleAutoplay","_handleFocus","_handleClick","_handleHover","_handleKeydown","_handleKeyup","_setTransitionDuration","initializeStorage","pushToStorage","dom","id","error","console","selectors","currentItem","currentCarouselItem","currentCarouselTab","currentAction","value","length","tabs","querySelectorAll","carouselTab","forEach","item","index","setAttribute","check","htmlElementChecks","HTMLElement","push","message","querySelectorChecks","carouselItemsSelector","carouselControlsSelector","carouselTabsSelector","autoplayChecks","delayCheck","durationCheck","activeClassChecks","previousClassChecks","nextClassChecks","playClassChecks","pauseClassChecks","playTextChecks","pauseTextChecks","prefixChecks","_setDOMElementType","elementType","base","overwrite","Array","isArray","domElements","from","filteredElements","filter","parentElement","domElement","querySelector","_resetDOMElementType","regenerate","Math","random","toString","replace","substring","tab","getAttribute","_setInterval","_clearInterval","setInterval","activateNextItem","clearInterval","addEventListener","activatePreviousItem","toggleAutoplay","activateItem","control","event","style","setProperty","activateCurrentItem","deactivateCurrentItem","currentIndex","dataset","grauplAction","requestAnimationFrame","setTimeout","activateLastItem","wsRE","attrName","doc","document","attr","element","op","value","attrSelector","id","TypeError","test","RangeError","checkElement","itemToCheck","Element","getElements","selector","context","elements","Document","DocumentFragment","querySelectorAll","Array","prototype","slice","call","filterAndModify","apply","filter","selected","matches","updateAttribute","add","remove","result","trim","split","forEach","item","indexOf","push","attribute","join","once","find","Carousel","once","generate","options","context","document","carouselSelector","forEach","carouselElement","carouselOptions","dataset","grauplCarouselOptions","JSON","parse","replace","initialize"],"sources":["../../../packages/core/src/js/domHelpers.js","../../../packages/core/src/js/eventHandlers.js","../../../packages/core/src/js/validate.js","../../../packages/core/src/js/storage.js","../../../packages/core/src/js/carousel/Carousel.js","../../../node_modules/@drupal/once/src/once.js","../../../packages/core/src/js/carousel/generator.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 Tab: key === \"Tab\" || key === 9,\n };\n\n return Object.keys(keys).find((key) => keys[key] === true) || \"\";\n } catch {\n // Return an empty string if something goes wrong.\n return \"\";\n }\n}\n\n/**\n * Stops an event from taking action.\n *\n * @param {Event} event - The event.\n */\nexport function preventEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n","/**\n * Check to see if the provided elements have a specific constructor.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking instanceof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {object} constructor - The constructor to check for.\n * @param {object} elements - The element(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidInstance(constructor, elements) {\n try {\n if (typeof elements !== \"object\") {\n const elementsType = typeof elements;\n\n throw new TypeError(\n `Elements given to isValidInstance() must be inside of an object. \"${elementsType}\" given.`\n );\n }\n\n for (const key in elements) {\n if (!(elements[key] instanceof constructor)) {\n const elementType = typeof elements[key];\n throw new TypeError(\n `${key} must be an instance of ${constructor.name}. \"${elementType}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are of a specific type.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking typeof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} type - The type to check for.\n * @param {object} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidType(type, values) {\n try {\n if (typeof values !== \"object\") {\n const valuesType = typeof values;\n\n throw new TypeError(\n `Values given to isValidType() must be inside of an object. \"${valuesType}\" given.`\n );\n }\n\n for (const key in values) {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(`${key} must be a ${type}. \"${valueType}\" given.`);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided values are valid query selectors.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isQuerySelector(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isQuerySelector() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n try {\n if (values[key] === null) {\n throw new Error();\n }\n\n document.querySelector(values[key]);\n } catch {\n throw new TypeError(\n `${key} must be a valid query selector. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided value is either a string or an array of strings.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string, string[]>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidClassList(values) {\n try {\n if (typeof values !== \"object\" || Array.isArray(values)) {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidClassList() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n const type = typeof values[key];\n\n if (type !== \"string\") {\n if (Array.isArray(values[key])) {\n values[key].forEach((value) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `${key} must be a string or an array of strings. An array containing non-strings given.`\n );\n }\n });\n } else {\n throw new TypeError(\n `${key} must be a string or an array of strings. \"${type}\" given.`\n );\n }\n } else {\n const obj = {};\n obj[key] = values[key];\n\n isQuerySelector(obj);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid hover types.\n *\n * Available types are: `\"off\"`, `\"on\"`, and `\"dynamic\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidHoverType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidHoverType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"off\", \"on\", \"dynamic\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided elements are using a specific tag.\n *\n * The elements must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `true` if the check is successful.\n *\n * @param {string} tagName - The name of the tag.\n * @param {Object<HTMLElement>} elements - The element(s) to check.\n * @return {boolean} - The result of the check.\n */\nexport function isTag(tagName, elements) {\n if (\n isValidType(\"string\", { tagName }).status &&\n isValidInstance(HTMLElement, elements).status\n ) {\n const tag = tagName.toLowerCase();\n let check = true;\n\n for (const key in elements) {\n if (elements[key].tagName.toLowerCase() !== tag) check = false;\n }\n\n return check;\n } else {\n return false;\n }\n}\n\n/**\n * Check to see if the provided values are valid focus states for a menu.\n *\n * Available states are: `\"none\"`, `\"self\"`, and `\"child\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidState(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidState() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validStates = [\"none\", \"self\", \"child\"];\n\n for (const key in values) {\n if (!validStates.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validStates.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid event types for a menu.\n *\n * Available events are: `\"none\"`, `\"mouse\"`, `\"keyboard\"`, and `\"character\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidEvent(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidEvent() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validEvents = [\"none\", \"mouse\", \"keyboard\", \"character\"];\n\n for (const key in values) {\n if (!validEvents.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validEvents.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * @file\n * Provides a system to get and store Graupl data in the browser.\n */\n\nimport { isValidType } from \"./validate.js\";\n\n/**\n * Initializes the storage system.\n *\n * @param {?string} [type = null] - The type of storage to initialize.\n */\nexport function initializeStorage(type = null) {\n window.Graupl = window.Graupl || {};\n\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = window.Graupl[type] || {};\n }\n}\n\n/**\n * Get the storage object.\n *\n * @param {?string} type - The type of storage to get.\n * @return {object} - The storage object.\n */\nexport function getStorage(type = null) {\n if (isValidType(\"string\", { type })) {\n return window.Graupl[type];\n }\n\n return window.Graupl;\n}\n\n/**\n * Set the storage object of a given type.\n *\n * @param {string} type - The type of storage to set.\n * @param {object} data - The data to set.\n */\nexport function setStorage(type, data = {}) {\n if (isValidType(\"string\", { type }) && isValidType(\"object\", { data })) {\n window.Graupl[type] = data;\n }\n}\n\n/**\n * Clear the storage object of a given type.\n *\n * @param {string} type - The type of storage to clear.\n */\nexport function clearStorage(type) {\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = {};\n }\n}\n\n/**\n * Push a value to the storage object.\n *\n * @param {string} type - The type of storage to push to.\n * @param {string} key - The key to use for the value.\n * @param {*} value - The value to store.\n */\nexport function pushToStorage(type, key, value) {\n if (isValidType(\"string\", { type, key })) {\n window.Graupl[type][key] = value;\n }\n}\n\n/**\n * Get a value from the storage object.\n *\n * @param {string }type - The type of storage to get from.\n * @param {string }key - The key to get the value from.\n * @return {*} - The value from the storage object.\n */\nexport function getFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n return window.Graupl[type][key];\n }\n\n return null;\n}\n\n/**\n * Remove a value from the storage object.\n *\n * @param {string} type - The type of storage to remove from.\n * @param {string} key - The key to remove the value from.\n */\nexport function removeFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n delete window.Graupl[type][key];\n }\n}\n\nexport default {\n initializeStorage,\n getStorage,\n setStorage,\n clearStorage,\n pushToStorage,\n getFromStorage,\n removeFromStorage,\n};\n","/**\n * @file\n * The carousel class.\n */\n\nimport { addClass, removeClass } from \"../domHelpers.js\";\nimport { preventEvent, keyPress } from \"../eventHandlers.js\";\nimport storage from \"../storage.js\";\nimport {\n isQuerySelector,\n isTag,\n isValidClassList,\n isValidInstance,\n isValidType,\n} from \"../validate.js\";\n\nclass Carousel {\n /**\n * The DOM elements within the carousel.\n *\n * @protected\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n *\n * @property {HTMLElement} carousel - The carousel element.\n * @property {HTMLElement[]} carouselItems - The carousel items.\n * @property {HTMLElement} carouselItemContainer - The carousel item container.\n * @property {HTMLElement[]} carouselControls - The carousel controls.\n * @property {HTMLElement} carouselControlContainer - The carousel control container.\n * @property {HTMLElement[]} carouselTabs - The carousel tabs.\n * @property {HTMLElement} carouselTabContainer - The carousel tab container.\n * @property {HTMLElement} autoplay - The autoplay button.\n * @property {HTMLElement} next - The next button.\n * @property {HTMLElement} previous - The previous button.\n */\n _dom = {\n carousel: null,\n carouselItems: [],\n carouselItemContainer: null,\n carouselControls: [],\n carouselControlContainer: null,\n carouselTabs: [],\n carouselTabContainer: null,\n autoplay: null,\n next: null,\n previous: null,\n };\n\n /**\n * The query selectors used by the carousel to populate the dom.\n *\n * @protected\n *\n * @type {Object<string>}\n *\n * @property {string} carouselItems - The query selector string for carousel items.\n * @property {string} carouselItemContainer - The query selector string for the carousel item container.\n * @property {string} carouselControls - The query selector string for carousel controls.\n * @property {string} carouselControlContainer - The query selector string for carousel control container.\n * @property {string} carouselTabs - The query selector string for the carousel tabs.\n * @property {string} carouselTabContainer - The query selector string for the carousel tab container.\n * @property {string} autoplay - The query selector string for the autoplay button.\n * @property {string} next - The query selector string for the next button.\n * @property {string} previous - The query selector string for the previous button.\n */\n _selectors = {\n carouselItems: \"\",\n carouselItemContainer: \"\",\n carouselControls: \"\",\n carouselControlContainer: \"\",\n carouselTabs: \"\",\n carouselTabContainer: \"\",\n autoplay: \"\",\n next: \"\",\n previous: \"\",\n };\n\n /**\n * The class(es) to apply when a carousel item is active.\n *\n * @protected\n *\n * @type {string|string[]}\n */\n _activeClass = \"active\";\n\n /**\n * The class(es) to apply to a carousel item that is the previously active item.\n *\n * @protected\n *\n * @type {string|string[]}\n */\n _previousClass = \"previous\";\n\n /**\n * The class(es) to apply to a carousel item that is the next active item.\n *\n * @protected\n *\n * @type {string|string[]}\n */\n _nextClass = \"next\";\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is paused.\n *\n * @protected\n *\n * @type {string|string[]}\n */\n _playClass = \"play\";\n\n /**\n * The class(es) to apply to the autoplay button when the carousel is playing.\n *\n * @protected\n *\n * @type {string|string[]}\n */\n _pauseClass = \"pause\";\n\n /**\n * The index of the currently active carousel item.\n *\n * @protected\n *\n * @type {number}\n */\n _currentItem = 0;\n\n /**\n * A flag to indicate if the carousel is currently playing.\n *\n * @protected\n *\n * @type {boolean}\n */\n _autoplay = true;\n\n /**\n * A variable to delay transition slides in milliseconds.\n *\n * @protected\n *\n * @type {number}\n */\n _transitionDelay = 10000;\n\n /**\n * The duration time (in milliseconds) for the transition between carousel items.\n *\n * @protected\n *\n * @type {number}\n */\n _transitionDuration = 500;\n\n /**\n * The label for the autoplay button when the carousel is paused.\n *\n * @protected\n *\n * @type {string}\n */\n _playText = \"Play\";\n\n /**\n * The label for the autoplay button when the carousel is playing.\n *\n * @protected\n *\n * @type {string}\n */\n _pauseText = \"Pause\";\n\n /**\n * The current action being performed by the carousel.\n *\n * @protected\n *\n * @type {string}\n */\n _currentAction = \"next\";\n\n /**\n * The stored interval callback for autoplaying the carousel.\n *\n * @protected\n *\n * @type {?Function}\n */\n _autoplayInterval = null;\n\n /**\n * The prefix to use for CSS custom properties.\n *\n * @protected\n *\n * @type {string}\n */\n _prefix = \"graupl-\";\n\n /**\n * The key used to generate IDs throughout the carousel.\n *\n * @protected\n *\n * @type {string}\n */\n _key = \"\";\n\n /**\n * An array of error messages generated by the carousel.\n *\n * @protected\n *\n * @type {string[]}\n */\n _errors = [];\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.carouselItemSelector = .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.carouselControlSelector = .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.carouselTabSelector = .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 to use for CSS custom properties.\n * @param {?string} [options.key = null] - The key used to generate IDs throughout the carousel.\n * @param {boolean} [options.initialize = false] - A flag to initialize the carousel immediately upon creation.\n */\n constructor({\n carouselElement,\n carouselItemSelector = \".carousel-item\",\n carouselItemContainerSelector = \".carousel-item-container\",\n carouselControlSelector = \".carousel-control\",\n carouselControlContainerSelector = \".carousel-control-container\",\n carouselTabSelector = \".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 initialize = false,\n }) {\n // Set DOM elements.\n this._dom.carousel = carouselElement;\n\n // Set query selectors.\n this._selectors.carouselItems = carouselItemSelector;\n this._selectors.carouselItemContainer = carouselItemContainerSelector;\n this._selectors.carouselControls = carouselControlSelector;\n this._selectors.carouselControlContainer = carouselControlContainerSelector;\n this._selectors.carouselTabs = carouselTabSelector;\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._activeClass = activeClass || \"\";\n this._previousClass = previousClass || \"\";\n this._nextClass = nextClass || \"\";\n this._playClass = playClass || \"\";\n this._pauseClass = pauseClass || \"\";\n\n // Set flags.\n this._autoplay = autoplay;\n\n // Set transition options.\n this._transitionDelay = transitionDelay;\n this._transitionDuration = transitionDuration;\n\n // Set labels.\n this._playText = playText || \"\";\n this._pauseText = pauseText || \"\";\n\n // Set prefix.\n this._prefix = prefix || \"\";\n\n // Set the key.\n this._key = key || \"\";\n\n if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initializes the carousel.\n */\n initialize() {\n try {\n if (!this._validate()) {\n throw new Error(\n `Graupl Carousel: cannot initialize carousel. The following errors have been found:\\n - ${this.errors.join(\n \"\\n - \"\n )}`\n );\n }\n\n // Set up the DOM.\n this._generateKey();\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n\n // Activate the first item.\n this.activateFirstItem();\n\n // Handle events.\n this._handleAutoplay();\n this._handleFocus();\n this._handleClick();\n this._handleHover();\n this._handleKeydown();\n this._handleKeyup();\n\n // Set the custom props.\n this._setTransitionDuration();\n\n // Set up the storage.\n storage.initializeStorage(\"carousels\");\n storage.pushToStorage(\"carousels\", this.dom.carousel.id, this);\n } catch (error) {\n console.error(error);\n }\n }\n\n /**\n * The HTML elements for the carousel in the DOM.\n *\n * @readonly\n *\n * @type {Object<HTMLElement>}\n *\n * @see _dom\n */\n get dom() {\n return this._dom;\n }\n\n /**\n * The query selectors used by the carousel to populate the dom.\n *\n * @readonly\n *\n * @type {Object<string>}\n *\n * @see _selectors\n */\n get selectors() {\n return this._selectors;\n }\n\n /**\n * The class(es) to apply when a carousel item is active.\n *\n * @type {string|string[]}\n *\n * @see _activeClass\n */\n get activeClass() {\n return this._activeClass;\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 _previousClass\n */\n get previousClass() {\n return this._previousClass;\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 _nextClass\n */\n get nextClass() {\n return this._nextClass;\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 _playClass\n */\n get playClass() {\n return this._playClass;\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 _pauseClass\n */\n get pauseClass() {\n return this._pauseClass;\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 /**\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 /**\n * The delay in milliseconds before transitioning slides.\n *\n * @type {number}\n *\n * @see _transitionDelay\n */\n get transitionDelay() {\n return this._transitionDelay;\n }\n\n /**\n * The duration time (in milliseconds) for the transition between carousel items.\n *\n * @type {number}\n *\n * @see _transitionDuration\n */\n get transitionDuration() {\n return this._transitionDuration;\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 /**\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 /**\n * The prefix to use for CSS custom properties.\n *\n * @type {string}\n *\n * @see _prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * The key used to generate IDs throughout the accordion.\n *\n * @type {string}\n *\n * @see _key\n */\n get key() {\n return this._key;\n }\n\n /**\n * 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 * An array of error messages generated by the carousel.\n *\n * @readonly\n *\n * @type {string[]}\n *\n * @see _errors\n */\n get errors() {\n return this._errors;\n }\n\n set currentItem(value) {\n isValidType(\"number\", { 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 set autoplay(value) {\n isValidType(\"boolean\", { value });\n\n if (this._autoplay !== value) {\n this._autoplay = value;\n }\n }\n\n set activeClass(value) {\n isValidClassList({ activeClass: value });\n\n if (this._activeClass !== value) {\n this._activeClass = value;\n }\n }\n\n set previousClass(value) {\n isValidClassList({ previousClass: value });\n\n if (this._previousClass !== value) {\n this._previousClass = value;\n }\n }\n\n set nextClass(value) {\n isValidClassList({ nextClass: value });\n\n if (this._nextClass !== value) {\n this._nextClass = value;\n }\n }\n\n set playClass(value) {\n isValidClassList({ playClass: value });\n\n if (this._playClass !== value) {\n this._playClass = value;\n }\n }\n\n set pauseClass(value) {\n isValidClassList({ pauseClass: value });\n\n if (this._pauseClass !== value) {\n this._pauseClass = value;\n }\n }\n\n set transitionDelay(value) {\n isValidType(\"number\", { value });\n\n if (value !== this.transitionDelay && value >= 0) {\n this._currentItem = value;\n }\n }\n\n set transitionDuration(value) {\n isValidType(\"number\", { value });\n\n if (this._transitionDuration !== value && value >= 0) {\n this._transitionDuration = value;\n this._setTransitionDuration();\n }\n }\n\n set playText(value) {\n isValidType(\"string\", { value });\n\n if (this._playText !== value) {\n this._playText = value;\n }\n }\n\n set pauseText(value) {\n isValidType(\"string\", { value });\n\n if (this._pauseText !== value) {\n this._pauseText = value;\n }\n }\n\n set prefix(value) {\n isValidType(\"string\", { value });\n\n if (this._prefix !== value) {\n this._prefix = value;\n }\n }\n\n set key(value) {\n isValidType(\"string\", { value });\n\n if (this._key !== value) {\n this._key = value;\n }\n }\n\n /**\n * Validates all aspects of the carousel to ensure proper functionality.\n *\n * @protected\n *\n * @return {boolean} - The results of the validation.\n */\n _validate() {\n let check = true;\n\n // HTML element checks.\n const htmlElementChecks = isValidInstance(HTMLElement, {\n carousel: this.dom.carousel,\n });\n\n if (!htmlElementChecks) {\n this._errors.push(htmlElementChecks.message);\n check = false;\n }\n\n // Query selector checks.\n const querySelectorChecks = isQuerySelector({\n carouselItemsSelector: this._selectors.carouselItems,\n carouselItemContainerSelector: this._selectors.carouselItemContainer,\n carouselControlsSelector: this._selectors.carouselControls,\n carouselControlContainerSelector:\n this._selectors.carouselControlContainer,\n carouselTabsSelector: this._selectors.carouselTabs,\n carouselTabContainerSelector: this._selectors.carouselTabContainer,\n autoplaySelector: this._selectors.autoplay,\n nextSelector: this._selectors.next,\n previousSelector: this._selectors.previous,\n });\n\n if (!querySelectorChecks) {\n this._errors.push(querySelectorChecks.message);\n check = false;\n }\n\n // Autoplay checks.\n const autoplayChecks = isValidType(\"boolean\", { autoplay: this.autoplay });\n\n if (!autoplayChecks) {\n this._errors.push(autoplayChecks.message);\n check = false;\n }\n\n // Check delay is a valid value.\n const delayCheck = isValidType(\"number\", {\n transitionDelay: this._transitionDelay,\n });\n\n if (!delayCheck) {\n this._errors.push(delayCheck.message);\n check = false;\n }\n\n // Check duration is a valid value.\n const durationCheck = isValidType(\"number\", {\n transitionDuration: this._transitionDuration,\n });\n\n if (!durationCheck) {\n this._errors.push(durationCheck.message);\n check = false;\n }\n\n // Active class checks.\n if (this._activeClass !== \"\") {\n const activeClassChecks = isValidClassList({\n activeClass: this._activeClass,\n });\n\n if (!activeClassChecks) {\n this._errors.push(activeClassChecks.message);\n check = false;\n }\n }\n\n // Previous class checks.\n if (this._previousClass !== \"\") {\n const previousClassChecks = isValidClassList({\n previousClass: this._previousClass,\n });\n\n if (!previousClassChecks) {\n this._errors.push(previousClassChecks.message);\n check = false;\n }\n }\n\n // Next class checks.\n if (this._nextClass !== \"\") {\n const nextClassChecks = isValidClassList({\n nextClass: this._nextClass,\n });\n\n if (!nextClassChecks) {\n this._errors.push(nextClassChecks.message);\n check = false;\n }\n }\n\n // Play class checks.\n if (this._playClass !== \"\") {\n const playClassChecks = isValidClassList({\n playClass: this._playClass,\n });\n\n if (!playClassChecks) {\n this._errors.push(playClassChecks.message);\n check = false;\n }\n }\n\n // Pause class checks.\n if (this._pauseClass !== \"\") {\n const pauseClassChecks = isValidClassList({\n pauseClass: this._pauseClass,\n });\n\n if (!pauseClassChecks) {\n this._errors.push(pauseClassChecks.message);\n check = false;\n }\n }\n\n // Play text checks.\n if (this._playText !== \"\") {\n const playTextChecks = isValidType(\"string\", {\n playText: this._playText,\n });\n\n if (!playTextChecks) {\n this._errors.push(playTextChecks.message);\n check = false;\n }\n }\n\n // Pause text checks.\n if (this._pauseText !== \"\") {\n const pauseTextChecks = isValidType(\"string\", {\n pauseText: this._pauseText,\n });\n\n if (!pauseTextChecks) {\n this._errors.push(pauseTextChecks.message);\n check = false;\n }\n }\n\n // Prefix checks.\n const prefixChecks = isValidType(\"string\", { prefix: this._prefix });\n\n if (!prefixChecks) {\n this._errors.push(prefixChecks.message);\n check = false;\n }\n\n return check;\n }\n\n /**\n * Sets DOM elements within the carousel.\n *\n * The carousel element _cannot_ be set through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to populate.\n * @param {HTMLElement} [base = this.dom.carousel] - The element used as the base for the querySelector.\n * @param {boolean} [overwrite = true] - A flag to set if the existing elements will be overwritten.\n */\n _setDOMElementType(elementType, base = this.dom.carousel, overwrite = true) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (elementType === \"carousel\") {\n throw new Error(\n `Graupl Carousel: \"${elementType}\" element cannot be set through _setDOMElementType.`\n );\n }\n\n if (base !== this.dom.carousel) isValidInstance(HTMLElement, { base });\n\n if (Array.isArray(this._dom[elementType])) {\n // Get all the elements matching the selector in the base.\n const domElements = Array.from(\n base.querySelectorAll(this.selectors[elementType])\n );\n\n // Filter the elements so only direct children of the base are kept.\n const filteredElements = domElements.filter(\n (item) => item.parentElement === base\n );\n\n if (overwrite) {\n this._dom[elementType] = filteredElements;\n } else {\n this._dom[elementType] = [\n ...this._dom[elementType],\n ...filteredElements,\n ];\n }\n } else {\n // Get the single element matching the selector in the base.\n const domElement = base.querySelector(this.selectors[elementType]);\n\n // Ensure the element is a direct child of the base.\n if (domElement && domElement.parentElement !== base) {\n return;\n }\n\n if (overwrite) {\n this._dom[elementType] = domElement;\n }\n }\n } else {\n throw new Error(\n `Graupl Carousel: \"${elementType}\" is not a valid element type within the carousel.`\n );\n }\n }\n\n /**\n * Resets DOM elements within the menu.\n *\n * The carousel element _cannot_ be reset through this method.\n *\n * @protected\n *\n * @param {string} elementType - The type of element to clear.\n */\n _resetDOMElementType(elementType) {\n if (typeof this.selectors[elementType] === \"string\") {\n if (elementType === \"carousel\") {\n throw new Error(\n `Graupl Carousel: \"${elementType}\" element cannot be reset through _resetDOMElementType.`\n );\n }\n\n if (Array.isArray(this._dom[elementType])) {\n this._dom[elementType] = [];\n } else {\n this._dom[elementType] = null;\n }\n } else {\n throw new Error(\n `Graupl Carousel: \"${elementType}\" is not a valid element type within the carousel.`\n );\n }\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 this._setDOMElementType(\"carouselControlContainer\");\n this._setDOMElementType(\"carouselTabContainer\");\n\n if (this.dom.carouselItemContainer) {\n this._setDOMElementType(\"carouselItems\", this.dom.carouselItemContainer);\n }\n if (this.dom.carouselControlContainer) {\n this._setDOMElementType(\n \"carouselControls\",\n this.dom.carouselControlContainer\n );\n this._setDOMElementType(\"autoplay\", this.dom.carouselControlContainer);\n this._setDOMElementType(\"next\", this.dom.carouselControlContainer);\n this._setDOMElementType(\"previous\", this.dom.carouselControlContainer);\n }\n\n if (this._dom.carouselTabContainer) {\n this._setDOMElementType(\"carouselTabs\", this.dom.carouselTabContainer);\n }\n }\n\n /**\n * Generates a key for the carousel.\n *\n * @param {boolean} [regenerate = false] - A flag to determine if the key should be regenerated.\n */\n _generateKey(regenerate = false) {\n if (this.key === \"\" || regenerate) {\n this.key = Math.random()\n .toString(36)\n .replace(/[^a-z]+/g, \"\")\n .substring(0, 10);\n }\n }\n\n /**\n * Sets the IDs of the carousel and it's 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\n /**\n * Sets the aria attributes for 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 }) &&\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 })) {\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 interval for autoplaying the carousel.\n *\n * @protected\n */\n _setInterval() {\n this._clearInterval();\n\n this._autoplayInterval = setInterval(() => {\n this.activateNextItem();\n }, this.transitionDelay);\n }\n\n /**\n * Clears the interval for autoplaying the carousel.\n *\n * @protected\n */\n _clearInterval() {\n clearInterval(this._autoplayInterval);\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();\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.dom.carousel.addEventListener(\"focusin\", () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this.dom.carousel.addEventListener(\"focusout\", () => {\n if (this.autoplay) {\n this._setInterval();\n }\n });\n }\n\n /**\n * Handles the click events throughout the carousel.\n *\n * - Adds a `pointerup` listener to the next control to activate the next item.\n * - Adds a `pointerup` listener to the previous control to activate the previous item.\n * - Adds a `pointerup` listener to the autoplay control to toggle autoplay.\n * - Adds a `pointerup` listener to each tab control to activate the corresponding item.\n */\n _handleClick() {\n this.dom.next.addEventListener(\"pointerup\", () => {\n this.activateNextItem();\n });\n\n this.dom.previous.addEventListener(\"pointerup\", () => {\n this.activatePreviousItem();\n });\n\n this.dom.autoplay.addEventListener(\"pointerup\", () => {\n this.toggleAutoplay();\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n tab.addEventListener(\"pointerup\", () => {\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.dom.carousel.addEventListener(\"pointerover\", () => {\n if (this.autoplay) {\n this._clearInterval();\n }\n });\n\n this.dom.carousel.addEventListener(\"pointerleave\", () => {\n if (this.autoplay) {\n this._setInterval();\n }\n });\n }\n\n /**\n * Handles keydown events throughout the carousel item 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 control.addEventListener(\"keydown\", (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 tab.addEventListener(\"keydown\", (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 item 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.dom.next.addEventListener(\"keyup\", (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.dom.previous.addEventListener(\"keyup\", (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.dom.autoplay.addEventListener(\"keyup\", (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 tab.addEventListener(\"keyup\", (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 * 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 _setTransitionDuration() {\n this.dom.carousel.style.setProperty(\n `--${this.prefix}carousel-transition-duration`,\n `${this.transitionDuration}ms`\n );\n }\n\n /**\n * Activates the current carousel item.\n *\n * @public\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 * @public\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 * @public\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();\n }\n }\n\n /**\n * Activates the first carousel item.\n *\n * @public\n */\n activateFirstItem() {\n this.activateItem(0);\n }\n\n /**\n * Activates the last carousel item.\n *\n * @public\n */\n activateLastItem() {\n this.activateItem(this.dom.carouselItems.length - 1);\n }\n\n /**\n * Activates the next carousel item.\n *\n * @public\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 * @public\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 * @public\n */\n toggleAutoplay() {\n this.autoplay = !this.autoplay;\n\n this._handleAutoplay();\n }\n}\n\nexport default Carousel;\n","/**\n * Mark DOM elements as processed to prevent multiple initializations.\n *\n * @module @drupal/once\n *\n * @example <!-- Use as a module -->\n * <script type=\"module\">\n * import once from 'https://unpkg.com/@drupal/once/src/once.js';\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n *\n * @example <!-- Use as a regular script -->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n * @example <!-- Using a single element as input-->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * // once methods always return an array, to simplify the use with a single\n * // element use destructuring or the shift method.\n * const [myElement] = once('my-once-id', document.body);\n * const myElement = once('my-once-id', document.body).shift();\n * </script>\n */\n\n/**\n * Illegal spaces in ids.\n *\n * @private\n *\n * @type {RegExp}\n */\nconst wsRE = /[\\11\\12\\14\\15\\40]+/;\n\n/**\n * Name of the HTML attribute containing an element's once ids.\n *\n * @private\n *\n * @type {string}\n */\nconst attrName = 'data-once';\n\n/**\n * Shortcut to access the html element.\n *\n * @private\n *\n * @type {HTMLElement}\n */\nconst doc = document;\n\n/**\n * Helper to access element attributes.\n *\n * @private\n *\n * @param {Element} element\n * The Element to access the data-once attribute from.\n * @param {string} op\n * The action to take on the element.\n * @param {string} [value]\n * Optional value for setAttribute.\n *\n * @return {string|undefined|null|boolean}\n * Result of the attribute method.\n */\nfunction attr(element, op, value) {\n return element[`${op}Attribute`](attrName, value);\n}\n\n/**\n * Return the attribute selector.\n *\n * @private\n *\n * @param {string} id\n * The id passed by a call to a once() function.\n *\n * @return {string}\n * The full CSS attribute selector.\n *\n * @throws {TypeError|RangeError}\n */\nfunction attrSelector(id) {\n // Verify the validity of the once id.\n if (typeof id !== 'string') {\n throw new TypeError('once ID must be a string');\n }\n if (id === '' || wsRE.test(id)) {\n throw new RangeError('once ID must not be empty or contain spaces');\n }\n // The id is valid, return the full CSS selector.\n return `[${attrName}~=\"${id}\"]`;\n}\n\n/**\n * Verifies that an item is an instance of Element.\n *\n * This function is used during filtering to ensure only DOM elements are\n * processed. once() makes use of get/setAttribute, which are methods\n * inherited from the Element object, so only of Element can be used.\n *\n * @private\n *\n * @param {*} itemToCheck\n * The item to check.\n *\n * @return {boolean}\n * True if the item is an instance of Element\n *\n * @throws {TypeError}\n */\nfunction checkElement(itemToCheck) {\n if (!(itemToCheck instanceof Element)) {\n throw new TypeError('The element must be an instance of Element');\n }\n return true;\n}\n\n/**\n * Process arguments, query the DOM if necessary.\n *\n * @private\n *\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array with the processed Id and the list of elements to process.\n */\nfunction getElements(selector, context = doc) {\n // Assume selector is an array-like value.\n let elements = selector;\n\n // If selector is null it is most likely because of a call to querySelector\n // that didn't return a result.\n if (selector === null) {\n elements = [];\n }\n // The selector is undefined, error out.\n else if (!selector) {\n throw new TypeError('Selector must not be empty');\n }\n // Context doesn't implement querySelectorAll, error out.\n else if (\n !(\n context instanceof Document ||\n context instanceof DocumentFragment ||\n context instanceof Element\n )\n ) {\n throw new TypeError(\n 'Context must be an object of type \"Document\", \"DocumentFragment\", or \"Element\".',\n );\n }\n // This is a selector, query the elements.\n else if (typeof selector === 'string') {\n elements = context.querySelectorAll(selector);\n }\n // This is a single element.\n else if (selector instanceof Element) {\n elements = [selector];\n }\n\n // Make sure an array is returned and not a NodeList or an Array-like object.\n return Array.prototype.slice.call(elements);\n}\n\n/**\n * A helper for applying DOM changes to a filtered set of elements.\n *\n * This makes it possible to filter items that are not instances of Element,\n * then modify their DOM attributes in a single array traversal.\n *\n * @private\n *\n * @param {string} selector\n * A CSS selector to check against to each element in the array.\n * @param {Array.<Element>} elements\n * A NodeList or array of elements passed by a call to a once() function.\n * @param {function} [apply]\n * An optional function to apply on all matched elements.\n *\n * @return {Array.<Element>}\n * The array of elements that match the CSS selector.\n */\nfunction filterAndModify(selector, elements, apply) {\n return elements.filter((element) => {\n const selected = checkElement(element) && element.matches(selector);\n if (selected && apply) {\n apply(element);\n }\n return selected;\n });\n}\n\n/**\n * Add or remove an item from a list of once values.\n *\n * This function removes duplicates while adding or removing a once id in a\n * single array traversal.\n *\n * @private\n *\n * @param {Element} element\n * A space separated string of once ids from a data-drupal-once attribute.\n * @param {string} [add]\n * The once id to add to the list of values.\n * @param {string} [remove]\n * The once id to remove from the list of values.\n *\n * @return {undefined}\n * Nothing to return this is a callback in a foreach.\n */\nfunction updateAttribute(element, { add, remove }) {\n const result = [];\n if (attr(element, 'has')) {\n attr(element, 'get')\n .trim()\n .split(wsRE)\n .forEach((item) => {\n if (result.indexOf(item) < 0 && item !== remove) {\n result.push(item);\n }\n });\n }\n if (add) {\n result.push(add);\n }\n const attribute = result.join(' ');\n attr(element, attribute === '' ? 'remove' : 'set', attribute);\n}\n\n/**\n * Ensures a JavaScript callback is only executed once on a set of elements.\n *\n * Filters a NodeList or array of elements, removing those already processed\n * by a callback with a given id.\n * This method adds a `data-once` attribute on DOM elements. The value of\n * this attribute identifies if a given callback has been executed on that\n * element.\n *\n * @global\n *\n * @example <caption>Basic usage</caption>\n * const elements = once('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once('my-once-id', document.querySelector('#some-id'));\n * @example <caption>Using a single element</caption>\n * // Once always returns an array, even when passing a single element. Some\n * // forms that can be used to keep code readable.\n * // Destructuring:\n * const [myElement] = once('my-once-id', document.body);\n * // By changing the resulting array, es5 compatible.\n * const myElement = once('my-once-id', document.body).shift();\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array of elements that have not yet been processed by a once call\n * with a given id.\n */\nfunction once(id, selector, context) {\n return filterAndModify(\n `:not(${attrSelector(id)})`,\n getElements(selector, context),\n (element) => updateAttribute(element, { add: id }),\n );\n}\n\n/**\n * Removes a once id from an element's data-drupal-once attribute value.\n *\n * If a once id is removed from an element's data-drupal-once attribute value,\n * the JavaScript callback associated with that id can be executed on that\n * element again.\n *\n * @method once.remove\n *\n * @example <caption>Basic usage</caption>\n * const elements = once.remove('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.remove('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.remove('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.remove('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.remove('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.remove('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of a once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that had been processed by the provided id,\n * and are now able to be processed again.\n */\nonce.remove = (id, selector, context) => {\n return filterAndModify(\n attrSelector(id),\n getElements(selector, context),\n (element) => updateAttribute(element, { remove: id }),\n );\n};\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Behaves like {@link once} and {@link once.remove} without changing the DOM.\n * To select all DOM nodes processed by a given id, use {@link once.find}.\n *\n * @method once.filter\n *\n * @example <caption>Basic usage</caption>\n * const filteredElements = once.filter('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.filter('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.filter('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.filter('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.filter('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.filter('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.filter = (id, selector, context) =>\n filterAndModify(attrSelector(id), getElements(selector, context));\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Query the 'context' element for elements that already have the\n * corresponding once id value.\n *\n * @method once.find\n *\n * @example <caption>Basic usage</caption>\n * const oncedElements = once.find('my-once-id');\n * @example <caption>Input parameters accepted</caption>\n * // Call without parameters, return all elements with a `data-once` attribute.\n * once.find();\n * // Call without a context.\n * once.find('my-once-id');\n * // Call with a context.\n * once.find('my-once-id', document.head);\n *\n * @param {string} [id]\n * The id of the once call.\n * @param {Document|DocumentFragment|Element} [context=document]\n * Scope of the search for matching elements.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.find = (id, context) =>\n getElements(!id ? `[${attrName}]` : attrSelector(id), context);\n\nexport default once;\n","import Carousel from \"./Carousel.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n carouselSelector = \".carousel\"\n) => {\n once(\"graupl-carousel-generator\", carouselSelector, context).forEach(\n (carouselElement) => {\n const carouselOptions = carouselElement.dataset.grauplCarouselOptions\n ? JSON.parse(\n carouselElement.dataset.grauplCarouselOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Carousel({\n carouselElement,\n initialize: true,\n ...options,\n ...carouselOptions,\n });\n }\n );\n};\n\nexport default generate;\n"],"x_google_ignoreList":[5],"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,E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sBAAsBG,QAAQ,KAAM,GAAA,CAC9D,GAAK,CAAA,EACL,CAAA,EAEJ,IAAId,EAAS,CACXQ,gBAAAA,EACAO,WAAY,GACZ,GAAGZ,EACH,GAAGM,EACJ,KAKP,IAAA,GAAeP"}
|
|
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","Tab","Object","find","preventEvent","preventDefault","stopPropagation","isValidInstance","constructor","elements","elementsType","TypeError","key","elementType","name","status","error","isValidType","type","values","valuesType","valueType","isQuerySelector","Error","document","querySelector","isValidClassList","Array","isArray","forEach","value","obj","isValidHoverType","validTypes","includes","join","isTag","tagName","HTMLElement","tag","toLowerCase","check","isValidState","validStates","isValidEvent","validEvents","isValidType","initializeStorage","type","window","Graupl","getStorage","setStorage","data","clearStorage","pushToStorage","key","value","getFromStorage","removeFromStorage","isValidInstance","isValidType","isValidClassList","isQuerySelector","isValidState","isValidEvent","storage","Component","_dom","_protectedDOMElements","_selectors","_elements","_classes","initialize","_durations","_delays","_focusState","_currentEvent","_breakpoint","_mediaQueryString","_mediaQueryList","_mediaQueryListEventCallback","event","matches","_intervals","_timeouts","_listeners","_events","_prefix","_key","_storageKey","_id","_valid","_errors","constructor","prefix","key","initializeClass","_validate","Error","name","errors","join","_generateKey","error","console","init","dom","selectors","elements","classes","durations","delays","intervals","timeouts","listeners","events","value","focusState","currentEvent","breakpoint","mediaQuery","Object","keys","length","domElements","domKey","Array","isArray","forEach","element","index","domChecks","HTMLElement","push","message","querySelectors","querySelector","querySelectorChecks","className","classListChecks","status","durationName","durationChecks","delayName","delayChecks","keyCheck","prefixCheck","regenerate","Math","random","toString","replace","substring","_setIds","_setAriaAttributes","_setCustomProps","_setDOMElementType","elementType","context","overwrite","strict","includes","from","querySelectorAll","filteredElements","filter","item","parentElement","_resetDOMElementType","_setDOMElements","_createChildElements","_handleMediaMatch","_breakpointWidth","window","matchMedia","addEventListener","_handleFocus","_handleClick","_handleKeydown","_handleKeyup","_store","initializeStorage","pushToStorage","_unstore","removeFromStorage","_setInterval","callback","delay","scope","_clearInterval","setInterval","clearInterval","_setTimeout","_clearTimeout","setTimeout","clearTimeout","_dispatchEvent","eventType","dispatchEvent","_addEventListener","type","listener","options","_removeEventListener","removeEventListener","indexOf","splice","_removeEventListeners","dispose","addClass","removeClass","preventEvent","keyPress","isTag","isValidClassList","isValidType","Component","Carousel","_dom","carousel","carouselItems","carouselItemContainer","carouselControls","carouselControlContainer","carouselTabs","carouselTabContainer","autoplay","next","previous","_protectedDOMElements","_selectors","_classes","active","play","pause","initialize","_durations","transition","_delays","_currentItem","_autoplay","_playText","_pauseText","_currentAction","_storageKey","constructor","carouselElement","carouselItemSelector","carouselItemContainerSelector","carouselControlSelector","carouselControlContainerSelector","carouselTabSelector","carouselTabContainerSelector","autoplaySelector","nextSelector","previousSelector","activeClass","previousClass","nextClass","playClass","pauseClass","transitionDelay","transitionDuration","playText","pauseText","prefix","key","initializeClass","dom","_setDOMElements","_setIds","_setAriaAttributes","_setCustomProps","activateFirstItem","_handleAutoplay","_handleFocus","_handleClick","_handleHover","_handleKeydown","_handleKeyup","_store","error","console","requestAnimationFrame","value","currentItem","length","tabs","querySelectorAll","selectors","carouselTab","forEach","item","index","setAttribute","currentCarouselItem","currentCarouselTab","_setTransitionDuration","currentAction","_validate","booleans","booleanChecks","_errors","push","message","_valid","strings","stringChecks","_setDOMElementType","context","id","tab","_id","getAttribute","style","setProperty","_setInterval","activateNextItem","_clearInterval","_addEventListener","activatePreviousItem","toggleAutoplay","activateItem","control","event","activateCurrentItem","deactivateCurrentItem","currentIndex","dataset","grauplAction","setTimeout","activateLastItem","wsRE","attrName","doc","document","attr","element","op","value","attrSelector","id","TypeError","test","RangeError","checkElement","itemToCheck","Element","getElements","selector","context","elements","Document","DocumentFragment","querySelectorAll","Array","prototype","slice","call","filterAndModify","apply","filter","selected","matches","updateAttribute","add","remove","result","trim","split","forEach","item","indexOf","push","attribute","join","once","find","Carousel","once","generate","options","context","document","carouselSelector","forEach","carouselElement","carouselOptions","dataset","grauplCarouselOptions","JSON","parse","replace","initialize"],"sources":["../../../packages/core/src/js/domHelpers.js","../../../packages/core/src/js/eventHandlers.js","../../../packages/core/src/js/validate.js","../../../packages/core/src/js/storage.js","../../../packages/core/src/js/Component.js","../../../packages/core/src/js/carousel/Carousel.js","../../../node_modules/@drupal/once/src/once.js","../../../packages/core/src/js/carousel/generator.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 Tab: key === \"Tab\" || key === 9,\n };\n\n return Object.keys(keys).find((key) => keys[key] === true) || \"\";\n } catch {\n // Return an empty string if something goes wrong.\n return \"\";\n }\n}\n\n/**\n * Stops an event from taking action.\n *\n * @param {Event} event - The event.\n */\nexport function preventEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n","/**\n * Check to see if the provided elements have a specific constructor.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking instanceof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {object} constructor - The constructor to check for.\n * @param {object} elements - The element(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidInstance(constructor, elements) {\n try {\n if (typeof elements !== \"object\") {\n const elementsType = typeof elements;\n\n throw new TypeError(\n `Elements given to isValidInstance() must be inside of an object. \"${elementsType}\" given.`\n );\n }\n\n for (const key in elements) {\n if (!(elements[key] instanceof constructor)) {\n const elementType = typeof elements[key];\n throw new TypeError(\n `${key} must be an instance of ${constructor.name}. \"${elementType}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are of a specific type.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * This is essentially just a wrapper function around checking typeof with\n * more descriptive error message to help debugging.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {string} type - The type to check for.\n * @param {object} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidType(type, values) {\n try {\n if (typeof values !== \"object\") {\n const valuesType = typeof values;\n\n throw new TypeError(\n `Values given to isValidType() must be inside of an object. \"${valuesType}\" given.`\n );\n }\n\n for (const key in values) {\n const valueType = typeof values[key];\n\n if (valueType !== type) {\n throw new TypeError(`${key} must be a ${type}. \"${valueType}\" given.`);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided values are valid query selectors.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isQuerySelector(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isQuerySelector() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n try {\n if (values[key] === null) {\n throw new Error();\n }\n\n document.querySelector(values[key]);\n } catch {\n throw new TypeError(\n `${key} must be a valid query selector. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided value is either a string or an array of strings.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string, string[]>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidClassList(values) {\n try {\n if (typeof values !== \"object\" || Array.isArray(values)) {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidClassList() must be inside of an object. \"${type}\" given.`\n );\n }\n\n for (const key in values) {\n const type = typeof values[key];\n\n if (type !== \"string\") {\n if (Array.isArray(values[key])) {\n values[key].forEach((value) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `${key} must be a string or an array of strings. An array containing non-strings given.`\n );\n }\n });\n } else {\n throw new TypeError(\n `${key} must be a string or an array of strings. \"${type}\" given.`\n );\n }\n } else {\n const obj = {};\n obj[key] = values[key];\n\n isQuerySelector(obj);\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid hover types.\n *\n * Available types are: `\"off\"`, `\"on\"`, and `\"dynamic\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidHoverType(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidHoverType() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validTypes = [\"off\", \"on\", \"dynamic\"];\n\n for (const key in values) {\n if (!validTypes.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validTypes.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Checks to see if the provided elements are using a specific tag.\n *\n * The elements must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `true` if the check is successful.\n *\n * @param {string} tagName - The name of the tag.\n * @param {Object<HTMLElement>} elements - The element(s) to check.\n * @return {boolean} - The result of the check.\n */\nexport function isTag(tagName, elements) {\n if (\n isValidType(\"string\", { tagName }).status &&\n isValidInstance(HTMLElement, elements).status\n ) {\n const tag = tagName.toLowerCase();\n let check = true;\n\n for (const key in elements) {\n if (elements[key].tagName.toLowerCase() !== tag) check = false;\n }\n\n return check;\n } else {\n return false;\n }\n}\n\n/**\n * Check to see if the provided values are valid focus states for a menu.\n *\n * Available states are: `\"none\"`, `\"self\"`, and `\"child\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidState(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidState() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validStates = [\"none\", \"self\", \"child\"];\n\n for (const key in values) {\n if (!validStates.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validStates.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n\n/**\n * Check to see if the provided values are valid event types for a menu.\n *\n * Available events are: `\"none\"`, `\"mouse\"`, `\"keyboard\"`, and `\"character\"`.\n *\n * The values must be provided inside of an object\n * so the variable name can be retrieved in case of errors.\n *\n * Will return `{ status: true }` if the check is successful.\n *\n * @param {Object<string>} values - The value(s) to check.\n * @return {Object<boolean, string>} - The result of the check.\n */\nexport function isValidEvent(values) {\n try {\n if (typeof values !== \"object\") {\n const type = typeof values;\n\n throw new TypeError(\n `Values given to isValidEvent() must be inside of an object. \"${type}\" given.`\n );\n }\n\n const validEvents = [\"none\", \"mouse\", \"keyboard\", \"character\"];\n\n for (const key in values) {\n if (!validEvents.includes(values[key])) {\n throw new TypeError(\n `${key} must be one of the following values: ${validEvents.join(\n \", \"\n )}. \"${values[key]}\" given.`\n );\n }\n }\n\n return {\n status: true,\n error: null,\n };\n } catch (error) {\n return {\n status: false,\n error,\n };\n }\n}\n","/**\n * @file\n * Provides a system to get and store Graupl data in the browser.\n */\n\nimport { isValidType } from \"./validate.js\";\n\n/**\n * Initializes the storage system.\n *\n * @param {?string} [type = null] - The type of storage to initialize.\n */\nexport function initializeStorage(type = null) {\n window.Graupl = window.Graupl || {};\n\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = window.Graupl[type] || {};\n }\n}\n\n/**\n * Get the storage object.\n *\n * @param {?string} type - The type of storage to get.\n * @return {object} - The storage object.\n */\nexport function getStorage(type = null) {\n if (isValidType(\"string\", { type })) {\n return window.Graupl[type];\n }\n\n return window.Graupl;\n}\n\n/**\n * Set the storage object of a given type.\n *\n * @param {string} type - The type of storage to set.\n * @param {object} data - The data to set.\n */\nexport function setStorage(type, data = {}) {\n if (isValidType(\"string\", { type }) && isValidType(\"object\", { data })) {\n window.Graupl[type] = data;\n }\n}\n\n/**\n * Clear the storage object of a given type.\n *\n * @param {string} type - The type of storage to clear.\n */\nexport function clearStorage(type) {\n if (isValidType(\"string\", { type })) {\n window.Graupl[type] = {};\n }\n}\n\n/**\n * Push a value to the storage object.\n *\n * @param {string} type - The type of storage to push to.\n * @param {string} key - The key to use for the value.\n * @param {*} value - The value to store.\n */\nexport function pushToStorage(type, key, value) {\n if (isValidType(\"string\", { type, key })) {\n window.Graupl[type][key] = value;\n }\n}\n\n/**\n * Get a value from the storage object.\n *\n * @param {string }type - The type of storage to get from.\n * @param {string }key - The key to get the value from.\n * @return {*} - The value from the storage object.\n */\nexport function getFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n return window.Graupl[type][key];\n }\n\n return null;\n}\n\n/**\n * Remove a value from the storage object.\n *\n * @param {string} type - The type of storage to remove from.\n * @param {string} key - The key to remove the value from.\n */\nexport function removeFromStorage(type, key) {\n if (isValidType(\"string\", { type, key })) {\n delete window.Graupl[type][key];\n }\n}\n\nexport default {\n initializeStorage,\n getStorage,\n setStorage,\n clearStorage,\n pushToStorage,\n getFromStorage,\n removeFromStorage,\n};\n","/**\n * @file\n * A generic component class.\n */\n\nimport {\n isValidInstance,\n isValidType,\n isValidClassList,\n isQuerySelector,\n isValidState,\n isValidEvent,\n} from \"./validate.js\";\nimport storage from \"./storage.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 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 * @\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\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 key used for storage.\n *\n * @protected\n *\n * @type {string}\n */\n _storageKey = \"components\";\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 errors found throughout the component.\n *\n * @protected\n *\n * @type {string[]}\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.constructor.name}: Cannot initialize component. The following errors have been found:\\n - ${this.errors.join(\"\\n - \")}`\n );\n }\n\n this._generateKey();\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 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 {object}\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 * 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 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 * 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 // 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 }\n\n domElements[`${domKey}Element`] = this._dom[domKey];\n }\n\n // Check the DOM elements.\n const domChecks = isValidInstance(HTMLElement, domElements);\n\n // Handle DOM check failure.\n if (!domChecks) {\n this._errors.push(domChecks.message);\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\n // Handle query selector check failure.\n if (!querySelectorChecks) {\n this._errors.push(querySelectorChecks.message);\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);\n\n // Handle class list check failure.\n if (!classListChecks.status) {\n this._errors.push(classListChecks.error.message);\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\n // Handle duration check failure.\n if (!durationChecks.status) {\n this._errors.push(durationChecks.error.message);\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);\n\n // Handle delay check failure.\n if (!delayChecks.status) {\n this._errors.push(delayChecks.error.message);\n this._valid = false;\n }\n }\n\n // Key check.\n if (this._key !== \"\") {\n // Check the key.\n const keyCheck = isValidType(\"string\", { key: this._key });\n\n // Handle key check failure.\n if (!keyCheck.status) {\n this._errors.push(keyCheck.error.message);\n this._valid = false;\n }\n }\n\n // Prefix check.\n if (this._prefix !== \"\") {\n const prefixCheck = isValidType(\"string\", { prefix: this._prefix });\n\n if (!prefixCheck.status) {\n this._errors.push(prefixCheck.error.message);\n this._valid = false;\n }\n }\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 = true] - A flag to set if the elements must be direct children of the base.\n */\n _setDOMElementType(\n elementType,\n { context, overwrite = true, strict = true } = {}\n ) {\n // Make sure the element type is valid.\n if (typeof this.selectors[elementType] !== \"string\") {\n throw new Error(\n `Graupl ${this.constructor.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 (this._protectedDOMElements.includes(elementType)) {\n throw new Error(\n `Graupl ${this.constructor.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.constructor.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 (this._protectedDOMElements.includes(elementType)) {\n throw new Error(\n `Graupl ${this.constructor.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._breakpointWidth === \"\") {\n return;\n }\n\n this._mediaQueryList = window.matchMedia(this.mediaQuery);\n this._mediaQueryList.addEventListener(\n \"change\",\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 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 // Set up the storage.\n storage.initializeStorage(this._storageKey);\n storage.pushToStorage(\n this._storageKey,\n this._id !== \"\" ? this._id : this._key,\n this\n );\n }\n\n /**\n * Removes the component from the global Graupl storage object.\n *\n * @protected\n */\n _unstore() {\n storage.removeFromStorage(\n this._storageKey,\n this._id !== \"\" ? this._id : this._key\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 the 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 * 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 the 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 * 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 if (!Object.keys(this.events).includes(eventType)) {\n throw new Error(\n `Graupl ${this.constructor.name}: \"${eventType}\" is not a valid event type.`\n );\n }\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 to an element and unregister 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 _removeEventListener(type, element, listener, options = {}) {\n // Remove the listener.\n element.removeEventListener(type, listener, options);\n\n // Remove it from the component storage.\n const index = this._listeners.indexOf({\n type,\n element,\n listener,\n options,\n });\n\n if (index !== -1) {\n this._listeners.splice(index);\n }\n }\n\n /**\n * Removes all event listeners registered in the component.\n *\n * @protected\n */\n _removeEventListeners() {\n this._listeners.forEach(({ type, element, listener, options }) => {\n this._removeEventListener(type, element, listener, options);\n });\n }\n\n /**\n * Disposes of the current instantiated component.\n *\n * Removes all event listeners and delete's the object.\n */\n dispose() {\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\nclass Carousel extends Component {\n /**\n * The DOM elements within the carousel.\n *\n * @protected\n *\n * @type {Object<HTMLElement, HTMLElement[]>}\n *\n * @property {HTMLElement} carousel - The carousel element.\n * @property {HTMLElement[]} carouselItems - The carousel items.\n * @property {HTMLElement} carouselItemContainer - The carousel item container.\n * @property {HTMLElement[]} carouselControls - The carousel controls.\n * @property {HTMLElement} carouselControlContainer - The carousel control container.\n * @property {HTMLElement[]} carouselTabs - The carousel tabs.\n * @property {HTMLElement} carouselTabContainer - The carousel tab container.\n * @property {HTMLElement} autoplay - The autoplay button.\n * @property {HTMLElement} next - The next button.\n * @property {HTMLElement} previous - The previous button.\n */\n _dom = {\n carousel: null,\n carouselItems: [],\n carouselItemContainer: null,\n carouselControls: [],\n carouselControlContainer: null,\n carouselTabs: [],\n carouselTabContainer: null,\n autoplay: null,\n next: null,\n previous: null,\n };\n\n /**\n * The DOM elements within the carousel that cannot be reset or generated by the carousel itself.\n *\n * @protected\n *\n * @type {string[]}\n */\n _protectedDOMElements = [\"carousel\"];\n\n /**\n * The query selectors used by the carousel.\n *\n * @protected\n *\n * @type {Object<string>}\n *\n * @property {string} carouselItems - The query selector string for carousel items.\n * @property {string} carouselItemContainer - The query selector string for the carousel item container.\n * @property {string} carouselControls - The query selector string for carousel controls.\n * @property {string} carouselControlContainer - The query selector string for carousel control container.\n * @property {string} carouselTabs - The query selector string for the carousel tabs.\n * @property {string} carouselTabContainer - The query selector string for the carousel tab container.\n * @property {string} autoplay - The query selector string for the autoplay button.\n * @property {string} next - The query selector string for the next button.\n * @property {string} previous - The query selector string for the previous button.\n */\n _selectors = {\n carouselItems: \"\",\n carouselItemContainer: \"\",\n carouselControls: \"\",\n carouselControlContainer: \"\",\n carouselTabs: \"\",\n carouselTabContainer: \"\",\n autoplay: \"\",\n next: \"\",\n previous: \"\",\n };\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 * @property {string|string[]} active - The class(es) to apply when a carousel item is active.\n * @property {string|string[]} previous - The class(es) to apply to a carousel item that is the previously active item.\n * @property {string|string[]} next - The class(es) to apply to a carousel item that is the next active item.\n * @property {string|string[]} play - The class(es) to apply to the autoplay button when the carousel is paused.\n * @property {string|string[]} pause - The class(es) to apply to the autoplay button when the carousel is playing.\n * @property {string|string[]} initialize - The class(es) to apply when the carousel is initializing.\n */\n _classes = {\n active: \"active\",\n previous: \"previous\",\n next: \"next\",\n play: \"play\",\n pause: \"pause\",\n initialize: \"initializing\",\n };\n\n /**\n * The duration times (in milliseconds) for variouse aspects throughout the carousel.\n *\n * @protected\n *\n * @type {Object<number>}\n *\n * @property {number} transition - The duration time (in milliseconds) for the transition between carousel items.\n */\n _durations = {\n transition: 250,\n };\n\n /**\n * The delay times (in milliseconds) for various aspects throughout the component.\n *\n * @protected\n *\n * @type {Object<number>}\n *\n * @property {number} transition = The delay time (in milliseconds) for the transition between carousel items.\n */\n _delays = {\n transition: 10000,\n };\n\n /**\n * The index of the currently active carousel item.\n *\n * @protected\n *\n * @type {number}\n */\n _currentItem = 0;\n\n /**\n * A flag to indicate if the carousel is currently playing.\n *\n * @protected\n *\n * @type {boolean}\n */\n _autoplay = true;\n\n /**\n * The label for the autoplay button when the carousel is paused.\n *\n * @protected\n *\n * @type {string}\n */\n _playText = \"Play\";\n\n /**\n * The label for the autoplay button when the carousel is playing.\n *\n * @protected\n *\n * @type {string}\n */\n _pauseText = \"Pause\";\n\n /**\n * The current action being performed by the carousel.\n *\n * @protected\n *\n * @type {string}\n */\n _currentAction = \"next\";\n\n /**\n * The key used for storage.\n *\n * @protected\n *\n * @type {string}\n */\n _storageKey = \"carousels\";\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.carouselItemSelector = .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.carouselControlSelector = .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.carouselTabSelector = .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 carouselItemSelector = \".carousel-item\",\n carouselItemContainerSelector = \".carousel-item-container\",\n carouselControlSelector = \".carousel-control\",\n carouselControlContainerSelector = \".carousel-control-container\",\n carouselTabSelector = \".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\n // Set query selectors.\n this._selectors.carouselItems = carouselItemSelector;\n this._selectors.carouselItemContainer = carouselItemContainerSelector;\n this._selectors.carouselControls = carouselControlSelector;\n this._selectors.carouselControlContainer = carouselControlContainerSelector;\n this._selectors.carouselTabs = carouselTabSelector;\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 if (initialize) {\n this.initialize();\n }\n }\n\n /**\n * Initializes the carousel.\n */\n initialize() {\n try {\n // Add the initialization class.\n addClass(this._classes.initialize, this.dom.carousel);\n\n super.initialize();\n\n // Set up the DOM.\n this._setDOMElements();\n this._setIds();\n this._setAriaAttributes();\n this._setCustomProps();\n\n // Activate the first item.\n this.activateFirstItem();\n\n // Handle events.\n this._handleAutoplay();\n this._handleFocus();\n this._handleClick();\n this._handleHover();\n this._handleKeydown();\n this._handleKeyup();\n\n // Store the component.\n this._store();\n } catch (error) {\n console.error(error);\n } finally {\n // Remove the initialization class.\n requestAnimationFrame(() => {\n removeClass(this.initializeClass, this.dom.carousel);\n });\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 * Validates all aspects of the carousel to ensure proper functionality.\n *\n * @protected\n *\n * @return {boolean} - The results of the validation.\n */\n _validate() {\n super._validate();\n\n // Boolean checks.\n const booleans = {\n autoplay: this._autoplay,\n };\n\n // Check the booleans.\n const booleanChecks = isValidType(\"boolean\", booleans);\n\n // Handle boolean check failure.\n if (!booleanChecks) {\n this._errors.push(booleanChecks.message);\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\n // Handle string check failures.\n if (!stringChecks) {\n this._errors.push(stringChecks.message);\n this._valid = false;\n }\n\n return this._valid;\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 it's 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 }) &&\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 })) {\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 `pointerup` listener to the next control to activate the next item.\n * - Adds a `pointerup` listener to the previous control to activate the previous item.\n * - Adds a `pointerup` listener to the autoplay control to toggle autoplay.\n * - Adds a `pointerup` listener to each tab control to activate the corresponding item.\n */\n _handleClick() {\n this._addEventListener(\"pointerup\", this.dom.next, () => {\n this.activateNextItem();\n });\n\n this._addEventListener(\"pointerup\", this.dom.previous, () => {\n this.activatePreviousItem();\n });\n\n this._addEventListener(\"pointerup\", this.dom.autoplay, () => {\n this.toggleAutoplay();\n });\n\n this.dom.carouselTabs.forEach((tab, index) => {\n this._addEventListener(\"pointerup\", 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 item 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 item 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","/**\n * Mark DOM elements as processed to prevent multiple initializations.\n *\n * @module @drupal/once\n *\n * @example <!-- Use as a module -->\n * <script type=\"module\">\n * import once from 'https://unpkg.com/@drupal/once/src/once.js';\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n *\n * @example <!-- Use as a regular script -->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * const elements = once('my-once-id', 'div');\n * // Initialize elements.\n * elements.forEach(el => el.innerHTML = 'processed');\n * </script>\n * @example <!-- Using a single element as input-->\n * <script src=\"https://unpkg.com/@drupal/once\"></script>\n * <script>\n * // once methods always return an array, to simplify the use with a single\n * // element use destructuring or the shift method.\n * const [myElement] = once('my-once-id', document.body);\n * const myElement = once('my-once-id', document.body).shift();\n * </script>\n */\n\n/**\n * Illegal spaces in ids.\n *\n * @private\n *\n * @type {RegExp}\n */\nconst wsRE = /[\\11\\12\\14\\15\\40]+/;\n\n/**\n * Name of the HTML attribute containing an element's once ids.\n *\n * @private\n *\n * @type {string}\n */\nconst attrName = 'data-once';\n\n/**\n * Shortcut to access the html element.\n *\n * @private\n *\n * @type {HTMLElement}\n */\nconst doc = document;\n\n/**\n * Helper to access element attributes.\n *\n * @private\n *\n * @param {Element} element\n * The Element to access the data-once attribute from.\n * @param {string} op\n * The action to take on the element.\n * @param {string} [value]\n * Optional value for setAttribute.\n *\n * @return {string|undefined|null|boolean}\n * Result of the attribute method.\n */\nfunction attr(element, op, value) {\n return element[`${op}Attribute`](attrName, value);\n}\n\n/**\n * Return the attribute selector.\n *\n * @private\n *\n * @param {string} id\n * The id passed by a call to a once() function.\n *\n * @return {string}\n * The full CSS attribute selector.\n *\n * @throws {TypeError|RangeError}\n */\nfunction attrSelector(id) {\n // Verify the validity of the once id.\n if (typeof id !== 'string') {\n throw new TypeError('once ID must be a string');\n }\n if (id === '' || wsRE.test(id)) {\n throw new RangeError('once ID must not be empty or contain spaces');\n }\n // The id is valid, return the full CSS selector.\n return `[${attrName}~=\"${id}\"]`;\n}\n\n/**\n * Verifies that an item is an instance of Element.\n *\n * This function is used during filtering to ensure only DOM elements are\n * processed. once() makes use of get/setAttribute, which are methods\n * inherited from the Element object, so only of Element can be used.\n *\n * @private\n *\n * @param {*} itemToCheck\n * The item to check.\n *\n * @return {boolean}\n * True if the item is an instance of Element\n *\n * @throws {TypeError}\n */\nfunction checkElement(itemToCheck) {\n if (!(itemToCheck instanceof Element)) {\n throw new TypeError('The element must be an instance of Element');\n }\n return true;\n}\n\n/**\n * Process arguments, query the DOM if necessary.\n *\n * @private\n *\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array with the processed Id and the list of elements to process.\n */\nfunction getElements(selector, context = doc) {\n // Assume selector is an array-like value.\n let elements = selector;\n\n // If selector is null it is most likely because of a call to querySelector\n // that didn't return a result.\n if (selector === null) {\n elements = [];\n }\n // The selector is undefined, error out.\n else if (!selector) {\n throw new TypeError('Selector must not be empty');\n }\n // Context doesn't implement querySelectorAll, error out.\n else if (\n !(\n context instanceof Document ||\n context instanceof DocumentFragment ||\n context instanceof Element\n )\n ) {\n throw new TypeError(\n 'Context must be an object of type \"Document\", \"DocumentFragment\", or \"Element\".',\n );\n }\n // This is a selector, query the elements.\n else if (typeof selector === 'string') {\n elements = context.querySelectorAll(selector);\n }\n // This is a single element.\n else if (selector instanceof Element) {\n elements = [selector];\n }\n\n // Make sure an array is returned and not a NodeList or an Array-like object.\n return Array.prototype.slice.call(elements);\n}\n\n/**\n * A helper for applying DOM changes to a filtered set of elements.\n *\n * This makes it possible to filter items that are not instances of Element,\n * then modify their DOM attributes in a single array traversal.\n *\n * @private\n *\n * @param {string} selector\n * A CSS selector to check against to each element in the array.\n * @param {Array.<Element>} elements\n * A NodeList or array of elements passed by a call to a once() function.\n * @param {function} [apply]\n * An optional function to apply on all matched elements.\n *\n * @return {Array.<Element>}\n * The array of elements that match the CSS selector.\n */\nfunction filterAndModify(selector, elements, apply) {\n return elements.filter((element) => {\n const selected = checkElement(element) && element.matches(selector);\n if (selected && apply) {\n apply(element);\n }\n return selected;\n });\n}\n\n/**\n * Add or remove an item from a list of once values.\n *\n * This function removes duplicates while adding or removing a once id in a\n * single array traversal.\n *\n * @private\n *\n * @param {Element} element\n * A space separated string of once ids from a data-drupal-once attribute.\n * @param {string} [add]\n * The once id to add to the list of values.\n * @param {string} [remove]\n * The once id to remove from the list of values.\n *\n * @return {undefined}\n * Nothing to return this is a callback in a foreach.\n */\nfunction updateAttribute(element, { add, remove }) {\n const result = [];\n if (attr(element, 'has')) {\n attr(element, 'get')\n .trim()\n .split(wsRE)\n .forEach((item) => {\n if (result.indexOf(item) < 0 && item !== remove) {\n result.push(item);\n }\n });\n }\n if (add) {\n result.push(add);\n }\n const attribute = result.join(' ');\n attr(element, attribute === '' ? 'remove' : 'set', attribute);\n}\n\n/**\n * Ensures a JavaScript callback is only executed once on a set of elements.\n *\n * Filters a NodeList or array of elements, removing those already processed\n * by a callback with a given id.\n * This method adds a `data-once` attribute on DOM elements. The value of\n * this attribute identifies if a given callback has been executed on that\n * element.\n *\n * @global\n *\n * @example <caption>Basic usage</caption>\n * const elements = once('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once('my-once-id', document.querySelector('#some-id'));\n * @example <caption>Using a single element</caption>\n * // Once always returns an array, even when passing a single element. Some\n * // forms that can be used to keep code readable.\n * // Destructuring:\n * const [myElement] = once('my-once-id', document.body);\n * // By changing the resulting array, es5 compatible.\n * const myElement = once('my-once-id', document.body).shift();\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements.\n * @param {Document|DocumentFragment|Element} [context=document]\n * An element or document object to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * An array of elements that have not yet been processed by a once call\n * with a given id.\n */\nfunction once(id, selector, context) {\n return filterAndModify(\n `:not(${attrSelector(id)})`,\n getElements(selector, context),\n (element) => updateAttribute(element, { add: id }),\n );\n}\n\n/**\n * Removes a once id from an element's data-drupal-once attribute value.\n *\n * If a once id is removed from an element's data-drupal-once attribute value,\n * the JavaScript callback associated with that id can be executed on that\n * element again.\n *\n * @method once.remove\n *\n * @example <caption>Basic usage</caption>\n * const elements = once.remove('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.remove('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.remove('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.remove('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.remove('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.remove('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of a once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that had been processed by the provided id,\n * and are now able to be processed again.\n */\nonce.remove = (id, selector, context) => {\n return filterAndModify(\n attrSelector(id),\n getElements(selector, context),\n (element) => updateAttribute(element, { remove: id }),\n );\n};\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Behaves like {@link once} and {@link once.remove} without changing the DOM.\n * To select all DOM nodes processed by a given id, use {@link once.find}.\n *\n * @method once.filter\n *\n * @example <caption>Basic usage</caption>\n * const filteredElements = once.filter('my-once-id', '[data-myelement]');\n * @example <caption>Input parameters accepted</caption>\n * // NodeList.\n * once.filter('my-once-id', document.querySelectorAll('[data-myelement]'));\n * // Array or Array-like of Element.\n * once.filter('my-once-id', jQuery('[data-myelement]'));\n * // A CSS selector without a context.\n * once.filter('my-once-id', '[data-myelement]');\n * // A CSS selector with a context.\n * once.filter('my-once-id', '[data-myelement]', document.head);\n * // Single Element.\n * once.filter('my-once-id', document.querySelector('#some-id'));\n *\n * @param {string} id\n * The id of the once call.\n * @param {NodeList|Array.<Element>|Element|string} selector\n * A NodeList or array of elements to remove the once id from.\n * @param {Document|Element} [context=document]\n * An element to use as context for querySelectorAll.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.filter = (id, selector, context) =>\n filterAndModify(attrSelector(id), getElements(selector, context));\n\n/**\n * Finds elements that have been processed by a given once id.\n *\n * Query the 'context' element for elements that already have the\n * corresponding once id value.\n *\n * @method once.find\n *\n * @example <caption>Basic usage</caption>\n * const oncedElements = once.find('my-once-id');\n * @example <caption>Input parameters accepted</caption>\n * // Call without parameters, return all elements with a `data-once` attribute.\n * once.find();\n * // Call without a context.\n * once.find('my-once-id');\n * // Call with a context.\n * once.find('my-once-id', document.head);\n *\n * @param {string} [id]\n * The id of the once call.\n * @param {Document|DocumentFragment|Element} [context=document]\n * Scope of the search for matching elements.\n *\n * @return {Array.<Element>}\n * A filtered array of elements that have already been processed by the\n * provided once id.\n */\nonce.find = (id, context) =>\n getElements(!id ? `[${attrName}]` : attrSelector(id), context);\n\nexport default once;\n","import Carousel from \"./Carousel.js\";\nimport once from \"@drupal/once\";\n\nconst generate = (\n options = {},\n context = document,\n carouselSelector = \".carousel\"\n) => {\n once(\"graupl-carousel-generator\", carouselSelector, context).forEach(\n (carouselElement) => {\n const carouselOptions = carouselElement.dataset.grauplCarouselOptions\n ? JSON.parse(\n carouselElement.dataset.grauplCarouselOptions.replace(/'/g, '\"')\n ) || {}\n : {};\n\n new Carousel({\n carouselElement,\n initialize: true,\n ...options,\n ...carouselOptions,\n });\n }\n );\n};\n\nexport default generate;\n"],"x_google_ignoreList":[6],"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,SAAW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