/*! * (C) Ionic http://ionicframework.com - MIT License */ import{w as e}from"./p-7b30edcc.js";let o;const t=(e,t,i)=>{const n=t.startsWith("animation")?(r=e,void 0===o&&(o=void 0===r.style.animationName&&void 0!==r.style.webkitAnimationName?"-webkit-":""),o):"";var r;e.style.setProperty(n+t,i)},i=(e=[],o)=>{if(void 0!==o){const t=Array.isArray(o)?o:[o];return[...e,...t]}return e},n=o=>{let n,r,a,s,d,l,f,c,v,m,u,y=[],p=[],g=[],b=!1,A={},C=[],E=[],h={},S=0,k=!1,R=!1,w=!0,T=!1,D=!0,F=!1;const W=o,I=[],K=[],M=[],j=[],x=[],P=[],q=[],z=[],B=[],G=[],H=[],J="function"==typeof AnimationEffect||void 0!==e&&"function"==typeof e.AnimationEffect,L="function"==typeof Element&&"function"==typeof Element.prototype.animate&&J,N=()=>H,O=(e,o)=>{const t=o.findIndex((o=>o.c===e));t>-1&&o.splice(t,1)},Q=(e,o)=>(((null==o?void 0:o.oneTimeCallback)?K:I).push({c:e,o}),u),U=()=>{L&&(H.forEach((e=>{e.cancel()})),H.length=0)},V=()=>{P.forEach((e=>{(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)})),P.length=0},X=()=>void 0!==d?d:f?f.getFill():"both",Y=()=>void 0!==c?c:void 0!==l?l:f?f.getDirection():"normal",Z=()=>k?"linear":void 0!==a?a:f?f.getEasing():"linear",$=()=>R?0:void 0!==v?v:void 0!==r?r:f?f.getDuration():0,_=()=>void 0!==s?s:f?f.getIterations():1,ee=()=>void 0!==m?m:void 0!==n?n:f?f.getDelay():0,oe=()=>{0!==S&&(S--,0===S&&((()=>{B.forEach((e=>e())),G.forEach((e=>e()));const e=w?1:0,o=C,i=E,n=h;j.forEach((e=>{const r=e.classList;o.forEach((e=>r.add(e))),i.forEach((e=>r.remove(e)));for(const o in n)n.hasOwnProperty(o)&&t(e,o,n[o])})),v=void 0,c=void 0,m=void 0,I.forEach((o=>o.c(e,u))),K.forEach((o=>o.c(e,u))),K.length=0,D=!0,w&&(T=!0),w=!0})(),f&&f.animationFinish()))},te=()=>{(()=>{q.forEach((e=>e())),z.forEach((e=>e()));const e=p,o=g,i=A;j.forEach((n=>{const r=n.classList;e.forEach((e=>r.add(e))),o.forEach((e=>r.remove(e)));for(const e in i)i.hasOwnProperty(e)&&t(n,e,i[e])}))})(),y.length>0&&L&&(j.forEach((e=>{const o=e.animate(y,{id:W,delay:ee(),duration:$(),easing:Z(),iterations:_(),fill:X(),direction:Y()});o.pause(),H.push(o)})),H.length>0&&(H[0].onfinish=()=>{oe()})),b=!0},ie=e=>{e=Math.min(Math.max(e,0),.9999),L&&H.forEach((o=>{o.currentTime=o.effect.getComputedTiming().delay+$()*e,o.pause()}))},ne=e=>{H.forEach((e=>{e.effect.updateTiming({delay:ee(),duration:$(),easing:Z(),iterations:_(),fill:X(),direction:Y()})})),void 0!==e&&ie(e)},re=(e=!1,o=!0,t)=>(e&&x.forEach((i=>{i.update(e,o,t)})),L&&ne(t),u),ae=()=>{b&&(L?H.forEach((e=>{e.pause()})):j.forEach((e=>{t(e,"animation-play-state","paused")})),F=!0)},se=e=>new Promise((o=>{(null==e?void 0:e.sync)&&(R=!0,Q((()=>R=!1),{oneTimeCallback:!0})),b||te(),T&&(L&&(ie(0),ne()),T=!1),D&&(S=x.length+1,D=!1);const t=()=>{O(i,K),o()},i=()=>{O(t,M),o()};Q(i,{oneTimeCallback:!0}),M.push({c:t,o:{oneTimeCallback:!0}}),x.forEach((e=>{e.play()})),L?(H.forEach((e=>{e.play()})),0!==y.length&&0!==j.length||oe()):oe(),F=!1})),de=(e,o)=>{const t=y[0];return void 0===t||void 0!==t.offset&&0!==t.offset?y=[{offset:0,[e]:o},...y]:t[e]=o,u};return u={parentAnimation:f,elements:j,childAnimations:x,id:W,animationFinish:oe,from:de,to:(e,o)=>{const t=y[y.length-1];return void 0===t||void 0!==t.offset&&1!==t.offset?y=[...y,{offset:1,[e]:o}]:t[e]=o,u},fromTo:(e,o,t)=>de(e,o).to(e,t),parent:e=>(f=e,u),play:se,pause:()=>(x.forEach((e=>{e.pause()})),ae(),u),stop:()=>{x.forEach((e=>{e.stop()})),b&&(U(),b=!1),k=!1,R=!1,D=!0,c=void 0,v=void 0,m=void 0,S=0,T=!1,w=!0,F=!1,M.forEach((e=>e.c(0,u))),M.length=0},destroy:e=>(x.forEach((o=>{o.destroy(e)})),(e=>{U(),e&&V()})(e),j.length=0,x.length=0,y.length=0,I.length=0,K.length=0,b=!1,D=!0,u),keyframes:e=>{const o=y!==e;return y=e,o&&(e=>{L&&N().forEach((o=>{const t=o.effect;if(t.setKeyframes)t.setKeyframes(e);else{const i=new KeyframeEffect(t.target,e,t.getTiming());o.effect=i}}))})(y),u},addAnimation:e=>{if(null!=e)if(Array.isArray(e))for(const o of e)o.parent(u),x.push(o);else e.parent(u),x.push(e);return u},addElement:e=>{if(null!=e)if(1===e.nodeType)j.push(e);else if(e.length>=0)for(let o=0;o(d=e,re(!0),u),direction:e=>(l=e,re(!0),u),iterations:e=>(s=e,re(!0),u),duration:e=>(L||0!==e||(e=1),r=e,re(!0),u),easing:e=>(a=e,re(!0),u),delay:e=>(n=e,re(!0),u),getWebAnimations:N,getKeyframes:()=>y,getFill:X,getDirection:Y,getDelay:ee,getIterations:_,getEasing:Z,getDuration:$,afterAddRead:e=>(B.push(e),u),afterAddWrite:e=>(G.push(e),u),afterClearStyles:(e=[])=>{for(const o of e)h[o]="";return u},afterStyles:(e={})=>(h=e,u),afterRemoveClass:e=>(E=i(E,e),u),afterAddClass:e=>(C=i(C,e),u),beforeAddRead:e=>(q.push(e),u),beforeAddWrite:e=>(z.push(e),u),beforeClearStyles:(e=[])=>{for(const o of e)A[o]="";return u},beforeStyles:(e={})=>(A=e,u),beforeRemoveClass:e=>(g=i(g,e),u),beforeAddClass:e=>(p=i(p,e),u),onFinish:Q,isRunning:()=>0!==S&&!F,progressStart:(e=!1,o)=>(x.forEach((t=>{t.progressStart(e,o)})),ae(),k=e,b||te(),re(!1,!0,o),u),progressStep:e=>(x.forEach((o=>{o.progressStep(e)})),ie(e),u),progressEnd:(e,o,t)=>(k=!1,x.forEach((i=>{i.progressEnd(e,o,t)})),void 0!==t&&(v=t),T=!1,w=!0,0===e?(c="reverse"===Y()?"normal":"reverse","reverse"===c&&(w=!1),L?(re(),ie(1-o)):(m=(1-o)*$()*-1,re(!1,!1))):1===e&&(L?(re(),ie(o)):(m=o*$()*-1,re(!1,!1))),void 0===e||f||se(),u)}};export{n as c}