/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
import{d as t}from"./p-CsyYiC5f.js";import{q as i}from"./p-hPTD29t1.js";import"./p-gD7P82jx.js";import"./p-vXpMhGrs.js";const o=o=>{if(void 0===t)return;let f,p,u,l=0;const d=o.getBoolean("animated",!0)&&o.getBoolean("rippleEffect",!0),v=new WeakMap,m=()=>{u&&clearTimeout(u),u=void 0,f&&(h(!1),f=void 0)},T=(t,o)=>{if(t&&t===f)return;u&&clearTimeout(u),u=void 0;const{x:e,y:n}=i(o);if(f){if(v.has(f))throw new Error("internal error");f.classList.contains(a)||j(f,e,n),h(!0)}if(t){const i=v.get(t);i&&(clearTimeout(i),v.delete(t)),t.classList.remove(a);const o=()=>{j(t,e,n),u=void 0};r(t)?o():u=setTimeout(o,s)}f=t},j=(t,i,o)=>{if(l=Date.now(),t.classList.add(a),!d)return;const e=n(t);null!==e&&(w(),p=e.addRipple(i,o))},w=()=>{void 0!==p&&(p.then((t=>t())),p=void 0)},h=t=>{w();const i=f;if(!i)return;const o=c-Date.now()+l;if(t&&o>0&&!r(i)){const t=setTimeout((()=>{i.classList.remove(a),v.delete(i)}),c);v.set(i,t)}else i.classList.remove(a)};t.addEventListener("ionGestureCaptured",m),t.addEventListener("pointerdown",(t=>{f||2===t.button||T(e(t),t)}),!0),t.addEventListener("pointerup",(t=>{T(void 0,t)}),!0),t.addEventListener("pointercancel",m,!0)},e=t=>{if(void 0===t.composedPath)return t.target.closest(".ion-activatable");{const i=t.composedPath();for(let t=0;t<i.length-2;t++){const o=i[t];if(!(o instanceof ShadowRoot)&&o.classList.contains("ion-activatable"))return o}}},r=t=>t.classList.contains("ion-activatable-instant"),n=t=>{if(t.shadowRoot){const i=t.shadowRoot.querySelector("ion-ripple-effect");if(i)return i}return t.querySelector("ion-ripple-effect")},a="ion-activated",s=100,c=150;export{o as startTapClick}