{"version":3,"sources":["./node_modules/@ionic/core/dist/esm/ion-ripple-effect.entry.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAA0I;AAC5G;;AAE9B;AACA;AACA,QAAQ,2DAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2DAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2DAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,WAAW;AACrE,4DAA4D,MAAM,MAAM,MAAM;AAC9E;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,qBAAqB,2DAAU;AAC/B,gBAAgB,2DAAC,CAAC,mDAAI,GAAG;AACzB;AACA;AACA,aAAa,EAAE;AACf;AACA,cAAc,QAAQ,2DAAU,OAAO;AACvC,wBAAwB,eAAe,OAAO,QAAQ,MAAM,SAAS,kBAAkB,eAAe,oBAAoB,kBAAkB,0BAA0B,eAAe,kBAAkB,kBAAkB,8BAA8B,cAAc,eAAe,UAAU,+EAA+E,uEAAuE,8BAA8B,oBAAoB,UAAU,8EAA8E,sEAAsE,iDAAiD,yCAAyC,oCAAoC,GAAG,0DAA0D,kDAAkD,2BAA2B,mBAAmB,GAAG,8EAA8E,uEAAuE,4BAA4B,GAAG,0DAA0D,kDAAkD,2BAA2B,mBAAmB,GAAG,8EAA8E,uEAAuE,oCAAoC,GAAG,yCAAyC,iCAAiC,UAAU,GAAG,aAAa,4BAA4B,GAAG,yCAAyC,iCAAiC,UAAU,GAAG,aAAa,qCAAqC,GAAG,yCAAyC,iCAAiC,YAAY,GAAG,WAAW,6BAA6B,GAAG,yCAAyC,iCAAiC,YAAY,GAAG,WAAW,EAAE;AACx6D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAE6C","file":"53-es2015.js","sourcesContent":["import { r as registerInstance, f as readTask, w as writeTask, c as getIonMode, h, e as getElement, H as Host } from './core-0a8d4d2e.js';\nimport './config-3c7f3790.js';\n\nconst RippleEffect = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * Sets the type of ripple-effect:\n *\n * - `bounded`: the ripple effect expands from the user's click position\n * - `unbounded`: the ripple effect expands from the center of the button and overflows the container.\n *\n * NOTE: Surfaces for bounded ripples should have the overflow property set to hidden,\n * while surfaces for unbounded ripples should have it set to visible.\n */\n this.type = 'bounded';\n }\n /**\n * Adds the ripple effect to the parent element.\n *\n * @param x The horizontal coordinate of where the ripple should start.\n * @param y The vertical coordinate of where the ripple should start.\n */\n async addRipple(x, y) {\n return new Promise(resolve => {\n readTask(() => {\n const rect = this.el.getBoundingClientRect();\n const width = rect.width;\n const height = rect.height;\n const hypotenuse = Math.sqrt(width * width + height * height);\n const maxDim = Math.max(height, width);\n const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;\n const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n const finalScale = maxRadius / initialSize;\n let posX = x - rect.left;\n let posY = y - rect.top;\n if (this.unbounded) {\n posX = width * 0.5;\n posY = height * 0.5;\n }\n const styleX = posX - initialSize * 0.5;\n const styleY = posY - initialSize * 0.5;\n const moveX = width * 0.5 - posX;\n const moveY = height * 0.5 - posY;\n writeTask(() => {\n const div = document.createElement('div');\n div.classList.add('ripple-effect');\n const style = div.style;\n style.top = styleY + 'px';\n style.left = styleX + 'px';\n style.width = style.height = initialSize + 'px';\n style.setProperty('--final-scale', `${finalScale}`);\n style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);\n const container = this.el.shadowRoot || this.el;\n container.appendChild(div);\n setTimeout(() => {\n resolve(() => {\n removeRipple(div);\n });\n }, 225 + 100);\n });\n });\n });\n }\n get unbounded() {\n return this.type === 'unbounded';\n }\n render() {\n const mode = getIonMode(this);\n return (h(Host, { role: \"presentation\", class: {\n [mode]: true,\n 'unbounded': this.unbounded\n } }));\n }\n get el() { return getElement(this); }\n static get style() { return \":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}:host(.unbounded){contain:layout size style}.ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:rippleAnimation 225ms forwards,fadeInAnimation 75ms forwards;animation:rippleAnimation 225ms forwards,fadeInAnimation 75ms forwards;will-change:transform,opacity;pointer-events:none}.fade-out{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1));-webkit-animation:fadeOutAnimation .15s forwards;animation:fadeOutAnimation .15s forwards}\\@-webkit-keyframes rippleAnimation{0%{-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1))}}\\@keyframes rippleAnimation{0%{-webkit-animation-timing-function:cubic-bezier(.4,0,.2,1);animation-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale,1));transform:translate(var(--translate-end)) scale(var(--final-scale,1))}}\\@-webkit-keyframes fadeInAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:.16}}\\@keyframes fadeInAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:.16}}\\@-webkit-keyframes fadeOutAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:.16}to{opacity:0}}\\@keyframes fadeOutAnimation{0%{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:.16}to{opacity:0}}\"; }\n};\nconst removeRipple = (ripple) => {\n ripple.classList.add('fade-out');\n setTimeout(() => {\n ripple.remove();\n }, 200);\n};\nconst PADDING = 10;\nconst INITIAL_ORIGIN_SCALE = 0.5;\n\nexport { RippleEffect as ion_ripple_effect };\n"],"sourceRoot":"webpack:///"}