{"version":3,"file":"index9-DSPl_teu.js","sources":["../../../../node_modules/.pnpm/@ionic+core@8.4.1/node_modules/@ionic/core/components/index9.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { d as doc } from './index5.js';\nimport { p as pointerCoord } from './helpers.js';\n\nconst startTapClick = (config) => {\n if (doc === undefined) {\n return;\n }\n let lastActivated = 0;\n let activatableEle;\n let activeRipple;\n let activeDefer;\n const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);\n const clearDefers = new WeakMap();\n const cancelActive = () => {\n if (activeDefer)\n clearTimeout(activeDefer);\n activeDefer = undefined;\n if (activatableEle) {\n removeActivated(false);\n activatableEle = undefined;\n }\n };\n const pointerDown = (ev) => {\n // Ignore right clicks\n if (activatableEle || ev.button === 2) {\n return;\n }\n setActivatedElement(getActivatableTarget(ev), ev);\n };\n const pointerUp = (ev) => {\n setActivatedElement(undefined, ev);\n };\n const setActivatedElement = (el, ev) => {\n // do nothing\n if (el && el === activatableEle) {\n return;\n }\n if (activeDefer)\n clearTimeout(activeDefer);\n activeDefer = undefined;\n const { x, y } = pointerCoord(ev);\n // deactivate selected\n if (activatableEle) {\n if (clearDefers.has(activatableEle)) {\n throw new Error('internal error');\n }\n if (!activatableEle.classList.contains(ACTIVATED)) {\n addActivated(activatableEle, x, y);\n }\n removeActivated(true);\n }\n // activate\n if (el) {\n const deferId = clearDefers.get(el);\n if (deferId) {\n clearTimeout(deferId);\n clearDefers.delete(el);\n }\n el.classList.remove(ACTIVATED);\n const callback = () => {\n addActivated(el, x, y);\n activeDefer = undefined;\n };\n if (isInstant(el)) {\n callback();\n }\n else {\n activeDefer = setTimeout(callback, ADD_ACTIVATED_DEFERS);\n }\n }\n activatableEle = el;\n };\n const addActivated = (el, x, y) => {\n lastActivated = Date.now();\n el.classList.add(ACTIVATED);\n if (!useRippleEffect)\n return;\n const rippleEffect = getRippleEffect(el);\n if (rippleEffect !== null) {\n removeRipple();\n activeRipple = rippleEffect.addRipple(x, y);\n }\n };\n const removeRipple = () => {\n if (activeRipple !== undefined) {\n activeRipple.then((remove) => remove());\n activeRipple = undefined;\n }\n };\n const removeActivated = (smooth) => {\n removeRipple();\n const active = activatableEle;\n if (!active) {\n return;\n }\n const time = CLEAR_STATE_DEFERS - Date.now() + lastActivated;\n if (smooth && time > 0 && !isInstant(active)) {\n const deferId = setTimeout(() => {\n active.classList.remove(ACTIVATED);\n clearDefers.delete(active);\n }, CLEAR_STATE_DEFERS);\n clearDefers.set(active, deferId);\n }\n else {\n active.classList.remove(ACTIVATED);\n }\n };\n doc.addEventListener('ionGestureCaptured', cancelActive);\n doc.addEventListener('pointerdown', pointerDown, true);\n doc.addEventListener('pointerup', pointerUp, true);\n /**\n * Tap click effects such as the ripple effect should\n * not happen when scrolling. For example, if a user scrolls\n * the page but also happens to do a touchstart on a button\n * as part of the scroll, the ripple effect should not\n * be dispatched. The ripple effect should only happen\n * if the button is activated and the page is not scrolling.\n *\n * pointercancel is dispatched on a gesture when scrolling\n * starts, so this lets us avoid having to listen for\n * ion-content's scroll events.\n */\n doc.addEventListener('pointercancel', cancelActive, true);\n};\n// TODO(FW-2832): type\nconst getActivatableTarget = (ev) => {\n if (ev.composedPath !== undefined) {\n /**\n * composedPath returns EventTarget[]. However,\n * objects other than Element can be targets too.\n * For example, AudioContext can be a target. In this\n * case, we know that the event is a UIEvent so we\n * can assume that the path will contain either Element\n * or ShadowRoot.\n */\n const path = ev.composedPath();\n for (let i = 0; i < path.length - 2; i++) {\n const el = path[i];\n if (!(el instanceof ShadowRoot) && el.classList.contains('ion-activatable')) {\n return el;\n }\n }\n }\n else {\n return ev.target.closest('.ion-activatable');\n }\n};\nconst isInstant = (el) => {\n return el.classList.contains('ion-activatable-instant');\n};\nconst getRippleEffect = (el) => {\n if (el.shadowRoot) {\n const ripple = el.shadowRoot.querySelector('ion-ripple-effect');\n if (ripple) {\n return ripple;\n }\n }\n return el.querySelector('ion-ripple-effect');\n};\nconst ACTIVATED = 'ion-activated';\nconst ADD_ACTIVATED_DEFERS = 100;\nconst CLEAR_STATE_DEFERS = 150;\n\nexport { startTapClick };\n"],"names":["startTapClick","config","doc","lastActivated","activatableEle","activeRipple","activeDefer","useRippleEffect","clearDefers","cancelActive","removeActivated","pointerDown","ev","setActivatedElement","getActivatableTarget","pointerUp","el","x","y","pointerCoord","ACTIVATED","addActivated","deferId","callback","isInstant","ADD_ACTIVATED_DEFERS","rippleEffect","getRippleEffect","removeRipple","remove","smooth","active","time","CLEAR_STATE_DEFERS","path","i","ripple"],"mappings":"+CAAA;AAAA;AAAA,GAMK,MAACA,EAAiBC,GAAW,CAC9B,GAAIC,IAAQ,OACR,OAEJ,IAAIC,EAAgB,EAChBC,EACAC,EACAC,EACJ,MAAMC,EAAkBN,EAAO,WAAW,WAAY,EAAI,GAAKA,EAAO,WAAW,eAAgB,EAAI,EAC/FO,EAAc,IAAI,QAClBC,EAAe,IAAM,CACnBH,GACA,aAAaA,CAAW,EAC5BA,EAAc,OACVF,IACAM,EAAgB,EAAK,EACrBN,EAAiB,OAExB,EACKO,EAAeC,GAAO,CAEpBR,GAAkBQ,EAAG,SAAW,GAGpCC,EAAoBC,EAAqBF,CAAE,EAAGA,CAAE,CACnD,EACKG,EAAaH,GAAO,CACtBC,EAAoB,OAAWD,CAAE,CACpC,EACKC,EAAsB,CAACG,EAAIJ,IAAO,CAEpC,GAAII,GAAMA,IAAOZ,EACb,OAEAE,GACA,aAAaA,CAAW,EAC5BA,EAAc,OACd,KAAM,CAAE,EAAAW,EAAG,EAAAC,GAAMC,EAAaP,CAAE,EAEhC,GAAIR,EAAgB,CAChB,GAAII,EAAY,IAAIJ,CAAc,EAC9B,MAAM,IAAI,MAAM,gBAAgB,EAE/BA,EAAe,UAAU,SAASgB,CAAS,GAC5CC,EAAajB,EAAgBa,EAAGC,CAAC,EAErCR,EAAgB,EAAI,CAChC,CAEQ,GAAIM,EAAI,CACJ,MAAMM,EAAUd,EAAY,IAAIQ,CAA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