angular-t9n
Version:
A translation tool for Angular i18n
1 lines • 70.3 kB
JavaScript
import{a as rn,b as on}from"./chunk-6NYZCEZT.js";import{a as nn,b as sn}from"./chunk-GKXKJW7N.js";import{a as an,b as ln}from"./chunk-YO72B5SH.js";import{b as en,c as tn}from"./chunk-MFCYHQDO.js";import{a as Wt,b as Ht,e as Yt,g as Xt,i as Zt}from"./chunk-6DDCRX73.js";import{b as cn}from"./chunk-NRGBO6B5.js";import{$ as He,Ac as Gt,Fa as Ye,Kb as Qt,Lb as Ze,Mb as Vt,Ob as xt,Pb as $t,Qc as Jt,Vb as Pe,Wa as zt,Wb as jt,Xb as Z,Y as v,_ as ve,_a as Kt,ca as be,cb as we,da as X,db as Xe,eb as Bt,kb as qt,na as Te,xb as re,yb as U,yd as Je,za as Lt,zb as Ae,zc as Ut}from"./chunk-IRWV2DJQ.js";import{a as Ee,c as It}from"./chunk-4CLCTAJ7.js";var _=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(_||{}),z="*";function un(i,e=null){return{type:_.Sequence,steps:i,options:e}}function et(i){return{type:_.Style,styles:i,offset:null}}var x=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(e=0,t=0){this.totalTime=e+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(e=>e()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(e){this._position=this.totalTime?e*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},oe=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(e){this.players=e;let t=0,n=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++n==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,a)=>Math.max(o,a.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this.players.forEach(e=>e.init())}onStart(e){this._onStartFns.push(e)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(e=>e()),this._onStartFns=[])}onDone(e){this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(e=>e.play())}pause(){this.players.forEach(e=>e.pause())}restart(){this.players.forEach(e=>e.restart())}finish(){this._onFinish(),this.players.forEach(e=>e.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(e=>e.destroy()),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}reset(){this.players.forEach(e=>e.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(e){let t=e*this.totalTime;this.players.forEach(n=>{let s=n.totalTime?Math.min(1,t/n.totalTime):1;n.setPosition(s)})}getPosition(){let e=this.players.reduce((t,n)=>t===null||n.totalTime>t.totalTime?n:t,null);return e!=null?e.getPosition():0}beforeDestroy(){this.players.forEach(e=>{e.beforeDestroy&&e.beforeDestroy()})}triggerCallback(e){let t=e=="start"?this._onStartFns:this._onDoneFns;t.forEach(n=>n()),t.length=0}},he="!";function hn(i){return new v(3e3,!1)}function ps(){return new v(3100,!1)}function gs(){return new v(3101,!1)}function ys(i){return new v(3001,!1)}function _s(i){return new v(3003,!1)}function Ss(i){return new v(3004,!1)}function dn(i,e){return new v(3005,!1)}function fn(){return new v(3006,!1)}function pn(){return new v(3007,!1)}function gn(i,e){return new v(3008,!1)}function yn(i){return new v(3002,!1)}function _n(i,e,t,n,s){return new v(3010,!1)}function Sn(){return new v(3011,!1)}function En(){return new v(3012,!1)}function vn(){return new v(3200,!1)}function bn(){return new v(3202,!1)}function Tn(){return new v(3013,!1)}function wn(i){return new v(3014,!1)}function An(i){return new v(3015,!1)}function Pn(i){return new v(3016,!1)}function Mn(i,e){return new v(3404,!1)}function Es(i){return new v(3502,!1)}function Cn(i){return new v(3503,!1)}function Nn(){return new v(3300,!1)}function Dn(i){return new v(3504,!1)}function kn(i){return new v(3301,!1)}function On(i,e){return new v(3302,!1)}function Rn(i){return new v(3303,!1)}function Fn(i,e){return new v(3400,!1)}function In(i){return new v(3401,!1)}function Ln(i){return new v(3402,!1)}function zn(i,e){return new v(3505,!1)}function $(i){switch(i.length){case 0:return new x;case 1:return i[0];default:return new oe(i)}}function it(i,e,t=new Map,n=new Map){let s=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((S,y)=>{let d=y,g=S;if(y!=="offset")switch(d=i.normalizePropertyName(d,s),g){case he:g=t.get(y);break;case z:g=n.get(y);break;default:g=i.normalizeStyleValue(y,d,g,s);break}u.set(d,g)}),h||r.push(u),a=u,o=c}),s.length)throw Es(s);return r}function Me(i,e,t,n){switch(e){case"start":i.onStart(()=>n(t&&tt(t,"start",i)));break;case"done":i.onDone(()=>n(t&&tt(t,"done",i)));break;case"destroy":i.onDestroy(()=>n(t&&tt(t,"destroy",i)));break}}function tt(i,e,t){let n=t.totalTime,s=!!t.disabled,r=Ce(i.element,i.triggerName,i.fromState,i.toState,e||i.phaseName,n??i.totalTime,s),o=i._data;return o!=null&&(r._data=o),r}function Ce(i,e,t,n,s="",r=0,o){return{element:i,triggerName:e,fromState:t,toState:n,phaseName:s,totalTime:r,disabled:!!o}}function O(i,e,t){let n=i.get(e);return n||i.set(e,n=t),n}function rt(i){let e=i.indexOf(":"),t=i.substring(1,e),n=i.slice(e+1);return[t,n]}var vs=typeof document>"u"?null:document.documentElement;function Ne(i){let e=i.parentNode||i.host||null;return e===vs?null:e}function bs(i){return i.substring(1,6)=="ebkit"}var J=null,mn=!1;function Kn(i){J||(J=Ts()||{},mn=J.style?"WebkitAppearance"in J.style:!1);let e=!0;return J.style&&!bs(i)&&(e=i in J.style,!e&&mn&&(e="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in J.style)),e}function Ts(){return typeof document<"u"?document.body:null}function ot(i,e){for(;e;){if(e===i)return!0;e=Ne(e)}return!1}function at(i,e,t){if(t)return Array.from(i.querySelectorAll(e));let n=i.querySelector(e);return n?[n]:[]}var ws=1e3,lt="{{",As="}}",ct="ng-enter",De="ng-leave",me="ng-trigger",de=".ng-trigger",ut="ng-animating",ke=".ng-animating";function V(i){if(typeof i=="number")return i;let e=i.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:nt(parseFloat(e[1]),e[2])}function nt(i,e){switch(e){case"s":return i*ws;default:return i}}function fe(i,e,t){return i.hasOwnProperty("duration")?i:Ps(i,e,t)}function Ps(i,e,t){let n=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,s,r=0,o="";if(typeof i=="string"){let a=i.match(n);if(a===null)return e.push(hn(i)),{duration:0,delay:0,easing:""};s=nt(parseFloat(a[1]),a[2]);let l=a[3];l!=null&&(r=nt(parseFloat(l),a[4]));let c=a[5];c&&(o=c)}else s=i;if(!t){let a=!1,l=e.length;s<0&&(e.push(ps()),a=!0),r<0&&(e.push(gs()),a=!0),a&&e.splice(l,0,hn(i))}return{duration:s,delay:r,easing:o}}function Bn(i){return i.length?i[0]instanceof Map?i:i.map(e=>new Map(Object.entries(e))):[]}function K(i,e,t){e.forEach((n,s)=>{let r=Oe(s);t&&!t.has(s)&&t.set(s,i.style[r]),i.style[r]=n})}function G(i,e){e.forEach((t,n)=>{let s=Oe(n);i.style[s]=""})}function ae(i){return Array.isArray(i)?i.length==1?i[0]:un(i):i}function qn(i,e,t){let n=e.params||{},s=ht(i);s.length&&s.forEach(r=>{n.hasOwnProperty(r)||t.push(ys(r))})}var st=new RegExp(`${lt}\\s*(.+?)\\s*${As}`,"g");function ht(i){let e=[];if(typeof i=="string"){let t;for(;t=st.exec(i);)e.push(t[1]);st.lastIndex=0}return e}function le(i,e,t){let n=`${i}`,s=n.replace(st,(r,o)=>{let a=e[o];return a==null&&(t.push(_s(o)),a=""),a.toString()});return s==n?i:s}var Ms=/-+([a-z0-9])/g;function Oe(i){return i.replace(Ms,(...e)=>e[1].toUpperCase())}function Qn(i,e){return i===0||e===0}function Vn(i,e,t){if(t.size&&e.length){let n=e[0],s=[];if(t.forEach((r,o)=>{n.has(o)||s.push(o),n.set(o,r)}),s.length)for(let r=1;r<e.length;r++){let o=e[r];s.forEach(a=>o.set(a,Re(i,a)))}}return e}function R(i,e,t){switch(e.type){case _.Trigger:return i.visitTrigger(e,t);case _.State:return i.visitState(e,t);case _.Transition:return i.visitTransition(e,t);case _.Sequence:return i.visitSequence(e,t);case _.Group:return i.visitGroup(e,t);case _.Animate:return i.visitAnimate(e,t);case _.Keyframes:return i.visitKeyframes(e,t);case _.Style:return i.visitStyle(e,t);case _.Reference:return i.visitReference(e,t);case _.AnimateChild:return i.visitAnimateChild(e,t);case _.AnimateRef:return i.visitAnimateRef(e,t);case _.Query:return i.visitQuery(e,t);case _.Stagger:return i.visitStagger(e,t);default:throw Ss(e.type)}}function Re(i,e){return window.getComputedStyle(i)[e]}var Nt=(()=>{class i{validateStyleProperty(t){return Kn(t)}containsElement(t,n){return ot(t,n)}getParentElement(t){return Ne(t)}query(t,n,s){return at(t,n,s)}computeStyle(t,n,s){return s||""}animate(t,n,s,r,o,a=[],l){return new x(s,r)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=ve({token:i,factory:i.\u0275fac})}return i})(),te=class{static NOOP=new Nt},ne=class{};var Cs=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ke=class extends ne{normalizePropertyName(e,t){return Oe(e)}normalizeStyleValue(e,t,n,s){let r="",o=n.toString().trim();if(Cs.has(t)&&n!==0&&n!=="0")if(typeof n=="number")r="px";else{let a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&s.push(dn(e,n))}return o+r}};var Be="*";function Ns(i,e){let t=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(n=>Ds(n,t,e)):t.push(i),t}function Ds(i,e,t){if(i[0]==":"){let l=ks(i,t);if(typeof l=="function"){e.push(l);return}i=l}let n=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return t.push(An(i)),e;let s=n[1],r=n[2],o=n[3];e.push(xn(s,o));let a=s==Be&&o==Be;r[0]=="<"&&!a&&e.push(xn(o,s))}function ks(i,e){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,n)=>parseFloat(n)>parseFloat(t);case":decrement":return(t,n)=>parseFloat(n)<parseFloat(t);default:return e.push(Pn(i)),"* => *"}}var Fe=new Set(["true","1"]),Ie=new Set(["false","0"]);function xn(i,e){let t=Fe.has(i)||Ie.has(i),n=Fe.has(e)||Ie.has(e);return(s,r)=>{let o=i==Be||i==s,a=e==Be||e==r;return!o&&t&&typeof s=="boolean"&&(o=s?Fe.has(i):Ie.has(i)),!a&&n&&typeof r=="boolean"&&(a=r?Fe.has(e):Ie.has(e)),o&&a}}var Jn=":self",Os=new RegExp(`s*${Jn}s*,?`,"g");function es(i,e,t,n){return new yt(i).build(e,t,n)}var $n="",yt=class{_driver;constructor(e){this._driver=e}build(e,t,n){let s=new _t(t);return this._resetContextStyleTimingState(s),R(this,ae(e),s)}_resetContextStyleTimingState(e){e.currentQuerySelector=$n,e.collectedStyles=new Map,e.collectedStyles.set($n,new Map),e.currentTime=0}visitTrigger(e,t){let n=t.queryCount=0,s=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(fn()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==_.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==_.Transition){let l=this.visitTransition(a,t);n+=l.queryCount,s+=l.depCount,o.push(l)}else t.errors.push(pn())}),{type:_.Trigger,name:e.name,states:r,transitions:o,queryCount:n,depCount:s,options:null}}visitState(e,t){let n=this.visitStyle(e.styles,t),s=e.options&&e.options.params||null;if(n.containsDynamicStyles){let r=new Set,o=s||{};n.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{ht(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(gn(e.name,[...r.values()]))}return{type:_.State,name:e.name,style:n,options:s?{params:s}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let n=R(this,ae(e.animation),t),s=Ns(e.expr,t.errors);return{type:_.Transition,matchers:s,animation:n,queryCount:t.queryCount,depCount:t.depCount,options:ee(e.options)}}visitSequence(e,t){return{type:_.Sequence,steps:e.steps.map(n=>R(this,n,t)),options:ee(e.options)}}visitGroup(e,t){let n=t.currentTime,s=0,r=e.steps.map(o=>{t.currentTime=n;let a=R(this,o,t);return s=Math.max(s,t.currentTime),a});return t.currentTime=s,{type:_.Group,steps:r,options:ee(e.options)}}visitAnimate(e,t){let n=Ls(e.timings,t.errors);t.currentAnimateTimings=n;let s,r=e.styles?e.styles:et({});if(r.type==_.Keyframes)s=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};n.easing&&(c.easing=n.easing),o=et(c)}t.currentTime+=n.duration+n.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,s=l}return t.currentAnimateTimings=null,{type:_.Animate,timings:n,style:s,options:null}}visitStyle(e,t){let n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n}_makeStyleAst(e,t){let n=[],s=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of s)typeof a=="string"?a===z?n.push(a):t.errors.push(yn(a)):n.push(new Map(Object.entries(a)));let r=!1,o=null;return n.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(lt)>=0){r=!0;break}}}),{type:_.Style,styles:n,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let n=t.currentAnimateTimings,s=t.currentTime,r=t.currentTime;n&&r>0&&(r-=n.duration+n.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=s&&r>=h.startTime&&s<=h.endTime&&(t.errors.push(_n(l,h.startTime,h.endTime,r,s)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:s}),t.options&&qn(a,t.options,t.errors)})})}visitKeyframes(e,t){let n={type:_.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(Sn()),n;let s=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let A=this._makeStyleAst(w,t),N=A.offset!=null?A.offset:Is(A.styles),M=0;return N!=null&&(r++,M=A.offset=N),l=l||M<0||M>1,a=a||M<c,c=M,o.push(M),A});l&&t.errors.push(En()),a&&t.errors.push(vn());let u=e.steps.length,S=0;r>0&&r<u?t.errors.push(bn()):r==0&&(S=s/(u-1));let y=u-1,d=t.currentTime,g=t.currentAnimateTimings,b=g.duration;return h.forEach((w,A)=>{let N=S>0?A==y?1:S*A:o[A],M=N*b;t.currentTime=d+g.delay+M,g.duration=M,this._validateStyleAst(w,t),w.offset=N,n.styles.push(w)}),n}visitReference(e,t){return{type:_.Reference,animation:R(this,ae(e.animation),t),options:ee(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:_.AnimateChild,options:ee(e.options)}}visitAnimateRef(e,t){return{type:_.AnimateRef,animation:this.visitReference(e.animation,t),options:ee(e.options)}}visitQuery(e,t){let n=t.currentQuerySelector,s=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=Rs(e.selector);t.currentQuerySelector=n.length?n+" "+r:r,O(t.collectedStyles,t.currentQuerySelector,new Map);let a=R(this,ae(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:_.Query,selector:r,limit:s.limit||0,optional:!!s.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:ee(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Tn());let n=e.timings==="full"?{duration:0,delay:0,easing:"full"}:fe(e.timings,t.errors,!0);return{type:_.Stagger,animation:R(this,ae(e.animation),t),timings:n,options:null}}};function Rs(i){let e=!!i.split(/\s*,\s*/).find(t=>t==Jn);return e&&(i=i.replace(Os,"")),i=i.replace(/@\*/g,de).replace(/@\w+/g,t=>de+"-"+t.slice(1)).replace(/:animating/g,ke),[i,e]}function Fs(i){return i?Ee({},i):null}var _t=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function Is(i){if(typeof i=="string")return null;let e=null;if(Array.isArray(i))i.forEach(t=>{if(t instanceof Map&&t.has("offset")){let n=t;e=parseFloat(n.get("offset")),n.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let t=i;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Ls(i,e){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=fe(i,e).duration;return mt(r,0,"")}let t=i;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=mt(0,0,"");return r.dynamic=!0,r.strValue=t,r}let s=fe(t,e);return mt(s.duration,s.delay,s.easing)}function ee(i){return i?(i=Ee({},i),i.params&&(i.params=Fs(i.params))):i={},i}function mt(i,e,t){return{duration:i,delay:e,easing:t}}function Dt(i,e,t,n,s,r,o=null,a=!1){return{type:1,element:i,keyframes:e,preStyleProps:t,postStyleProps:n,duration:s,delay:r,totalTime:s+r,easing:o,subTimeline:a}}var ge=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let n=this._map.get(e);n||this._map.set(e,n=[]),n.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},zs=1,Ks=":enter",Bs=new RegExp(Ks,"g"),qs=":leave",Qs=new RegExp(qs,"g");function ts(i,e,t,n,s,r=new Map,o=new Map,a,l,c=[]){return new St().buildKeyframes(i,e,t,n,s,r,o,a,l,c)}var St=class{buildKeyframes(e,t,n,s,r,o,a,l,c,h=[]){c=c||new ge;let u=new Et(e,t,c,s,r,h,[]);u.options=l;let S=l.delay?V(l.delay):0;u.currentTimeline.delayNextStep(S),u.currentTimeline.setStyles([o],null,u.errors,l),R(this,n,u);let y=u.timelines.filter(d=>d.containsAnimation());if(y.length&&a.size){let d;for(let g=y.length-1;g>=0;g--){let b=y[g];if(b.element===t){d=b;break}}d&&!d.allowOnlyTimelineStyles()&&d.setStyles([a],null,u.errors,l)}return y.length?y.map(d=>d.buildKeyframes()):[Dt(t,[],[],[],0,S,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let n=t.subInstructions.get(t.element);if(n){let s=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,s,s.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,n),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,n){for(let s of e){let r=s?.delay;if(r){let o=typeof r=="number"?r:V(le(r,s?.params??{},t.errors));n.delayNextStep(o)}}}_visitSubInstructions(e,t,n){let r=t.currentTimeline.currentTime,o=n.duration!=null?V(n.duration):null,a=n.delay!=null?V(n.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),R(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let n=t.subContextCount,s=t,r=e.options;if(r&&(r.params||r.delay)&&(s=t.createSubContext(r),s.transformIntoNewTimeline(),r.delay!=null)){s.previousNode.type==_.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=qe);let o=V(r.delay);s.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>R(this,o,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>n&&s.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let n=[],s=t.currentTimeline.currentTime,r=e.options&&e.options.delay?V(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),R(this,o,a),s=Math.max(s,a.currentTimeline.currentTime),n.push(a.currentTimeline)}),n.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(s),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let n=e.strValue,s=t.params?le(n,t.params,t.errors):n;return fe(s,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let n=t.currentAnimateTimings=this._visitTiming(e.timings,t),s=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),s.snapshotCurrentStyles());let r=e.style;r.type==_.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(n.duration),this.visitStyle(r,t),s.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let n=t.currentTimeline,s=t.currentAnimateTimings;!s&&n.hasCurrentStyleProperties()&&n.forwardFrame();let r=s&&s.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(r):n.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let n=t.currentAnimateTimings,s=t.currentTimeline.duration,r=n.duration,a=t.createSubContext().currentTimeline;a.easing=n.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(s+r),t.previousNode=e}visitQuery(e,t){let n=t.currentTimeline.currentTime,s=e.options||{},r=s.delay?V(s.delay):0;r&&(t.previousNode.type===_.Style||n==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=qe);let o=n,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!s.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),R(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let S=u.currentTimeline.currentTime;o=Math.max(o,S)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let n=t.parentContext,s=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=n.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;R(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=s.currentTime-u+(s.startTime-n.currentTimeline.startTime)}},qe={},Et=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=qe;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,n,s,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=s,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new Qe(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let n=e,s=this.options;n.duration!=null&&(s.duration=V(n.duration)),n.delay!=null&&(s.delay=V(n.delay));let r=n.params;if(r){let o=s.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=le(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let n=e.params={};Object.keys(t).forEach(s=>{n[s]=t[s]})}}return e}createSubContext(e=null,t,n){let s=t||this.element,r=new i(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=qe,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,n){let s={duration:t??e.duration,delay:this.currentTimeline.currentTime+(n??0)+e.delay,easing:""},r=new vt(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,s,e.stretchStartingKeyframe);return this.timelines.push(r),s}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,n,s,r,o){let a=[];if(s&&a.push(this.element),e.length>0){e=e.replace(Bs,"."+this._enterClassName),e=e.replace(Qs,"."+this._leaveClassName);let l=n!=1,c=this._driver.query(this.element,e,l);n!==0&&(c=n<0?c.slice(c.length+n,c.length):c.slice(0,n)),a.push(...c)}return!r&&a.length==0&&o.push(wn(t)),a}},Qe=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,n,s){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=s,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new i(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=zs,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,n]of this._globalTimelineStyles)this._backFill.set(t,n||z),this._currentKeyframe.set(t,z);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,n,s){t&&this._previousKeyframe.set("easing",t);let r=s&&s.params||{},o=Vs(e,this._globalTimelineStyles);for(let[a,l]of o){let c=le(l,r,n);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??z),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,n)=>{let s=this._styleSummary.get(n);(!s||t.time>s.time)&&this._updateStyle(n,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,n=this._keyframes.size===1&&this.duration===0,s=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===he?e.add(u):h===z&&t.add(u)}),n||c.set("offset",l/this.duration),s.push(c)});let r=[...e.values()],o=[...t.values()];if(n){let a=s[0],l=new Map(a);a.set("offset",0),l.set("offset",1),s=[a,l]}return Dt(this.element,s,r,o,this.duration,this.startTime,this.easing,!1)}},vt=class extends Qe{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,n,s,r,o,a=!1){super(e,t,o.delay),this.keyframes=n,this.preStyleProps=s,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:n,easing:s}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=n+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",jn(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let S=new Map(e[u]),y=S.get("offset"),d=t+y*n;S.set("offset",jn(d/o)),r.push(S)}n=o,t=0,s="",e=r}return Dt(this.element,e,this.preStyleProps,this.postStyleProps,n,t,s,!0)}};function jn(i,e=3){let t=Math.pow(10,e-1);return Math.round(i*t)/t}function Vs(i,e){let t=new Map,n;return i.forEach(s=>{if(s==="*"){n??=e.keys();for(let r of n)t.set(r,z)}else for(let[r,o]of s)t.set(r,o)}),t}function Un(i,e,t,n,s,r,o,a,l,c,h,u,S){return{type:0,element:i,triggerName:e,isRemovalTransition:s,fromState:t,fromStyles:r,toState:n,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:S}}var dt={},Ve=class{_triggerName;ast;_stateStyles;constructor(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}match(e,t,n,s){return xs(this.ast.matchers,e,t,n,s)}buildStyles(e,t,n){let s=this._stateStyles.get("*");return e!==void 0&&(s=this._stateStyles.get(e?.toString())||s),s?s.buildStyles(t,n):new Map}build(e,t,n,s,r,o,a,l,c,h){let u=[],S=this.ast.options&&this.ast.options.params||dt,y=a&&a.params||dt,d=this.buildStyles(n,y,u),g=l&&l.params||dt,b=this.buildStyles(s,g,u),w=new Set,A=new Map,N=new Map,M=s==="void",se={params:ns(g,S),delay:this.ast.options?.delay},q=h?[]:ts(e,t,this.ast.animation,r,o,d,b,se,c,u),D=0;return q.forEach(k=>{D=Math.max(k.duration+k.delay,D)}),u.length?Un(t,this._triggerName,n,s,M,d,b,[],[],A,N,D,u):(q.forEach(k=>{let W=k.element,ie=O(A,W,new Set);k.preStyleProps.forEach(H=>ie.add(H));let kt=O(N,W,new Set);k.postStyleProps.forEach(H=>kt.add(H)),W!==t&&w.add(W)}),Un(t,this._triggerName,n,s,M,d,b,q,[...w.values()],A,N,D))}};function xs(i,e,t,n,s){return i.some(r=>r(e,t,n,s))}function ns(i,e){let t=Ee({},e);return Object.entries(i).forEach(([n,s])=>{s!=null&&(t[n]=s)}),t}var bt=class{styles;defaultParams;normalizer;constructor(e,t,n){this.styles=e,this.defaultParams=t,this.normalizer=n}buildStyles(e,t){let n=new Map,s=ns(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=le(o,s,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),n.set(a,o)})}),n}};function $s(i,e,t){return new Tt(i,e,t)}var Tt=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,n){this.name=e,this.ast=t,this._normalizer=n,t.states.forEach(s=>{let r=s.options&&s.options.params||{};this.states.set(s.name,new bt(s.style,r,n))}),Gn(this.states,"true","1"),Gn(this.states,"false","0"),t.transitions.forEach(s=>{this.transitionFactories.push(new Ve(e,s,this.states))}),this.fallbackTransition=js(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,n,s){return this.transitionFactories.find(o=>o.match(e,t,n,s))||null}matchStyles(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)}};function js(i,e,t){let n=[(o,a)=>!0],s={type:_.Sequence,steps:[],options:null},r={type:_.Transition,animation:s,matchers:n,options:null,queryCount:0,depCount:0};return new Ve(i,r,e)}function Gn(i,e,t){i.has(e)?i.has(t)||i.set(t,i.get(e)):i.has(t)&&i.set(e,i.get(t))}var Us=new ge,wt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n}register(e,t){let n=[],s=[],r=es(this._driver,t,n,s);if(n.length)throw Cn(n);this._animations.set(e,r)}_buildPlayer(e,t,n){let s=e.element,r=it(this._normalizer,e.keyframes,t,n);return this._driver.animate(s,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,n={}){let s=[],r=this._animations.get(e),o,a=new Map;if(r?(o=ts(this._driver,t,r,ct,De,new Map,new Map,n,Us,s),o.forEach(h=>{let u=O(a,h.element,new Map);h.postStyleProps.forEach(S=>u.set(S,null))})):(s.push(Nn()),o=[]),s.length)throw Dn(s);a.forEach((h,u)=>{h.forEach((S,y)=>{h.set(y,this._driver.computeStyle(u,y,z))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=$(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw kn(e);return t}listen(e,t,n,s){let r=Ce(t,"","","");return Me(this._getPlayer(e),n,r,s),()=>{}}command(e,t,n,s){if(n=="register"){this.register(e,s[0]);return}if(n=="create"){let o=s[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(n){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(e);break}}},Wn="ng-animate-queued",Gs=".ng-animate-queued",ft="ng-animate-disabled",Ws=".ng-animate-disabled",Hs="ng-star-inserted",Ys=".ng-star-inserted",Xs=[],ss={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Zs={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},B="__ng_removed",ye=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let n=e&&e.hasOwnProperty("value"),s=n?e.value:e;if(this.value=ei(s),n){let r=e,{value:o}=r,a=It(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let n=this.options.params;Object.keys(t).forEach(s=>{n[s]==null&&(n[s]=t[s])})}}},pe="void",pt=new ye(pe),At=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,n,s){if(!this._triggers.has(t))throw On(n,t);if(n==null||n.length==0)throw Rn(t);if(!ti(n))throw Fn(n,t);let r=O(this._elementListeners,e,[]),o={name:t,phase:n,callback:s};r.push(o);let a=O(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,me),L(e,me+"-"+t),a.set(t,pt)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw In(e);return t}trigger(e,t,n,s=!0){let r=this._getTrigger(t),o=new _e(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,me),L(e,me+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new ye(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=pt),!(c.value===pe)&&l.value===c.value){if(!ii(l.params,c.params)){let g=[],b=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{G(e,b),K(e,w)})}return}let S=O(this._engine.playersByElement,e,[]);S.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),d=!1;if(!y){if(!s)return;y=r.fallbackTransition,d=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:d}),d||(L(e,Wn),o.onStart(()=>{ce(e,Wn)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let b=this._engine.playersByElement.get(e);if(b){let w=b.indexOf(o);w>=0&&b.splice(w,1)}}),this.players.push(o),S.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,n)=>{this._elementListeners.set(n,t.filter(s=>s.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(n=>n.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let n=this._engine.driver.query(e,de,!0);n.forEach(s=>{if(s[B])return;let r=this._engine.fetchNamespacesByElement(s);r.size?r.forEach(o=>o.triggerLeaveAnimation(s,t,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(e,t,n,s){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,pe,s);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),n&&$(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),n=this._engine.statesByElement.get(e);if(t&&n){let s=new Set;t.forEach(r=>{let o=r.name;if(s.has(o))return;s.add(o);let l=this._triggers.get(o).fallbackTransition,c=n.get(o)||pt,h=new ye(pe),u=new _e(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let n=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let s=!1;if(n.totalAnimations){let r=n.players.length?n.playersByQueriedElement.get(e):[];if(r&&r.length)s=!0;else{let o=e;for(;o=o.parentNode;)if(n.statesByElement.get(o)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(e),s)n.markElementAsRemoved(this.id,e,!1,t);else{let r=e[B];(!r||r===ss)&&(n.afterFlush(()=>this.clearElementCache(e)),n.destroyInnerAnimations(e),n._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(n=>{let s=n.player;if(s.destroyed)return;let r=n.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==n.triggerName){let l=Ce(r,n.triggerName,n.fromState.value,n.toState.value);l._data=e,Me(n.player,a.phase,l,a.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):t.push(n)}),this._queue=[],t.sort((n,s)=>{let r=n.transition.ast.depCount,o=s.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(n.element,s.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Pt=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,n){this.bodyNode=e,this.driver=t,this._normalizer=n}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(n=>{n.queued&&e.push(n)})}),e}createNamespace(e,t){let n=new At(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(n,t):(this.newHostElements.set(t,n),this.collectEnterElement(t)),this._namespaceLookup[e]=n}_balanceNamespaceList(e,t){let n=this._namespaceList,s=this.namespacesByHostElement;if(n.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=s.get(a);if(l){let c=n.indexOf(l);n.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||n.unshift(e)}else n.push(e);return s.set(t,e),e}register(e,t){let n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n}registerTrigger(e,t,n){let s=this._namespaceLookup[e];s&&s.register(t,n)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(e);this.namespacesByHostElement.delete(n.hostElement);let s=this._namespaceList.indexOf(n);s>=0&&this._namespaceList.splice(s,1),n.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,n=this.statesByElement.get(e);if(n){for(let s of n.values())if(s.namespaceId){let r=this._fetchNamespace(s.namespaceId);r&&t.add(r)}}return t}trigger(e,t,n,s){if(Le(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,n,s),!0}return!1}insertNode(e,t,n,s){if(!Le(t))return;let r=t[B];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,n)}s&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ft)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ce(e,ft))}removeNode(e,t,n){if(Le(t)){let s=e?this._fetchNamespace(e):null;s?s.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,n)}else this._onRemovalComplete(t,n)}markElementAsRemoved(e,t,n,s,r){this.collectedLeaveElements.push(t),t[B]={namespaceId:e,setForRemoval:s,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,n,s,r){return Le(t)?this._fetchNamespace(e).listen(t,n,s,r):()=>{}}_buildInstruction(e,t,n,s,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,s,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,de,!0);t.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,ke,!0),t.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return $(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[B];if(t&&t.setForRemoval){if(e[B]=ss,t.namespaceId){this.destroyInnerAnimations(e);let n=this._fetchNamespace(t.namespaceId);n&&n.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ft)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Ws,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,s)=>this._balanceNamespaceList(n,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let s=this.collectedEnterElements[n];L(s,Hs)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{t=this._flushAnimations(n,e)}finally{for(let s=0;s<n.length;s++)n[s]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let s=this.collectedLeaveElements[n];this.processLeaveNode(s)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],t.length?$(t).onDone(()=>{n.forEach(s=>s())}):n.forEach(s=>s())}}reportError(e){throw Ln(e)}_flushAnimations(e,t){let n=new ge,s=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(m=>{h.add(m);let f=this.driver.query(m,Gs,!0);for(let p=0;p<f.length;p++)h.add(f[p])});let u=this.bodyNode,S=Array.from(this.statesByElement.keys()),y=Xn(S,this.collectedEnterElements),d=new Map,g=0;y.forEach((m,f)=>{let p=ct+g++;d.set(f,p),m.forEach(E=>L(E,p))});let b=[],w=new Set,A=new Set;for(let m=0;m<this.collectedLeaveElements.length;m++){let f=this.collectedLeaveElements[m],p=f[B];p&&p.setForRemoval&&(b.push(f),w.add(f),p.hasAnimation?this.driver.query(f,Ys,!0).forEach(E=>w.add(E)):A.add(f))}let N=new Map,M=Xn(S,Array.from(w));M.forEach((m,f)=>{let p=De+g++;N.set(f,p),m.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((m,f)=>{let p=d.get(f);m.forEach(E=>ce(E,p))}),M.forEach((m,f)=>{let p=N.get(f);m.forEach(E=>ce(E,p))}),b.forEach(m=>{this.processLeaveNode(m)})});let se=[],q=[];for(let m=this._namespaceList.length-1;m>=0;m--)this._namespaceList[m].drainQueuedTransitions(t).forEach(p=>{let E=p.player,P=p.element;if(se.push(E),this.collectedEnterElements.length){let C=P[B];if(C&&C.setForMove){if(C.previousTriggersValues&&C.previousTriggersValues.has(p.triggerName)){let Y=C.previousTriggersValues.get(p.triggerName),I=this.statesByElement.get(p.element);if(I&&I.has(p.triggerName)){let Se=I.get(p.triggerName);Se.value=Y,I.set(p.triggerName,Se)}}E.destroy();return}}let Q=!u||!this.driver.containsElement(u,P),F=N.get(P),j=d.get(P),T=this._buildInstruction(p,n,j,F,Q);if(T.errors&&T.errors.length){q.push(T);return}if(Q){E.onStart(()=>G(P,T.fromStyles)),E.onDestroy(()=>K(P,T.toStyles)),s.push(E);return}if(p.isFallbackTransition){E.onStart(()=>G(P,T.fromStyles)),E.onDestroy(()=>K(P,T.toStyles)),s.push(E);return}let Ft=[];T.timelines.forEach(C=>{C.stretchStartingKeyframe=!0,this.disabledNodes.has(C.element)||Ft.push(C)}),T.timelines=Ft,n.append(P,T.timelines);let fs={instruction:T,player:E,element:P};o.push(fs),T.queriedElements.forEach(C=>O(a,C,[]).push(E)),T.preStyleProps.forEach((C,Y)=>{if(C.size){let I=l.get(Y);I||l.set(Y,I=new Set),C.forEach((Se,We)=>I.add(We))}}),T.postStyleProps.forEach((C,Y)=>{let I=c.get(Y);I||c.set(Y,I=new Set),C.forEach((Se,We)=>I.add(We))})});if(q.length){let m=[];q.forEach(f=>{m.push(zn(f.triggerName,f.errors))}),se.forEach(f=>f.destroy()),this.reportError(m)}let D=new Map,k=new Map;o.forEach(m=>{let f=m.element;n.has(f)&&(k.set(f,f),this._beforeAnimationBuild(m.player.namespaceId,m.instruction,D))}),s.forEach(m=>{let f=m.element;this._getPreviousPlayers(f,!1,m.namespaceId,m.triggerName,null).forEach(E=>{O(D,f,[]).push(E),E.destroy()})});let W=b.filter(m=>Zn(m,l,c)),ie=new Map;Yn(ie,this.driver,A,c,z).forEach(m=>{Zn(m,l,c)&&W.push(m)});let H=new Map;y.forEach((m,f)=>{Yn(H,this.driver,new Set(m),l,he)}),W.forEach(m=>{let f=ie.get(m),p=H.get(m);ie.set(m,new Map([...f?.entries()??[],...p?.entries()??[]]))});let Ge=[],Ot=[],Rt={};o.forEach(m=>{let{element:f,player:p,instruction:E}=m;if(n.has(f)){if(h.has(f)){p.onDestroy(()=>K(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),s.push(p);return}let P=Rt;if(k.size>1){let F=f,j=[];for(;F=F.parentNode;){let T=k.get(F);if(T){P=T;break}j.push(F)}j.forEach(T=>k.set(T,P))}let Q=this._buildAnimation(p.namespaceId,E,D,r,H,ie);if(p.setRealPlayer(Q),P===Rt)Ge.push(p);else{let F=this.playersByElement.get(P);F&&F.length&&(p.parentPlayer=$(F)),s.push(p)}}else G(f,E.fromStyles),p.onDestroy(()=>K(f,E.toStyles)),Ot.push(p),h.has(f)&&s.push(p)}),Ot.forEach(m=>{let f=r.get(m.element);if(f&&f.length){let p=$(f);m.setRealPlayer(p)}}),s.forEach(m=>{m.parentPlayer?m.syncPlayerEvents(m.parentPlayer):m.destroy()});for(let m=0;m<b.length;m++){let f=b[m],p=f[B];if(ce(f,De),p&&p.hasAnimation)continue;let E=[];if(a.size){let Q=a.get(f);Q&&Q.length&&E.push(...Q);let F=this.driver.query(f,ke,!0);for(let j=0;j<F.length;j++){let T=a.get(F[j]);T&&T.length&&E.push(...T)}}let P=E.filter(Q=>!Q.destroyed);P.length?ni(this,f,P):this.processLeaveNode(f)}return b.length=0,Ge.forEach(m=>{this.players.push(m),m.onDone(()=>{m.destroy();let f=this.players.indexOf(m);this.players.splice(f,1)}),m.play()}),Ge}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,n,s,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==pe;a.forEach(c=>{c.queued||!l&&c.triggerName!=s||o.push(c)})}}return(n||s)&&(o=o.filter(a=>!(n&&n!=a.namespaceId||s&&s!=a.triggerName))),o}_beforeAnimationBuild(e,t,n){let s=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:s;for(let l of t.timelines){let c=l.element,h=c!==r,u=O(n,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let d=y.getRealPlayer();d.beforeDestroy&&d.beforeDestroy(),y.destroy(),u.push(y)})}G(r,t.fromStyles)}_buildAnimation(e,t,n,s,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,S=t.timelines.map(d=>{let g=d.element;h.add(g);let b=g[B];if(b&&b.removedBeforeQueried)return new x(d.duration,d.delay);let w=g!==l,A=si((n.get(g)||Xs).map(D=>D.getRealPlayer())).filter(D=>{let k=D;return k.element?k.element===g:!1}),N=r.get(g),M=o.get(g),se=it(this._normalizer,d.keyframes,N,M),q=this._buildPlayer(d,se,A);if(d.subTimeline&&s&&u.add