{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-ripple-effect.entry.js"],"names":["RippleEffect","class_1","prototype","addRipple","x","y","this","_this","_a","Promise","resolve","rect","el","getBoundingClientRect","width","height","hypotenuse","Math","sqrt","maxDim","max","maxRadius","unbounded","PADDING","initialSize","floor","INITIAL_ORIGIN_SCALE","finalScale","posX","left","posY","top","styleX","styleY","moveX","moveY","div","document","createElement","style","classList","add","setProperty","shadowRoot","appendChild","setTimeout","removeRipple","Object","defineProperty","get","type","enumerable","configurable","render","mode","role","class","hostRef","ripple","remove"],"mappings":"6FAAA,mFAGIA,GAHJ,UAuBIC,EAAQC,UAAUC,UAAY,SAAUC,EAAGC,GACvC,OAAO,YAAUC,KAAM,OAAQ,OAAQ,WACnC,IAAIC,EAAQD,KACZ,OAAO,YAAYA,KAAM,SAAUE,GAC/B,MAAO,CAAC,EAAc,IAAIC,QAAQ,SAAUC,GACpC,YAAS,WACL,IAAIC,EAAOJ,EAAMK,GAAGC,sBAAsB,EACtCC,EAAQH,EAAKG,MACbC,EAASJ,EAAKI,OACdC,EAAaC,KAAKC,KAAKJ,EAAQA,EAAQC,EAASA,CAAM,EACtDI,EAASF,KAAKG,IAAIL,EAAQD,CAAK,EAC/BO,EAAYd,EAAMe,UAAYH,EAASH,EAAaO,EACpDC,EAAcP,KAAKQ,MAAMN,EAASO,CAAoB,EACtDC,EAAaN,EAAYG,EACzBI,EAAOxB,EAAIO,EAAKkB,KAChBC,EAAOzB,EAAIM,EAAKoB,IAKhBC,GAJAzB,EAAMe,YACNM,EAAe,GAARd,EACPgB,EAAgB,GAATf,GAEEa,EAAqB,GAAdJ,GAChBS,EAASH,EAAqB,GAAdN,EAChBU,EAAgB,GAARpB,EAAcc,EACtBO,EAAiB,GAATpB,EAAee,EAC3B,YAAU,WACN,IAAIM,EAAMC,SAASC,cAAc,KAAK,EAElCC,GADJH,EAAII,UAAUC,IAAI,eAAe,EACrBL,EAAIG,OAChBA,EAAMR,IAAME,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__generator } from \"tslib\";\nimport { r as registerInstance, f as readTask, w as writeTask, c as getIonMode, h, e as getElement, H as Host } from './core-feeeff0d.js';\nimport './config-3c7f3790.js';\nvar RippleEffect = /** @class */ (function () {\n function class_1(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 class_1.prototype.addRipple = function (x, y) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) {\n readTask(function () {\n var rect = _this.el.getBoundingClientRect();\n var width = rect.width;\n var height = rect.height;\n var hypotenuse = Math.sqrt(width * width + height * height);\n var maxDim = Math.max(height, width);\n var maxRadius = _this.unbounded ? maxDim : hypotenuse + PADDING;\n var initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);\n var finalScale = maxRadius / initialSize;\n var posX = x - rect.left;\n var posY = y - rect.top;\n if (_this.unbounded) {\n posX = width * 0.5;\n posY = height * 0.5;\n }\n var styleX = posX - initialSize * 0.5;\n var styleY = posY - initialSize * 0.5;\n var moveX = width * 0.5 - posX;\n var moveY = height * 0.5 - posY;\n writeTask(function () {\n var div = document.createElement('div');\n div.classList.add('ripple-effect');\n var 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 var container = _this.el.shadowRoot || _this.el;\n container.appendChild(div);\n setTimeout(function () {\n resolve(function () {\n removeRipple(div);\n });\n }, 225 + 100);\n });\n });\n })];\n });\n });\n };\n Object.defineProperty(class_1.prototype, \"unbounded\", {\n get: function () {\n return this.type === 'unbounded';\n },\n enumerable: true,\n configurable: true\n });\n class_1.prototype.render = function () {\n var _a;\n var mode = getIonMode(this);\n return (h(Host, { role: \"presentation\", class: (_a = {},\n _a[mode] = true,\n _a['unbounded'] = this.unbounded,\n _a) }));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { 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 enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar removeRipple = function (ripple) {\n ripple.classList.add('fade-out');\n setTimeout(function () {\n ripple.remove();\n }, 200);\n};\nvar PADDING = 10;\nvar INITIAL_ORIGIN_SCALE = 0.5;\nexport { RippleEffect as ion_ripple_effect };\n"],"sourceRoot":""}