{"version":3,"file":"index-D5BioG3x.js","sources":["../../../app/frontend/entrypoints/marketing/bootstrap/mdb-prefix/util/index.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000;\nconst MILLISECONDS_MULTIPLIER = 1000;\nconst TRANSITION_END = 'transitionend';\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = (obj) => {\n if (obj === null || obj === undefined) {\n return `${obj}`;\n }\n\n return {}.toString\n .call(obj)\n .match(/\\s([a-z]+)/i)[1]\n .toLowerCase();\n};\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = (prefix) => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID);\n } while (document.getElementById(prefix));\n\n return prefix;\n};\n\nconst getSelector = (element) => {\n let selector = element.getAttribute('data-mdb-target');\n\n if (!selector || selector === '#') {\n let hrefAttr = element.getAttribute('href');\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {\n return null;\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {\n hrefAttr = `#${hrefAttr.split('#')[1]}`;\n }\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;\n }\n\n return selector;\n};\n\nconst getSelectorFromElement = (element) => {\n const selector = getSelector(element);\n\n if (selector) {\n return document.querySelector(selector) ? selector : null;\n }\n\n return null;\n};\n\nconst getElementFromSelector = (element) => {\n const selector = getSelector(element);\n\n return selector ? document.querySelector(selector) : null;\n};\n\nconst getTransitionDurationFromElement = (element) => {\n if (!element) {\n return 0;\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element);\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration);\n const floatTransitionDelay = Number.parseFloat(transitionDelay);\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n\n return (\n (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) *\n MILLISECONDS_MULTIPLIER\n );\n};\n\nconst triggerTransitionEnd = (element) => {\n element.dispatchEvent(new Event(TRANSITION_END));\n};\n\nconst isElement = (obj) => {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n if (typeof obj.jquery !== 'undefined') {\n obj = obj[0];\n }\n\n return typeof obj.nodeType !== 'undefined';\n};\n\nconst getElement = (obj) => {\n if (isElement(obj)) {\n // it's a jQuery object or a node element\n return obj.jquery ? obj[0] : obj;\n }\n\n if (typeof obj === 'string' && obj.length > 0) {\n return document.querySelector(obj);\n }\n\n return null;\n};\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes).forEach((property) => {\n const expectedTypes = configTypes[property];\n const value = config[property];\n const valueType = value && isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `${componentName.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n );\n }\n });\n};\n\nconst isVisible = (element) => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false;\n }\n\n return getComputedStyle(element).getPropertyValue('visibility') === 'visible';\n};\n\nconst isDisabled = (element) => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n\n if (element.classList.contains('disabled')) {\n return true;\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled;\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false';\n};\n\nconst findShadowRoot = (element) => {\n if (!document.documentElement.attachShadow) {\n return null;\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null;\n }\n\n return findShadowRoot(element.parentNode);\n};\n\nconst noop = () => {};\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = (element) => {\n // eslint-disable-next-line no-unused-expressions\n element.offsetHeight;\n};\n\nconst getjQuery = () => {\n const { jQuery } = window;\n\n if (jQuery && !document.body.hasAttribute('data-mdb-no-jquery')) {\n return jQuery;\n }\n\n return null;\n};\n\nconst DOMContentLoadedCallbacks = [];\n\nconst onDOMContentLoaded = (callback) => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n DOMContentLoadedCallbacks.forEach((callback) => callback());\n });\n }\n\n DOMContentLoadedCallbacks.push(callback);\n } else {\n callback();\n }\n};\n\nconst isRTL = () => document.documentElement.dir === 'rtl';\n\nconst defineJQueryPlugin = (plugin) => {\n onDOMContentLoaded(() => {\n const $ = getjQuery();\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME;\n const JQUERY_NO_CONFLICT = $.fn[name];\n $.fn[name] = plugin.jQueryInterface;\n $.fn[name].Constructor = plugin;\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT;\n return plugin.jQueryInterface;\n };\n }\n });\n};\n\nconst execute = (callback) => {\n if (typeof callback === 'function') {\n callback();\n }\n};\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback);\n return;\n }\n\n const durationPadding = 5;\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding;\n\n let called = false;\n\n const handler = ({ target }) => {\n if (target !== transitionElement) {\n return;\n }\n\n called = true;\n transitionElement.removeEventListener(TRANSITION_END, handler);\n execute(callback);\n };\n\n transitionElement.addEventListener(TRANSITION_END, handler);\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement);\n }\n }, emulatedDuration);\n};\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n let index = list.indexOf(activeElement);\n\n // if the element does not exist in the list return an element depending on the direction and if cycle is allowed\n if (index === -1) {\n return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0];\n }\n\n const listLength = list.length;\n\n index += shouldGetNext ? 1 : -1;\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength;\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))];\n};\n\nexport {\n getElement,\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n typeCheckConfig,\n isVisible,\n isDisabled,\n findShadowRoot,\n noop,\n getNextActiveElement,\n reflow,\n getjQuery,\n onDOMContentLoaded,\n isRTL,\n defineJQueryPlugin,\n execute,\n executeAfterTransition,\n};\n"],"names":["TRANSITION_END","toType","obj","getUID","prefix","getSelector","element","selector","hrefAttr","getSelectorFromElement","getElementFromSelector","getTransitionDurationFromElement","transitionDuration","transitionDelay","floatTransitionDuration","floatTransitionDelay","triggerTransitionEnd","isElement","getElement","typeCheckConfig","componentName","config","configTypes","property","expectedTypes","value","valueType","isVisible","isDisabled","findShadowRoot","root","noop","reflow","getjQuery","jQuery","DOMContentLoadedCallbacks","onDOMContentLoaded","callback","isRTL","defineJQueryPlugin","plugin","$","name","JQUERY_NO_CONFLICT","execute","executeAfterTransition","transitionElement","waitForTransition","emulatedDuration","called","handler","target","getNextActiveElement","list","activeElement","shouldGetNext","isCycleAllowed","index","listLength"],"mappings":"AASA,MAAMA,EAAiB,gBAGjBC,EAAUC,GACVA,GAAQ,KACH,GAAGA,CAAG,GAGR,CAAE,EAAC,SACP,KAAKA,CAAG,EACR,MAAM,aAAa,EAAE,CAAC,EACtB,cASCC,EAAUC,GAAW,CACzB,GACEA,GAAU,KAAK,MAAM,KAAK,OAAM,EAAK,GAAO,QACrC,SAAS,eAAeA,CAAM,GAEvC,OAAOA,CACT,EAEMC,EAAeC,GAAY,CAC/B,IAAIC,EAAWD,EAAQ,aAAa,iBAAiB,EAErD,GAAI,CAACC,GAAYA,IAAa,IAAK,CACjC,IAAIC,EAAWF,EAAQ,aAAa,MAAM,EAM1C,GAAI,CAACE,GAAa,CAACA,EAAS,SAAS,GAAG,GAAK,CAACA,EAAS,WAAW,GAAG,EACnE,OAAO,KAILA,EAAS,SAAS,GAAG,GAAK,CAACA,EAAS,WAAW,GAAG,IACpDA,EAAW,IAAIA,EAAS,MAAM,GAAG,EAAE,CAAC,CAAC,IAGvCD,EAAWC,GAAYA,IAAa,IAAMA,EAAS,KAAM,EAAG,IAC7D,CAED,OAAOD,CACT,EAEME,EAA0BH,GAAY,CAC1C,MAAMC,EAAWF,EAAYC,CAAO,EAEpC,OAAIC,GACK,SAAS,cAAcA,CAAQ,EAAIA,EAGrC,IACT,EAEMG,EAA0BJ,GAAY,CAC1C,MAAMC,EAAWF,EAAYC,CAAO,EAEpC,OAAOC,EAAW,SAAS,cAAcA,CAAQ,EAAI,IACvD,EAEMI,EAAoCL,GAAY,CACpD,GAAI,CAACA,EACH,MAAO,GAIT,GAAI,CAAE,mBAAAM,EAAoB,gBAAAC,CAAe,EAAK,OAAO,iBAAiBP,CAAO,EAE7E,MAAMQ,EAA0B,OAAO,WAAWF,CAAkB,EAC9DG,EAAuB,OAAO,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