UNPKG

otus-localization

Version:

A translation tool for Angular i18n(angular-t9n)

1 lines 581 kB
"use strict";(self.webpackChunkotus_translation=self.webpackChunkotus_translation||[]).push([[179],{7289:(at,ye,m)=>{m.d(ye,{I:()=>le,v:()=>ce});var a=m(1896),I=m(7328),A=m(5619),B=m(2181),F=m(5879);const le=["Excel","Json"];let ce=(()=>{class se{constructor(G){this.router=G,this.fileFormat=new I.t(1),this.loading$=new A.X(!1),this.router.events.pipe((0,B.h)(fe=>fe instanceof a.m2)).subscribe(()=>{const fe=this.router.url.split("/")[1];if(fe){const[te,...Ee]=fe;this.fileFormat.next(`${te.toUpperCase()}${Ee.join("")}`)}})}setFileFormat(G){this.router.navigateByUrl(`/${G.toLowerCase()}`)}static{this.\u0275fac=function(fe){return new(fe||se)(F.LFG(a.F0))}}static{this.\u0275prov=F.Yz7({token:se,factory:se.\u0275fac,providedIn:"root"})}}return se})()},2315:(at,ye,m)=>{m.d(ye,{i:()=>_e});var a=m(5619),I=m(3997),A=m(2181),B=m(9397),F=m(9360),le=m(8251),ce=m(2737),se=m(4825),ee=m(4829),fe=m(8645),te=m(305),Ee=m(5592),Ie=m(7394),Te=m(7328);const Le={url:"",deserializer:q=>JSON.parse(q.data),serializer:q=>JSON.stringify(q)};class Ve extends fe.u{constructor(pe,ue){if(super(),this._socket=null,pe instanceof Ee.y)this.destination=ue,this.source=pe;else{const ve=this._config=Object.assign({},Le);if(this._output=new fe.x,"string"==typeof pe)ve.url=pe;else for(const Ye in pe)pe.hasOwnProperty(Ye)&&(ve[Ye]=pe[Ye]);if(!ve.WebSocketCtor&&WebSocket)ve.WebSocketCtor=WebSocket;else if(!ve.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new Te.t}}lift(pe){const ue=new Ve(this._config,this.destination);return ue.operator=pe,ue.source=this,ue}_resetState(){this._socket=null,this.source||(this.destination=new Te.t),this._output=new fe.x}multiplex(pe,ue,ve){const Ye=this;return new Ee.y(qe=>{try{Ye.next(pe())}catch(mt){qe.error(mt)}const it=Ye.subscribe({next:mt=>{try{ve(mt)&&qe.next(mt)}catch(Et){qe.error(Et)}},error:mt=>qe.error(mt),complete:()=>qe.complete()});return()=>{try{Ye.next(ue())}catch(mt){qe.error(mt)}it.unsubscribe()}})}_connectSocket(){const{WebSocketCtor:pe,protocol:ue,url:ve,binaryType:Ye}=this._config,qe=this._output;let it=null;try{it=ue?new pe(ve,ue):new pe(ve),this._socket=it,Ye&&(this._socket.binaryType=Ye)}catch(Et){return void qe.error(Et)}const mt=new Ie.w0(()=>{this._socket=null,it&&1===it.readyState&&it.close()});it.onopen=Et=>{const{_socket:Tt}=this;if(!Tt)return it.close(),void this._resetState();const{openObserver:Nt}=this._config;Nt&&Nt.next(Et);const lt=this.destination;this.destination=te.Lv.create(zt=>{if(1===it.readyState)try{const{serializer:Z}=this._config;it.send(Z(zt))}catch(Z){this.destination.error(Z)}},zt=>{const{closingObserver:Z}=this._config;Z&&Z.next(void 0),zt&&zt.code?it.close(zt.code,zt.reason):qe.error(new TypeError("WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }")),this._resetState()},()=>{const{closingObserver:zt}=this._config;zt&&zt.next(void 0),it.close(),this._resetState()}),lt&&lt instanceof Te.t&&mt.add(lt.subscribe(this.destination))},it.onerror=Et=>{this._resetState(),qe.error(Et)},it.onclose=Et=>{it===this._socket&&this._resetState();const{closeObserver:Tt}=this._config;Tt&&Tt.next(Et),Et.wasClean?qe.complete():qe.error(Et)},it.onmessage=Et=>{try{const{deserializer:Tt}=this._config;qe.next(Tt(Et))}catch(Tt){qe.error(Tt)}}}_subscribe(pe){const{source:ue}=this;return ue?ue.subscribe(pe):(this._socket||this._connectSocket(),this._output.subscribe(pe),pe.add(()=>{const{_socket:ve}=this;0===this._output.observers.length&&(ve&&(1===ve.readyState||0===ve.readyState)&&ve.close(),this._resetState())}),pe)}unsubscribe(){const{_socket:pe}=this;pe&&(1===pe.readyState||0===pe.readyState)&&pe.close(),this._resetState(),super.unsubscribe()}}var Ke=m(553),Y=m(5879);let _e=(()=>{class q{constructor(){this._projectSubject=new a.X(null),this.project=this._projectSubject.pipe((0,I.x)((ue,ve)=>JSON.stringify(ue)===JSON.stringify(ve))),this.projectChange=this.project.pipe((0,A.h)(ue=>!!ue)),function Ze(q){return new Ve(q)}(Ke.N.translationSocket).pipe((0,B.b)({error:()=>this._projectSubject.next(null)}),function G(q=1/0){let pe;pe=q&&"object"==typeof q?q:{count:q};const{count:ue=1/0,delay:ve,resetOnSuccess:Ye=!1}=pe;return ue<=0?ce.y:(0,F.e)((qe,it)=>{let Et,mt=0;const Tt=()=>{let Nt=!1;Et=qe.subscribe((0,le.x)(it,lt=>{Ye&&(mt=0),it.next(lt)},void 0,lt=>{if(mt++<ue){const zt=()=>{Et?(Et.unsubscribe(),Et=null,Tt()):Nt=!0};if(null!=ve){const Z="number"==typeof ve?(0,se.H)(ve):(0,ee.Xf)(ve(lt,mt)),Q=(0,le.x)(it,()=>{Q.unsubscribe(),zt()},()=>{it.complete()});Z.subscribe(Q)}else zt()}else it.error(lt)})),Nt&&(Et.unsubscribe(),Et=null,Tt())};Tt()})}({delay:1e3})).subscribe(ue=>this._projectSubject.next(ue))}static{this.\u0275fac=function(ve){return new(ve||q)}}static{this.\u0275prov=Y.Yz7({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})()},553:(at,ye,m)=>{m.d(ye,{N:()=>a});const a={production:!0,translationServer:"",translationSocket:`ws://${location.host}`}},8825:(at,ye,m)=>{var a=m(9862),I=m(6593),A=m(5879),B=m(6825);function le(S){return new A.vHH(3e3,!1)}function j(S){switch(S.length){case 0:return new B.ZN;case 1:return S[0];default:return new B.ZE(S)}}function ie(S,c,h=new Map,y=new Map){const x=[],k=[];let ne=-1,he=null;if(c.forEach(Ne=>{const je=Ne.get("offset"),gt=je==ne,vt=gt&&he||new Map;Ne.forEach((Jt,d)=>{let C=d,_=Jt;if("offset"!==d)switch(C=S.normalizePropertyName(C,x),_){case B.k1:_=h.get(d);break;case B.l3:_=y.get(d);break;default:_=S.normalizeStyleValue(d,C,_,x)}vt.set(C,_)}),gt||k.push(vt),he=vt,ne=je}),x.length)throw function mt(S){return new A.vHH(3502,!1)}();return k}function Re(S,c,h,y){switch(c){case"start":S.onStart(()=>y(h&&Qe(h,"start",S)));break;case"done":S.onDone(()=>y(h&&Qe(h,"done",S)));break;case"destroy":S.onDestroy(()=>y(h&&Qe(h,"destroy",S)))}}function Qe(S,c,h){const k=et(S.element,S.triggerName,S.fromState,S.toState,c||S.phaseName,h.totalTime??S.totalTime,!!h.disabled),ne=S._data;return null!=ne&&(k._data=ne),k}function et(S,c,h,y,x="",k=0,ne){return{element:S,triggerName:c,fromState:h,toState:y,phaseName:x,totalTime:k,disabled:!!ne}}function Mt(S,c,h){let y=S.get(c);return y||S.set(c,y=h),y}function Ot(S){const c=S.indexOf(":");return[S.substring(1,c),S.slice(c+1)]}const xt=(()=>typeof document>"u"?null:document.documentElement)();function Lt(S){const c=S.parentNode||S.host||null;return c===xt?null:c}let nn=null,Bn=!1;function re(S,c){for(;c;){if(c===S)return!0;c=Lt(c)}return!1}function V(S,c,h){if(h)return Array.from(S.querySelectorAll(c));const y=S.querySelector(c);return y?[y]:[]}let R=(()=>{class S{validateStyleProperty(h){return function jn(S){nn||(nn=function Ge(){return typeof document<"u"?document.body:null}()||{},Bn=!!nn.style&&"WebkitAppearance"in nn.style);let c=!0;return nn.style&&!function gn(S){return"ebkit"==S.substring(1,6)}(S)&&(c=S in nn.style,!c&&Bn&&(c="Webkit"+S.charAt(0).toUpperCase()+S.slice(1)in nn.style)),c}(h)}matchesElement(h,y){return!1}containsElement(h,y){return re(h,y)}getParentElement(h){return Lt(h)}query(h,y,x){return V(h,y,x)}computeStyle(h,y,x){return x||""}animate(h,y,x,k,ne,he=[],Ne){return new B.ZN(x,k)}static{this.\u0275fac=function(y){return new(y||S)}}static{this.\u0275prov=A.Yz7({token:S,factory:S.\u0275fac})}}return S})(),X=(()=>{class S{static{this.NOOP=new R}}return S})();const Pe=1e3,Dt="ng-enter",Ft="ng-leave",ot="ng-trigger",St=".ng-trigger",bt="ng-animating",Dn=".ng-animating";function Yt(S){if("number"==typeof S)return S;const c=S.match(/^(-?[\.\d]+)(m?s)/);return!c||c.length<2?0:an(parseFloat(c[1]),c[2])}function an(S,c){return"s"===c?S*Pe:S}function ln(S,c,h){return S.hasOwnProperty("duration")?S:function vn(S,c,h){let x,k=0,ne="";if("string"==typeof S){const he=S.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===he)return c.push(le()),{duration:0,delay:0,easing:""};x=an(parseFloat(he[1]),he[2]);const Ne=he[3];null!=Ne&&(k=an(parseFloat(Ne),he[4]));const je=he[5];je&&(ne=je)}else x=S;if(!h){let he=!1,Ne=c.length;x<0&&(c.push(function ce(){return new A.vHH(3100,!1)}()),he=!0),k<0&&(c.push(function se(){return new A.vHH(3101,!1)}()),he=!0),he&&c.splice(Ne,0,le())}return{duration:x,delay:k,easing:ne}}(S,c,h)}function Mn(S,c={}){return Object.keys(S).forEach(h=>{c[h]=S[h]}),c}function ai(S){const c=new Map;return Object.keys(S).forEach(h=>{c.set(h,S[h])}),c}function $(S,c=new Map,h){if(h)for(let[y,x]of h)c.set(y,x);for(let[y,x]of S)c.set(y,x);return c}function ae(S,c,h){c.forEach((y,x)=>{const k=rt(x);h&&!h.has(x)&&h.set(x,S.style[k]),S.style[k]=y})}function Ae(S,c){c.forEach((h,y)=>{const x=rt(y);S.style[x]=""})}function nt(S){return Array.isArray(S)?1==S.length?S[0]:(0,B.vP)(S):S}const H=new RegExp("{{\\s*(.+?)\\s*}}","g");function T(S){let c=[];if("string"==typeof S){let h;for(;h=H.exec(S);)c.push(h[1]);H.lastIndex=0}return c}function D(S,c,h){const y=S.toString(),x=y.replace(H,(k,ne)=>{let he=c[ne];return null==he&&(h.push(function G(S){return new A.vHH(3003,!1)}()),he=""),he.toString()});return x==y?S:x}function U(S){const c=[];let h=S.next();for(;!h.done;)c.push(h.value),h=S.next();return c}const be=/-+([a-z0-9])/g;function rt(S){return S.replace(be,(...c)=>c[1].toUpperCase())}function cn(S,c,h){switch(c.type){case 7:return S.visitTrigger(c,h);case 0:return S.visitState(c,h);case 1:return S.visitTransition(c,h);case 2:return S.visitSequence(c,h);case 3:return S.visitGroup(c,h);case 4:return S.visitAnimate(c,h);case 5:return S.visitKeyframes(c,h);case 6:return S.visitStyle(c,h);case 8:return S.visitReference(c,h);case 9:return S.visitAnimateChild(c,h);case 10:return S.visitAnimateRef(c,h);case 11:return S.visitQuery(c,h);case 12:return S.visitStagger(c,h);default:throw function fe(S){return new A.vHH(3004,!1)}()}}function rn(S,c){return window.getComputedStyle(S)[c]}const ct="*";function Xt(S,c){const h=[];return"string"==typeof S?S.split(/\s*,\s*/).forEach(y=>function ft(S,c,h){if(":"==S[0]){const Ne=function yn(S,c){switch(S){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(h,y)=>parseFloat(y)>parseFloat(h);case":decrement":return(h,y)=>parseFloat(y)<parseFloat(h);default:return c.push(function ve(S){return new A.vHH(3016,!1)}()),"* => *"}}(S,h);if("function"==typeof Ne)return void c.push(Ne);S=Ne}const y=S.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(null==y||y.length<4)return h.push(function ue(S){return new A.vHH(3015,!1)}()),c;const x=y[1],k=y[2],ne=y[3];c.push(Kn(x,ne));"<"==k[0]&&!(x==ct&&ne==ct)&&c.push(Kn(ne,x))}(y,h,c)):h.push(S),h}const ti=new Set(["true","1"]),Tn=new Set(["false","0"]);function Kn(S,c){const h=ti.has(S)||Tn.has(S),y=ti.has(c)||Tn.has(c);return(x,k)=>{let ne=S==ct||S==x,he=c==ct||c==k;return!ne&&h&&"boolean"==typeof x&&(ne=x?ti.has(S):Tn.has(S)),!he&&y&&"boolean"==typeof k&&(he=k?ti.has(c):Tn.has(c)),ne&&he}}const Ln=new RegExp("s*:selfs*,?","g");function un(S,c,h,y){return new fi(S).build(c,h,y)}class fi{constructor(c){this._driver=c}build(c,h,y){const x=new Un(h);return this._resetContextStyleTimingState(x),cn(this,nt(c),x)}_resetContextStyleTimingState(c){c.currentQuerySelector="",c.collectedStyles=new Map,c.collectedStyles.set("",new Map),c.currentTime=0}visitTrigger(c,h){let y=h.queryCount=0,x=h.depCount=0;const k=[],ne=[];return"@"==c.name.charAt(0)&&h.errors.push(function Ee(){return new A.vHH(3006,!1)}()),c.definitions.forEach(he=>{if(this._resetContextStyleTimingState(h),0==he.type){const Ne=he,je=Ne.name;je.toString().split(/\s*,\s*/).forEach(gt=>{Ne.name=gt,k.push(this.visitState(Ne,h))}),Ne.name=je}else if(1==he.type){const Ne=this.visitTransition(he,h);y+=Ne.queryCount,x+=Ne.depCount,ne.push(Ne)}else h.errors.push(function Ie(){return new A.vHH(3007,!1)}())}),{type:7,name:c.name,states:k,transitions:ne,queryCount:y,depCount:x,options:null}}visitState(c,h){const y=this.visitStyle(c.styles,h),x=c.options&&c.options.params||null;if(y.containsDynamicStyles){const k=new Set,ne=x||{};y.styles.forEach(he=>{he instanceof Map&&he.forEach(Ne=>{T(Ne).forEach(je=>{ne.hasOwnProperty(je)||k.add(je)})})}),k.size&&(U(k.values()),h.errors.push(function Te(S,c){return new A.vHH(3008,!1)}()))}return{type:0,name:c.name,style:y,options:x?{params:x}:null}}visitTransition(c,h){h.queryCount=0,h.depCount=0;const y=cn(this,nt(c.animation),h);return{type:1,matchers:Xt(c.expr,h.errors),animation:y,queryCount:h.queryCount,depCount:h.depCount,options:Hn(c.options)}}visitSequence(c,h){return{type:2,steps:c.steps.map(y=>cn(this,y,h)),options:Hn(c.options)}}visitGroup(c,h){const y=h.currentTime;let x=0;const k=c.steps.map(ne=>{h.currentTime=y;const he=cn(this,ne,h);return x=Math.max(x,h.currentTime),he});return h.currentTime=x,{type:3,steps:k,options:Hn(c.options)}}visitAnimate(c,h){const y=function Ni(S,c){if(S.hasOwnProperty("duration"))return S;if("number"==typeof S)return bi(ln(S,c).duration,0,"");const h=S;if(h.split(/\s+/).some(k=>"{"==k.charAt(0)&&"{"==k.charAt(1))){const k=bi(0,0,"");return k.dynamic=!0,k.strValue=h,k}const x=ln(h,c);return bi(x.duration,x.delay,x.easing)}(c.timings,h.errors);h.currentAnimateTimings=y;let x,k=c.styles?c.styles:(0,B.oB)({});if(5==k.type)x=this.visitKeyframes(k,h);else{let ne=c.styles,he=!1;if(!ne){he=!0;const je={};y.easing&&(je.easing=y.easing),ne=(0,B.oB)(je)}h.currentTime+=y.duration+y.delay;const Ne=this.visitStyle(ne,h);Ne.isEmptyStep=he,x=Ne}return h.currentAnimateTimings=null,{type:4,timings:y,style:x,options:null}}visitStyle(c,h){const y=this._makeStyleAst(c,h);return this._validateStyleAst(y,h),y}_makeStyleAst(c,h){const y=[],x=Array.isArray(c.styles)?c.styles:[c.styles];for(let he of x)"string"==typeof he?he===B.l3?y.push(he):h.errors.push(new A.vHH(3002,!1)):y.push(ai(he));let k=!1,ne=null;return y.forEach(he=>{if(he instanceof Map&&(he.has("easing")&&(ne=he.get("easing"),he.delete("easing")),!k))for(let Ne of he.values())if(Ne.toString().indexOf("{{")>=0){k=!0;break}}),{type:6,styles:y,easing:ne,offset:c.offset,containsDynamicStyles:k,options:null}}_validateStyleAst(c,h){const y=h.currentAnimateTimings;let x=h.currentTime,k=h.currentTime;y&&k>0&&(k-=y.duration+y.delay),c.styles.forEach(ne=>{"string"!=typeof ne&&ne.forEach((he,Ne)=>{const je=h.collectedStyles.get(h.currentQuerySelector),gt=je.get(Ne);let vt=!0;gt&&(k!=x&&k>=gt.startTime&&x<=gt.endTime&&(h.errors.push(function Ve(S,c,h,y,x){return new A.vHH(3010,!1)}()),vt=!1),k=gt.startTime),vt&&je.set(Ne,{startTime:k,endTime:x}),h.options&&function we(S,c,h){const y=c.params||{},x=T(S);x.length&&x.forEach(k=>{y.hasOwnProperty(k)||h.push(function ee(S){return new A.vHH(3001,!1)}())})}(he,h.options,h.errors)})})}visitKeyframes(c,h){const y={type:5,styles:[],options:null};if(!h.currentAnimateTimings)return h.errors.push(function Ze(){return new A.vHH(3011,!1)}()),y;let k=0;const ne=[];let he=!1,Ne=!1,je=0;const gt=c.steps.map(W=>{const Oe=this._makeStyleAst(W,h);let Ue=null!=Oe.offset?Oe.offset:function Zn(S){if("string"==typeof S)return null;let c=null;if(Array.isArray(S))S.forEach(h=>{if(h instanceof Map&&h.has("offset")){const y=h;c=parseFloat(y.get("offset")),y.delete("offset")}});else if(S instanceof Map&&S.has("offset")){const h=S;c=parseFloat(h.get("offset")),h.delete("offset")}return c}(Oe.styles),ut=0;return null!=Ue&&(k++,ut=Oe.offset=Ue),Ne=Ne||ut<0||ut>1,he=he||ut<je,je=ut,ne.push(ut),Oe});Ne&&h.errors.push(function Ke(){return new A.vHH(3012,!1)}()),he&&h.errors.push(function Y(){return new A.vHH(3200,!1)}());const vt=c.steps.length;let Jt=0;k>0&&k<vt?h.errors.push(function _e(){return new A.vHH(3202,!1)}()):0==k&&(Jt=1/(vt-1));const d=vt-1,C=h.currentTime,_=h.currentAnimateTimings,w=_.duration;return gt.forEach((W,Oe)=>{const Ue=Jt>0?Oe==d?1:Jt*Oe:ne[Oe],ut=Ue*w;h.currentTime=C+_.delay+ut,_.duration=ut,this._validateStyleAst(W,h),W.offset=Ue,y.styles.push(W)}),y}visitReference(c,h){return{type:8,animation:cn(this,nt(c.animation),h),options:Hn(c.options)}}visitAnimateChild(c,h){return h.depCount++,{type:9,options:Hn(c.options)}}visitAnimateRef(c,h){return{type:10,animation:this.visitReference(c.animation,h),options:Hn(c.options)}}visitQuery(c,h){const y=h.currentQuerySelector,x=c.options||{};h.queryCount++,h.currentQuery=c;const[k,ne]=function xi(S){const c=!!S.split(/\s*,\s*/).find(h=>":self"==h);return c&&(S=S.replace(Ln,"")),S=S.replace(/@\*/g,St).replace(/@\w+/g,h=>St+"-"+h.slice(1)).replace(/:animating/g,Dn),[S,c]}(c.selector);h.currentQuerySelector=y.length?y+" "+k:k,Mt(h.collectedStyles,h.currentQuerySelector,new Map);const he=cn(this,nt(c.animation),h);return h.currentQuery=null,h.currentQuerySelector=y,{type:11,selector:k,limit:x.limit||0,optional:!!x.optional,includeSelf:ne,animation:he,originalSelector:c.selector,options:Hn(c.options)}}visitStagger(c,h){h.currentQuery||h.errors.push(function q(){return new A.vHH(3013,!1)}());const y="full"===c.timings?{duration:0,delay:0,easing:"full"}:ln(c.timings,h.errors,!0);return{type:12,animation:cn(this,nt(c.animation),h),timings:y,options:null}}}class Un{constructor(c){this.errors=c,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function Hn(S){return S?(S=Mn(S)).params&&(S.params=function An(S){return S?Mn(S):null}(S.params)):S={},S}function bi(S,c,h){return{duration:S,delay:c,easing:h}}function ii(S,c,h,y,x,k,ne=null,he=!1){return{type:1,element:S,keyframes:c,preStyleProps:h,postStyleProps:y,duration:x,delay:k,totalTime:x+k,easing:ne,subTimeline:he}}class pi{constructor(){this._map=new Map}get(c){return this._map.get(c)||[]}append(c,h){let y=this._map.get(c);y||this._map.set(c,y=[]),y.push(...h)}has(c){return this._map.has(c)}clear(){this._map.clear()}}const Hr=new RegExp(":enter","g"),ao=new RegExp(":leave","g");function Vr(S,c,h,y,x,k=new Map,ne=new Map,he,Ne,je=[]){return(new So).buildKeyframes(S,c,h,y,x,k,ne,he,Ne,je)}class So{buildKeyframes(c,h,y,x,k,ne,he,Ne,je,gt=[]){je=je||new pi;const vt=new co(c,h,je,x,k,gt,[]);vt.options=Ne;const Jt=Ne.delay?Yt(Ne.delay):0;vt.currentTimeline.delayNextStep(Jt),vt.currentTimeline.setStyles([ne],null,vt.errors,Ne),cn(this,y,vt);const d=vt.timelines.filter(C=>C.containsAnimation());if(d.length&&he.size){let C;for(let _=d.length-1;_>=0;_--){const w=d[_];if(w.element===h){C=w;break}}C&&!C.allowOnlyTimelineStyles()&&C.setStyles([he],null,vt.errors,Ne)}return d.length?d.map(C=>C.buildKeyframes()):[ii(h,[],[],[],0,Jt,"",!1)]}visitTrigger(c,h){}visitState(c,h){}visitTransition(c,h){}visitAnimateChild(c,h){const y=h.subInstructions.get(h.element);if(y){const x=h.createSubContext(c.options),k=h.currentTimeline.currentTime,ne=this._visitSubInstructions(y,x,x.options);k!=ne&&h.transformIntoNewTimeline(ne)}h.previousNode=c}visitAnimateRef(c,h){const y=h.createSubContext(c.options);y.transformIntoNewTimeline(),this._applyAnimationRefDelays([c.options,c.animation.options],h,y),this.visitReference(c.animation,y),h.transformIntoNewTimeline(y.currentTimeline.currentTime),h.previousNode=c}_applyAnimationRefDelays(c,h,y){for(const x of c){const k=x?.delay;if(k){const ne="number"==typeof k?k:Yt(D(k,x?.params??{},h.errors));y.delayNextStep(ne)}}}_visitSubInstructions(c,h,y){let k=h.currentTimeline.currentTime;const ne=null!=y.duration?Yt(y.duration):null,he=null!=y.delay?Yt(y.delay):null;return 0!==ne&&c.forEach(Ne=>{const je=h.appendInstructionToTimeline(Ne,ne,he);k=Math.max(k,je.duration+je.delay)}),k}visitReference(c,h){h.updateOptions(c.options,!0),cn(this,c.animation,h),h.previousNode=c}visitSequence(c,h){const y=h.subContextCount;let x=h;const k=c.options;if(k&&(k.params||k.delay)&&(x=h.createSubContext(k),x.transformIntoNewTimeline(),null!=k.delay)){6==x.previousNode.type&&(x.currentTimeline.snapshotCurrentStyles(),x.previousNode=nr);const ne=Yt(k.delay);x.delayNextStep(ne)}c.steps.length&&(c.steps.forEach(ne=>cn(this,ne,x)),x.currentTimeline.applyStylesToKeyframe(),x.subContextCount>y&&x.transformIntoNewTimeline()),h.previousNode=c}visitGroup(c,h){const y=[];let x=h.currentTimeline.currentTime;const k=c.options&&c.options.delay?Yt(c.options.delay):0;c.steps.forEach(ne=>{const he=h.createSubContext(c.options);k&&he.delayNextStep(k),cn(this,ne,he),x=Math.max(x,he.currentTimeline.currentTime),y.push(he.currentTimeline)}),y.forEach(ne=>h.currentTimeline.mergeTimelineCollectedStyles(ne)),h.transformIntoNewTimeline(x),h.previousNode=c}_visitTiming(c,h){if(c.dynamic){const y=c.strValue;return ln(h.params?D(y,h.params,h.errors):y,h.errors)}return{duration:c.duration,delay:c.delay,easing:c.easing}}visitAnimate(c,h){const y=h.currentAnimateTimings=this._visitTiming(c.timings,h),x=h.currentTimeline;y.delay&&(h.incrementTime(y.delay),x.snapshotCurrentStyles());const k=c.style;5==k.type?this.visitKeyframes(k,h):(h.incrementTime(y.duration),this.visitStyle(k,h),x.applyStylesToKeyframe()),h.currentAnimateTimings=null,h.previousNode=c}visitStyle(c,h){const y=h.currentTimeline,x=h.currentAnimateTimings;!x&&y.hasCurrentStyleProperties()&&y.forwardFrame();const k=x&&x.easing||c.easing;c.isEmptyStep?y.applyEmptyStep(k):y.setStyles(c.styles,k,h.errors,h.options),h.previousNode=c}visitKeyframes(c,h){const y=h.currentAnimateTimings,x=h.currentTimeline.duration,k=y.duration,he=h.createSubContext().currentTimeline;he.easing=y.easing,c.styles.forEach(Ne=>{he.forwardTime((Ne.offset||0)*k),he.setStyles(Ne.styles,Ne.easing,h.errors,h.options),he.applyStylesToKeyframe()}),h.currentTimeline.mergeTimelineCollectedStyles(he),h.transformIntoNewTimeline(x+k),h.previousNode=c}visitQuery(c,h){const y=h.currentTimeline.currentTime,x=c.options||{},k=x.delay?Yt(x.delay):0;k&&(6===h.previousNode.type||0==y&&h.currentTimeline.hasCurrentStyleProperties())&&(h.currentTimeline.snapshotCurrentStyles(),h.previousNode=nr);let ne=y;const he=h.invokeQuery(c.selector,c.originalSelector,c.limit,c.includeSelf,!!x.optional,h.errors);h.currentQueryTotal=he.length;let Ne=null;he.forEach((je,gt)=>{h.currentQueryIndex=gt;const vt=h.createSubContext(c.options,je);k&&vt.delayNextStep(k),je===h.element&&(Ne=vt.currentTimeline),cn(this,c.animation,vt),vt.currentTimeline.applyStylesToKeyframe(),ne=Math.max(ne,vt.currentTimeline.currentTime)}),h.currentQueryIndex=0,h.currentQueryTotal=0,h.transformIntoNewTimeline(ne),Ne&&(h.currentTimeline.mergeTimelineCollectedStyles(Ne),h.currentTimeline.snapshotCurrentStyles()),h.previousNode=c}visitStagger(c,h){const y=h.parentContext,x=h.currentTimeline,k=c.timings,ne=Math.abs(k.duration),he=ne*(h.currentQueryTotal-1);let Ne=ne*h.currentQueryIndex;switch(k.duration<0?"reverse":k.easing){case"reverse":Ne=he-Ne;break;case"full":Ne=y.currentStaggerTime}const gt=h.currentTimeline;Ne&&gt.delayNextStep(Ne);const vt=gt.currentTime;cn(this,c.animation,h),h.previousNode=c,y.currentStaggerTime=x.currentTime-vt+(x.startTime-y.currentTimeline.startTime)}}const nr={};class co{constructor(c,h,y,x,k,ne,he,Ne){this._driver=c,this.element=h,this.subInstructions=y,this._enterClassName=x,this._leaveClassName=k,this.errors=ne,this.timelines=he,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=nr,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=Ne||new ri(this._driver,h,0),he.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(c,h){if(!c)return;const y=c;let x=this.options;null!=y.duration&&(x.duration=Yt(y.duration)),null!=y.delay&&(x.delay=Yt(y.delay));const k=y.params;if(k){let ne=x.params;ne||(ne=this.options.params={}),Object.keys(k).forEach(he=>{(!h||!ne.hasOwnProperty(he))&&(ne[he]=D(k[he],ne,this.errors))})}}_copyOptions(){const c={};if(this.options){const h=this.options.params;if(h){const y=c.params={};Object.keys(h).forEach(x=>{y[x]=h[x]})}}return c}createSubContext(c=null,h,y){const x=h||this.element,k=new co(this._driver,x,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(x,y||0));return k.previousNode=this.previousNode,k.currentAnimateTimings=this.currentAnimateTimings,k.options=this._copyOptions(),k.updateOptions(c),k.currentQueryIndex=this.currentQueryIndex,k.currentQueryTotal=this.currentQueryTotal,k.parentContext=this,this.subContextCount++,k}transformIntoNewTimeline(c){return this.previousNode=nr,this.currentTimeline=this.currentTimeline.fork(this.element,c),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(c,h,y){const x={duration:h??c.duration,delay:this.currentTimeline.currentTime+(y??0)+c.delay,easing:""},k=new Io(this._driver,c.element,c.keyframes,c.preStyleProps,c.postStyleProps,x,c.stretchStartingKeyframe);return this.timelines.push(k),x}incrementTime(c){this.currentTimeline.forwardTime(this.currentTimeline.duration+c)}delayNextStep(c){c>0&&this.currentTimeline.delayNextStep(c)}invokeQuery(c,h,y,x,k,ne){let he=[];if(x&&he.push(this.element),c.length>0){c=(c=c.replace(Hr,"."+this._enterClassName)).replace(ao,"."+this._leaveClassName);let je=this._driver.query(this.element,c,1!=y);0!==y&&(je=y<0?je.slice(je.length+y,je.length):je.slice(0,y)),he.push(...je)}return!k&&0==he.length&&ne.push(function pe(S){return new A.vHH(3014,!1)}()),he}}class ri{constructor(c,h,y,x){this._driver=c,this.element=h,this.startTime=y,this._elementTimelineStylesLookup=x,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(h),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(h,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(c){const h=1===this._keyframes.size&&this._pendingStyles.size;this.duration||h?(this.forwardTime(this.currentTime+c),h&&this.snapshotCurrentStyles()):this.startTime+=c}fork(c,h){return this.applyStylesToKeyframe(),new ri(this._driver,c,h||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+=1,this._loadKeyframe()}forwardTime(c){this.applyStylesToKeyframe(),this.duration=c,this._loadKeyframe()}_updateStyle(c,h){this._localTimelineStyles.set(c,h),this._globalTimelineStyles.set(c,h),this._styleSummary.set(c,{time:this.currentTime,value:h})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(c){c&&this._previousKeyframe.set("easing",c);for(let[h,y]of this._globalTimelineStyles)this._backFill.set(h,y||B.l3),this._currentKeyframe.set(h,B.l3);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(c,h,y,x){h&&this._previousKeyframe.set("easing",h);const k=x&&x.params||{},ne=function zr(S,c){const h=new Map;let y;return S.forEach(x=>{if("*"===x){y=y||c.keys();for(let k of y)h.set(k,B.l3)}else $(x,h)}),h}(c,this._globalTimelineStyles);for(let[he,Ne]of ne){const je=D(Ne,k,y);this._pendingStyles.set(he,je),this._localTimelineStyles.has(he)||this._backFill.set(he,this._globalTimelineStyles.get(he)??B.l3),this._updateStyle(he,je)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((c,h)=>{this._currentKeyframe.set(h,c)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((c,h)=>{this._currentKeyframe.has(h)||this._currentKeyframe.set(h,c)}))}snapshotCurrentStyles(){for(let[c,h]of this._localTimelineStyles)this._pendingStyles.set(c,h),this._updateStyle(c,h)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const c=[];for(let h in this._currentKeyframe)c.push(h);return c}mergeTimelineCollectedStyles(c){c._styleSummary.forEach((h,y)=>{const x=this._styleSummary.get(y);(!x||h.time>x.time)&&this._updateStyle(y,h.value)})}buildKeyframes(){this.applyStylesToKeyframe();const c=new Set,h=new Set,y=1===this._keyframes.size&&0===this.duration;let x=[];this._keyframes.forEach((he,Ne)=>{const je=$(he,new Map,this._backFill);je.forEach((gt,vt)=>{gt===B.k1?c.add(vt):gt===B.l3&&h.add(vt)}),y||je.set("offset",Ne/this.duration),x.push(je)});const k=c.size?U(c.values()):[],ne=h.size?U(h.values()):[];if(y){const he=x[0],Ne=new Map(he);he.set("offset",0),Ne.set("offset",1),x=[he,Ne]}return ii(this.element,x,k,ne,this.duration,this.startTime,this.easing,!1)}}class Io extends ri{constructor(c,h,y,x,k,ne,he=!1){super(c,h,ne.delay),this.keyframes=y,this.preStyleProps=x,this.postStyleProps=k,this._stretchStartingKeyframe=he,this.timings={duration:ne.duration,delay:ne.delay,easing:ne.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let c=this.keyframes,{delay:h,duration:y,easing:x}=this.timings;if(this._stretchStartingKeyframe&&h){const k=[],ne=y+h,he=h/ne,Ne=$(c[0]);Ne.set("offset",0),k.push(Ne);const je=$(c[0]);je.set("offset",lo(he)),k.push(je);const gt=c.length-1;for(let vt=1;vt<=gt;vt++){let Jt=$(c[vt]);const d=Jt.get("offset");Jt.set("offset",lo((h+d*y)/ne)),k.push(Jt)}y=ne,h=0,x="",c=k}return ii(this.element,c,this.preStyleProps,this.postStyleProps,y,h,x,!0)}}function lo(S,c=3){const h=Math.pow(10,c-1);return Math.round(S*h)/h}class $r{}const dr=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"]);class Mr extends $r{normalizePropertyName(c,h){return rt(c)}normalizeStyleValue(c,h,y,x){let k="";const ne=y.toString().trim();if(dr.has(h)&&0!==y&&"0"!==y)if("number"==typeof y)k="px";else{const he=y.match(/^[+-]?[\d\.]+([a-z]*)$/);he&&0==he[1].length&&x.push(function te(S,c){return new A.vHH(3005,!1)}())}return ne+k}}function hr(S,c,h,y,x,k,ne,he,Ne,je,gt,vt,Jt){return{type:0,element:S,triggerName:c,isRemovalTransition:x,fromState:h,fromStyles:k,toState:y,toStyles:ne,timelines:he,queriedElements:Ne,preStyleProps:je,postStyleProps:gt,totalTime:vt,errors:Jt}}const ir={};class Vt{constructor(c,h,y){this._triggerName=c,this.ast=h,this._stateStyles=y}match(c,h,y,x){return function Xn(S,c,h,y,x){return S.some(k=>k(c,h,y,x))}(this.ast.matchers,c,h,y,x)}buildStyles(c,h,y){let x=this._stateStyles.get("*");return void 0!==c&&(x=this._stateStyles.get(c?.toString())||x),x?x.buildStyles(h,y):new Map}build(c,h,y,x,k,ne,he,Ne,je,gt){const vt=[],Jt=this.ast.options&&this.ast.options.params||ir,C=this.buildStyles(y,he&&he.params||ir,vt),_=Ne&&Ne.params||ir,w=this.buildStyles(x,_,vt),W=new Set,Oe=new Map,Ue=new Map,ut="void"===x,sn={params:Ki(_,Jt),delay:this.ast.options?.delay},tn=gt?[]:Vr(c,h,this.ast.animation,k,ne,C,w,sn,je,vt);let Ht=0;if(tn.forEach(hn=>{Ht=Math.max(hn.duration+hn.delay,Ht)}),vt.length)return hr(h,this._triggerName,y,x,ut,C,w,[],[],Oe,Ue,Ht,vt);tn.forEach(hn=>{const qt=hn.element,Fn=Mt(Oe,qt,new Set);hn.preStyleProps.forEach(Pn=>Fn.add(Pn));const ui=Mt(Ue,qt,new Set);hn.postStyleProps.forEach(Pn=>ui.add(Pn)),qt!==h&&W.add(qt)});const kt=U(W.values());return hr(h,this._triggerName,y,x,ut,C,w,tn,kt,Oe,Ue,Ht)}}function Ki(S,c){const h=Mn(c);for(const y in S)S.hasOwnProperty(y)&&null!=S[y]&&(h[y]=S[y]);return h}class ci{constructor(c,h,y){this.styles=c,this.defaultParams=h,this.normalizer=y}buildStyles(c,h){const y=new Map,x=Mn(this.defaultParams);return Object.keys(c).forEach(k=>{const ne=c[k];null!==ne&&(x[k]=ne)}),this.styles.styles.forEach(k=>{"string"!=typeof k&&k.forEach((ne,he)=>{ne&&(ne=D(ne,x,h));const Ne=this.normalizer.normalizePropertyName(he,h);ne=this.normalizer.normalizeStyleValue(he,Ne,ne,h),y.set(he,ne)})}),y}}class Gr{constructor(c,h,y){this.name=c,this.ast=h,this._normalizer=y,this.transitionFactories=[],this.states=new Map,h.states.forEach(x=>{this.states.set(x.name,new ci(x.style,x.options&&x.options.params||{},y))}),fr(this.states,"true","1"),fr(this.states,"false","0"),h.transitions.forEach(x=>{this.transitionFactories.push(new Vt(c,x,this.states))}),this.fallbackTransition=function Sr(S,c,h){return new Vt(S,{type:1,animation:{type:2,steps:[],options:null},matchers:[(ne,he)=>!0],options:null,queryCount:0,depCount:0},c)}(c,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(c,h,y,x){return this.transitionFactories.find(ne=>ne.match(c,h,y,x))||null}matchStyles(c,h,y){return this.fallbackTransition.buildStyles(c,h,y)}}function fr(S,c,h){S.has(c)?S.has(h)||S.set(h,S.get(c)):S.has(h)&&S.set(c,S.get(h))}const Kr=new pi;class bn{constructor(c,h,y){this.bodyNode=c,this._driver=h,this._normalizer=y,this._animations=new Map,this._playersById=new Map,this.players=[]}register(c,h){const y=[],k=un(this._driver,h,y,[]);if(y.length)throw function Et(S){return new A.vHH(3503,!1)}();this._animations.set(c,k)}_buildPlayer(c,h,y){const x=c.element,k=ie(this._normalizer,c.keyframes,h,y);return this._driver.animate(x,k,c.duration,c.delay,c.easing,[],!0)}create(c,h,y={}){const x=[],k=this._animations.get(c);let ne;const he=new Map;if(k?(ne=Vr(this._driver,h,k,Dt,Ft,new Map,new Map,y,Kr,x),ne.forEach(gt=>{const vt=Mt(he,gt.element,new Map);gt.postStyleProps.forEach(Jt=>vt.set(Jt,null))})):(x.push(function Tt(){return new A.vHH(3300,!1)}()),ne=[]),x.length)throw function Nt(S){return new A.vHH(3504,!1)}();he.forEach((gt,vt)=>{gt.forEach((Jt,d)=>{gt.set(d,this._driver.computeStyle(vt,d,B.l3))})});const je=j(ne.map(gt=>{const vt=he.get(gt.element);return this._buildPlayer(gt,new Map,vt)}));return this._playersById.set(c,je),je.onDestroy(()=>this.destroy(c)),this.players.push(je),je}destroy(c){const h=this._getPlayer(c);h.destroy(),this._playersById.delete(c);const y=this.players.indexOf(h);y>=0&&this.players.splice(y,1)}_getPlayer(c){const h=this._playersById.get(c);if(!h)throw function lt(S){return new A.vHH(3301,!1)}();return h}listen(c,h,y,x){const k=et(h,"","","");return Re(this._getPlayer(c),y,k,x),()=>{}}command(c,h,y,x){if("register"==y)return void this.register(c,x[0]);if("create"==y)return void this.create(c,h,x[0]||{});const k=this._getPlayer(c);switch(y){case"play":k.play();break;case"pause":k.pause();break;case"reset":k.reset();break;case"restart":k.restart();break;case"finish":k.finish();break;case"init":k.init();break;case"setPosition":k.setPosition(parseFloat(x[0]));break;case"destroy":this.destroy(c)}}}const pt="ng-animate-queued",dn="ng-animate-disabled",Yi=[],Cn={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},mi={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Qn="__ng_removed";class Bt{get params(){return this.options.params}constructor(c,h=""){this.namespaceId=h;const y=c&&c.hasOwnProperty("value");if(this.value=function Ti(S){return S??null}(y?c.value:c),y){const k=Mn(c);delete k.value,this.options=k}else this.options={};this.options.params||(this.options.params={})}absorbOptions(c){const h=c.params;if(h){const y=this.options.params;Object.keys(h).forEach(x=>{null==y[x]&&(y[x]=h[x])})}}}const Ei="void",pr=new Bt(Ei);class rr{constructor(c,h,y){this.id=c,this.hostElement=h,this._engine=y,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+c,oi(h,this._hostClassName)}listen(c,h,y,x){if(!this._triggers.has(h))throw function zt(S,c){return new A.vHH(3302,!1)}();if(null==y||0==y.length)throw function Z(S){return new A.vHH(3303,!1)}();if(!function Zo(S){return"start"==S||"done"==S}(y))throw function Q(S,c){return new A.vHH(3400,!1)}();const k=Mt(this._elementListeners,c,[]),ne={name:h,phase:y,callback:x};k.push(ne);const he=Mt(this._engine.statesByElement,c,new Map);return he.has(h)||(oi(c,ot),oi(c,ot+"-"+h),he.set(h,pr)),()=>{this._engine.afterFlush(()=>{const Ne=k.indexOf(ne);Ne>=0&&k.splice(Ne,1),this._triggers.has(h)||he.delete(h)})}}register(c,h){return!this._triggers.has(c)&&(this._triggers.set(c,h),!0)}_getTrigger(c){const h=this._triggers.get(c);if(!h)throw function K(S){return new A.vHH(3401,!1)}();return h}trigger(c,h,y,x=!0){const k=this._getTrigger(h),ne=new Zi(this.id,h,c);let he=this._engine.statesByElement.get(c);he||(oi(c,ot),oi(c,ot+"-"+h),this._engine.statesByElement.set(c,he=new Map));let Ne=he.get(h);const je=new Bt(y,this.id);if(!(y&&y.hasOwnProperty("value"))&&Ne&&je.absorbOptions(Ne.options),he.set(h,je),Ne||(Ne=pr),je.value!==Ei&&Ne.value===je.value){if(!function wi(S,c){const h=Object.keys(S),y=Object.keys(c);if(h.length!=y.length)return!1;for(let x=0;x<h.length;x++){const k=h[x];if(!c.hasOwnProperty(k)||S[k]!==c[k])return!1}return!0}(Ne.params,je.params)){const _=[],w=k.matchStyles(Ne.value,Ne.params,_),W=k.matchStyles(je.value,je.params,_);_.length?this._engine.reportError(_):this._engine.afterFlush(()=>{Ae(c,w),ae(c,W)})}return}const Jt=Mt(this._engine.playersByElement,c,[]);Jt.forEach(_=>{_.namespaceId==this.id&&_.triggerName==h&&_.queued&&_.destroy()});let d=k.matchTransition(Ne.value,je.value,c,je.params),C=!1;if(!d){if(!x)return;d=k.fallbackTransition,C=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:c,triggerName:h,transition:d,fromState:Ne,toState:je,player:ne,isFallbackTransition:C}),C||(oi(c,pt),ne.onStart(()=>{$t(c,pt)})),ne.onDone(()=>{let _=this.players.indexOf(ne);_>=0&&this.players.splice(_,1);const w=this._engine.playersByElement.get(c);if(w){let W=w.indexOf(ne);W>=0&&w.splice(W,1)}}),this.players.push(ne),Jt.push(ne),ne}deregister(c){this._triggers.delete(c),this._engine.statesByElement.forEach(h=>h.delete(c)),this._elementListeners.forEach((h,y)=>{this._elementListeners.set(y,h.filter(x=>x.name!=c))})}clearElementCache(c){this._engine.statesByElement.delete(c),this._elementListeners.delete(c);const h=this._engine.playersByElement.get(c);h&&(h.forEach(y=>y.destroy()),this._engine.playersByElement.delete(c))}_signalRemovalForInnerTriggers(c,h){const y=this._engine.driver.query(c,St,!0);y.forEach(x=>{if(x[Qn])return;const k=this._engine.fetchNamespacesByElement(x);k.size?k.forEach(ne=>ne.triggerLeaveAnimation(x,h,!1,!0)):this.clearElementCache(x)}),this._engine.afterFlushAnimationsDone(()=>y.forEach(x=>this.clearElementCache(x)))}triggerLeaveAnimation(c,h,y,x){const k=this._engine.statesByElement.get(c),ne=new Map;if(k){const he=[];if(k.forEach((Ne,je)=>{if(ne.set(je,Ne.value),this._triggers.has(je)){const gt=this.trigger(c,je,Ei,x);gt&&he.push(gt)}}),he.length)return this._engine.markElementAsRemoved(this.id,c,!0,h,ne),y&&j(he).onDone(()=>this._engine.processLeaveNode(c)),!0}return!1}prepareLeaveAnimationListeners(c){const h=this._elementListeners.get(c),y=this._engine.statesByElement.get(c);if(h&&y){const x=new Set;h.forEach(k=>{const ne=k.name;if(x.has(ne))return;x.add(ne);const Ne=this._triggers.get(ne).fallbackTransition,je=y.get(ne)||pr,gt=new Bt(Ei),vt=new Zi(this.id,ne,c);this._engine.totalQueuedPlayers++,this._queue.push({element:c,triggerName:ne,transition:Ne,fromState:je,toState:gt,player:vt,isFallbackTransition:!0})})}}removeNode(c,h){const y=this._engine;if(c.childElementCount&&this._signalRemovalForInnerTriggers(c,h),this.triggerLeaveAnimation(c,h,!0))return;let x=!1;if(y.totalAnimations){const k=y.players.length?y.playersByQueriedElement.get(c):[];if(k&&k.length)x=!0;else{let ne=c;for(;ne=ne.parentNode;)if(y.statesByElement.get(ne)){x=!0;break}}}if(this.prepareLeaveAnimationListeners(c),x)y.markElementAsRemoved(this.id,c,!1,h);else{const k=c[Qn];(!k||k===Cn)&&(y.afterFlush(()=>this.clearElementCache(c)),y.destroyInnerAnimations(c),y._onRemovalComplete(c,h))}}insertNode(c,h){oi(c,this._hostClassName)}drainQueuedTransitions(c){const h=[];return this._queue.forEach(y=>{const x=y.player;if(x.destroyed)return;const k=y.element,ne=this._elementListeners.get(k);ne&&ne.forEach(he=>{if(he.name==y.triggerName){const Ne=et(k,y.triggerName,y.fromState.value,y.toState.value);Ne._data=c,Re(y.player,he.phase,Ne,he.callback)}}),x.markedForDestroy?this._engine.afterFlush(()=>{x.destroy()}):h.push(y)}),this._queue=[],h.sort((y,x)=>{const k=y.transition.ast.depCount,ne=x.transition.ast.depCount;return 0==k||0==ne?k-ne:this._engine.driver.containsElement(y.element,x.element)?1:-1})}destroy(c){this.players.forEach(h=>h.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,c)}}class On{_onRemovalComplete(c,h){this.onRemovalComplete(c,h)}constructor(c,h,y){this.bodyNode=c,this.driver=h,this._normalizer=y,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(x,k)=>{}}get queuedPlayers(){const c=[];return this._namespaceList.forEach(h=>{h.players.forEach(y=>{y.queued&&c.push(y)})}),c}createNamespace(c,h){const y=new rr(c,h,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,h)?this._balanceNamespaceList(y,h):(this.newHostElements.set(h,y),this.collectEnterElement(h)),this._namespaceLookup[c]=y}_balanceNamespaceList(c,h){const y=this._namespaceList,x=this.namespacesByHostElement;if(y.length-1>=0){let ne=!1,he=this.driver.getParentElement(h);for(;he;){const Ne=x.get(he);if(Ne){const je=y.indexOf(Ne);y.splice(je+1,0,c),ne=!0;break}he=this.driver.getParentElement(he)}ne||y.unshift(c)}else y.push(c);return x.set(h,c),c}register(c,h){let y=this._namespaceLookup[c];return y||(y=this.createNamespace(c,h)),y}registerTrigger(c,h,y){let x=this._namespaceLookup[c];x&&x.register(h,y)&&this.totalAnimations++}destroy(c,h){c&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const y=this._fetchNamespace(c);this.namespacesByHostElement.delete(y.hostElement);const x=this._namespaceList.indexOf(y);x>=0&&this._namespaceList.splice(x,1),y.destroy(h),delete this._namespaceLookup[c]}))}_fetchNamespace(c){return this._namespaceLookup[c]}fetchNamespacesByElement(c){const h=new Set,y=this.statesByElement.get(c);if(y)for(let x of y.values())if(x.namespaceId){const k=this._fetchNamespace(x.namespaceId);k&&h.add(k)}return h}trigger(c,h,y,x){if(Xi(h)){const k=this._fetchNamespace(c);if(k)return k.trigger(h,y,x),!0}return!1}insertNode(c,h,y,x){if(!Xi(h))return;const k=h[Qn];if(k&&k.setForRemoval){k.setForRemoval=!1,k.setForMove=!0;const ne=this.collectedLeaveElements.indexOf(h);ne>=0&&this.collectedLeaveElements.splice(ne,1)}if(c){const ne=this._fetchNamespace(c);ne&&ne.insertNode(h,y)}x&&this.collectEnterElement(h)}collectEnterElement(c){this.collectedEnterElements.push(c)}markElementAsDisabled(c,h){h?this.disabledNodes.has(c)||(this.disabledNodes.add(c),oi(c,dn)):this.disabledNodes.has(c)&&(this.disabledNodes.delete(c),$t(c,dn))}removeNode(c,h,y){if(Xi(h)){const x=c?this._fetchNamespace(c):null;x?x.removeNode(h,y):this.markElementAsRemoved(c,h,!1,y);const k=this.namespacesByHostElement.get(h);k&&k.id!==c&&k.removeNode(h,y)}else this._onRemovalComplete(h,y)}markElementAsRemoved(c,h,y,x,k){this.collectedLeaveElements.push(h),h[Qn]={namespaceId:c,setForRemoval:x,hasAnimation:y,removedBeforeQueried:!1,previousTriggersValues:k}}listen(c,h,y,x,k){return Xi(h)?this._fetchNamespace(c).listen(h,y,x,k):()=>{}}_buildInstruction(c,h,y,x,k){return c.transition.build(this.driver,c.element,c.fromState.value,c.toState.value,y,x,c.fromState.options,c.toState.options,h,k)}destroyInnerAnimations(c){let h=this.driver.query(c,St,!0);h.forEach(y=>this.destroyActiveAnimationsForElement(y)),0!=this.playersByQueriedElement.size&&(h=this.driver.query(c,Dn,!0),h.forEach(y=>this.finishActiveQueriedAnimationOnElement(y)))}destroyActiveAnimationsForElement(c){const h=this.playersByElement.get(c);h&&h.forEach(y=>{y.queued?y.markedForDestroy=!0:y.destroy()})}finishActiveQueriedAnimationOnElement(c){const h=this.playersByQueriedElement.get(c);h&&h.forEach(y=>y.finish())}whenRenderingDone(){return new Promise(c=>{if(this.players.length)return j(this.players).onDone(()=>c());c()})}processLeaveNode(c){const h=c[Qn];if(h&&h.setForRemoval){if(c[Qn]=Cn,h.namespaceId){this.destroyInnerAnimations(c);const y=this._fetchNamespace(h.namespaceId);y&&y.clearElementCache(c)}this._onRemovalComplete(c,h.setForRemoval)}c.classList?.contains(dn)&&this.markElementAsDisabled(c,!1),this.driver.query(c,".ng-animate-disabled",!0).forEach(y=>{this.markElementAsDisabled(y,!1)})}flush(c=-1){let h=[];if(this.newHostElements.size&&(this.newHostElements.forEach((y,x)=>this._balanceNamespaceList(y,x)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let y=0;y<this.collectedEnterElements.length;y++)oi(this.collectedEnterElements[y],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){const y=[];try{h=this._flushAnimations(y,c)}finally{for(let x=0;x<y.length;x++)y[x]()}}else for(let y=0;y<this.collectedLeaveElements.length;y++)this.processLeaveNode(this.collectedLeaveElements[y]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(y=>y()),this._flushFns=[],this._whenQuietFns.length){const y=this._whenQuietFns;this._whenQuietFns=[],h.length?j(h).onDone(()=>{y.forEach(x=>x())}):y.forEach(x=>x())}}reportError(c){throw function De(S){return new A.vHH(3402,!1)}()}_flushAnimations(c,h){const y=new pi,x=[],k=new Map,ne=[],he=new Map,Ne=new Map,je=new Map,gt=new Set;this.disabledNodes.forEach(Ct=>{gt.add(Ct);const wt=this.driver.query(Ct,".ng-animate-queued",!0);for(let At=0;At<wt.length;At++)gt.add(wt[At])});const vt=this.bodyNode,Jt=Array.from(this.statesByElement.keys()),d=Bi(Jt,this.collectedEnterElements),C=new Map;let _=0;d.forEach((Ct,wt)=>{const At=Dt+_++;C.set(wt,At),Ct.forEach(Wt=>oi(Wt,At))});const w=[],W=new Set,Oe=new Set;for(let Ct=0;Ct<this.collectedLeaveElements.length;Ct++){const wt=this.collectedLeaveElements[Ct],At=wt[Qn];At&&At.setForRemoval&&(w.push(wt),W.add(wt),At.hasAnimation?this.driver.query(wt,".ng-star-inserted",!0).forEach(Wt=>W.add(Wt)):Oe.add(wt))}const Ue=new Map,ut=Bi(Jt,Array.from(W));ut.forEach((Ct,wt)=>{const At=Ft+_++;Ue.set(wt,At),Ct.forEach(Wt=>oi(Wt,At))}),c.push(()=>{d.forEach((Ct,wt)=>{const At=C.get(wt);Ct.forEach(Wt=>$t(Wt,At))}),ut.forEach((Ct,wt)=>{const At=Ue.get(wt);Ct.forEach(Wt=>$t(Wt,At))}),w.forEach(Ct=>{this.processLeaveNode(Ct)})});const sn=[],tn=[];for(let Ct=this._namespaceList.length-1;Ct>=0;Ct--)this._namespaceList[Ct].drainQueuedTransitions(h).forEach(At=>{const Wt=At.player,Gt=At.element;if(sn.push(Wt),this.collectedEnterElements.length){const _n=Gt[Qn];if(_n&&_n.setForMove){if(_n.previousTriggersValues&&_n.previousTriggersValues.has(At.triggerName)){const yr=_n.previousTriggersValues.get(At.triggerName),vi=this.statesByElement.get(At.element);if(vi&&vi.has(At.triggerName)){const eo=vi.get(At.triggerName);eo.value=yr,vi.set(At.triggerName,eo)}}return void Wt.destroy()}}const Ci=!vt||!this.driver.containsElement(vt,Gt),Wn=Ue.get(Gt),Nn=C.get(Gt),xn=this._buildInstruction(At,y,Nn,Wn,Ci);if(xn.errors&&xn.errors.length)return void tn.push(xn);if(Ci)return Wt.onStart(()=>Ae(Gt,xn.fromStyles)),Wt.onDestroy(()=>ae(Gt,xn.toStyles)),void x.push(Wt);if(At.isFallbackTransition)return Wt.onStart(()=>Ae(Gt,xn.fromStyles)),Wt.onDestroy(()=>ae(Gt,xn.toStyles)),void x.push(Wt);const Po=[];xn.timelines.forEach(_n=>{_n.stretchStartingKeyframe=!0,this.disabledNodes.has(_n.element)||Po.push(_n)}),xn.timelines=Po,y.append(Gt,xn.timelines),ne.push({instruction:xn,player:Wt,element:Gt}),xn.queriedElements.forEach(_n=>Mt(he,_n,[]).push(Wt)),xn.preStyleProps.forEach((_n,yr)=>{if(_n.size){let vi=Ne.get(yr);vi||Ne.set(yr,vi=new Set),_n.forEach((eo,Vi)=>vi.add(Vi))}}),xn.postStyleProps.forEach((_n,yr)=>{let vi=je.get(yr);vi||je.set(yr,vi=new Set),_n.forEach((eo,Vi)=>vi.add(Vi))})});if(tn.length){const Ct=[];tn.forEach(wt=>{Ct.push(function P(S,c){return new A.vHH(3505,!1)}())}),sn.forEach(wt=>wt.destroy()),this.reportError(Ct)}const Ht=new Map,kt=new Map;ne.forEach(Ct=>{const wt=Ct.element;y.has(wt)&&(kt.set(wt,wt),this._beforeAnimationBuild(Ct.player.namespaceId,Ct.instruction,Ht))}),x.forEach(Ct=>{const wt=Ct.element;this._getPreviousPlayers(wt,!1,Ct.namespaceId,Ct.triggerName,null).forEach(Wt=>{Mt(Ht,wt,[]).push(Wt),Wt.destroy()})});const hn=w.filter(Ct=>ji(Ct,Ne,je)),qt=new Map;ki(qt,this.driver,Oe,je,B.l3).forEach(Ct=>{ji(Ct,Ne,je)&&hn.push(Ct)});const ui=new Map;d.forEach((Ct,wt)=>{ki(ui,this.driver,new Set(Ct),Ne,B.k1)}),hn.forEach(Ct=>{const wt=qt.get(Ct),At=ui.get(Ct);qt.set(Ct,new Map([...wt?.entries()??[],...At?.entries()??[]]))});const Pn=[],Hi=[],si={};ne.forEach(Ct=>{const{element:wt,player:At,instruction:Wt}=Ct;if(y.has(wt)){if(gt.has(wt))return At.onDestroy(()=>ae(wt,Wt.toStyles)),At.disabled=!0,At.overrideTotalTime(Wt.totalTime),void x.push(At);let Gt=si;if(kt.size>1){let Wn=wt;const Nn=[];for(;Wn=Wn.parentNode;){const xn=kt.get(Wn);if(xn){Gt=xn;break}Nn.push(Wn)}Nn.forEach(xn=>kt.set(xn,Gt))}const Ci=this._buildAnimation(At.namespaceId,Wt,Ht,k,ui,qt);if(At.setRealPlayer(Ci),Gt===si)Pn.push(At);else{const Wn=this.playersByElement.get(Gt);Wn&&Wn.length&&(At.parentPlayer=j(Wn)),x.push(At)}}else Ae(wt,Wt.fromStyles),At.onDestroy(()=>ae