(self.webpackChunklicense_server=self.webpackChunklicense_server||[]).push([[792],{243:Eo=>{"use strict";var Ht={single_source_shortest_paths:function(qt,Dt,bt){var gt={},h={};h[Dt]=0;var Ot,Pt,Be,kn,Yn,vn,_t=Ht.PriorityQueue.make();for(_t.push(Dt,0);!_t.empty();)for(Be in kn=(Ot=_t.pop()).cost,Yn=qt[Pt=Ot.value]||{})Yn.hasOwnProperty(Be)&&(vn=kn+Yn[Be],(typeof h[Be]>"u"||h[Be]>vn)&&(h[Be]=vn,_t.push(Be,vn),gt[Be]=Pt));if(typeof bt<"u"&&typeof h[bt]>"u"){var ui=["Could not find a path from ",Dt," to ",bt,"."].join("");throw new Error(ui)}return gt},extract_shortest_path_from_predecessor_list:function(qt,Dt){for(var bt=[],gt=Dt;gt;)bt.push(gt),gt=qt[gt];return bt.reverse(),bt},find_path:function(qt,Dt,bt){var gt=Ht.single_source_shortest_paths(qt,Dt,bt);return Ht.extract_shortest_path_from_predecessor_list(gt,bt)},PriorityQueue:{make:function(qt){var gt,Dt=Ht.PriorityQueue,bt={};for(gt in qt=qt||{},Dt)Dt.hasOwnProperty(gt)&&(bt[gt]=Dt[gt]);return bt.queue=[],bt.sorter=qt.sorter||Dt.default_sorter,bt},default_sorter:function(qt,Dt){return qt.cost-Dt.cost},push:function(qt,Dt){this.queue.push({value:qt,cost:Dt}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};Eo.exports=Ht},377:(Eo,Ht)=>{Ht.isValid=function(Dt){return!isNaN(Dt)&&Dt>=1&&Dt<=40}},1018:(Eo,Ht,qt)=>{const Dt=qt(1677),bt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function gt(h){this.mode=Dt.ALPHANUMERIC,this.data=h}gt.getBitsLength=function(_t){return 11*Math.floor(_t/2)+_t%2*6},gt.prototype.getLength=function(){return this.data.length},gt.prototype.getBitsLength=function(){return gt.getBitsLength(this.data.length)},gt.prototype.write=function(_t){let Ot;for(Ot=0;Ot+2<=this.data.length;Ot+=2){let Pt=45*bt.indexOf(this.data[Ot]);Pt+=bt.indexOf(this.data[Ot+1]),_t.put(Pt,11)}this.data.length%2&&_t.put(bt.indexOf(this.data[Ot]),6)},Eo.exports=gt},1247:function(Eo){Eo.exports=function(){"use strict";var Ht,qt,Dt;function bt(h,_t){if(Ht)if(qt){var Ot="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+Ht+")(sharedChunk); ("+qt+")(sharedChunk); self.onerror = null;",Pt={};Ht(Pt),Dt=_t(Pt),typeof window<"u"&&window&&window.URL&&window.URL.createObjectURL&&(Dt.workerUrl=window.URL.createObjectURL(new Blob([Ot],{type:"text/javascript"})))}else qt=_t;else Ht=_t}return bt(0,function(h){function _t(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Ot,Pt={},Be={};function kn(){if(Ot)return Be;Ot=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.setMatrixArrayType=function(g){Be.ARRAY_TYPE=a=g},Be.toRadian=function(g){return g*p},Be.equals=function(g,m){return Math.abs(g-m)<=d*Math.max(1,Math.abs(g),Math.abs(m))},Be.RANDOM=Be.ARRAY_TYPE=Be.EPSILON=void 0;var d=1e-6;Be.EPSILON=d;var a=typeof Float32Array<"u"?Float32Array:Array;Be.ARRAY_TYPE=a;var l=Math.random;Be.RANDOM=l;var p=Math.PI/180;return Math.hypot||(Math.hypot=function(){for(var g=0,m=arguments.length;m--;)g+=arguments[m]*arguments[m];return Math.sqrt(g)}),Be}var Yn,Fn={};function vn(){if(Yn)return Fn;function d(m){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(b){return typeof b}:function(b){return b&&"function"==typeof Symbol&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(m)}Yn=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.create=function(){var m=new a.ARRAY_TYPE(4);return a.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0),m[0]=1,m[3]=1,m},Fn.clone=function(m){var b=new a.ARRAY_TYPE(4);return b[0]=m[0],b[1]=m[1],b[2]=m[2],b[3]=m[3],b},Fn.copy=function(m,b){return m[0]=b[0],m[1]=b[1],m[2]=b[2],m[3]=b[3],m},Fn.identity=function(m){return m[0]=1,m[1]=0,m[2]=0,m[3]=1,m},Fn.fromValues=function(m,b,T,k){var F=new a.ARRAY_TYPE(4);return F[0]=m,F[1]=b,F[2]=T,F[3]=k,F},Fn.set=function(m,b,T,k,F){return m[0]=b,m[1]=T,m[2]=k,m[3]=F,m},Fn.transpose=function(m,b){if(m===b){var T=b[1];m[1]=b[2],m[2]=T}else m[0]=b[0],m[1]=b[2],m[2]=b[1],m[3]=b[3];return m},Fn.invert=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=T*S-F*k;return R?(m[0]=S*(R=1/R),m[1]=-k*R,m[2]=-F*R,m[3]=T*R,m):null},Fn.adjoint=function(m,b){var T=b[0];return m[0]=b[3],m[1]=-b[1],m[2]=-b[2],m[3]=T,m},Fn.determinant=function(m){return m[0]*m[3]-m[2]*m[1]},Fn.multiply=p,Fn.rotate=function(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=Math.sin(T),A=Math.cos(T);return m[0]=k*A+S*L,m[1]=F*A+R*L,m[2]=k*-L+S*A,m[3]=F*-L+R*A,m},Fn.scale=function(m,b,T){var k=b[1],F=b[2],S=b[3],R=T[0],L=T[1];return m[0]=b[0]*R,m[1]=k*R,m[2]=F*L,m[3]=S*L,m},Fn.fromRotation=function(m,b){var T=Math.sin(b),k=Math.cos(b);return m[0]=k,m[1]=T,m[2]=-T,m[3]=k,m},Fn.fromScaling=function(m,b){return m[0]=b[0],m[1]=0,m[2]=0,m[3]=b[1],m},Fn.str=function(m){return"mat2("+m[0]+", "+m[1]+", "+m[2]+", "+m[3]+")"},Fn.frob=function(m){return Math.hypot(m[0],m[1],m[2],m[3])},Fn.LDU=function(m,b,T,k){return m[2]=k[2]/k[0],T[0]=k[0],T[1]=k[1],T[3]=k[3]-m[2]*T[1],[m,b,T]},Fn.add=function(m,b,T){return m[0]=b[0]+T[0],m[1]=b[1]+T[1],m[2]=b[2]+T[2],m[3]=b[3]+T[3],m},Fn.subtract=g,Fn.exactEquals=function(m,b){return m[0]===b[0]&&m[1]===b[1]&&m[2]===b[2]&&m[3]===b[3]},Fn.equals=function(m,b){var T=m[0],k=m[1],F=m[2],S=m[3],R=b[0],L=b[1],A=b[2],P=b[3];return Math.abs(T-R)<=a.EPSILON*Math.max(1,Math.abs(T),Math.abs(R))&&Math.abs(k-L)<=a.EPSILON*Math.max(1,Math.abs(k),Math.abs(L))&&Math.abs(F-A)<=a.EPSILON*Math.max(1,Math.abs(F),Math.abs(A))&&Math.abs(S-P)<=a.EPSILON*Math.max(1,Math.abs(S),Math.abs(P))},Fn.multiplyScalar=function(m,b,T){return m[0]=b[0]*T,m[1]=b[1]*T,m[2]=b[2]*T,m[3]=b[3]*T,m},Fn.multiplyScalarAndAdd=function(m,b,T,k){return m[0]=b[0]+T[0]*k,m[1]=b[1]+T[1]*k,m[2]=b[2]+T[2]*k,m[3]=b[3]+T[3]*k,m},Fn.sub=Fn.mul=void 0;var a=function(m){if(m&&m.__esModule)return m;if(null===m||"object"!==d(m)&&"function"!=typeof m)return{default:m};var T=l(void 0);if(T&&T.has(m))return T.get(m);var k={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in m)if("default"!==S&&Object.prototype.hasOwnProperty.call(m,S)){var R=F?Object.getOwnPropertyDescriptor(m,S):null;R&&(R.get||R.set)?Object.defineProperty(k,S,R):k[S]=m[S]}return k.default=m,T&&T.set(m,k),k}(kn());function l(m){if("function"!=typeof WeakMap)return null;var b=new WeakMap,T=new WeakMap;return(l=function(k){return k?T:b})(m)}function p(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=T[0],A=T[1],P=T[2],z=T[3];return m[0]=k*L+S*A,m[1]=F*L+R*A,m[2]=k*P+S*z,m[3]=F*P+R*z,m}function g(m,b,T){return m[0]=b[0]-T[0],m[1]=b[1]-T[1],m[2]=b[2]-T[2],m[3]=b[3]-T[3],m}return Fn.mul=p,Fn.sub=g,Fn}var un,ln={};function ui(){if(un)return ln;function d(m){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(b){return typeof b}:function(b){return b&&"function"==typeof Symbol&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(m)}un=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.create=function(){var m=new a.ARRAY_TYPE(6);return a.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0,m[4]=0,m[5]=0),m[0]=1,m[3]=1,m},ln.clone=function(m){var b=new a.ARRAY_TYPE(6);return b[0]=m[0],b[1]=m[1],b[2]=m[2],b[3]=m[3],b[4]=m[4],b[5]=m[5],b},ln.copy=function(m,b){return m[0]=b[0],m[1]=b[1],m[2]=b[2],m[3]=b[3],m[4]=b[4],m[5]=b[5],m},ln.identity=function(m){return m[0]=1,m[1]=0,m[2]=0,m[3]=1,m[4]=0,m[5]=0,m},ln.fromValues=function(m,b,T,k,F,S){var R=new a.ARRAY_TYPE(6);return R[0]=m,R[1]=b,R[2]=T,R[3]=k,R[4]=F,R[5]=S,R},ln.set=function(m,b,T,k,F,S,R){return m[0]=b,m[1]=T,m[2]=k,m[3]=F,m[4]=S,m[5]=R,m},ln.invert=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=b[4],L=b[5],A=T*S-k*F;return A?(m[0]=S*(A=1/A),m[1]=-k*A,m[2]=-F*A,m[3]=T*A,m[4]=(F*L-S*R)*A,m[5]=(k*R-T*L)*A,m):null},ln.determinant=function(m){return m[0]*m[3]-m[1]*m[2]},ln.multiply=p,ln.rotate=function(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=Math.sin(T),z=Math.cos(T);return m[0]=k*z+S*P,m[1]=F*z+R*P,m[2]=k*-P+S*z,m[3]=F*-P+R*z,m[4]=L,m[5]=A,m},ln.scale=function(m,b,T){var k=b[1],F=b[2],S=b[3],R=b[4],L=b[5],A=T[0],P=T[1];return m[0]=b[0]*A,m[1]=k*A,m[2]=F*P,m[3]=S*P,m[4]=R,m[5]=L,m},ln.translate=function(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=T[0],z=T[1];return m[0]=k,m[1]=F,m[2]=S,m[3]=R,m[4]=k*P+S*z+L,m[5]=F*P+R*z+A,m},ln.fromRotation=function(m,b){var T=Math.sin(b),k=Math.cos(b);return m[0]=k,m[1]=T,m[2]=-T,m[3]=k,m[4]=0,m[5]=0,m},ln.fromScaling=function(m,b){return m[0]=b[0],m[1]=0,m[2]=0,m[3]=b[1],m[4]=0,m[5]=0,m},ln.fromTranslation=function(m,b){return m[0]=1,m[1]=0,m[2]=0,m[3]=1,m[4]=b[0],m[5]=b[1],m},ln.str=function(m){return"mat2d("+m[0]+", "+m[1]+", "+m[2]+", "+m[3]+", "+m[4]+", "+m[5]+")"},ln.frob=function(m){return Math.hypot(m[0],m[1],m[2],m[3],m[4],m[5],1)},ln.add=function(m,b,T){return m[0]=b[0]+T[0],m[1]=b[1]+T[1],m[2]=b[2]+T[2],m[3]=b[3]+T[3],m[4]=b[4]+T[4],m[5]=b[5]+T[5],m},ln.subtract=g,ln.multiplyScalar=function(m,b,T){return m[0]=b[0]*T,m[1]=b[1]*T,m[2]=b[2]*T,m[3]=b[3]*T,m[4]=b[4]*T,m[5]=b[5]*T,m},ln.multiplyScalarAndAdd=function(m,b,T,k){return m[0]=b[0]+T[0]*k,m[1]=b[1]+T[1]*k,m[2]=b[2]+T[2]*k,m[3]=b[3]+T[3]*k,m[4]=b[4]+T[4]*k,m[5]=b[5]+T[5]*k,m},ln.exactEquals=function(m,b){return m[0]===b[0]&&m[1]===b[1]&&m[2]===b[2]&&m[3]===b[3]&&m[4]===b[4]&&m[5]===b[5]},ln.equals=function(m,b){var T=m[0],k=m[1],F=m[2],S=m[3],R=m[4],L=m[5],A=b[0],P=b[1],z=b[2],j=b[3],$=b[4],K=b[5];return Math.abs(T-A)<=a.EPSILON*Math.max(1,Math.abs(T),Math.abs(A))&&Math.abs(k-P)<=a.EPSILON*Math.max(1,Math.abs(k),Math.abs(P))&&Math.abs(F-z)<=a.EPSILON*Math.max(1,Math.abs(F),Math.abs(z))&&Math.abs(S-j)<=a.EPSILON*Math.max(1,Math.abs(S),Math.abs(j))&&Math.abs(R-$)<=a.EPSILON*Math.max(1,Math.abs(R),Math.abs($))&&Math.abs(L-K)<=a.EPSILON*Math.max(1,Math.abs(L),Math.abs(K))},ln.sub=ln.mul=void 0;var a=function(m){if(m&&m.__esModule)return m;if(null===m||"object"!==d(m)&&"function"!=typeof m)return{default:m};var T=l(void 0);if(T&&T.has(m))return T.get(m);var k={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in m)if("default"!==S&&Object.prototype.hasOwnProperty.call(m,S)){var R=F?Object.getOwnPropertyDescriptor(m,S):null;R&&(R.get||R.set)?Object.defineProperty(k,S,R):k[S]=m[S]}return k.default=m,T&&T.set(m,k),k}(kn());function l(m){if("function"!=typeof WeakMap)return null;var b=new WeakMap,T=new WeakMap;return(l=function(k){return k?T:b})(m)}function p(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=T[0],z=T[1],j=T[2],$=T[3],K=T[4],J=T[5];return m[0]=k*P+S*z,m[1]=F*P+R*z,m[2]=k*j+S*$,m[3]=F*j+R*$,m[4]=k*K+S*J+L,m[5]=F*K+R*J+A,m}function g(m,b,T){return m[0]=b[0]-T[0],m[1]=b[1]-T[1],m[2]=b[2]-T[2],m[3]=b[3]-T[3],m[4]=b[4]-T[4],m[5]=b[5]-T[5],m}return ln.mul=p,ln.sub=g,ln}var Gi,Dn={};function yi(){if(Gi)return Dn;function d(m){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(b){return typeof b}:function(b){return b&&"function"==typeof Symbol&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b})(m)}Gi=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.create=function(){var m=new a.ARRAY_TYPE(9);return a.ARRAY_TYPE!=Float32Array&&(m[1]=0,m[2]=0,m[3]=0,m[5]=0,m[6]=0,m[7]=0),m[0]=1,m[4]=1,m[8]=1,m},Dn.fromMat4=function(m,b){return m[0]=b[0],m[1]=b[1],m[2]=b[2],m[3]=b[4],m[4]=b[5],m[5]=b[6],m[6]=b[8],m[7]=b[9],m[8]=b[10],m},Dn.clone=function(m){var b=new a.ARRAY_TYPE(9);return b[0]=m[0],b[1]=m[1],b[2]=m[2],b[3]=m[3],b[4]=m[4],b[5]=m[5],b[6]=m[6],b[7]=m[7],b[8]=m[8],b},Dn.copy=function(m,b){return m[0]=b[0],m[1]=b[1],m[2]=b[2],m[3]=b[3],m[4]=b[4],m[5]=b[5],m[6]=b[6],m[7]=b[7],m[8]=b[8],m},Dn.fromValues=function(m,b,T,k,F,S,R,L,A){var P=new a.ARRAY_TYPE(9);return P[0]=m,P[1]=b,P[2]=T,P[3]=k,P[4]=F,P[5]=S,P[6]=R,P[7]=L,P[8]=A,P},Dn.set=function(m,b,T,k,F,S,R,L,A,P){return m[0]=b,m[1]=T,m[2]=k,m[3]=F,m[4]=S,m[5]=R,m[6]=L,m[7]=A,m[8]=P,m},Dn.identity=function(m){return m[0]=1,m[1]=0,m[2]=0,m[3]=0,m[4]=1,m[5]=0,m[6]=0,m[7]=0,m[8]=1,m},Dn.transpose=function(m,b){if(m===b){var T=b[1],k=b[2],F=b[5];m[1]=b[3],m[2]=b[6],m[3]=T,m[5]=b[7],m[6]=k,m[7]=F}else m[0]=b[0],m[1]=b[3],m[2]=b[6],m[3]=b[1],m[4]=b[4],m[5]=b[7],m[6]=b[2],m[7]=b[5],m[8]=b[8];return m},Dn.invert=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=b[4],L=b[5],A=b[6],P=b[7],z=b[8],j=z*R-L*P,$=-z*S+L*A,K=P*S-R*A,J=T*j+k*$+F*K;return J?(m[0]=j*(J=1/J),m[1]=(-z*k+F*P)*J,m[2]=(L*k-F*R)*J,m[3]=$*J,m[4]=(z*T-F*A)*J,m[5]=(-L*T+F*S)*J,m[6]=K*J,m[7]=(-P*T+k*A)*J,m[8]=(R*T-k*S)*J,m):null},Dn.adjoint=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=b[4],L=b[5],A=b[6],P=b[7],z=b[8];return m[0]=R*z-L*P,m[1]=F*P-k*z,m[2]=k*L-F*R,m[3]=L*A-S*z,m[4]=T*z-F*A,m[5]=F*S-T*L,m[6]=S*P-R*A,m[7]=k*A-T*P,m[8]=T*R-k*S,m},Dn.determinant=function(m){var b=m[3],T=m[4],k=m[5],F=m[6],S=m[7],R=m[8];return m[0]*(R*T-k*S)+m[1]*(-R*b+k*F)+m[2]*(S*b-T*F)},Dn.multiply=p,Dn.translate=function(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=b[6],z=b[7],j=b[8],$=T[0],K=T[1];return m[0]=k,m[1]=F,m[2]=S,m[3]=R,m[4]=L,m[5]=A,m[6]=$*k+K*R+P,m[7]=$*F+K*L+z,m[8]=$*S+K*A+j,m},Dn.rotate=function(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=b[6],z=b[7],j=b[8],$=Math.sin(T),K=Math.cos(T);return m[0]=K*k+$*R,m[1]=K*F+$*L,m[2]=K*S+$*A,m[3]=K*R-$*k,m[4]=K*L-$*F,m[5]=K*A-$*S,m[6]=P,m[7]=z,m[8]=j,m},Dn.scale=function(m,b,T){var k=T[0],F=T[1];return m[0]=k*b[0],m[1]=k*b[1],m[2]=k*b[2],m[3]=F*b[3],m[4]=F*b[4],m[5]=F*b[5],m[6]=b[6],m[7]=b[7],m[8]=b[8],m},Dn.fromTranslation=function(m,b){return m[0]=1,m[1]=0,m[2]=0,m[3]=0,m[4]=1,m[5]=0,m[6]=b[0],m[7]=b[1],m[8]=1,m},Dn.fromRotation=function(m,b){var T=Math.sin(b),k=Math.cos(b);return m[0]=k,m[1]=T,m[2]=0,m[3]=-T,m[4]=k,m[5]=0,m[6]=0,m[7]=0,m[8]=1,m},Dn.fromScaling=function(m,b){return m[0]=b[0],m[1]=0,m[2]=0,m[3]=0,m[4]=b[1],m[5]=0,m[6]=0,m[7]=0,m[8]=1,m},Dn.fromMat2d=function(m,b){return m[0]=b[0],m[1]=b[1],m[2]=0,m[3]=b[2],m[4]=b[3],m[5]=0,m[6]=b[4],m[7]=b[5],m[8]=1,m},Dn.fromQuat=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=T+T,L=k+k,A=F+F,P=T*R,z=k*R,j=k*L,$=F*R,K=F*L,J=F*A,Z=S*R,ne=S*L,oe=S*A;return m[0]=1-j-J,m[3]=z-oe,m[6]=$+ne,m[1]=z+oe,m[4]=1-P-J,m[7]=K-Z,m[2]=$-ne,m[5]=K+Z,m[8]=1-P-j,m},Dn.normalFromMat4=function(m,b){var T=b[0],k=b[1],F=b[2],S=b[3],R=b[4],L=b[5],A=b[6],P=b[7],z=b[8],j=b[9],$=b[10],K=b[11],J=b[12],Z=b[13],ne=b[14],oe=b[15],le=T*L-k*R,xe=T*A-F*R,ve=T*P-S*R,ye=k*A-F*L,Fe=k*P-S*L,Se=F*P-S*A,Ne=z*Z-j*J,Ge=z*ne-$*J,He=z*oe-K*J,Xe=j*ne-$*Z,Je=j*oe-K*Z,rt=$*oe-K*ne,Qe=le*rt-xe*Je+ve*Xe+ye*He-Fe*Ge+Se*Ne;return Qe?(m[0]=(L*rt-A*Je+P*Xe)*(Qe=1/Qe),m[1]=(A*He-R*rt-P*Ge)*Qe,m[2]=(R*Je-L*He+P*Ne)*Qe,m[3]=(F*Je-k*rt-S*Xe)*Qe,m[4]=(T*rt-F*He+S*Ge)*Qe,m[5]=(k*He-T*Je-S*Ne)*Qe,m[6]=(Z*Se-ne*Fe+oe*ye)*Qe,m[7]=(ne*ve-J*Se-oe*xe)*Qe,m[8]=(J*Fe-Z*ve+oe*le)*Qe,m):null},Dn.projection=function(m,b,T){return m[0]=2/b,m[1]=0,m[2]=0,m[3]=0,m[4]=-2/T,m[5]=0,m[6]=-1,m[7]=1,m[8]=1,m},Dn.str=function(m){return"mat3("+m[0]+", "+m[1]+", "+m[2]+", "+m[3]+", "+m[4]+", "+m[5]+", "+m[6]+", "+m[7]+", "+m[8]+")"},Dn.frob=function(m){return Math.hypot(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8])},Dn.add=function(m,b,T){return m[0]=b[0]+T[0],m[1]=b[1]+T[1],m[2]=b[2]+T[2],m[3]=b[3]+T[3],m[4]=b[4]+T[4],m[5]=b[5]+T[5],m[6]=b[6]+T[6],m[7]=b[7]+T[7],m[8]=b[8]+T[8],m},Dn.subtract=g,Dn.multiplyScalar=function(m,b,T){return m[0]=b[0]*T,m[1]=b[1]*T,m[2]=b[2]*T,m[3]=b[3]*T,m[4]=b[4]*T,m[5]=b[5]*T,m[6]=b[6]*T,m[7]=b[7]*T,m[8]=b[8]*T,m},Dn.multiplyScalarAndAdd=function(m,b,T,k){return m[0]=b[0]+T[0]*k,m[1]=b[1]+T[1]*k,m[2]=b[2]+T[2]*k,m[3]=b[3]+T[3]*k,m[4]=b[4]+T[4]*k,m[5]=b[5]+T[5]*k,m[6]=b[6]+T[6]*k,m[7]=b[7]+T[7]*k,m[8]=b[8]+T[8]*k,m},Dn.exactEquals=function(m,b){return m[0]===b[0]&&m[1]===b[1]&&m[2]===b[2]&&m[3]===b[3]&&m[4]===b[4]&&m[5]===b[5]&&m[6]===b[6]&&m[7]===b[7]&&m[8]===b[8]},Dn.equals=function(m,b){var T=m[0],k=m[1],F=m[2],S=m[3],R=m[4],L=m[5],A=m[6],P=m[7],z=m[8],j=b[0],$=b[1],K=b[2],J=b[3],Z=b[4],ne=b[5],oe=b[6],le=b[7],xe=b[8];return Math.abs(T-j)<=a.EPSILON*Math.max(1,Math.abs(T),Math.abs(j))&&Math.abs(k-$)<=a.EPSILON*Math.max(1,Math.abs(k),Math.abs($))&&Math.abs(F-K)<=a.EPSILON*Math.max(1,Math.abs(F),Math.abs(K))&&Math.abs(S-J)<=a.EPSILON*Math.max(1,Math.abs(S),Math.abs(J))&&Math.abs(R-Z)<=a.EPSILON*Math.max(1,Math.abs(R),Math.abs(Z))&&Math.abs(L-ne)<=a.EPSILON*Math.max(1,Math.abs(L),Math.abs(ne))&&Math.abs(A-oe)<=a.EPSILON*Math.max(1,Math.abs(A),Math.abs(oe))&&Math.abs(P-le)<=a.EPSILON*Math.max(1,Math.abs(P),Math.abs(le))&&Math.abs(z-xe)<=a.EPSILON*Math.max(1,Math.abs(z),Math.abs(xe))},Dn.sub=Dn.mul=void 0;var a=function(m){if(m&&m.__esModule)return m;if(null===m||"object"!==d(m)&&"function"!=typeof m)return{default:m};var T=l(void 0);if(T&&T.has(m))return T.get(m);var k={},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in m)if("default"!==S&&Object.prototype.hasOwnProperty.call(m,S)){var R=F?Object.getOwnPropertyDescriptor(m,S):null;R&&(R.get||R.set)?Object.defineProperty(k,S,R):k[S]=m[S]}return k.default=m,T&&T.set(m,k),k}(kn());function l(m){if("function"!=typeof WeakMap)return null;var b=new WeakMap,T=new WeakMap;return(l=function(k){return k?T:b})(m)}function p(m,b,T){var k=b[0],F=b[1],S=b[2],R=b[3],L=b[4],A=b[5],P=b[6],z=b[7],j=b[8],$=T[0],K=T[1],J=T[2],Z=T[3],ne=T[4],oe=T[5],le=T[6],xe=T[7],ve=T[8];return m[0]=$*k+K*R+J*P,m[1]=$*F+K*L+J*z,m[2]=$*S+K*A+J*j,m[3]=Z*k+ne*R+oe*P,m[4]=Z*F+ne*L+oe*z,m[5]=Z*S+ne*A+oe*j,m[6]=le*k+xe*R+ve*P,m[7]=le*F+xe*L+ve*z,m[8]=le*S+xe*A+ve*j,m}function g(m,b,T){return m[0]=b[0]-T[0],m[1]=b[1]-T[1],m[2]=b[2]-T[2],m[3]=b[3]-T[3],m[4]=b[4]-T[4],m[5]=b[5]-T[5],m[6]=b[6]-T[6],m[7]=b[7]-T[7],m[8]=b[8]-T[8],m}return Dn.mul=p,Dn.sub=g,Dn}var oi,hn={};function Ji(){if(oi)return hn;function d(S){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(R){return typeof R}:function(R){return R&&"function"==typeof Symbol&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(S)}oi=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.create=function(){var S=new a.ARRAY_TYPE(16);return a.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S},hn.clone=function(S){var R=new a.ARRAY_TYPE(16);return R[0]=S[0],R[1]=S[1],R[2]=S[2],R[3]=S[3],R[4]=S[4],R[5]=S[5],R[6]=S[6],R[7]=S[7],R[8]=S[8],R[9]=S[9],R[10]=S[10],R[11]=S[11],R[12]=S[12],R[13]=S[13],R[14]=S[14],R[15]=S[15],R},hn.copy=function(S,R){return S[0]=R[0],S[1]=R[1],S[2]=R[2],S[3]=R[3],S[4]=R[4],S[5]=R[5],S[6]=R[6],S[7]=R[7],S[8]=R[8],S[9]=R[9],S[10]=R[10],S[11]=R[11],S[12]=R[12],S[13]=R[13],S[14]=R[14],S[15]=R[15],S},hn.fromValues=function(S,R,L,A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve){var ye=new a.ARRAY_TYPE(16);return ye[0]=S,ye[1]=R,ye[2]=L,ye[3]=A,ye[4]=P,ye[5]=z,ye[6]=j,ye[7]=$,ye[8]=K,ye[9]=J,ye[10]=Z,ye[11]=ne,ye[12]=oe,ye[13]=le,ye[14]=xe,ye[15]=ve,ye},hn.set=function(S,R,L,A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve,ye){return S[0]=R,S[1]=L,S[2]=A,S[3]=P,S[4]=z,S[5]=j,S[6]=$,S[7]=K,S[8]=J,S[9]=Z,S[10]=ne,S[11]=oe,S[12]=le,S[13]=xe,S[14]=ve,S[15]=ye,S},hn.identity=p,hn.transpose=function(S,R){if(S===R){var L=R[1],A=R[2],P=R[3],z=R[6],j=R[7],$=R[11];S[1]=R[4],S[2]=R[8],S[3]=R[12],S[4]=L,S[6]=R[9],S[7]=R[13],S[8]=A,S[9]=z,S[11]=R[14],S[12]=P,S[13]=j,S[14]=$}else S[0]=R[0],S[1]=R[4],S[2]=R[8],S[3]=R[12],S[4]=R[1],S[5]=R[5],S[6]=R[9],S[7]=R[13],S[8]=R[2],S[9]=R[6],S[10]=R[10],S[11]=R[14],S[12]=R[3],S[13]=R[7],S[14]=R[11],S[15]=R[15];return S},hn.invert=function(S,R){var L=R[0],A=R[1],P=R[2],z=R[3],j=R[4],$=R[5],K=R[6],J=R[7],Z=R[8],ne=R[9],oe=R[10],le=R[11],xe=R[12],ve=R[13],ye=R[14],Fe=R[15],Se=L*$-A*j,Ne=L*K-P*j,Ge=L*J-z*j,He=A*K-P*$,Xe=A*J-z*$,Je=P*J-z*K,rt=Z*ve-ne*xe,Qe=Z*ye-oe*xe,It=Z*Fe-le*xe,jt=ne*ye-oe*ve,Et=ne*Fe-le*ve,gn=oe*Fe-le*ye,dn=Se*gn-Ne*Et+Ge*jt+He*It-Xe*Qe+Je*rt;return dn?(S[0]=($*gn-K*Et+J*jt)*(dn=1/dn),S[1]=(P*Et-A*gn-z*jt)*dn,S[2]=(ve*Je-ye*Xe+Fe*He)*dn,S[3]=(oe*Xe-ne*Je-le*He)*dn,S[4]=(K*It-j*gn-J*Qe)*dn,S[5]=(L*gn-P*It+z*Qe)*dn,S[6]=(ye*Ge-xe*Je-Fe*Ne)*dn,S[7]=(Z*Je-oe*Ge+le*Ne)*dn,S[8]=(j*Et-$*It+J*rt)*dn,S[9]=(A*It-L*Et-z*rt)*dn,S[10]=(xe*Xe-ve*Ge+Fe*Se)*dn,S[11]=(ne*Ge-Z*Xe-le*Se)*dn,S[12]=($*Qe-j*jt-K*rt)*dn,S[13]=(L*jt-A*Qe+P*rt)*dn,S[14]=(ve*Ne-xe*He-ye*Se)*dn,S[15]=(Z*He-ne*Ne+oe*Se)*dn,S):null},hn.adjoint=function(S,R){var L=R[0],A=R[1],P=R[2],z=R[3],j=R[4],$=R[5],K=R[6],J=R[7],Z=R[8],ne=R[9],oe=R[10],le=R[11],xe=R[12],ve=R[13],ye=R[14],Fe=R[15];return S[0]=$*(oe*Fe-le*ye)-ne*(K*Fe-J*ye)+ve*(K*le-J*oe),S[1]=-(A*(oe*Fe-le*ye)-ne*(P*Fe-z*ye)+ve*(P*le-z*oe)),S[2]=A*(K*Fe-J*ye)-$*(P*Fe-z*ye)+ve*(P*J-z*K),S[3]=-(A*(K*le-J*oe)-$*(P*le-z*oe)+ne*(P*J-z*K)),S[4]=-(j*(oe*Fe-le*ye)-Z*(K*Fe-J*ye)+xe*(K*le-J*oe)),S[5]=L*(oe*Fe-le*ye)-Z*(P*Fe-z*ye)+xe*(P*le-z*oe),S[6]=-(L*(K*Fe-J*ye)-j*(P*Fe-z*ye)+xe*(P*J-z*K)),S[7]=L*(K*le-J*oe)-j*(P*le-z*oe)+Z*(P*J-z*K),S[8]=j*(ne*Fe-le*ve)-Z*($*Fe-J*ve)+xe*($*le-J*ne),S[9]=-(L*(ne*Fe-le*ve)-Z*(A*Fe-z*ve)+xe*(A*le-z*ne)),S[10]=L*($*Fe-J*ve)-j*(A*Fe-z*ve)+xe*(A*J-z*$),S[11]=-(L*($*le-J*ne)-j*(A*le-z*ne)+Z*(A*J-z*$)),S[12]=-(j*(ne*ye-oe*ve)-Z*($*ye-K*ve)+xe*($*oe-K*ne)),S[13]=L*(ne*ye-oe*ve)-Z*(A*ye-P*ve)+xe*(A*oe-P*ne),S[14]=-(L*($*ye-K*ve)-j*(A*ye-P*ve)+xe*(A*K-P*$)),S[15]=L*($*oe-K*ne)-j*(A*oe-P*ne)+Z*(A*K-P*$),S},hn.determinant=function(S){var R=S[0],L=S[1],A=S[2],P=S[3],z=S[4],j=S[5],$=S[6],K=S[7],J=S[8],Z=S[9],ne=S[10],oe=S[11],le=S[12],xe=S[13],ve=S[14],ye=S[15];return(R*j-L*z)*(ne*ye-oe*ve)-(R*$-A*z)*(Z*ye-oe*xe)+(R*K-P*z)*(Z*ve-ne*xe)+(L*$-A*j)*(J*ye-oe*le)-(L*K-P*j)*(J*ve-ne*le)+(A*K-P*$)*(J*xe-Z*le)},hn.multiply=g,hn.translate=function(S,R,L){var A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve=L[0],ye=L[1],Fe=L[2];return R===S?(S[12]=R[0]*ve+R[4]*ye+R[8]*Fe+R[12],S[13]=R[1]*ve+R[5]*ye+R[9]*Fe+R[13],S[14]=R[2]*ve+R[6]*ye+R[10]*Fe+R[14],S[15]=R[3]*ve+R[7]*ye+R[11]*Fe+R[15]):(P=R[1],z=R[2],j=R[3],$=R[4],K=R[5],J=R[6],Z=R[7],ne=R[8],oe=R[9],le=R[10],xe=R[11],S[0]=A=R[0],S[1]=P,S[2]=z,S[3]=j,S[4]=$,S[5]=K,S[6]=J,S[7]=Z,S[8]=ne,S[9]=oe,S[10]=le,S[11]=xe,S[12]=A*ve+$*ye+ne*Fe+R[12],S[13]=P*ve+K*ye+oe*Fe+R[13],S[14]=z*ve+J*ye+le*Fe+R[14],S[15]=j*ve+Z*ye+xe*Fe+R[15]),S},hn.scale=function(S,R,L){var A=L[0],P=L[1],z=L[2];return S[0]=R[0]*A,S[1]=R[1]*A,S[2]=R[2]*A,S[3]=R[3]*A,S[4]=R[4]*P,S[5]=R[5]*P,S[6]=R[6]*P,S[7]=R[7]*P,S[8]=R[8]*z,S[9]=R[9]*z,S[10]=R[10]*z,S[11]=R[11]*z,S[12]=R[12],S[13]=R[13],S[14]=R[14],S[15]=R[15],S},hn.rotate=function(S,R,L,A){var P,z,j,$,K,J,Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne,Ge,He,Xe,Je,rt,Qe,It,jt,Et=A[0],gn=A[1],dn=A[2],Qt=Math.hypot(Et,gn,dn);return Qt0?(L[0]=2*($*j+Z*A+K*z-J*P)/ne,L[1]=2*(K*j+Z*P+J*A-$*z)/ne,L[2]=2*(J*j+Z*z+$*P-K*A)/ne):(L[0]=2*($*j+Z*A+K*z-J*P),L[1]=2*(K*j+Z*P+J*A-$*z),L[2]=2*(J*j+Z*z+$*P-K*A)),m(S,R,L),S},hn.getTranslation=function(S,R){return S[0]=R[12],S[1]=R[13],S[2]=R[14],S},hn.getScaling=b,hn.getRotation=function(S,R){var L=new a.ARRAY_TYPE(3);b(L,R);var A=1/L[0],P=1/L[1],z=1/L[2],j=R[0]*A,$=R[1]*P,K=R[2]*z,J=R[4]*A,Z=R[5]*P,ne=R[6]*z,oe=R[8]*A,le=R[9]*P,xe=R[10]*z,ve=j+Z+xe,ye=0;return ve>0?(ye=2*Math.sqrt(ve+1),S[3]=.25*ye,S[0]=(ne-le)/ye,S[1]=(oe-K)/ye,S[2]=($-J)/ye):j>Z&&j>xe?(ye=2*Math.sqrt(1+j-Z-xe),S[3]=(ne-le)/ye,S[0]=.25*ye,S[1]=($+J)/ye,S[2]=(oe+K)/ye):Z>xe?(ye=2*Math.sqrt(1+Z-j-xe),S[3]=(oe-K)/ye,S[0]=($+J)/ye,S[1]=.25*ye,S[2]=(ne+le)/ye):(ye=2*Math.sqrt(1+xe-j-Z),S[3]=($-J)/ye,S[0]=(oe+K)/ye,S[1]=(ne+le)/ye,S[2]=.25*ye),S},hn.fromRotationTranslationScale=function(S,R,L,A){var P=R[0],z=R[1],j=R[2],$=R[3],K=P+P,J=z+z,Z=j+j,ne=P*K,oe=P*J,le=P*Z,xe=z*J,ve=z*Z,ye=j*Z,Fe=$*K,Se=$*J,Ne=$*Z,Ge=A[0],He=A[1],Xe=A[2];return S[0]=(1-(xe+ye))*Ge,S[1]=(oe+Ne)*Ge,S[2]=(le-Se)*Ge,S[3]=0,S[4]=(oe-Ne)*He,S[5]=(1-(ne+ye))*He,S[6]=(ve+Fe)*He,S[7]=0,S[8]=(le+Se)*Xe,S[9]=(ve-Fe)*Xe,S[10]=(1-(ne+xe))*Xe,S[11]=0,S[12]=L[0],S[13]=L[1],S[14]=L[2],S[15]=1,S},hn.fromRotationTranslationScaleOrigin=function(S,R,L,A,P){var z=R[0],j=R[1],$=R[2],K=R[3],J=z+z,Z=j+j,ne=$+$,oe=z*J,le=z*Z,xe=z*ne,ve=j*Z,ye=j*ne,Fe=$*ne,Se=K*J,Ne=K*Z,Ge=K*ne,He=A[0],Xe=A[1],Je=A[2],rt=P[0],Qe=P[1],It=P[2],jt=(1-(ve+Fe))*He,Et=(le+Ge)*He,gn=(xe-Ne)*He,dn=(le-Ge)*Xe,Qt=(1-(oe+Fe))*Xe,Wt=(ye+Se)*Xe,Vn=(xe+Ne)*Je,bn=(ye-Se)*Je,An=(1-(oe+ve))*Je;return S[0]=jt,S[1]=Et,S[2]=gn,S[3]=0,S[4]=dn,S[5]=Qt,S[6]=Wt,S[7]=0,S[8]=Vn,S[9]=bn,S[10]=An,S[11]=0,S[12]=L[0]+rt-(jt*rt+dn*Qe+Vn*It),S[13]=L[1]+Qe-(Et*rt+Qt*Qe+bn*It),S[14]=L[2]+It-(gn*rt+Wt*Qe+An*It),S[15]=1,S},hn.fromQuat=function(S,R){var L=R[0],A=R[1],P=R[2],z=R[3],j=L+L,$=A+A,K=P+P,J=L*j,Z=A*j,ne=A*$,oe=P*j,le=P*$,xe=P*K,ve=z*j,ye=z*$,Fe=z*K;return S[0]=1-ne-xe,S[1]=Z+Fe,S[2]=oe-ye,S[3]=0,S[4]=Z-Fe,S[5]=1-J-xe,S[6]=le+ve,S[7]=0,S[8]=oe+ye,S[9]=le-ve,S[10]=1-J-ne,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S},hn.frustum=function(S,R,L,A,P,z,j){var $=1/(L-R),K=1/(P-A),J=1/(z-j);return S[0]=2*z*$,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=2*z*K,S[6]=0,S[7]=0,S[8]=(L+R)*$,S[9]=(P+A)*K,S[10]=(j+z)*J,S[11]=-1,S[12]=0,S[13]=0,S[14]=j*z*2*J,S[15]=0,S},hn.perspectiveNO=T,hn.perspectiveZO=function(S,R,L,A,P){var z,j=1/Math.tan(R/2);return S[0]=j/L,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=j,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,null!=P&&P!==1/0?(S[10]=P*(z=1/(A-P)),S[14]=P*A*z):(S[10]=-1,S[14]=-A),S},hn.perspectiveFromFieldOfView=function(S,R,L,A){var P=Math.tan(R.upDegrees*Math.PI/180),z=Math.tan(R.downDegrees*Math.PI/180),j=Math.tan(R.leftDegrees*Math.PI/180),$=Math.tan(R.rightDegrees*Math.PI/180),K=2/(j+$),J=2/(P+z);return S[0]=K,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=J,S[6]=0,S[7]=0,S[8]=-(j-$)*K*.5,S[9]=(P-z)*J*.5,S[10]=A/(L-A),S[11]=-1,S[12]=0,S[13]=0,S[14]=A*L/(L-A),S[15]=0,S},hn.orthoNO=k,hn.orthoZO=function(S,R,L,A,P,z,j){var $=1/(R-L),K=1/(A-P),J=1/(z-j);return S[0]=-2*$,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*K,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=J,S[11]=0,S[12]=(R+L)*$,S[13]=(P+A)*K,S[14]=z*J,S[15]=1,S},hn.lookAt=function(S,R,L,A){var P,z,j,$,K,J,Z,ne,oe,le,xe=R[0],ve=R[1],ye=R[2],Fe=A[0],Se=A[1],Ne=A[2],Ge=L[0],He=L[1],Xe=L[2];return Math.abs(xe-Ge)0&&(Z*=le=1/Math.sqrt(le),ne*=le,oe*=le);var xe=K*oe-J*ne,ve=J*Z-$*oe,ye=$*ne-K*Z;return(le=xe*xe+ve*ve+ye*ye)>0&&(xe*=le=1/Math.sqrt(le),ve*=le,ye*=le),S[0]=xe,S[1]=ve,S[2]=ye,S[3]=0,S[4]=ne*ye-oe*ve,S[5]=oe*xe-Z*ye,S[6]=Z*ve-ne*xe,S[7]=0,S[8]=Z,S[9]=ne,S[10]=oe,S[11]=0,S[12]=P,S[13]=z,S[14]=j,S[15]=1,S},hn.str=function(S){return"mat4("+S[0]+", "+S[1]+", "+S[2]+", "+S[3]+", "+S[4]+", "+S[5]+", "+S[6]+", "+S[7]+", "+S[8]+", "+S[9]+", "+S[10]+", "+S[11]+", "+S[12]+", "+S[13]+", "+S[14]+", "+S[15]+")"},hn.frob=function(S){return Math.hypot(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[8],S[9],S[10],S[11],S[12],S[13],S[14],S[15])},hn.add=function(S,R,L){return S[0]=R[0]+L[0],S[1]=R[1]+L[1],S[2]=R[2]+L[2],S[3]=R[3]+L[3],S[4]=R[4]+L[4],S[5]=R[5]+L[5],S[6]=R[6]+L[6],S[7]=R[7]+L[7],S[8]=R[8]+L[8],S[9]=R[9]+L[9],S[10]=R[10]+L[10],S[11]=R[11]+L[11],S[12]=R[12]+L[12],S[13]=R[13]+L[13],S[14]=R[14]+L[14],S[15]=R[15]+L[15],S},hn.subtract=F,hn.multiplyScalar=function(S,R,L){return S[0]=R[0]*L,S[1]=R[1]*L,S[2]=R[2]*L,S[3]=R[3]*L,S[4]=R[4]*L,S[5]=R[5]*L,S[6]=R[6]*L,S[7]=R[7]*L,S[8]=R[8]*L,S[9]=R[9]*L,S[10]=R[10]*L,S[11]=R[11]*L,S[12]=R[12]*L,S[13]=R[13]*L,S[14]=R[14]*L,S[15]=R[15]*L,S},hn.multiplyScalarAndAdd=function(S,R,L,A){return S[0]=R[0]+L[0]*A,S[1]=R[1]+L[1]*A,S[2]=R[2]+L[2]*A,S[3]=R[3]+L[3]*A,S[4]=R[4]+L[4]*A,S[5]=R[5]+L[5]*A,S[6]=R[6]+L[6]*A,S[7]=R[7]+L[7]*A,S[8]=R[8]+L[8]*A,S[9]=R[9]+L[9]*A,S[10]=R[10]+L[10]*A,S[11]=R[11]+L[11]*A,S[12]=R[12]+L[12]*A,S[13]=R[13]+L[13]*A,S[14]=R[14]+L[14]*A,S[15]=R[15]+L[15]*A,S},hn.exactEquals=function(S,R){return S[0]===R[0]&&S[1]===R[1]&&S[2]===R[2]&&S[3]===R[3]&&S[4]===R[4]&&S[5]===R[5]&&S[6]===R[6]&&S[7]===R[7]&&S[8]===R[8]&&S[9]===R[9]&&S[10]===R[10]&&S[11]===R[11]&&S[12]===R[12]&&S[13]===R[13]&&S[14]===R[14]&&S[15]===R[15]},hn.equals=function(S,R){var L=S[0],A=S[1],P=S[2],z=S[3],j=S[4],$=S[5],K=S[6],J=S[7],Z=S[8],ne=S[9],oe=S[10],le=S[11],xe=S[12],ve=S[13],ye=S[14],Fe=S[15],Se=R[0],Ne=R[1],Ge=R[2],He=R[3],Xe=R[4],Je=R[5],rt=R[6],Qe=R[7],It=R[8],jt=R[9],Et=R[10],gn=R[11],dn=R[12],Qt=R[13],Wt=R[14],Vn=R[15];return Math.abs(L-Se)<=a.EPSILON*Math.max(1,Math.abs(L),Math.abs(Se))&&Math.abs(A-Ne)<=a.EPSILON*Math.max(1,Math.abs(A),Math.abs(Ne))&&Math.abs(P-Ge)<=a.EPSILON*Math.max(1,Math.abs(P),Math.abs(Ge))&&Math.abs(z-He)<=a.EPSILON*Math.max(1,Math.abs(z),Math.abs(He))&&Math.abs(j-Xe)<=a.EPSILON*Math.max(1,Math.abs(j),Math.abs(Xe))&&Math.abs($-Je)<=a.EPSILON*Math.max(1,Math.abs($),Math.abs(Je))&&Math.abs(K-rt)<=a.EPSILON*Math.max(1,Math.abs(K),Math.abs(rt))&&Math.abs(J-Qe)<=a.EPSILON*Math.max(1,Math.abs(J),Math.abs(Qe))&&Math.abs(Z-It)<=a.EPSILON*Math.max(1,Math.abs(Z),Math.abs(It))&&Math.abs(ne-jt)<=a.EPSILON*Math.max(1,Math.abs(ne),Math.abs(jt))&&Math.abs(oe-Et)<=a.EPSILON*Math.max(1,Math.abs(oe),Math.abs(Et))&&Math.abs(le-gn)<=a.EPSILON*Math.max(1,Math.abs(le),Math.abs(gn))&&Math.abs(xe-dn)<=a.EPSILON*Math.max(1,Math.abs(xe),Math.abs(dn))&&Math.abs(ve-Qt)<=a.EPSILON*Math.max(1,Math.abs(ve),Math.abs(Qt))&&Math.abs(ye-Wt)<=a.EPSILON*Math.max(1,Math.abs(ye),Math.abs(Wt))&&Math.abs(Fe-Vn)<=a.EPSILON*Math.max(1,Math.abs(Fe),Math.abs(Vn))},hn.sub=hn.mul=hn.ortho=hn.perspective=void 0;var a=function(S){if(S&&S.__esModule)return S;if(null===S||"object"!==d(S)&&"function"!=typeof S)return{default:S};var L=l(void 0);if(L&&L.has(S))return L.get(S);var A={},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in S)if("default"!==z&&Object.prototype.hasOwnProperty.call(S,z)){var j=P?Object.getOwnPropertyDescriptor(S,z):null;j&&(j.get||j.set)?Object.defineProperty(A,z,j):A[z]=S[z]}return A.default=S,L&&L.set(S,A),A}(kn());function l(S){if("function"!=typeof WeakMap)return null;var R=new WeakMap,L=new WeakMap;return(l=function(A){return A?L:R})(S)}function p(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function g(S,R,L){var A=R[0],P=R[1],z=R[2],j=R[3],$=R[4],K=R[5],J=R[6],Z=R[7],ne=R[8],oe=R[9],le=R[10],xe=R[11],ve=R[12],ye=R[13],Fe=R[14],Se=R[15],Ne=L[0],Ge=L[1],He=L[2],Xe=L[3];return S[0]=Ne*A+Ge*$+He*ne+Xe*ve,S[1]=Ne*P+Ge*K+He*oe+Xe*ye,S[2]=Ne*z+Ge*J+He*le+Xe*Fe,S[3]=Ne*j+Ge*Z+He*xe+Xe*Se,S[4]=(Ne=L[4])*A+(Ge=L[5])*$+(He=L[6])*ne+(Xe=L[7])*ve,S[5]=Ne*P+Ge*K+He*oe+Xe*ye,S[6]=Ne*z+Ge*J+He*le+Xe*Fe,S[7]=Ne*j+Ge*Z+He*xe+Xe*Se,S[8]=(Ne=L[8])*A+(Ge=L[9])*$+(He=L[10])*ne+(Xe=L[11])*ve,S[9]=Ne*P+Ge*K+He*oe+Xe*ye,S[10]=Ne*z+Ge*J+He*le+Xe*Fe,S[11]=Ne*j+Ge*Z+He*xe+Xe*Se,S[12]=(Ne=L[12])*A+(Ge=L[13])*$+(He=L[14])*ne+(Xe=L[15])*ve,S[13]=Ne*P+Ge*K+He*oe+Xe*ye,S[14]=Ne*z+Ge*J+He*le+Xe*Fe,S[15]=Ne*j+Ge*Z+He*xe+Xe*Se,S}function m(S,R,L){var A=R[0],P=R[1],z=R[2],j=R[3],$=A+A,K=P+P,J=z+z,Z=A*$,ne=A*K,oe=A*J,le=P*K,xe=P*J,ve=z*J,ye=j*$,Fe=j*K,Se=j*J;return S[0]=1-(le+ve),S[1]=ne+Se,S[2]=oe-Fe,S[3]=0,S[4]=ne-Se,S[5]=1-(Z+ve),S[6]=xe+ye,S[7]=0,S[8]=oe+Fe,S[9]=xe-ye,S[10]=1-(Z+le),S[11]=0,S[12]=L[0],S[13]=L[1],S[14]=L[2],S[15]=1,S}function b(S,R){var L=R[4],A=R[5],P=R[6],z=R[8],j=R[9],$=R[10];return S[0]=Math.hypot(R[0],R[1],R[2]),S[1]=Math.hypot(L,A,P),S[2]=Math.hypot(z,j,$),S}function T(S,R,L,A,P){var z,j=1/Math.tan(R/2);return S[0]=j/L,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=j,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,null!=P&&P!==1/0?(S[10]=(P+A)*(z=1/(A-P)),S[14]=2*P*A*z):(S[10]=-1,S[14]=-2*A),S}function k(S,R,L,A,P,z,j){var $=1/(R-L),K=1/(A-P),J=1/(z-j);return S[0]=-2*$,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*K,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*J,S[11]=0,S[12]=(R+L)*$,S[13]=(P+A)*K,S[14]=(j+z)*J,S[15]=1,S}function F(S,R,L){return S[0]=R[0]-L[0],S[1]=R[1]-L[1],S[2]=R[2]-L[2],S[3]=R[3]-L[3],S[4]=R[4]-L[4],S[5]=R[5]-L[5],S[6]=R[6]-L[6],S[7]=R[7]-L[7],S[8]=R[8]-L[8],S[9]=R[9]-L[9],S[10]=R[10]-L[10],S[11]=R[11]-L[11],S[12]=R[12]-L[12],S[13]=R[13]-L[13],S[14]=R[14]-L[14],S[15]=R[15]-L[15],S}return hn.perspective=T,hn.ortho=k,hn.mul=g,hn.sub=F,hn}var $o,sn={},wn={};function Ti(){if($o)return wn;function d(P){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(z){return typeof z}:function(z){return z&&"function"==typeof Symbol&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z})(P)}$o=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.create=p,wn.clone=function(P){var z=new a.ARRAY_TYPE(3);return z[0]=P[0],z[1]=P[1],z[2]=P[2],z},wn.length=g,wn.fromValues=function(P,z,j){var $=new a.ARRAY_TYPE(3);return $[0]=P,$[1]=z,$[2]=j,$},wn.copy=function(P,z){return P[0]=z[0],P[1]=z[1],P[2]=z[2],P},wn.set=function(P,z,j,$){return P[0]=z,P[1]=j,P[2]=$,P},wn.add=function(P,z,j){return P[0]=z[0]+j[0],P[1]=z[1]+j[1],P[2]=z[2]+j[2],P},wn.subtract=m,wn.multiply=b,wn.divide=T,wn.ceil=function(P,z){return P[0]=Math.ceil(z[0]),P[1]=Math.ceil(z[1]),P[2]=Math.ceil(z[2]),P},wn.floor=function(P,z){return P[0]=Math.floor(z[0]),P[1]=Math.floor(z[1]),P[2]=Math.floor(z[2]),P},wn.min=function(P,z,j){return P[0]=Math.min(z[0],j[0]),P[1]=Math.min(z[1],j[1]),P[2]=Math.min(z[2],j[2]),P},wn.max=function(P,z,j){return P[0]=Math.max(z[0],j[0]),P[1]=Math.max(z[1],j[1]),P[2]=Math.max(z[2],j[2]),P},wn.round=function(P,z){return P[0]=Math.round(z[0]),P[1]=Math.round(z[1]),P[2]=Math.round(z[2]),P},wn.scale=function(P,z,j){return P[0]=z[0]*j,P[1]=z[1]*j,P[2]=z[2]*j,P},wn.scaleAndAdd=function(P,z,j,$){return P[0]=z[0]+j[0]*$,P[1]=z[1]+j[1]*$,P[2]=z[2]+j[2]*$,P},wn.distance=k,wn.squaredDistance=F,wn.squaredLength=S,wn.negate=function(P,z){return P[0]=-z[0],P[1]=-z[1],P[2]=-z[2],P},wn.inverse=function(P,z){return P[0]=1/z[0],P[1]=1/z[1],P[2]=1/z[2],P},wn.normalize=function(P,z){var j=z[0],$=z[1],K=z[2],J=j*j+$*$+K*K;return J>0&&(J=1/Math.sqrt(J)),P[0]=z[0]*J,P[1]=z[1]*J,P[2]=z[2]*J,P},wn.dot=R,wn.cross=function(P,z,j){var $=z[0],K=z[1],J=z[2],Z=j[0],ne=j[1],oe=j[2];return P[0]=K*oe-J*ne,P[1]=J*Z-$*oe,P[2]=$*ne-K*Z,P},wn.lerp=function(P,z,j,$){var K=z[0],J=z[1],Z=z[2];return P[0]=K+$*(j[0]-K),P[1]=J+$*(j[1]-J),P[2]=Z+$*(j[2]-Z),P},wn.hermite=function(P,z,j,$,K,J){var Z=J*J,ne=Z*(2*J-3)+1,oe=Z*(J-2)+J,le=Z*(J-1),xe=Z*(3-2*J);return P[0]=z[0]*ne+j[0]*oe+$[0]*le+K[0]*xe,P[1]=z[1]*ne+j[1]*oe+$[1]*le+K[1]*xe,P[2]=z[2]*ne+j[2]*oe+$[2]*le+K[2]*xe,P},wn.bezier=function(P,z,j,$,K,J){var Z=1-J,ne=Z*Z,oe=J*J,le=ne*Z,xe=3*J*ne,ve=3*oe*Z,ye=oe*J;return P[0]=z[0]*le+j[0]*xe+$[0]*ve+K[0]*ye,P[1]=z[1]*le+j[1]*xe+$[1]*ve+K[1]*ye,P[2]=z[2]*le+j[2]*xe+$[2]*ve+K[2]*ye,P},wn.random=function(P,z){z=z||1;var j=2*a.RANDOM()*Math.PI,$=2*a.RANDOM()-1,K=Math.sqrt(1-$*$)*z;return P[0]=Math.cos(j)*K,P[1]=Math.sin(j)*K,P[2]=$*z,P},wn.transformMat4=function(P,z,j){var $=z[0],K=z[1],J=z[2],Z=j[3]*$+j[7]*K+j[11]*J+j[15];return P[0]=(j[0]*$+j[4]*K+j[8]*J+j[12])/(Z=Z||1),P[1]=(j[1]*$+j[5]*K+j[9]*J+j[13])/Z,P[2]=(j[2]*$+j[6]*K+j[10]*J+j[14])/Z,P},wn.transformMat3=function(P,z,j){var $=z[0],K=z[1],J=z[2];return P[0]=$*j[0]+K*j[3]+J*j[6],P[1]=$*j[1]+K*j[4]+J*j[7],P[2]=$*j[2]+K*j[5]+J*j[8],P},wn.transformQuat=function(P,z,j){var $=j[0],K=j[1],J=j[2],Z=z[0],ne=z[1],oe=z[2],le=K*oe-J*ne,xe=J*Z-$*oe,ve=$*ne-K*Z,ye=K*ve-J*xe,Fe=J*le-$*ve,Se=$*xe-K*le,Ne=2*j[3];return xe*=Ne,ve*=Ne,Fe*=2,Se*=2,P[0]=Z+(le*=Ne)+(ye*=2),P[1]=ne+xe+Fe,P[2]=oe+ve+Se,P},wn.rotateX=function(P,z,j,$){var K=[],J=[];return K[0]=z[0]-j[0],K[1]=z[1]-j[1],K[2]=z[2]-j[2],J[0]=K[0],J[1]=K[1]*Math.cos($)-K[2]*Math.sin($),J[2]=K[1]*Math.sin($)+K[2]*Math.cos($),P[0]=J[0]+j[0],P[1]=J[1]+j[1],P[2]=J[2]+j[2],P},wn.rotateY=function(P,z,j,$){var K=[],J=[];return K[0]=z[0]-j[0],K[1]=z[1]-j[1],K[2]=z[2]-j[2],J[0]=K[2]*Math.sin($)+K[0]*Math.cos($),J[1]=K[1],J[2]=K[2]*Math.cos($)-K[0]*Math.sin($),P[0]=J[0]+j[0],P[1]=J[1]+j[1],P[2]=J[2]+j[2],P},wn.rotateZ=function(P,z,j,$){var K=[],J=[];return K[0]=z[0]-j[0],K[1]=z[1]-j[1],K[2]=z[2]-j[2],J[0]=K[0]*Math.cos($)-K[1]*Math.sin($),J[1]=K[0]*Math.sin($)+K[1]*Math.cos($),J[2]=K[2],P[0]=J[0]+j[0],P[1]=J[1]+j[1],P[2]=J[2]+j[2],P},wn.angle=function(P,z){var j=P[0],$=P[1],K=P[2],J=z[0],Z=z[1],ne=z[2],oe=Math.sqrt(j*j+$*$+K*K)*Math.sqrt(J*J+Z*Z+ne*ne),le=oe&&R(P,z)/oe;return Math.acos(Math.min(Math.max(le,-1),1))},wn.zero=function(P){return P[0]=0,P[1]=0,P[2]=0,P},wn.str=function(P){return"vec3("+P[0]+", "+P[1]+", "+P[2]+")"},wn.exactEquals=function(P,z){return P[0]===z[0]&&P[1]===z[1]&&P[2]===z[2]},wn.equals=function(P,z){var j=P[0],$=P[1],K=P[2],J=z[0],Z=z[1],ne=z[2];return Math.abs(j-J)<=a.EPSILON*Math.max(1,Math.abs(j),Math.abs(J))&&Math.abs($-Z)<=a.EPSILON*Math.max(1,Math.abs($),Math.abs(Z))&&Math.abs(K-ne)<=a.EPSILON*Math.max(1,Math.abs(K),Math.abs(ne))},wn.forEach=wn.sqrLen=wn.len=wn.sqrDist=wn.dist=wn.div=wn.mul=wn.sub=void 0;var a=function(P){if(P&&P.__esModule)return P;if(null===P||"object"!==d(P)&&"function"!=typeof P)return{default:P};var j=l(void 0);if(j&&j.has(P))return j.get(P);var $={},K=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in P)if("default"!==J&&Object.prototype.hasOwnProperty.call(P,J)){var Z=K?Object.getOwnPropertyDescriptor(P,J):null;Z&&(Z.get||Z.set)?Object.defineProperty($,J,Z):$[J]=P[J]}return $.default=P,j&&j.set(P,$),$}(kn());function l(P){if("function"!=typeof WeakMap)return null;var z=new WeakMap,j=new WeakMap;return(l=function($){return $?j:z})(P)}function p(){var P=new a.ARRAY_TYPE(3);return a.ARRAY_TYPE!=Float32Array&&(P[0]=0,P[1]=0,P[2]=0),P}function g(P){return Math.hypot(P[0],P[1],P[2])}function m(P,z,j){return P[0]=z[0]-j[0],P[1]=z[1]-j[1],P[2]=z[2]-j[2],P}function b(P,z,j){return P[0]=z[0]*j[0],P[1]=z[1]*j[1],P[2]=z[2]*j[2],P}function T(P,z,j){return P[0]=z[0]/j[0],P[1]=z[1]/j[1],P[2]=z[2]/j[2],P}function k(P,z){return Math.hypot(z[0]-P[0],z[1]-P[1],z[2]-P[2])}function F(P,z){var j=z[0]-P[0],$=z[1]-P[1],K=z[2]-P[2];return j*j+$*$+K*K}function S(P){var z=P[0],j=P[1],$=P[2];return z*z+j*j+$*$}function R(P,z){return P[0]*z[0]+P[1]*z[1]+P[2]*z[2]}wn.sub=m,wn.mul=b,wn.div=T,wn.dist=k,wn.sqrDist=F,wn.len=g,wn.sqrLen=S;var L,A=(L=p(),function(P,z,j,$,K,J){var Z,ne;for(z||(z=3),j||(j=0),ne=$?Math.min($*z+j,P.length):P.length,Z=j;Z0&&(J=1/Math.sqrt(J)),A[0]=z*J,A[1]=j*J,A[2]=$*J,A[3]=K*J,A},Cn.dot=function(A,P){return A[0]*P[0]+A[1]*P[1]+A[2]*P[2]+A[3]*P[3]},Cn.cross=function(A,P,z,j){var $=z[0]*j[1]-z[1]*j[0],K=z[0]*j[2]-z[2]*j[0],J=z[0]*j[3]-z[3]*j[0],Z=z[1]*j[2]-z[2]*j[1],ne=z[1]*j[3]-z[3]*j[1],oe=z[2]*j[3]-z[3]*j[2],le=P[0],xe=P[1],ve=P[2],ye=P[3];return A[0]=xe*oe-ve*ne+ye*Z,A[1]=-le*oe+ve*J-ye*K,A[2]=le*ne-xe*J+ye*$,A[3]=-le*Z+xe*K-ve*$,A},Cn.lerp=function(A,P,z,j){var $=P[0],K=P[1],J=P[2],Z=P[3];return A[0]=$+j*(z[0]-$),A[1]=K+j*(z[1]-K),A[2]=J+j*(z[2]-J),A[3]=Z+j*(z[3]-Z),A},Cn.random=function(A,P){var z,j,$,K,J,Z;P=P||1;do{J=(z=2*a.RANDOM()-1)*z+(j=2*a.RANDOM()-1)*j}while(J>=1);do{Z=($=2*a.RANDOM()-1)*$+(K=2*a.RANDOM()-1)*K}while(Z>=1);var ne=Math.sqrt((1-J)/Z);return A[0]=P*z,A[1]=P*j,A[2]=P*$*ne,A[3]=P*K*ne,A},Cn.transformMat4=function(A,P,z){var j=P[0],$=P[1],K=P[2],J=P[3];return A[0]=z[0]*j+z[4]*$+z[8]*K+z[12]*J,A[1]=z[1]*j+z[5]*$+z[9]*K+z[13]*J,A[2]=z[2]*j+z[6]*$+z[10]*K+z[14]*J,A[3]=z[3]*j+z[7]*$+z[11]*K+z[15]*J,A},Cn.transformQuat=function(A,P,z){var j=P[0],$=P[1],K=P[2],J=z[0],Z=z[1],ne=z[2],oe=z[3],le=oe*j+Z*K-ne*$,xe=oe*$+ne*j-J*K,ve=oe*K+J*$-Z*j,ye=-J*j-Z*$-ne*K;return A[0]=le*oe+ye*-J+xe*-ne-ve*-Z,A[1]=xe*oe+ye*-Z+ve*-J-le*-ne,A[2]=ve*oe+ye*-ne+le*-Z-xe*-J,A[3]=P[3],A},Cn.zero=function(A){return A[0]=0,A[1]=0,A[2]=0,A[3]=0,A},Cn.str=function(A){return"vec4("+A[0]+", "+A[1]+", "+A[2]+", "+A[3]+")"},Cn.exactEquals=function(A,P){return A[0]===P[0]&&A[1]===P[1]&&A[2]===P[2]&&A[3]===P[3]},Cn.equals=function(A,P){var z=A[0],j=A[1],$=A[2],K=A[3],J=P[0],Z=P[1],ne=P[2],oe=P[3];return Math.abs(z-J)<=a.EPSILON*Math.max(1,Math.abs(z),Math.abs(J))&&Math.abs(j-Z)<=a.EPSILON*Math.max(1,Math.abs(j),Math.abs(Z))&&Math.abs($-ne)<=a.EPSILON*Math.max(1,Math.abs($),Math.abs(ne))&&Math.abs(K-oe)<=a.EPSILON*Math.max(1,Math.abs(K),Math.abs(oe))},Cn.forEach=Cn.sqrLen=Cn.len=Cn.sqrDist=Cn.dist=Cn.div=Cn.mul=Cn.sub=void 0;var a=function(A){if(A&&A.__esModule)return A;if(null===A||"object"!==d(A)&&"function"!=typeof A)return{default:A};var z=l(void 0);if(z&&z.has(A))return z.get(A);var j={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in A)if("default"!==K&&Object.prototype.hasOwnProperty.call(A,K)){var J=$?Object.getOwnPropertyDescriptor(A,K):null;J&&(J.get||J.set)?Object.defineProperty(j,K,J):j[K]=A[K]}return j.default=A,z&&z.set(A,j),j}(kn());function l(A){if("function"!=typeof WeakMap)return null;var P=new WeakMap,z=new WeakMap;return(l=function(j){return j?z:P})(A)}function p(){var A=new a.ARRAY_TYPE(4);return a.ARRAY_TYPE!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0,A[3]=0),A}function g(A,P,z){return A[0]=P[0]-z[0],A[1]=P[1]-z[1],A[2]=P[2]-z[2],A[3]=P[3]-z[3],A}function m(A,P,z){return A[0]=P[0]*z[0],A[1]=P[1]*z[1],A[2]=P[2]*z[2],A[3]=P[3]*z[3],A}function b(A,P,z){return A[0]=P[0]/z[0],A[1]=P[1]/z[1],A[2]=P[2]/z[2],A[3]=P[3]/z[3],A}function T(A,P){return Math.hypot(P[0]-A[0],P[1]-A[1],P[2]-A[2],P[3]-A[3])}function k(A,P){var z=P[0]-A[0],j=P[1]-A[1],$=P[2]-A[2],K=P[3]-A[3];return z*z+j*j+$*$+K*K}function F(A){return Math.hypot(A[0],A[1],A[2],A[3])}function S(A){var P=A[0],z=A[1],j=A[2],$=A[3];return P*P+z*z+j*j+$*$}Cn.sub=g,Cn.mul=m,Cn.div=b,Cn.dist=T,Cn.sqrDist=k,Cn.len=F,Cn.sqrLen=S;var R,L=(R=p(),function(A,P,z,j,$,K){var J,Z;for(P||(P=4),z||(z=0),Z=j?Math.min(j*P+z,A.length):A.length,J=z;Ja.EPSILON?(Se[0]=Ne[0]/He,Se[1]=Ne[1]/He,Se[2]=Ne[2]/He):(Se[0]=1,Se[1]=0,Se[2]=0),Ge},sn.getAngle=function(Se,Ne){var Ge=z(Se,Ne);return Math.acos(2*Ge*Ge-1)},sn.multiply=F,sn.rotateX=function(Se,Ne,Ge){Ge*=.5;var He=Ne[0],Xe=Ne[1],Je=Ne[2],rt=Ne[3],Qe=Math.sin(Ge),It=Math.cos(Ge);return Se[0]=He*It+rt*Qe,Se[1]=Xe*It+Je*Qe,Se[2]=Je*It-Xe*Qe,Se[3]=rt*It-He*Qe,Se},sn.rotateY=function(Se,Ne,Ge){Ge*=.5;var He=Ne[0],Xe=Ne[1],Je=Ne[2],rt=Ne[3],Qe=Math.sin(Ge),It=Math.cos(Ge);return Se[0]=He*It-Je*Qe,Se[1]=Xe*It+rt*Qe,Se[2]=Je*It+He*Qe,Se[3]=rt*It-Xe*Qe,Se},sn.rotateZ=function(Se,Ne,Ge){Ge*=.5;var He=Ne[0],Xe=Ne[1],Je=Ne[2],rt=Ne[3],Qe=Math.sin(Ge),It=Math.cos(Ge);return Se[0]=He*It+Xe*Qe,Se[1]=Xe*It-He*Qe,Se[2]=Je*It+rt*Qe,Se[3]=rt*It-Je*Qe,Se},sn.calculateW=function(Se,Ne){var Ge=Ne[0],He=Ne[1],Xe=Ne[2];return Se[0]=Ge,Se[1]=He,Se[2]=Xe,Se[3]=Math.sqrt(Math.abs(1-Ge*Ge-He*He-Xe*Xe)),Se},sn.exp=S,sn.ln=R,sn.pow=function(Se,Ne,Ge){return R(Se,Ne),P(Se,Se,Ge),S(Se,Se),Se},sn.slerp=L,sn.random=function(Se){var Ne=a.RANDOM(),Ge=a.RANDOM(),He=a.RANDOM(),Xe=Math.sqrt(1-Ne),Je=Math.sqrt(Ne);return Se[0]=Xe*Math.sin(2*Math.PI*Ge),Se[1]=Xe*Math.cos(2*Math.PI*Ge),Se[2]=Je*Math.sin(2*Math.PI*He),Se[3]=Je*Math.cos(2*Math.PI*He),Se},sn.invert=function(Se,Ne){var Ge=Ne[0],He=Ne[1],Xe=Ne[2],Je=Ne[3],rt=Ge*Ge+He*He+Xe*Xe+Je*Je,Qe=rt?1/rt:0;return Se[0]=-Ge*Qe,Se[1]=-He*Qe,Se[2]=-Xe*Qe,Se[3]=Je*Qe,Se},sn.conjugate=function(Se,Ne){return Se[0]=-Ne[0],Se[1]=-Ne[1],Se[2]=-Ne[2],Se[3]=Ne[3],Se},sn.fromMat3=A,sn.fromEuler=function(Se,Ne,Ge,He){var Xe=.5*Math.PI/180;Ne*=Xe,Ge*=Xe,He*=Xe;var Je=Math.sin(Ne),rt=Math.cos(Ne),Qe=Math.sin(Ge),It=Math.cos(Ge),jt=Math.sin(He),Et=Math.cos(He);return Se[0]=Je*It*Et-rt*Qe*jt,Se[1]=rt*Qe*Et+Je*It*jt,Se[2]=rt*It*jt-Je*Qe*Et,Se[3]=rt*It*Et+Je*Qe*jt,Se},sn.str=function(Se){return"quat("+Se[0]+", "+Se[1]+", "+Se[2]+", "+Se[3]+")"},sn.setAxes=sn.sqlerp=sn.rotationTo=sn.equals=sn.exactEquals=sn.normalize=sn.sqrLen=sn.squaredLength=sn.len=sn.length=sn.lerp=sn.dot=sn.scale=sn.mul=sn.add=sn.set=sn.copy=sn.fromValues=sn.clone=void 0;var a=b(kn()),l=b(yi()),p=b(Ti()),g=b(ci());function m(Se){if("function"!=typeof WeakMap)return null;var Ne=new WeakMap,Ge=new WeakMap;return(m=function(He){return He?Ge:Ne})(Se)}function b(Se,Ne){if(Se&&Se.__esModule)return Se;if(null===Se||"object"!==d(Se)&&"function"!=typeof Se)return{default:Se};var Ge=m(Ne);if(Ge&&Ge.has(Se))return Ge.get(Se);var He={},Xe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Je in Se)if("default"!==Je&&Object.prototype.hasOwnProperty.call(Se,Je)){var rt=Xe?Object.getOwnPropertyDescriptor(Se,Je):null;rt&&(rt.get||rt.set)?Object.defineProperty(He,Je,rt):He[Je]=Se[Je]}return He.default=Se,Ge&&Ge.set(Se,He),He}function T(){var Se=new a.ARRAY_TYPE(4);return a.ARRAY_TYPE!=Float32Array&&(Se[0]=0,Se[1]=0,Se[2]=0),Se[3]=1,Se}function k(Se,Ne,Ge){Ge*=.5;var He=Math.sin(Ge);return Se[0]=He*Ne[0],Se[1]=He*Ne[1],Se[2]=He*Ne[2],Se[3]=Math.cos(Ge),Se}function F(Se,Ne,Ge){var He=Ne[0],Xe=Ne[1],Je=Ne[2],rt=Ne[3],Qe=Ge[0],It=Ge[1],jt=Ge[2],Et=Ge[3];return Se[0]=He*Et+rt*Qe+Xe*jt-Je*It,Se[1]=Xe*Et+rt*It+Je*Qe-He*jt,Se[2]=Je*Et+rt*jt+He*It-Xe*Qe,Se[3]=rt*Et-He*Qe-Xe*It-Je*jt,Se}function S(Se,Ne){var Ge=Ne[0],He=Ne[1],Xe=Ne[2],Je=Ne[3],rt=Math.sqrt(Ge*Ge+He*He+Xe*Xe),Qe=Math.exp(Je),It=rt>0?Qe*Math.sin(rt)/rt:0;return Se[0]=Ge*It,Se[1]=He*It,Se[2]=Xe*It,Se[3]=Qe*Math.cos(rt),Se}function R(Se,Ne){var Ge=Ne[0],He=Ne[1],Xe=Ne[2],Je=Ne[3],rt=Math.sqrt(Ge*Ge+He*He+Xe*Xe),Qe=rt>0?Math.atan2(rt,Je)/rt:0;return Se[0]=Ge*Qe,Se[1]=He*Qe,Se[2]=Xe*Qe,Se[3]=.5*Math.log(Ge*Ge+He*He+Xe*Xe+Je*Je),Se}function L(Se,Ne,Ge,He){var Xe,Je,rt,Qe,It,jt=Ne[0],Et=Ne[1],gn=Ne[2],dn=Ne[3],Qt=Ge[0],Wt=Ge[1],Vn=Ge[2],bn=Ge[3];return(Je=jt*Qt+Et*Wt+gn*Vn+dn*bn)<0&&(Je=-Je,Qt=-Qt,Wt=-Wt,Vn=-Vn,bn=-bn),1-Je>a.EPSILON?(Xe=Math.acos(Je),rt=Math.sin(Xe),Qe=Math.sin((1-He)*Xe)/rt,It=Math.sin(He*Xe)/rt):(Qe=1-He,It=He),Se[0]=Qe*jt+It*Qt,Se[1]=Qe*Et+It*Wt,Se[2]=Qe*gn+It*Vn,Se[3]=Qe*dn+It*bn,Se}function A(Se,Ne){var Ge,He=Ne[0]+Ne[4]+Ne[8];if(He>0)Ge=Math.sqrt(He+1),Se[3]=.5*Ge,Se[0]=(Ne[5]-Ne[7])*(Ge=.5/Ge),Se[1]=(Ne[6]-Ne[2])*Ge,Se[2]=(Ne[1]-Ne[3])*Ge;else{var Xe=0;Ne[4]>Ne[0]&&(Xe=1),Ne[8]>Ne[3*Xe+Xe]&&(Xe=2);var Je=(Xe+1)%3,rt=(Xe+2)%3;Ge=Math.sqrt(Ne[3*Xe+Xe]-Ne[3*Je+Je]-Ne[3*rt+rt]+1),Se[Xe]=.5*Ge,Se[3]=(Ne[3*Je+rt]-Ne[3*rt+Je])*(Ge=.5/Ge),Se[Je]=(Ne[3*Je+Xe]+Ne[3*Xe+Je])*Ge,Se[rt]=(Ne[3*rt+Xe]+Ne[3*Xe+rt])*Ge}return Se}sn.clone=g.clone,sn.fromValues=g.fromValues,sn.copy=g.copy,sn.set=g.set,sn.add=g.add,sn.mul=F;var P=g.scale;sn.scale=P;var z=g.dot;sn.dot=z,sn.lerp=g.lerp;var j=g.length;sn.length=j,sn.len=j;var $=g.squaredLength;sn.squaredLength=$,sn.sqrLen=$;var K=g.normalize;sn.normalize=K,sn.exactEquals=g.exactEquals,sn.equals=g.equals;var J,Z,ne,oe=(J=p.create(),Z=p.fromValues(1,0,0),ne=p.fromValues(0,1,0),function(Se,Ne,Ge){var He=p.dot(Ne,Ge);return He<-.999999?(p.cross(J,Z,Ne),p.len(J)<1e-6&&p.cross(J,ne,Ne),p.normalize(J,J),k(Se,J,Math.PI),Se):He>.999999?(Se[0]=0,Se[1]=0,Se[2]=0,Se[3]=1,Se):(p.cross(J,Ne,Ge),Se[0]=J[0],Se[1]=J[1],Se[2]=J[2],Se[3]=1+He,K(Se,Se))});sn.rotationTo=oe;var le,xe,ve=(le=T(),xe=T(),function(Se,Ne,Ge,He,Xe,Je){return L(le,Ne,Xe,Je),L(xe,Ge,He,Je),L(Se,le,xe,2*Je*(1-Je)),Se});sn.sqlerp=ve;var ye,Fe=(ye=l.create(),function(Se,Ne,Ge,He){return ye[0]=Ge[0],ye[3]=Ge[1],ye[6]=Ge[2],ye[1]=He[0],ye[4]=He[1],ye[7]=He[2],ye[2]=-Ne[0],ye[5]=-Ne[1],ye[8]=-Ne[2],K(Se,A(Se,ye))});return sn.setAxes=Fe,sn}var Ri,mi={};var pc,Vl,wi={};function Oc(){if(pc)return wi;function d(A){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(P){return typeof P}:function(P){return P&&"function"==typeof Symbol&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P})(A)}pc=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.create=p,wi.clone=function(A){var P=new a.ARRAY_TYPE(2);return P[0]=A[0],P[1]=A[1],P},wi.fromValues=function(A,P){var z=new a.ARRAY_TYPE(2);return z[0]=A,z[1]=P,z},wi.copy=function(A,P){return A[0]=P[0],A[1]=P[1],A},wi.set=function(A,P,z){return A[0]=P,A[1]=z,A},wi.add=function(A,P,z){return A[0]=P[0]+z[0],A[1]=P[1]+z[1],A},wi.subtract=g,wi.multiply=m,wi.divide=b,wi.ceil=function(A,P){return A[0]=Math.ceil(P[0]),A[1]=Math.ceil(P[1]),A},wi.floor=function(A,P){return A[0]=Math.floor(P[0]),A[1]=Math.floor(P[1]),A},wi.min=function(A,P,z){return A[0]=Math.min(P[0],z[0]),A[1]=Math.min(P[1],z[1]),A},wi.max=function(A,P,z){return A[0]=Math.max(P[0],z[0]),A[1]=Math.max(P[1],z[1]),A},wi.round=function(A,P){return A[0]=Math.round(P[0]),A[1]=Math.round(P[1]),A},wi.scale=function(A,P,z){return A[0]=P[0]*z,A[1]=P[1]*z,A},wi.scaleAndAdd=function(A,P,z,j){return A[0]=P[0]+z[0]*j,A[1]=P[1]+z[1]*j,A},wi.distance=T,wi.squaredDistance=k,wi.length=F,wi.squaredLength=S,wi.negate=function(A,P){return A[0]=-P[0],A[1]=-P[1],A},wi.inverse=function(A,P){return A[0]=1/P[0],A[1]=1/P[1],A},wi.normalize=function(A,P){var z=P[0],j=P[1],$=z*z+j*j;return $>0&&($=1/Math.sqrt($)),A[0]=P[0]*$,A[1]=P[1]*$,A},wi.dot=function(A,P){return A[0]*P[0]+A[1]*P[1]},wi.cross=function(A,P,z){var j=P[0]*z[1]-P[1]*z[0];return A[0]=A[1]=0,A[2]=j,A},wi.lerp=function(A,P,z,j){var $=P[0],K=P[1];return A[0]=$+j*(z[0]-$),A[1]=K+j*(z[1]-K),A},wi.random=function(A,P){P=P||1;var z=2*a.RANDOM()*Math.PI;return A[0]=Math.cos(z)*P,A[1]=Math.sin(z)*P,A},wi.transformMat2=function(A,P,z){var j=P[0],$=P[1];return A[0]=z[0]*j+z[2]*$,A[1]=z[1]*j+z[3]*$,A},wi.transformMat2d=function(A,P,z){var j=P[0],$=P[1];return A[0]=z[0]*j+z[2]*$+z[4],A[1]=z[1]*j+z[3]*$+z[5],A},wi.transformMat3=function(A,P,z){var j=P[0],$=P[1];return A[0]=z[0]*j+z[3]*$+z[6],A[1]=z[1]*j+z[4]*$+z[7],A},wi.transformMat4=function(A,P,z){var j=P[0],$=P[1];return A[0]=z[0]*j+z[4]*$+z[12],A[1]=z[1]*j+z[5]*$+z[13],A},wi.rotate=function(A,P,z,j){var $=P[0]-z[0],K=P[1]-z[1],J=Math.sin(j),Z=Math.cos(j);return A[0]=$*Z-K*J+z[0],A[1]=$*J+K*Z+z[1],A},wi.angle=function(A,P){var z=A[0],j=A[1],$=P[0],K=P[1],J=Math.sqrt(z*z+j*j)*Math.sqrt($*$+K*K);return Math.acos(Math.min(Math.max(J&&(z*$+j*K)/J,-1),1))},wi.zero=function(A){return A[0]=0,A[1]=0,A},wi.str=function(A){return"vec2("+A[0]+", "+A[1]+")"},wi.exactEquals=function(A,P){return A[0]===P[0]&&A[1]===P[1]},wi.equals=function(A,P){var z=A[0],j=A[1],$=P[0],K=P[1];return Math.abs(z-$)<=a.EPSILON*Math.max(1,Math.abs(z),Math.abs($))&&Math.abs(j-K)<=a.EPSILON*Math.max(1,Math.abs(j),Math.abs(K))},wi.forEach=wi.sqrLen=wi.sqrDist=wi.dist=wi.div=wi.mul=wi.sub=wi.len=void 0;var a=function(A){if(A&&A.__esModule)return A;if(null===A||"object"!==d(A)&&"function"!=typeof A)return{default:A};var z=l(void 0);if(z&&z.has(A))return z.get(A);var j={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in A)if("default"!==K&&Object.prototype.hasOwnProperty.call(A,K)){var J=$?Object.getOwnPropertyDescriptor(A,K):null;J&&(J.get||J.set)?Object.defineProperty(j,K,J):j[K]=A[K]}return j.default=A,z&&z.set(A,j),j}(kn());function l(A){if("function"!=typeof WeakMap)return null;var P=new WeakMap,z=new WeakMap;return(l=function(j){return j?z:P})(A)}function p(){var A=new a.ARRAY_TYPE(2);return a.ARRAY_TYPE!=Float32Array&&(A[0]=0,A[1]=0),A}function g(A,P,z){return A[0]=P[0]-z[0],A[1]=P[1]-z[1],A}function m(A,P,z){return A[0]=P[0]*z[0],A[1]=P[1]*z[1],A}function b(A,P,z){return A[0]=P[0]/z[0],A[1]=P[1]/z[1],A}function T(A,P){return Math.hypot(P[0]-A[0],P[1]-A[1])}function k(A,P){var z=P[0]-A[0],j=P[1]-A[1];return z*z+j*j}function F(A){return Math.hypot(A[0],A[1])}function S(A){var P=A[0],z=A[1];return P*P+z*z}wi.len=F,wi.sub=g,wi.mul=m,wi.div=b,wi.dist=T,wi.sqrDist=k,wi.sqrLen=S;var R,L=(R=p(),function(A,P,z,j,$,K){var J,Z;for(P||(P=2),z||(z=0),Z=j?Math.min(j*P+z,A.length):A.length,J=z;J0){P=Math.sqrt(P);var z=A[0]/P,j=A[1]/P,$=A[2]/P,K=A[3]/P,J=A[4],Z=A[5],ne=A[6],oe=A[7],le=z*J+j*Z+$*ne+K*oe;L[0]=z,L[1]=j,L[2]=$,L[3]=K,L[4]=(J-z*le)/P,L[5]=(Z-j*le)/P,L[6]=(ne-$*le)/P,L[7]=(oe-K*le)/P}return L},mi.str=function(L){return"quat2("+L[0]+", "+L[1]+", "+L[2]+", "+L[3]+", "+L[4]+", "+L[5]+", "+L[6]+", "+L[7]+")"},mi.exactEquals=function(L,A){return L[0]===A[0]&&L[1]===A[1]&&L[2]===A[2]&&L[3]===A[3]&&L[4]===A[4]&&L[5]===A[5]&&L[6]===A[6]&&L[7]===A[7]},mi.equals=function(L,A){var P=L[0],z=L[1],j=L[2],$=L[3],K=L[4],J=L[5],Z=L[6],ne=L[7],oe=A[0],le=A[1],xe=A[2],ve=A[3],ye=A[4],Fe=A[5],Se=A[6],Ne=A[7];return Math.abs(P-oe)<=a.EPSILON*Math.max(1,Math.abs(P),Math.abs(oe))&&Math.abs(z-le)<=a.EPSILON*Math.max(1,Math.abs(z),Math.abs(le))&&Math.abs(j-xe)<=a.EPSILON*Math.max(1,Math.abs(j),Math.abs(xe))&&Math.abs($-ve)<=a.EPSILON*Math.max(1,Math.abs($),Math.abs(ve))&&Math.abs(K-ye)<=a.EPSILON*Math.max(1,Math.abs(K),Math.abs(ye))&&Math.abs(J-Fe)<=a.EPSILON*Math.max(1,Math.abs(J),Math.abs(Fe))&&Math.abs(Z-Se)<=a.EPSILON*Math.max(1,Math.abs(Z),Math.abs(Se))&&Math.abs(ne-Ne)<=a.EPSILON*Math.max(1,Math.abs(ne),Math.abs(Ne))},mi.sqrLen=mi.squaredLength=mi.len=mi.length=mi.dot=mi.mul=mi.setReal=mi.getReal=void 0;var a=m(kn()),l=m(Ui()),p=m(Ji());function g(L){if("function"!=typeof WeakMap)return null;var A=new WeakMap,P=new WeakMap;return(g=function(z){return z?P:A})(L)}function m(L,A){if(L&&L.__esModule)return L;if(null===L||"object"!==d(L)&&"function"!=typeof L)return{default:L};var P=g(A);if(P&&P.has(L))return P.get(L);var z={},j=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in L)if("default"!==$&&Object.prototype.hasOwnProperty.call(L,$)){var K=j?Object.getOwnPropertyDescriptor(L,$):null;K&&(K.get||K.set)?Object.defineProperty(z,$,K):z[$]=L[$]}return z.default=L,P&&P.set(L,z),z}function b(L,A,P){var z=.5*P[0],j=.5*P[1],$=.5*P[2],K=A[0],J=A[1],Z=A[2],ne=A[3];return L[0]=K,L[1]=J,L[2]=Z,L[3]=ne,L[4]=z*ne+j*Z-$*J,L[5]=j*ne+$*K-z*Z,L[6]=$*ne+z*J-j*K,L[7]=-z*K-j*J-$*Z,L}function T(L,A){return L[0]=A[0],L[1]=A[1],L[2]=A[2],L[3]=A[3],L[4]=A[4],L[5]=A[5],L[6]=A[6],L[7]=A[7],L}function k(L,A,P){var z=A[0],j=A[1],$=A[2],K=A[3],J=P[4],Z=P[5],ne=P[6],oe=P[7],le=A[4],xe=A[5],ve=A[6],ye=A[7],Fe=P[0],Se=P[1],Ne=P[2],Ge=P[3];return L[0]=z*Ge+K*Fe+j*Ne-$*Se,L[1]=j*Ge+K*Se+$*Fe-z*Ne,L[2]=$*Ge+K*Ne+z*Se-j*Fe,L[3]=K*Ge-z*Fe-j*Se-$*Ne,L[4]=z*oe+K*J+j*ne-$*Z+le*Ge+ye*Fe+xe*Ne-ve*Se,L[5]=j*oe+K*Z+$*J-z*ne+xe*Ge+ye*Se+ve*Fe-le*Ne,L[6]=$*oe+K*ne+z*Z-j*J+ve*Ge+ye*Ne+le*Se-xe*Fe,L[7]=K*oe-z*J-j*Z-$*ne+ye*Ge-le*Fe-xe*Se-ve*Ne,L}mi.getReal=l.copy,mi.setReal=l.copy,mi.mul=k;var F=l.dot;mi.dot=F;var S=l.length;mi.length=S,mi.len=S;var R=l.squaredLength;return mi.squaredLength=R,mi.sqrLen=R,mi}());Pt.quat2=T;var k=L(Oc());Pt.vec2=k;var F=L(Ti());Pt.vec3=F;var S=L(ci());function R(A){if("function"!=typeof WeakMap)return null;var P=new WeakMap,z=new WeakMap;return(R=function(j){return j?z:P})(A)}function L(A,P){if(A&&A.__esModule)return A;if(null===A||"object"!==d(A)&&"function"!=typeof A)return{default:A};var z=R(P);if(z&&z.has(A))return z.get(A);var j={},$=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var K in A)if("default"!==K&&Object.prototype.hasOwnProperty.call(A,K)){var J=$?Object.getOwnPropertyDescriptor(A,K):null;J&&(J.get||J.set)?Object.defineProperty(j,K,J):j[K]=A[K]}return j.default=A,z&&z.set(A,j),j}return Pt.vec4=S,Pt}(),cr=function(){if(Ul)return lr;function d(a,l,p,g){this.cx=3*a,this.bx=3*(p-a)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(g-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=a,this.p1y=l,this.p2x=p,this.p2y=g}return Ul=1,lr=d,d.prototype={sampleCurveX:function(a){return((this.ax*a+this.bx)*a+this.cx)*a},sampleCurveY:function(a){return((this.ay*a+this.by)*a+this.cy)*a},sampleCurveDerivativeX:function(a){return(3*this.ax*a+2*this.bx)*a+this.cx},solveCurveX:function(a,l){if(void 0===l&&(l=1e-6),a<0)return 0;if(a>1)return 1;for(var p=a,g=0;g<8;g++){var m=this.sampleCurveX(p)-a;if(Math.abs(m)m?T=p:k=p,p=.5*(k-T)+T;return p},solve:function(a,l){return this.sampleCurveY(this.solveCurveX(a,l))}},lr}(),yr=_t(cr);function Wo(){if(Ns)return Fs;function d(a,l){this.x=a,this.y=l}return Ns=1,Fs=d,d.prototype={clone:function(){return new d(this.x,this.y)},add:function(a){return this.clone()._add(a)},sub:function(a){return this.clone()._sub(a)},multByPoint:function(a){return this.clone()._multByPoint(a)},divByPoint:function(a){return this.clone()._divByPoint(a)},mult:function(a){return this.clone()._mult(a)},div:function(a){return this.clone()._div(a)},rotate:function(a){return this.clone()._rotate(a)},rotateAround:function(a,l){return this.clone()._rotateAround(a,l)},matMult:function(a){return this.clone()._matMult(a)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(a){return this.x===a.x&&this.y===a.y},dist:function(a){return Math.sqrt(this.distSqr(a))},distSqr:function(a){var l=a.x-this.x,p=a.y-this.y;return l*l+p*p},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(a){return Math.atan2(this.y-a.y,this.x-a.x)},angleWith:function(a){return this.angleWithSep(a.x,a.y)},angleWithSep:function(a,l){return Math.atan2(this.x*l-this.y*a,this.x*a+this.y*l)},_matMult:function(a){var l=a[2]*this.x+a[3]*this.y;return this.x=a[0]*this.x+a[1]*this.y,this.y=l,this},_add:function(a){return this.x+=a.x,this.y+=a.y,this},_sub:function(a){return this.x-=a.x,this.y-=a.y,this},_mult:function(a){return this.x*=a,this.y*=a,this},_div:function(a){return this.x/=a,this.y/=a,this},_multByPoint:function(a){return this.x*=a.x,this.y*=a.y,this},_divByPoint:function(a){return this.x/=a.x,this.y/=a.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var a=this.y;return this.y=this.x,this.x=-a,this},_rotate:function(a){var l=Math.cos(a),p=Math.sin(a),g=p*this.x+l*this.y;return this.x=l*this.x-p*this.y,this.y=g,this},_rotateAround:function(a,l){var p=Math.cos(a),g=Math.sin(a),m=l.y+g*(this.x-l.x)+p*(this.y-l.y);return this.x=l.x+p*(this.x-l.x)-g*(this.y-l.y),this.y=m,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(a){return a instanceof d?a:Array.isArray(a)?new d(a[0],a[1]):a},Fs}var Xt=_t(Wo());function fa(d,a){if(Array.isArray(d)){if(!Array.isArray(a)||d.length!==a.length)return!1;for(let l=0;l=1)return 1;const a=d*d,l=a*d;return 4*(d<.5?l:3*(d-a)+l-.75)}function pe(d,a,l,p){const g=new yr(d,a,l,p);return function(m){return g.solve(m)}}const et=pe(.25,.1,.25,1);function ht(d,a,l){return Math.min(l,Math.max(a,d))}function _n(d,a,l){return(l=ht((l-d)/(a-d),0,1))*l*(3-2*l)}function an(d,a,l){const p=l-a,g=((d-a)%p+p)%p+a;return g===a?l:g}function vo(d,a,l){if(!d.length)return l(null,[]);let p=d.length;const g=new Array(d.length);let m=null;d.forEach((b,T)=>{a(b,(k,F)=>{k&&(m=k),g[T]=F,0==--p&&l(m,g)})})}function fo(d,...a){for(const l of a)for(const p in l)d[p]=l[p];return d}let Ho=1;function ai(){return Ho++}function dr(d){return d<=1?1:Math.pow(2,Math.ceil(Math.log(d)/Math.LN2))}function Hl(d,a){d.forEach(l=>{a[l]&&(a[l]=a[l].bind(a))})}function Fa(d,a){return-1!==d.indexOf(a,d.length-a.length)}function zs(d,a,l){const p={};for(const g in d)p[g]=a.call(this,d[g],g,d);return p}function nc(d,a,l){const p={};for(const g in d)a.call(this,d[g],g,d)&&(p[g]=d[g]);return p}function Bs(d){return Array.isArray(d)?d.map(Bs):"object"==typeof d&&d?zs(d,Bs):d}const Pc={};function ki(d){Pc[d]||(typeof console<"u"&&console.warn(d),Pc[d]=!0)}function Lc(d,a,l){return(l.y-d.y)*(a.x-d.x)>(a.y-d.y)*(l.x-d.x)}function im(d){let a=0;for(let l,p,g=0,m=d.length,b=m-1;g@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(l,p,g,m)=>{const b=g||m;return a[p]=!b||b.toLowerCase(),""}),a["max-age"]){const l=parseInt(a["max-age"],10);isNaN(l)?delete a["max-age"]:a["max-age"]=l}return a}let sh=null;function md(d,a){return[d[4*a],d[4*a+1],d[4*a+2],d[4*a+3]]}function Qh(d,a,l,p){for(;a>1;d[g]>1;d[g]<=p?a=g+1:l=g}return a}function om(d){return d>0?1/(1.001-d):1+d}function fd(d){return d>0?1-1/(1.001-d):-d}const zr={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!zr.API_URL)return null;try{const d=new URL(zr.API_URL);return"api.mapbox.cn"===d.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===d.hostname?"https://events.mapbox.com/events/v2":null}catch{return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function lh(d){return zr.API_URL_REGEX.test(d)}function ch(d){return zr.API_SPRITE_REGEX.test(d)}let Jh,Na,za,ft,re,se;function _e(){return null==Jh&&(Jh=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Jh}const ke={now:()=>void 0!==ft?ft:performance.now(),setNow(d){ft=d},restoreNow(){ft=void 0},frame(d){const a=requestAnimationFrame(d);return{cancel:()=>cancelAnimationFrame(a)}},getImageData(d,a=0){const{width:l,height:p}=d;re||(re=document.createElement("canvas"));const g=re.getContext("2d",{willReadFrequently:!0});if(!g)throw new Error("failed to create canvas 2d context");return(l>re.width||p>re.height)&&(re.width=l,re.height=p),g.clearRect(-a,-a,l+2*a,p+2*a),g.drawImage(d,0,0,l,p),g.getImageData(-a,-a,l+2*a,p+2*a)},resolveURL:d=>(Na||(Na=document.createElement("a")),Na.href=d,Na.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==za&&(za=window.matchMedia("(prefers-reduced-motion: reduce)")),za.matches)},hasCanvasFingerprintNoise(){if(void 0!==se)return se;if(!_e())return se=!1,!1;const d=new OffscreenCanvas(85,1),a=d.getContext("2d",{willReadFrequently:!0});let l=0;for(let g=0;g0?`?${m}`:""}`}const Ee="mapbox-tiles";let We=500,it=50;const dt=["language","worldview","jobid"];let ot,St;function on(){try{return caches}catch{}}function kt(){const d=on();d&&null==ot&&(ot=d.open(Ee))}let Zn=1/0;const ni={supported:!1,testSupport:function(d){!Mi&&ii&&(Ai?Wi(d):ct=d)}};let ct,ii,Mi=!1,Ai=!1;const Di=typeof self<"u"?self:{};function Wi(d){const a=d.createTexture();d.bindTexture(d.TEXTURE_2D,a);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,ii),d.isContextLost())return;ni.supported=!0}catch{}d.deleteTexture(a),Mi=!0}Di.document&&(ii=Di.document.createElement("img"),ii.onload=function(){ct&&Wi(ct),ct=null,Ai=!0},ii.onerror=function(){Mi=!0,ct=null},ii.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Hi={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Hi);class Go extends Error{constructor(a,l,p){401===l&&lh(p)&&(a+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(a),this.status=l,this.url=p}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const qr=as()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,Zo=function(d,a){if(!(/^file:/.test(l=d.url)||/^file:/.test(qr())&&!/^\w+:/.test(l))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(p,g){const m=new AbortController,b=new Request(p.url,{method:p.method||"GET",body:p.body,credentials:p.credentials,headers:p.headers,referrer:qr(),referrerPolicy:p.referrerPolicy,signal:m.signal});let T=!1,k=!1;const F=(S=b.url).indexOf("sku=")>0&&lh(S);var S;"json"===p.type&&b.headers.set("Accept","application/json");const R=(A,P,z)=>{if(k)return;if(A&&"SecurityError"!==A.message&&ki(A.toString()),P&&z)return L(P);const j=Date.now();fetch(b).then($=>{if($.ok){const K=F?$.clone():null;return L($,K,j)}return g(new Go($.statusText,$.status,p.url))}).catch($=>{"AbortError"!==$.name&&g(new Error(`${$.message} ${p.url}`))})},L=(A,P,z)=>{("arrayBuffer"===p.type?A.arrayBuffer():"json"===p.type?A.json():A.text()).then(j=>{k||(P&&z&&function($,K,J){if(kt(),null==ot)return;const Z=pd(K.headers.get("Cache-Control")||"");if(Z["no-store"])return;const ne={status:K.status,statusText:K.statusText,headers:new Headers};K.headers.forEach((xe,ve)=>ne.headers.set(ve,xe)),Z["max-age"]&&ne.headers.set("Expires",new Date(J+1e3*Z["max-age"]).toUTCString());const oe=ne.headers.get("Expires");if(!oe||new Date(oe).getTime()-J<42e4)return;let le=qe($.url,{persistentParams:dt});if(206===K.status){const xe=$.headers.get("Range");if(!xe)return;ne.status=200,le=Oe(le,{range:xe})}!function(xe,ve){if(void 0===St)try{new Response(new ReadableStream),St=!0}catch{St=!1}St?ve(xe.body):xe.blob().then(ve)}(K,xe=>{const ve=new Response(200!==(ye=K.status)&&404!==ye&&[101,103,204,205,304].includes(ye)?null:xe,ne);var ye;kt(),ot?.then(Fe=>Fe.put(le,ve)).catch(Fe=>ki(Fe.message))})}(b,P,z),T=!0,g(null,j,A.headers.get("Cache-Control"),A.headers.get("Expires")))}).catch(j=>{k||g(new Error(j.message))})};return F?function(A,P){if(kt(),null==ot)return P(null);ot.then(z=>{let j=qe(A.url,{persistentParams:dt});const $=A.headers.get("Range");$&&(j=Oe(j,{range:$})),z.match(j).then(K=>{const J=function(Z){if(!Z)return!1;const ne=new Date(Z.headers.get("Expires")||0),oe=pd(Z.headers.get("Cache-Control")||"");return ne>Date.now()&&!oe["no-cache"]}(K);z.delete(j),J&&z.put(j,K.clone()),P(null,K,J)}).catch(P)}).catch(P)}(b,R):R(null,null),{cancel:()=>{k=!0,T||m.abort()}}}(d,a);if(as()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",d,a,void 0,!0)}var l;return function(p,g){const m=new XMLHttpRequest;m.open(p.method||"GET",p.url,!0),"arrayBuffer"===p.type&&(m.responseType="arraybuffer");for(const b in p.headers)m.setRequestHeader(b,p.headers[b]);return"json"===p.type&&(m.responseType="text",m.setRequestHeader("Accept","application/json")),m.withCredentials="include"===p.credentials,m.onerror=()=>{g(new Error(m.statusText))},m.onload=()=>{if((m.status>=200&&m.status<300||0===m.status)&&null!==m.response){let b=m.response;if("json"===p.type)try{b=JSON.parse(m.response)}catch(T){return g(T)}g(null,b,m.getResponseHeader("Cache-Control"),m.getResponseHeader("Expires"))}else g(new Go(m.statusText,m.status,p.url))},m.send(p.body),{cancel:()=>m.abort()}}(d,a)},Tr=function(d,a){return Zo(fo(d,{type:"arrayBuffer"}),a)};function ss(d){const a=document.createElement("a");return a.href=d,a.protocol===location.protocol&&a.host===location.host}const Nc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Wr,Iu;Wr=[],Iu=0;const Or=function(d,a){if(ni.supported&&(d.headers||(d.headers={}),d.headers.accept="image/webp,*/*"),Iu>=zr.MAX_PARALLEL_IMAGE_REQUESTS){const m={requestParameters:d,callback:a,cancelled:!1,cancel(){this.cancelled=!0}};return Wr.push(m),m}Iu++;let l=!1;const p=()=>{if(!l)for(l=!0,Iu--;Wr.length&&Iu{p(),m?a(m):b&&(self.createImageBitmap?function(F,S){const R=new Blob([new Uint8Array(F)],{type:"image/png"});createImageBitmap(R).then(L=>{S(null,L)}).catch(L=>{S(new Error(`Could not load image because of ${L.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(b,(F,S)=>a(F,S,T,k)):function(F,S){const R=new Image;R.onload=()=>{S(null,R),URL.revokeObjectURL(R.src),R.onload=null,requestAnimationFrame(()=>{R.src=Nc})},R.onerror=()=>S(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const L=new Blob([new Uint8Array(F)],{type:"image/png"});R.src=F.byteLength?URL.createObjectURL(L):Nc}(b,(F,S)=>a(F,S,T,k)))});return{cancel:()=>{g.cancel(),p()}}};var pf,rm,Jo,Wa={exports:{}},Yo={exports:{}},mc={exports:{}},zc=function(){if(Jo)return Wa.exports;Jo=1;var d=(pf||(pf=1,Yo.exports=function(l,p){var g,m,b,T,k,F,S,R;for(m=l.length-(g=3&l.length),b=p,k=3432918353,F=461845907,R=0;R>>16)*k&65535)<<16)&4294967295)<<15|S>>>17))*F+(((S>>>16)*F&65535)<<16)&4294967295)<<13|b>>>19))+((5*(b>>>16)&65535)<<16)&4294967295))+((58964+(T>>>16)&65535)<<16);switch(S=0,g){case 3:S^=(255&l.charCodeAt(R+2))<<16;case 2:S^=(255&l.charCodeAt(R+1))<<8;case 1:b^=S=(65535&(S=(S=(65535&(S^=255&l.charCodeAt(R)))*k+(((S>>>16)*k&65535)<<16)&4294967295)<<15|S>>>17))*F+(((S>>>16)*F&65535)<<16)&4294967295}return b^=l.length,b=2246822507*(65535&(b^=b>>>16))+((2246822507*(b>>>16)&65535)<<16)&4294967295,b=3266489909*(65535&(b^=b>>>13))+((3266489909*(b>>>16)&65535)<<16)&4294967295,(b^=b>>>16)>>>0}),Yo.exports),a=(rm||(rm=1,mc.exports=function(l,p){for(var g,m=l.length,b=p^m,T=0;m>=4;)g=1540483477*(65535&(g=255&l.charCodeAt(T)|(255&l.charCodeAt(++T))<<8|(255&l.charCodeAt(++T))<<16|(255&l.charCodeAt(++T))<<24))+((1540483477*(g>>>16)&65535)<<16),b=1540483477*(65535&b)+((1540483477*(b>>>16)&65535)<<16)^(g=1540483477*(65535&(g^=g>>>24))+((1540483477*(g>>>16)&65535)<<16)),m-=4,++T;switch(m){case 3:b^=(255&l.charCodeAt(T+2))<<16;case 2:b^=(255&l.charCodeAt(T+1))<<8;case 1:b=1540483477*(65535&(b^=255&l.charCodeAt(T)))+((1540483477*(b>>>16)&65535)<<16)}return b=1540483477*(65535&(b^=b>>>13))+((1540483477*(b>>>16)&65535)<<16),(b^=b>>>15)>>>0}),mc.exports);return Wa.exports=d,Wa.exports.murmur3=d,Wa.exports.murmur2=a,Wa.exports}(),jl=_t(zc);class lo{constructor(a,...l){fo(this,l[0]||{}),this.type=a}}class eo extends lo{constructor(a,l={}){super("error",fo({error:a},l))}}function dh(d,a,l){l[d]&&-1!==l[d].indexOf(a)||(l[d]=l[d]||[],l[d].push(a))}function Ie(d,a,l){if(l&&l[d]){const p=l[d].indexOf(a);-1!==p&&l[d].splice(p,1)}}class ze{on(a,l){return this._listeners=this._listeners||{},dh(a,l,this._listeners),this}off(a,l){return Ie(a,l,this._listeners),Ie(a,l,this._oneTimeListeners),this}once(a,l){return l?(this._oneTimeListeners=this._oneTimeListeners||{},dh(a,l,this._oneTimeListeners),this):new Promise(p=>this.once(a,p))}fire(a,l){const p="string"==typeof a?new lo(a,l):a,g=p.type;if(this.listens(g)){p.target=this;const m=this._listeners&&this._listeners[g]?this._listeners[g].slice():[];for(const k of m)k.call(this,p);const b=this._oneTimeListeners&&this._oneTimeListeners[g]?this._oneTimeListeners[g].slice():[];for(const k of b)Ie(g,k,this._oneTimeListeners),k.call(this,p);const T=this._eventedParent;T&&(fo(p,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),T.fire(p))}else p instanceof eo&&console.error(p.error);return this}listens(a){return!!(this._listeners&&this._listeners[a]&&this._listeners[a].length>0||this._oneTimeListeners&&this._oneTimeListeners[a]&&this._oneTimeListeners[a].length>0||this._eventedParent&&this._eventedParent.listens(a))}setEventedParent(a,l){return this._eventedParent=a,this._eventedParentData=l,this}}var ut,Zt={},yn=function(){if(ut)return Zt;ut=1;var d={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(m){return(m=Math.round(m))<0?0:m>255?255:m}function l(m){return a("%"===m[m.length-1]?parseFloat(m)/100*255:parseInt(m))}function p(m){return(b="%"===m[m.length-1]?parseFloat(m)/100:parseFloat(m))<0?0:b>1?1:b;var b}function g(m,b,T){return T<0?T+=1:T>1&&(T-=1),6*T<1?m+(b-m)*T*6:2*T<1?b:3*T<2?m+(b-m)*(2/3-T)*6:m}try{Zt.parseCSSColor=function(m){var b,T=m.replace(/ /g,"").toLowerCase();if(T in d)return d[T].slice();if("#"===T[0])return 4===T.length?(b=parseInt(T.substr(1),16))>=0&&b<=4095?[(3840&b)>>4|(3840&b)>>8,240&b|(240&b)>>4,15&b|(15&b)<<4,1]:null:7===T.length&&(b=parseInt(T.substr(1),16))>=0&&b<=16777215?[(16711680&b)>>16,(65280&b)>>8,255&b,1]:null;var k=T.indexOf("("),F=T.indexOf(")");if(-1!==k&&F+1===T.length){var S=T.substr(0,k),R=T.substr(k+1,F-(k+1)).split(","),L=1;switch(S){case"rgba":if(4!==R.length)return null;L=p(R.pop());case"rgb":return 3!==R.length?null:[l(R[0]),l(R[1]),l(R[2]),L];case"hsla":if(4!==R.length)return null;L=p(R.pop());case"hsl":if(3!==R.length)return null;var A=(parseFloat(R[0])%360+360)%360/360,P=p(R[1]),z=p(R[2]),j=z<=.5?z*(P+1):z+P-z*P,$=2*z-j;return[a(255*g($,j,A+1/3)),a(255*g($,j,A)),a(255*g($,j,A-1/3)),L];default:return null}}return null}}catch{}return Zt}();class In{constructor(a,l,p,g=1){this.r=a,this.g=l,this.b=p,this.a=g}static parse(a){if(!a)return;if(a instanceof In)return a;if("string"!=typeof a)return;const l=yn.parseCSSColor(a);return l?new In(l[0]/255*l[3],l[1]/255*l[3],l[2]/255*l[3],l[3]):void 0}toStringPremultipliedAlpha(){const[a,l,p,g]=0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(a)},${Math.round(l)},${Math.round(p)},${g})`}toString(){const[a,l,p,g]=[this.r,this.g,this.b,this.a];return`rgba(${Math.round(255*a)},${Math.round(255*l)},${Math.round(255*p)},${g})`}toRenderColor(a){const{r:l,g:p,b:g,a:m}=this;return new zo(a,l,p,g,m)}clone(){return new In(this.r,this.g,this.b,this.a)}}class zo{constructor(a,l,p,g,m){if(a){const b=a.image.height,T=b*b;l=0===m?0:l/m*(b-1),p=0===m?0:p/m*(b-1),g=0===m?0:g/m*(b-1);const k=Math.floor(l),F=Math.floor(p),S=Math.floor(g),R=Math.ceil(l),L=Math.ceil(p),A=Math.ceil(g),P=l-k,z=p-F,j=g-S,$=a.image.data,K=4*(k+F*T+S*b),J=4*(k+F*T+A*b),Z=4*(k+L*T+S*b),ne=4*(k+L*T+A*b),oe=4*(R+F*T+S*b),le=4*(R+F*T+A*b),xe=4*(R+L*T+S*b),ve=4*(R+L*T+A*b);if(K<0||ve>=$.length)throw new Error("out of range");this.r=Un(Un(Un($[K],$[J],j),Un($[Z],$[ne],j),z),Un(Un($[oe],$[le],j),Un($[xe],$[ve],j),z),P)/255*m,this.g=Un(Un(Un($[K+1],$[J+1],j),Un($[Z+1],$[ne+1],j),z),Un(Un($[oe+1],$[le+1],j),Un($[xe+1],$[ve+1],j),z),P)/255*m,this.b=Un(Un(Un($[K+2],$[J+2],j),Un($[Z+2],$[ne+2],j),z),Un(Un($[oe+2],$[le+2],j),Un($[xe+2],$[ve+2],j),z),P)/255*m,this.a=m}else this.r=l,this.g=p,this.b=g,this.a=m}toArray(){const{r:a,g:l,b:p,a:g}=this;return 0===g?[0,0,0,0]:[255*a/g,255*l/g,255*p/g,g]}toHslaArray(){if(0===this.a)return[0,0,0,0];const{r:a,g:l,b:p,a:g}=this,m=Math.min(Math.max(a/g,0),1),b=Math.min(Math.max(l/g,0),1),T=Math.min(Math.max(p/g,0),1),k=Math.min(m,b,T),F=Math.max(m,b,T),S=(k+F)/2;if(k===F)return[0,0,100*S,g];const R=F-k,L=S>.5?R/(2-F-k):R/(F+k);let A=0;return F===m?A=(b-T)/R+(bUn(p,a[g],l))}In.black=new In(0,0,0,1),In.white=new In(1,1,1,1),In.transparent=new In(0,0,0,0),In.red=new In(1,0,0,1),In.blue=new In(0,0,1,1);var ls=Object.freeze({__proto__:null,array:Cs,color:function(d,a,l){return new In(Un(d.r,a.r,l),Un(d.g,a.g,l),Un(d.b,a.b,l),Un(d.a,a.a,l))},number:Un});function ic(d,...a){for(const l of a)for(const p in l)d[p]=l[p];return d}class Zi extends Error{constructor(a,l){super(l),this.message=l,this.key=a}}class el{constructor(a,l=[]){this.parent=a,this.bindings={};for(const[p,g]of l)this.bindings[p]=g}concat(a){return new el(this,a)}get(a){if(this.bindings[a])return this.bindings[a];if(this.parent)return this.parent.get(a);throw new Error(`${a} not found in scope.`)}has(a){return!!this.bindings[a]||!!this.parent&&this.parent.has(a)}}const Pi={kind:"null"},Nn={kind:"number"},Bo={kind:"string"},xo={kind:"boolean"},ml={kind:"color"},uh={kind:"object"},Nt={kind:"value"},N_={kind:"collator"},_i={kind:"formatted"},hh={kind:"resolvedImage"};function Ss(d,a){return{kind:"array",itemType:d,N:a}}function Br(d){if("array"===d.kind){const a=Br(d.itemType);return"number"==typeof d.N?`array<${a}, ${d.N}>`:"value"===d.itemType.kind?"array":`array<${a}>`}return d.kind}const zb=[Pi,Nn,Bo,xo,ml,_i,uh,Ss(Nt),hh];function Us(d,a){if("error"===a.kind)return null;if("array"===d.kind){if("array"===a.kind&&(0===a.N&&"value"===a.itemType.kind||!Us(d.itemType,a.itemType))&&("number"!=typeof d.N||d.N===a.N))return null}else{if(d.kind===a.kind)return null;if("value"===d.kind)for(const l of zb)if(!Us(l,a))return null}return`Expected ${Br(d)} but found ${Br(a)} instead.`}function ep(d,a){return a.some(l=>l.kind===d.kind)}function tp(d,a){return a.some(l=>"null"===l?null===d:"array"===l?Array.isArray(d):"object"===l?d&&!Array.isArray(d)&&"object"==typeof d:l===typeof d)}class mf{constructor(a,l,p){this.sensitivity=a?l?"variant":"case":l?"accent":"base",this.locale=p,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(a,l){return this.collator.compare(a,l)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class ff{constructor(a,l,p,g,m){this.text=a.normalize?a.normalize():a,this.image=l,this.scale=p,this.fontStack=g,this.textColor=m}}class yt{constructor(a){this.sections=a}static fromString(a){return new yt([new ff(a,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(a=>0!==a.text.length||a.image&&a.image.namePrimary)}static factory(a){return a instanceof yt?a:yt.fromString(a)}toString(){return 0===this.sections.length?"":this.sections.map(a=>a.text).join("")}serialize(){const a=["format"];for(const l of this.sections){if(l.image){a.push(["image",l.image.namePrimary]);continue}a.push(l.text);const p={};l.fontStack&&(p["text-font"]=["literal",l.fontStack.split(",")]),l.scale&&(p["font-scale"]=l.scale),l.textColor&&(p["text-color"]=["rgba"].concat(l.textColor.toRenderColor(null).toArray())),a.push(p)}return a}}class Bc{constructor(a,l){if(this.id=a,this.options=l||{params:{}},this.options.transform){const{a:p,b:g,c:m,d:b,e:T,f:k}=this.options.transform;this.options.transform=new DOMMatrix([p,g,m,b,T,k])}else this.options.transform=new DOMMatrix([1,0,0,1,0,0])}static deserializeId(a){return JSON.parse(a).id}static deserializeFromString(a){const l=JSON.parse(a),{a:p,b:g,c:m,d:b,e:T,f:k}=l.options.transform;return new DOMMatrix([p,g,m,b,T,k]),new Bc(l.id,l.options)}scaleSelf(a){return this.options.transform=this.options.transform.scale(a),this}serialize(){const a={id:this.id};this.options&&(a.options=this.options);const{a:l,b:p,c:g,d:m,e:b,f:T}=this.options.transform;return a.options.transform={a:l,b:p,c:g,d:m,e:b,f:T},JSON.stringify(a)}}class Za{constructor(a){this.namePrimary=a.namePrimary,a.nameSecondary&&(this.nameSecondary=a.nameSecondary),a.optionsPrimary&&(this.optionsPrimary=a.optionsPrimary),a.optionsSecondary&&(this.optionsSecondary=a.optionsSecondary),this.available=a.available}toString(){return this.namePrimary&&this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}getPrimary(){return new Bc(this.namePrimary,{params:this.optionsPrimary&&this.optionsPrimary.params||{}})}getSerializedPrimary(){return this.getPrimary().serialize()}getSecondary(){return this.nameSecondary?new Bc(this.nameSecondary,{params:this.optionsSecondary&&this.optionsSecondary.params||{}}):null}static from(a){return"string"==typeof a?Za.build(a):a}static build(a,l,p,g){return a?new Za({namePrimary:a,nameSecondary:l,optionsPrimary:p,optionsSecondary:g,available:!1}):null}}function z_(d,a,l,p){return"number"==typeof d&&d>=0&&d<=255&&"number"==typeof a&&a>=0&&a<=255&&"number"==typeof l&&l>=0&&l<=255?void 0===p||"number"==typeof p&&p>=0&&p<=1?null:`Invalid rgba value [${[d,a,l,p].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof p?[d,a,l,p]:[d,a,l]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function _d(d){if(null===d||"string"==typeof d||"boolean"==typeof d||"number"==typeof d||d instanceof In||d instanceof mf||d instanceof yt||d instanceof Za)return!0;if(Array.isArray(d)){for(const a of d)if(!_d(a))return!1;return!0}if("object"==typeof d){for(const a in d)if(!_d(d[a]))return!1;return!0}return!1}function Vr(d){if(null===d)return Pi;if("string"==typeof d)return Bo;if("boolean"==typeof d)return xo;if("number"==typeof d)return Nn;if(d instanceof In)return ml;if(d instanceof mf)return N_;if(d instanceof yt)return _i;if(d instanceof Za)return hh;if(Array.isArray(d)){const a=d.length;let l;for(const p of d){const g=Vr(p);if(l){if(l===g)continue;l=Nt;break}l=g}return Ss(l||Nt,a)}return uh}function $l(d){const a=typeof d;return null===d?"":"string"===a||"number"===a||"boolean"===a?String(d):d instanceof In?d.toStringPremultipliedAlpha():d instanceof yt||d instanceof Za?d.toString():JSON.stringify(d)}class Hs{constructor(a,l){this.type=a,this.value=l}static parse(a,l){if(2!==a.length)return l.error(`'literal' expression requires exactly one argument, but found ${a.length-1} instead.`);if(!_d(a[1]))return l.error("invalid value");const p=a[1];let g=Vr(p);const m=l.expectedType;return"array"!==g.kind||0!==g.N||!m||"array"!==m.kind||"number"==typeof m.N&&0!==m.N||(g=m),new Hs(g,p)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof In?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof yt?this.value.serialize():this.value}}class Ca{constructor(a){this.name="ExpressionEvaluationError",this.message=a}toJSON(){return this.message}}const B_={string:Bo,number:Nn,boolean:xo,object:uh};class Qd{constructor(a,l){this.type=a,this.args=l}static parse(a,l){if(a.length<2)return l.error("Expected at least one argument.");let p,g=1;const m=a[0];if("array"===m){let T,k;if(a.length>2){const F=a[1];if("string"!=typeof F||!(F in B_)||"object"===F)return l.error('The item type argument of "array" must be one of string, number, boolean',1);T=B_[F],g++}else T=Nt;if(a.length>3){if(null!==a[2]&&("number"!=typeof a[2]||a[2]<0||a[2]!==Math.floor(a[2])))return l.error('The length argument to "array" must be a positive integer literal',2);k=a[2],g++}p=Ss(T,k)}else p=B_[m];const b=[];for(;ga.outputDefined())}serialize(){const a=this.type,l=[a.kind];if("array"===a.kind){const p=a.itemType;if("string"===p.kind||"number"===p.kind||"boolean"===p.kind){l.push(p.kind);const g=a.N;("number"==typeof g||this.args.length>1)&&l.push(g)}}return l.concat(this.args.map(p=>p.serialize()))}}class am{constructor(a){this.type=_i,this.sections=a}static parse(a,l){if(a.length<2)return l.error("Expected at least one argument.");const p=a[1];if(!Array.isArray(p)&&"object"==typeof p)return l.error("First argument must be an image or text section.");const g=[];let m=!1;for(let b=1;b<=a.length-1;++b){const T=a[b];if(m&&"object"==typeof T&&!Array.isArray(T)){m=!1;let k=null;if(T["font-scale"]&&(k=l.parseObjectValue(T["font-scale"],b,"font-scale",Nn),!k))return null;let F=null;if(T["text-font"]&&(F=l.parseObjectValue(T["text-font"],b,"text-font",Ss(Bo)),!F))return null;let S=null;if(T["text-color"]&&(S=l.parseObjectValue(T["text-color"],b,"text-color",ml),!S))return null;const R=g[g.length-1];R.scale=k,R.font=F,R.textColor=S}else{const k=l.parse(a[b],b,Nt);if(!k)return null;const F=k.type.kind;if("string"!==F&&"value"!==F&&"null"!==F&&"resolvedImage"!==F)return l.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");m=!0,g.push({content:k,scale:null,font:null,textColor:null})}}return new am(g)}evaluate(a){return new yt(this.sections.map(l=>{const p=l.content.evaluate(a);return Vr(p)===hh?new ff("",p,null,null,null):new ff($l(p),null,l.scale?l.scale.evaluate(a):null,l.font?l.font.evaluate(a).join(","):null,l.textColor?l.textColor.evaluate(a):null)}))}eachChild(a){for(const l of this.sections)a(l.content),l.scale&&a(l.scale),l.font&&a(l.font),l.textColor&&a(l.textColor)}outputDefined(){return!1}serialize(){const a=["format"];for(const l of this.sections){a.push(l.content.serialize());const p={};l.scale&&(p["font-scale"]=l.scale.serialize()),l.font&&(p["text-font"]=l.font.serialize()),l.textColor&&(p["text-color"]=l.textColor.serialize()),a.push(p)}return a}}class np{constructor(a,l,p,g){this._imageWarnHistory={},this.type=hh,this.inputPrimary=a,this.inputSecondary=l,this.inputPrimaryParams=p,this.inputSecondaryParams=g}static parse(a,l){if(a.length<2)return l.error("Expected two or more arguments.");let p=1;const g=[];function m(){if(p-1,l.nameSecondary&&l.available&&a.availableImages&&(l.available=a.availableImages.indexOf(l.nameSecondary)>-1)),l}eachChild(a){if(a(this.inputPrimary),this.inputPrimaryParams)for(const l in this.inputPrimaryParams)this.inputPrimaryParams[l]&&a(this.inputPrimaryParams[l]);if(this.inputSecondary&&(a(this.inputSecondary),this.inputSecondaryParams))for(const l in this.inputSecondaryParams)this.inputSecondaryParams[l]&&a(this.inputSecondaryParams[l])}outputDefined(){return!1}serializeParams(a){const l={};if(a){for(const p in a)a[p]&&(l[p]=a[p].serialize());return{params:l}}}serialize(){const a=["image",this.inputPrimary.serialize()];return this.inputPrimaryParams&&a.push(this.serializeParams(this.inputPrimaryParams)),this.inputSecondary&&(a.push(this.inputSecondary.serialize()),this.inputSecondaryParams&&a.push(this.serializeParams(this.inputSecondaryParams))),a}}function fl(d){return d instanceof Number?"number":d instanceof String?"string":d instanceof Boolean?"boolean":Array.isArray(d)?"array":null===d?"null":typeof d}const _f={"to-boolean":xo,"to-color":ml,"to-number":Nn,"to-string":Bo};class gd{constructor(a,l){this.type=a,this.args=l}static parse(a,l){if(a.length<2)return l.error("Expected at least one argument.");const p=a[0],g=[];let m=Pi;if("to-array"===p){if(!Array.isArray(a[1]))return null;const b=a[1].length;if(l.expectedType){if("array"!==l.expectedType.kind)return l.error(`Expected ${l.expectedType.kind} but found array.`);m=Ss(l.expectedType.itemType,b)}else{if(!(b>0&&_d(a[1][0])))return null;m=Ss(Vr(a[1][0]),b)}for(let T=0;T4?`Invalid rbga value ${JSON.stringify(l)}: expected an array containing either three or four numeric values.`:z_(l[0],l[1],l[2],l[3]),!p))return new In(l[0]/255,l[1]/255,l[2]/255,l[3])}throw new Ca(p||`Could not parse color from value '${"string"==typeof l?l:String(JSON.stringify(l))}'`)}if("number"===this.type.kind){let l=null;for(const p of this.args){if(l=p.evaluate(a),null===l)return 0;const g=Number(l);if(!isNaN(g))return g}throw new Ca(`Could not convert ${JSON.stringify(l)} to number.`)}return"formatted"===this.type.kind?yt.fromString($l(this.args[0].evaluate(a))):"resolvedImage"===this.type.kind?Za.build($l(this.args[0].evaluate(a))):"array"===this.type.kind?this.args.map(l=>l.evaluate(a)):$l(this.args[0].evaluate(a))}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}serialize(){if("formatted"===this.type.kind)return new am([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new np(this.args[0]).serialize();const a="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild(l=>{a.push(l.serialize())}),a}}const w0=["Unknown","Point","LineString","Polygon"];class bd{constructor(a,l){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=a,this.options=l}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?w0[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}measureLight(a){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const a=this.featureDistanceData.center,l=this.featureDistanceData.scale,{x:p,y:g}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(p*l-a[0])+this.featureDistanceData.bearing[1]*(g*l-a[1])}return 0}parseColor(a){let l=this._parseColorCache[a];return l||(l=this._parseColorCache[a]=In.parse(a)),l}getConfig(a){return this.options?this.options.get(a):null}}class Ts{constructor(a,l,p,g,m){this.name=a,this.type=l,this._evaluate=p,this.args=g,this._overloadIndex=m}evaluate(a){if(!this._evaluate){const l=Ts.definitions[this.name];this._evaluate=Array.isArray(l)?l[2]:l.overloads[this._overloadIndex][1]}return this._evaluate(a,this.args)}eachChild(a){this.args.forEach(a)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(a=>a.serialize()))}static parse(a,l){const p=a[0],g=Ts.definitions[p];if(!g)return l.error(`Unknown expression "${p}". If you wanted a literal array, use ["literal", [...]].`,0);const m=Array.isArray(g)?g[0]:g.type,b=Array.isArray(g)?[[g[1],g[2]]]:g.overloads,T=[];let k=null,F=-1;for(const[S,R]of b){if(Array.isArray(S)&&S.length!==a.length-1)continue;T.push(S),F++,k=new cm(l.registry,l.path,null,l.scope,void 0,l._scope,l.options);const L=[];let A=!1;for(let P=1;PL)).map(V_).join(" | "),R=[];for(let L=1;Ll;){if(p-l>600){const k=p-l+1,F=a-l+1,S=Math.log(k),R=.5*Math.exp(2*S/3),L=.5*Math.sqrt(S*R*(k-R)/k)*(F-k/2<0?-1:1);er(d,a,Math.max(l,Math.floor(a-F*R/k+L)),Math.min(p,Math.floor(a+(k-F)*R/k+L)),g)}const m=d[a];let b=l,T=p;for(U_(d,l,a),g(d[p],m)>0&&U_(d,l,p);b0;)T--}0===g(d[l],m)?U_(d,l,T):(T++,U_(d,T,p)),T<=a&&(l=T+1),a<=T&&(p=T-1)}}function U_(d,a,l){const p=d[a];d[a]=d[l],d[l]=p}function dw(d,a){return da?1:0}function C0(d){let a=0;for(let l,p,g=0,m=d.length,b=m-1;g=a[2]||d[1]<=a[1]||d[3]>=a[3])}function Bb(d,a,l){const p=d[0]-a[0],g=d[1]-a[1],m=d[0]-l[0],b=d[1]-l[1];return p*b-m*g==0&&p*m<=0&&g*b<=0}function To(d,a,l=!1){let p=!1;for(let T=0,k=a.length;T(g=d)[1]!=(b=P)[1]>g[1]&&g[0]<(b[0]-m[0])*(g[1]-m[1])/(b[1]-m[1])+m[0]&&(p=!p)}}var g,m,b;return p}function bf(d,a,l,p){const g=p[0]-l[0],m=p[1]-l[1],b=(d[0]-l[0])*m-g*(d[1]-l[1]),T=(a[0]-l[0])*m-g*(a[1]-l[1]);return b>0&&T<0||b<0&&T>0}function Jd(d,a,l,p){return(g=[p[0]-l[0],p[1]-l[1]])[0]*(m=[a[0]-d[0],a[1]-d[1]])[1]-g[1]*m[0]!=0&&!(!bf(d,a,l,p)||!bf(l,p,d,a));var g,m}const Ya=8192;function S0(d,a){const l=(180+d[0])/360,p=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d[1]*Math.PI/360)))/360,g=Math.pow(2,a.z);return[Math.round(l*g*Ya),Math.round(p*g*Ya)]}function T0(d,a){for(let l=0;ll[2]){const g=.5*p;let m=d[0]-l[0]>g?-p:l[0]-d[0]>g?p:0;0===m&&(m=d[0]-l[2]>g?-p:l[2]-d[0]>g?p:0),d[0]+=m}H_(a,d)}function Jn(d,a,l,p){const g=Math.pow(2,p.z)*Ya,m=[p.x*Ya,p.y*Ya],b=[];if(!d)return b;for(const T of d)for(const k of T){const F=[k.x+m[0],k.y+m[1]];zi(F,a,l,g),b.push(F)}return b}function $_(d,a,l,p){const g=Math.pow(2,p.z)*Ya,m=[p.x*Ya,p.y*Ya],b=[];if(!d)return b;for(const k of d){const F=[];for(const S of k){const R=[S.x+m[0],S.y+m[1]];H_(a,R),F.push(R)}b.push(F)}if(a[2]-a[0]<=g/2){(T=a)[0]=T[1]=1/0,T[2]=T[3]=-1/0;for(const k of b)for(const F of k)zi(F,a,l,g)}var T;return b}class pi{constructor(a,l){this.type=xo,this.geojson=a,this.geometries=l}static parse(a,l){if(2!==a.length)return l.error(`'within' expression requires exactly one argument, but found ${a.length-1} instead.`);if(_d(a[1])){const p=a[1];if("FeatureCollection"===p.type)for(let g=0;gl)return mh(m,b,(l-(p-T))/T)}return a[a.length-1]}pointToSegmentDistance(a,l,p){let[g,m]=l,b=Gl(p[0]-g)*this.kx,T=(p[1]-m)*this.ky;if(0!==b||0!==T){const k=(Gl(a[0]-g)*this.kx*b+(a[1]-m)*this.ky*T)/(b*b+T*T);k>1?(g=p[0],m=p[1]):k>0&&(g+=b/this.kx*k,m+=T/this.ky*k)}return b=Gl(a[0]-g)*this.kx,T=(a[1]-m)*this.ky,Math.sqrt(b*b+T*T)}pointOnLine(a,l){let p=1/0,g=a[0][0],m=a[0][1],b=0,T=0;for(let k=0;k1?(F=a[k+1][0],S=a[k+1][1]):A>0&&(F+=R/this.kx*A,S+=L/this.ky*A)),R=Gl(l[0]-F)*this.kx,L=(l[1]-S)*this.ky;const P=R*R+L*L;Pm.index||g.index===m.index&&g.t>m.t){const F=g;g=m,m=F}const b=[g.point],T=g.index+1,k=m.index;!yf(p[T],b[0])&&T<=k&&b.push(p[T]);for(let F=T+1;F<=k;F++)b.push(p[F]);return yf(p[k],m.point)||b.push(m.point),b}lineSliceAlong(a,l,p){let g=0;const m=[];for(let b=0;ba&&0===m.length&&m.push(mh(T,k,(a-(g-F))/F)),g>=l)return m.push(mh(T,k,(l-(g-F))/F)),m;g>a&&m.push(k)}return m}bufferPoint(a,l){const p=l/this.ky,g=l/this.kx;return[a[0]-g,a[1]-p,a[0]+g,a[1]+p]}bufferBBox(a,l){const p=l/this.ky,g=l/this.kx;return[a[0]-g,a[1]-p,a[2]+g,a[3]+p]}insideBBox(a,l){return Gl(a[0]-l[0])>=0&&Gl(a[0]-l[2])<=0&&a[1]>=l[1]&&a[1]<=l[3]}}function yf(d,a){return d[0]===a[0]&&d[1]===a[1]}function mh(d,a,l){const p=Gl(a[0]-d[0]);return[d[0]+p*l,d[1]+(a[1]-d[1])*l]}function Gl(d){for(;d<-180;)d+=360;for(;d>180;)d-=360;return d}class js{constructor(a=[],l=(p,g)=>pg?1:0){if(this.data=a,this.length=this.data.length,this.compare=l,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(a){this.data.push(a),this._up(this.length++)}pop(){if(0===this.length)return;const a=this.data[0],l=this.data.pop();return--this.length>0&&(this.data[0]=l,this._down(0)),a}peek(){return this.data[0]}_up(a){const{data:l,compare:p}=this,g=l[a];for(;a>0;){const m=a-1>>1,b=l[m];if(p(g,b)>=0)break;l[a]=b,a=m}l[a]=g}_down(a){const{data:l,compare:p}=this,g=this.length>>1,m=l[a];for(;a=0)break;l[a]=l[b],a=b}l[a]=m}}var pn=8192;function Ub(d,a){return a.dist-d.dist}function _l(d){const a=[1/0,1/0,-1/0,-1/0];if(a.length!==d.length)return!1;for(let l=0;l=d[0]&&d[1]d[1])return[null,null];const l=Ds(d);if(a){if(2===l)return[d,null];const p=Math.floor(l/2);return[[d[0],d[0]+p],[d[0]+p,d[1]]]}{if(1===l)return[d,null];const p=Math.floor(l/2)-1;return[[d[0],d[0]+p],[d[0]+p+1,d[1]]]}}function cs(d,a){const l=[1/0,1/0,-1/0,-1/0];if(!ql(a,d.length))return l;for(let p=a[0];p<=a[1];++p)H_(l,d[p]);return l}function Vc(d){const a=[1/0,1/0,-1/0,-1/0];for(let l=0;la[2]&&(p=d[0]-a[2]),d[1]>a[3]&&(g=d[1]-a[3]),d[3]=p)return p;if(gf(g,m)){if(jb(d,a))return 0}else if(jb(a,d))return 0;let b=p;for(const T of d)for(let k=0,F=T.length,S=F-1;k=m)continue;const S=F.range1;if(Ds(S)<=T){if(!ql(S,d.length))return NaN;if(a){const R=Hc(d,S,l,p);if(0===(m=Math.min(m,R)))return m}else for(let R=S[0];R<=S[1];++R){const L=qo(d[R],l,p);if(0===(m=Math.min(m,L)))return m}}else{const R=Hb(S,a);if(null!==R[0]){const L=fh(cs(d,R[0]),k,p);L=b)continue;const R=S.range1,L=S.range2;if(Ds(R)<=k&&Ds(L)<=F){if(!ql(R,d.length)||!ql(L,l.length))return NaN;if(a&&p?b=Math.min(b,uw(d,R,l,L,g)):a||p?a&&!p?b=Math.min(b,xf(l,L,d,R,g)):!a&&p&&(b=Math.min(b,xf(d,R,l,L,g))):b=Math.min(b,Uc(d,R,l,L,g)),0===b)return b}else{const A=Hb(R,a),P=Hb(L,p);_h(T,b,g,d,l,A[0],P[0]),_h(T,b,g,d,l,A[0],P[1]),_h(T,b,g,d,l,A[1],P[0]),_h(T,b,g,d,l,A[1],P[1])}}return b}function ds(d,a,l,p,g=1/0){let m=g;const b=cs(d,[0,d.length-1]);for(const T of l)if(!(m!==1/0&&fh(b,cs(T,[0,T.length-1]),p)>=m)&&(m=Math.min(m,co(d,a,T,!0,p,m)),0===m))return m;return m}function tl(d,a,l,p,g=1/0){let m=g;const b=cs(d,[0,d.length-1]);for(const T of l){if(m!==1/0&&fh(b,Vc(T),p)>=m)continue;const k=ac(d,a,T,p,m);if(isNaN(k))return k;if(0===(m=Math.min(m,k)))return m}return m}function nu(d){return"Point"===d||"MultiPoint"===d||"LineString"===d||"MultiLineString"===d||"Polygon"===d||"MultiPolygon"===d}class Wl{constructor(a,l){this.type=Nn,this.geojson=a,this.geometries=l}static parse(a,l){if(2!==a.length)return l.error(`'distance' expression requires either one argument, but found ' ${a.length-1} instead.`);if(_d(a[1])){const p=a[1];if("FeatureCollection"===p.type){for(let g=0;gl&&(d=l),d}class Eu{constructor(a,l,p){this.type=a,this.key=l,this.scope=p}static parse(a,l){let p=l.expectedType;if(null==p&&(p=Nt),a.length<2||a.length>3)return l.error("Invalid number of arguments for 'config' expression.");const g=l.parse(a[1],1);if(!(g instanceof Hs))return l.error("Key name of 'config' expression must be a string literal.");if(a.length>=3){const m=l.parse(a[2],2);return m instanceof Hs?new Eu(p,$l(g.value),$l(m.value)):l.error("Scope of 'config' expression must be a string literal.")}return new Eu(p,$l(g.value))}evaluate(a){const l=[this.key,this.scope,a.scope].filter(Boolean).join("\x1f"),p=a.getConfig(l);if(!p)return null;const{type:g,value:m,values:b,minValue:T,maxValue:k,stepValue:F}=p,S=p.default.evaluate(a);let R=S;if(m){const L=a.scope;a.scope=(L||"").split("\x1f").slice(1).join("\x1f"),R=m.evaluate(a),a.scope=L}return g&&(R=$b(g,R)),void 0===R||void 0===T&&void 0===k&&void 0===F||("number"==typeof R?R=Gb(R,T,k,F):Array.isArray(R)&&(R=R.map(L=>"number"==typeof L?Gb(L,T,k,F):L))),void 0!==m&&void 0!==R&&b&&!b.includes(R)&&(R=S,g&&(R=$b(g,R))),(g&&g!==this.type||void 0!==R&&Vr(R)!==this.type)&&(R=$b(this.type.kind,R)),R}eachChild(){}outputDefined(){return!1}serialize(){const a=["config",this.key];return this.scope&&a.concat(this.key),a}}function op(d){if(d instanceof Ts&&("get"===d.name&&1===d.args.length||"feature-state"===d.name||"has"===d.name&&1===d.args.length||"properties"===d.name||"geometry-type"===d.name||"id"===d.name||/^filter-/.test(d.name))||d instanceof pi||d instanceof Wl)return!1;let a=!0;return d.eachChild(l=>{a&&!op(l)&&(a=!1)}),a}function gh(d){if(d instanceof Ts&&"feature-state"===d.name)return!1;let a=!0;return d.eachChild(l=>{a&&!gh(l)&&(a=!1)}),a}function W_(d){if(d instanceof Eu)return new Set([d.key]);let a=new Set;return d.eachChild(l=>{a=new Set([...a,...W_(l)])}),a}function Mu(d,a){if(d instanceof Ts&&a.indexOf(d.name)>=0)return!1;let l=!0;return d.eachChild(p=>{l&&!Mu(p,a)&&(l=!1)}),l}class rp{constructor(a,l){this.type=l.type,this.name=a,this.boundExpression=l}static parse(a,l){if(2!==a.length||"string"!=typeof a[1])return l.error("'var' expression requires exactly one string literal argument.");const p=a[1];return l.scope.has(p)?new rp(p,l.scope.get(p)):l.error(`Unknown variable "${p}". Make sure "${p}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(a){return this.boundExpression.evaluate(a)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class bh{constructor(a,l=[],p,g=new el,m=[],b,T){this.registry=a,this.path=l,this.key=l.map(k=>"string"==typeof k?`['${k}']`:`[${k}]`).join(""),this.scope=g,this.errors=m,this.expectedType=p,this._scope=b,this.options=T}parse(a,l,p,g,m={}){return l||p?this.concat(l,null,p,g)._parse(a,m):this._parse(a,m)}parseObjectValue(a,l,p,g,m,b={}){return this.concat(l,p,g,m)._parse(a,b)}_parse(a,l){function p(g,m,b){return"assert"===b?new Qd(m,[g]):"coerce"===b?new gd(m,[g]):g}if(null!==a&&"string"!=typeof a&&"boolean"!=typeof a&&"number"!=typeof a||(a=["literal",a]),Array.isArray(a)){if(0===a.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const g="string"==typeof a[0]?this.registry[a[0]]:void 0;if(g){let m=g.parse(a,this);if(!m)return null;if(this.expectedType){const b=this.expectedType,T=m.type;if("string"!==b.kind&&"number"!==b.kind&&"boolean"!==b.kind&&"object"!==b.kind&&"array"!==b.kind||"value"!==T.kind)if("color"!==b.kind&&"formatted"!==b.kind&&"resolvedImage"!==b.kind||"value"!==T.kind&&"string"!==T.kind){if(this.checkSubtype(b,T))return null}else m=p(m,b,l.typeAnnotation||"coerce");else m=p(m,b,l.typeAnnotation||"assert")}if(!(m instanceof Hs)&&"resolvedImage"!==m.type.kind&&Cf(m)){const b=new bd(this._scope,this.options);try{m=new Hs(m.type,m.evaluate(b))}catch(T){return this.error(T.message),null}}return m}return gd.parse(["to-array",a],this)}return this.error(void 0===a?"'undefined' value invalid. Use null instead.":"object"==typeof a?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof a} instead.`)}concat(a,l,p,g){let m="number"==typeof a?this.path.concat(a):this.path;m="string"==typeof l?m.concat(l):m;const b=g?this.scope.concat(g):this.scope;return new bh(this.registry,m,p||null,b,this.errors,this._scope,this.options)}error(a,...l){const p=`${this.key}${l.map(g=>`[${g}]`).join("")}`;this.errors.push(new Zi(p,a))}checkSubtype(a,l){const p=Us(a,l);return p&&this.error(p),p}}var cm=bh;function Cf(d){if(d instanceof rp)return Cf(d.boundExpression);if(d instanceof Ts&&"error"===d.name||d instanceof _o||d instanceof pi||d instanceof Wl||d instanceof Eu)return!1;const a=d instanceof gd||d instanceof Qd;let l=!0;return d.eachChild(p=>{l=a?l&&Cf(p):l&&p instanceof Hs}),!!l&&op(d)&&Mu(d,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function yd(d,a){const l=d.length-1;let p,g,m=0,b=l,T=0;for(;m<=b;)if(T=Math.floor((m+b)/2),p=d[T],g=d[T+1],p<=a){if(T===l||aa))throw new Ca("Input is not a number.");b=T-1}return 0}class dm{constructor(a,l,p){this.type=a,this.input=l,this.labels=[],this.outputs=[];for(const[g,m]of p)this.labels.push(g),this.outputs.push(m)}static parse(a,l){if(a.length-1<4)return l.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if((a.length-1)%2!=0)return l.error("Expected an even number of arguments.");const p=l.parse(a[1],1,Nn);if(!p)return null;const g=[];let m=null;l.expectedType&&"value"!==l.expectedType.kind&&(m=l.expectedType);for(let b=1;b=T)return l.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',F);const R=l.parse(k,S,m);if(!R)return null;m=m||R.type,g.push([T,R])}return new dm(m,p,g)}evaluate(a){const l=this.labels,p=this.outputs;if(1===l.length)return p[0].evaluate(a);const g=this.input.evaluate(a);if(g<=l[0])return p[0].evaluate(a);const m=l.length;return g>=l[m-1]?p[m-1].evaluate(a):p[yd(l,g)].evaluate(a)}eachChild(a){a(this.input);for(const l of this.outputs)a(l)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}serialize(){const a=["step",this.input.serialize()];for(let l=0;l0&&a.push(this.labels[l]),a.push(this.outputs[l].serialize());return a}}const qb=4/29,yh=6/29,Sf=3*yh*yh,us=yh*yh*yh,ap=Math.PI/180,rr=180/Math.PI;function Wb(d){return d>us?Math.pow(d,1/3):d/Sf+qb}function Zb(d){return d>yh?d*d*d:Sf*(d-qb)}function Z_(d){return 255*(d<=.0031308?12.92*d:1.055*Math.pow(d,1/2.4)-.055)}function sp(d){return(d/=255)<=.04045?d/12.92:Math.pow((d+.055)/1.055,2.4)}function lp(d){const a=sp(d.r),l=sp(d.g),p=sp(d.b),g=Wb((.4124564*a+.3575761*l+.1804375*p)/.95047),m=Wb((.2126729*a+.7151522*l+.072175*p)/1);return{l:116*m-16,a:500*(g-m),b:200*(m-Wb((.0193339*a+.119192*l+.9503041*p)/1.08883)),alpha:d.a}}function I0(d){let a=(d.l+16)/116,l=isNaN(d.a)?a:a+d.a/500,p=isNaN(d.b)?a:a-d.b/200;return a=1*Zb(a),l=.95047*Zb(l),p=1.08883*Zb(p),new In(Z_(3.2404542*l-1.5371385*a-.4985314*p),Z_(-.969266*l+1.8760108*a+.041556*p),Z_(.0556434*l-.2040259*a+1.0572252*p),d.alpha)}function hw(d,a,l){const p=a-d;return d+l*(p>180||p<-180?p-360*Math.round(p/360):p)}const Tf={forward:lp,reverse:I0,interpolate:function(d,a,l){return{l:Un(d.l,a.l,l),a:Un(d.a,a.a,l),b:Un(d.b,a.b,l),alpha:Un(d.alpha,a.alpha,l)}}},cp={forward:function(d){const{l:a,a:l,b:p}=lp(d),g=Math.atan2(p,l)*rr;return{h:g<0?g+360:g,c:Math.sqrt(l*l+p*p),l:a,alpha:d.a}},reverse:function(d){const a=d.h*ap,l=d.c;return I0({l:d.l,a:Math.cos(a)*l,b:Math.sin(a)*l,alpha:d.alpha})},interpolate:function(d,a,l){return{h:hw(d.h,a.h,l),c:Un(d.c,a.c,l),l:Un(d.l,a.l,l),alpha:Un(d.alpha,a.alpha,l)}}};var fc=Object.freeze({__proto__:null,hcl:cp,lab:Tf});class gl{constructor(a,l,p,g,m,b){this.type=a,this.operator=l,this.interpolation=p,this.input=g,this.dynamicStops=m,this.labels=[],this.outputs=[];for(const[T,k]of b)this.labels.push(T),this.outputs.push(k)}static interpolationFactor(a,l,p,g){let m=0;if("exponential"===a.name)m=vh(l,a.base,p,g);else if("linear"===a.name)m=vh(l,1,p,g);else if("cubic-bezier"===a.name){const b=a.controlPoints;m=new yr(b[0],b[1],b[2],b[3]).solve(vh(l,1,p,g))}return m}static parse(a,l){let[p,g,m,...b]=a;if(!Array.isArray(g)||0===g.length)return l.error("Expected an interpolation type expression.",1);if("linear"===g[0])g={name:"linear"};else if("exponential"===g[0]){const F=g[1];if("number"!=typeof F)return l.error("Exponential interpolation requires a numeric base.",1,1);g={name:"exponential",base:F}}else{if("cubic-bezier"!==g[0])return l.error(`Unknown interpolation type ${String(g[0])}`,1,0);{const F=g.slice(1);if(4!==F.length||F.some(S=>"number"!=typeof S||S<0||S>1))return l.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);g={name:"cubic-bezier",controlPoints:F}}}if(a.length-1<3)return l.error(`Expected at least 3 arguments, but found only ${a.length-1}.`);if(a.length-1>3&&(a.length-1)%2!=0)return l.error("Expected an even number of arguments.");if(m=l.parse(m,2,Nn),!m)return null;const T=[];let k=null;if("interpolate-hcl"===p||"interpolate-lab"===p?k=ml:l.expectedType&&"value"!==l.expectedType.kind&&(k=l.expectedType),a.length-1==3){const F=l.parse(b[0],3,Nt);return F?new gl(k,p,g,m,F,T):null}for(let F=0;F=S)return l.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',L);const P=l.parse(R,A,k);if(!P)return null;k=k||P.type,T.push([S,P])}return"number"===k.kind||"color"===k.kind||"array"===k.kind&&"number"===k.itemType.kind&&"number"==typeof k.N?new gl(k,p,g,m,null,T):l.error(`Type ${Br(k)} is not interpolatable.`)}evaluate(a){let l=this.labels,p=this.outputs;if(this.dynamicStops){const S=this.dynamicStops.evaluate(a);if(S.length%2!=0)throw new Ca("Expected an even number of arguments.");l=[],p=[];for(let R=0;R=L)throw new Ca('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.');l.push(L),p.push(A)}if(0===l.length)throw new Ca("Expected at least one input/output pair.")}if(1===l.length)return p[0].evaluate(a);const g=this.input.evaluate(a);if(g<=l[0])return p[0].evaluate(a);const m=l.length;if(g>=l[m-1])return p[m-1].evaluate(a);const b=yd(l,g),T=gl.interpolationFactor(this.interpolation,g,l[b],l[b+1]),k=p[b].evaluate(a),F=p[b+1].evaluate(a);return"interpolate"===this.operator?ls[this.type.kind.toLowerCase()](k,F,T):"interpolate-hcl"===this.operator?cp.reverse(cp.interpolate(cp.forward(k),cp.forward(F),T)):Tf.reverse(Tf.interpolate(Tf.forward(k),Tf.forward(F),T))}eachChild(a){a(this.input);for(const l of this.outputs)a(l)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}serialize(){let a;a="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const l=[this.operator,a,this.input.serialize()];if(this.dynamicStops)l.push(this.dynamicStops.serialize());else for(let p=0;pUs(g,T.type));return new ku(b?Nt:p,m)}evaluate(a){let l,p=null,g=0;for(const m of this.args){if(g++,p=m.evaluate(a),p&&p instanceof Za&&!p.available&&(l||(l=p),p=null,g===this.args.length))return l;if(null!==p)break}return p}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}serialize(){const a=["coalesce"];return this.eachChild(l=>{a.push(l.serialize())}),a}}class Y_{constructor(a,l){this.type=l.type,this.bindings=[].concat(a),this.result=l}evaluate(a){return this.result.evaluate(a)}eachChild(a){for(const l of this.bindings)a(l[1]);a(this.result)}static parse(a,l){if(a.length<4)return l.error(`Expected at least 3 arguments, but found ${a.length-1} instead.`);const p=[];for(let m=1;mp.length-1)throw new Ca(`Array index out of bounds: ${l} > ${p.length-1}.`);if(l===Math.floor(l))return p[l];const g=Math.floor(l),m=Math.ceil(l),b=p[g],T=p[m];if("number"!=typeof b||"number"!=typeof T)throw new Ca(`Cannot interpolate between non-number values at index ${l}.`);const k=l-g;return b*(1-k)+T*k}eachChild(a){a(this.index),a(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Xa{constructor(a,l){this.type=xo,this.needle=a,this.haystack=l}static parse(a,l){if(3!==a.length)return l.error(`Expected 2 arguments, but found ${a.length-1} instead.`);const p=l.parse(a[1],1,Nt),g=l.parse(a[2],2,Nt);return p&&g?ep(p.type,[xo,Bo,Nn,Pi,Nt])?new Xa(p,g):l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Br(p.type)} instead`):null}evaluate(a){const l=this.needle.evaluate(a),p=this.haystack.evaluate(a);if(null==p)return!1;if(!tp(l,["boolean","string","number","null"]))throw new Ca(`Expected first argument to be of type boolean, string, number or null, but found ${Br(Vr(l))} instead.`);if(!tp(p,["string","array"]))throw new Ca(`Expected second argument to be of type array or string, but found ${Br(Vr(p))} instead.`);return p.indexOf(l)>=0}eachChild(a){a(this.needle),a(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Df{constructor(a,l,p){this.type=Nn,this.needle=a,this.haystack=l,this.fromIndex=p}static parse(a,l){if(a.length<=2||a.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);const p=l.parse(a[1],1,Nt),g=l.parse(a[2],2,Nt);if(!p||!g)return null;if(!ep(p.type,[xo,Bo,Nn,Pi,Nt]))return l.error(`Expected first argument to be of type boolean, string, number or null, but found ${Br(p.type)} instead`);if(4===a.length){const m=l.parse(a[3],3,Nn);return m?new Df(p,g,m):null}return new Df(p,g)}evaluate(a){const l=this.needle.evaluate(a),p=this.haystack.evaluate(a);if(!tp(l,["boolean","string","number","null"]))throw new Ca(`Expected first argument to be of type boolean, string, number or null, but found ${Br(Vr(l))} instead.`);if(!tp(p,["string","array"]))throw new Ca(`Expected second argument to be of type array or string, but found ${Br(Vr(p))} instead.`);if(this.fromIndex){const g=this.fromIndex.evaluate(a);return p.indexOf(l,g)}return p.indexOf(l)}eachChild(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const a=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),a]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Xb{constructor(a,l,p,g,m,b){this.inputType=a,this.type=l,this.input=p,this.cases=g,this.outputs=m,this.otherwise=b}static parse(a,l){if(a.length<5)return l.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if(a.length%2!=1)return l.error("Expected an even number of arguments.");let p,g;l.expectedType&&"value"!==l.expectedType.kind&&(g=l.expectedType);const m={},b=[];for(let F=2;FNumber.MAX_SAFE_INTEGER)return L.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof P&&Math.floor(P)!==P)return L.error("Numeric branch labels must be integer values.");if(p){if(L.checkSubtype(p,Vr(P)))return null}else p=Vr(P);if(void 0!==m[String(P)])return L.error("Branch labels must be unique.");m[String(P)]=b.length}const A=l.parse(R,F,g);if(!A)return null;g=g||A.type,b.push(A)}const T=l.parse(a[1],1,Nt);if(!T)return null;const k=l.parse(a[a.length-1],a.length-1,g);return k?"value"!==T.type.kind&&l.concat(1).checkSubtype(p,T.type)?null:new Xb(p,g,T,m,b,k):null}evaluate(a){const l=this.input.evaluate(a);return(Vr(l)===this.inputType&&this.outputs[this.cases[l]]||this.otherwise).evaluate(a)}eachChild(a){a(this.input),this.outputs.forEach(a),a(this.otherwise)}outputDefined(){return this.outputs.every(a=>a.outputDefined())&&this.otherwise.outputDefined()}serialize(){const a=["match",this.input.serialize()],l=Object.keys(this.cases).sort(),p=[],g={};for(const b of l){const T=g[this.cases[b]];void 0===T?(g[this.cases[b]]=p.length,p.push([this.cases[b],[b]])):p[T][1].push(b)}const m=b=>"number"===this.inputType.kind?Number(b):b;for(const[b,T]of p)a.push(1===T.length?m(T[0]):T.map(m)),a.push(this.outputs[b].serialize());return a.push(this.otherwise.serialize()),a}}class dp{constructor(a,l,p){this.type=a,this.branches=l,this.otherwise=p}static parse(a,l){if(a.length<4)return l.error(`Expected at least 3 arguments, but found only ${a.length-1}.`);if(a.length%2!=0)return l.error("Expected an odd number of arguments.");let p;l.expectedType&&"value"!==l.expectedType.kind&&(p=l.expectedType);const g=[];for(let b=1;bl.outputDefined())&&this.otherwise.outputDefined()}serialize(){const a=["case"];return this.eachChild(l=>{a.push(l.serialize())}),a}}class X_{constructor(a,l,p,g){this.type=a,this.input=l,this.beginIndex=p,this.endIndex=g}static parse(a,l){if(a.length<=2||a.length>=5)return l.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);const p=l.parse(a[1],1,Nt),g=l.parse(a[2],2,Nn);if(!p||!g)return null;if(!ep(p.type,[Ss(Nt),Bo,Nt]))return l.error(`Expected first argument to be of type array or string, but found ${Br(p.type)} instead`);if(4===a.length){const m=l.parse(a[3],3,Nn);return m?new X_(p.type,p,g,m):null}return new X_(p.type,p,g)}evaluate(a){const l=this.input.evaluate(a),p=this.beginIndex.evaluate(a);if(!tp(l,["string","array"]))throw new Ca(`Expected first argument to be of type array or string, but found ${Br(Vr(l))} instead.`);if(this.endIndex){const g=this.endIndex.evaluate(a);return l.slice(p,g)}return l.slice(p)}eachChild(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const a=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),a]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function E0(d,a){return"=="===d||"!="===d?"boolean"===a.kind||"string"===a.kind||"number"===a.kind||"null"===a.kind||"value"===a.kind:"string"===a.kind||"number"===a.kind||"value"===a.kind}function M0(d,a,l,p){return 0===p.compare(a,l)}function um(d,a,l){const p="=="!==d&&"!="!==d;return class u9{constructor(m,b,T){this.type=xo,this.lhs=m,this.rhs=b,this.collator=T,this.hasUntypedArgument="value"===m.type.kind||"value"===b.type.kind}static parse(m,b){if(3!==m.length&&4!==m.length)return b.error("Expected two or three arguments.");const T=m[0];let k=b.parse(m[1],1,Nt);if(!k)return null;if(!E0(T,k.type))return b.concat(1).error(`"${T}" comparisons are not supported for type '${Br(k.type)}'.`);let F=b.parse(m[2],2,Nt);if(!F)return null;if(!E0(T,F.type))return b.concat(2).error(`"${T}" comparisons are not supported for type '${Br(F.type)}'.`);if(k.type.kind!==F.type.kind&&"value"!==k.type.kind&&"value"!==F.type.kind)return b.error(`Cannot compare types '${Br(k.type)}' and '${Br(F.type)}'.`);p&&("value"===k.type.kind&&"value"!==F.type.kind?k=new Qd(F.type,[k]):"value"!==k.type.kind&&"value"===F.type.kind&&(F=new Qd(k.type,[F])));let S=null;if(4===m.length){if("string"!==k.type.kind&&"string"!==F.type.kind&&"value"!==k.type.kind&&"value"!==F.type.kind)return b.error("Cannot use collator to compare non-string types.");if(S=b.parse(m[3],3,N_),!S)return null}return new u9(k,F,S)}evaluate(m){const b=this.lhs.evaluate(m),T=this.rhs.evaluate(m);if(p&&this.hasUntypedArgument){const k=Vr(b),F=Vr(T);if(k.kind!==F.kind||"string"!==k.kind&&"number"!==k.kind)throw new Ca(`Expected arguments for "${d}" to be (string, string) or (number, number), but found (${k.kind}, ${F.kind}) instead.`)}if(this.collator&&!p&&this.hasUntypedArgument){const k=Vr(b),F=Vr(T);if("string"!==k.kind||"string"!==F.kind)return a(m,b,T)}return this.collator?l(m,b,T,this.collator.evaluate(m)):a(m,b,T)}eachChild(m){m(this.lhs),m(this.rhs),this.collator&&m(this.collator)}outputDefined(){return!0}serialize(){const m=[d];return this.eachChild(b=>{m.push(b.serialize())}),m}}}const pw=um("==",function(d,a,l){return a===l},M0),mw=um("!=",function(d,a,l){return a!==l},function(d,a,l,p){return!M0(0,a,l,p)}),Kb=um("<",function(d,a,l){return a",function(d,a,l){return a>l},function(d,a,l,p){return p.compare(a,l)>0}),Dr=um("<=",function(d,a,l){return a<=l},function(d,a,l,p){return p.compare(a,l)<=0}),Ln=um(">=",function(d,a,l){return a>=l},function(d,a,l,p){return p.compare(a,l)>=0});class Yi{constructor(a,l,p,g,m,b){this.type=Bo,this.number=a,this.locale=l,this.currency=p,this.unit=g,this.minFractionDigits=m,this.maxFractionDigits=b}static parse(a,l){if(3!==a.length)return l.error("Expected two arguments.");const p=l.parse(a[1],1,Nn);if(!p)return null;const g=a[2];if("object"!=typeof g||Array.isArray(g))return l.error("NumberFormat options argument must be an object.");let m=null;if(g.locale&&(m=l.parseObjectValue(g.locale,2,"locale",Bo),!m))return null;let b=null;if(g.currency&&(b=l.parseObjectValue(g.currency,2,"currency",Bo),!b))return null;let T=null;if(g.unit&&(T=l.parseObjectValue(g.unit,2,"unit",Bo),!T))return null;let k=null;if(g["min-fraction-digits"]&&(k=l.parseObjectValue(g["min-fraction-digits"],2,"min-fraction-digits",Nn),!k))return null;let F=null;return g["max-fraction-digits"]&&(F=l.parseObjectValue(g["max-fraction-digits"],2,"max-fraction-digits",Nn),!F)?null:new Yi(p,m,b,T,k,F)}evaluate(a){return new Intl.NumberFormat(this.locale?this.locale.evaluate(a):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(a):void 0,unit:this.unit?this.unit.evaluate(a):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(a):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(a):void 0}).format(this.number.evaluate(a))}eachChild(a){a(this.number),this.locale&&a(this.locale),this.currency&&a(this.currency),this.unit&&a(this.unit),this.minFractionDigits&&a(this.minFractionDigits),this.maxFractionDigits&&a(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const a={};return this.locale&&(a.locale=this.locale.serialize()),this.currency&&(a.currency=this.currency.serialize()),this.unit&&(a.unit=this.unit.serialize()),this.minFractionDigits&&(a["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(a["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),a]}}class ia{constructor(a){this.type=Nn,this.input=a}static parse(a,l){if(2!==a.length)return l.error(`Expected 1 argument, but found ${a.length-1} instead.`);const p=l.parse(a[1],1);return p?"array"!==p.type.kind&&"string"!==p.type.kind&&"value"!==p.type.kind?l.error(`Expected argument of type string or array, but found ${Br(p.type)} instead.`):new ia(p):null}evaluate(a){const l=this.input.evaluate(a);if("string"==typeof l||Array.isArray(l))return l.length;throw new Ca(`Expected value to be of type string or array, but found ${Br(Vr(l))} instead.`)}eachChild(a){a(this.input)}outputDefined(){return!1}serialize(){const a=["length"];return this.eachChild(l=>{a.push(l.serialize())}),a}}function Is(d){return function(){d=1831565813+(d|=0)|0;let a=Math.imul(d^d>>>15,1|d);return a=a+Math.imul(a^a>>>7,61|a)^a,((a^a>>>14)>>>0)/4294967296}}const Sa={"==":pw,"!=":mw,">":K_,"<":Kb,">=":Ln,"<=":Dr,array:Qd,at:Yb,boolean:Qd,case:dp,coalesce:ku,collator:_o,format:am,image:np,in:Xa,"index-of":Df,interpolate:gl,"interpolate-hcl":gl,"interpolate-lab":gl,length:ia,let:Y_,literal:Hs,match:Xb,number:Qd,"number-format":Yi,object:Qd,slice:X_,step:dm,string:Qd,"to-boolean":gd,"to-color":gd,"to-number":gd,"to-string":gd,var:rp,within:pi,distance:Wl,config:Eu};function nl(d,[a,l,p,g]){a=a.evaluate(d),l=l.evaluate(d),p=p.evaluate(d);const m=g?g.evaluate(d):1,b=z_(a,l,p,m);if(b)throw new Ca(b);return new In(a/255*m,l/255*m,p/255*m,m)}function up(d,[a,l,p,g]){a=a.evaluate(d),l=l.evaluate(d),p=p.evaluate(d);const m=g?g.evaluate(d):1,b=(S=l,R=p,L=m,"number"==typeof(F=a)&&F>=0&&F<=360?"number"==typeof S&&S>=0&&S<=100&&"number"==typeof R&&R>=0&&R<=100?void 0===L||"number"==typeof L&&L>=0&&L<=1?null:`Invalid hsla value [${[F,S,R,L].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof L?[F,S,R,L]:[F,S,R]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof L?[F,S,R,L]:[F,S,R]).join(", ")}]: 'h' must be between 0 and 360.`);var F,S,R,L;if(b)throw new Ca(b);const T=`hsla(${a}, ${l}%, ${p}%, ${m})`,k=In.parse(T);if(!k)throw new Ca(`Failed to parse HSLA color: ${T}`);return k}function mr(d,a){return d in a}function oa(d,a){const l=a[d];return void 0===l?null:l}function il(d){return{type:d}}function Qi(d){return{result:"success",value:d}}function Es(d){return{result:"error",value:d}}function hp(d,a){return!!d&&!!d.parameters&&d.parameters.indexOf(a)>-1}function iu(d){return"data-driven"===d["property-type"]}function ra(d){return hp(d.expression,"measure-light")}function ou(d){return hp(d.expression,"zoom")}function ru(d){return!!d.expression&&d.expression.interpolated}function vd(d){return"object"==typeof d&&null!==d&&!Array.isArray(d)}function If(d){return d}function Q_(d,a){const l="color"===a.type,p=d.stops&&"object"==typeof d.stops[0][0],g=p||!(p||void 0!==d.property),m=d.type||(ru(a)?"exponential":"interval");if(l&&((d=ic({},d)).stops&&(d.stops=d.stops.map(F=>[F[0],In.parse(F[1])])),d.default=In.parse(d.default?d.default:a.default)),d.colorSpace&&"rgb"!==d.colorSpace&&!fc[d.colorSpace])throw new Error(`Unknown color space: ${d.colorSpace}`);let b,T,k;if("exponential"===m)b=sc;else if("interval"===m)b=pp;else if("categorical"===m){b=J_,T=Object.create(null);for(const F of d.stops)T[F[0]]=F[1];k=typeof d.stops[0][0]}else{if("identity"!==m)throw new Error(`Unknown function type "${m}"`);b=mp}if(p){const F={},S=[];for(let A=0;AA[0]),evaluate:({zoom:A},P)=>sc({stops:R,base:d.base},a,A).evaluate(A,P)}}if(g){const F="exponential"===m?{name:"exponential",base:void 0!==d.base?d.base:1}:null;return{kind:"camera",interpolationType:F,interpolationFactor:gl.interpolationFactor.bind(void 0,F),zoomStops:d.stops.map(S=>S[0]),evaluate:({zoom:S})=>b(d,a,S,T,k)}}return{kind:"source",evaluate(F,S){const R=S&&S.properties?S.properties[d.property]:void 0;return void 0===R?_c(d.default,a.default):b(d,a,R,T,k)}}}function _c(d,a,l){return void 0!==d?d:void 0!==a?a:void 0!==l?l:void 0}function J_(d,a,l,p,g){return _c(typeof l===g?p[l]:void 0,d.default,a.default)}function pp(d,a,l){if("number"!==fl(l))return _c(d.default,a.default);const p=d.stops.length;if(1===p||l<=d.stops[0][0])return d.stops[0][1];if(l>=d.stops[p-1][0])return d.stops[p-1][1];const g=yd(d.stops.map(m=>m[0]),l);return d.stops[g][1]}function sc(d,a,l){const p=void 0!==d.base?d.base:1;if("number"!==fl(l))return _c(d.default,a.default);const g=d.stops.length;if(1===g||l<=d.stops[0][0])return d.stops[0][1];if(l>=d.stops[g-1][0])return d.stops[g-1][1];const m=yd(d.stops.map(S=>S[0]),l),b=function(S,R,L,A){const P=A-L,z=S-L;return 0===P?0:1===R?z/P:(Math.pow(R,z)-1)/(Math.pow(R,P)-1)}(l,p,d.stops[m][0],d.stops[m+1][0]),T=d.stops[m][1],k=d.stops[m+1][1];let F=ls[a.type]||If;if(d.colorSpace&&"rgb"!==d.colorSpace){const S=fc[d.colorSpace];F=(R,L)=>S.reverse(S.interpolate(S.forward(R),S.forward(L),b))}return"function"==typeof T.evaluate?{evaluate(...S){const R=T.evaluate.apply(void 0,S),L=k.evaluate.apply(void 0,S);if(void 0!==R&&void 0!==L)return F(R,L,b)}}:F(T,k,b)}function mp(d,a,l){return"color"===a.type?l=In.parse(l):"formatted"===a.type?l=yt.fromString(l.toString()):"resolvedImage"===a.type?l=Za.build(l.toString()):fl(l)===a.type||"enum"===a.type&&a.values[l]||(l=void 0),_c(l,d.default,a.default)}Ts.register(Sa,{error:[{kind:"error"},[Bo],(d,[a])=>{throw new Ca(a.evaluate(d))}],typeof:[Bo,[Nt],(d,[a])=>Br(Vr(a.evaluate(d)))],"to-rgba":[Ss(Nn,4),[ml],(d,[a])=>a.evaluate(d).toRenderColor(null).toArray()],"to-hsla":[Ss(Nn,4),[ml],(d,[a])=>a.evaluate(d).toRenderColor(null).toHslaArray()],rgb:[ml,[Nn,Nn,Nn],nl],rgba:[ml,[Nn,Nn,Nn,Nn],nl],hsl:[ml,[Nn,Nn,Nn],up],hsla:[ml,[Nn,Nn,Nn,Nn],up],has:{type:xo,overloads:[[[Bo],(d,[a])=>mr(a.evaluate(d),d.properties())],[[Bo,uh],(d,[a,l])=>mr(a.evaluate(d),l.evaluate(d))]]},get:{type:Nt,overloads:[[[Bo],(d,[a])=>oa(a.evaluate(d),d.properties())],[[Bo,uh],(d,[a,l])=>oa(a.evaluate(d),l.evaluate(d))]]},"feature-state":[Nt,[Bo],(d,[a])=>oa(a.evaluate(d),d.featureState||{})],properties:[uh,[],d=>d.properties()],"geometry-type":[Bo,[],d=>d.geometryType()],id:[Nt,[],d=>d.id()],zoom:[Nn,[],d=>d.globals.zoom],pitch:[Nn,[],d=>d.globals.pitch||0],"distance-from-center":[Nn,[],d=>d.distanceFromCenter()],"measure-light":[Nn,[Bo],(d,[a])=>d.measureLight(a.evaluate(d))],"heatmap-density":[Nn,[],d=>d.globals.heatmapDensity||0],"line-progress":[Nn,[],d=>d.globals.lineProgress||0],"raster-value":[Nn,[],d=>d.globals.rasterValue||0],"raster-particle-speed":[Nn,[],d=>d.globals.rasterParticleSpeed||0],"sky-radial-progress":[Nn,[],d=>d.globals.skyRadialProgress||0],accumulated:[Nt,[],d=>void 0===d.globals.accumulated?null:d.globals.accumulated],"+":[Nn,il(Nn),(d,a)=>{let l=0;for(const p of a)l+=p.evaluate(d);return l}],"*":[Nn,il(Nn),(d,a)=>{let l=1;for(const p of a)l*=p.evaluate(d);return l}],"-":{type:Nn,overloads:[[[Nn,Nn],(d,[a,l])=>a.evaluate(d)-l.evaluate(d)],[[Nn],(d,[a])=>-a.evaluate(d)]]},"/":[Nn,[Nn,Nn],(d,[a,l])=>a.evaluate(d)/l.evaluate(d)],"%":[Nn,[Nn,Nn],(d,[a,l])=>a.evaluate(d)%l.evaluate(d)],ln2:[Nn,[],()=>Math.LN2],pi:[Nn,[],()=>Math.PI],e:[Nn,[],()=>Math.E],"^":[Nn,[Nn,Nn],(d,[a,l])=>Math.pow(a.evaluate(d),l.evaluate(d))],sqrt:[Nn,[Nn],(d,[a])=>Math.sqrt(a.evaluate(d))],log10:[Nn,[Nn],(d,[a])=>Math.log(a.evaluate(d))/Math.LN10],ln:[Nn,[Nn],(d,[a])=>Math.log(a.evaluate(d))],log2:[Nn,[Nn],(d,[a])=>Math.log(a.evaluate(d))/Math.LN2],sin:[Nn,[Nn],(d,[a])=>Math.sin(a.evaluate(d))],cos:[Nn,[Nn],(d,[a])=>Math.cos(a.evaluate(d))],tan:[Nn,[Nn],(d,[a])=>Math.tan(a.evaluate(d))],asin:[Nn,[Nn],(d,[a])=>Math.asin(a.evaluate(d))],acos:[Nn,[Nn],(d,[a])=>Math.acos(a.evaluate(d))],atan:[Nn,[Nn],(d,[a])=>Math.atan(a.evaluate(d))],min:[Nn,il(Nn),(d,a)=>Math.min(...a.map(l=>l.evaluate(d)))],max:[Nn,il(Nn),(d,a)=>Math.max(...a.map(l=>l.evaluate(d)))],abs:[Nn,[Nn],(d,[a])=>Math.abs(a.evaluate(d))],round:[Nn,[Nn],(d,[a])=>{const l=a.evaluate(d);return l<0?-Math.round(-l):Math.round(l)}],floor:[Nn,[Nn],(d,[a])=>Math.floor(a.evaluate(d))],ceil:[Nn,[Nn],(d,[a])=>Math.ceil(a.evaluate(d))],"filter-==":[xo,[Bo,Nt],(d,[a,l])=>d.properties()[a.value]===l.value],"filter-id-==":[xo,[Nt],(d,[a])=>d.id()===a.value],"filter-type-==":[xo,[Bo],(d,[a])=>d.geometryType()===a.value],"filter-<":[xo,[Bo,Nt],(d,[a,l])=>{const p=d.properties()[a.value],g=l.value;return typeof p==typeof g&&p{const l=d.id(),p=a.value;return typeof l==typeof p&&l":[xo,[Bo,Nt],(d,[a,l])=>{const p=d.properties()[a.value],g=l.value;return typeof p==typeof g&&p>g}],"filter-id->":[xo,[Nt],(d,[a])=>{const l=d.id(),p=a.value;return typeof l==typeof p&&l>p}],"filter-<=":[xo,[Bo,Nt],(d,[a,l])=>{const p=d.properties()[a.value],g=l.value;return typeof p==typeof g&&p<=g}],"filter-id-<=":[xo,[Nt],(d,[a])=>{const l=d.id(),p=a.value;return typeof l==typeof p&&l<=p}],"filter->=":[xo,[Bo,Nt],(d,[a,l])=>{const p=d.properties()[a.value],g=l.value;return typeof p==typeof g&&p>=g}],"filter-id->=":[xo,[Nt],(d,[a])=>{const l=d.id(),p=a.value;return typeof l==typeof p&&l>=p}],"filter-has":[xo,[Nt],(d,[a])=>a.value in d.properties()],"filter-has-id":[xo,[],d=>null!==d.id()&&void 0!==d.id()],"filter-type-in":[xo,[Ss(Bo)],(d,[a])=>a.value.indexOf(d.geometryType())>=0],"filter-id-in":[xo,[Ss(Nt)],(d,[a])=>a.value.indexOf(d.id())>=0],"filter-in-small":[xo,[Bo,Ss(Nt)],(d,[a,l])=>l.value.indexOf(d.properties()[a.value])>=0],"filter-in-large":[xo,[Bo,Ss(Nt)],(d,[a,l])=>function(p,g,m,b){for(;m<=b;){const T=m+b>>1;if(g[T]===p)return!0;g[T]>p?b=T-1:m=T+1}return!1}(d.properties()[a.value],l.value,0,l.value.length-1)],all:{type:xo,overloads:[[[xo,xo],(d,[a,l])=>a.evaluate(d)&&l.evaluate(d)],[il(xo),(d,a)=>{for(const l of a)if(!l.evaluate(d))return!1;return!0}]]},any:{type:xo,overloads:[[[xo,xo],(d,[a,l])=>a.evaluate(d)||l.evaluate(d)],[il(xo),(d,a)=>{for(const l of a)if(l.evaluate(d))return!0;return!1}]]},"!":[xo,[xo],(d,[a])=>!a.evaluate(d)],"is-supported-script":[xo,[Bo],(d,[a])=>{const l=d.globals&&d.globals.isSupportedScript;return!l||l(a.evaluate(d))}],upcase:[Bo,[Bo],(d,[a])=>a.evaluate(d).toUpperCase()],downcase:[Bo,[Bo],(d,[a])=>a.evaluate(d).toLowerCase()],concat:[Bo,il(Nt),(d,a)=>a.map(l=>$l(l.evaluate(d))).join("")],"resolved-locale":[Bo,[N_],(d,[a])=>a.evaluate(d).resolvedLocale()],random:[Nn,[Nn,Nn,Nt],(d,a)=>{const[l,p,g]=a.map(b=>b.evaluate(d));if(l>p||l===p)return l;let m;if("string"==typeof g)m=function(b){let T=0;if(0===b.length)return T;for(let k=0;kJSON.stringify(S)).join(", ")}, but found ${JSON.stringify(F)} instead.`);return F}catch(F){return this._warningHistory[F.message]||(this._warningHistory[F.message]=!0,typeof console<"u"&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${F.message}`)),this._defaultValue}}}function xh(d){return Array.isArray(d)&&d.length>0&&"string"==typeof d[0]&&d[0]in Sa}function bl(d,a,l,p){const g=new cm(Sa,[],a?function(b){const T={color:ml,string:Bo,number:Nn,enum:Bo,boolean:xo,formatted:_i,resolvedImage:hh};return"array"===b.type?Ss(T[b.value]||Nt,b.length):T[b.type]}(a):void 0,void 0,void 0,l,p),m=g.parse(d,void 0,void 0,void 0,a&&"string"===a.type?{typeAnnotation:"coerce"}:void 0);return m?Qi(new bi(m,a,l,p)):Es(g.errors)}class gc{constructor(a,l,p,g){this.kind=a,this._styleExpression=l,this.isLightConstant=p,this.isLineProgressConstant=g,this.isStateDependent="constant"!==a&&!gh(l.expression),this.configDependencies=W_(l.expression)}evaluateWithoutErrorHandling(a,l,p,g,m,b){return this._styleExpression.evaluateWithoutErrorHandling(a,l,p,g,m,b)}evaluate(a,l,p,g,m,b){return this._styleExpression.evaluate(a,l,p,g,m,b)}}class wh{constructor(a,l,p,g,m,b){this.kind=a,this.zoomStops=p,this._styleExpression=l,this.isStateDependent="camera"!==a&&!gh(l.expression),this.isLightConstant=m,this.isLineProgressConstant=b,this.configDependencies=W_(l.expression),this.interpolationType=g}evaluateWithoutErrorHandling(a,l,p,g,m,b){return this._styleExpression.evaluateWithoutErrorHandling(a,l,p,g,m,b)}evaluate(a,l,p,g,m,b){return this._styleExpression.evaluate(a,l,p,g,m,b)}interpolationFactor(a,l,p){return this.interpolationType?gl.interpolationFactor(this.interpolationType,a,l,p):0}}function fp(d,a,l,p){if("error"===(d=bl(d,a,l,p)).result)return d;const g=d.value.expression,m=op(g);if(!m&&!iu(a))return Es([new Zi("","data expressions not supported")]);const b=Mu(g,["zoom","pitch","distance-from-center"]);if(!b&&!ou(a))return Es([new Zi("","zoom expressions not supported")]);const T=Mu(g,["measure-light"]);if(!T&&!ra(a))return Es([new Zi("","measure-light expression not supported")]);const k=Mu(g,["line-progress"]);if(!k&&!hp(a.expression,"line-progress"))return Es([new Zi("","line-progress expression not supported")]);const F=a.expression&&a.expression.relaxZoomRestriction,S=Zr(g);return S||b||F?S instanceof Zi?Es([S]):S instanceof gl&&!ru(a)?Es([new Zi("",'"interpolate" expressions cannot be used with this property')]):Qi(S?new wh(m&&k?"camera":"composite",d.value,S.labels,S instanceof gl?S.interpolation:void 0,T,k):new gc(m&&k?"constant":"source",d.value,T,k)):Es([new Zi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class Pr{constructor(a,l){this._parameters=a,this._specification=l,ic(this,Q_(this._parameters,this._specification))}static deserialize(a){return new Pr(a._parameters,a._specification)}static serialize(a){return{_parameters:a._parameters,_specification:a._specification}}}function Zr(d){let a=null;if(d instanceof Y_)a=Zr(d.result);else if(d instanceof ku){for(const l of d.args)if(a=Zr(l),a)break}else(d instanceof dm||d instanceof gl)&&d.input instanceof Ts&&"zoom"===d.input.name&&(a=d);return a instanceof Zi||d.eachChild(l=>{const p=Zr(l);p instanceof Zi?a=p:a&&p&&a!==p&&(a=new Zi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),a}var Ka,eg,xd=function(){if(eg)return Ka;eg=1,Ka=a;var d=3;function a(l,p,g){var m=this.cells=[];if(l instanceof ArrayBuffer){this.arrayBuffer=l;var b=new Int32Array(this.arrayBuffer);l=b[0],this.d=(p=b[1])+2*(g=b[2]);for(var T=0;T=L[z+0]&&m>=L[z+1])?(k[P]=!0,T.push(R[P])):k[P]=!1}}},a.prototype._forEachCell=function(l,p,g,m,b,T,k,F){for(var S=this._convertToCellCoord(l),R=this._convertToCellCoord(p),L=this._convertToCellCoord(g),A=this._convertToCellCoord(m),P=S;P<=L;P++)for(var z=R;z<=A;z++){var j=this.d*z+P;if((!F||F(this._convertFromCellCoord(P),this._convertFromCellCoord(z),this._convertFromCellCoord(P+1),this._convertFromCellCoord(z+1)))&&b.call(this,l,p,g,m,j,T,k,F))return}},a.prototype._convertFromCellCoord=function(l){return(l-this.padding)/this.scale},a.prototype._convertToCellCoord=function(l){return Math.max(0,Math.min(this.d-1,Math.floor(l*this.scale)+this.padding))},a.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var l=this.cells,p=d+this.cells.length+1+1,g=0,m=0;m=0||(g[m]=vl(d[m],a)));d instanceof Error&&(g.message=d.message)}if(g.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==p&&(g.$name=p),g}throw new Error("can't serialize object of type "+typeof d)}function Ch(d){if(null==d||"boolean"==typeof d||"number"==typeof d||"string"==typeof d||d instanceof Boolean||d instanceof Number||d instanceof String||d instanceof Date||d instanceof RegExp||tg(d)||Qb(d)||ArrayBuffer.isView(d)||d instanceof ImageData)return d;if(Array.isArray(d))return d.map(Ch);if("object"==typeof d){const a=d.$name||"Object";if("Map"===a){const g=new Map;for(const m of Object.keys(d))"$name"!==m&&g.set(m,Ch(d[m]));return g}if("Set"===a){const g=new Set;for(const m of Object.keys(d))"$name"!==m&&g.add(Ch(d[m]));return g}const{klass:l}=yl[a];if(!l)throw new Error(`Can't deserialize unregistered class "${a}".`);if(l.deserialize)return l.deserialize(d);const p=Object.create(l.prototype);for(const g of Object.keys(d))"$name"!==g&&(p[g]=Ch(d[g]));return p}throw new Error("can't deserialize object of type "+typeof d)}const Gn_Latin_1_Supplement=d=>d>=128&&d<=255,Gn_Arabic=d=>d>=1536&&d<=1791,Gn_Arabic_Supplement=d=>d>=1872&&d<=1919,Gn_Arabic_Extended_A=d=>d>=2208&&d<=2303,Gn_Hangul_Jamo=d=>d>=4352&&d<=4607,Gn_Unified_Canadian_Aboriginal_Syllabics=d=>d>=5120&&d<=5759,Gn_Khmer=d=>d>=6016&&d<=6143,Gn_Unified_Canadian_Aboriginal_Syllabics_Extended=d=>d>=6320&&d<=6399,Gn_General_Punctuation=d=>d>=8192&&d<=8303,Gn_Letterlike_Symbols=d=>d>=8448&&d<=8527,Gn_Number_Forms=d=>d>=8528&&d<=8591,Gn_Miscellaneous_Technical=d=>d>=8960&&d<=9215,Gn_Control_Pictures=d=>d>=9216&&d<=9279,Gn_Optical_Character_Recognition=d=>d>=9280&&d<=9311,Gn_Enclosed_Alphanumerics=d=>d>=9312&&d<=9471,Gn_Geometric_Shapes=d=>d>=9632&&d<=9727,Gn_Miscellaneous_Symbols=d=>d>=9728&&d<=9983,Gn_Miscellaneous_Symbols_and_Arrows=d=>d>=11008&&d<=11263,Gn_CJK_Radicals_Supplement=d=>d>=11904&&d<=12031,Gn_Kangxi_Radicals=d=>d>=12032&&d<=12255,Gn_Ideographic_Description_Characters=d=>d>=12272&&d<=12287,Gn_CJK_Symbols_and_Punctuation=d=>d>=12288&&d<=12351,Gn_Hiragana=d=>d>=12352&&d<=12447,Gn_Katakana=d=>d>=12448&&d<=12543,Gn_Bopomofo=d=>d>=12544&&d<=12591,Gn_Hangul_Compatibility_Jamo=d=>d>=12592&&d<=12687,Gn_Kanbun=d=>d>=12688&&d<=12703,Gn_Bopomofo_Extended=d=>d>=12704&&d<=12735,Gn_CJK_Strokes=d=>d>=12736&&d<=12783,Gn_Katakana_Phonetic_Extensions=d=>d>=12784&&d<=12799,Gn_Enclosed_CJK_Letters_and_Months=d=>d>=12800&&d<=13055,Gn_CJK_Compatibility=d=>d>=13056&&d<=13311,Gn_CJK_Unified_Ideographs_Extension_A=d=>d>=13312&&d<=19903,Gn_Yijing_Hexagram_Symbols=d=>d>=19904&&d<=19967,Gn_CJK_Unified_Ideographs=d=>d>=19968&&d<=40959,Gn_Yi_Syllables=d=>d>=40960&&d<=42127,Gn_Yi_Radicals=d=>d>=42128&&d<=42191,Gn_Hangul_Jamo_Extended_A=d=>d>=43360&&d<=43391,Gn_Hangul_Syllables=d=>d>=44032&&d<=55215,Gn_Hangul_Jamo_Extended_B=d=>d>=55216&&d<=55295,Gn_Private_Use_Area=d=>d>=57344&&d<=63743,Gn_CJK_Compatibility_Ideographs=d=>d>=63744&&d<=64255,Gn_Arabic_Presentation_Forms_A=d=>d>=64336&&d<=65023,Gn_Vertical_Forms=d=>d>=65040&&d<=65055,Gn_CJK_Compatibility_Forms=d=>d>=65072&&d<=65103,Gn_Small_Form_Variants=d=>d>=65104&&d<=65135,Gn_Arabic_Presentation_Forms_B=d=>d>=65136&&d<=65279,Gn_Halfwidth_and_Fullwidth_Forms=d=>d>=65280&&d<=65519,Gn_Osage=d=>d>=66736&&d<=66815,Gn_CJK_Unified_Ideographs_Extension_B=d=>d>=131072&&d<=173791;function hm(d){for(const a of d)if(Jb(a.charCodeAt(0)))return!0;return!1}function rD(d){for(const a of d)if(!aD(a.charCodeAt(0)))return!1;return!0}function aD(d){return!(Gn_Arabic(d)||Gn_Arabic_Supplement(d)||Gn_Arabic_Extended_A(d)||Gn_Arabic_Presentation_Forms_A(d)||Gn_Arabic_Presentation_Forms_B(d))}function Jb(d){return!(746!==d&&747!==d&&(d<4352||!(Gn_Bopomofo_Extended(d)||Gn_Bopomofo(d)||Gn_CJK_Compatibility_Forms(d)&&!(d>=65097&&d<=65103)||Gn_CJK_Compatibility_Ideographs(d)||Gn_CJK_Compatibility(d)||Gn_CJK_Radicals_Supplement(d)||Gn_CJK_Strokes(d)||!(!Gn_CJK_Symbols_and_Punctuation(d)||d>=12296&&d<=12305||d>=12308&&d<=12319||12336===d)||Gn_CJK_Unified_Ideographs_Extension_A(d)||Gn_CJK_Unified_Ideographs(d)||Gn_Enclosed_CJK_Letters_and_Months(d)||Gn_Hangul_Compatibility_Jamo(d)||Gn_Hangul_Jamo_Extended_A(d)||Gn_Hangul_Jamo_Extended_B(d)||Gn_Hangul_Jamo(d)||Gn_Hangul_Syllables(d)||Gn_Hiragana(d)||Gn_Ideographic_Description_Characters(d)||Gn_Kanbun(d)||Gn_Kangxi_Radicals(d)||Gn_Katakana_Phonetic_Extensions(d)||Gn_Katakana(d)&&12540!==d||!(!Gn_Halfwidth_and_Fullwidth_Forms(d)||65288===d||65289===d||65293===d||d>=65306&&d<=65310||65339===d||65341===d||65343===d||d>=65371&&d<=65503||65507===d||d>=65512&&d<=65519)||!(!Gn_Small_Form_Variants(d)||d>=65112&&d<=65118||d>=65123&&d<=65126)||Gn_Unified_Canadian_Aboriginal_Syllabics(d)||Gn_Unified_Canadian_Aboriginal_Syllabics_Extended(d)||Gn_Vertical_Forms(d)||Gn_Yijing_Hexagram_Symbols(d)||Gn_Yi_Syllables(d)||Gn_Yi_Radicals(d))))}function A0(d){return!(Jb(d)||(a=d,Gn_Latin_1_Supplement(a)&&(167===a||169===a||174===a||177===a||188===a||189===a||190===a||215===a||247===a)||Gn_General_Punctuation(a)&&(8214===a||8224===a||8225===a||8240===a||8241===a||8251===a||8252===a||8258===a||8263===a||8264===a||8265===a||8273===a)||Gn_Letterlike_Symbols(a)||Gn_Number_Forms(a)||Gn_Miscellaneous_Technical(a)&&(a>=8960&&a<=8967||a>=8972&&a<=8991||a>=8996&&a<=9e3||9003===a||a>=9085&&a<=9114||a>=9150&&a<=9165||9167===a||a>=9169&&a<=9179||a>=9186&&a<=9215)||Gn_Control_Pictures(a)&&9251!==a||Gn_Optical_Character_Recognition(a)||Gn_Enclosed_Alphanumerics(a)||Gn_Geometric_Shapes(a)||Gn_Miscellaneous_Symbols(a)&&!(a>=9754&&a<=9759)||Gn_Miscellaneous_Symbols_and_Arrows(a)&&(a>=11026&&a<=11055||a>=11088&&a<=11097||a>=11192&&a<=11243)||Gn_CJK_Symbols_and_Punctuation(a)||Gn_Katakana(a)||Gn_Private_Use_Area(a)||Gn_CJK_Compatibility_Forms(a)||Gn_Small_Form_Variants(a)||Gn_Halfwidth_and_Fullwidth_Forms(a)||8734===a||8756===a||8757===a||a>=9984&&a<=10087||a>=10102&&a<=10131||65532===a||65533===a));var a}function k0(d){return d>=1424&&d<=2303||Gn_Arabic_Presentation_Forms_A(d)||Gn_Arabic_Presentation_Forms_B(d)}function fw(d,a){return!(!a&&k0(d)||d>=2304&&d<=3583||d>=3840&&d<=4255||Gn_Khmer(d))}function ng(d){for(const a of d)if(k0(a.charCodeAt(0)))return!0;return!1}const ig="deferred",ey="loading",R0="loaded";let ty=null,Zl="unavailable",Ru=null;const O0=function(d){d&&"string"==typeof d&&d.indexOf("NetworkError")>-1&&(Zl="error"),ty&&ty(d)};function P0(){Ef.fire(new lo("pluginStateChange",{pluginStatus:Zl,pluginURL:Ru}))}const Ef=new ze,og=function(){return Zl},pm=function(){if(Zl!==ig||!Ru)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Zl=ey,P0(),Ru&&Tr({url:Ru},d=>{d?O0(d):(Zl=R0,P0())})},go={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Zl===R0||null!=go.applyArabicShaping,isLoading:()=>Zl===ey,setState(d){Zl=d.pluginStatus,Ru=d.pluginURL},isParsed:()=>null!=go.applyArabicShaping&&null!=go.processBidirectionalText&&null!=go.processStyledBidirectionalText,getPluginURL:()=>Ru};class ar{constructor(a,l){this.zoom=a,l?(this.now=l.now,this.fadeDuration=l.fadeDuration,this.transition=l.transition,this.pitch=l.pitch,this.brightness=l.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(a){return function(l,p){for(const g of l)if(!fw(g.charCodeAt(0),p))return!1;return!0}(a,go.isLoaded())}}class rg{constructor(a,l,p,g){this.property=a,this.value=l,this.expression=function(m,b,T,k){if(vd(m))return new Pr(m,b);if(xh(m)||Array.isArray(m)&&m.length>0){const F=fp(m,b,T,k);if("error"===F.result)throw new Error(F.value.map(S=>`${S.key}: ${S.message}`).join(", "));return F.value}{let F=m;return"string"==typeof m&&"color"===b.type&&(F=In.parse(m)),{kind:"constant",configDependencies:new Set,evaluate:()=>F}}}(void 0===l?a.specification.default:l,a.specification,p,g)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(a,l,p){return this.property.possiblyEvaluate(this,a,l,p)}}class Mf{constructor(a,l,p){this.property=a,this.value=new rg(a,void 0,l,p)}transitioned(a,l){return new ag(this.property,this.value,l,fo({},a.transition,this.transition),a.now)}untransitioned(){return new ag(this.property,this.value,null,{},0)}}class Af{constructor(a,l,p){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues),this._scope=l,this._options=p,this.configDependencies=new Set}getValue(a){return Bs(this._values[a].value.value)}setValue(a,l){this._values.hasOwnProperty(a)||(this._values[a]=new Mf(this._values[a].property,this._scope,this._options)),this._values[a].value=new rg(this._values[a].property,null===l?void 0:Bs(l),this._scope,this._options),this._values[a].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[a].value.expression.configDependencies]))}setTransitionOrValue(a,l){l&&(this._options=l);const p=this._properties.properties;if(a)for(const g in a){const m=a[g];if(Fa(g,"-transition")){const b=g.slice(0,-11);p[b]&&this.setTransition(b,m)}else p.hasOwnProperty(g)&&this.setValue(g,m)}}getTransition(a){return Bs(this._values[a].transition)}setTransition(a,l){this._values.hasOwnProperty(a)||(this._values[a]=new Mf(this._values[a].property)),this._values[a].transition=Bs(l)||void 0}serialize(){const a={};for(const l of Object.keys(this._values)){const p=this.getValue(l);void 0!==p&&(a[l]=p);const g=this.getTransition(l);void 0!==g&&(a[`${l}-transition`]=g)}return a}transitioned(a,l){const p=new kf(this._properties);for(const g of Object.keys(this._values))p._values[g]=this._values[g].transitioned(a,l._values[g]);return p}untransitioned(){const a=new kf(this._properties);for(const l of Object.keys(this._values))a._values[l]=this._values[l].untransitioned();return a}}class ag{constructor(a,l,p,g,m){const b=g.delay||0,T=g.duration||0;m=m||0,this.property=a,this.value=l,this.begin=m+b,this.end=this.begin+T,a.specification.transition&&(g.delay||g.duration)&&(this.prior=p)}possiblyEvaluate(a,l,p){const g=a.now||0,m=this.value.possiblyEvaluate(a,l,p),b=this.prior;if(b){if(g>this.end)return this.prior=null,m;if(this.value.isDataDriven())return this.prior=null,m;if(g":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"snow":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.85],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.3],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":"#ffffff","experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.4,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,50],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"flake-size":{"type":"number","property-type":"data-constant","default":0.71,"minimum":0,"maximum":5,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"rain":{"density":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,0.5],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#03113d",0.3,"#a8adbc"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"opacity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,0.88,1,0.7],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],11,0,13,1],"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vignette-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["measure-light","brightness"],0,"#001736",0.3,"#464646"],"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"center-thinning":{"type":"number","property-type":"data-constant","default":0.57,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"direction":{"type":"array","default":[0,80],"minimum":0,"maximum":360,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"droplet-size":{"type":"array","default":[2.6,18.2],"minimum":0,"maximum":50,"length":2,"value":"number","property-type":"data-constant","transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"distortion-strength":{"type":"number","property-type":"data-constant","default":0.7,"minimum":0,"maximum":1,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"indoor":{"floorplanFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}},"buildingFeaturesetId":{"type":"string","experimental":true,"property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-height-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"flat","property-type":"data-constant"},"fill-extrusion-base-alignment":{"type":"enum","experimental":true,"values":{"terrain":1,"flat":1},"default":"terrain","property-type":"data-constant"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light","line-progress"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"symbol-z-offset":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":[]},"experimental":true,"property-type":"data-constant"},"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"property-type":"data-driven"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"*"}}}');function xl(d){return d instanceof Number||d instanceof String||d instanceof Boolean?d.valueOf():d}function sg(d){if(Array.isArray(d))return d.map(sg);if(d instanceof Object&&!(d instanceof Number||d instanceof String||d instanceof Boolean)){const a={};for(const l in d)a[l]=sg(d[l]);return a}return xl(d)}function Ou(d){if(!0===d||!1===d)return!0;if(!Array.isArray(d)||0===d.length)return!1;switch(d[0]){case"has":return d.length>=2&&"$id"!==d[1]&&"$type"!==d[1];case"in":return d.length>=3&&("string"!=typeof d[1]||Array.isArray(d[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==d.length||Array.isArray(d[1])||Array.isArray(d[2]);case"any":case"all":for(const a of d.slice(1))if(!Ou(a)&&"boolean"!=typeof a)return!1;return!0;default:return!0}}function Th(d,a="",l=null,p="fill"){if(null==d)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ou(d)||(d=Rf(d));const g=d;let m=!0;try{m=function(S){if(!fm(S))return S;let R=sg(S);return wl(R),R=lg(R),R}(g)}catch{console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(g,null,2)}\n `)}let b=null,T=null;if("background"!==p&&"sky"!==p&&"slot"!==p){T=lt[`filter_${p}`];const S=bl(m,T,a,l);if("error"===S.result)throw new Error(S.value.map(R=>`${R.key}: ${R.message}`).join(", "));b=(R,L,A)=>S.value.evaluate(R,L,{},A)}let k=null,F=null;if(m!==g){const S=bl(g,T,a,l);if("error"===S.result)throw new Error(S.value.map(R=>`${R.key}: ${R.message}`).join(", "));k=(R,L,A,P,z)=>S.value.evaluate(R,L,{},A,void 0,void 0,P,z),F=!op(S.value.expression)}return{filter:b,dynamicFilter:k||void 0,needGeometry:bc(m),needFeature:!!F}}function lg(d){if(!Array.isArray(d))return d;const a=function(l){if(ny.has(l[0]))for(let p=1;plg(l))}function wl(d){let a=!1;const l=[];if("case"===d[0]){for(let p=1;p",">=","<","<=","to-boolean"]);function _w(d,a){return da?1:0}function bc(d){if(!Array.isArray(d))return!1;if("within"===d[0]||"distance"===d[0])return!0;for(let a=1;a"===a||"<="===a||">="===a?su(d[1],d[2],a):"any"===a?(l=d.slice(1),["any"].concat(l.map(Rf))):"all"===a?["all"].concat(d.slice(1).map(Rf)):"none"===a?["all"].concat(d.slice(1).map(Rf).map(Pu)):"in"===a?cg(d[1],d.slice(2)):"!in"===a?Pu(cg(d[1],d.slice(2))):"has"===a?_p(d[1]):"!has"!==a||Pu(_p(d[1]));var l}function su(d,a,l){switch(d){case"$type":return[`filter-type-${l}`,a];case"$id":return[`filter-id-${l}`,a];default:return[`filter-${l}`,d,a]}}function cg(d,a){if(0===a.length)return!1;switch(d){case"$type":return["filter-type-in",["literal",a]];case"$id":return["filter-id-in",["literal",a]];default:return a.length>200&&!a.some(l=>typeof l!=typeof a[0])?["filter-in-large",d,["literal",a.sort(_w)]]:["filter-in-small",d,["literal",a]]}}function _p(d){switch(d){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",d]}}function Pu(d){return["!",d]}function yc(d,a){return a?`${d}\x1f${a}`:d}const wd="-transition",lu=new Set(["fill","line","background","hillshade","raster"]);class Ba extends ze{constructor(a,l,p,g,m){if(super(),this.id=a.id,this.fqid=yc(this.id,p),this.type=a.type,this.scope=p,this.lut=g,this.options=m,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,"custom"!==a.type){if(this.metadata=a.metadata,this.minzoom=a.minzoom,this.maxzoom=a.maxzoom,a.type&&"background"!==a.type&&"sky"!==a.type&&"slot"!==a.type){this.source=a.source,this.sourceLayer=a["source-layer"],this.filter=a.filter;const b=bl(this.filter,lt[`filter_${a.type}`]);"error"!==b.result&&(this.configDependencies=new Set([...this.configDependencies,...b.value.configDependencies]))}if(a.slot&&(this.slot=a.slot),l.layout&&(this._unevaluatedLayout=new Sh(l.layout,this.scope,m),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),l.paint){this._transitionablePaint=new Af(l.paint,this.scope,m);for(const b in a.paint)this.setPaintProperty(b,a.paint[b]);for(const b in a.layout)this.setLayoutProperty(b,a.layout[b]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new tr(l.paint)}}}onAdd(a){}onRemove(a){}isDraped(a){return!this.is3D()&&lu.has(this.type)}getLayoutProperty(a){return"visibility"===a?this.visibility:this._unevaluatedLayout.getValue(a)}setLayoutProperty(a,l){if("custom"===this.type&&"visibility"===a)return void(this.visibility=l);const p=this._unevaluatedLayout;p._properties.properties[a]&&(p.setValue(a,l),this.configDependencies=new Set([...this.configDependencies,...p.configDependencies]),"visibility"===a&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this._unevaluatedLayout._values.visibility&&(this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0}))}getPaintProperty(a){return Fa(a,wd)?this._transitionablePaint.getTransition(a.slice(0,-11)):this._transitionablePaint.getValue(a)}setPaintProperty(a,l){const p=this._transitionablePaint,g=p._properties.properties;if(Fa(a,wd)){const R=a.slice(0,-11);return g[R]&&p.setTransition(R,l||void 0),!1}if(!g[a])return!1;const m=p._values[a],b=m.value.isDataDriven(),T=m.value;p.setValue(a,l),this.configDependencies=new Set([...this.configDependencies,...p.configDependencies]),this._handleSpecialPaintPropertyUpdate(a);const k=p._values[a].value,F=k.isDataDriven(),S=Fa(a,"pattern")||"line-dasharray"===a;return F||b||S||this._handleOverridablePaintPropertyUpdate(a,T,k)}_handleSpecialPaintPropertyUpdate(a){}getProgramIds(){return null}getDefaultProgramParams(a,l,p){return null}_handleOverridablePaintPropertyUpdate(a,l,p){return!1}isHidden(a){return!!(this.minzoom&&a=this.maxzoom)||"none"===this.visibility}updateTransitions(a){this._transitioningPaint=this._transitionablePaint.transitioned(a,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(a,l){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(a,void 0,l)),this.paint=this._transitioningPaint.possiblyEvaluate(a,void 0,l)}serialize(){return nc({id:this.id,type:this.type,slot:this.slot,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()},(a,l)=>!(void 0===a||"layout"===l&&!Object.keys(a).length||"paint"===l&&!Object.keys(a).length))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const a in this.paint._values){const l=this.paint.get(a);if(l instanceof mm&&iu(l.property.specification)&&("source"===l.value.kind||"composite"===l.value.kind)&&l.value.isStateDependent)return!0}return!1}compileFilter(a){this._filterCompiled||(this._featureFilter=Th(this.filter,this.scope,a),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(a){this._stats&&("shadow"===a.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(a){}queryIntersectsFeature(a,l,p,g,m,b,T,k,F){}}const iy={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Of{constructor(a,l){this._structArray=a,this._pos1=l*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class si{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(a,l){return a._trim(),l&&(a.isTransferred=!0,l.add(a.arrayBuffer)),{length:a.length,arrayBuffer:a.arrayBuffer}}static deserialize(a){const l=Object.create(this.prototype);return l.arrayBuffer=a.arrayBuffer,l.length=a.length,l.capacity=a.arrayBuffer.byteLength/l.bytesPerElement,l._refreshViews(),l}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(a){this.reserve(a),this.length=a}reserve(a){if(a>this.capacity){this.capacity=Math.max(a,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const l=this.uint8;this._refreshViews(),l&&this.uint8.set(l)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...a){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...a){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function wo(d,a=1){let l=0,p=0;return{members:d.map(g=>{const m=iy[g.type].BYTES_PER_ELEMENT,b=l=dg(l,Math.max(a,m)),T=g.components||1;return p=Math.max(p,m),l+=m*T,{name:g.name,type:g.type,components:T,offset:b}}),size:dg(l,Math.max(p,a)),alignment:a}}function dg(d,a){return Math.ceil(d/a)*a}class Cd extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l){const p=this.length;return this.resize(p+1),this.emplace(p,a,l)}emplace(a,l,p){const g=2*a;return this.int16[g+0]=l,this.int16[g+1]=p,a}}Cd.prototype.bytesPerElement=4,En(Cd,"StructArrayLayout2i4");class _m extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,a,l,p)}emplace(a,l,p,g){const m=3*a;return this.int16[m+0]=l,this.int16[m+1]=p,this.int16[m+2]=g,a}}_m.prototype.bytesPerElement=6,En(_m,"StructArrayLayout3i6");class Fu extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,a,l,p,g)}emplace(a,l,p,g,m){const b=4*a;return this.int16[b+0]=l,this.int16[b+1]=p,this.int16[b+2]=g,this.int16[b+3]=m,a}}Fu.prototype.bytesPerElement=8,En(Fu,"StructArrayLayout4i8");class ug extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m){const b=this.length;return this.resize(b+1),this.emplace(b,a,l,p,g,m)}emplace(a,l,p,g,m,b){const T=5*a;return this.int16[T+0]=l,this.int16[T+1]=p,this.int16[T+2]=g,this.int16[T+3]=m,this.int16[T+4]=b,a}}ug.prototype.bytesPerElement=10,En(ug,"StructArrayLayout5i10");class gp extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T){const k=this.length;return this.resize(k+1),this.emplace(k,a,l,p,g,m,b,T)}emplace(a,l,p,g,m,b,T,k){const F=6*a,S=12*a,R=3*a;return this.int16[F+0]=l,this.int16[F+1]=p,this.uint8[S+4]=g,this.uint8[S+5]=m,this.uint8[S+6]=b,this.uint8[S+7]=T,this.float32[R+2]=k,a}}gp.prototype.bytesPerElement=12,En(gp,"StructArrayLayout2i4ub1f12");class Cl extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,a,l,p)}emplace(a,l,p,g){const m=3*a;return this.float32[m+0]=l,this.float32[m+1]=p,this.float32[m+2]=g,a}}Cl.prototype.bytesPerElement=12,En(Cl,"StructArrayLayout3f12");class ol extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m){const b=this.length;return this.resize(b+1),this.emplace(b,a,l,p,g,m)}emplace(a,l,p,g,m,b){const T=6*a,k=3*a;return this.uint16[T+0]=l,this.uint16[T+1]=p,this.uint16[T+2]=g,this.uint16[T+3]=m,this.float32[k+2]=b,a}}ol.prototype.bytesPerElement=12,En(ol,"StructArrayLayout4ui1f12");class hg extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,a,l,p,g)}emplace(a,l,p,g,m){const b=4*a;return this.uint16[b+0]=l,this.uint16[b+1]=p,this.uint16[b+2]=g,this.uint16[b+3]=m,a}}hg.prototype.bytesPerElement=8,En(hg,"StructArrayLayout4ui8");class Pf extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b){const T=this.length;return this.resize(T+1),this.emplace(T,a,l,p,g,m,b)}emplace(a,l,p,g,m,b,T){const k=6*a;return this.int16[k+0]=l,this.int16[k+1]=p,this.int16[k+2]=g,this.int16[k+3]=m,this.int16[k+4]=b,this.int16[k+5]=T,a}}Pf.prototype.bytesPerElement=12,En(Pf,"StructArrayLayout6i12");class oy extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R,L){const A=this.length;return this.resize(A+1),this.emplace(A,a,l,p,g,m,b,T,k,F,S,R,L)}emplace(a,l,p,g,m,b,T,k,F,S,R,L,A){const P=12*a;return this.int16[P+0]=l,this.int16[P+1]=p,this.int16[P+2]=g,this.int16[P+3]=m,this.uint16[P+4]=b,this.uint16[P+5]=T,this.uint16[P+6]=k,this.uint16[P+7]=F,this.int16[P+8]=S,this.int16[P+9]=R,this.int16[P+10]=L,this.int16[P+11]=A,a}}oy.prototype.bytesPerElement=24,En(oy,"StructArrayLayout4i4ui4i24");class ry extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b){const T=this.length;return this.resize(T+1),this.emplace(T,a,l,p,g,m,b)}emplace(a,l,p,g,m,b,T){const k=10*a,F=5*a;return this.int16[k+0]=l,this.int16[k+1]=p,this.int16[k+2]=g,this.float32[F+2]=m,this.float32[F+3]=b,this.float32[F+4]=T,a}}ry.prototype.bytesPerElement=20,En(ry,"StructArrayLayout3i3f20");class Yt extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,a,l,p,g)}emplace(a,l,p,g,m){const b=4*a;return this.float32[b+0]=l,this.float32[b+1]=p,this.float32[b+2]=g,this.float32[b+3]=m,a}}Yt.prototype.bytesPerElement=16,En(Yt,"StructArrayLayout4f16");class io extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(a){const l=this.length;return this.resize(l+1),this.emplace(l,a)}emplace(a,l){return this.uint32[1*a+0]=l,a}}io.prototype.bytesPerElement=4,En(io,"StructArrayLayout1ul4");class fe extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l){const p=this.length;return this.resize(p+1),this.emplace(p,a,l)}emplace(a,l,p){const g=2*a;return this.uint16[g+0]=l,this.uint16[g+1]=p,a}}fe.prototype.bytesPerElement=4,En(fe,"StructArrayLayout2ui4");class ge extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R,L,A){const P=this.length;return this.resize(P+1),this.emplace(P,a,l,p,g,m,b,T,k,F,S,R,L,A)}emplace(a,l,p,g,m,b,T,k,F,S,R,L,A,P){const z=20*a,j=10*a;return this.int16[z+0]=l,this.int16[z+1]=p,this.int16[z+2]=g,this.int16[z+3]=m,this.int16[z+4]=b,this.float32[j+3]=T,this.float32[j+4]=k,this.float32[j+5]=F,this.float32[j+6]=S,this.int16[z+14]=R,this.uint32[j+8]=L,this.uint16[z+18]=A,this.uint16[z+19]=P,a}}ge.prototype.bytesPerElement=40,En(ge,"StructArrayLayout5i4f1i1ul2ui40");class Lo extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T){const k=this.length;return this.resize(k+1),this.emplace(k,a,l,p,g,m,b,T)}emplace(a,l,p,g,m,b,T,k){const F=8*a;return this.int16[F+0]=l,this.int16[F+1]=p,this.int16[F+2]=g,this.int16[F+4]=m,this.int16[F+5]=b,this.int16[F+6]=T,this.int16[F+7]=k,a}}Lo.prototype.bytesPerElement=16,En(Lo,"StructArrayLayout3i2i2i16");class pg extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m){const b=this.length;return this.resize(b+1),this.emplace(b,a,l,p,g,m)}emplace(a,l,p,g,m,b){const T=4*a,k=8*a;return this.float32[T+0]=l,this.float32[T+1]=p,this.float32[T+2]=g,this.int16[k+6]=m,this.int16[k+7]=b,a}}pg.prototype.bytesPerElement=16,En(pg,"StructArrayLayout2f1f2i16");class bp extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b){const T=this.length;return this.resize(T+1),this.emplace(T,a,l,p,g,m,b)}emplace(a,l,p,g,m,b,T){const k=20*a,F=5*a;return this.uint8[k+0]=l,this.uint8[k+1]=p,this.float32[F+1]=g,this.float32[F+2]=m,this.float32[F+3]=b,this.float32[F+4]=T,a}}bp.prototype.bytesPerElement=20,En(bp,"StructArrayLayout2ub4f20");class Ir extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l,p){const g=this.length;return this.resize(g+1),this.emplace(g,a,l,p)}emplace(a,l,p,g){const m=3*a;return this.uint16[m+0]=l,this.uint16[m+1]=p,this.uint16[m+2]=g,a}}Ir.prototype.bytesPerElement=6,En(Ir,"StructArrayLayout3ui6");class Lf extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne){const oe=this.length;return this.resize(oe+1),this.emplace(oe,a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne)}emplace(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne,oe){const le=30*a,xe=15*a,ve=60*a;return this.int16[le+0]=l,this.int16[le+1]=p,this.int16[le+2]=g,this.float32[xe+2]=m,this.float32[xe+3]=b,this.uint16[le+8]=T,this.uint16[le+9]=k,this.uint32[xe+5]=F,this.uint32[xe+6]=S,this.uint32[xe+7]=R,this.uint16[le+16]=L,this.uint16[le+17]=A,this.uint16[le+18]=P,this.float32[xe+10]=z,this.float32[xe+11]=j,this.uint8[ve+48]=$,this.uint8[ve+49]=K,this.uint8[ve+50]=J,this.uint32[xe+13]=Z,this.int16[le+28]=ne,this.uint8[ve+58]=oe,a}}Lf.prototype.bytesPerElement=60,En(Lf,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Ff extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne,Ge,He,Xe){const Je=this.length;return this.resize(Je+1),this.emplace(Je,a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne,Ge,He,Xe)}emplace(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$,K,J,Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne,Ge,He,Xe,Je){const rt=20*a,Qe=40*a,It=80*a;return this.float32[rt+0]=l,this.float32[rt+1]=p,this.int16[Qe+4]=g,this.int16[Qe+5]=m,this.int16[Qe+6]=b,this.int16[Qe+7]=T,this.int16[Qe+8]=k,this.int16[Qe+9]=F,this.int16[Qe+10]=S,this.int16[Qe+11]=R,this.int16[Qe+12]=L,this.uint16[Qe+13]=A,this.uint16[Qe+14]=P,this.uint16[Qe+15]=z,this.uint16[Qe+16]=j,this.uint16[Qe+17]=$,this.uint16[Qe+18]=K,this.uint16[Qe+19]=J,this.uint16[Qe+20]=Z,this.uint16[Qe+21]=ne,this.uint16[Qe+22]=oe,this.uint16[Qe+23]=le,this.uint16[Qe+24]=xe,this.uint16[Qe+25]=ve,this.uint16[Qe+26]=ye,this.uint16[Qe+27]=Fe,this.uint32[rt+14]=Se,this.float32[rt+15]=Ne,this.float32[rt+16]=Ge,this.float32[rt+17]=He,this.float32[rt+18]=Xe,this.uint8[It+76]=Je,a}}Ff.prototype.bytesPerElement=80,En(Ff,"StructArrayLayout2f9i15ui1ul4f1ub80");class gm extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a){const l=this.length;return this.resize(l+1),this.emplace(l,a)}emplace(a,l){return this.float32[1*a+0]=l,a}}gm.prototype.bytesPerElement=4,En(gm,"StructArrayLayout1f4");class yp extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m){const b=this.length;return this.resize(b+1),this.emplace(b,a,l,p,g,m)}emplace(a,l,p,g,m,b){const T=5*a;return this.float32[T+0]=l,this.float32[T+1]=p,this.float32[T+2]=g,this.float32[T+3]=m,this.float32[T+4]=b,a}}yp.prototype.bytesPerElement=20,En(yp,"StructArrayLayout5f20");class ay extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T){const k=this.length;return this.resize(k+1),this.emplace(k,a,l,p,g,m,b,T)}emplace(a,l,p,g,m,b,T,k){const F=7*a;return this.float32[F+0]=l,this.float32[F+1]=p,this.float32[F+2]=g,this.float32[F+3]=m,this.float32[F+4]=b,this.float32[F+5]=T,this.float32[F+6]=k,a}}ay.prototype.bytesPerElement=28,En(ay,"StructArrayLayout7f28");class Sd extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R){const L=this.length;return this.resize(L+1),this.emplace(L,a,l,p,g,m,b,T,k,F,S,R)}emplace(a,l,p,g,m,b,T,k,F,S,R,L){const A=11*a;return this.float32[A+0]=l,this.float32[A+1]=p,this.float32[A+2]=g,this.float32[A+3]=m,this.float32[A+4]=b,this.float32[A+5]=T,this.float32[A+6]=k,this.float32[A+7]=F,this.float32[A+8]=S,this.float32[A+9]=R,this.float32[A+10]=L,a}}Sd.prototype.bytesPerElement=44,En(Sd,"StructArrayLayout11f44");class Nf extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F){const S=this.length;return this.resize(S+1),this.emplace(S,a,l,p,g,m,b,T,k,F)}emplace(a,l,p,g,m,b,T,k,F,S){const R=9*a;return this.float32[R+0]=l,this.float32[R+1]=p,this.float32[R+2]=g,this.float32[R+3]=m,this.float32[R+4]=b,this.float32[R+5]=T,this.float32[R+6]=k,this.float32[R+7]=F,this.float32[R+8]=S,a}}Nf.prototype.bytesPerElement=36,En(Nf,"StructArrayLayout9f36");class Nu extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l){const p=this.length;return this.resize(p+1),this.emplace(p,a,l)}emplace(a,l,p){const g=2*a;return this.float32[g+0]=l,this.float32[g+1]=p,a}}Nu.prototype.bytesPerElement=8,En(Nu,"StructArrayLayout2f8");class rl extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,l,p,g){const m=this.length;return this.resize(m+1),this.emplace(m,a,l,p,g)}emplace(a,l,p,g,m){const b=6*a;return this.uint32[3*a+0]=l,this.uint16[b+2]=p,this.uint16[b+3]=g,this.uint16[b+4]=m,a}}rl.prototype.bytesPerElement=12,En(rl,"StructArrayLayout1ul3ui12");class Td extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a){const l=this.length;return this.resize(l+1),this.emplace(l,a)}emplace(a,l){return this.uint16[1*a+0]=l,a}}Td.prototype.bytesPerElement=2,En(Td,"StructArrayLayout1ui2");class bm extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j){const $=this.length;return this.resize($+1),this.emplace($,a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j)}emplace(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$){const K=16*a;return this.float32[K+0]=l,this.float32[K+1]=p,this.float32[K+2]=g,this.float32[K+3]=m,this.float32[K+4]=b,this.float32[K+5]=T,this.float32[K+6]=k,this.float32[K+7]=F,this.float32[K+8]=S,this.float32[K+9]=R,this.float32[K+10]=L,this.float32[K+11]=A,this.float32[K+12]=P,this.float32[K+13]=z,this.float32[K+14]=j,this.float32[K+15]=$,a}}bm.prototype.bytesPerElement=64,En(bm,"StructArrayLayout16f64");class Sl extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,l,p,g,m,b,T){const k=this.length;return this.resize(k+1),this.emplace(k,a,l,p,g,m,b,T)}emplace(a,l,p,g,m,b,T,k){const F=10*a,S=5*a;return this.uint16[F+0]=l,this.uint16[F+1]=p,this.uint16[F+2]=g,this.uint16[F+3]=m,this.float32[S+2]=b,this.float32[S+3]=T,this.float32[S+4]=k,a}}Sl.prototype.bytesPerElement=20,En(Sl,"StructArrayLayout4ui3f20");class Dd extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a){const l=this.length;return this.resize(l+1),this.emplace(l,a)}emplace(a,l){return this.int16[1*a+0]=l,a}}Dd.prototype.bytesPerElement=2,En(Dd,"StructArrayLayout1i2");class mg extends si{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(a){const l=this.length;return this.resize(l+1),this.emplace(l,a)}emplace(a,l){return this.uint8[1*a+0]=l,a}}mg.prototype.bytesPerElement=1,En(mg,"StructArrayLayout1ub1");class sy extends Of{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}sy.prototype.size=40;class ly extends ge{get(a){return new sy(this,a)}}En(ly,"CollisionBoxArray");class zf extends Of{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(a){this._structArray.uint8[this._pos1+49]=a}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(a){this._structArray.uint8[this._pos1+50]=a}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(a){this._structArray.uint32[this._pos4+13]=a}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(a){this._structArray.uint8[this._pos1+58]=a}}zf.prototype.size=60;class fg extends Lf{get(a){return new zf(this,a)}}En(fg,"PlacedSymbolArray");class _g extends Of{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(a){this._structArray.uint32[this._pos4+14]=a}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(a){this._structArray.float32[this._pos4+18]=a}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}_g.prototype.size=80;class gg extends Ff{get(a){return new _g(this,a)}}En(gg,"SymbolInstanceArray");class Bf extends gm{getoffsetX(a){return this.float32[1*a+0]}}En(Bf,"GlyphOffsetArray");class L0 extends Cd{getx(a){return this.int16[2*a+0]}gety(a){return this.int16[2*a+1]}}En(L0,"SymbolLineVertexArray");class ym extends Of{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}ym.prototype.size=12;class vp extends rl{get(a){return new ym(this,a)}}En(vp,"FeatureIndexArray");class Yl extends fe{geta_centroid_pos0(a){return this.uint16[2*a+0]}geta_centroid_pos1(a){return this.uint16[2*a+1]}}En(Yl,"FillExtrusionCentroidArray");class vm extends Of{get a_join_normal_inside0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside2(){return this._structArray.int16[this._pos2+2]}}vm.prototype.size=6;class cy extends _m{get(a){return new vm(this,a)}}En(cy,"FillExtrusionWallArray");const F0=wo([{name:"a_pos",components:2,type:"Int16"}],4),dy=wo([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Yr{constructor(a=[]){this.segments=a}_prepareSegment(a,l,p,g){let m=this.segments[this.segments.length-1];return a>Yr.MAX_VERTEX_ARRAY_LENGTH&&ki(`Max vertices per segment is ${Yr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${a}`),(!m||m.vertexLength+a>Yr.MAX_VERTEX_ARRAY_LENGTH||m.sortKey!==g)&&(m={vertexOffset:l,primitiveOffset:p,vertexLength:0,primitiveLength:0},void 0!==g&&(m.sortKey=g),this.segments.push(m)),m}prepareSegment(a,l,p,g){return this._prepareSegment(a,l.length,p.length,g)}get(){return this.segments}destroy(){for(const a of this.segments)for(const l in a.vaos)a.vaos[l].destroy()}static simpleSegment(a,l,p,g){return new Yr([{vertexOffset:a,primitiveOffset:l,vertexLength:p,primitiveLength:g,vaos:{},sortKey:0}])}}function hs(d,a){return 256*(d=ht(Math.floor(d),0,255))+ht(Math.floor(a),0,255)}Yr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,En(Yr,"SegmentVector");const xp=wo([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),vr=wo([{name:"a_dash",components:4,type:"Uint16"}]);class Va{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(a,l,p,g){this.ids.push(N0(a)),this.positions.push(l,p,g)}eachPosition(a,l){const p=N0(a);let g=0,m=this.ids.length-1;for(;g>1;this.ids[b]>=p?m=b:g=b+1}for(;this.ids[g]===p;)l(this.positions[3*g],this.positions[3*g+1],this.positions[3*g+2]),g++}static serialize(a,l){const p=new Float64Array(a.ids),g=new Uint32Array(a.positions);return cu(p,g,0,p.length-1),l&&(l.add(p.buffer),l.add(g.buffer)),{ids:p,positions:g}}static deserialize(a){const l=new Va;let p;l.ids=a.ids,l.positions=a.positions;for(const g of l.ids)g!==p&&l.uniqueIds.push(g),p=g;return l.indexed=!0,l}}function N0(d){const a=+d;return!isNaN(a)&&Number.MIN_SAFE_INTEGER<=a&&a<=Number.MAX_SAFE_INTEGER?a:jl(String(d))}function cu(d,a,l,p){for(;l>1];let m=l-1,b=p+1;for(;;){do{m++}while(d[m]g);if(m>=b)break;bg(d,m,b),bg(a,3*m,3*b),bg(a,3*m+1,3*b+1),bg(a,3*m+2,3*b+2)}b-l`u_${m}`),this.type=p,this.context=g}setUniform(a,l,p,g,m){const b=g.constantOr(this.value);l.set(a,m,b instanceof In?b.toRenderColor(this.ignoreLut?null:this.context.lut):b)}getBinding(a,l){return"color"===this.type?new Vf(a):new Er(a)}}class zu{constructor(a,l){this.uniformNames=l.map(p=>`u_${p}`),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(a){this.pixelRatio=a.pixelRatio||1,this.pattern=a.tl.concat(a.br)}setUniform(a,l,p,g,m){const b="u_pattern"===m||"u_dash"===m?this.pattern:"u_pixel_ratio"===m?this.pixelRatio:null;b&&l.set(a,m,b)}getBinding(a,l){return"u_pattern"===l||"u_dash"===l?new wp(a):new Er(a)}}class Md{constructor(a,l,p,g){this.expression=a,this.type=p,this.maxValue=0,this.paintVertexAttributes=l.map(m=>({name:`a_${m}`,type:"Float32",components:"color"===p?2:1,offset:0})),this.paintVertexArray=new g}populatePaintArray(a,l,p,g,m,b,T){const k=this.paintVertexArray.length,F="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate(new ar(0,{brightness:b}),l,{},m,g,T):"constant"===this.expression.kind&&this.expression.value;!this.lutExpression||"composite"!==this.lutExpression.kind&&"source"!==this.lutExpression.kind||(this.ignoreLut="none"===this.lutExpression.evaluate(new ar(0,{brightness:b}),l,{},m,g,T)),this.paintVertexArray.resize(a),this._setPaintValue(k,a,F,this.context)}updatePaintArray(a,l,p,g,m,b,T){const k="composite"===this.expression.kind||"source"===this.expression.kind?this.expression.evaluate({zoom:0,brightness:T},p,g,void 0,m):"constant"===this.expression.kind&&this.expression.value;!this.lutExpression||"composite"!==this.lutExpression.kind&&"source"!==this.lutExpression.kind||(this.ignoreLut="none"===this.lutExpression.evaluate({zoom:0,brightness:T},p,g,void 0,m)),this._setPaintValue(a,l,k,this.context)}_setPaintValue(a,l,p,g){if("color"===this.type){const m=Dh(p.toRenderColor(this.ignoreLut?null:g.lut));for(let b=a;b`u_${T}_t`),this.type=p,this.useIntegerZoom=g,this.context=m,this.maxValue=0,this.paintVertexAttributes=l.map(T=>({name:`a_${T}`,type:"Float32",components:"color"===p?4:2,offset:0})),this.paintVertexArray=new b}populatePaintArray(a,l,p,g,m,b,T){const k=this.expression.evaluate(new ar(this.context.zoom,{brightness:b}),l,{},m,g,T),F=this.expression.evaluate(new ar(this.context.zoom+1,{brightness:b}),l,{},m,g,T);!this.lutExpression||"composite"!==this.lutExpression.kind&&"source"!==this.lutExpression.kind||(this.ignoreLut="none"===this.lutExpression.evaluate(new ar(this.context.zoom,{brightness:b}),l,{},m,g,T));const S=this.paintVertexArray.length;this.paintVertexArray.resize(a),this._setPaintValue(S,a,k,F,this.context)}updatePaintArray(a,l,p,g,m,b,T){const k=this.expression.evaluate({zoom:this.context.zoom,brightness:T},p,g,void 0,m),F=this.expression.evaluate({zoom:this.context.zoom+1,brightness:T},p,g,void 0,m);!this.lutExpression||"composite"!==this.lutExpression.kind&&"source"!==this.lutExpression.kind||(this.ignoreLut="none"===this.lutExpression.evaluate({zoom:this.context.zoom,brightness:T},p,g,void 0,m)),this._setPaintValue(a,l,k,F,this.context)}_setPaintValue(a,l,p,g,m){if("color"===this.type){const b=Dh(p.toRenderColor(this.ignoreLut?null:m.lut)),T=Dh(p.toRenderColor(this.ignoreLut?null:m.lut));for(let k=a;k!0){this.binders={},this._buffers=[],this.context=l;const g=[];for(const m in a.paint._values){const b=a.paint.get(m),T=a.paint.get(`${m}-use-theme`);if(m.endsWith("-use-theme")||!p(m)||!(b instanceof mm&&iu(b.property.specification)))continue;const k=gw(m,a.type),F=b.value,S=b.property.specification.type,R=!!b.property.useIntegerZoom,L="line-dasharray"===m||m.endsWith("pattern"),A="line-dasharray"===m&&"constant"!==a.layout.get("line-cap").value.kind||T&&"constant"!==T.value.kind;if("constant"!==F.kind||A)if("source"===F.kind||A||L){const P=Dp(m,S,"source");this.binders[m]=L?new Ih(F,k,S,P,a.id):new Md(F,k,S,P),g.push(`/a_${m}`)}else{const P=Dp(m,S,"composite");this.binders[m]=new Ad(F,k,S,R,l,P),g.push(`/z_${m}`)}else this.binders[m]=L?new zu(F.value,k):new Ed(F.value,k,S,l),g.push(`/u_${m}`);T&&(this.binders[m].ignoreLut="none"===T.constantOr("default"),this.binders[m].lutExpression=T.value,this.binders[m].checkUseTheme=!0)}this.cacheKey=g.sort().join("")}getMaxValue(a){const l=this.binders[a];return l instanceof Md||l instanceof Ad?l.maxValue:0}populatePaintArrays(a,l,p,g,m,b,T){for(const k in this.binders){const F=this.binders[k];F.context=this.context,F instanceof Md||F instanceof Ad||F instanceof Ih?F.populatePaintArray(a,l,p,g,m,b,T):F.lutExpression&&F instanceof Ed&&F.lutExpression&&("composite"===F.lutExpression.kind||"source"===F.lutExpression.kind)&&(F.ignoreLut="none"===F.lutExpression.evaluate(new ar(0,{brightness:b}),l,{},m,g,T))}}setConstantPatternPositions(a){for(const l in this.binders){const p=this.binders[l];p instanceof zu&&p.setConstantPatternPositions(a)}}updatePaintArrays(a,l,p,g,m,b,T,k,F){let S=!1;const R=Object.keys(a),L=0!==R.length&&!k,A=L?R:l.uniqueIds;this.context.lut=m.lut;for(const P in this.binders){const z=this.binders[P];if(z.context=this.context,(z instanceof Md||z instanceof Ad||z instanceof Ih)&&z.expression&&z.expression.kind&&"constant"!==z.expression.kind&&(!0===z.expression.isStateDependent||!1===z.expression.isLightConstant)){const j=m.paint.get(P);z.expression=j.value;for(const $ of A){const K=a[$.toString()];l.eachPosition($,(J,Z,ne)=>{const oe=g.feature(J);z.updatePaintArray(Z,ne,oe,K,b,T,F)})}if(!L)for(const $ of p.uniqueIds){const K=a[$.toString()];p.eachPosition($,(J,Z,ne)=>{const oe=g.feature(J);z.updatePaintArray(Z,ne,oe,K,b,T,F)})}S=!0}}return S}defines(){const a=[];for(const l in this.binders){const p=this.binders[l];(p instanceof Ed||p instanceof zu)&&a.push(...p.uniformNames.map(g=>`#define HAS_UNIFORM_${g}`))}return a}getBinderAttributes(){const a=[];for(const l in this.binders){const p=this.binders[l];if(p instanceof Md||p instanceof Ad||p instanceof Ih)for(let g=0;g!0){this.programConfigurations={};for(const g of a)this.programConfigurations[g.id]=new Sp(g,l,p);this.needsUpload=!1,this._featureMap=new Va,this._featureMapWithoutIds=new Va,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(a,l,p,g,m,b,T,k){for(const F in this.programConfigurations)this.programConfigurations[F].populatePaintArrays(a,l,g,m,b,T,k);void 0!==l.id?this._featureMap.add(l.id,p,this._bufferOffset,a):(this._featureMapWithoutIds.add(this._idlessCounter,p,this._bufferOffset,a),this._idlessCounter+=1),this._bufferOffset=a,this.needsUpload=!0}updatePaintArrays(a,l,p,g,m,b,T){for(const k of p)this.needsUpload=this.programConfigurations[k.id].updatePaintArrays(a,this._featureMap,this._featureMapWithoutIds,l,k,g,m,b,T||0)||this.needsUpload}get(a){return this.programConfigurations[a]}upload(a){if(this.needsUpload){for(const l in this.programConfigurations)this.programConfigurations[l].upload(a);this.needsUpload=!1}}destroy(){for(const a in this.programConfigurations)this.programConfigurations[a].destroy()}}const sD={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"symbol-z-offset":["z_offset"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function gw(d,a){return sD[d]||[d.replace(`${a}-`,"").replace(/-/g,"_")]}const B0={"line-pattern":{source:ol,composite:ol},"fill-pattern":{source:ol,composite:ol},"fill-extrusion-pattern":{source:ol,composite:ol},"line-dasharray":{source:hg,composite:hg}},Hf={color:{source:Nu,composite:Yt},number:{source:gm,composite:Nu}};function Dp(d,a,l){const p=B0[d];return p&&p[l]||Hf[a][l]}En(Ed,"ConstantBinder"),En(zu,"PatternConstantBinder"),En(Md,"SourceExpressionBinder"),En(Ih,"PatternCompositeBinder"),En(Ad,"CompositeExpressionBinder"),En(Sp,"ProgramConfiguration",{omit:["_buffers"]}),En(Tp,"ProgramConfigurationSet");const al=pn/Math.PI/2,Sm=[64,32,16],Tl=-al,jc=al;function Ip(d,a,l,p=al){return l=Li(l),[d*Math.sin(l)*p,-a*p,d*Math.cos(l)*p]}function Mh(d,a,l){return Ip(Math.cos(Li(d)),Math.sin(Li(d)),a,l)}const Ep=6371008.8,$c=2*Math.PI*Ep;class Co{constructor(a,l){if(isNaN(a)||isNaN(l))throw new Error(`Invalid LngLat object: (${a}, ${l})`);if(this.lng=+a,this.lat=+l,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Co(an(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(a){const l=Math.PI/180,p=this.lat*l,g=a.lat*l,m=Math.sin(p)*Math.sin(g)+Math.cos(p)*Math.cos(g)*Math.cos((a.lng-this.lng)*l);return Ep*Math.acos(Math.min(m,1))}toBounds(a=0){const l=360*a/40075017,p=l/Math.cos(Math.PI/180*this.lat);return new kd({lng:this.lng-p,lat:this.lat-l},{lng:this.lng+p,lat:this.lat+l})}toEcef(a){return Mh(this.lat,this.lng,al+a*al/Ep)}static convert(a){if(a instanceof Co)return a;if(Array.isArray(a)&&(2===a.length||3===a.length))return new Co(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&"object"==typeof a&&null!==a)return new Co(Number("lng"in a?a.lng:a.lon),Number(a.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class kd{constructor(a,l){if(a)if(l)this.setSouthWest(a).setNorthEast(l);else if(4===a.length){const p=a;this.setSouthWest([p[0],p[1]]).setNorthEast([p[2],p[3]])}else{const p=a;this.setSouthWest(p[0]).setNorthEast(p[1])}}setNorthEast(a){return this._ne=a instanceof Co?new Co(a.lng,a.lat):Co.convert(a),this}setSouthWest(a){return this._sw=a instanceof Co?new Co(a.lng,a.lat):Co.convert(a),this}extend(a){const l=this._sw,p=this._ne;let g,m;if(a instanceof Co)g=a,m=a;else{if(!(a instanceof kd))return Array.isArray(a)?4===a.length||a.every(Array.isArray)?this.extend(kd.convert(a)):this.extend(Co.convert(a)):"object"==typeof a&&null!==a&&a.hasOwnProperty("lat")&&(a.hasOwnProperty("lon")||a.hasOwnProperty("lng"))?this.extend(Co.convert(a)):this;if(g=a._sw,m=a._ne,!g||!m)return this}return l||p?(l.lng=Math.min(g.lng,l.lng),l.lat=Math.min(g.lat,l.lat),p.lng=Math.max(m.lng,p.lng),p.lat=Math.max(m.lat,p.lat)):(this._sw=new Co(g.lng,g.lat),this._ne=new Co(m.lng,m.lat)),this}getCenter(){return new Co((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Co(this.getWest(),this.getNorth())}getSouthEast(){return new Co(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(a){const{lng:l,lat:p}=Co.convert(a);let g=this._sw.lng<=l&&l<=this._ne.lng;return this._sw.lng>this._ne.lng&&(g=this._sw.lng>=l&&l>=this._ne.lng),this._sw.lat<=p&&p<=this._ne.lat&&g}static convert(a){if(a)return a instanceof kd?a:new kd(a)}}function Mp(d){return $c*Math.cos(d*Math.PI/180)}function Gc(d){return(180+d)/360}function Rd(d){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+d*Math.PI/360)))/360}function sl(d,a){return d/Mp(a)}function Xl(d){return 360*d-180}function ps(d){return 360/Math.PI*Math.atan(Math.exp((180-360*d)*Math.PI/180))-90}function py(d,a){return d*Mp(ps(a))}const Xr=85.051129;function Tm(d){return Math.cos(Li(ht(d,-Xr,Xr)))}function uu(d,a){const l=ht(a,0,25.5),p=Math.pow(2,l);return Tm(d)*$c/(512*p)}function f(d){return 1/Math.cos(d*Math.PI/180)}function s(d,a=0){const l=Math.exp(Math.PI*(1-(d.y+a/pn)/(1<=k?(_(d,a,l,F,S,m,R,T,k),_(d,F,S,p,g,R,b,T,k)):d.push(b)}function v(d,a,l){let p=d[0],g=p.x,m=p.y;a(p);const b=[p];for(let T=1;Td.x+1||pd.y+1)&&ki("Geometry exceeds allowed extent, reduce your vector tile buffer size"),d}function H(d,a,l){const p=d.loadGeometry(),g=d.extent,m=pn/g;if(a&&l&&l.projection.isReprojectedInTileSpace){const b=1<{const A=Xl((a.x+L.x/g)/b),P=ps((a.y+L.y/g)/b),z=S.project(A,P);L.x=(z.x*T-k)*g,L.y=(z.y*T-F)*g};for(let L=0;L=g||P.y<0||P.y>=g||(R(P),A.push(P));p[L]=A}}for(const b of p)for(const T of b)U(T,m);return p}function G(d,a){return{type:d.type,id:d.id,properties:d.properties,geometry:a?H(d):[]}}function W(d,a,l,p,g){d.emplaceBack(2*a+(p+1)/2,2*l+(g+1)/2)}function Q(d,a,l){d.emplaceBack(a.x,a.y,a.z,16384*l[0],16384*l[1],16384*l[2])}class ae{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(l=>l.fqid),this.index=a.index,this.hasPattern=!1,this.projection=a.projection,this.layoutVertexArray=new Cd,this.indexArray=new Ir,this.segments=new Yr,this.programConfigurations=new Tp(a.layers,{zoom:a.zoom,lut:a.lut}),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id)}updateFootprints(a,l){}populate(a,l,p,g){const m=this.layers[0],b=[];let T=null;"circle"===m.type&&(T=m.layout.get("circle-sort-key"));for(const{feature:F,id:S,index:R,sourceLayerIndex:L}of a){const A=this.layers[0]._featureFilter.needGeometry,P=G(F,A);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),P,p))continue;const z=T?T.evaluate(P,{},p):void 0,j={id:S,properties:F.properties,type:F.type,sourceLayerIndex:L,index:R,geometry:A?P.geometry:H(F,p,g),patterns:{},sortKey:z};b.push(j)}T&&b.sort((F,S)=>F.sortKey-S.sortKey);let k=null;"globe"===g.projection.name&&(this.globeExtVertexArray=new Pf,k=g.projection);for(const F of b){const{geometry:S,index:R,sourceLayerIndex:L}=F,A=a[R].feature;this.addFeature(F,S,R,l.availableImages,p,k,l.brightness),l.featureIndex.insert(A,S,R,L,this.index)}}update(a,l,p,g,m,b,T){this.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,F0.members),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=a.createVertexBuffer(this.globeExtVertexArray,dy.members))),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(a,l,p,g,m,b,T){for(const k of l)for(const F of k){const S=F.x,R=F.y;if(S<0||S>=pn||R<0||R>=pn)continue;if(b){const P=b.projectTilePoint(S,R,m),z=b.upVector(m,S,R),j=this.globeExtVertexArray;Q(j,P,z),Q(j,P,z),Q(j,P,z),Q(j,P,z)}const L=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),A=L.vertexLength;W(this.layoutVertexArray,S,R,-1,-1),W(this.layoutVertexArray,S,R,1,-1),W(this.layoutVertexArray,S,R,1,1),W(this.layoutVertexArray,S,R,-1,1),this.indexArray.emplaceBack(A,A+1,A+2),this.indexArray.emplaceBack(A,A+2,A+3),L.vertexLength+=4,L.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,p,{},g,m,T)}}function ie(d,a){for(let l=0;l1){if(De(d,a))return!0;for(let p=0;p1?l:l.sub(a)._mult(g)._add(a))}function Pe(d,a){let l,p,g,m=!1;for(let b=0;ba.y!=g.y>a.y&&a.x<(g.x-p.x)*(a.y-p.y)/(g.y-p.y)+p.x&&(m=!m)}return m}function Ae(d,a){let l=!1;for(let p=0,g=d.length-1;pa.y!=b.y>a.y&&a.x<(b.x-m.x)*(a.y-m.y)/(b.y-m.y)+m.x&&(l=!l)}return l}function Ve(d,a,l,p,g){for(const b of d)if(a<=b.x&&l<=b.y&&p>=b.x&&g>=b.y)return!0;const m=[new Xt(a,l),new Xt(a,g),new Xt(p,g),new Xt(p,l)];if(d.length>2)for(const b of m)if(Ae(d,b))return!0;for(let b=0;bg.x&&a.x>g.x||d.yg.y&&a.y>g.y)return!1;const m=Lc(d,a,l[0]);return m!==Lc(d,a,l[1])||m!==Lc(d,a,l[2])||m!==Lc(d,a,l[3])}function vt(d,a,l,p,g,m){let b=a.y-d.y,T=d.x-a.x;if(m=m||0){const k=b*b+T*T;if(0===k)return!0;const F=Math.sqrt(k);b/=F,T/=F}return!((l.x-d.x)*b+(l.y-d.y)*T-m<0||(p.x-d.x)*b+(p.y-d.y)*T-m<0||(g.x-d.x)*b+(g.y-d.y)*T-m<0)}function Ke(d,a,l,p,g,m,b){return!(vt(d,a,p,g,m,b)||vt(a,l,p,g,m,b)||vt(l,d,p,g,m,b)||vt(p,g,d,a,l,b)||vt(g,m,d,a,l,b)||vt(m,p,d,a,l,b))}function Mt(d,a,l){const p=a.paint.get(d).value;return"constant"===p.kind?p.value:l.programConfigurations.get(a.id).getMaxValue(d)}function Rt(d){return Math.sqrt(d[0]*d[0]+d[1]*d[1])}function nt(d,a,l,p,g){if(!a[0]&&!a[1])return d;const m=Xt.convert(a)._mult(g);"viewport"===l&&m._rotate(-p);const b=[];for(let T=0;T0;S--)k=1<this.canonical.z?new Kt(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Kt(a,this.wrap,a,this.canonical.x>>l,this.canonical.y>>l)}calculateScaledKey(a,l=!0){if(this.overscaledZ===a&&l)return this.key;if(a>this.canonical.z)return en(this.wrap*+l,a,this.canonical.z,this.canonical.x,this.canonical.y);{const p=this.canonical.z-a;return en(this.wrap*+l,a,a,this.canonical.x>>p,this.canonical.y>>p)}}isChildOf(a){if(a.wrap!==this.wrap)return!1;const l=this.canonical.z-a.canonical.z;return 0===a.overscaledZ||a.overscaledZ>l&&a.canonical.y===this.canonical.y>>l}children(a){if(this.overscaledZ>=a)return[new Kt(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const l=this.canonical.z+1,p=2*this.canonical.x,g=2*this.canonical.y;return[new Kt(l,this.wrap,l,p,g),new Kt(l,this.wrap,l,p+1,g),new Kt(l,this.wrap,l,p,g+1),new Kt(l,this.wrap,l,p+1,g+1)]}isLessThan(a){return this.wrapa.wrap)&&(this.overscaledZa.overscaledZ)&&(this.canonical.xa.canonical.x)&&this.canonical.y{let a=d.canonical.x-1,l=d.wrap;return a<0&&(a=(1<{let a=d.canonical.x+1,l=d.wrap;return a===1<new Kt(d.overscaledZ,d.wrap,d.canonical.z,d.canonical.x,(0===d.canonical.y?1<new Kt(d.overscaledZ,d.wrap,d.canonical.z,d.canonical.x,d.canonical.y===(1<=0;if(0===m)return 0;m!==a.length&&(l=!1)}return l?2:1}function ur(d,a){for(const l of d.projections){const p=Fo(a,d.points[0],l.axis);if(l.projection[1]p[1])return 0}return 1}function tn(d,a){let l=0;const p=[0,0,0,0];for(let g=0;g=0&&l++;return l}class yo{constructor(a,l){this.points=a||new Array(8).fill([0,0,0]),this.planes=l||new Array(6).fill([0,0,0,0]),this.bounds=$n.fromPoints(this.points),this.projections=[],this.frustumEdges=[Ze.vec3.sub([],this.points[2],this.points[3]),Ze.vec3.sub([],this.points[0],this.points[3]),Ze.vec3.sub([],this.points[4],this.points[0]),Ze.vec3.sub([],this.points[5],this.points[1]),Ze.vec3.sub([],this.points[6],this.points[2]),Ze.vec3.sub([],this.points[7],this.points[3])];for(const p of this.frustumEdges){const g=[0,-p[2],p[1]],m=[p[2],0,-p[0]];this.projections.push({axis:g,projection:Fo(this.points,this.points[0],g)}),this.projections.push({axis:m,projection:Fo(this.points,this.points[0],m)})}}static fromInvProjectionMatrix(a,l,p,g){const m=Math.pow(2,p),b=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(F=>{const S=Ze.vec4.transformMat4([],F,a),R=1/S[3]/l*m;return Ze.vec4.mul(S,S,[R,R,g?1/S[3]:R,R])}),T=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(F=>{const S=Ze.vec3.sub([],b[F[0]],b[F[1]]),R=Ze.vec3.sub([],b[F[2]],b[F[1]]),L=Ze.vec3.normalize([],Ze.vec3.cross([],S,R)),A=-Ze.vec3.dot(L,b[F[1]]);return L.concat(A)}),k=[];for(let F=0;FF[1]||F[0]>k[1])return 0}return 1}containsPoint(a){for(const l of this.planes){const p=l[3];if(Ze.vec3.dot([l[0],l[1],l[2]],a)+p<0)return!1}return!0}}class $n{static fromPoints(a){const l=[1/0,1/0,1/0],p=[-1/0,-1/0,-1/0];for(const g of a)Ze.vec3.min(l,l,g),Ze.vec3.max(p,p,g);return new $n(l,p)}static fromTileIdAndHeight(a,l,p){const g=1<a.max[l]||a.min[l]>this.max[l])return!1;return!0}intersectsAabbXY(a){return!(this.min[0]>a.max[0]||a.min[0]>this.max[0]||this.min[1]>a.max[1]||a.min[1]>this.max[1])}encapsulate(a){for(let l=0;l<3;l++)this.min[l]=Math.min(this.min[l],a.min[l]),this.max[l]=Math.max(this.max[l],a.max[l])}encapsulatePoint(a){for(let l=0;l<3;l++)this.min[l]=Math.min(this.min[l],a[l]),this.max[l]=Math.max(this.max[l],a[l])}closestPoint(a){return[Math.max(Math.min(this.max[0],a[0]),this.min[0]),Math.max(Math.min(this.max[1],a[1]),this.min[1]),Math.max(Math.min(this.max[2],a[2]),this.min[2])]}}function no(d){return d*al/Ep}En($n,"Aabb");const Mo=[new $n([Tl,Tl,Tl],[jc,jc,jc]),new $n([Tl,Tl,Tl],[0,0,jc]),new $n([0,Tl,Tl],[jc,0,jc]),new $n([Tl,0,Tl],[0,jc,jc]),new $n([0,0,Tl],[jc,jc,jc])];function Do(d,a,l,p=!0){const g=Ze.vec3.scale([],d._camera.position,d.worldSize),m=[a,l,1,1];Ze.vec4.transformMat4(m,m,d.pixelMatrixInverse),Ze.vec4.scale(m,m,1/m[3]);const b=Ze.vec3.sub([],m,g),T=Ze.vec3.normalize([],b),k=d.globeMatrix,F=[k[12],k[13],k[14]],S=Ze.vec3.sub([],F,g),R=Ze.vec3.length(S),L=Ze.vec3.normalize([],S),A=d.worldSize/(2*Math.PI),P=Ze.vec3.dot(L,T),z=Math.asin(A/R);if(z1?null:function(p,g,m,b){const T=Math.sin(m);return p*(Math.sin((1-b)*m)/T)+g*(Math.sin(b*m)/T)}(d.a[a],d.b[a],d.angle,ht(l,0,1))+d.center[a]}function aa(d){if(d.z<=1)return Mo[d.z+2*d.y+d.x];const a=bo(Mr(d));return $n.fromPoints(a)}function Ta(d,a,l){return Ze.vec3.scale(d,d,1-l),Ze.vec3.scaleAndAdd(d,d,a,l)}function vc(d,a,l){for(const p of d)Ze.vec3.transformMat4(p,p,a),Ze.vec3.scale(p,p,l)}function $s(d,a,l,p){const g=a/d.worldSize,m=d.globeMatrix;if(l.z<=1){const ve=aa(l).getCorners();return vc(ve,m,g),$n.fromPoints(ve)}const b=Mr(l,p),T=bo(b,al+no(d._tileCoverLift));vc(T,m,g);const k=Number.MAX_VALUE,F=[-k,-k,-k],S=[k,k,k];if(b.contains(d.center)){for(const Fe of T)Ze.vec3.min(S,S,Fe),Ze.vec3.max(F,F,Fe);F[2]=0;const ve=d.point,ye=[ve.x*g,ve.y*g,0];return Ze.vec3.min(S,S,ye),Ze.vec3.max(F,F,ye),new $n(S,F)}if(d._tileCoverLift>0){for(const ve of T)Ze.vec3.min(S,S,ve),Ze.vec3.max(F,F,ve);return new $n(S,F)}const R=[m[12]*g,m[13]*g,m[14]*g],L=b.getCenter(),A=ht(d.center.lat,-Xr,Xr),P=ht(L.lat,-Xr,Xr),z=Gc(d.center.lng),j=Rd(A);let $=z-Gc(L.lng);const K=j-Rd(P);$>.5?$-=1:$<-.5&&($+=1);let J=0;if(Math.abs($)>Math.abs(K))J=$>=0?1:3;else{J=K>=0?0:2;const ve=[m[4]*g,m[5]*g,m[6]*g],ye=-Math.sin(Li(K>=0?b.getSouth():b.getNorth()))*al;Ze.vec3.scaleAndAdd(R,R,ve,ye)}const Z=T[J],ne=T[(J+1)%4],oe=new xr(Z,ne,R),le=[Ua(oe,0)||Z[0],Ua(oe,1)||Z[1],Ua(oe,2)||Z[2]],xe=fs(d.zoom);if(xe>0){const ve=function({x:Fe,y:Se,z:Ne},Ge,He,Xe,Je){const rt=1/(1<.5?gn=-1:dn<-.5&&(gn=1),Qe=((Qe+gn)*Ge-(Xe*=Ge))*He+Xe,It=((It+gn)*Ge-Xe)*He+Xe,jt=(jt*Ge-(Je*=Ge))*He+Je,Et=(Et*Ge-Je)*He+Je,[[Qe,Et,0],[It,Et,0],[It,jt,0],[Qe,jt,0]]}(l,a,d._pixelsPerMercatorPixel,z,j);for(let Fe=0;FeMath.PI/2*1.01}const Gs=Li(85),Dm=Math.cos(Gs),Da=Math.sin(Gs),hu=Ze.mat4.create(),Ap=d=>{const a=[];return"map"===d.paint.get("circle-pitch-alignment")&&a.push("PITCH_WITH_MAP"),"map"===d.paint.get("circle-pitch-scale")&&a.push("SCALE_WITH_MAP"),a};function vg(d,a,l,p,g,m,b,T,k){if(m&&d.queryGeometry.isAboveHorizon)return!1;m&&(k*=d.pixelToTileUnitsFactor);const F=d.tileID.canonical,S=l.projection.upVectorScale(F,l.center.lat,l.worldSize).metersToTile;for(const R of a)for(const L of R){const A=L.add(T),P=g&&l.elevation?l.elevation.exaggeration()*g.getElevationAt(A.x,A.y,!0):0,z=l.projection.projectTilePoint(A.x,A.y,F);if(P>0){const J=l.projection.upVector(F,A.x,A.y);z.x+=J[0]*S*P,z.y+=J[1]*S*P,z.z+=J[2]*S*P}const j=m?A:Od(z.x,z.y,z.z,p),$=m?d.tilespaceRays.map(J=>bw(J,P)):d.queryGeometry.screenGeometry,K=Ze.vec4.transformMat4([],[z.x,z.y,z.z,1],p);if(!b&&m?k*=K[3]/l.cameraToCenterDistance:b&&!m&&(k*=l.cameraToCenterDistance/K[3]),m){const J=ps((L.y/pn+F.y)/(1<d.width||g.height>d.height||l.x>d.width-g.width||l.y>d.height-g.height)throw new RangeError("out of range source coordinates for image copy");if(g.width>a.width||g.height>a.height||p.x>a.width-g.width||p.y>a.height-g.height)throw new RangeError("out of range destination coordinates for image copy");const k=d.data,F=a.data,S=4===m&&T;for(let R=0;R{a[d.evaluationKey]=k;const F=d.expression.evaluate(a);F&&(g.data[b+T+0]=Math.floor(255*F.r/F.a),g.data[b+T+1]=Math.floor(255*F.g/F.a),g.data[b+T+2]=Math.floor(255*F.b/F.a),g.data[b+T+3]=Math.floor(255*F.a))};if(d.clips)for(let b=0,T=0;b80*l){T=1/0,k=1/0;let S=-1/0,R=-1/0;for(let L=l;LS&&(S=A),P>R&&(R=P)}F=Math.max(S-T,R-k),F=0!==F?32767/F:0}return Dl(m,b,l,T,k,F,0),b}function ww(d,a,l,p,g){let m;if(g===function(b,T,k,F){let S=0;for(let R=T,L=k-F;R0)for(let b=a;b=a;b-=p)m=Iw(b/p|0,d[b],d[b+1],m);return m&&j0(m,m.next)&&(Tg(m),m=m.next),m}function kp(d,a){if(!d)return d;a||(a=d);let l,p=d;do{if(l=!1,p.steiner||!j0(p,p.next)&&0!==Ja(p.prev,p,p.next))p=p.next;else{if(Tg(p),p=a=p.prev,p===p.next)break;l=!0}}while(l||p!==a);return a}function Dl(d,a,l,p,g,m,b){if(!d)return;!b&&m&&function(k,F,S,R){let L=k;do{0===L.z&&(L.z=Sw(L.x,L.y,F,S,R)),L.prevZ=L.prev,L.nextZ=L.next,L=L.next}while(L!==k);L.prevZ.nextZ=null,L.prevZ=null,function(A){let P,z=1;do{let j,$=A;A=null;let K=null;for(P=0;$;){P++;let J=$,Z=0;for(let oe=0;oe0||ne>0&&J;)0!==Z&&(0===ne||!J||$.z<=J.z)?(j=$,$=$.nextZ,Z--):(j=J,J=J.nextZ,ne--),K?K.nextZ=j:A=j,j.prevZ=K,K=j;$=J}K.nextZ=null,z*=2}while(P>1)}(L)}(d,p,g,m);let T=d;for(;d.prev!==d.next;){const k=d.prev,F=d.next;if(m?Cw(d,p,g,m):gy(d))a.push(k.i,d.i,F.i),Tg(d),d=F.next,T=F.next;else if((d=F)===T){b?1===b?Dl(d=cD(kp(d),a),a,l,p,g,m,2):2===b&&mA(d,a,l,p,g,m):Dl(kp(d),a,l,p,g,m,1);break}}}function gy(d){const a=d.prev,l=d,p=d.next;if(Ja(a,l,p)>=0)return!1;const g=a.x,m=l.x,b=p.x,T=a.y,k=l.y,F=p.y,S=gm?g>b?g:b:m>b?m:b,A=T>k?T>F?T:F:k>F?k:F;let P=p.next;for(;P!==a;){if(P.x>=S&&P.x<=L&&P.y>=R&&P.y<=A&&Sg(g,T,m,k,b,F,P.x,P.y)&&Ja(P.prev,P,P.next)>=0)return!1;P=P.next}return!0}function Cw(d,a,l,p){const g=d.prev,m=d,b=d.next;if(Ja(g,m,b)>=0)return!1;const T=g.x,k=m.x,F=b.x,S=g.y,R=m.y,L=b.y,A=Tk?T>F?T:F:k>F?k:F,j=S>R?S>L?S:L:R>L?R:L,$=Sw(A,P,a,l,p),K=Sw(z,j,a,l,p);let J=d.prevZ,Z=d.nextZ;for(;J&&J.z>=$&&Z&&Z.z<=K;){if(J.x>=A&&J.x<=z&&J.y>=P&&J.y<=j&&J!==g&&J!==b&&Sg(T,S,k,R,F,L,J.x,J.y)&&Ja(J.prev,J,J.next)>=0||(J=J.prevZ,Z.x>=A&&Z.x<=z&&Z.y>=P&&Z.y<=j&&Z!==g&&Z!==b&&Sg(T,S,k,R,F,L,Z.x,Z.y)&&Ja(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;J&&J.z>=$;){if(J.x>=A&&J.x<=z&&J.y>=P&&J.y<=j&&J!==g&&J!==b&&Sg(T,S,k,R,F,L,J.x,J.y)&&Ja(J.prev,J,J.next)>=0)return!1;J=J.prevZ}for(;Z&&Z.z<=K;){if(Z.x>=A&&Z.x<=z&&Z.y>=P&&Z.y<=j&&Z!==g&&Z!==b&&Sg(T,S,k,R,F,L,Z.x,Z.y)&&Ja(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function cD(d,a){let l=d;do{const p=l.prev,g=l.next.next;!j0(p,g)&&Tw(p,l,l.next,g)&&Em(p,g)&&Em(g,p)&&(a.push(p.i,l.i,g.i),Tg(l),Tg(l.next),l=d=g),l=l.next}while(l!==d);return kp(l)}function mA(d,a,l,p,g,m){let b=d;do{let T=b.next.next;for(;T!==b.prev;){if(b.i!==T.i&&_A(b,T)){let k=Dw(b,T);return b=kp(b,b.next),k=kp(k,k.next),Dl(b,a,l,p,g,m,0),void Dl(k,a,l,p,g,m,0)}T=T.next}b=b.next}while(b!==d)}function dD(d,a){return d.x-a.x}function fA(d,a){const l=function(g,m){let b=m;const T=g.x,k=g.y;let F,S=-1/0;do{if(k<=b.y&&k>=b.next.y&&b.next.y!==b.y){const z=b.x+(k-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(z<=T&&z>S&&(S=z,F=b.x=b.x&&b.x>=L&&T!==b.x&&Sg(kF.x||b.x===F.x&&uD(F,b)))&&(F=b,P=z)}b=b.next}while(b!==R);return F}(d,a);if(!l)return a;const p=Dw(l,d);return kp(p,p.next),kp(l,l.next)}function uD(d,a){return Ja(d.prev,d,a.prev)<0&&Ja(a.next,d,d.next)<0}function Sw(d,a,l,p,g){return(d=1431655765&((d=858993459&((d=252645135&((d=16711935&((d=(d-l)*g|0)|d<<8))|d<<4))|d<<2))|d<<1))|(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-p)*g|0)|a<<8))|a<<4))|a<<2))|a<<1))<<1}function hD(d){let a=d,l=d;do{(a.x=(d-b)*(m-T)&&(d-b)*(p-T)>=(l-b)*(a-T)&&(l-b)*(m-T)>=(g-b)*(p-T)}function _A(d,a){return d.next.i!==a.i&&d.prev.i!==a.i&&!function(l,p){let g=l;do{if(g.i!==l.i&&g.next.i!==l.i&&g.i!==p.i&&g.next.i!==p.i&&Tw(g,g.next,l,p))return!0;g=g.next}while(g!==l);return!1}(d,a)&&(Em(d,a)&&Em(a,d)&&function(l,p){let g=l,m=!1;const b=(l.x+p.x)/2,T=(l.y+p.y)/2;do{g.y>T!=g.next.y>T&&g.next.y!==g.y&&b<(g.next.x-g.x)*(T-g.y)/(g.next.y-g.y)+g.x&&(m=!m),g=g.next}while(g!==l);return m}(d,a)&&(Ja(d.prev,d,a.prev)||Ja(d,a.prev,a))||j0(d,a)&&Ja(d.prev,d,d.next)>0&&Ja(a.prev,a,a.next)>0)}function Ja(d,a,l){return(a.y-d.y)*(l.x-a.x)-(a.x-d.x)*(l.y-a.y)}function j0(d,a){return d.x===a.x&&d.y===a.y}function Tw(d,a,l,p){const g=yy(Ja(d,a,l)),m=yy(Ja(d,a,p)),b=yy(Ja(l,p,d)),T=yy(Ja(l,p,a));return g!==m&&b!==T||!(0!==g||!by(d,l,a))||!(0!==m||!by(d,p,a))||!(0!==b||!by(l,d,p))||!(0!==T||!by(l,a,p))}function by(d,a,l){return a.x<=Math.max(d.x,l.x)&&a.x>=Math.min(d.x,l.x)&&a.y<=Math.max(d.y,l.y)&&a.y>=Math.min(d.y,l.y)}function yy(d){return d>0?1:d<0?-1:0}function Em(d,a){return Ja(d.prev,d,d.next)<0?Ja(d,a,d.next)>=0&&Ja(d,d.prev,a)>=0:Ja(d,a,d.prev)<0||Ja(d,d.next,a)<0}function Dw(d,a){const l=$0(d.i,d.x,d.y),p=$0(a.i,a.x,a.y),g=d.next,m=a.prev;return d.next=a,a.prev=d,l.next=g,g.prev=l,p.next=l,l.prev=p,m.next=p,p.prev=m,p}function Iw(d,a,l,p){const g=$0(d,a,l);return p?(g.next=p.next,g.prev=p,p.next.prev=g,p.next=g):(g.prev=g,g.next=g),g}function Tg(d){d.next.prev=d.prev,d.prev.next=d.next,d.prevZ&&(d.prevZ.nextZ=d.nextZ),d.nextZ&&(d.nextZ.prevZ=d.prevZ)}function $0(d,a,l){return{i:d,x:a,y:l,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function G0(d,a){const l=d.length;if(l<=1)return[d];const p=[];let g,m;for(let b=0;b1)for(let b=0;bl.fqid),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Cd,this.indexArray=new Ir,this.indexArray2=new fe,this.programConfigurations=new Tp(a.layers,{zoom:a.zoom,lut:a.lut}),this.segments=new Yr,this.segments2=new Yr,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.projection=a.projection}updateFootprints(a,l){}populate(a,l,p,g){this.hasPattern=Ew("fill",this.layers,this.pixelRatio,l);const m=this.layers[0].layout.get("fill-sort-key"),b=[];for(const{feature:T,id:k,index:F,sourceLayerIndex:S}of a){const R=this.layers[0]._featureFilter.needGeometry,L=G(T,R);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),L,p))continue;const A=m?m.evaluate(L,{},p,l.availableImages):void 0,P={id:k,properties:T.properties,type:T.type,sourceLayerIndex:S,index:F,geometry:R?L.geometry:H(T,p,g),patterns:{},sortKey:A};b.push(P)}m&&b.sort((T,k)=>T.sortKey-k.sortKey);for(const T of b){const{geometry:k,index:F,sourceLayerIndex:S}=T;if(this.hasPattern){const R=Mw("fill",this.layers,T,this.zoom,this.pixelRatio,l);this.patternFeatures.push(R)}else this.addFeature(T,k,F,p,{},l.availableImages,l.brightness,l.elevationFeatures);l.featureIndex.insert(a[F].feature,k,F,S,this.index)}}update(a,l,p,g,m,b,T){this.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T)}addFeatures(a,l,p,g,m,b){for(const T of this.patternFeatures)this.addFeature(T,T.geometry,T.index,l,p,g,b,a.elevationFeatures)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,Wc),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.indexBuffer2=a.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(a,l,p,g,m,b=[],T,k){for(const F of G0(l,500)){let S=0;for(const j of F)S+=j.length;const R=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray),L=R.vertexLength,A=[],P=[];for(const j of F){if(0===j.length)continue;j!==F[0]&&P.push(A.length/2);const $=this.segments2.prepareSegment(j.length,this.layoutVertexArray,this.indexArray2),K=$.vertexLength;this.layoutVertexArray.emplaceBack(j[0].x,j[0].y),this.indexArray2.emplaceBack(K+j.length-1,K),A.push(j[0].x),A.push(j[0].y);for(let J=1;JR.cellIdx-L.cellIdx||R.triIdx-L.triIdx);let S=0;for(;Sthis.max.x||this.min.x>a.x||a.y>this.max.y||this.min.y>a.y)return;const p=Ah(a.x-this.min.x,this.xScale,this.cellsX),g=Ah(a.y-this.min.y,this.yScale,this.cellsY),m=this.cells[g*this.cellsX+p];if(m){this._lazyInitLookup();for(let b=0;bthis.max.x||this.min.x>l.x||a.y>this.max.y||this.min.y>l.y)return;this._lazyInitLookup();const g=Ah(a.x-this.min.x,this.xScale,this.cellsX),m=Ah(l.x-this.min.x,this.xScale,this.cellsX),b=Ah(a.y-this.min.y,this.yScale,this.cellsY),T=Ah(l.y-this.min.y,this.yScale,this.cellsY);for(let k=b;k<=T;k++)for(let F=g;F<=m;F++){const S=this.cells[k*this.cellsX+F];if(S)for(let R=0;Rl.fqid),this.index=a.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.footprints=[]}updateFootprints(a,l){for(const p of this.footprints)l.push({footprint:p,id:a})}populate(a,l,p,g){const m=[];for(const{feature:b,id:T,index:k,sourceLayerIndex:F}of a){const S=this.layers[0]._featureFilter.needGeometry,R=G(b,S);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),R,p))continue;const L={id:T,properties:b.properties,type:b.type,sourceLayerIndex:F,index:k,geometry:S?R.geometry:H(b,p,g),patterns:{}};m.push(L)}for(const b of m){const{geometry:T,index:k,sourceLayerIndex:F}=b;this.addFeature(b,T,k,p,{},l.availableImages,l.brightness),l.featureIndex.insert(a[k].feature,T,k,F,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(a){}update(a,l,p,g,m,b,T){}destroy(){}addFeature(a,l,p,g,m,b=[],T){for(const k of G0(l,2)){const F=[],S=[],R=[],L=new Xt(1/0,1/0),A=new Xt(-1/0,-1/0);for(const j of k)if(0!==j.length){j!==k[0]&&R.push(S.length/2);for(let $=0;$>3}if(k--,1===T||2===T)F+=g.readSVarint(),S+=g.readSVarint(),1===T&&(m&&R.push(m),m=[]),m.push(new d(F,S));else{if(7!==T)throw new Error("unknown command "+T);m&&m.push(m[0].clone())}}return m&&R.push(m),R},a.prototype.bbox=function(){var g=this._pbf;g.pos=this._geometry;for(var m=g.readVarint()+g.pos,b=1,T=0,k=0,F=0,S=1/0,R=-1/0,L=1/0,A=-1/0;g.pos>3}if(T--,1===b||2===b)(k+=g.readSVarint())R&&(R=k),(F+=g.readSVarint())A&&(A=F);else if(7!==b)throw new Error("unknown command "+b)}return[S,L,R,A]},a.prototype.toGeoJSON=function(g,m,b){var T,k,F=this.extent*Math.pow(2,b),S=this.extent*g,R=this.extent*m,L=this.loadGeometry(),A=a.types[this.type];function P($){for(var K=0;K<$.length;K++){var J=$[K];$[K]=[360*(J.x+S)/F-180,360/Math.PI*Math.atan(Math.exp((180-360*(J.y+R)/F)*Math.PI/180))-90]}}switch(this.type){case 1:var z=[];for(T=0;T>3;T=1===F?b.readString():2===F?b.readFloat():3===F?b.readDouble():4===F?b.readVarint64():5===F?b.readVarint():6===F?b.readSVarint():7===F?b.readBoolean():null}return T}(m))}return bD=a,a.prototype.feature=function(p){if(p<0||p>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[p];var g=this._pbf.readVarint()+this._pbf.pos;return new d(this._pbf,g,this.extent,this._keys,this._values)},bD}function wy(){return W0||(W0=1,Dg.VectorTile=function(){if(vD)return Rp;vD=1;var d=Pw();function a(l,p,g){if(3===l){var m=new d(g,g.readVarint()+g.pos);m.length&&(p[m.name]=m)}}return Rp=function(l,p){this.layers=l.readFields(a,{},p)}}(),Dg.VectorTileFeature=Z0(),Dg.VectorTileLayer=Pw()),Dg}var Mm=wy();class Uu extends Xt{constructor(a,l,p){super(a,l),this.z=p}}class Cy extends Uu{constructor(a,l,p,g){super(a,l,p),this.w=g}}function Hu(d,a,l,p){const g=[],m=0===p?(b,T,k,F,S,R)=>{b.push(new Xt(R,k+(R-T)/(F-T)*(S-k)))}:(b,T,k,F,S,R)=>{b.push(new Xt(T+(R-k)/(S-k)*(F-T),R))};for(const b of d){const T=[];for(const k of b){if(k.length<=2)continue;const F=[];for(let L=0;La&&m(F,A,P,z,j,a):$>l?K=a&&m(F,A,P,z,j,a),K>l&&$<=l&&m(F,A,P,z,j,l)}let S=k[k.length-1];const R=0===p?S.x:S.y;R>=a&&R<=l&&F.push(S),F.length&&(S=F[F.length-1],F[0].x===S.x&&F[0].y===S.y||F.push(F[0]),T.push(F))}T.length&&g.push(T)}return g}function Y0(d,a,l,p){const g="x"===l?"y":"x",m=(p-d[l])/(a[l]-d[l]);d[g]=d[g]+(a[g]-d[g])*m,d[l]=p,d.hasOwnProperty("z")&&(d.z=Un(d.z,a.z,m)),d.hasOwnProperty("w")&&(d.w=Un(d.w,a.w,m))}function Sy(d,a,l,p){const g=l,m=p;for(const b of["x","y"]){let T=d,k=a;T[b]>=k[b]&&(T=a,k=d),T[b]g&&Y0(T,k,b,g),T[b]m&&Y0(k,T,b,m)}}const Am=Number.MAX_SAFE_INTEGER;function X0(d,a,l,p){return d.orderb===g));var g,m}function Ig(d,a){return d.x-a.x||d.y-a.y}function Ty(d,a){return 0===Ig(d.min,a.min)&&0===Ig(d.max,a.max)}function K0(d,a){return!(d.min.x>a.max.x||d.max.xa.max.y||d.max.ynew Xt((k.x+m.x*pn)*T-b.x*pn,(k.y+m.y*pn)*T-b.y*pn))}return Lw(l,g,d.indices,0,d.indices.length,0,0)}function Q0(d,a,l,p){const g=Math.pow(2,p.z-l.z);return new Xt((d+l.x*pn)*g-p.x*pn,(a+l.y*pn)*g-p.y*pn)}function Nw(d,a){const l=[];a.grid.queryPoint(d,l);const p=a.indices,g=a.vertices;for(let m=0;m0&&(p.length>1&&l.push(p),p=[])}return p.length>1&&l.push(p),l}const Iy=Mm.VectorTileFeature.types,Eg=["fill-extrusion-base","fill-extrusion-height","fill-extrusion-color","fill-extrusion-pattern","fill-extrusion-flood-light-wall-radius","fill-extrusion-line-width","fill-extrusion-emissive-strength"],wD=["fill-extrusion-flood-light-ground-radius"],Zc=Math.pow(2,13),lF=Math.pow(2,15)-1,Ey=new Xt(0,1),km=2147483648;function kh(d,a,l,p,g,m,b,T){d.emplaceBack((a<<1)+b,(l<<1)+m,(Math.floor(p*Zc)<<1)+g,Math.round(T))}function Gf(d,a,l){d.emplaceBack(a.x*pn,a.y*pn,l?1:0)}function My(d,a,l,p,g,m){d.emplaceBack(a.x,a.y,(l.x<<1)+p,(l.y<<1)+g,m)}function Mg(d,a,l){d.emplaceBack(a.x,a.y,a.z,16384*l[0],16384*l[1],16384*l[2])}class zw{constructor(){this.vertexOffset=0,this.vertexCount=0,this.indexOffset=0,this.indexCount=0}}class Ag{constructor(){this.centroidXY=new Xt(0,0),this.vertexArrayOffset=0,this.vertexCount=0,this.groundVertexArrayOffset=0,this.groundVertexCount=0,this.flags=0,this.footprintSegIdx=-1,this.footprintSegLen=0,this.polygonSegIdx=-1,this.polygonSegLen=0,this.min=new Xt(Number.MAX_VALUE,Number.MAX_VALUE),this.max=new Xt(-Number.MAX_VALUE,-Number.MAX_VALUE),this.height=0}span(){return new Xt(this.max.x-this.min.x,this.max.y-this.min.y)}}class As{constructor(){this.acc=new Xt(0,0),this.accCount=0,this.centroidDataIndex=0}startRing(a,l){a.min.x===Number.MAX_VALUE&&(a.min.x=a.max.x=l.x,a.min.y=a.max.y=l.y)}appendEdge(a,l,p){this.accCount++,this.acc._add(l);let g=!!this.borders;l.xa.max.x&&(a.max.x=l.x,g=!0),l.ya.max.y&&(a.max.y=l.y,g=!0),((0===l.x||l.x===pn)&&l.x===p.x)!=((0===l.y||l.y===pn)&&l.y===p.y)&&this.processBorderOverlap(l,p),g&&this.checkBorderIntersection(l,p)}checkBorderIntersection(a,l){l.x<0!=a.x<0&&this.addBorderIntersection(0,Un(l.y,a.y,(0-l.x)/(a.x-l.x))),l.x>pn!=a.x>pn&&this.addBorderIntersection(1,Un(l.y,a.y,(pn-l.x)/(a.x-l.x))),l.y<0!=a.y<0&&this.addBorderIntersection(2,Un(l.x,a.x,(0-l.y)/(a.y-l.y))),l.y>pn!=a.y>pn&&this.addBorderIntersection(3,Un(l.x,a.x,(pn-l.y)/(a.y-l.y)))}addBorderIntersection(a,l){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const p=this.borders[a];lp[1]&&(p[1]=l)}processBorderOverlap(a,l){if(a.x===l.x){if(a.y===l.y)return;const p=0===a.x?0:1;this.addBorderIntersection(p,l.y),this.addBorderIntersection(p,a.y)}else{const p=0===a.y?2:3;this.addBorderIntersection(p,l.x),this.addBorderIntersection(p,a.x)}}centroid(){return 0===this.accCount?new Xt(0,0):new Xt(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce((a,l)=>a+ +(l[0]!==Number.MAX_VALUE),0):0}}function CD(d,a){const l=d.add(a)._unit(),p=ht(d.x*l.x+d.y*l.y,-1,1);var g,m,b;return b=Math.acos(p),Math.min(4,Math.max(-4,Math.tan(b)))/4*lF*((g=d).x*(m=a).y-g.y*m.x<0?-1:1)}const SD=[d=>d.x<0,d=>d.x>pn,d=>d.y<0,d=>d.y>pn];function cF(d,a,l,p){const g=[4];if(0===p)return g;l._mult(p);const m=d.sub(l),b=a.sub(l),T=[d,a,m,b];for(let k=0;k<4;k++)for(const F of T)if(SD[k](F)){g.push(k);break}return g}class _s{constructor(a){this.vertexArray=new ug,this.indexArray=new Ir,this.programConfigurations=new Tp(a.layers,{zoom:a.zoom,lut:a.lut},l=>wD.includes(l)),this._segments=new Yr,this.hiddenByLandmarkVertexArray=new mg,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Yr}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(a,l,p,g=!1){const m=a.length;if(m>2){let b=Math.max(0,this._segments.get().length-1);const T=this._segments._prepareSegment(4*m,this.vertexArray.length,2*this._segmentToGroundQuads[b].length);let k;b!==this._segments.get().length-1&&(b++,this._segmentToGroundQuads[b]=[],this._segmentToRegionTriCounts[b]=[0,0,0,0,0]);{const F=a[0],S=a[1];k=CD(F.sub(a[m-1])._perp()._unit(),S.sub(F)._perp()._unit())}for(let F=0;Fg.region-m.region);for(let p=0;pk+F,0);let T=0;for(let k=0;k<=4;k++){const F=b[k];if(0!==F){let S=this.regionSegments[k];S||(S=this.regionSegments[k]=new Yr);const R={vertexOffset:m.vertexOffset,primitiveOffset:m.primitiveOffset+T,vertexLength:m.vertexLength,primitiveLength:F};S.get().push(R)}T+=F}for(let k=0;k0?this.hiddenByLandmarkVertexBuffer=a.createVertexBuffer(this.hiddenByLandmarkVertexArray,sF.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let a=0;a<=4;a++){const l=this.regionSegments[a];l&&l.destroy()}}}}class qf{constructor(a){this.zoom=a.zoom,this.canonical=a.canonical,this.overscaling=a.overscaling,this.layers=a.layers,this.pixelRatio=a.pixelRatio,this.layerIds=this.layers.map(l=>l.fqid),this.index=a.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=a.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Ir,this.footprintVertices=new Cd,this.footprintSegments=[],this.layoutVertexArray=new Fu,this.centroidVertexArray=new Yl,this.wallVertexArray=new cy,this.indexArray=new Ir,this.programConfigurations=new Tp(a.layers,{zoom:a.zoom,lut:a.lut},l=>Eg.includes(l)),this.segments=new Yr,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.groundEffect=new _s(a),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(a,l){}populate(a,l,p,g){this.features=[],this.hasPattern=Ew("fill-extrusion",this.layers,this.pixelRatio,l),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.selfDEMTileTimestamp=Number.MAX_VALUE,this.borderDEMTileTimestamp=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE],this.tileToMeter=s(p),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:m,id:b,index:T,sourceLayerIndex:k}of a){const F=this.layers[0]._featureFilter.needGeometry,S=G(m,F);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),S,p))continue;const R={id:b,sourceLayerIndex:k,index:T,geometry:F?S.geometry:H(m,p,g),properties:m.properties,type:m.type,patterns:{}},L=this.layoutVertexArray.length,A="Polygon"===Iy[R.type];if(this.hasPattern)this.features.push(Mw("fill-extrusion",this.layers,R,this.zoom,this.pixelRatio,l));else if(this.wallMode)for(const P of R.geometry)for(const z of e1(P,A))this.addFeature(R,[z],T,p,{},l.availableImages,g,l.brightness);else this.addFeature(R,R.geometry,T,p,{},l.availableImages,g,l.brightness);l.featureIndex.insert(m,R.geometry,T,k,this.index,L)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(a,l,p,g,m,b){for(const T of this.features){const k="Polygon"===Iy[T.type],{geometry:F}=T;if(this.wallMode)for(const S of F)for(const R of e1(S,k))this.addFeature(T,[R],T.index,l,p,g,m,b);else this.addFeature(T,F,T.index,l,p,g,m,b)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(a,l,p,g,m,b,T){this.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T),this.groundEffect.update(a,l,m,p,g,b,T)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,Rw),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.wallVertexBuffer=a.createVertexBuffer(this.wallVertexArray,xy.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=a.createVertexBuffer(this.layoutVertexExtArray,Kr.members,!0)),this.groundEffect.upload(a)),this.groundEffect.uploadPaintProperties(a),this.programConfigurations.upload(a),this.uploaded=!0}uploadCentroid(a){this.groundEffect.uploadHiddenByLandmark(a),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=a.createVertexBuffer(this.centroidVertexArray,kw.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(a,l,p,g,m,b,T,k){const F=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(a,{})/this.tileToMeter,S=[new Xt(0,0),new Xt(pn,pn)],R=T.projection,L="globe"===R.name,A=this.wallMode||"Polygon"===Iy[a.type],P=new As;P.centroidDataIndex=this.centroidData.length;const z=new Ag,j=this.layers[0].paint.get("fill-extrusion-base").evaluate(a,{},g)<=0,$=this.layers[0].paint.get("fill-extrusion-height").evaluate(a,{},g);let K;if(z.height=$,z.vertexArrayOffset=this.layoutVertexArray.length,z.groundVertexArrayOffset=this.groundEffect.vertexArray.length,L&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new Pf),this.wallMode){if(L)return void ki("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==l.length)return;K=function(ye){const Fe=ye[0].x===ye[ye.length-1].x&&ye[0].y===ye[ye.length-1].y;(function(Qt){let Wt=0;const Vn=Qt.length;for(let bn=0;bn=0})(ye)||(ye=ye.reverse());const Ne={geometry:[],joinNormals:[],indices:[]},Ge=[],He=[],Xe=[];let Je=ye.length;for(;Je>=2&&ye[Je-1].equals(ye[Je-2]);)Je--;if(Je<(Fe?3:2))return Ne;let rt,Qe,It,jt,Et,gn=0;for(;gn0;let fi="miter";const Oi=2;"miter"===fi&&bn>Oi&&(fi="bevel"),"bevel"===fi&&(bn>100&&(fi="flipbevel"),bn{const ko=new Xt(Ii.x,Ii.y),Ci=new Xt(Ii.x,Ii.y);ko.x+=Bi.x*nr,ko.y+=Bi.y*nr,Ci.x-=Bi.x*Math.max(ji,1),Ci.y-=Bi.y*Math.max(ji,1),Xe.push(Bi),Ge.push(ko),He.push(Ci)};if("miter"===fi)Wt._mult(bn),Si(rt,Wt,0,0);else if("flipbevel"===fi)Wt=Et.mult(-1),Si(rt,Wt,0,0),Si(rt,Wt.mult(-1),0,0);else{const Ii=-Math.sqrt(bn*bn-1),Bi=An?Ii:0,ji=An?0:Ii;Qe&&Si(rt,jt,Bi,ji),It&&Si(rt,Et,Bi,ji)}}Ne.geometry=[...Ge,...He.reverse(),Ge[0]],Ne.joinNormals=[...Xe,...Xe.reverse(),Xe[Xe.length-1]];const dn=Ne.geometry.length-1;for(let Qt=0;Qtye<(Fe.length-1)/2||ye===Fe.length-1,Z=this.wallMode?[l]:G0(l,500);for(let ye=Z.length-1;ye>=0;ye--){const Fe=Z[ye];(0===Fe.length||(ne=Fe[0]).every(Se=>Se.x<=0)||ne.every(Se=>Se.x>=pn)||ne.every(Se=>Se.y<=0)||ne.every(Se=>Se.y>=pn))&&Z.splice(ye,1)}var ne;let oe;if(L)oe=DD(Z,S,g);else{oe=[];for(const ye of Z)oe.push({polygon:ye,bounds:S})}const le=A?this.edgeRadius:0,xe=le>0&&this.zoom<17,ve=(ye,Fe)=>{if(0===ye.length)return!1;const Se=ye[ye.length-1];return Fe.x===Se.x&&Fe.y===Se.y};for(const{polygon:ye,bounds:Fe}of oe){let Se=0,Ne=0;for(const Je of ye)A&&!Je[0].equals(Je[Je.length-1])&&Je.push(Je[0]),Ne+=A?Je.length-1:Je.length;const Ge=this.segments.prepareSegment((A?5:4)*Ne,this.layoutVertexArray,this.indexArray);z.footprintSegIdx<0&&(z.footprintSegIdx=this.footprintSegments.length),z.polygonSegIdx<0&&(z.polygonSegIdx=this.polygonSegments.length);const He={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},Xe=new zw;if(Xe.vertexOffset=this.footprintVertices.length,Xe.indexOffset=3*this.footprintIndices.length,Xe.ringIndices=[],A){const Je=[],rt=[];Se=Ge.vertexLength;for(let It=0;It4&&kg(rt[rt.length-2],rt[0],rt[1]),It=le?Qr(rt[rt.length-2],rt[0],rt[1],le):0;const jt=[];let Et,gn,dn;gn=rt[1].sub(rt[0])._perp()._unit();let Qt=!0;for(let Wt=1,Vn=0;Wt0?1:0,Bi=bn.dist(An);if(Vn+Bi>32768&&(Vn=0),le){dn=fi.sub(An)._perp()._unit();let Ci=Wf(bn,An,fi,Bw(gn,dn),le);isNaN(Ci)&&(Ci=0);const No=An.sub(bn)._unit();bn=bn.add(No.mult(It))._round(),An=An.add(No.mult(-Ci))._round(),It=Ci,gn=dn,j&&this.zoom>=17&&(ve(jt,bn)||jt.push(bn),ve(jt,An)||jt.push(An))}const ji=Ge.vertexLength,nr=rt.length>4&&kg(bn,An,fi);let ko=Ay(Vn,Qe,Qt);if(kh(this.layoutVertexArray,bn.x,bn.y,Si,Ii,0,0,ko),kh(this.layoutVertexArray,bn.x,bn.y,Si,Ii,0,1,ko),this.wallMode){const Ci=J(Wt-1,rt),No=K.joinNormals[Wt-1];Gf(this.wallVertexArray,No,Ci),Gf(this.wallVertexArray,No,Ci)}if(Vn+=Bi,ko=Ay(Vn,nr,!Qt),Qe=nr,kh(this.layoutVertexArray,An.x,An.y,Si,Ii,0,0,ko),kh(this.layoutVertexArray,An.x,An.y,Si,Ii,0,1,ko),this.wallMode){const Ci=J(Wt,rt),No=K.joinNormals[Wt];Gf(this.wallVertexArray,No,Ci),Gf(this.wallVertexArray,No,Ci)}if(Ge.vertexLength+=4,this.indexArray.emplaceBack(ji+0,ji+1,ji+2),this.indexArray.emplaceBack(ji+1,ji+3,ji+2),Ge.primitiveLength+=2,le){const Ci=Se+(1===Wt?rt.length-2:Wt-2),No=1===Wt?Se:Ci+1;if(this.indexArray.emplaceBack(ji+1,Ci,ji+3),this.indexArray.emplaceBack(Ci,No,ji+3),Ge.primitiveLength+=2,void 0===Et&&(Et=ji),!Rm(fi,rt[Wt],Fe)){const Vo=Wt===rt.length-1?Et:Ge.vertexLength;this.indexArray.emplaceBack(ji+2,ji+3,Vo),this.indexArray.emplaceBack(ji+3,Vo+1,Vo),this.indexArray.emplaceBack(ji+3,No,Vo+1),Ge.primitiveLength+=3}Qt=!Qt}if(L){const Ci=this.layoutVertexExtArray,No=R.projectTilePoint(bn.x,bn.y,g),Vo=R.projectTilePoint(An.x,An.y,g),pr=R.upVector(g,bn.x,bn.y),la=R.upVector(g,An.x,An.y);Mg(Ci,No,pr),Mg(Ci,No,pr),Mg(Ci,Vo,la),Mg(Ci,Vo,la)}}A&&(Se+=rt.length-1),j&&le&&this.zoom>=17&&(0!==jt.length&&ve(jt,jt[0])&&jt.pop(),this.groundEffect.addData(jt,Fe,F,le>0))}this.footprintSegments.push(Xe),He.triangleCount=this.indexArray.length-He.triangleArrayOffset,this.polygonSegments.push(He),++z.footprintSegLen,++z.polygonSegLen}if(z.vertexCount=this.layoutVertexArray.length-z.vertexArrayOffset,z.groundVertexCount=this.groundEffect.vertexArray.length-z.groundVertexArrayOffset,0!==z.vertexCount){if(z.centroidXY=P.borders?Ey:this.encodeCentroid(P,z),this.centroidData.push(z),P.borders){this.featuresOnBorder.push(P);const ye=this.featuresOnBorder.length-1;for(let Fe=0;Fethis.featuresOnBorder[l].borders[a][0]-this.featuresOnBorder[p].borders[a][0])}splitToSubtiles(){const a=[];for(let T=0;Tpn),S=2*F+(+(k.min.x+k.max.x>pn)^F);for(let R=0;RT.triangleSegmentIdx===k.triangleSegmentIdx?T.subtile-k.subtile:T.triangleSegmentIdx-k.triangleSegmentIdx);let p=0,g=0,m=0;for(const T of a){if(T.triangleSegmentIdx!==p)break;m++}const b=a.length;for(;g!==a.length;){p=a[g].triangleSegmentIdx;let T=0,k=g,F=g;for(let S=k;S0&&this.triangleSubSegments.push({segment:A,min:R,max:L}),k=F;for(let P=k;P[z[0]*(1-$[0])+j[0]*$[0],z[1]*(1-$[1])+j[1]*$[1]],A=[],P=[];for(const z of this.triangleSubSegments){A[0]=z.min.x/pn,A[1]=z.min.y/pn,P[0]=z.max.x/pn,P[1]=z.max.y/pn;const j=L(S,R,A),$=L(S,R,P);if(0===new $n([j[0],j[1],m],[$[0],$[1],b]).intersectsPrecise(p)){F&&(g.segments.push(F),F=void 0);continue}const K=z.segment;F&&F.vertexOffset!==K.vertexOffset&&(g.segments.push(F),F=void 0),F?(F.vertexLength+=K.vertexLength,F.primitiveLength+=K.primitiveLength):F={vertexOffset:K.vertexOffset,primitiveLength:K.primitiveLength,vertexLength:K.vertexLength,primitiveOffset:K.primitiveOffset,sortKey:void 0,vaos:{}}}return F&&g.segments.push(F),g}encodeCentroid(a,l){const p=a.centroid(),g=l.span(),m=Math.min(7,Math.round(g.x*this.tileToMeter/10)),b=Math.min(7,Math.round(g.y*this.tileToMeter/10));return new Xt(ht(p.x,1,8191)<<3|m,ht(p.y,1,8191)<<3|b)}encodeBorderCentroid(a){if(!a.borders)return new Xt(0,0);const l=a.borders,p=Number.MAX_VALUE;if(l[0][0]!==p||l[1][0]!==p){const g=l[0][0]!==p?0:1;return new Xt(6|(l[0][0]!==p?0:65528),(l[g][0]+l[g][1])/2<<3|6)}{const g=l[2][0]!==p?2:3;return new Xt((l[g][0]+l[g][1])/2<<3|6,6|(l[2][0]!==p?0:65528))}}showCentroid(a){const l=this.centroidData[a.centroidDataIndex];l.flags&=km,l.centroidXY.x=0,l.centroidXY.y=0,this.writeCentroidToBuffer(l)}writeCentroidToBuffer(a){this.groundEffect.updateHiddenByLandmark(a);const l=a.vertexArrayOffset,p=a.vertexCount+a.vertexArrayOffset,g=a.flags&km?Ey:a.centroidXY,m=this.centroidVertexArray.geta_centroid_pos0(l);if(this.centroidVertexArray.geta_centroid_pos1(l)!==g.y||m!==g.x){for(let b=l;bk.max.x||k.min.x>b.max.x||b.min.y>k.max.y||k.min.y>b.max.y))for(let F=0;Fl!=A>l&&a<(this.footprintVertices.int16[2*(S+b.vertexOffset)+0]-R)*(l-L)/(A-L)+R&&(g=!g)}T=k}}return g}getHeightAtTileCoord(a,l){let p=Number.NEGATIVE_INFINITY,g=!0;const m=4*(a+pn)*pn+(l+pn);if(this.partLookup.hasOwnProperty(m)){const b=this.partLookup[m];return b?{height:b.height,hidden:!!(b.flags&km)}:void 0}for(const b of this.centroidData)a>b.max.x||b.min.x>a||l>b.max.y||b.min.y>l||this.footprintContainsPoint(a,l,b)&&b&&b.height>p&&(p=b.height,this.partLookup[m]=b,g=!!(b.flags&km));if(p!==Number.NEGATIVE_INFINITY)return{height:p,hidden:g};this.partLookup[m]=void 0}}function Bw(d,a){const l=d.add(a)._unit();return d.x*l.x+d.y*l.y}function Qr(d,a,l,p){const g=a.sub(d)._perp()._unit(),m=l.sub(a)._perp()._unit();return Wf(d,a,l,Bw(g,m),p)}function Wf(d,a,l,p,g){const m=Math.sqrt(1-p*p);return Math.min(d.dist(a)/3,a.dist(l)/3,g*m/p)}function Rm(d,a,l){return d.xl[1].x&&a.x>l[1].x||d.yl[1].y&&a.y>l[1].y}function Rh(d,a){return d.xa[1].x||d.ya[1].y}function kg(d,a,l){if(d.x<0||d.x>=pn||a.x<0||a.x>=pn||l.x<0||l.x>=pn)return!1;const p=l.sub(a),g=p.perp(),m=d.sub(a);return(p.x*m.x+p.y*m.y)/Math.sqrt((p.x*p.x+p.y*p.y)*(m.x*m.x+m.y*m.y))>-.866&&g.x*m.x+g.y*m.y<0}function Ay(d,a,l){const p=a?2|d:-3&d;return l?1|p:-2&p}function TD(){const d=Math.PI/32,a=Math.tan(d),l=Ep;return l*Math.sqrt(1+2*a*a)-l}function DD(d,a,l){const p=1<{for(const xe of oe)P.push({polygon:xe,bounds:le})},j=Math.ceil(Math.log2(S)),$=Math.ceil(Math.log2(R)),K=j-$,J=[];for(let oe=0;oe0?0:1);for(let oe=0;oele+1?ne.push({polygons:Ge,bounds:Xe,depth:le+1}):z(Ge,Xe)}if(He.length){const Xe=[new Xt(0===xe?Ne:ve.x,1===xe?Ne:ve.y),ye];J.length>le+1?ne.push({polygons:He,bounds:Xe,depth:le+1}):z(He,Xe)}}return P}(d,a,Math.ceil((m-g)/11.25),Math.ceil((b-T)/11.25),1,(k,F,S)=>{if(0===k)return.5*(F+S);{const R=ps((l.y+F/pn)/p);return(Rd(.5*(ps((l.y+S/pn)/p)+R))*p-l.y)*pn}})}function Rg(d,a,l,p,g,m){const b=Math.pow(2,p.z-g.z);for(let T=0;T1&&(k=a[++T]);const S=Math.abs(F-k.left),R=Math.abs(F-k.right),L=Math.min(S,R);let A;const P=m/p*(g+1);if(k.isDash){const z=g-Math.abs(P);A=Math.sqrt(L*L+z*z)}else A=g-Math.sqrt(L*L+P*P);this.image.data[b+F]=Math.max(0,Math.min(255,A+128))}}}addRegularDash(a,l){for(let k=a.length-1;k>=0;--k){const F=a[k],S=a[k+1];F.zeroLength?a.splice(k,1):S&&S.isDash===F.isDash&&(S.left=F.left,a.splice(k,1))}const p=a[0],g=a[a.length-1];p.isDash===g.isDash&&(p.left=g.left-this.width,g.right=p.right+this.width);const m=this.width*this.nextRow;let b=0,T=a[b];for(let k=0;k1&&(T=a[++b]);const F=Math.abs(k-T.left),S=Math.abs(k-T.right),R=Math.min(F,S);this.image.data[m+k]=Math.max(0,Math.min(255,(T.isDash?R:-R)+l+128))}}addDash(a,l){const p=this.getKey(a,l);if(this.positions[p])return this.positions[p];const g="round"===l,m=g?7:0,b=2*m+1;if(this.nextRow+b>this.height)return ki("LineAtlas out of space"),null;0===a.length&&a.push(1);let T=0;for(let S=0;Sl.fqid),this.index=a.index,this.projection=a.projection,this.hasPattern=!1,this.hasZOffset=!1,this.hasCrossSlope=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(l=>{this.gradients[l.id]={}}),this.layoutVertexArray=new gp,this.layoutVertexArray2=new Cl,this.patternVertexArray=new Cl,this.indexArray=new Ir,this.programConfigurations=new Tp(a.layers,{zoom:a.zoom,lut:a.lut}),this.segments=new Yr,this.maxLineLength=0,this.zOffsetVertexArray=new Cl,this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.tessellationStep=a.tessellationStep?a.tessellationStep:128}updateFootprints(a,l){}populate(a,l,p,g){this.hasPattern=Ew("line",this.layers,this.pixelRatio,l);const m=this.layers[0].layout.get("line-sort-key");this.tileToMeter=s(p);const b=this.layers[0].layout.get("line-z-offset"),T=b.isConstant()&&!b.constantOr(0),k=this.layers[0].layout.get("line-elevation-reference");this.hasZOffset="sea"===k||"ground"===k||!T&&"none"===k,this.hasZOffset&&"none"===k&&ki(`line-elevation-reference: ground is used for the layer ${this.layerIds[0]} because non-zero line-z-offset value was found.`);const F=this.layers[0].layout.get("line-cross-slope");this.hasCrossSlope=this.hasZOffset&&void 0!==F;const S=[];for(const{feature:P,id:z,index:j,sourceLayerIndex:$}of a){const K=this.layers[0]._featureFilter.needGeometry,J=G(P,K);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),J,p))continue;const Z=m?m.evaluate(J,{},p):void 0,ne={id:z,properties:P.properties,type:P.type,sourceLayerIndex:$,index:j,geometry:K?J.geometry:H(P,p,g),patterns:{},sortKey:Z};S.push(ne)}m&&S.sort((P,z)=>P.sortKey-z.sortKey);const{lineAtlas:R,featureIndex:L}=l,A=this.addConstantDashes(R);for(const P of S){const{geometry:z,index:j,sourceLayerIndex:$}=P;if(A&&this.addFeatureDashes(P,R),this.hasPattern){const K=Mw("line",this.layers,P,this.zoom,this.pixelRatio,l);this.patternFeatures.push(K)}else this.addFeature(P,z,j,p,R.positions,l.availableImages,l.brightness);L.insert(a[j].feature,z,j,$,this.index)}}addConstantDashes(a){let l=!1;for(const p of this.layers){const g=p.paint.get("line-dasharray").value,m=p.layout.get("line-cap").value;if("constant"!==g.kind||"constant"!==m.kind)l=!0;else{const b=m.value,T=g.value;if(!T)continue;a.addDash(T,b)}}return l}addFeatureDashes(a,l){const p=this.zoom;for(const g of this.layers){const m=g.paint.get("line-dasharray").value,b=g.layout.get("line-cap").value;if("constant"===m.kind&&"constant"===b.kind)continue;let T,k;if("constant"===m.kind){if(T=m.value,!T)continue}else T=m.evaluate({zoom:p},a);k="constant"===b.kind?b.value:b.evaluate({zoom:p},a),l.addDash(T,k),a.patterns[g.id]=l.getKey(T,k)}}update(a,l,p,g,m,b,T){this.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T)}addFeatures(a,l,p,g,m,b){for(const T of this.patternFeatures)this.addFeature(T,T.geometry,T.index,l,p,g,b)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=a.createVertexBuffer(this.layoutVertexArray2,wc)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=a.createVertexBuffer(this.patternVertexArray,Il)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=a.createVertexBuffer(this.zOffsetVertexArray,ED.members,!0)),this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,MD),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(a){if(a.properties&&a.properties.hasOwnProperty("mapbox_clip_start")&&a.properties.hasOwnProperty("mapbox_clip_end"))return{start:+a.properties.mapbox_clip_start,end:+a.properties.mapbox_clip_end}}addFeature(a,l,p,g,m,b,T){const k=this.layers[0].layout,F=k.get("line-join").evaluate(a,{}),S=k.get("line-cap").evaluate(a,{}),R=k.get("line-miter-limit"),L=k.get("line-round-limit");this.lineClips=this.lineFeatureClips(a),this.lineFeature=a,this.zOffsetValue=k.get("line-z-offset").value;const A=this.layers[0].paint.get("line-width").value;"constant"!==A.kind&&!1===A.isLineProgressConstant&&(this.variableWidthValue=A);for(const P of l)this.addLine(P,a,g,F,S,R,L);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,p,m,b,g,T)}addLine(a,l,p,g,m,b,T){this.distance=0,this.prevDistance=0,this.scaledDistance=0,this.totalDistance=0,this.totalFeatureLength=0,this.lineSoFar=0,this.currentVertex=void 0;const k="none"===g;if(this.patternJoinNone=this.hasPattern&&k,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let J=0;J=2&&a[S-1].equals(a[S-2]);)S--;let R=0;for(;R0,Ne=this.overscaling<=16?15*pn/(512*this.overscaling):0;if(Z&&"round"===ne)if(veb&&(ne="bevel"),"bevel"===ne&&(ve>2&&(ne="flipbevel"),ve2*Ne){const Xe=A.sub(A.sub(P)._mult(Ne/Ge)._round());this.updateDistance(P,Xe),this.addCurrentVertex(Xe,j,0,0,L,K),P=Xe}this.updateDistance(P,A),le._mult(ve),this.addCurrentVertex(A,le,0,0,L,K);const He=A.dist(z);if(He>2*Ne){const Xe=A.add(z.sub(A)._mult(Ne/He)._round());this.updateDistance(A,Xe),this.addCurrentVertex(Xe,$,0,0,L,K),A=Xe}}else le._mult(ve),this.addCurrentVertex(A,le,0,0,L,K);else if("flipbevel"===ne){if(ve>100)le=$.mult(-1);else{const Ge=ve*j.add($).mag()/j.sub($).mag();le._perp()._mult(Ge*(Se?-1:1))}this.addCurrentVertex(A,le,0,0,L,K),this.addCurrentVertex(A,le.mult(-1),0,0,L,K)}else if("bevel"===ne||"fakeround"===ne){null!=K&&P&&this.addCurrentVertex(A,j,-1,-1,L,K);const Ge=A.dist(P)<=2*Ne&&"bevel"!==ne,He=le.mult(Se?1:-1);He._mult(ve);const Xe=$.mult(Se?-1:1),Je=j.mult(Se?-1:1),rt=this.evaluateLineProgressFeatures(this.distance);if(null==K&&(this.addHalfVertex(A,He.x,He.y,!1,!Se,0,L,rt),Ge||this.addHalfVertex(A,He.x+2*Je.x,He.y+2*Je.y,!1,Se,0,L,rt)),"fakeround"===ne){const Qe=Math.round(180*ye/Math.PI/20);this.addHalfVertex(A,Je.x,Je.y,!1,Se,0,L,rt);for(let It=0;It1){this.lineSoFar=a.w;const z=(l.x-a.x)/R,j=(l.y-a.y)/R,$=(l.z-a.z)/R,K=(l.w-a.w)/R;for(let J=1;J=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,S),k.primitiveLength++),b?this.e2=S:this.e1=S,null!=F&&this.zOffsetVertexArray.emplaceBack(F.zOffset,F.variableWidth,F.variableWidth)}updateScaledDistance(){this.lineClips?(this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=this.totalFeatureLength*this.lineClips.start+this.distance):this.lineSoFar=this.distance}updateDistance(a,l){this.prevDistance=this.distance,this.distance+=a.dist(l),this.updateScaledDistance()}}function Hw(d,a,l){return d.xl||d.yl}let xA,jw;function RD(d,a,l){return a*(pn/(d.tileSize*Math.pow(2,l-d.tileID.overscaledZ)))}En(n1,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const wA=(d,a,l)=>(1-l)*d+l*a;function Oy(d,a){return 1/RD(d,1,a.tileZoom)}function o1(d,a,l,p){return d.translatePosMatrix(p||a.tileID.projMatrix,a,l.paint.get("line-translate"),l.paint.get("line-translate-anchor"))}const r1=d=>{const a=[];Yf(d)&&a.push("RENDER_LINE_DASH"),d.paint.get("line-gradient")&&a.push("RENDER_LINE_GRADIENT");const l=d.paint.get("line-trim-offset");0===l[0]&&0===l[1]||a.push("RENDER_LINE_TRIM_OFFSET"),0!==d.paint.get("line-border-width").constantOr(1)&&a.push("RENDER_LINE_BORDER");const p="none"===d.layout.get("line-join").constantOr("miter"),g=!!d.paint.get("line-pattern").constantOr(1);return p&&g&&a.push("LINE_JOIN_NONE"),a};function Yf(d){const a=d.paint.get("line-dasharray").value;return a.value||"constant"!==a.kind}let Pg;const Py=()=>Pg||(Pg={layout:xA||(xA=new fr({"line-cap":new Tn(lt.layout_line["line-cap"]),"line-join":new Tn(lt.layout_line["line-join"]),"line-miter-limit":new nn(lt.layout_line["line-miter-limit"]),"line-round-limit":new nn(lt.layout_line["line-round-limit"]),"line-sort-key":new Tn(lt.layout_line["line-sort-key"]),"line-z-offset":new Tn(lt.layout_line["line-z-offset"]),"line-elevation-reference":new nn(lt.layout_line["line-elevation-reference"]),"line-cross-slope":new nn(lt.layout_line["line-cross-slope"]),visibility:new nn(lt.layout_line.visibility),"line-width-unit":new nn(lt.layout_line["line-width-unit"])})),paint:jw||(jw=new fr({"line-opacity":new Tn(lt.paint_line["line-opacity"]),"line-color":new Tn(lt.paint_line["line-color"]),"line-translate":new nn(lt.paint_line["line-translate"]),"line-translate-anchor":new nn(lt.paint_line["line-translate-anchor"]),"line-width":new Tn(lt.paint_line["line-width"]),"line-gap-width":new Tn(lt.paint_line["line-gap-width"]),"line-offset":new Tn(lt.paint_line["line-offset"]),"line-blur":new Tn(lt.paint_line["line-blur"]),"line-dasharray":new Tn(lt.paint_line["line-dasharray"]),"line-pattern":new Tn(lt.paint_line["line-pattern"]),"line-gradient":new jo(lt.paint_line["line-gradient"]),"line-trim-offset":new nn(lt.paint_line["line-trim-offset"]),"line-trim-fade-range":new nn(lt.paint_line["line-trim-fade-range"]),"line-trim-color":new nn(lt.paint_line["line-trim-color"]),"line-emissive-strength":new nn(lt.paint_line["line-emissive-strength"]),"line-border-width":new Tn(lt.paint_line["line-border-width"]),"line-border-color":new Tn(lt.paint_line["line-border-color"]),"line-occlusion-opacity":new nn(lt.paint_line["line-occlusion-opacity"]),"line-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"line-gradient-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"line-trim-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"line-border-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"})}))},Pg);class Lg extends Tn{possiblyEvaluate(a,l){return l=new ar(Math.floor(l.zoom),{now:l.now,fadeDuration:l.fadeDuration,transition:l.transition}),super.possiblyEvaluate(a,l)}evaluate(a,l,p,g){return l=fo({},l,{zoom:Math.floor(l.zoom)}),super.evaluate(a,l,p,g)}}let Xf;function a1(d,a){return a>0?a+2*d:d}const OD=wo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),PD=wo([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),$w=wo([{name:"a_projected_pos",components:4,type:"Float32"}],4);wo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const CA=wo([{name:"a_auto_z_offset",components:1,type:"Float32"}],4),SA=wo([{name:"a_texb",components:2,type:"Uint16"}]),Fg=wo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_elevation_from_sea",components:2,type:"Float32"}]),Ly=wo([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"},{name:"a_auto_z_offset",components:1,type:"Float32"}]);wo([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Gw=wo([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),TA=wo([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);wo([{name:"triangle",components:3,type:"Uint16"}]),wo([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),wo([{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Float32",name:"zOffset"},{type:"Uint8",name:"hasIconTextFit"}]),wo([{type:"Float32",name:"offsetX"}]),wo([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);const Oh=128;function s1(d,a,l,p,g){if("camera"===d.kind)return d.maxSize;if("composite"===d.kind){const m=a.possiblyEvaluate(new ar(d.maxZoom),l).evaluate(g,{},l),b=a.possiblyEvaluate(new ar(d.minZoom),l).evaluate(g,{},l);return Math.max(m,b)}return a.possiblyEvaluate(new ar(p)).evaluate(g,{},l)}function qw(d,a){const{expression:l}=a;if("constant"===l.kind)return{kind:"constant",layoutSize:l.evaluate(new ar(d+1))};if("source"===l.kind)return{kind:"source"};{const{zoomStops:p,interpolationType:g}=l;let m=0;for(;m{p.text=function(g,m,b){const T=m.layout.get("text-transform").evaluate(b,{});return"uppercase"===T?g=g.toLocaleUpperCase():"lowercase"===T&&(g=g.toLocaleLowerCase()),go.applyArabicShaping&&(g=go.applyArabicShaping(g)),g}(p.text,a,l)}),d}const Ng={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42","\u2190":"\u2191","\u2192":"\u2193"};function IA(d){return"\ufe36"===d||"\ufe48"===d||"\ufe38"===d||"\ufe44"===d||"\ufe42"===d||"\ufe3e"===d||"\ufe3c"===d||"\ufe3a"===d||"\ufe18"===d||"\ufe40"===d||"\ufe10"===d||"\ufe13"===d||"\ufe14"===d||"\uff40"===d||"\uffe3"===d||"\ufe11"===d||"\ufe12"===d}function EA(d){return"\ufe35"===d||"\ufe47"===d||"\ufe37"===d||"\ufe43"===d||"\ufe41"===d||"\ufe3d"===d||"\ufe3b"===d||"\ufe39"===d||"\ufe17"===d||"\ufe3f"===d}var Ph,Ww,MA,Ny={};function zy(){if(MA)return Ww;MA=1,Ww=a;var d=function dF(){return Ph||(Ph=1,Ny.read=function(d,a,l,p,g){var m,b,T=8*g-p-1,k=(1<>1,S=-7,R=l?g-1:0,L=l?-1:1,A=d[a+R];for(R+=L,m=A&(1<<-S)-1,A>>=-S,S+=T;S>0;m=256*m+d[a+R],R+=L,S-=8);for(b=m&(1<<-S)-1,m>>=-S,S+=p;S>0;b=256*b+d[a+R],R+=L,S-=8);if(0===m)m=1-F;else{if(m===k)return b?NaN:1/0*(A?-1:1);b+=Math.pow(2,p),m-=F}return(A?-1:1)*b*Math.pow(2,m-p)},Ny.write=function(d,a,l,p,g,m){var b,T,k,F=8*m-g-1,S=(1<>1,L=23===g?Math.pow(2,-24)-Math.pow(2,-77):0,A=p?0:m-1,P=p?1:-1,z=a<0||0===a&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(T=isNaN(a)?1:0,b=S):(b=Math.floor(Math.log(a)/Math.LN2),a*(k=Math.pow(2,-b))<1&&(b--,k*=2),(a+=b+R>=1?L/k:L*Math.pow(2,1-R))*k>=2&&(b++,k/=2),b+R>=S?(T=0,b=S):b+R>=1?(T=(a*k-1)*Math.pow(2,g),b+=R):(T=a*Math.pow(2,R-1)*Math.pow(2,g),b=0));g>=8;d[l+A]=255&T,A+=P,T/=256,g-=8);for(b=b<0;d[l+A]=255&b,A+=P,b/=256,F-=8);d[l+A-P]|=128*z}),Ny}();function a(Z){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(Z)?Z:new Uint8Array(Z||0),this.pos=0,this.type=0,this.length=this.buf.length}a.Varint=0,a.Fixed64=1,a.Bytes=2,a.Fixed32=5;var l=4294967296,p=1/l,g=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function m(Z){return Z.type===a.Bytes?Z.readVarint()+Z.pos:Z.pos+1}function T(Z,ne,oe){var le=ne<=16383?1:ne<=2097151?2:ne<=268435455?3:Math.floor(Math.log(ne)/(7*Math.LN2));oe.realloc(le);for(var xe=oe.pos-1;xe>=Z;xe--)oe.buf[xe+le]=oe.buf[xe]}function k(Z,ne){for(var oe=0;oe>>8,Z[oe+2]=ne>>>16,Z[oe+3]=ne>>>24}function J(Z,ne){return(Z[ne]|Z[ne+1]<<8|Z[ne+2]<<16)+(Z[ne+3]<<24)}return a.prototype={destroy:function(){this.buf=null},readFields:function(Z,ne,oe){for(oe=oe||this.length;this.pos>3,ve=this.pos;this.type=7&le,Z(xe,ne,this),this.pos===ve&&this.skip(le)}return ne},readMessage:function(Z,ne){return this.readFields(Z,ne,this.readVarint()+this.pos)},readFixed32:function(){var Z=$(this.buf,this.pos);return this.pos+=4,Z},readSFixed32:function(){var Z=J(this.buf,this.pos);return this.pos+=4,Z},readFixed64:function(){var Z=$(this.buf,this.pos)+$(this.buf,this.pos+4)*l;return this.pos+=8,Z},readSFixed64:function(){var Z=$(this.buf,this.pos)+J(this.buf,this.pos+4)*l;return this.pos+=8,Z},readFloat:function(){var Z=d.read(this.buf,this.pos,!0,23,4);return this.pos+=4,Z},readDouble:function(){var Z=d.read(this.buf,this.pos,!0,52,8);return this.pos+=8,Z},readVarint:function(Z){var ne,oe,le=this.buf;return ne=127&(oe=le[this.pos++]),oe<128?ne:(ne|=(127&(oe=le[this.pos++]))<<7,oe<128?ne:(ne|=(127&(oe=le[this.pos++]))<<14,oe<128?ne:(ne|=(127&(oe=le[this.pos++]))<<21,oe<128?ne:function(xe,ve,ye){var Fe,Se,Ne=ye.buf;if(Fe=(112&(Se=Ne[ye.pos++]))>>4,Se<128||(Fe|=(127&(Se=Ne[ye.pos++]))<<3,Se<128)||(Fe|=(127&(Se=Ne[ye.pos++]))<<10,Se<128)||(Fe|=(127&(Se=Ne[ye.pos++]))<<17,Se<128)||(Fe|=(127&(Se=Ne[ye.pos++]))<<24,Se<128)||(Fe|=(1&(Se=Ne[ye.pos++]))<<31,Se<128))return function b(Z,ne,oe){return oe?4294967296*ne+(Z>>>0):4294967296*(ne>>>0)+(Z>>>0)}(xe,Fe,ve);throw new Error("Expected varint not more than 10 bytes")}(ne|=(15&(oe=le[this.pos]))<<28,Z,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var Z=this.readVarint();return Z%2==1?(Z+1)/-2:Z/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var Z=this.readVarint()+this.pos,ne=this.pos;return this.pos=Z,Z-ne>=12&&g?g.decode(this.buf.subarray(ne,Z)):function(oe,le,xe){for(var ve="",ye=le;ye239?4:Ge>223?3:Ge>191?2:1;if(ye+Xe>xe)break;1===Xe?Ge<128&&(He=Ge):2===Xe?128==(192&(Fe=oe[ye+1]))&&(He=(31&Ge)<<6|63&Fe)<=127&&(He=null):3===Xe?(Se=oe[ye+2],128==(192&(Fe=oe[ye+1]))&&128==(192&Se)&&((He=(15&Ge)<<12|(63&Fe)<<6|63&Se)<=2047||He>=55296&&He<=57343)&&(He=null)):4===Xe&&(Se=oe[ye+2],Ne=oe[ye+3],128==(192&(Fe=oe[ye+1]))&&128==(192&Se)&&128==(192&Ne)&&((He=(15&Ge)<<18|(63&Fe)<<12|(63&Se)<<6|63&Ne)<=65535||He>=1114112)&&(He=null)),null===He?(He=65533,Xe=1):He>65535&&(He-=65536,ve+=String.fromCharCode(He>>>10&1023|55296),He=56320|1023&He),ve+=String.fromCharCode(He),ye+=Xe}return ve}(this.buf,ne,Z)},readBytes:function(){var Z=this.readVarint()+this.pos,ne=this.buf.subarray(this.pos,Z);return this.pos=Z,ne},readPackedVarint:function(Z,ne){if(this.type!==a.Bytes)return Z.push(this.readVarint(ne));var oe=m(this);for(Z=Z||[];this.pos127;);else if(ne===a.Bytes)this.pos=this.readVarint()+this.pos;else if(ne===a.Fixed32)this.pos+=4;else{if(ne!==a.Fixed64)throw new Error("Unimplemented type: "+ne);this.pos+=8}},writeTag:function(Z,ne){this.writeVarint(Z<<3|ne)},realloc:function(Z){for(var ne=this.length||16;ne268435455||Z<0?function(ne,oe){var le,xe,ve,Fe;if(ne>=0?(le=ne%4294967296|0,xe=ne/4294967296|0):(xe=~(-ne/4294967296),4294967295^(le=~(-ne%4294967296))?le=le+1|0:(le=0,xe=xe+1|0)),ne>=0x10000000000000000||ne<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");oe.realloc(10),ve=le,(Fe=oe).buf[Fe.pos++]=127&ve|128,ve>>>=7,Fe.buf[Fe.pos++]=127&ve|128,ve>>>=7,Fe.buf[Fe.pos++]=127&ve|128,ve>>>=7,Fe.buf[Fe.pos++]=127&ve|128,Fe.buf[Fe.pos]=127&(ve>>>=7),function(ve,ye){var Fe=(7&ve)<<4;ye.buf[ye.pos++]|=Fe|((ve>>>=3)?128:0),ve&&(ye.buf[ye.pos++]=127&ve|((ve>>>=7)?128:0),ve&&(ye.buf[ye.pos++]=127&ve|((ve>>>=7)?128:0),ve&&(ye.buf[ye.pos++]=127&ve|((ve>>>=7)?128:0),ve&&(ye.buf[ye.pos++]=127&ve|((ve>>>=7)?128:0),ve&&(ye.buf[ye.pos++]=127&ve)))))}(xe,oe)}(Z,this):(this.realloc(4),this.buf[this.pos++]=127&Z|(Z>127?128:0),Z<=127||(this.buf[this.pos++]=127&(Z>>>=7)|(Z>127?128:0),Z<=127||(this.buf[this.pos++]=127&(Z>>>=7)|(Z>127?128:0),Z<=127||(this.buf[this.pos++]=Z>>>7&127))))},writeSVarint:function(Z){this.writeVarint(Z<0?2*-Z-1:2*Z)},writeBoolean:function(Z){this.writeVarint(!!Z)},writeString:function(Z){Z=String(Z),this.realloc(4*Z.length),this.pos++;var ne=this.pos;this.pos=function(le,xe,ve){for(var ye,Fe,Se=0;Se55295&&ye<57344){if(!Fe){ye>56319||Se+1===xe.length?(le[ve++]=239,le[ve++]=191,le[ve++]=189):Fe=ye;continue}if(ye<56320){le[ve++]=239,le[ve++]=191,le[ve++]=189,Fe=ye;continue}ye=Fe-55296<<10|ye-56320|65536,Fe=null}else Fe&&(le[ve++]=239,le[ve++]=191,le[ve++]=189,Fe=null);ye<128?le[ve++]=ye:(ye<2048?le[ve++]=ye>>6|192:(ye<65536?le[ve++]=ye>>12|224:(le[ve++]=ye>>18|240,le[ve++]=ye>>12&63|128),le[ve++]=ye>>6&63|128),le[ve++]=63&ye|128)}return ve}(this.buf,Z,this.pos);var oe=this.pos-ne;oe>=128&&T(ne,oe,this),this.pos=ne-1,this.writeVarint(oe),this.pos+=oe},writeFloat:function(Z){this.realloc(4),d.write(this.buf,Z,this.pos,!0,23,4),this.pos+=4},writeDouble:function(Z){this.realloc(8),d.write(this.buf,Z,this.pos,!0,52,8),this.pos+=8},writeBytes:function(Z){var ne=Z.length;this.writeVarint(ne),this.realloc(ne);for(var oe=0;oe=128&&T(oe,le,this),this.pos=oe-1,this.writeVarint(le),this.pos+=le},writeMessage:function(Z,ne,oe){this.writeTag(Z,a.Bytes),this.writeRawMessage(ne,oe)},writePackedVarint:function(Z,ne){ne.length&&this.writeMessage(Z,k,ne)},writePackedSVarint:function(Z,ne){ne.length&&this.writeMessage(Z,F,ne)},writePackedBoolean:function(Z,ne){ne.length&&this.writeMessage(Z,L,ne)},writePackedFloat:function(Z,ne){ne.length&&this.writeMessage(Z,S,ne)},writePackedDouble:function(Z,ne){ne.length&&this.writeMessage(Z,R,ne)},writePackedFixed32:function(Z,ne){ne.length&&this.writeMessage(Z,A,ne)},writePackedSFixed32:function(Z,ne){ne.length&&this.writeMessage(Z,P,ne)},writePackedFixed64:function(Z,ne){ne.length&&this.writeMessage(Z,z,ne)},writePackedSFixed64:function(Z,ne){ne.length&&this.writeMessage(Z,j,ne)},writeBytesField:function(Z,ne){this.writeTag(Z,a.Bytes),this.writeBytes(ne)},writeFixed32Field:function(Z,ne){this.writeTag(Z,a.Fixed32),this.writeFixed32(ne)},writeSFixed32Field:function(Z,ne){this.writeTag(Z,a.Fixed32),this.writeSFixed32(ne)},writeFixed64Field:function(Z,ne){this.writeTag(Z,a.Fixed64),this.writeFixed64(ne)},writeSFixed64Field:function(Z,ne){this.writeTag(Z,a.Fixed64),this.writeSFixed64(ne)},writeVarintField:function(Z,ne){this.writeTag(Z,a.Varint),this.writeVarint(ne)},writeSVarintField:function(Z,ne){this.writeTag(Z,a.Varint),this.writeSVarint(ne)},writeStringField:function(Z,ne){this.writeTag(Z,a.Bytes),this.writeString(ne)},writeFloatField:function(Z,ne){this.writeTag(Z,a.Fixed32),this.writeFloat(ne)},writeDoubleField:function(Z,ne){this.writeTag(Z,a.Fixed64),this.writeDouble(ne)},writeBooleanField:function(Z,ne){this.writeVarintField(Z,!!ne)}},Ww}var Pm=_t(zy());function FD(d,a,l){a.glyphs=[],1===d&&l.readMessage(AA,a)}function AA(d,a,l){if(3===d){const{id:p,bitmap:g,width:m,height:b,left:T,top:k,advance:F}=l.readMessage(kA,{});a.glyphs.push({id:p,bitmap:new Im({width:m+6,height:b+6},g),metrics:{width:m,height:b,left:T,top:k,advance:F}})}else 4===d?a.ascender=l.readSVarint():5===d&&(a.descender=l.readSVarint())}function kA(d,a,l){1===d?a.id=l.readVarint():2===d?a.bitmap=l.readBytes():3===d?a.width=l.readVarint():4===d?a.height=l.readVarint():5===d?a.left=l.readSVarint():6===d?a.top=l.readSVarint():7===d&&(a.advance=l.readVarint())}const Yc={horizontal:1,vertical:2,horizontalOnly:3};class By{constructor(){this.scale=1,this.fontStack="",this.image=null}static forText(a,l){const p=new By;return p.scale=a||1,p.fontStack=l,p}static forImage(a){const l=new By;return l.image=a,l}}class zg{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(a,l){const p=new zg;for(let g=0;g=0&&p>=a&&Vy[this.text.charCodeAt(p)];p--)l--;this.text=this.text.substring(a,l),this.sectionIndex=this.sectionIndex.slice(a,l)}substring(a,l){const p=new zg;return p.text=this.text.substring(a,l),p.sectionIndex=this.sectionIndex.slice(a,l),p.sections=this.sections,p}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((a,l)=>Math.max(a,this.sections[l].scale),0)}addTextSection(a,l){this.text+=a.text,this.sections.push(By.forText(a.scale,a.fontStack||l));const p=this.sections.length-1;for(let g=0;g=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Kf(d,a,l,p,g,m,b,T,k,F,S,R,L,A,P){const z=zg.fromFeature(d,g);R===Yc.vertical&&z.verticalizePunctuation(L);let j=[];const $=function(oe,le,xe,ve,ye,Fe){if(!oe)return[];const Se=[],Ne=function(Je,rt,Qe,It,jt,Et){let gn=0;for(let dn=0;dn=0;let He=0;for(let Je=0;Je0&&Cc>Ii&&(Ii=Cc)}else{const gs=xe[Ci.fontStack];if(!gs)continue;gs[Vo]&&(Ia=gs[Vo]);const sr=le[Ci.fontStack];if(!sr)continue;const Cc=sr.glyphs[Vo];if(!Cc)continue;if(la=Cc.metrics,Ur=8203!==Vo?24:0,Et){const Wu=void 0!==sr.ascender?Math.abs(sr.ascender):0,Ld=void 0!==sr.descender?Math.abs(sr.descender):0,bu=(Wu+Ld)*pr;Bi-l/2;){if(b--,b<0)return!1;T-=d[b].dist(m),m=d[b]}T+=d[b].dist(d[b+1]),b++;const k=[];let F=0;for(;Tp;)F-=k.shift().angleDelta;if(F>g)return!1;b++,T+=S.dist(R)}return!0}function Jw(d){let a=0;for(let l=0;lF){const P=(F-k)/A,z=Un(R.x,L.x,P),j=Un(R.y,L.y,P),$=new Lm(z,j,0,L.angleTo(R),S);return!b||PA(d,$,T,b,a)?$:void 0}k+=A}}function BD(d,a,l,p,g,m,b,T,k){const F=zD(p,m,b),S=eC(p,g),R=S*b,L=0===d[0].x||d[0].x===k||0===d[0].y||d[0].y===k;return a-R=0&&Z=0&&ne=0&&L+F<=S){const oe=new Lm(Z,ne,0,K,P);p&&!PA(d,oe,m,p,g)||A.push(oe)}}R+=$}return T||A.length||b||(A=Fm(d,R/2,l,p,g,m,b,!0,k)),A}function nC(d,a,l,p,g){const m=[];for(let b=0;b=p&&R.x>=p||(S.x>=p?S=new Xt(p,S.y+(p-S.x)/(R.x-S.x)*(R.y-S.y))._round():R.x>=p&&(R=new Xt(p,S.y+(p-S.x)/(R.x-S.x)*(R.y-S.y))._round()),S.y>=g&&R.y>=g||(S.y>=g?S=new Xt(S.x+(g-S.y)/(R.y-S.y)*(R.x-S.x),g)._round():R.y>=g&&(R=new Xt(S.x+(g-S.y)/(R.y-S.y)*(R.x-S.x),g)._round()),k&&S.equals(k[k.length-1])||(k=[S],m.push(k)),k.push(R)))))}}return m}function VD(d){let a=0,l=0;for(const b of d)a+=b.w*b.h,l=Math.max(l,b.w);d.sort((b,T)=>T.h-b.h);const p=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(a/.95)),l),h:1/0}];let g=0,m=0;for(const b of d)for(let T=p.length-1;T>=0;T--){const k=p[T];if(!(b.w>k.w||b.h>k.h)){if(b.x=k.x,b.y=k.y,m=Math.max(m,b.y+b.h),g=Math.max(g,b.x+b.w),b.w===k.w&&b.h===k.h){const F=p.pop();T1?A-1:A,Ms.copy(R.data,F,{x:0,y:0},{x:P,y:z},R.data,p),Ms.copy(R.data,F,{x:0,y:$-A},{x:P,y:z-A},{width:j,height:A},p),Ms.copy(R.data,F,{x:0,y:0},{x:P,y:z+$},{width:j,height:A},p),Ms.copy(R.data,F,{x:j-A,y:0},{x:P-A,y:z},{width:A,height:$},p),Ms.copy(R.data,F,{x:0,y:0},{x:P+j,y:z},{width:A,height:$},p),Ms.copy(R.data,F,{x:j-A,y:$-A},{x:P-A,y:z-A},{width:A,height:A},p),Ms.copy(R.data,F,{x:0,y:$-A},{x:P+j,y:z-A},{width:A,height:A},p),Ms.copy(R.data,F,{x:0,y:0},{x:P+j,y:z+$},{width:A,height:A},p),Ms.copy(R.data,F,{x:j-A,y:0},{x:P-A,y:z+$},{width:A,height:A},p)}this.lut=p,this.image=F,this.iconPositions=g,this.patternPositions=m}addImages(a,l,p,g){for(const m in a){const b=a[m],T={x:0,y:0,w:b.data.width+2*p,h:b.data.height+2*p};g.push(T);const k=Bc.deserializeFromString(m);l[m]=new jy(T,b,p,k),b.hasRenderCallback&&this.haveRenderCallbacks.push(k.id)}}patchUpdatedImages(a,l,p){this.haveRenderCallbacks=this.haveRenderCallbacks.filter(g=>a.hasImage(g,p)),a.dispatchRenderCallbacks(this.haveRenderCallbacks,p);for(const g in a.getUpdatedImages(p)){for(const m of Object.keys(this.iconPositions))Bc.deserializeId(m)===g&&this.patchUpdatedImage(this.iconPositions[m],a.getImage(g,p),l);for(const m of Object.keys(this.patternPositions))Bc.deserializeId(m)===g&&this.patchUpdatedImage(this.patternPositions[m],a.getImage(g,p),l)}}patchUpdatedImage(a,l,p){if(!a||!l||a.version===l.version)return;a.version=l.version;const[g,m]=a.tl,b=a.sdf;if(this.lut||b){const T={width:l.data.width,height:l.data.height},k=new Ms(T);Ms.copy(l.data,k,{x:0,y:0},{x:0,y:0},T,this.lut,b),p.update(k,{position:{x:g,y:m}})}else p.update(l.data,{position:{x:g,y:m}})}}En(jy,"ImagePosition"),En(UD,"ImageAtlas");const Ug=1e20;function HD(d,a,l,p,g,m,b,T,k){for(let F=a;F-1);k++,m[k]=T,b[k]=F,b[k+1]=Ug}for(let T=0,k=0;T{let F=this.entries[b];F||(F=this.entries[b]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let S=F.glyphs[T];if(void 0!==S)return void k(null,{stack:b,id:T,glyph:S});if(S=this._tinySDF(F,b,T),S)return F.glyphs[T]=S,void k(null,{stack:b,id:T,glyph:S});const R=Math.floor(T/256);if(256*R>65535)return ki("glyphs > 65535 not supported"),void k(null,{stack:b,id:T,glyph:S});if(F.ranges[R])return void k(null,{stack:b,id:T,glyph:S});let L=F.requests[R];L||(L=F.requests[R]=[],Hg.loadGlyphRange(b,R,m,this.requestManager,(A,P)=>{if(P){F.ascender=P.ascender,F.descender=P.descender;for(const z in P.glyphs)this._doesCharSupportLocalGlyph(+z)||(F.glyphs[+z]=P.glyphs[+z]);F.ranges[R]=!0}for(const z of L)z(A,P);delete F.requests[R]})),L.push((A,P)=>{A?k(A):P&&k(null,{stack:b,id:T,glyph:P.glyphs[T]||null})})},(b,T)=>{if(b)p(b);else if(T){const k={};for(const{stack:F,id:S,glyph:R}of T)void 0===k[F]&&(k[F]={}),void 0===k[F].glyphs&&(k[F].glyphs={}),k[F].glyphs[S]=R&&{id:R.id,bitmap:R.bitmap.clone(),metrics:R.metrics},k[F].ascender=this.entries[F].ascender,k[F].descender=this.entries[F].descender;p(null,k)}})}_doesCharSupportLocalGlyph(a){return this.localGlyphMode!==iC.none&&(this.localGlyphMode===iC.all?!!this.localFontFamily:!!this.localFontFamily&&(Gn_CJK_Unified_Ideographs(a)||Gn_Hangul_Syllables(a)||Gn_Hiragana(a)||Gn_Katakana(a)||Gn_CJK_Symbols_and_Punctuation(a)||Gn_CJK_Unified_Ideographs_Extension_A(a)||Gn_CJK_Unified_Ideographs_Extension_B(a)||Gn_Osage(a)))}_tinySDF(a,l,p){const g=this.localFontFamily;if(!g||!this._doesCharSupportLocalGlyph(p))return;let m=a.tinySDF;if(!m){let z="400";/bold/i.test(l)?z="900":/medium/i.test(l)?z="500":/light/i.test(l)&&(z="200"),m=a.tinySDF=new Hg.TinySDF({fontFamily:g,fontWeight:z,fontSize:48,buffer:6,radius:16}),m.fontWeight=z}if(this.localGlyphs[m.fontWeight][p])return this.localGlyphs[m.fontWeight][p];const b=String.fromCodePoint(p),{data:T,width:k,height:F,glyphWidth:S,glyphHeight:R,glyphLeft:L,glyphTop:A,glyphAdvance:P}=m.draw(b);return this.localGlyphs[m.fontWeight][p]={id:p,bitmap:new Im({width:k,height:F},T),metrics:{width:S/2,height:R/2,left:L/2,top:A/2-27,advance:P/2,localGlyph:!0}}}}Hg.loadGlyphRange=function(d,a,l,p,g){const m=256*a,b=m+255,T=p.transformRequest(p.normalizeGlyphsURL(l).replace("{fontstack}",d).replace("{range}",`${m}-${b}`),Hi.Glyphs);Tr(T,(k,F)=>{if(k)g(k);else if(F){const S={},R=new Pm(F).readFields(FD,{});for(const L of R.glyphs)S[L.id]=L;g(null,{glyphs:S,ascender:R.ascender,descender:R.descender})}})},Hg.TinySDF=class{constructor({fontSize:d=24,buffer:a=3,radius:l=8,cutoff:p=.25,fontFamily:g="sans-serif",fontWeight:m="normal",fontStyle:b="normal"}={}){this.buffer=a,this.cutoff=p,this.radius=l;const T=this.size=d+4*a,k=this._createCanvas(T),F=this.ctx=k.getContext("2d",{willReadFrequently:!0});F.font=`${b} ${m} ${d}px ${g}`,F.textBaseline="alphabetic",F.textAlign="left",F.fillStyle="black",this.gridOuter=new Float64Array(T*T),this.gridInner=new Float64Array(T*T),this.f=new Float64Array(T),this.z=new Float64Array(T+1),this.v=new Uint16Array(T)}_createCanvas(d){const a=document.createElement("canvas");return a.width=a.height=d,a}draw(d){const{width:a,actualBoundingBoxAscent:l,actualBoundingBoxDescent:p,actualBoundingBoxLeft:g,actualBoundingBoxRight:m}=this.ctx.measureText(d),b=Math.ceil(l),T=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-g))),k=Math.min(this.size-this.buffer,b+Math.ceil(p)),F=T+2*this.buffer,S=k+2*this.buffer,R=Math.max(F*S,0),L=new Uint8ClampedArray(R),A={data:L,width:F,height:S,glyphWidth:T,glyphHeight:k,glyphTop:b,glyphLeft:0,glyphAdvance:a};if(0===T||0===k)return A;const{ctx:P,buffer:z,gridInner:j,gridOuter:$}=this;P.clearRect(z,z,T,k),P.fillText(d,z,z+b);const K=P.getImageData(z,z,T,k);$.fill(Ug,0,R),j.fill(0,0,R);for(let J=0;J0?le*le:0,j[oe]=le<0?le*le:0}}HD($,0,0,F,S,F,this.f,this.v,this.z),HD(j,z,z,T,k,F,this.f,this.v,this.z);for(let J=0;J{const He=l1(Fe.stretch-K,J,S,d.left*g),Xe=$y(Fe.fixed-oe,le,Fe.stretch,P),Je=l1(Se.stretch-Z,ne,R,d.top*g),rt=$y(Se.fixed-xe,ve,Se.stretch,z),Qe=l1(Ne.stretch-K,J,S,d.left*g),It=$y(Ne.fixed-oe,le,Ne.stretch,P),jt=l1(Ge.stretch-Z,ne,R,d.top*g),Et=$y(Ge.fixed-xe,ve,Ge.stretch,z),gn=new Xt(He,Je),dn=new Xt(Qe,Je),Qt=new Xt(Qe,jt),Wt=new Xt(He,jt),Vn=new Xt(Xe/T,rt/T),bn=new Xt(It/T,Et/T),An=a*Math.PI/180;if(An){const ji=Math.sin(An),nr=Math.cos(An),ko=[nr,-ji,ji,nr];gn._matMult(ko),dn._matMult(ko),Wt._matMult(ko),Qt._matMult(ko)}const fi=Fe.stretch+Fe.fixed,Oi=Ne.stretch+Ne.fixed,Si=Se.stretch+Se.fixed,Ii=Ge.stretch+Ge.fixed,Bi=d.imageSecondary;return{tl:gn,tr:dn,bl:Wt,br:Qt,texPrimary:{x:b.paddedRect.x+1+fi,y:b.paddedRect.y+1+Si,w:Oi-fi,h:Ii-Si},texSecondary:Bi?{x:Bi.paddedRect.x+1+fi,y:Bi.paddedRect.y+1+Si,w:Oi-fi,h:Ii-Si}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Vn,pixelOffsetBR:bn,minFontScaleX:le/T/S,minFontScaleY:ve/T/R,isSDF:l}};if(p&&(b.stretchX||b.stretchY)){const Fe=oC(L,j,P),Se=oC(A,$,z);for(let Ne=0;Nem)&&(m=P.x),(!A||P.y>b)&&(b=P.y)}const k=Math.min(m-p,b-g);let F=k/2;const S=new js([],pu);if(0===k)return new Xt(p,g);for(let A=p;AR.d||!R.d)&&(R=A,l&&console.log("found best %d after %d probes",Math.round(1e4*A.d)/1e4,L)),A.max-R.d<=a||(F=A.h/2,S.push(new Op(A.p.x-F,A.p.y-F,F,d)),S.push(new Op(A.p.x+F,A.p.y-F,F,d)),S.push(new Op(A.p.x-F,A.p.y+F,F,d)),S.push(new Op(A.p.x+F,A.p.y+F,F,d)),L+=4)}return l&&(console.log(`num probes: ${L}`),console.log(`best distance: ${R.d}`)),R.p}function pu(d,a){return a.max-d.max}class Op{constructor(a,l,p,g){this.p=new Xt(a,l),this.h=p,this.d=function(m,b){let T=!1,k=1/0;for(let F=0;Fm.y!=z.y>m.y&&m.x<(z.x-P.x)*(m.y-P.y)/(z.y-P.y)+P.x&&(T=!T),k=Math.min(k,Me(m,P,z))}}return(T?1:-1)*Math.sqrt(k)}(this.p,g),this.max=this.d+this.h*Math.SQRT2}}const c1=Number.POSITIVE_INFINITY,$g=Math.sqrt(2);function qD(d,[a,l]){let p=0,g=0;if(l===c1){a<0&&(a=0);const m=a/$g;switch(d){case"top-right":case"top-left":g=m-7;break;case"bottom-right":case"bottom-left":g=7-m;break;case"bottom":g=7-a;break;case"top":g=a-7}switch(d){case"top-right":case"bottom-right":p=-m;break;case"top-left":case"bottom-left":p=m;break;case"left":p=a;break;case"right":p=-a}}else{switch(a=Math.abs(a),l=Math.abs(l),d){case"top-right":case"top-left":case"top":g=l-7;break;case"bottom-right":case"bottom-left":case"bottom":g=7-l}switch(d){case"top-right":case"bottom-right":case"right":p=-a;break;case"top-left":case"bottom-left":case"left":p=a}}return[p,g]}function Gg(d){switch(d){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sC(d,a,l,p,g,m,b,T,k,F,S,R,L,A,P){let z=m.textMaxSize.evaluate(a,{},R);void 0===z?z=b*m.textScaleFactor:z*=m.textScaleFactor;const j=d.layers[0].layout,$=j.get("icon-offset").evaluate(a,{},R),K=Nm(l.horizontal)||l.vertical,J="globe"===L.name,ne=b*m.textScaleFactor/24,oe=d.tilePixelRatio*z/24,le=(He=d.overscaling,d.zoom>18&&He>2&&(He>>=1),Math.max(pn/(512*He),1)*j.get("symbol-spacing")),xe=j.get("text-padding")*d.tilePixelRatio,ve=j.get("icon-padding")*d.tilePixelRatio,ye=Li(j.get("text-max-angle")),Fe="map"===j.get("text-rotation-alignment")&&"point"!==j.get("symbol-placement"),Se="map"===j.get("icon-rotation-alignment")&&"point"!==j.get("symbol-placement"),Ne=j.get("symbol-placement"),Ge=le/2;var He;const Xe=j.get("icon-text-fit").evaluate(a,{},R),Je=j.get("icon-text-fit-padding").evaluate(a,{},R),rt="none"!==Xe;let Qe;!1===d.hasAnyIconTextFit&&rt&&(d.hasAnyIconTextFit=!0),p&&rt&&(d.allowVerticalPlacement&&l.vertical&&(Qe=Vg(p,l.vertical,Xe,Je,$,ne)),K&&(p=Vg(p,K,Xe,Je,$,ne)));const It=(jt,Et,gn)=>{if(Et.x<0||Et.x>=pn||Et.y<0||Et.y>=pn)return;let dn=null;if(J){const{x:Qt,y:Wt,z:Vn}=L.projectTilePoint(Et.x,Et.y,gn);dn={anchor:new Lm(Qt,Wt,Vn,0,void 0),up:L.upVector(gn,Et.x,Et.y)}}!function(Qt,Wt,Vn,bn,An,fi,Oi,Si,Ii,Bi,ji,nr,ko,Ci,No,Vo,pr,la,Ia,Jr,Ur,ca,da,gs,sr,Cc,Wu){const Ld=Qt.addToLineVertexArray(Wt,bn);let bu,u_,Fd,h_,ab,H2,bv,Qc=0,Hr=0,j2=0,$2=0,yv=-1,Vp=-1;const Nd={};let cS=jl("");const Zu=Vn?Vn.anchor:Wt,dS="none"!==Ii.layout.get("icon-text-fit").evaluate(Ur,{},sr);let uS=0,G2=0;if(void 0===Ii._unevaluatedLayout.getValue("text-radial-offset")?[uS,G2]=Ii.layout.get("text-offset").evaluate(Ur,{},sr).map(Sc=>24*Sc):(uS=24*Ii.layout.get("text-radial-offset").evaluate(Ur,{},sr),G2=c1),Qt.allowVerticalPlacement&&An.vertical){const Sc=An.vertical;if(No)H2=cC(Sc),Si&&(bv=cC(Si));else{const Ws=Ii.layout.get("text-rotate").evaluate(Ur,{},sr)+90;Fd=d1(Bi,Zu,Wt,ji,nr,ko,Sc,Ci,Ws,Vo),Si&&(h_=d1(Bi,Zu,Wt,ji,nr,ko,Si,la,Ws))}}if(fi){const Sc=Qt.iconSizeData,Ws=Ii.layout.get("icon-rotate").evaluate(Ur,{},sr),p_=GD(fi,Ws,da,dS,ca.iconScaleFactor),$e=Si?GD(Si,Ws,da,dS,ca.iconScaleFactor):void 0;u_=d1(Bi,Zu,Wt,ji,nr,ko,fi,la,Ws,null),Qc=4*p_.length;let Up=null;"source"===Sc.kind?(Up=[Oh*Ii.layout.get("icon-size").evaluate(Ur,{},sr)*ca.iconScaleFactor],Up[0]>Pp&&ki(`${Qt.layerIds[0]}: Value for "icon-size" is >= ${qg}. Reduce your "icon-size".`)):"composite"===Sc.kind&&(Up=[Oh*ca.compositeIconSizes[0].evaluate(Ur,{},sr)*ca.iconScaleFactor,Oh*ca.compositeIconSizes[1].evaluate(Ur,{},sr)*ca.iconScaleFactor],(Up[0]>Pp||Up[1]>Pp)&&ki(`${Qt.layerIds[0]}: Value for "icon-size" is >= ${qg}. Reduce your "icon-size".`)),Qt.addSymbols(Qt.icon,p_,Up,Jr,Ia,Ur,!1,Vn,Wt,Ld.lineStartIndex,Ld.lineLength,-1,gs,sr,Cc,Wu),yv=Qt.icon.placedSymbolArray.length-1,$e&&(Hr=4*$e.length,Qt.addSymbols(Qt.icon,$e,Up,Jr,Ia,Ur,Yc.vertical,Vn,Wt,Ld.lineStartIndex,Ld.lineLength,-1,gs,sr,Cc,Wu),Vp=Qt.icon.placedSymbolArray.length-1)}for(const Sc in An.horizontal){const Ws=An.horizontal[Sc];bu||(cS=jl(Ws.text),No?ab=cC(Ws):bu=d1(Bi,Zu,Wt,ji,nr,ko,Ws,Ci,Ii.layout.get("text-rotate").evaluate(Ur,{},sr),Vo));const p_=1===Ws.positionedLines.length;if(j2+=lC(Qt,Vn,Wt,Ws,Oi,Ii,No,Ur,Vo,Ld,An.vertical?Yc.horizontal:Yc.horizontalOnly,p_?Object.keys(An.horizontal):[Sc],Nd,yv,ca,gs,sr,Cc),p_)break}An.vertical&&($2+=lC(Qt,Vn,Wt,An.vertical,Oi,Ii,No,Ur,Vo,Ld,Yc.vertical,["vertical"],Nd,Vp,ca,gs,sr,Cc));let $m=-1;const Vh=(Sc,Ws)=>Sc?Math.max(Sc,Ws):Ws;$m=Vh(ab,$m),$m=Vh(H2,$m),$m=Vh(bv,$m);const vv=$m>-1?1:0;Qt.glyphOffsetArray.length>=65535&&ki("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Ur.sortKey&&Qt.addToSortKeyRanges(Qt.symbolInstances.length,Ur.sortKey),Qt.symbolInstances.emplaceBack(Wt.x,Wt.y,Zu.x,Zu.y,Zu.z,Nd.right>=0?Nd.right:-1,Nd.center>=0?Nd.center:-1,Nd.left>=0?Nd.left:-1,Nd.vertical>=0?Nd.vertical:-1,yv,Vp,cS,void 0!==bu?bu:Qt.collisionBoxArray.length,void 0!==bu?bu+1:Qt.collisionBoxArray.length,void 0!==Fd?Fd:Qt.collisionBoxArray.length,void 0!==Fd?Fd+1:Qt.collisionBoxArray.length,void 0!==u_?u_:Qt.collisionBoxArray.length,void 0!==u_?u_+1:Qt.collisionBoxArray.length,h_||Qt.collisionBoxArray.length,h_?h_+1:Qt.collisionBoxArray.length,ji,j2,$2,Qc,Hr,vv,0,uS,G2,$m,0,dS?1:0)}(d,Et,dn,jt,l,p,g,Qe,d.layers[0],d.collisionBoxArray,a.index,a.sourceLayerIndex,d.index,xe,Fe,k,0,ve,Se,$,a,m,F,S,R,A,P)};if("line"===Ne)for(const jt of nC(a.geometry,0,0,pn,pn)){const Et=BD(jt,le,ye,l.vertical||K,p,24,oe,d.overscaling,pn);for(const gn of Et)K&&LA(d,K.text,Ge,gn)||It(jt,gn,R)}else if("line-center"===Ne){for(const jt of a.geometry)if(jt.length>1){const Et=tC(jt,ye,l.vertical||K,p,24,oe);Et&&It(jt,Et,R)}}else if("Polygon"===a.type)for(const jt of G0(a.geometry,0)){const Et=aC(jt,16);It(jt[0],new Lm(Et.x,Et.y,0,0,void 0),R)}else if("LineString"===a.type)for(const jt of a.geometry)It(jt,new Lm(jt[0].x,jt[0].y,0,0,void 0),R);else if("Point"===a.type)for(const jt of a.geometry)for(const Et of jt)It([Et],new Lm(Et.x,Et.y,0,0,void 0),R)}const qg=255,Pp=qg*Oh;function lC(d,a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j,$){const K=function(ne,oe,le,xe,ve,ye,Fe,Se){const Ne=[];if(0===oe.positionedLines.length)return Ne;const Ge=xe.layout.get("text-rotate").evaluate(ye,{})*Math.PI/180,He=function(It){const jt=It[0],Et=It[1],gn=jt*Et;return gn>0?[jt,-Et]:gn<0?[-jt,Et]:0===jt?[Et,jt]:[Et,-jt]}(le);let Xe=Math.abs(oe.top-oe.bottom);for(const It of oe.positionedLines)Xe-=It.lineOffset;const Je=oe.positionedLines.length,rt=Xe/Je;let Qe=oe.top-le[1];for(let It=0;ItPp&&ki(`${d.layerIds[0]}: Value for "text-size" is >= ${qg}. Reduce your "text-size".`)):"composite"===J.kind&&(Z=[Oh*P.compositeTextSizes[0].evaluate(T,{},j)*P.textScaleFactor,Oh*P.compositeTextSizes[1].evaluate(T,{},j)*P.textScaleFactor],(Z[0]>Pp||Z[1]>Pp)&&ki(`${d.layerIds[0]}: Value for "text-size" is >= ${qg}. Reduce your "text-size".`)),d.addSymbols(d.text,K,Z,k,b,T,S,a,l,F.lineStartIndex,F.lineLength,A,z,j,$,!1);for(const ne of R)L[ne]=d.text.placedSymbolArray.length-1;return 4*K.length}function Nm(d){for(const a in d)return d[a];return null}function d1(d,a,l,p,g,m,b,T,k,F){let S=b.top,R=b.bottom,L=b.left,A=b.right;const P=b.collisionPadding;if(P&&(L-=P[0],S-=P[1],A+=P[2],R+=P[3]),k){const z=new Xt(L,S),j=new Xt(A,S),$=new Xt(L,R),K=new Xt(A,R),J=Li(k);let Z=new Xt(0,0);F&&(Z=new Xt(F[0],F[1])),z._rotateAround(J,Z),j._rotateAround(J,Z),$._rotateAround(J,Z),K._rotateAround(J,Z),L=Math.min(z.x,j.x,$.x,K.x),A=Math.max(z.x,j.x,$.x,K.x),S=Math.min(z.y,j.y,$.y,K.y),R=Math.max(z.y,j.y,$.y,K.y)}return d.emplaceBack(a.x,a.y,a.z,l.x,l.y,L,S,A,R,T,p,g,m),d.length-1}function cC(d){d.collisionPadding&&(d.top-=d.collisionPadding[1],d.bottom+=d.collisionPadding[3]);const a=d.bottom-d.top;return a>0?Math.max(10,a):null}function LA(d,a,l,p){const g=d.compareText;if(a in g){const m=g[a];for(let b=m.length-1;b>=0;b--)if(p.dist(m[b])J&&(Z(oe,Ge,xe,ve,Se,Ne),Z(Ge,le,Se,Ne,ye,Fe))}Z(R,L,p,m,g,m),Z(L,A,g,m,g,b),Z(A,P,g,b,p,b),Z(P,R,p,b,p,m),z-=J,j-=J,$+=J,K+=J;const ne=1/Math.max($-z,K-j);return{scale:ne,x:z*ne,y:j*ne,x2:$*ne,y2:K*ne,projection:a}}function Xc(d,{x:a,y:l},p=0){return new Xt(((a-p)*d.scale-d.x)*pn,(l*d.scale-d.y)*pn)}const Fh=Ze.mat4.identity(new Float32Array(16));class zm{constructor(a){this.spec=a,this.name=a.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(a,l){return{x:0,y:0,z:0}}unproject(a,l){return new Co(0,0)}projectTilePoint(a,l,p){return{x:a,y:l,z:0}}locationPoint(a,l,p=!0){return a._coordinatePoint(a.locationCoordinate(l),p)}pixelsPerMeter(a,l){return sl(1,a)*l}pixelSpaceConversion(a,l,p){return 1}farthestPixelDistance(a){return WD(a,a.pixelsPerMeter)}pointCoordinate(a,l,p,g){const m=a.horizonLineFromTop(!1),b=new Xt(l,Math.max(m,p));return a.rayIntersectionCoordinate(a.pointRayIntersection(b,g))}pointCoordinate3D(a,l,p){const g=new Xt(l,p);if(a.elevation)return a.elevation.pointCoordinate(g);{const m=this.pointCoordinate(a,g.x,g.y,0);return[m.x,m.y,m.z]}}isPointAboveHorizon(a,l){if(a.elevation&&a.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(a,l.x,l.y);const p=a.horizonLineFromTop();return l.y0?l<-Wg+p&&(l=-Wg+p):l>Wg-p&&(l=Wg-p);const b=m/Math.pow(u1(l),g);let T=b*Math.sin(g*a),k=m-b*Math.cos(g*a);return T=.5*(T/Math.PI+.5),k=.5*(k/Math.PI+.5),{x:T,y:this.southernCenter?k:1-k,z:0}}unproject(a,l){a=(2*a-.5)*Math.PI,this.southernCenter&&(l=1-l),l=(2*(1-l)-.5)*Math.PI;const{n:p,f:g}=this,m=g-l,b=Math.sign(m),T=Math.sign(p)*Math.sqrt(a*a+m*m);let k=Math.atan2(a,Math.abs(m))*b;m*p<0&&(k-=Math.PI*Math.sign(a)*b);const F=ht(Nr(k/p)+this.center[0],-180,180),S=ht(Nr(2*Math.atan(Math.pow(g/T,1/p))-Wg),-Xr,Xr);return new Co(F,this.southernCenter?-S:S)}}class Nh extends zm{constructor(a){super(a),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(a,l){return{x:Gc(a),y:Rd(l),z:0}}unproject(a,l){const p=Xl(a),g=ps(l);return new Co(p,g)}}const Zg=Li(Xr);class ZD extends zm{project(a,l){const p=(l=Li(l))*l,g=p*p;return{x:.5*((a=Li(a))*(.8707-.131979*p+g*(g*(.003971*p-.001529*g)-.013791))/Math.PI+.5),y:1-.5*(l*(1.007226+p*(.015085+g*(.028874*p-.044475-.005916*g)))/Math.PI+1),z:0}}unproject(a,l){a=(2*a-.5)*Math.PI;let p=l=(2*(1-l)-1)*Math.PI,g=25,m=0,b=p*p;do{b=p*p;const F=b*b;m=(p*(1.007226+b*(.015085+F*(.028874*b-.044475-.005916*F)))-l)/(1.007226+b*(.045255+F*(.259866*b-.311325-.005916*11*F))),p=ht(p-m,-Zg,Zg)}while(Math.abs(m)>1e-6&&--g>0);b=p*p;const T=ht(Nr(a/(.8707+b*(b*(b*b*b*(.003971-.001529*b)-.013791)-.131979))),-180,180),k=Nr(p);return new Co(T,k)}}const dC=Li(Xr);class YD extends zm{project(a,l){l=Li(l),a=Li(a);const p=Math.cos(l),g=2/Math.PI,m=Math.acos(p*Math.cos(a/2)),b=Math.sin(m)/m,T=.5*(a*g+2*p*Math.sin(a/2)/b)||0,k=.5*(l+Math.sin(l)/b)||0;return{x:.5*(T/Math.PI+.5),y:1-.5*(k/Math.PI+1),z:0}}unproject(a,l){let p=a=(2*a-.5)*Math.PI,g=l=(2*(1-l)-1)*Math.PI,m=25;const b=1e-6;let T=0,k=0;do{const F=Math.cos(g),S=Math.sin(g),R=2*S*F,L=S*S,A=F*F,P=Math.cos(p/2),z=Math.sin(p/2),j=2*P*z,$=z*z,K=1-A*P*P,J=K?1/K:0,Z=K?Math.acos(F*P)*Math.sqrt(1/K):0,ne=.5*(2*Z*F*z+2*p/Math.PI)-a,oe=.5*(Z*S+g)-l,le=.5*J*(A*$+Z*F*P*L)+1/Math.PI,xe=J*(j*R/4-Z*S*z),ve=.125*J*(R*z-Z*S*A*j),ye=.5*J*(L*P+Z*$*F)+.5,Fe=xe*ve-ye*le;T=(oe*xe-ne*ye)/Fe,k=(ne*ve-oe*le)/Fe,p=ht(p-T,-Math.PI,Math.PI),g=ht(g-k,-dC,dC)}while((Math.abs(T)>b||Math.abs(k)>b)&&--m>0);return new Co(Nr(p),Nr(g))}}class BA extends zm{constructor(a){super(a),this.center=a.center||[0,0],this.parallels=a.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(Li(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(a,l){const{scale:p,cosPhi:g}=this;return{x:Li(a)*g*p+.5,y:-Math.sin(Li(l))/g*p+.5,z:0}}unproject(a,l){const{scale:p,cosPhi:g}=this,m=-(l-.5)/p,b=ht(Nr((a-.5)/p)/g,-180,180),T=Math.asin(ht(m*g,-1,1)),k=ht(Nr(T),-Xr,Xr);return new Co(b,k)}}class hF extends Nh{constructor(a){super(a),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(a,l,p){const g=Xo(a,l,p),m=ms(aa(p));return Ze.vec3.transformMat4(g,g,m),{x:g[0],y:g[1],z:g[2]}}locationPoint(a,l){const p=Mh(l.lat,l.lng),g=Ze.vec3.normalize([],p),m=a.elevation?a.elevation.getAtPointOrZero(a.locationCoordinate(l),a._centerAltitude):a._centerAltitude,b=sl(1,0)*pn*m;Ze.vec3.scaleAndAdd(p,p,g,b);const T=Ze.mat4.identity(new Float64Array(16));return Ze.mat4.multiply(T,a.pixelMatrix,a.globeMatrix),Ze.vec3.transformMat4(p,p,T),new Xt(p[0],p[1])}pixelsPerMeter(a,l){return sl(1,0)*l}pixelSpaceConversion(a,l,p){const g=sl(1,a)*l,m=Un(sl(1,45)*l,g,p);return this.pixelsPerMeter(a,l)/m}createTileMatrix(a,l,p){const g=Ko(aa(p.canonical));return Ze.mat4.multiply(new Float64Array(16),a.globeMatrix,g)}createInversionMatrix(a,l){const{center:p}=a,g=ms(aa(l));return Ze.mat4.rotateY(g,g,Li(p.lng)),Ze.mat4.rotateX(g,g,Li(p.lat)),Ze.mat4.scale(g,g,[a._pixelsPerMercatorPixel,a._pixelsPerMercatorPixel,1]),Float32Array.from(g)}pointCoordinate(a,l,p,g){return Do(a,l,p,!0)||new c(0,0)}pointCoordinate3D(a,l,p){const g=this.pointCoordinate(a,l,p,0);return[g.x,g.y,g.z]}isPointAboveHorizon(a,l){return!Do(a,l.x,l.y,!1)}farthestPixelDistance(a){const l=function(g,m){const b=g.cameraToCenterDistance,T=g._centerAltitude*m,k=g._camera,F=g._camera.forward(),S=Ze.vec3.add([],Ze.vec3.scale([],F,-b),[0,0,T]),R=g.worldSize/(2*Math.PI),L=[0,0,-R],A=g.width/g.height,P=Math.tan(g.fovAboveCenter),z=Ze.vec3.scale([],k.up(),P),j=Ze.vec3.scale([],k.right(),P*A),$=Ze.vec3.normalize([],Ze.vec3.add([],Ze.vec3.add([],F,z),j)),K=[];let J;if(new vi(S,$).closestPointOnSphere(L,R,K)){const Z=Ze.vec3.add([],K,L),ne=Ze.vec3.sub([],Z,S);J=Math.cos(g.fovAboveCenter)*Ze.vec3.length(ne)}else{const Z=Ze.vec3.sub([],S,L),ne=Ze.vec3.sub([],L,S);Ze.vec3.normalize(ne,ne);const oe=Ze.vec3.length(Z)-R;J=Math.sqrt(oe*(oe+2*R));const le=Math.acos(J/(R+oe))-Math.acos(Ze.vec3.dot(F,ne));J*=Math.cos(le)}return 1.01*J}(a,this.pixelsPerMeter(a.center.lat,a.worldSize)),p=fs(a.zoom);if(p>0){const g=WD(a,sl(1,a.center.lat)*a.worldSize),m=a.worldSize/(2*Math.PI),b=Math.max(a.width,a.height)/a.worldSize*Math.PI;return Un(l,g+m*(1-Math.cos(b)),Math.pow(p,10))}return l}upVector(a,l,p){return Xo(l,p,a,1)}upVectorScale(a){return{metersToTile:no(ao(aa(a)))}}}function VA(d){const a=d.parallels,l=!!a&&Math.abs(a[0]+a[1])<.01;switch(d.name){case"mercator":return new Nh(d);case"equirectangular":return new zA(d);case"naturalEarth":return new ZD(d);case"equalEarth":return new NA(d);case"winkelTripel":return new YD(d);case"albers":return l?new BA(d):new FA(d);case"lambertConformalConic":return l?new BA(d):new h1(d);case"globe":return new hF(d)}throw new Error(`Invalid projection name: ${d.name}`)}const uC=Mm.VectorTileFeature.types,hC=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function pC(d,a,l,p,g,m,b,T,k,F,S,R,L){const A=T?Math.min(Pp,Math.round(T[0])):0,P=T?Math.min(Pp,Math.round(T[1])):0;d.emplaceBack(a,l,Math.round(32*p),Math.round(32*g),m,b,(A<<1)+(k?1:0),P,16*F,16*S,256*R,256*L)}function mC(d,a,l){d.emplaceBack(a,l)}function Ky(d,a,l,p,g,m,b){d.emplaceBack(a,l,p,g,m,b)}function p1(d,a,l,p,g){d.emplaceBack(a,l,p,g),d.emplaceBack(a,l,p,g),d.emplaceBack(a,l,p,g),d.emplaceBack(a,l,p,g)}function UA(d){for(const a of d.sections)if(ng(a.text))return!0;return!1}class fC{constructor(a){this.layoutVertexArray=new oy,this.indexArray=new Ir,this.programConfigurations=a,this.segments=new Yr,this.dynamicLayoutVertexArray=new Yt,this.opacityVertexArray=new io,this.placedSymbolArray=new fg,this.iconTransitioningVertexArray=new fe,this.globeExtVertexArray=new ry,this.zOffsetVertexArray=new gm}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(a,l,p,g,m){this.isEmpty()||(p&&(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,OD.members),this.indexBuffer=a.createIndexBuffer(this.indexArray,l),this.dynamicLayoutVertexBuffer=a.createVertexBuffer(this.dynamicLayoutVertexArray,$w.members,!0),this.opacityVertexBuffer=a.createVertexBuffer(this.opacityVertexArray,hC,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=a.createVertexBuffer(this.iconTransitioningVertexArray,SA.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=a.createVertexBuffer(this.globeExtVertexArray,PD.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||m)&&(this.zOffsetVertexBuffer=a.createVertexBuffer(this.zOffsetVertexArray,CA.members,!0)),this.opacityVertexBuffer.itemSize=1),(p||g)&&this.programConfigurations.upload(a))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}En(fC,"SymbolBuffers");class _C{constructor(a,l,p){this.layoutVertexArray=new a,this.layoutAttributes=l,this.indexArray=new p,this.segments=new Yr,this.collisionVertexArray=new bp,this.collisionVertexArrayExt=new Yt}upload(a){this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=a.createVertexBuffer(this.collisionVertexArray,Fg.members,!0),this.collisionVertexBufferExt=a.createVertexBuffer(this.collisionVertexArrayExt,Ly.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}En(_C,"CollisionBuffers");class m1{constructor(a){this.collisionBoxArray=a.collisionBoxArray,this.zoom=a.zoom,this.lut=a.lut,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(b=>b.fqid),this.index=a.index,this.pixelRatio=a.pixelRatio,this.sourceLayerIndex=a.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Ze.mat4.identity([]),this.placementViewportMatrix=Ze.mat4.identity([]);const l=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qw(this.zoom,l["text-size"]),this.iconSizeData=qw(this.zoom,l["icon-size"]);const p=this.layers[0].layout,g=p.get("symbol-sort-key"),m=p.get("symbol-z-order");this.canOverlap=p.get("text-allow-overlap")||p.get("icon-allow-overlap")||p.get("text-ignore-placement")||p.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==m&&void 0!==g.constantOr(1),this.sortFeaturesByY=("viewport-y"===m||"auto"===m&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=p.get("text-writing-mode").map(b=>Yc[b]),this.stateDependentLayerIds=this.layers.filter(b=>b.isStateDependent()).map(b=>b.id),this.sourceID=a.sourceID,this.projection=a.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=p.get("symbol-z-elevate"),this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new fC(new Tp(this.layers,{zoom:this.zoom,lut:this.lut},a=>a.startsWith("text")||a.startsWith("symbol"))),this.icon=new fC(new Tp(this.layers,{zoom:this.zoom,lut:this.lut},a=>a.startsWith("icon")||a.startsWith("symbol"))),this.glyphOffsetArray=new Bf,this.lineVertexArray=new L0,this.symbolInstances=new gg}calculateGlyphDependencies(a,l,p,g,m){for(const b of a){const T=b.codePointAt(0);if(void 0===T)break;if(l[T]=!0,g&&m&&T<=65535){const k=Ng[b];k&&(l[k.charCodeAt(0)]=!0)}}}updateFootprints(a,l){}updateReplacement(a,l){if(l.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=l.updateTime;const p=l.getReplacementRegionsForTile(a.toUnwrapped(),!0);return!Dy(this.activeReplacements,p)&&(this.activeReplacements=p,!0)}populate(a,l,p,g){const m=this.layers[0],b=m.layout,T="globe"===this.projection.name,k=b.get("text-font"),F=b.get("text-field"),S=b.get("icon-image"),[R,L]=b.get("icon-size-scale-range"),A=ht(l.scaleFactor||1,R,L),P=("constant"!==F.value.kind||F.value.value instanceof yt&&!F.value.value.isEmpty()||F.value.value.toString().length>0)&&("constant"!==k.value.kind||k.value.value.length>0),z="constant"!==S.value.kind||!!S.value.value||Object.keys(S.parameters).length>0,j=b.get("symbol-sort-key");if(this.features=[],!P&&!z)return;const $=l.iconDependencies,K=l.glyphDependencies,J=l.availableImages,Z=new ar(this.zoom);for(const{feature:ne,id:oe,index:le,sourceLayerIndex:xe}of a){const ve=m._featureFilter.needGeometry,ye=G(ne,ve);if(!m._featureFilter.filter(Z,ye,p))continue;if(ve||(ye.geometry=H(ne,p,g)),T&&1!==ne.type&&p.z<=5){const He=ye.geometry,Xe=.98078528056,Je=(rt,Qe)=>{const It=Xo(rt.x,rt.y,p,1),jt=Xo(Qe.x,Qe.y,p,1);return Ze.vec3.dot(It,jt)=0;for(const Je of Fe.sections)if(Je.image){const rt=Je.image.getPrimary().scaleSelf(this.pixelRatio);$[rt.id]=$[rt.id]||[],$[rt.id].push(rt)}else{const rt=hm(Fe.toString()),Qe=Je.fontStack||He,It=K[Qe]=K[Qe]||{};this.calculateGlyphDependencies(Je.text,It,Xe,this.allowVerticalPlacement,rt)}}}"line"===b.get("symbol-placement")&&(this.features=function(ne){const oe={},le={},xe=[];let ve=0;function ye(Ge){xe.push(ne[Ge]),ve++}function Fe(Ge,He,Xe){const Je=le[Ge];return delete le[Ge],le[He]=Je,xe[Je].geometry[0].pop(),xe[Je].geometry[0]=xe[Je].geometry[0].concat(Xe[0]),Je}function Se(Ge,He,Xe){const Je=oe[He];return delete oe[He],oe[Ge]=Je,xe[Je].geometry[0].shift(),xe[Je].geometry[0]=Xe[0].concat(xe[Je].geometry[0]),Je}function Ne(Ge,He,Xe){const Je=Xe?He[0][He[0].length-1]:He[0][0];return`${Ge}:${Je.x}:${Je.y}`}for(let Ge=0;GeGe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ne,oe)=>ne.sortKey-oe.sortKey)}update(a,l,p,g,m,b,T){this.text.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T),this.icon.programConfigurations.updatePaintArrays(a,l,m,p,g,b,T)}updateZOffset(){const a=(m,b,T)=>{p+=b,p>m.length&&m.resize(p);for(let k=-b;k<0;k++)m.emplace(k+p,T)},l=(m,b,T)=>{g+=b,g>m.length&&m.resize(g);for(let k=-b;k<0;k++)m.emplace(k+g,T)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let p=0,g=0;for(let m=0;m0;if((T>0||k>0)&&(a(this.text.zOffsetVertexArray,T,S),a(this.text.zOffsetVertexArray,k,S)),R){const{placedIconSymbolIndex:L,verticalPlacedIconSymbolIndex:A}=b;L>=0&&l(this.icon.zOffsetVertexArray,F,S),A>=0&&l(this.icon.zOffsetVertexArray,b.numVerticalIconVertices,S)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(a){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(a),this.iconCollisionBox.upload(a)),this.text.upload(a,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(a,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=VA(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(a,l){const p=this.lineVertexArray.length;if(void 0!==a.segment)for(const{x:g,y:m}of l)this.lineVertexArray.emplaceBack(g,m);return{lineStartIndex:p,lineLength:this.lineVertexArray.length-p}}addSymbols(a,l,p,g,m,b,T,k,F,S,R,L,A,P,z,j){const $=a.indexArray,K=a.layoutVertexArray,J=a.globeExtVertexArray,Z=a.segments.prepareSegment(4*l.length,K,$,this.canOverlap?b.sortKey:void 0),ne=this.glyphOffsetArray.length,oe=Z.vertexLength,le=this.allowVerticalPlacement&&T===Yc.vertical?Math.PI/2:0,xe=b.text&&b.text.sections;for(let ye=0;ye=0?l.rightJustifiedTextSymbolIndex:l.centerJustifiedTextSymbolIndex>=0?l.centerJustifiedTextSymbolIndex:l.leftJustifiedTextSymbolIndex>=0?l.leftJustifiedTextSymbolIndex:l.verticalPlacedTextSymbolIndex>=0?l.verticalPlacedTextSymbolIndex:g),b=Fy(this.textSizeData,a,m)/24;return this.tilePixelRatio*b}getSymbolInstanceIconSize(a,l,p){const g=this.icon.placedSymbolArray.get(p),m=Fy(this.iconSizeData,a,g);return this.tilePixelRatio*m}_commitDebugCollisionVertexUpdate(a,l,p,g){a.emplaceBack(l,-p,-p,g),a.emplaceBack(l,p,-p,g),a.emplaceBack(l,p,p,g),a.emplaceBack(l,-p,p,g)}_updateTextDebugCollisionBoxes(a,l,p,g,m,b,T){for(let k=g;k0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(a,l){const p=a.placedSymbolArray.get(l),g=p.vertexStartIndex+4*p.numGlyphs;for(let m=p.vertexStartIndex;mg[T]-g[k]||m[k]-m[T]),b}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let a=0;athis.symbolInstances.get(l).zOffset-this.symbolInstances.get(a).zOffset)}addToSortKeyRanges(a,l){const p=this.sortKeyRanges[this.sortKeyRanges.length-1];p&&p.sortKey===l?p.symbolInstanceEnd=a+1:this.sortKeyRanges.push({sortKey:l,symbolInstanceStart:a,symbolInstanceEnd:a+1})}sortFeatures(a){if(this.sortFeaturesByY&&this.sortedAngle!==a&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(a),this.sortedAngle=a,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const l of this.symbolInstanceIndexes){const p=this.symbolInstances.get(l);this.featureSortOrder.push(p.featureIndex);const{rightJustifiedTextSymbolIndex:g,centerJustifiedTextSymbolIndex:m,leftJustifiedTextSymbolIndex:b,verticalPlacedTextSymbolIndex:T,placedIconSymbolIndex:k,verticalPlacedIconSymbolIndex:F}=p;g>=0&&this.addIndicesForPlacedSymbol(this.text,g),m>=0&&m!==g&&this.addIndicesForPlacedSymbol(this.text,m),b>=0&&b!==m&&b!==g&&this.addIndicesForPlacedSymbol(this.text,b),T>=0&&this.addIndicesForPlacedSymbol(this.text,T),k>=0&&this.addIndicesForPlacedSymbol(this.icon,k),F>=0&&this.addIndicesForPlacedSymbol(this.icon,F)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let gC,bC,yC;En(m1,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),m1.addDynamicAttributes=p1;class XD{constructor(a){this.type=a.property.overrides?a.property.overrides.runtimeType:Pi,this.defaultValue=a}evaluate(a){if(a.formattedSection){const l=this.defaultValue.property.overrides;if(l&&l.hasOverride(a.formattedSection))return l.getOverride(a.formattedSection)}return a.feature&&a.featureState?this.defaultValue.evaluate(a.feature,a.featureState):this.defaultValue.property.specification.default}eachChild(a){this.defaultValue.isConstant()||a(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}En(XD,"FormatSectionOverride",{omit:["defaultValue"]});const f1=()=>yC||(yC={layout:gC||(gC=new fr({"symbol-placement":new nn(lt.layout_symbol["symbol-placement"]),"symbol-spacing":new nn(lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new nn(lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Tn(lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new nn(lt.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new nn(lt.layout_symbol["symbol-z-elevate"]),"symbol-elevation-reference":new nn(lt.layout_symbol["symbol-elevation-reference"]),"icon-allow-overlap":new nn(lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new nn(lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new nn(lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new nn(lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Tn(lt.layout_symbol["icon-size"]),"icon-size-scale-range":new nn(lt.layout_symbol["icon-size-scale-range"]),"icon-text-fit":new Tn(lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Tn(lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Tn(lt.layout_symbol["icon-image"]),"icon-rotate":new Tn(lt.layout_symbol["icon-rotate"]),"icon-padding":new nn(lt.layout_symbol["icon-padding"]),"icon-keep-upright":new nn(lt.layout_symbol["icon-keep-upright"]),"icon-offset":new Tn(lt.layout_symbol["icon-offset"]),"icon-anchor":new Tn(lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new nn(lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new nn(lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new nn(lt.layout_symbol["text-rotation-alignment"]),"text-field":new Tn(lt.layout_symbol["text-field"]),"text-font":new Tn(lt.layout_symbol["text-font"]),"text-size":new Tn(lt.layout_symbol["text-size"]),"text-size-scale-range":new nn(lt.layout_symbol["text-size-scale-range"]),"text-max-width":new Tn(lt.layout_symbol["text-max-width"]),"text-line-height":new Tn(lt.layout_symbol["text-line-height"]),"text-letter-spacing":new Tn(lt.layout_symbol["text-letter-spacing"]),"text-justify":new Tn(lt.layout_symbol["text-justify"]),"text-radial-offset":new Tn(lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new nn(lt.layout_symbol["text-variable-anchor"]),"text-anchor":new Tn(lt.layout_symbol["text-anchor"]),"text-max-angle":new nn(lt.layout_symbol["text-max-angle"]),"text-writing-mode":new nn(lt.layout_symbol["text-writing-mode"]),"text-rotate":new Tn(lt.layout_symbol["text-rotate"]),"text-padding":new nn(lt.layout_symbol["text-padding"]),"text-keep-upright":new nn(lt.layout_symbol["text-keep-upright"]),"text-transform":new Tn(lt.layout_symbol["text-transform"]),"text-offset":new Tn(lt.layout_symbol["text-offset"]),"text-allow-overlap":new nn(lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new nn(lt.layout_symbol["text-ignore-placement"]),"text-optional":new nn(lt.layout_symbol["text-optional"]),visibility:new nn(lt.layout_symbol.visibility)})),paint:bC||(bC=new fr({"icon-opacity":new Tn(lt.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new Tn(lt.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new Tn(lt.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new Tn(lt.paint_symbol["text-emissive-strength"]),"icon-color":new Tn(lt.paint_symbol["icon-color"]),"icon-halo-color":new Tn(lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Tn(lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Tn(lt.paint_symbol["icon-halo-blur"]),"icon-translate":new nn(lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new nn(lt.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new Tn(lt.paint_symbol["icon-image-cross-fade"]),"text-opacity":new Tn(lt.paint_symbol["text-opacity"]),"text-occlusion-opacity":new Tn(lt.paint_symbol["text-occlusion-opacity"]),"text-color":new Tn(lt.paint_symbol["text-color"],{runtimeType:ml,getOverride:d=>d.textColor,hasOverride:d=>!!d.textColor}),"text-halo-color":new Tn(lt.paint_symbol["text-halo-color"]),"text-halo-width":new Tn(lt.paint_symbol["text-halo-width"]),"text-halo-blur":new Tn(lt.paint_symbol["text-halo-blur"]),"text-translate":new nn(lt.paint_symbol["text-translate"]),"text-translate-anchor":new nn(lt.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new nn(lt.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new nn(lt.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new nn(lt.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new nn(lt.paint_symbol["icon-color-brightness-max"]),"symbol-z-offset":new Tn(lt.paint_symbol["symbol-z-offset"]),"icon-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"icon-halo-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"text-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"}),"text-halo-color-use-theme":new Tn({type:"string",default:"default","property-type":"data-driven"})}))},yC);class Qf extends Ba{constructor(a,l,p,g){super(a,f1(),l,p,g),this._colorAdjustmentMatrix=Ze.mat4.identity([]),this.hasInitialOcclusionOpacityProperties=void 0!==a.paint&&("icon-occlusion-opacity"in a.paint||"text-occlusion-opacity"in a.paint)}recalculate(a,l){super.recalculate(a,l),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const p=this.layout.get("text-writing-mode");if(p){const g=[];for(const m of p)g.indexOf(m)<0&&g.push(m);this.layout._values["text-writing-mode"]=g}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(a,l,p,g){return this._saturation===a&&this._contrast===l&&this._brightnessMin===p&&this._brightnessMax===g||(this._colorAdjustmentMatrix=function(m,b,T,k){m=fd(m),b=om(b);const F=Ze.mat4.create(),S=m/3,R=1-2*S,L=[R,S,S,0,S,R,S,0,S,S,R,0,0,0,0,1],A=.5-.5*b,P=k-T;return Ze.mat4.multiply(F,[P,0,0,0,0,P,0,0,0,0,P,0,T,T,T,1],[b,0,0,0,0,b,0,0,0,0,b,0,A,A,A,1]),Ze.mat4.multiply(F,F,L),F}(a,l,p,g),this._saturation=a,this._contrast=l,this._brightnessMin=p,this._brightnessMax=g),this._colorAdjustmentMatrix}getValueAndResolveTokens(a,l,p,g){const m=this.layout.get(a).evaluate(l,{},p,g),b=this._unevaluatedLayout._values[a];return b.isDataDriven()||xh(b.value)||!m?m:(T=l.properties,m.replace(/{([^{}]+)}/g,(F,S)=>S in T?String(T[S]):""));var T}createBucket(a){return new m1(a)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const a of f1().paint.overridableProperties){if(!Qf.hasPaintOverride(this.layout,a))continue;const l=this.paint.get(a),p=new XD(l),g=new bi(p,l.property.specification,this.scope,this.options);let m=null;m="constant"===l.value.kind||"source"===l.value.kind?new gc("source",g):new wh("composite",g,l.value.zoomStops,l.value._interpolationType),this.paint._values[a]=new mm(l.property,m,l.parameters)}}_handleOverridablePaintPropertyUpdate(a,l,p){return!(!this.layout||l.isDataDriven()||p.isDataDriven())&&Qf.hasPaintOverride(this.layout,a)}static hasPaintOverride(a,l){const p=a.get("text-field"),g=f1().paint.properties[l];let m=!1;const b=T=>{for(const k of T)if(g.overrides&&g.overrides.hasOverride(k))return void(m=!0)};if("constant"===p.value.kind&&p.value.value instanceof yt)b(p.value.value.sections);else if("source"===p.value.kind){const T=F=>{m||(F instanceof Hs&&Vr(F.value)===_i?b(F.value.sections):F instanceof am?b(F.sections):F.eachChild(T))},k=p.value;k._styleExpression&&T(k._styleExpression.expression)}return m}getProgramIds(){return["symbol"]}getDefaultProgramParams(a,l,p){return{config:new Sp(this,{zoom:l,lut:p}),overrideFog:!1}}}let vC,_1,KD,El;var g1=wo([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);function xC(d){switch(d){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.RGBA;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.DEPTH_COMPONENT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.DEPTH_STENCIL;case WebGL2RenderingContext.R8:case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.RED}}function Jf(d){switch(d){case WebGL2RenderingContext.RGBA8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.DEPTH_COMPONENT16:return WebGL2RenderingContext.UNSIGNED_SHORT;case WebGL2RenderingContext.DEPTH24_STENCIL8:return WebGL2RenderingContext.UNSIGNED_INT_24_8;case WebGL2RenderingContext.R8:return WebGL2RenderingContext.UNSIGNED_BYTE;case WebGL2RenderingContext.R32F:return WebGL2RenderingContext.FLOAT}}class b1{constructor(a,l,p,g){this.context=a,this.format=p,this.useMipmap=g&&g.useMipmap,this.texture=a.gl.createTexture(),this.update(l,{premultiply:g&&g.premultiply})}update(a,l){const p=a&&a instanceof HTMLVideoElement&&0===a.width?a.videoWidth:a.width,g=a&&a instanceof HTMLVideoElement&&0===a.height?a.videoHeight:a.height,{context:m}=this,{gl:b}=m,{x:T,y:k}=l&&l.position?l.position:{x:0,y:0},F=T+p,S=k+g;!this.size||this.size[0]===F&&this.size[1]===S||(b.bindTexture(b.TEXTURE_2D,null),b.deleteTexture(this.texture),this.texture=b.createTexture(),this.size=null),b.bindTexture(b.TEXTURE_2D,this.texture),m.pixelStoreUnpackFlipY.set(!1),m.pixelStoreUnpack.set(1),m.pixelStoreUnpackPremultiplyAlpha.set(this.format===b.RGBA8&&(!l||!1!==l.premultiply));const R=a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement||a instanceof ImageData||ImageBitmap&&a instanceof ImageBitmap;if(!this.size&&F>0&&S>0){const L=this.useMipmap?Math.floor(Math.log2(Math.max(F,S)))+1:1;b.texStorage2D(b.TEXTURE_2D,L,this.format,F,S),this.size=[F,S]}if(this.size)if(R)b.texSubImage2D(b.TEXTURE_2D,0,T,k,xC(this.format),Jf(this.format),a);else{const L=a.data;L&&b.texSubImage2D(b.TEXTURE_2D,0,T,k,p,g,xC(this.format),Jf(this.format),L)}this.useMipmap&&b.generateMipmap(b.TEXTURE_2D)}bind(a,l,p=!1){const{context:g}=this,{gl:m}=g;m.bindTexture(m.TEXTURE_2D,this.texture),a!==this.minFilter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,a),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,this.useMipmap&&!p?a===m.NEAREST?m.NEAREST_MIPMAP_NEAREST:m.LINEAR_MIPMAP_LINEAR:a),this.minFilter=a),l!==this.wrapS&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,l),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,l),this.wrapS=l)}bindExtraParam(a,l,p,g){const{context:m}=this,{gl:b}=m;b.bindTexture(b.TEXTURE_2D,this.texture),l!==this.magFilter&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,l),this.magFilter=l),a!==this.minFilter&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,this.useMipmap?a===b.NEAREST?b.NEAREST_MIPMAP_NEAREST:b.LINEAR_MIPMAP_LINEAR:a),this.minFilter=a),p!==this.wrapS&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,p),this.wrapS=p),g!==this.wrapT&&(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g),this.wrapT=g)}destroy(){const{gl:a}=this.context;a.deleteTexture(this.texture),this.texture=null}}class y1{constructor(a,l){this.context=a,this.texture=l}bind(a,l){const{context:p}=this,{gl:g}=p;g.bindTexture(g.TEXTURE_2D,this.texture),a!==this.minFilter&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,a),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,a),this.minFilter=a),l!==this.wrapS&&(g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,l),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,l),this.wrapS=l)}}function v1(d,a,l,p,g,m,b,T){const k=[d,a,1,l,p,1,g,m,1],F=[b,T,1],S=Ze.mat3.adjoint([],k),[R,L,A]=Ze.vec3.transformMat3(F,F,S);return Ze.mat3.multiply(k,k,[R,0,0,0,L,0,0,0,A])}function QD(d,a,l,p,g,m,b,T){const k=function(F,S,R,L,A,P,z,j){const $=v1(0,0,1,0,1,1,0,1),K=v1(F,S,R,L,A,P,z,j),J=Ze.mat3.adjoint([],$);return Ze.mat3.multiply(K,K,J)}(d,a,l,p,g,m,b,T);return[k[2]/k[8]/pn,k[5]/k[8]/pn]}function x1(d){return[d[0],Math.min(Math.max(d[1],-Xr),Xr)]}class wC extends ze{constructor(a,l,p,g){super(),this.id=a,this.dispatcher=p,this.coordinates=l.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(g),this.options=l,this._dirty=!1}load(a,l){if(this._loaded=l||!1,this.fire(new lo("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return a&&(this.coordinates=a),this._loaded=!0,void this._finishLoading();this._imageRequest=Or(this.map._requestManager.transformRequest(this.url,Hi.Image),(p,g)=>{this._imageRequest=null,this._loaded=!0,p?this.fire(new eo(p)):g&&(this.image=g instanceof HTMLImageElement?ke.getImageData(g):g,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,a&&(this.coordinates=a),this._finishLoading())})}loaded(){return this._loaded}updateImage(a){return a.url?(this._imageRequest&&a.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=a.url,this.load(a.coordinates,this._loaded),this):this}setTexture(a){if(!(a.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new y1(this.map.painter.context,a.handle),this.width=a.dimensions[0],this.height=a.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new lo("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(a){this.map=a,this.load()}onRemove(a){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof y1||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(a){if(this.coordinates=a,this._boundsArray=void 0,this._unsupportedCoords=!1,!a.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let l=a[0][1],p=a[0][1];for(const m of a)m[1]>p&&(p=m[1]),m[1]Xr?this.onNorthPole=!0:g<-Xr&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const m=a.map(c.fromLngLat);this.tileID=function(b){let T=1/0,k=1/0,F=-1/0,S=-1/0;for(const z of b)T=Math.min(T,z.x),k=Math.min(k,z.y),F=Math.max(F,z.x),S=Math.max(S,z.y);const R=Math.max(F-T,S-k),L=Math.max(0,Math.floor(-Math.log(R)/Math.LN2)),A=Math.pow(2,L);let P=Math.floor((T+F)/2*A);return P>1&&(P-=1),new $t(L,P,Math.floor((k+S)/2*A))}(m),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new lo("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(a){for(const $ in this.tiles){const K=this.tiles[$];"loaded"!==K.state&&(K.state="loaded",K.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const l=Gy(new $t(0,0,0),this.map.transform.projection),p=[l.projection.project(this.coordinates[0][0],this.coordinates[0][1]),l.projection.project(this.coordinates[1][0],this.coordinates[1][1]),l.projection.project(this.coordinates[2][0],this.coordinates[2][1]),l.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!function($){const K=$[1].x-$[0].x,J=$[1].y-$[0].y,Z=$[2].x-$[1].x,ne=$[2].y-$[1].y,oe=$[3].x-$[2].x,le=$[3].y-$[2].y,xe=$[0].x-$[3].x,ve=$[0].y-$[3].y,ye=K*ne-Z*J,Fe=Z*le-oe*ne,Se=oe*ve-xe*le,Ne=xe*J-K*ve;return ye>0&&Fe>0&&Se>0&&Ne>0||ye<0&&Fe<0&&Se<0&&Ne<0}(p))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const g=Gy(this.tileID,this.map.transform.projection),[m,b,T,k]=this.coordinates.map($=>{const K=g.projection.project($[0],$[1]);return Xc(g,K)._round()});this.perspectiveTransform=QD(m.x,m.y,b.x,b.y,T.x,T.y,k.x,k.y);const F=this._boundsArray=new Fu;F.emplaceBack(m.x,m.y,0,0),F.emplaceBack(b.x,b.y,pn,0),F.emplaceBack(k.x,k.y,0,pn),F.emplaceBack(T.x,T.y,pn,pn),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=a.createVertexBuffer(F,g1.members),this.boundsSegments=Yr.simpleSegment(0,0,4,2);const S=[],R=[x1((L=this.coordinates)[0]),x1(L[1]),x1(L[2]),x1(L[3])];var L;const[A,P,z,j]=function($){let K=$[0][0],J=K,Z=$[0][1],ne=Z;for(let oe=1;oe<$.length;oe++)$[oe][0]J&&(J=$[oe][0]),$[oe][1]ne&&(ne=$[oe][1]);return[K,Z,J-K,ne-Z]}(R);{const $=new Fu,[K,J,Z,ne]=function(Je){let rt=Je[0].x,Qe=rt,It=Je[0].y,jt=It;for(let Et=1;EtQe&&(Qe=Je[Et].x),Je[Et].yjt&&(jt=Je[Et].y);return[rt,It,Qe-rt,jt-It]}(p),oe=Je=>[(Je.x-K)/Z,(Je.y-J)/ne],[le,xe,ve,ye]=p.map(oe),Fe=function(Je,rt,Qe,It,jt,Et,gn,dn){const Qt=v1(0,0,1,0,1,1,0,1),Wt=v1(Je,rt,Qe,It,jt,Et,gn,dn),Vn=Ze.mat3.adjoint([],Wt);return Ze.mat3.multiply(Qt,Qt,Vn)}(le[0],le[1],xe[0],xe[1],ve[0],ve[1],ye[0],ye[1]);this.elevatedGlobePerspectiveTransform=QD(le[0],le[1],xe[0],xe[1],ve[0],ve[1],ye[0],ye[1]);const Se=(Je,rt)=>{S.push(Je.lng);const Qe=Math.round((Je.lng-A)/z*pn),It=Math.round((Je.lat-P)/j*pn),jt=oe(rt),Et=Ze.vec3.transformMat3([],[jt[0],jt[1],1],Fe),gn=Math.round(Et[0]/Et[2]*pn),dn=Math.round(Et[1]/Et[2]*pn);$.emplaceBack(Qe,It,gn,dn)},Ne=p[3].x-p[0].x,Ge=p[3].y-p[0].y,He=p[2].x-p[1].x,Xe=p[2].y-p[1].y;for(let Je=0;Je<65;Je++){const rt=Je/64,Qe=[p[0].x+rt*Ne,p[0].y+rt*Ge],It=[p[1].x+rt*He,p[1].y+rt*Xe],jt=It[0]-Qe[0],Et=It[1]-Qe[1];for(let gn=0;gn<65;gn++){const dn=gn/64,Qt={x:Qe[0]+jt*dn,y:Qe[1]+Et*dn,z:0};Se(l.projection.unproject(Qt.x,Qt.y),Qt)}}this.elevatedGlobeVertexBuffer=a.createVertexBuffer($,g1.members)}{this.maxLongitudeTriangleSize=0;let $=[],K=new Ir;const J=(Z,ne,oe)=>{K.emplaceBack(Z,ne,oe);const le=S[Z],xe=S[ne],ve=S[oe],ye=Math.min(Math.min(le,xe),ve),Fe=Math.max(Math.max(le,xe),ve)-ye;Fe>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=Fe),$.push(ye+Fe/2)};for(let Z=0;Z<64;Z++)for(let ne=0;ne<64;ne++){const oe=65*Z+ne,le=oe+1,xe=oe+65,ve=xe+1;J(oe,xe,le),J(le,xe,ve)}[$,K]=function(Z,ne){const oe=Array.from({length:Z.length},(ve,ye)=>ye);oe.sort((ve,ye)=>Z[ve]-Z[ye]);const le=[],xe=new Ir;for(let ve=0;ve{b.segments.push({vertexOffset:0,primitiveOffset:R,vertexLength:l.segments[0].vertexLength,primitiveLength:L,sortKey:void 0,vaos:{}})},k=.51*this.maxLongitudeTriangleSize;if(Math.abs(p[0]-g)<=k){const R=Fc(p,0,p.length,g+k);return R===p.length||T(R,Qh(p,R+1,p.length,g+360-k)-R),b}g0?function(b,T,k){const F=(P,z,j)=>{const $=Ze.vec3.length(P),K=Ze.vec3.length(z),J=Ta(P,z,j);return Ze.vec3.scale(J,J,1/Ze.vec3.length(J)*Un($,K,j))},S=F([b[0],b[1],b[2]],[T[0],T[1],T[2]],k),R=F([b[4],b[5],b[6]],[T[4],T[5],T[6]],k),L=F([b[8],b[9],b[10]],[T[8],T[9],T[10]],k),A=Ta([b[12],b[13],b[14]],[T[12],T[13],T[14]],k);return[S[0],S[1],S[2],0,R[0],R[1],R[2],0,L[0],L[1],L[2],0,A[0],A[1],A[2],1]}(g,function(b,T){const k=T.worldSize,F=sl(1,0)*k*uu(T.center.lat,T.zoom)/ll(k),S=sl(1,T.center.lat)*k,R=Ze.mat4.identity([]);return Ze.mat4.rotateY(R,R,Li(T.center.lng)),Ze.mat4.rotateX(R,R,Li(T.center.lat)),Ze.mat4.translate(R,R,[0,0,al]),Ze.mat4.scale(R,R,[F,F,F*S]),Ze.mat4.translate(R,R,[T.point.x-.5*k,T.point.y-.5*k,0]),Ze.mat4.multiply(R,R,b),Ze.mat4.multiply(R,T.globeMatrix,R)}(d,a),p):g}function GA(d,a,l,p){const g=$n.projectAabbCorners(p,l);let m=Number.MAX_VALUE,b=-1;for(let F=0;Fnew Xt(g[F][0],g[F][1]);let k;switch(b){case 0:case 6:k=[T(1),T(5),T(4),T(7),T(3),T(2),T(1)];break;case 1:case 7:k=[T(0),T(4),T(5),T(6),T(2),T(3),T(0)];break;case 3:case 5:k=[T(1),T(0),T(4),T(7),T(6),T(2),T(1)];break;default:k=[T(1),T(5),T(6),T(7),T(3),T(0),T(1)]}if(ie(d,k))return m}const mF=wo([{name:"a_pos_3f",components:3,type:"Float32"}]),fF=wo([{name:"a_color_3f",components:3,type:"Float32"}]),qA=wo([{name:"a_color_4f",components:4,type:"Float32"}]),S1=wo([{name:"a_uv_2f",components:2,type:"Float32"}]),T1=wo([{name:"a_normal_3f",components:3,type:"Float32"}]),l2=wo([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),c2=wo([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]),DC={None:0,Model:1,Symbol:2,FillExtrusion:4,All:7};class Lp{constructor(a,l,p,g){this.message=(a?`${a}: `:"")+p,g&&(this.identifier=g),null!=l&&l.__line__&&(this.line=l.__line__)}}function IC(d,a){const l=-1===d.indexOf("://");try{return new URL(d,l&&a?"http://example.com":void 0),!0}catch{return!1}}class EC{constructor(a,l){this.feature=a,this.instancedDataOffset=l,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class e_{constructor(){this.instancedDataArray=new bm,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class mu{constructor(a){this.zoom=a.zoom,this.canonical=a.canonical,this.layers=a.layers,this.layerIds=this.layers.map(l=>l.fqid),this.projection=a.projection,this.index=a.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0}updateFootprints(a,l){}populate(a,l,p,g){this.tileToMeter=s(p);const m=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:b,id:T,index:k,sourceLayerIndex:F}of a){const S=T??(b.properties&&b.properties.hasOwnProperty("id")?b.properties.id:void 0),R=G(b,m);if(!this.layers[0]._featureFilter.filter(new ar(this.zoom),R,p))continue;const L={id:S,sourceLayerIndex:F,index:k,geometry:m?R.geometry:H(b,p,g),properties:b.properties,type:b.type,patterns:{}},A=this.addFeature(L,L.geometry,R);A&&l.featureIndex.insert(b,L.geometry,k,F,this.index,this.instancesPerModel[A].instancedDataArray.length,256)}this.lookup=null}update(a,l,p,g){for(const m in this.instancesPerModel){const b=this.instancesPerModel[m];for(const T in a)b.idToFeaturesIndex.hasOwnProperty(T)&&(this.evaluate(b.features[b.idToFeaturesIndex[T]],a[T],b,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let a=!1;for(const l in this.instancesPerModel){const p=this.instancesPerModel[l];for(const g of p.features){const m=this.layers[0],b=g.feature,T=this.canonical,k=m.paint.get("model-rotation").evaluate(b,{},T),F=m.paint.get("model-scale").evaluate(b,{},T),S=m.paint.get("model-translation").evaluate(b,{},T);Ze.vec3.exactEquals(g.rotation,k)&&Ze.vec3.exactEquals(g.scale,F)&&Ze.vec3.exactEquals(g.translation,S)||(this.evaluate(g,g.featureStates,p,!0),a=!0)}}return a}updateReplacement(a,l,p,g){if(l.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=l.updateTime;const m=l.getReplacementRegionsForTile(a.toUnwrapped(),!0);if(Dy(this.activeReplacements,m))return!1;this.activeReplacements=m;let b=!1;for(const T in this.instancesPerModel){const k=this.instancesPerModel[T],F=k.instancedDataArray;for(const S of k.features){const R=S.instancedDataOffset,L=S.instancedDataCount;for(let A=0;Apn;z=j?z-pn:z;const $=Math.floor(z),K=F.float32[P+1];let J=!1;for(const Z of this.activeReplacements)if(!X0(Z,p,DC.Model,g)&&!(Z.min.x>$||$>Z.max.x||Z.min.y>K||K>Z.max.y)&&(J=Nw(Q0($,K,a.canonical,Z.footprintTileId.canonical),Z.footprint),J))break;F.float32[P]=J?z+pn:z,b=b||J!==j}}}return b}isEmpty(){for(const a in this.instancesPerModel)if(0!==this.instancesPerModel[a].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(a){if(!this.uploaded)for(const l in this.instancesPerModel){const p=this.instancesPerModel[l];p.instancedDataArray.length<0||0===p.instancedDataArray.length||(p.instancedDataBuffer?p.instancedDataBuffer.updateData(p.instancedDataArray):p.instancedDataBuffer=a.createVertexBuffer(p.instancedDataArray,l2.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const l in this.instancesPerModel){const p=this.instancesPerModel[l];0!==p.instancedDataArray.length&&p.instancedDataBuffer&&p.instancedDataBuffer.destroy()}const a=this.layers[0].modelManager;if(a&&this.modelUris)for(const l of this.modelUris)a.removeModel(l,"")}addFeature(a,l,p){const g=this.layers[0],m=g.layout.get("model-id").evaluate(p,{},this.canonical);if(!m)return ki(`modelId is not evaluated for layer ${g.id} and it is not going to get rendered.`),m;IC(m,!1)&&(this.modelUris.includes(m)||this.modelUris.push(m)),this.instancesPerModel[m]||(this.instancesPerModel[m]=new e_);const b=this.instancesPerModel[m],T=b.instancedDataArray,k=new EC(p,T.length);for(const F of l)for(const S of F){if(S.x<0||S.x>=pn||S.y<0||S.y>=pn)continue;const R=(this.lookupDim-1)/pn,L=this.lookupDim*(S.y*R|0)+S.x*R|0;if(this.lookup){if(0!==this.lookup[L])continue;this.lookup[L]=1}this.instanceCount++;const A=T.length;T.resize(A+1),b.instancesEvaluatedElevation.push(0),T.float32[16*A]=S.x,T.float32[16*A+1]=S.y}return k.instancedDataCount=b.instancedDataArray.length-k.instancedDataOffset,k.instancedDataCount>0&&(a.id&&(b.idToFeaturesIndex[a.id]=b.features.length),b.features.push(k),this.evaluate(k,{},b,!1)),m}getModelUris(){return this.modelUris}evaluate(a,l,p,g){const m=this.layers[0],b=a.feature,T=this.canonical,k=a.rotation=m.paint.get("model-rotation").evaluate(b,l,T),F=a.scale=m.paint.get("model-scale").evaluate(b,l,T),S=a.translation=m.paint.get("model-translation").evaluate(b,l,T),R=m.paint.get("model-color").evaluate(b,l,T);R.a=m.paint.get("model-color-mix-intensity").evaluate(b,l,T);const L=[];this.maxVerticalOffset10?this.tileToMeter:s(T,J)),$[j+4]=S[0],$[j+5]=S[1],$[j+6]=S[2]+K,$[j+7]=L[0],$[j+8]=L[1],$[j+9]=L[2],$[j+10]=L[4],$[j+11]=L[5],$[j+12]=L[6],$[j+13]=L[8],$[j+14]=L[9],$[j+15]=L[10],p.instancesEvaluatedElevation[z]=S[2]}}}let MC,WA;En(mu,"ModelBucket",{omit:["layers"]}),En(e_,"PerModelAttributes"),En(EC,"ModelFeature");const Qy={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function ZA(d,a,l,p,g,m,b,T,k,F=!1){const S=l.zoom,R=l.project(p),L=uu(p.lat,S),A=1/L;Ze.mat4.identity(d),Ze.mat4.translate(d,d,[R.x+b[0]*A,R.y+b[1]*A,b[2]]);let P=1,z=1;const j=l.worldSize;if(F){if("mercator"===l.projection.name){let Z=0;l.elevation&&(Z=l.elevation.getAtPointOrZero(new c(R.x/j,R.y/j),0));const ne=Ze.vec4.transformMat4([],[R.x,R.y,Z,1],l.projMatrix)[3]/l.cameraToCenterDistance;P=ne,z=ne*uu(l.center.lat,S)}else if("globe"===l.projection.name){const Z=s2(d,l),ne=Ze.mat4.multiply([],l.projMatrix,Z),oe=[0,0,0,1];Ze.vec4.transformMat4(oe,oe,ne);const le=oe[3]/l.cameraToCenterDistance,xe=fs(S),ve=l.projection.pixelsPerMeter(p.lat,j)*uu(p.lat,S),ye=l.projection.pixelsPerMeter(l.center.lat,j)*uu(l.center.lat,S);P=le/Un(ve,Tm(l.center.lat),xe),z=le*L/ve,P*=ye,z*=ye}}else P=A;Ze.mat4.scale(d,d,[P,P,z]);const $=[...d],K=a.orientation,J=[];if(C1(J,[K[0]+g[0],K[1]+g[1],K[2]+g[2]],m),Ze.mat4.multiply(d,$,J),T&&l.elevation){let Z=0;const ne=[];if(k&&l.elevation){Z=function(xe,ve,ye,Fe,Se){const Ne=ve.elevation;if(!Ne)return 0;const Ge=$n.projectAabbCorners(ye,Fe),He=sl(1,Se.lat)*ve.worldSize,Xe=function(Vn,bn){const An=[0,0,1],fi=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const Oi of fi){const Si=Vn[Oi.corners[0]],Ii=Vn[Oi.corners[1]],Bi=Vn[Oi.corners[2]],ji=[Ii[0]-Si[0],Ii[1]-Si[1],bn*(Ii[2]-Si[2])],nr=Ze.vec3.cross(ji,ji,[Bi[0]-Si[0],Bi[1]-Si[1],bn*(Bi[2]-Si[2])]);Ze.vec3.normalize(nr,nr),Oi.dotProductWithUp=Ze.vec3.dot(nr,An)}return fi.sort((Oi,Si)=>Oi.dotProductWithUp-Si.dotProductWithUp),fi[0].corners}(Ge,He),Je=Ge[Xe[0]],rt=Ge[Xe[1]],Qe=Ge[Xe[2]],It=Ge[Xe[3]],jt=Ne.getAtPointOrZero(new c(Je[0]/ve.worldSize,Je[1]/ve.worldSize),0),Et=Ne.getAtPointOrZero(new c(rt[0]/ve.worldSize,rt[1]/ve.worldSize),0),gn=Ne.getAtPointOrZero(new c(Qe[0]/ve.worldSize,Qe[1]/ve.worldSize),0),dn=Ne.getAtPointOrZero(new c(It[0]/ve.worldSize,It[1]/ve.worldSize),0),Qt=(jt+dn)/2,Wt=(Et+gn)/2;return Qt>Wt?Et=a.gl.NEAREST_MIPMAP_NEAREST}),d.uploaded=!0,d.image=null)}function d2(d,a,l){d.indexBuffer=a.createIndexBuffer(d.indexArray,!1,!0),d.vertexBuffer=a.createVertexBuffer(d.vertexArray,mF.members,!1,!0),d.normalArray&&(d.normalBuffer=a.createVertexBuffer(d.normalArray,T1.members,!1,!0)),d.texcoordArray&&(d.texcoordBuffer=a.createVertexBuffer(d.texcoordArray,S1.members,!1,!0)),d.colorArray&&(d.colorBuffer=a.createVertexBuffer(d.colorArray,(12===d.colorArray.bytesPerElement?fF:qA).members,!1,!0)),d.featureArray&&(d.pbrBuffer=a.createVertexBuffer(d.featureArray,c2.members,!0)),d.segments=Yr.simpleSegment(0,0,d.vertexArray.length,d.indexArray.length);const p=d.material;p.pbrMetallicRoughness.baseColorTexture&&Xg(p.pbrMetallicRoughness.baseColorTexture,a),p.pbrMetallicRoughness.metallicRoughnessTexture&&Xg(p.pbrMetallicRoughness.metallicRoughnessTexture,a),p.normalTexture&&Xg(p.normalTexture,a),p.occlusionTexture&&Xg(p.occlusionTexture,a,l),p.emissionTexture&&Xg(p.emissionTexture,a)}function u2(d,a,l){if(d.meshes)for(const p of d.meshes)d2(p,a,l);if(d.children)for(const p of d.children)u2(p,a,l)}function D1(d){if(d.meshes)for(const a of d.meshes)a.indexArray.destroy(),a.vertexArray.destroy(),a.colorArray&&a.colorArray.destroy(),a.normalArray&&a.normalArray.destroy(),a.texcoordArray&&a.texcoordArray.destroy(),a.featureArray&&a.featureArray.destroy();if(d.children)for(const a of d.children)D1(a)}function I1(d){if(d.meshes)for(const l of d.meshes)l.vertexBuffer&&(l.vertexBuffer.destroy(),l.indexBuffer.destroy(),l.normalBuffer&&l.normalBuffer.destroy(),l.texcoordBuffer&&l.texcoordBuffer.destroy(),l.colorBuffer&&l.colorBuffer.destroy(),l.pbrBuffer&&l.pbrBuffer.destroy(),l.segments.destroy(),l.material&&((a=l.material).pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.gfxTexture&&a.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),a.pbrMetallicRoughness.metallicRoughnessTexture&&a.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&a.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),a.normalTexture&&a.normalTexture.gfxTexture&&a.normalTexture.gfxTexture.destroy(),a.emissionTexture&&a.emissionTexture.gfxTexture&&a.emissionTexture.gfxTexture.destroy(),a.occlusionTexture&&a.occlusionTexture.gfxTexture&&a.occlusionTexture.gfxTexture.destroy()));var a;if(d.children)for(const l of d.children)I1(l)}class Kg{constructor(a,l,p){this._demTile=a,this._dem=this._demTile.dem,this._scale=l,this._offset=p}static create(a,l,p){const g=p||a.findDEMTileFor(l);if(!g||!g.dem)return;const m=g.dem,b=g.tileID,T=1<k.fqid),this.stateDependentLayerIds=this.layers.filter(k=>k.isStateDependent()).map(k=>k.id),this.modelTraits|=Qy.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,g&&(this.modelTraits|=Qy.HasMapboxMeshFeatures),m&&(this.modelTraits|=Qy.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=b,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[];for(const k of l)this.nodesInfo.push(new AC(k)),fu(k,T.featureIndexArray.length,T.grid),T.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,T.bucketLayerIDs.length-1,0);this.states={}}updateFootprints(a,l){for(const p of this.getNodesInfo()){const g=p.node;g.footprint&&l.push({footprint:g.footprint,id:a})}}update(a){const l=0!==Object.keys(a).length;if(l&&!this.stateDependentLayers.length)return;const p=l?this.stateDependentLayers:this.layers;if(!fa(a,this.states))for(const g of p)this.evaluate(g,a);this.states=structuredClone(a)}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(a){if(!this.needsUpload)return;const l=this.getNodesInfo();for(const p of l){const g=p.node;this.uploaded?this.updatePbrBuffer(g):u2(g,a,!0)}for(const p of l)D1(p.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(a){let l=!1;if(!a.meshes)return l;for(const p of a.meshes)p.pbrBuffer&&(p.pbrBuffer.updateData(p.featureArray),l=!0);return l}needsReEvaluation(a,l,p){const g=a.transform.projectionOptions,m=a.style.getBrightness(),b=this.brightness!==m;if(!this.uploaded||this.dirty||g.name!==this.projection.name||ev(p.paint.get("model-color").value,b)||ev(p.paint.get("model-color-mix-intensity").value,b)||ev(p.paint.get("model-roughness").value,b)||ev(p.paint.get("model-emissive-strength").value,b)||ev(p.paint.get("model-height-based-emissive-strength-multiplier").value,b)){this.projection=g,this.brightness=m;const T=this.getNodesInfo();for(const k of T)k.state=null;return!0}return!1}evaluateScale(a,l){if(a.transform.zoom===this.zoom)return;this.zoom=a.transform.zoom;const p=this.getNodesInfo(),g=this.id.canonical;for(const m of p){const b=m.feature;m.evaluatedScale=l.paint.get("model-scale").evaluate(b,{},g)}}evaluate(a,l){const p=this.getNodesInfo();for(const g of p){if(!g.node.meshes)continue;const m=g.feature,b=l&&l[m.id];if(fa(b,g.state))continue;g.state=structuredClone(b);const T=g.node.meshes&&g.node.meshes[0].featureData,k=g.evaluatedColor[2],F=g.evaluatedRMEA[2],S=this.id.canonical;if(g.hasTranslucentParts=!1,T){for(let R=0;R=oe)continue;const Je=Jy[Xe],rt=Math.abs(Je);rt>Fe&&(ye=Je,Fe=rt,Se=He,Ne=Ge)}if(Fe>.1){const Ge=1-(oe+.5*Math.abs(Se*Ne))/P;let He=l._dem.get(xe,le)+ye*Ge;const Xe=l._dem.get(xe+Se,le+Ne),Je=l._dem.get(xe-Se,le-Ne,!0);(He-Xe)*(He-Je)>0&&(He=(Xe+Je)/2),Jy[ve]=l._dem.set(xe,le,He),n_[ve]=oe}}}}}T&&(l._demTile.needsDEMTextureUpload=!0,l._dem._timestamp=ke.now())}getNodesInfo(){return this.nodesInfo}destroy(){const a=this.getNodesInfo();for(const l of a)D1(l.node),I1(l.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(a,l){if(l.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=l.updateTime;const p=l.getReplacementRegionsForTile(a.toUnwrapped()),g=this.getNodesInfo();for(let m=0;mT.footprint===b.footprint)}}getHeightAtTileCoord(a,l){const p=this.getNodesInfo(),g=[],m=[0,0,0],b=Ze.mat4.identity([]);for(let T=0;TS.max[0]||l>S.max[1])continue;if(!0===k.node.hidden)return{height:1/0,maxHeight:k.feature.properties.height,hidden:!1,verticalScale:k.evaluatedScale[2]};Ze.mat4.invert(b,k.node.matrix),m[0]=a,m[1]=l,Ze.vec3.transformMat4(m,m,b);const R=(m[0]-F.aabb.min[0])/(F.aabb.max[0]-F.aabb.min[0])*64|0,L=64*Math.min(63,(m[1]-F.aabb.min[1])/(F.aabb.max[1]-F.aabb.min[1])*64|0)+Math.min(63,R),A=F.heightmap[L];if(!(A<0&&k.node.footprint))return k.hiddenByReplacement?void 0:{height:A,maxHeight:k.feature.properties.height,hidden:!1,verticalScale:k.evaluatedScale[2]};if(k.node.footprint.grid.query(new Xt(a,l),new Xt(a,l),g),g.length>0)return{height:void 0,maxHeight:k.feature.properties.height,hidden:k.hiddenByReplacement,verticalScale:k.evaluatedScale[2]}}}}function ev(d,a){return!d.isLightConstant&&a}function YA(d,a,l,p,g,m,b,T){let k=(61440&a|(61440&a)>>4)>>8,F=(3840&a|(3840&a)>>4)>>4,S=240&a|(240&a)>>4;l[3]>0&&(k=Un(k,255*l[0],l[3]),F=Un(F,255*l[1],l[3]),S=Un(S,255*l[2],l[3]));const R=k<<8|F,L=S<<8|Math.floor(255*p[3]),A=function(oe){const le=ht(oe,0,2);return Math.min(Math.round(.5*le*255),255)}(p[2])<<8|15*p[0]<<4|15*p[1],P=ht(g[0],0,1),z=ht(g[1],0,1),j=ht(g[2],0,1),$=ht(g[3],0,1);let K,J,Z,ne;if(P!==z&&b!==m&&z!==P){const oe=b-m;J=1/(oe*(z-P)),Z=-(m+oe*P)/(oe*(z-P));const le=ht(g[4],-1,1);ne=Math.pow(10,le),K=255*j<<8|255*$}else K=65535,J=0,Z=1,ne=1;if(d.emplaceBack(R,L,A,K,J,Z,ne),T){const oe=T.length;T.clear();for(let le=0;le>16&65535,S=m?k>>16&65535:65535&k,R=(15&S)<8?15&S:0,L=d.evaluatedRMEA[R],A=d.evaluatedColor[R],P=d.emissionHeightBasedParams[R];let z;if(T&&2===R&&p.lights&&(z=new Sl,z.resize(10*p.lights.length)),YA(b.featureArray,F,A,L,P,b.aabb.min[2],b.aabb.max[2],z),z&&T){T=!1;const j=p.meshes[p.lightMeshIndex];j.featureArray=z,j.featureArray._trim()}}b.featureArray._trim(),g++}}function kC(d,a,l,p){const g=1<Z.polygon).flat());const j=A?T:null,[$,K]=(ne=p,oe=R,le=S,xe=F,ve=b,ye=j,Fe=L,Se=P,Ne=m.center.lat,"globe"===(Z=m).projection.name?function(He,Xe,Je,rt,Qe,It,jt,Et,gn,dn,Qt){const Wt=[],Vn=[],bn=He.projection.upVectorScale(Qt,He.center.lat,He.worldSize).metersToTile,An=[0,0,0,1],fi=[0,0,0,1],Oi=(Ii,Bi,ji,nr)=>{Ii[0]=Bi,Ii[1]=ji,Ii[2]=nr,Ii[3]=1},Si=TD();Je>0&&(Je+=Si),rt+=Si;for(const Ii of Xe){const Bi=[],ji=[];for(const nr of Ii){const ko=nr.x+Qe.x,Ci=nr.y+Qe.y,No=He.projection.projectTilePoint(ko,Ci,Qt),Vo=He.projection.upVector(Qt,nr.x,nr.y);let pr=Je,la=rt;if(jt){const Ia=Og(ko,Ci,Je,rt,jt,Et,gn,dn);pr+=Ia.base,la+=Ia.top}0!==Je?Oi(An,No.x+Vo[0]*bn*pr,No.y+Vo[1]*bn*pr,No.z+Vo[2]*bn*pr):Oi(An,No.x,No.y,No.z),Oi(fi,No.x+Vo[0]*bn*la,No.y+Vo[1]*bn*la,No.z+Vo[2]*bn*la),Ze.vec3.transformMat4(An,An,It),Ze.vec3.transformMat4(fi,fi,It),Bi.push(new Uu(An[0],An[1],An[2])),ji.push(new Uu(fi[0],fi[1],fi[2]))}Wt.push(Bi),Vn.push(ji)}return[Wt,Vn]}(Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne,d.tileID.canonical):ye?function(He,Xe,Je,rt,Qe,It,jt,Et,gn){const dn=[],Qt=[],Wt=[0,0,0,1];for(const Vn of He){const bn=[],An=[];for(const fi of Vn){const Oi=fi.x+rt.x,Si=fi.y+rt.y,Ii=Og(Oi,Si,Xe,Je,It,jt,Et,gn);Wt[0]=Oi,Wt[1]=Si,Wt[2]=Ii.base,Wt[3]=1,Ze.vec4.transformMat4(Wt,Wt,Qe),Wt[3]=Math.max(Wt[3],1e-5);const Bi=new Uu(Wt[0]/Wt[3],Wt[1]/Wt[3],Wt[2]/Wt[3]);Wt[0]=Oi,Wt[1]=Si,Wt[2]=Ii.top,Wt[3]=1,Ze.vec4.transformMat4(Wt,Wt,Qe),Wt[3]=Math.max(Wt[3],1e-5);const ji=new Uu(Wt[0]/Wt[3],Wt[1]/Wt[3],Wt[2]/Wt[3]);bn.push(Bi),An.push(ji)}dn.push(bn),Qt.push(An)}return[dn,Qt]}(ne,oe,le,xe,ve,ye,Fe,Se,Ne):function(He,Xe,Je,rt,Qe){const It=[],jt=[],Et=Qe[8]*Xe,gn=Qe[9]*Xe,dn=Qe[10]*Xe,Qt=Qe[11]*Xe,Wt=Qe[8]*Je,Vn=Qe[9]*Je,bn=Qe[10]*Je,An=Qe[11]*Je;for(const fi of He){const Oi=[],Si=[];for(const Ii of fi){const Bi=Ii.x+rt.x,ji=Ii.y+rt.y,nr=Qe[0]*Bi+Qe[4]*ji+Qe[12],ko=Qe[1]*Bi+Qe[5]*ji+Qe[13],Ci=Qe[2]*Bi+Qe[6]*ji+Qe[14],No=Qe[3]*Bi+Qe[7]*ji+Qe[15],Vo=nr+Et,pr=ko+gn,la=Ci+dn,Ia=Math.max(No+Qt,1e-5),Jr=nr+Wt,Ur=ko+Vn,ca=Ci+bn,da=Math.max(No+An,1e-5);Oi.push(new Uu(Vo/Ia,pr/Ia,la/Ia)),Si.push(new Uu(Jr/da,Ur/da,ca/da))}It.push(Oi),jt.push(Si)}return[It,jt]}(ne,oe,le,xe,ve)),J=d.queryGeometry;var Z,ne,oe,le,xe,ve,ye,Fe,Se,Ne;return function(Z,ne,oe){let le=1/0;de(oe,ne)&&(le=Vw(oe,ne[0]));for(let xe=0;xe{if(Xf)return Xf;const l=Py();return Xf=new Lg(l.paint.properties["line-width"].specification),Xf.useIntegerZoom=!0,Xf})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,d)}createBucket(d){return new n1(d)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(d,a,l){const p=r1(this);return{config:new Sp(this,{zoom:a,lut:l}),defines:p,overrideFog:!1}}queryRadius(d){const a=d,l=a1(Mt("line-width",this,a),Mt("line-gap-width",this,a)),p=Mt("line-offset",this,a);return l/2+Math.abs(p)+Rt(this.paint.get("line-translate"))}queryIntersectsFeature(d,a,l,p,g,m){if(d.queryGeometry.isAboveHorizon)return!1;const b=nt(d.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),m.angle,d.pixelToTileUnitsFactor),T=d.pixelToTileUnitsFactor/2*a1(this.paint.get("line-width").evaluate(a,l),this.paint.get("line-gap-width").evaluate(a,l)),k=this.paint.get("line-offset").evaluate(a,l);return k&&(p=function(F,S){const R=[],L=new Xt(0,0);for(let A=0;A=3)for(let P=0;P{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){this._channel=void 0,this._callback=()=>{}}}class JA{constructor(){this.tasks={},this.taskQueue=[],Hl(["process"],this),this.invoker=new QA(this.process),this.nextId=0}add(a,l){const p=this.nextId++,g=function({type:m,isSymbolTile:b,zoom:T}){return T=T||0,"message"===m?0:"maybePrepare"!==m||b?"parseTile"!==m||b?"parseTile"===m&&b?300-T:"maybePrepare"===m&&b?400-T:500:200-T:100-T}(l);if(0===g){try{a()}finally{}return null}return this.tasks[p]={fn:a,metadata:l,priority:g,id:p},this.taskQueue.push(p),this.invoker.trigger(),{cancel:()=>{delete this.tasks[p]}}}process(){try{if(this.taskQueue=this.taskQueue.filter(p=>!!this.tasks[p]),!this.taskQueue.length)return;const a=this.pick();if(null===a)return;const l=this.tasks[a];if(delete this.tasks[a],this.taskQueue.length&&this.invoker.trigger(),!l)return;l.fn()}finally{}}pick(){let a=null,l=1/0;for(let g=0;g{p&&delete this.callbacks[T],this.target.postMessage({id:T,type:"",targetMapId:g,sourceMapId:this.mapId})}}}receive(a){const l=a.data,p=l.id;if(p&&(!l.targetMapId||this.mapId===l.targetMapId))if(""===l.type){const g=this.cancelCallbacks[p];delete this.cancelCallbacks[p],g&&g.cancel()}else if(l.mustQueue||as()){const g=this.callbacks[p],m=this.scheduler.add(()=>this.processTask(p,l),g&&g.metadata||{type:"message"});m&&(this.cancelCallbacks[p]=m)}else this.processTask(p,l)}processTask(a,l){if(delete this.cancelCallbacks[a],""===l.type){const p=this.callbacks[a];delete this.callbacks[a],p&&(l.error?p(Ch(l.error)):p(null,Ch(l.data)))}else{const p=new Set,g=l.hasCallback?(b,T)=>{this.target.postMessage({id:a,type:"",sourceMapId:this.mapId,error:b?vl(b):null,data:vl(T,p)},p)}:()=>{},m=Ch(l.data);if(this.parent[l.type])this.parent[l.type](l.sourceMapId,m,g);else if(this.parent.getWorkerSource){const b=l.type.split(".");this.parent.getWorkerSource(l.sourceMapId,b[0],m.source,m.scope)[b[1]](m,g)}else g(new Error(`Could not find function ${l.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}var i_={workerUrl:"",workerClass:null,workerParams:void 0};const M1="mapboxgl_preloaded_worker_pool";let $u,A1,Qg=(()=>{class d{constructor(){this.active={}}acquire(l,p=d.workerCount){if(!this.workers)for(this.workers=[];this.workers.length{p.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[M1]}numActive(){return Object.keys(this.active).length}}return d.workerCount=2,d})();class Fp{constructor(a,l,p="Worker",g=Qg.workerCount){this.workerPool=a,this.actors=[],this.currentActor=0,this.id=ai();const m=this.workerPool.acquire(this.id,g);for(let b=0;b{this.ready=!0})}broadcast(a,l,p){vo(this.actors,(g,m)=>{g.send(a,l,m)},p=p||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(a=>{a.remove()}),this.actors=[],this.workerPool.release(this.id)}}function tv(){return $u||($u=new Qg),$u}Fp.Actor=Ao;const o_=new In(0,0,0);var d,k1=((d=k1||{})[d.PATH_RULE_UNSPECIFIED=0]="PATH_RULE_UNSPECIFIED",d[d.PATH_RULE_NON_ZERO=1]="PATH_RULE_NON_ZERO",d[d.PATH_RULE_EVEN_ODD=2]="PATH_RULE_EVEN_ODD",d),R1=(d=>(d[d.LINE_CAP_UNSPECIFIED=0]="LINE_CAP_UNSPECIFIED",d[d.LINE_CAP_BUTT=1]="LINE_CAP_BUTT",d[d.LINE_CAP_ROUND=2]="LINE_CAP_ROUND",d[d.LINE_CAP_SQUARE=3]="LINE_CAP_SQUARE",d))(R1||{}),nv=(d=>(d[d.LINE_JOIN_UNSPECIFIED=0]="LINE_JOIN_UNSPECIFIED",d[d.LINE_JOIN_MITER=1]="LINE_JOIN_MITER",d[d.LINE_JOIN_MITER_CLIP=2]="LINE_JOIN_MITER_CLIP",d[d.LINE_JOIN_ROUND=3]="LINE_JOIN_ROUND",d[d.LINE_JOIN_BEVEL=4]="LINE_JOIN_BEVEL",d))(nv||{}),RC=(d=>(d[d.PAINT_ORDER_UNSPECIFIED=0]="PAINT_ORDER_UNSPECIFIED",d[d.PAINT_ORDER_FILL_AND_STROKE=1]="PAINT_ORDER_FILL_AND_STROKE",d[d.PAINT_ORDER_STROKE_AND_FILL=2]="PAINT_ORDER_STROKE_AND_FILL",d))(RC||{}),Bm=(d=>(d[d.PATH_COMMAND_UNSPECIFIED=0]="PATH_COMMAND_UNSPECIFIED",d[d.PATH_COMMAND_MOVE=1]="PATH_COMMAND_MOVE",d[d.PATH_COMMAND_LINE=2]="PATH_COMMAND_LINE",d[d.PATH_COMMAND_QUAD=3]="PATH_COMMAND_QUAD",d[d.PATH_COMMAND_CUBIC=4]="PATH_COMMAND_CUBIC",d[d.PATH_COMMAND_CLOSE=5]="PATH_COMMAND_CLOSE",d))(Bm||{}),m2=(d=>(d[d.MASK_TYPE_UNSPECIFIED=0]="MASK_TYPE_UNSPECIFIED",d[d.MASK_TYPE_LUMINANCE=1]="MASK_TYPE_LUMINANCE",d[d.MASK_TYPE_ALPHA=2]="MASK_TYPE_ALPHA",d))(m2||{});function f2(d,a,l){var p,g;1===d&&a.icons.push((p=l,g=l.readVarint()+l.pos,function(m){if(m.usvg_tree.height||(m.usvg_tree.height=m.usvg_tree.width),!m.metadata)return m;const{metadata:b}=m;if(b.content_area){const{content_area:T}=b;null==T.top&&(T.top=T.left),null==T.width&&(T.width=m.usvg_tree.width),null==T.height&&(T.height=T.width)}return b.stretch_x&&b.stretch_x.length&&iv(b,"x"),b.stretch_y&&b.stretch_y.length&&iv(b,"y"),m}(p.readFields(ek,{name:void 0},g))))}function iv(d,a){const l=[],p=d[`stretch_${a}`];let g=null;for(let m=0;m>16&255)/255,(d>>8&255)/255,(255&d)/255,1)}function _2(d,a,l){1===d?(a.rgb_color=L1(l.readVarint()),a.paint="rgb_color"):2===d?(a.linear_gradient_idx=l.readVarint(),a.paint="linear_gradient_idx"):3===d?(a.radial_gradient_idx=l.readVarint(),a.paint="radial_gradient_idx"):5===d?l.readPackedFloat(a.dasharray):6===d?a.dashoffset=l.readFloat():7===d?a.miterlimit=l.readFloat():8===d?a.opacity=l.readVarint():9===d?a.width=l.readFloat():10===d?a.linecap=l.readVarint():11===d&&(a.linejoin=l.readVarint())}function nk(d,a,l){1===d?a.transform=av(l,l.readVarint()+l.pos):2===d?a.spread_method=l.readVarint():3===d?a.stops.push(g2(l,l.readVarint()+l.pos)):4===d?a.x1=l.readFloat():5===d?a.y1=l.readFloat():6===d?a.x2=l.readFloat():7===d&&(a.y2=l.readFloat())}function g2(d,a){return d.readFields(ik,{offset:0,opacity:255,rgb_color:o_},a)}function ik(d,a,l){1===d?a.offset=l.readFloat():2===d?a.opacity=l.readVarint():3===d&&(a.rgb_color=L1(l.readVarint()))}function Kc(d,a,l){1===d?a.transform=av(l,l.readVarint()+l.pos):2===d?a.spread_method=l.readVarint():3===d?a.stops.push(g2(l,l.readVarint()+l.pos)):4===d?a.cx=l.readFloat():5===d?a.cy=l.readFloat():6===d?a.r=l.readFloat():7===d?a.fx=l.readFloat():8===d?a.fy=l.readFloat():9===d&&(a.fr=l.readFloat())}function ok(d,a,l){1===d?a.transform=av(l,l.readVarint()+l.pos):2===d?a.clip_path_idx=l.readVarint():3===d&&a.children.push(rv(l,l.readVarint()+l.pos))}function b2(d,a,l){1===d?a.left=a.top=l.readFloat():2===d?a.width=a.height=l.readFloat():3===d?a.top=l.readFloat():4===d?a.height=l.readFloat():5===d?a.mask_type=l.readVarint():6===d?a.mask_idx=l.readVarint():7===d&&a.children.push(rv(l,l.readVarint()+l.pos))}class _F{static calculate(a,l){const p=new Map,g=new Map;if(0===Object.keys(a).length)return p;l.forEach(m=>{g.set(m.name,m.rgb_color||new In(0,0,0))});for(const[m,b]of Object.entries(a))g.has(m)?p.set(g.get(m).toStringPremultipliedAlpha(),b):console.warn(`Ignoring unknown image variable "${m}"`);return p}}function Jg(d,a=255,l){const p=a/255,g=d.toStringPremultipliedAlpha(),m=l.has(g)?l.get(g).clone():d.clone();return m.a=p,m.toString()}function sv(d,a){if(!_e()){const l=document.createElement("canvas");return l.width=d,l.height=a,l}return new OffscreenCanvas(d,a)}function rk(d,a){const l=_F.calculate(a.params,d.metadata?d.metadata.variables:[]),p=d.usvg_tree,g=p.width,m=p.height,b=a.transform?a.transform:new DOMMatrix,T=Math.max(1,Math.round(g*b.a)),k=Math.max(1,Math.round(m*b.d)),F=new DOMMatrix([T/g,0,0,k/m,0,0]),S=sv(T,k).getContext("2d");return lv(S,F,p,p,l),S.getImageData(0,0,T,k)}function lv(d,a,l,p,g){for(const m of p.children)Gu(d,a,l,m,g)}function Gu(d,a,l,p,g){p.group?(d.save(),function(m,b,T,k,F){const S=null!=k.mask_idx?T.masks[k.mask_idx]:null,R=null!=k.clip_path_idx?T.clip_paths[k.clip_path_idx]:null;if(k.transform&&(b=r_(k.transform).preMultiplySelf(b)),255===k.opacity&&!(null!=R)&&!(null!=S))return void lv(m,b,T,k,F);const L=sv(m.canvas.width,m.canvas.height),A=L.getContext("2d");lv(A,b,T,k,F),R&&v2(A,b,T,R),S&&x2(A,b,T,S,F),m.globalAlpha=k.opacity/255,m.drawImage(L,0,0)}(d,a,l,p.group,g),d.restore()):p.path&&(d.save(),function(m,b,T,k,F){const S=w2(k);m.setTransform(b),k.paint_order===RC.PAINT_ORDER_FILL_AND_STROKE?(F1(m,T,k,S,F),ak(m,T,k,S,F)):(ak(m,T,k,S,F),F1(m,T,k,S,F))}(d,a,l,p.path,g),d.restore())}function F1(d,a,l,p,g){const m=l.fill;if(!m)return;const b=m.opacity/255;switch(m.paint){case"rgb_color":d.fillStyle=Jg(m.rgb_color,m.opacity,g);break;case"linear_gradient_idx":d.fillStyle=NC(d,a.linear_gradients[m.linear_gradient_idx],b,g);break;case"radial_gradient_idx":d.fillStyle=N1(d,a.radial_gradients[m.radial_gradient_idx],b,g)}d.fill(p,y2(l))}function y2(d){return d.rule===k1.PATH_RULE_NON_ZERO?"nonzero":d.rule===k1.PATH_RULE_EVEN_ODD?"evenodd":void 0}function ak(d,a,l,p,g){const m=l.stroke;if(!m)return;d.lineWidth=m.width,d.miterLimit=m.miterlimit,d.setLineDash(m.dasharray),d.lineDashOffset=m.dashoffset;const b=m.opacity/255;switch(m.paint){case"rgb_color":d.strokeStyle=Jg(m.rgb_color,m.opacity,g);break;case"linear_gradient_idx":d.strokeStyle=NC(d,a.linear_gradients[m.linear_gradient_idx],b,g);break;case"radial_gradient_idx":d.strokeStyle=N1(d,a.radial_gradients[m.radial_gradient_idx],b,g)}switch(m.linejoin){case nv.LINE_JOIN_MITER_CLIP:case nv.LINE_JOIN_MITER:d.lineJoin="miter";break;case nv.LINE_JOIN_ROUND:d.lineJoin="round";break;case nv.LINE_JOIN_BEVEL:d.lineJoin="bevel"}switch(m.linecap){case R1.LINE_CAP_BUTT:d.lineCap="butt";break;case R1.LINE_CAP_ROUND:d.lineCap="round";break;case R1.LINE_CAP_SQUARE:d.lineCap="square"}d.stroke(p)}function NC(d,a,l,p){if(1===a.stops.length){const L=a.stops[0];return Jg(L.rgb_color,L.opacity*l,p)}const g=r_(a.transform),{x1:m,y1:b,x2:T,y2:k}=a,F=g.transformPoint(new DOMPoint(m,b)),S=g.transformPoint(new DOMPoint(T,k)),R=d.createLinearGradient(F.x,F.y,S.x,S.y);for(const L of a.stops)R.addColorStop(L.offset,Jg(L.rgb_color,L.opacity*l,p));return R}function N1(d,a,l,p){if(1===a.stops.length){const L=a.stops[0];return Jg(L.rgb_color,L.opacity*l,p)}const g=r_(a.transform),{fx:m,fy:b,cx:T,cy:k}=a,F=g.transformPoint(new DOMPoint(m,b)),S=g.transformPoint(new DOMPoint(T,k)),R=d.createRadialGradient(F.x,F.y,0,S.x,S.y,a.r*((g.a+g.d)/2));for(const L of a.stops)R.addColorStop(L.offset,Jg(L.rgb_color,L.opacity*l,p));return R}function z1(d,a,l,p){const g=p.transform?r_(p.transform).preMultiplySelf(a):a,m=sv(d.canvas.width,d.canvas.height),b=m.getContext("2d");for(const k of p.children)if(k.group)z1(b,g,l,k.group);else if(k.path){const F=k.path,S=new Path2D;S.addPath(w2(F),g),b.fill(S,y2(F))}const T=null!=p.clip_path_idx?l.clip_paths[p.clip_path_idx]:null;T&&v2(b,g,l,T),d.globalCompositeOperation="source-over",d.drawImage(m,0,0)}function v2(d,a,l,p){const g=sv(d.canvas.width,d.canvas.height);z1(g.getContext("2d"),a,l,p),d.globalCompositeOperation="destination-in",d.drawImage(g,0,0)}function x2(d,a,l,p,g){if(0===p.children.length)return;const m=null!=p.mask_idx?l.masks[p.mask_idx]:null;m&&x2(d,a,l,m,g);const b=d.canvas.width,T=d.canvas.height,k=sv(b,T),F=k.getContext("2d"),S=p.width,R=p.height,L=p.left,A=p.top,P=new Path2D,z=new Path2D;z.rect(L,A,S,R),P.addPath(z,a),F.clip(P);for(const K of p.children)Gu(F,a,l,K,g);const j=F.getImageData(0,0,b,T),$=j.data;if(p.mask_type===m2.MASK_TYPE_LUMINANCE)for(let K=0;K<$.length;K+=4)$[K+3]=$[K+3]/255*(.2126*$[K]+.7152*$[K+1]+.0722*$[K+2]);F.putImageData(j,0,0),d.globalCompositeOperation="destination-in",d.drawImage(k,0,0)}function r_(d){return d?new DOMMatrix([d.sx,d.ky,d.kx,d.sy,d.tx,d.ty]):new DOMMatrix}function w2(d){const a=new Path2D,l=d.step;let p=d.diffs[0]*l,g=d.diffs[1]*l;a.moveTo(p,g);for(let m=0,b=2;ma[b])return null}else{const T=1/p[b];let k=(d[b]-l[b])*T,F=(a[b]-l[b])*T;if(k>F){const S=k;k=F,F=S}if(k>g&&(g=k),Fm)return null}return g}function C2(d,a,l,p,g,m,b,T,k,F,S){const R=p-d,L=g-a,A=m-l,P=b-d,z=T-a,j=k-l,$=S[1]*j-S[2]*z,K=S[2]*P-S[0]*j,J=S[0]*z-S[1]*P,Z=R*$+L*K+A*J;if(Math.abs(Z)<1e-15)return null;const ne=1/Z,oe=F[0]-d,le=F[1]-a,xe=F[2]-l,ve=(oe*$+le*K+xe*J)*ne;if(ve<0||ve>1)return null;const ye=le*A-xe*L,Fe=xe*R-oe*A,Se=oe*L-le*R,Ne=(S[0]*ye+S[1]*Fe+S[2]*Se)*ne;return Ne<0||ve+Ne>1?null:(P*ye+z*Fe+j*Se)*ne}function zp(d,a,l){return(d-a)/(l-a)}function Bp(d,a,l,p,g,m,b,T,k){const F=1<{const K=j?1:0,J=(A+1)*z-K,Z=P*z,ne=(P+1)*z-K;$[0]=A*z,$[1]=Z,$[2]=J,$[3]=ne};let R=new B1(k);const L=[];for(let A=0;A=1;k/=2){const A=T[T.length-1];R=new B1(k);for(let P=0;P0;){const{idx:P,t:z,nodex:j,nodey:$,depth:K}=A.pop();if(this.leaves[P]){Bp(j,$,K,a,l,p,g,R,L);const Z=1<=Xe[2])return z}continue}let J=0;for(let Z=0;Z=F[S[xe]]&&(S.splice(xe,0,Z),le=!0);le||(S[J]=Z),J++}}for(let Z=0;Z=this.dim+1||l<-1||l>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(l+1)*this.stride+(a+1)}static pack(a,l){const p=[0,0,0,0],g=Hm.getUnpackVector(l);let m=Math.floor((a+g[3])/g[2]);return p[2]=m%256,m=Math.floor(m/256),p[1]=m%256,m=Math.floor(m/256),p[0]=m,p}getPixels(){return new H0({width:this.stride,height:this.stride},this.pixels)}backfillBorder(a,l,p){if(this.dim!==a.dim)throw new Error("dem dimension mismatch");let g=l*this.dim,m=l*this.dim+this.dim,b=p*this.dim,T=p*this.dim+this.dim;switch(l){case-1:g=m-1;break;case 1:m=g+1}switch(p){case-1:b=T-1;break;case 1:T=b+1}const k=-l*this.dim,F=-p*this.dim;for(let S=b;S=1;p--){const g=1===p?1:0,m=2===p?1:0;for(let b=0;b>>1^-(1&d[a]);return d}function U1(d,a){switch(a){case"uint32":return d;case"uint16":for(let l=0;l>4|(61440&p)>>8|(240&g)<<4|61440&g,d[l+1]=15&p|(3840&p)>>4|(15&g)<<8|(3840&g)<<4}return d;case"uint8":for(let l=0;l>6|(192&g)>>4|(192&m)>>2|192&b,d[l+1]=(48&p)>>4|(48&g)>>2|48&m|(48&b)<<2,d[l+2]=(12&p)>>2|12&g|(12&m)<<2|(12&b)<<4,d[l+3]=3&p|(3&g)<<2|(3&m)<<4|(3&b)<<6}return d;default:throw new Error(`Invalid pixel format, "${a}"`)}}En(Hm,"DEMData"),En(a_,"DemMinMaxQuadTree",{omit:["dem"]});var cl=Uint8Array,eb=Uint16Array,jC=Int32Array,H1=new cl([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cv=new cl([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),dk=new cl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$C=function(d,a){for(var l=new eb(31),p=0;p<31;++p)l[p]=a+=1<>1|(21845&ga)<<1;qC[ga]=((65280&(nb=(61680&(nb=(52428&nb)>>2|(13107&nb)<<2))>>4|(3855&nb)<<4))>>8|(255&nb)<<8)>>1}var dv=function(d,a,l){for(var p=d.length,g=0,m=new eb(a);g>k]=F;return b},uv=new cl(288);for(ga=0;ga<144;++ga)uv[ga]=8;for(ga=144;ga<256;++ga)uv[ga]=9;for(ga=256;ga<280;++ga)uv[ga]=7;for(ga=280;ga<288;++ga)uv[ga]=8;var R2=new cl(32);for(ga=0;ga<32;++ga)R2[ga]=5;var uk=dv(uv,9),hk=dv(R2,5),j1=function(d){for(var a=d[0],l=1;la&&(a=d[l]);return a},_u=function(d,a,l){var p=a/8|0;return(d[p]|d[p+1]<<8)>>(7&a)&l},WC=function(d,a){var l=a/8|0;return(d[l]|d[l+1]<<8|d[l+2]<<16)>>(7&a)},$1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],qu=function(d,a,l){var p=new Error(a||$1[d]);if(p.code=d,Error.captureStackTrace&&Error.captureStackTrace(p,qu),!l)throw p;return p},O2=new cl(0),P2=typeof TextDecoder<"u"&&new TextDecoder;try{P2.decode(O2,{stream:!0})}catch{}const L2={gzip_data:"gzip"};class gu extends Error{constructor(a){super(a),this.name="MRTError"}}const pk={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},ZC={uint32:1,uint16:2,uint8:4},YC={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let G1;class XC{constructor(a=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=a}getLayer(a){const l=this.layers[a];if(!l)throw new gu(`Layer '${a}' not found`);return l}getHeaderLength(a){const l=new Uint8Array(a),p=new DataView(a);if(13!==l[0])throw new gu("File is not a valid MRT.");return p.getUint32(1,!0)}parseHeader(a){const l=new Uint8Array(a),p=this.getHeaderLength(a);if(l.length= ${p} but got buffer of length ${l.length}`);const g=new G1(l.subarray(0,p)).readFields(VC,{headerLength:0,x:0,y:0,z:0,layers:[]},void 0);if(!isNaN(this.x)&&(this.x!==g.x||this.y!==g.y||this.z!==g.z))throw new gu(`Invalid attempt to parse header ${g.z}/${g.x}/${g.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=g.x,this.y=g.y,this.z=g.z;for(const m of g.layers)this.layers[m.name]=new hv(m,{cacheSize:this._cacheSize});return this}createDecodingTask(a){const l=[],p=this.getLayer(a.layerName);for(let g of a.blockIndices){const m=p.dataIndex[g],b=m.firstByte-a.firstByte,T=m.lastByte-a.firstByte;if(p._blocksInProgress.has(g))continue;const k={layerName:p.name,firstByte:b,lastByte:T,pixelFormat:p.pixelFormat,blockIndex:g,blockShape:[m.bands.length].concat(p.bandShape),buffer:p.buffer,codec:m.codec.codec,filters:m.filters.map(F=>F.filter)};p._blocksInProgress.add(g),l.push(k)}return new KC(l,()=>{l.forEach(g=>p._blocksInProgress.delete(g.blockIndex))},(g,m)=>{if(l.forEach(b=>p._blocksInProgress.delete(b.blockIndex)),g)throw g;m.forEach(b=>{this.getLayer(b.layerName).processDecodedData(b)})})}}class hv{constructor({version:a,name:l,units:p,tileSize:g,pixelFormat:m,buffer:b,dataIndex:T},k){if(this.version=a,1!==this.version)throw new gu(`Cannot parse raster layer encoded with MRT version ${a}`);this.name=l,this.units=p,this.tileSize=g,this.buffer=b,this.pixelFormat=pk[m],this.dataIndex=T,this.bandShape=[g+2*b,g+2*b,ZC[this.pixelFormat]],this._decodedBlocks=new Vm(k?k.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return ZC[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map(({bands:a})=>a).flat()}processDecodedData(a){const l=a.blockIndex.toString();this._decodedBlocks.get(l)||this._decodedBlocks.put(l,a.data)}getBlockForBand(a){let l=0;switch(typeof a){case"string":for(const[p,g]of this.dataIndex.entries()){for(const[m,b]of g.bands.entries())if(b===a)return{bandIndex:l+m,blockIndex:p,blockBandIndex:m};l+=g.bands.length}break;case"number":for(const[p,g]of this.dataIndex.entries()){if(a>=l&&athis.cacheSize)throw new gu(`Number of blocks to decode (${m.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:l,lastByte:p,blockIndices:g}}hasBand(a){const{blockIndex:l}=this.getBlockForBand(a);return l>=0}hasDataForBand(a){const{blockIndex:l}=this.getBlockForBand(a);return l>=0&&!!this._decodedBlocks.get(l.toString())}getBandView(a){const{blockIndex:l,blockBandIndex:p}=this.getBlockForBand(a),g=this._decodedBlocks.get(l.toString());if(!g)throw new gu(`Data for band ${JSON.stringify(a)} of layer "${this.name}" not decoded.`);const m=this.dataIndex[l],b=this.bandShape.reduce((F,S)=>F*S,1),T=p*b,k=g.subarray(T,T+b);return{data:k,bytes:new Uint8Array(k.buffer).subarray(k.byteOffset,k.byteOffset+k.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:m.offset,scale:m.scale}}}XC.setPbf=function(d){G1=d};class KC{constructor(a,l,p){this.tasks=a,this._onCancel=l,this._onComplete=p,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(a,l){this._finalized||(this._onComplete(a,l),this._finalized=!0)}}XC.performDecoding=function(d,a){const l=new Uint8Array(d);return Promise.all(a.tasks.map(p=>{const{layerName:g,firstByte:m,lastByte:b,pixelFormat:T,blockShape:k,blockIndex:F,filters:S,codec:R}=p,L=l.subarray(m,b+1),A=new Uint32Array(k[0]*k[1]*k[2]);let P;if("gzip_data"!==R)throw new gu(`Unhandled codec: ${R}`);return P=function(z,j){if(!globalThis.DecompressionStream&&"gzip_data"===j)return Promise.resolve(((Z=function(le){31==le[0]&&139==le[1]&&8==le[2]||qu(6,"invalid gzip data");var xe=le[3],ve=10;4&xe&&(ve+=2+(le[10]|le[11]<<8));for(var ye=(xe>>3&1)+(xe>>4&1);ye>0;ye-=!le[ve++]);return ve+(2&xe)}(J=z))+8>J.length&&qu(6,"invalid gzip data"),function(le,xe,ve){var Fe=le.length;if(!Fe||xe.f&&!xe.l)return ve||new cl(0);var Se=!ve,Ne=Se||2!=xe.i,Ge=xe.i;Se&&(ve=new cl(3*Fe));var He,Xe,Je=function(Fd){var h_=ve.length;if(Fd>h_){var ab=new cl(Math.max(2*h_,Fd));ab.set(ve),ve=ab}},rt=xe.f||0,Qe=xe.p||0,It=xe.b||0,jt=xe.l,Et=xe.d,gn=xe.m,dn=xe.n,Qt=8*Fe;do{if(!jt){rt=_u(le,Qe,1);var Wt=_u(le,Qe+1,3);if(Qe+=3,!Wt){var Vn=le[(Ci=4+((Qe+7)/8|0))-4]|le[Ci-3]<<8,bn=Ci+Vn;if(bn>Fe){Ge&&qu(0);break}Ne&&Je(It+Vn),ve.set(le.subarray(Ci,bn),It),xe.b=It+=Vn,xe.p=Qe=8*bn,xe.f=rt;continue}if(1==Wt)jt=uk,Et=hk,gn=9,dn=5;else if(2==Wt){var An=_u(le,Qe,31)+257,fi=_u(le,Qe+10,15)+4,Oi=An+_u(le,Qe+5,31)+1;Qe+=14;for(var Si=new cl(Oi),Ii=new cl(19),Bi=0;Bi>4)<16)Si[Bi++]=Ci;else{var Vo=0,pr=0;for(16==Ci?(pr=3+_u(le,Qe,3),Qe+=2,Vo=Si[Bi-1]):17==Ci?(pr=3+_u(le,Qe,7),Qe+=3):18==Ci&&(pr=11+_u(le,Qe,127),Qe+=7);pr--;)Si[Bi++]=Vo}}var la=Si.subarray(0,An),Ia=Si.subarray(An);gn=j1(la),dn=j1(Ia),jt=dv(la,gn),Et=dv(Ia,dn)}else qu(1);if(Qe>Qt){Ge&&qu(0);break}}Ne&&Je(It+131072);for(var Jr=(1<>4;if((Qe+=15&Vo)>Qt){Ge&&qu(0);break}if(Vo||qu(2),da<256)ve[It++]=da;else{if(256==da){ca=Qe,jt=null;break}var gs=da-254;da>264&&(gs=_u(le,Qe,(1<<(Wu=H1[Bi=da-257]))-1)+k2[Bi],Qe+=Wu);var sr=Et[WC(le,Qe)&Ur],Cc=sr>>4;if(sr||qu(3),Qe+=15&sr,Ia=GC[Cc],Cc>3){var Wu=cv[Cc];Ia+=WC(le,Qe)&(1<Qt){Ge&&qu(0);break}Ne&&Je(It+131072);var Ld=It+gs;if(ItHe.length)&&(Xe=He.length),new cl(He.subarray(0,Xe))):ve.subarray(0,It)}(J.subarray(Z,-8),{i:2},new cl((($=J)[(K=$.length)-4]|$[K-3]<<8|$[K-2]<<16|$[K-1]<<24)>>>0))));var $,K,J,Z;const ne=L2[j];if(!ne)throw new Error(`Unhandled codec: ${j}`);const oe=new globalThis.DecompressionStream(ne);return new Response(new Blob([z]).stream().pipeThrough(oe)).arrayBuffer().then(le=>new Uint8Array(le))}(L,R).then(z=>(new G1(z).readFields(I2,A),new YC[T](A.buffer))),P.then(z=>{for(let j=S.length-1;j>=0;j--)switch(S[j]){case"delta_filter":HC(z,k);break;case"zigzag_filter":M2(z);break;case"bitshuffle_filter":U1(z,T);break;default:throw new gu(`Unhandled filter "${S[j]}"`)}return{layerName:g,blockIndex:F,data:z}}).catch(z=>{throw z})}))},En(KC,"MRTDecodingBatch",{omit:["_onCancel","_onComplete"]});let ib,jm,Pd,Bh,QC,s_=null;function ob(){return as()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:jm||zr.DRACO_URL}function mk(){if(as()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Bh)return Bh;const d=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Bh=WebAssembly.validate(d)?zr.MESHOPT_SIMD_URL:zr.MESHOPT_URL,Bh}const JC={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},sa={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},pv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function F2(d,a,l){const p=l.json.bufferViews.length,g=l.buffers.length;a.bufferView=p,l.json.bufferViews[p]={buffer:g,byteLength:d.byteLength},l.buffers[g]=d}const eS="KHR_draco_mesh_compression";function q1(d,a){const l=d.extensions&&d.extensions[eS];if(!l)return;const p=new Pd.Decoder,g=yk(a,l.bufferView),m=new Pd.Mesh;if(!p.DecodeArrayToMesh(g,g.byteLength,m))throw new Error("Failed to decode Draco mesh");const b=a.json.accessors[d.indices],T=JC[b.componentType],k=b.count*T.BYTES_PER_ELEMENT,F=Pd._malloc(k);T===Uint16Array?p.GetTrianglesUInt16Array(m,k,F):p.GetTrianglesUInt32Array(m,k,F),F2(Pd.memory.buffer.slice(F,F+k),b,a),Pd._free(F);for(const S of Object.keys(l.attributes)){const R=p.GetAttributeByUniqueId(m,l.attributes[S]),L=a.json.accessors[d.attributes[S]],A=sa[L.componentType],P=L.count*pv[L.type]*JC[L.componentType].BYTES_PER_ELEMENT,z=Pd._malloc(P);p.GetAttributeDataArrayForAllPoints(m,R,Pd[A],P,z),F2(Pd.memory.buffer.slice(z,z+P),L,a),Pd._free(z)}p.destroy(),m.destroy(),delete d.extensions[eS]}const rb="EXT_meshopt_compression";function fk(d,a){if(!d.extensions||!d.extensions[rb])return;const l=d.extensions[rb],p=new Uint8Array(a.buffers[l.buffer],l.byteOffset||0,l.byteLength||0),g=new Uint8Array(l.count*l.byteStride);QC.decodeGltfBuffer(g,l.count,l.byteStride,p,l.mode,l.filter),d.buffer=a.buffers.length,d.byteOffset=0,a.buffers[d.buffer]=g.buffer,delete d.extensions[rb]}const _k=1179937895,gk=new TextDecoder("utf8");function N2(d,a){return new URL(d,a).href}function bk(d,a,l,p){return fetch(N2(d.uri,p)).then(g=>g.arrayBuffer()).then(g=>{a.buffers[l]=g})}function yk(d,a){const l=d.json.bufferViews[a];return new Uint8Array(d.buffers[l.buffer],l.byteOffset||0,l.byteLength)}function vk(d,a,l,p){if(d.uri){const g=N2(d.uri,p);return fetch(g).then(m=>m.blob()).then(m=>createImageBitmap(m)).then(m=>{a.images[l]=m})}if(void 0!==d.bufferView){const g=yk(a,d.bufferView),m=new Blob([g],{type:d.mimeType});return createImageBitmap(m).then(b=>{a.images[l]=b})}}function xk(d,a=0,l){const p={json:null,images:[],buffers:[]};if(new Uint32Array(d,a,1)[0]===_k){const S=new Uint32Array(d,a);let R=2;const L=(S[R++]>>2)-3,A=S[R++]>>2;if(R++,p.json=JSON.parse(gk.decode(S.subarray(R,R+A))),R+=A,R{const S=[],R=T&&T.includes(eS),L=T&&T.includes(rb);if(R&&S.push(function(){if(!Pd)return ib??(ib=function(A){let P,z=null;function j(){P=new Uint8Array(z.buffer)}function $(){throw new Error("Unexpected Draco error.")}const K={a:{a:$,d:function(J,Z,ne){return P.copyWithin(J,Z,Z+ne)},c:function(J){const Z=P.length,ne=Math.max(J>>>0,Math.ceil(1.2*Z)),oe=Math.ceil((ne-Z)/65536);try{return z.grow(oe),j(),!0}catch{return!1}},b:$}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(A,K):A.then(J=>J.arrayBuffer()).then(J=>WebAssembly.instantiate(J,K))).then(J=>{const{Rb:Z,Qb:ne,P:oe,T:le,X:xe,Ja:ve,La:ye,Qa:Fe,Va:Se,Wa:Ne,eb:Ge,jb:He,f:Xe,e:Je,yb:rt,zb:Qe,Ab:It,Bb:jt,Db:Et,Gb:gn}=J.instance.exports;z=Je;const dn=(()=>{let Qt=0,Wt=0,Vn=0,bn=0;return An=>{Vn&&(Z(bn),Z(Qt),Wt+=Vn,Vn=Qt=0),Qt||(Wt+=128,Qt=ne(Wt));const fi=An.length+7&-8;let Oi=Qt;fi>=Wt&&(Vn=fi,Oi=bn=ne(fi));for(let Si=0;Si{Pd=A,ib=void 0}))}()),L&&S.push(function(){if(QC)return;const A=function(P){let z;const j=WebAssembly.instantiateStreaming(P,{}).then(J=>{z=J.instance,z.exports.__wasm_call_ctors()}),$={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},K={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:j,supported:!0,decodeGltfBuffer(J,Z,ne,oe,le,xe){!function(ve,ye,Fe,Se,Ne,Ge,He){const Xe=ve.exports.sbrk,Je=Se+3&-4,rt=Xe(Je*Ne),Qe=Xe(Ge.length),It=new Uint8Array(ve.exports.memory.buffer);It.set(Ge,Qe);const jt=ye(rt,Se,Ne,Qe,Ge.length);if(0===jt&&He&&He(rt,Je,Ne),Fe.set(It.subarray(rt,rt+Se*Ne)),Xe(rt-Xe(0)),0!==jt)throw new Error(`Malformed buffer data: ${jt}`)}(z,z.exports[K[le]],J,Z,ne,oe,z.exports[$[xe]])}}}(fetch(mk()));return A.ready.then(()=>{QC=A})}()),m)for(let A=0;A{if(R&&b)for(const{primitives:A}of b)for(const P of A)q1(P,p);if(L&&b&&k)for(const A of k)fk(A,p);return p})})}function l_(d,a){const l=d.json.bufferViews[a.bufferView],p=JC[a.componentType];return new p(d.buffers[l.buffer],(a.byteOffset||0)+(l.byteOffset||0),a.count*(l.byteStride&&l.byteStride!==pv[a.type]*p.BYTES_PER_ELEMENT?l.byteStride/p.BYTES_PER_ELEMENT:pv[a.type]))}function tS(d,a,l,p){const g=JC[a.componentType],m=function(S){switch(S){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:return 1}}(g),b=d.json.bufferViews[a.bufferView],T=b.byteStride?b.byteStride/g.BYTES_PER_ELEMENT:pv[a.type],k=l.float32,F=k.length/l.capacity;for(let S=0,R=0;S0){for(let j=0;j0){m.texcoordArray=new Nu;const L=a.json.accessors[g.TEXCOORD_0];m.texcoordArray.resize(L.count);const A=l_(a,L);tS(a,L,m.texcoordArray,A)}if(void 0!==g._FEATURE_ID_RGBA4444){const L=a.json.accessors[g._FEATURE_ID_RGBA4444];a.json.extensionsUsed&&a.json.extensionsUsed.includes("EXT_meshopt_compression")&&(m.featureData=l_(a,L))}void 0!==g._FEATURE_RGBA4444&&(m.featureData=new Uint32Array(l_(a,a.json.accessors[g._FEATURE_RGBA4444]).buffer));const R=d.material;return m.material=function(L,A){const{emissiveFactor:P=[0,0,0],alphaMode:z="OPAQUE",alphaCutoff:j=.5,normalTexture:$,occlusionTexture:K,emissiveTexture:J,doubleSided:Z}=L,{baseColorFactor:ne=[1,1,1,1],metallicFactor:oe=1,roughnessFactor:le=1,baseColorTexture:xe,metallicRoughnessTexture:ve}=L.pbrMetallicRoughness||{},ye=K?A[K.index]:void 0;if(K&&K.extensions&&K.extensions.KHR_texture_transform&&ye){const Fe=K.extensions.KHR_texture_transform;ye.offsetScale=[Fe.offset[0],Fe.offset[1],Fe.scale[0],Fe.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new In(...ne),metallicFactor:oe,roughnessFactor:le,baseColorTexture:xe?A[xe.index]:void 0,metallicRoughnessTexture:ve?A[ve.index]:void 0},doubleSided:Z,emissiveFactor:P,alphaMode:z,alphaCutoff:j,normalTexture:$?A[$.index]:void 0,occlusionTexture:ye,emissionTexture:J?A[J.index]:void 0,defined:void 0===L.defined}}(void 0!==R?a.json.materials[R]:{defined:!1},l),m}function W1(d,a,l){const{matrix:p,rotation:g,translation:m,scale:b,mesh:T,extras:k,children:F}=d,S={};if(S.matrix=p||Ze.mat4.fromRotationTranslationScale([],g||[0,0,0,1],m||[0,0,0],b||[1,1,1]),void 0!==T){S.meshes=l[T];const R=S.anchor=[0,0];for(const L of S.meshes){const{min:A,max:P}=L.aabb;R[0]+=A[0]+P[0],R[1]+=A[1]+P[1]}R[0]=Math.floor(R[0]/S.meshes.length/2),R[1]=Math.floor(R[1]/S.meshes.length/2)}if(k&&(k.id&&(S.id=k.id),k.lights&&(S.lights=function(R){if(!R.length)return[];const L=function($){const K=atob($),J=new Uint8Array(K.length);for(let Z=0;Z1&&p[p.length-1].equals(p[0])&&p.pop();let g=0;for(let b=0;b0&&p.reverse();const m=jf(p.flatMap(b=>[b.x,b.y]),[]);return 0===m.length?null:{vertices:p,indices:m}}function Z1(d,a){const l=[],p=[];let g=0;const m=[];for(const b of d){g=l.length;const T=b.vertexArray.float32,k=b.indexArray.uint16;for(let F=0;F0&&([p[b+1],p[b+2]]=[p[b+2],p[b+1]])}return{vertices:l,indices:p}}function iS(d){const l=function(k,F){const S=[];for(const R of k.json.meshes){const L=[];for(const A of R.primitives)L.push(wk(A,k,F));S.push(L)}return S}(d,function(k,F){const S=[],R=WebGL2RenderingContext;if(k.json.textures)for(const L of k.json.textures){const A={magFilter:R.LINEAR,minFilter:R.NEAREST,wrapS:R.REPEAT,wrapT:R.REPEAT};void 0!==L.sampler&&Object.assign(A,k.json.samplers[L.sampler]),S.push({image:F[L.source],sampler:A,uploaded:!1})}return S}(d,d.images)),{scenes:p,scene:g,nodes:m}=d.json,b=p?p[g||0].nodes:m,T=[];for(const k of b)T.push(W1(m[k],d,l));return function(k,F,S){const R={},L=new Set;for(let A=0;A0){const A=Array.from(L.values()).sort((P,z)=>P-z);for(let P=A.length-1;P>=0;P--)k.splice(A[P],1)}}(T,b,d.json.nodes),T}function fv(d){d.heightmap=new Float32Array(4096),d.heightmap.fill(-1);const a=d.vertexArray.float32,l=d.aabb.min[0]-1,p=d.aabb.min[1]-1,g=64/(d.aabb.max[0]-l+2),m=64/(d.aabb.max[1]-p+2);for(let b=0;bd.heightmap[64*F+k]&&(d.heightmap[64*F+k]=T)}}function z2(d,a){const l={};l.indexArray=new Ir,l.indexArray.reserve(4*d.length),l.vertexArray=new Cl,l.vertexArray.reserve(10*d.length),l.colorArray=new Yt,l.vertexArray.reserve(10*d.length);let p=0;for(const b of d){const T=Math.min(10,Math.max(4,1.3*b.height))*a,k=[-b.normal[1],b.normal[0],0],F=Math.min(.29,.1*b.width/b.depth),S=b.width-2*b.depth*a*(F+.01),R=Ze.vec3.scaleAndAdd([],b.pos,k,S/2),L=Ze.vec3.scaleAndAdd([],b.pos,k,-S/2),A=[R[0],R[1],R[2]+b.height],P=[L[0],L[1],L[2]+b.height],z=Ze.vec3.scaleAndAdd([],b.normal,k,F);Ze.vec3.scale(z,z,T);const j=Ze.vec3.scaleAndAdd([],b.normal,k,-F);Ze.vec3.scale(j,j,T),Ze.vec3.add(z,R,z),Ze.vec3.add(j,L,j),R[2]+=.1,L[2]+=.1,l.vertexArray.emplaceBack(z[0],z[1],z[2]),l.vertexArray.emplaceBack(j[0],j[1],j[2]),l.vertexArray.emplaceBack(R[0],R[1],R[2]),l.vertexArray.emplaceBack(L[0],L[1],L[2]),l.vertexArray.emplaceBack(A[0],A[1],A[2]),l.vertexArray.emplaceBack(P[0],P[1],P[2]),l.vertexArray.emplaceBack(R[0],R[1],R[2]),l.vertexArray.emplaceBack(L[0],L[1],L[2]),l.vertexArray.emplaceBack(z[0],z[1],z[2]),l.vertexArray.emplaceBack(j[0],j[1],j[2]);const $=S/T/2;l.colorArray.emplaceBack(-$-F,-1,$,.8),l.colorArray.emplaceBack($+F,-1,$,.8),l.colorArray.emplaceBack(-$,0,$,1.3),l.colorArray.emplaceBack($,0,$,1.3),l.colorArray.emplaceBack($+F,-.8,$,.7),l.colorArray.emplaceBack($+F,-.8,$,.7),l.colorArray.emplaceBack(0,0,$,1.3),l.colorArray.emplaceBack(0,0,$,1.3),l.colorArray.emplaceBack($+F,-1.2,$,.8),l.colorArray.emplaceBack($+F,-1.2,$,.8),l.indexArray.emplaceBack(6+p,4+p,8+p),l.indexArray.emplaceBack(7+p,9+p,5+p),l.indexArray.emplaceBack(0+p,1+p,2+p),l.indexArray.emplaceBack(1+p,3+p,2+p),p+=10}const g={defined:!0,emissiveFactor:[0,0,0]},m={};return m.baseColorFactor=In.white,g.pbrMetallicRoughness=m,l.material=g,l.aabb=new $n([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),l}class B2{constructor(a){this._stringToNumber={},this._numberToString=[];for(let l=0;l=0&&L[3]>=0&&F.insert(k,L[0],L[1],L[2],L[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Mm.VectorTile(new Pm(this.rawTileData)).layers,this.sourceLayerCoder=new B2(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const a in this.vtLayers)this.vtFeatures[a]=[]}return this.vtLayers}query(a,l){const{tilespaceGeometry:p,transform:g,tileTransform:m,pixelPosMatrix:b,availableImages:T}=l;this.loadVTLayers(),this.serializedLayersCache.clear();const k=p.bufferedTilespaceBounds,F=this.grid.query(k.min.x,k.min.y,k.max.x,k.max.y,(A,P,z,j)=>Ve(p.bufferedTilespaceGeometry,A,P,z,j));F.sort(rS);let S=null;g.elevation&&F.length>0&&(S=Kg.create(g.elevation,this.tileID));const R={};let L;for(let A=0;A(j||(j=H($,this.tileID.canonical,m)),K.queryIntersectsFeature(p,$,J,j,this.z,g,b,S,Z)))}return R}loadMatchingFeature(a,l,p,g,m){const{featureIndex:b,bucketIndex:T,sourceLayerIndex:k,layoutVertexArrayOffset:F}=l,S=this.bucketLayerIDs[T],R=p.layers,L=Object.keys(R);if(L.length&&!function($,K){for(let J=0;J<$.length;J++)if(K.indexOf($[J])>=0)return!0;return!1}(L,S))return;const A=p.sourceCache,P=this.sourceLayerCoder.decode(k),z=this.vtLayers[P].feature(b),j=this.getId(z,P);for(let $=0;$`${T.key}: ${T.message}`).join(", ")}`);this.promoteIdExpression=m.value}this.promoteIdExpression._evaluator||(this.promoteIdExpression._evaluator=new bd),p=this.promoteIdExpression.evaluate({zoom:0},a)}else p=a.properties[g];"boolean"==typeof p&&(p=Number(p))}return p}}function d_(d,a,l,p,g){return zs(d,(m,b)=>{const T=a instanceof tr?a.get(b):null;return T&&T.evaluate?T.evaluate(l,p,g):T})}function rS(d,a){return a-d}En(oS,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});const V2=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class aS{static from(a){if(!(a instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[l,p]=new Uint8Array(a,0,2);if(219!==l)throw new Error("Data does not appear to be in a KDBush format.");const g=p>>4;if(1!==g)throw new Error(`Got v${g} data when expected v1.`);const m=V2[15&p];if(!m)throw new Error("Unrecognized array type.");const[b]=new Uint16Array(a,2,1),[T]=new Uint32Array(a,4,1);return new aS(T,b,m,a)}constructor(a,l=64,p=Float64Array,g){if(isNaN(a)||a<0)throw new Error(`Unpexpected numItems value: ${a}.`);this.numItems=+a,this.nodeSize=Math.min(Math.max(+l,2),65535),this.ArrayType=p,this.IndexArrayType=a<65536?Uint16Array:Uint32Array;const m=V2.indexOf(this.ArrayType),b=2*a*this.ArrayType.BYTES_PER_ELEMENT,T=a*this.IndexArrayType.BYTES_PER_ELEMENT,k=(8-T%8)%8;if(m<0)throw new Error(`Unexpected typed array class: ${p}.`);g&&g instanceof ArrayBuffer?(this.data=g,this.ids=new this.IndexArrayType(this.data,8,a),this.coords=new this.ArrayType(this.data,8+T+k,2*a),this._pos=2*a,this._finished=!0):(this.data=new ArrayBuffer(8+b+T+k),this.ids=new this.IndexArrayType(this.data,8,a),this.coords=new this.ArrayType(this.data,8+T+k,2*a),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+m]),new Uint16Array(this.data,2,1)[0]=l,new Uint32Array(this.data,4,1)[0]=a)}add(a,l){const p=this._pos>>1;return this.ids[p]=p,this.coords[this._pos++]=a,this.coords[this._pos++]=l,p}finish(){const a=this._pos>>1;if(a!==this.numItems)throw new Error(`Added ${a} items when expected ${this.numItems}.`);return Y1(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(a,l,p,g){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:m,coords:b,nodeSize:T}=this,k=[0,m.length-1,0],F=[];for(;k.length;){const S=k.pop()||0,R=k.pop()||0,L=k.pop()||0;if(R-L<=T){for(let j=L;j<=R;j++){const $=b[2*j],K=b[2*j+1];$>=a&&$<=p&&K>=l&&K<=g&&F.push(m[j])}continue}const A=L+R>>1,P=b[2*A],z=b[2*A+1];P>=a&&P<=p&&z>=l&&z<=g&&F.push(m[A]),(0===S?a<=P:l<=z)&&(k.push(L),k.push(A-1),k.push(1-S)),(0===S?p>=P:g>=z)&&(k.push(A+1),k.push(R),k.push(1-S))}return F}within(a,l,p){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:g,coords:m,nodeSize:b}=this,T=[0,g.length-1,0],k=[],F=p*p;for(;T.length;){const S=T.pop()||0,R=T.pop()||0,L=T.pop()||0;if(R-L<=b){for(let j=L;j<=R;j++)U2(m[2*j],m[2*j+1],a,l)<=F&&k.push(g[j]);continue}const A=L+R>>1,P=m[2*A],z=m[2*A+1];U2(P,z,a,l)<=F&&k.push(g[A]),(0===S?a-p<=P:l-p<=z)&&(T.push(L),T.push(A-1),T.push(1-S)),(0===S?a+p>=P:l+p>=z)&&(T.push(A+1),T.push(R),T.push(1-S))}return k}}function Y1(d,a,l,p,g,m){if(g-p<=l)return;const b=p+g>>1;sS(d,a,b,p,g,m),Y1(d,a,l,p,b-1,1-m),Y1(d,a,l,b+1,g,1-m)}function sS(d,a,l,p,g,m){for(;g>p;){if(g-p>600){const F=g-p+1,S=l-p+1,R=Math.log(F),L=.5*Math.exp(2*R/3),A=.5*Math.sqrt(R*L*(F-L)/F)*(S-F/2<0?-1:1);sS(d,a,l,Math.max(p,Math.floor(l-S*L/F+A)),Math.min(g,Math.floor(l+(F-S)*L/F+A)),m)}const b=a[2*l+m];let T=p,k=g;for(gv(d,a,p,l),a[2*g+m]>b&&gv(d,a,p,g);Tb;)k--}a[2*p+m]===b?gv(d,a,p,k):(k++,gv(d,a,k,g)),k<=l&&(p=k+1),l<=k&&(g=k-1)}}function gv(d,a,l,p){lS(d,l,p),lS(a,2*l,2*p),lS(a,2*l+1,2*p+1)}function lS(d,a,l){const p=d[a];d[a]=d[l],d[l]=p}function U2(d,a,l,p){const g=d-l,m=a-p;return g*g+m*m}h.$=Ou,h.A=Za,h.B=2,h.C=jy,h.D=Fp,h.E=ze,h.F=VD,h.G=class extends Lp{},h.H=fl,h.I=Np,h.J=ic,h.K=xl,h.L=ru,h.M=iu,h.N=ou,h.O=xh,h.P=Xt,h.Q=sg,h.R=Hi,h.S=fp,h.T=b1,h.U=bl,h.V=Lp,h.W=gh,h.X=Mu,h.Y=op,h.Z=Ts,h._=yn,h.a=function(d){return zr.API_CDN_URL_REGEX.test(d)},h.a$=c_,h.a0=vd,h.a1=ra,h.a2=function(d){const a=d.value;let l=[];if(!a)return l;const p=fl(a);return"string"!==p?(l=l.concat([new Lp(d.key,a,`string expected, "${p}" found`)]),l):(IC(a,!0)||(l=l.concat([new Lp(d.key,a,`invalid url "${a}"`)])),l)},h.a3=lt,h.a4=Af,h.a5=fr,h.a6=nn,h.a7=class{constructor(d){this.specification=d}possiblyEvaluate(d,a){return Vs(d.expression.evaluate(a))}interpolate(d,a,l){return{x:Un(d.x,a.x,l),y:Un(d.y,a.y,l),z:Un(d.z,a.z,l),azimuthal:Un(d.azimuthal,a.azimuthal,l),polar:Un(d.polar,a.polar,l)}}},h.a8=ar,h.a9=wh,h.aA=Rd,h.aB=class{constructor(d){this.entries={},this.scheduler=d}request(d,a,l,p){const g=this.entries[d]=this.entries[d]||{callbacks:[]};if(g.result){const[m,b]=g.result;return this.scheduler?this.scheduler.add(()=>{p(m,b)},a):p(m,b),()=>{}}return g.callbacks.push(p),g.cancel||(g.cancel=l((m,b)=>{g.result=[m,b];for(const T of g.callbacks)this.scheduler?this.scheduler.add(()=>{T(m,b)},a):T(m,b);setTimeout(()=>delete this.entries[d],3e3)})),()=>{g.result||(g.callbacks=g.callbacks.filter(m=>m!==p),g.callbacks.length||(g.cancel(),delete this.entries[d]))}}},h.aC=yc,h.aD=function(d,a,l){const p=JSON.stringify(d.request);return d.data&&(this.deduped.entries[p]={result:[null,d.data]}),this.deduped.request(p,{type:"parseTile",isSymbolTile:d.isSymbolTile,zoom:d.tileZoom},g=>{const m=Tr(d.request,(b,T,k,F)=>{b?g(b):T&&g(null,{vectorTile:l?void 0:new Mm.VectorTile(new Pm(T)),rawData:T,cacheControl:k,expires:F})});return()=>{m.cancel(),g()}},a)},h.aE=function(d){Zn++,Zn>it&&(d.getActor().send("enforceCacheSizeLimit",We),Zn=0)},h.aF=function(d){return d<=1?1:Math.pow(2,Math.floor(Math.log(d)/Math.LN2))},h.aG=Kt,h.aH=HA,h.aI=n2,h.aJ=wC,h.aK=function(d,a){const l=document.createElement("video");l.muted=!0,l.onloadstart=function(){a(null,l)};for(let p=0;p{}}},h.aL=y1,h.aM=function(d){return fetch(d).then(a=>a.arrayBuffer()).then(a=>xk(a,0,d))},h.aN=iS,h.aO=class{constructor(d,a,l,p){this.id=d,this.position=null!=a?new Co(a[0],a[1]):new Co(0,0),this.orientation=l??[0,0,0],this.nodes=p,this.uploaded=!1,this.aabb=new $n([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(d,a){if(Ze.mat4.multiply(d.matrix,a,d.matrix),d.meshes)for(const l of d.meshes){const p=$n.applyTransformFast(l.aabb,d.matrix);this.aabb.encapsulate(p)}if(d.children)for(const l of d.children)this._applyTransformations(l,d.matrix)}computeBoundsAndApplyParent(){const d=Ze.mat4.identity([]);for(const a of this.nodes)this._applyTransformations(a,d)}computeModelMatrix(d,a,l,p,g,m,b=!1){ZA(this.matrix,this,d.transform,this.position,a,l,p,g,m,b)}upload(d){if(!this.uploaded){for(const a of this.nodes)u2(a,d);for(const a of this.nodes)D1(a);this.uploaded=!0}}destroy(){for(const d of this.nodes)I1(d)}},h.aP=Hl,h.aQ=Gy,h.aR=Xl,h.aS=ps,h.aT=Fu,h.aU=Ir,h.aV=ai,h.aW=ly,h.aX=m1,h.aY=function(){go.isLoading()||go.isLoaded()||"deferred"!==og()||pm()},h.aZ=Th,h.a_=G,h.aa=c,h.ab=Ze,h.ac=_n,h.ad=tr,h.ae=fs,h.af=Un,h.ag=pn,h.ah=Cs,h.ai=Li,h.aj=In,h.ak=class{constructor(d){this.specification=d}possiblyEvaluate(d,a){return function([l,p]){const g=Vs([1,l,p]);return{x:g.x,y:g.y,z:g.z}}(d.expression.evaluate(a))}interpolate(d,a,l){return{x:Un(d.x,a.x,l),y:Un(d.y,a.y,l),z:Un(d.z,a.z,l)}}},h.al=function(d,a,l=0,p=!0){const g=new Xt(l,l),m=d.sub(g),b=a.add(g),T=[m,new Xt(b.x,m.y),b,new Xt(m.x,b.y)];return p&&T.push(m.clone()),T},h.am=function(d,a){const l=[];for(let p=0;p0&&(p+=(d[g]-0)*(d[g]-0)),a[g]<0&&(p+=(0-a[g])*(0-a[g]));return p},h.bX=Xr,h.bY=6,h.bZ=function(d){const a=Ze.mat4.identity(new Float64Array(16));Ze.mat4.multiply(a,d.pixelMatrix,d.globeMatrix);const l=[0,Tl,0],p=[0,jc,0];return Ze.vec3.transformMat4(l,l,a),Ze.vec3.transformMat4(p,p,a),[l[0]>0&&l[0]<=d.width&&l[1]>0&&l[1]<=d.height&&!xc(d,new Co(d.center.lat,90)),p[0]>0&&p[0]<=d.width&&p[1]>0&&p[1]<=d.height&&!xc(d,new Co(d.center.lat,-90))]},h.b_=function(d,a){const{scale:l}=d.tileTransform,p=l*pn/(d.tileSize*Math.pow(2,a.zoom-d.tileID.overscaledZ+d.tileID.canonical.z));return Ze.mat2.scale(new Float32Array(4),a.inverseAdjustmentMatrix,[p,p])},h.ba=function(d,a){const l=fs(a.zoom);if(0===l)return aa(d);const p=Mr(d),g=bo(p),m=Gc(p.getWest())*a.worldSize,b=Gc(p.getEast())*a.worldSize,T=Rd(p.getNorth())*a.worldSize,k=Rd(p.getSouth())*a.worldSize,F=[m,T,0],S=[b,T,0],R=[m,k,0],L=[b,k,0],A=Ze.mat4.invert([],a.globeMatrix);return Ze.vec3.transformMat4(F,F,A),Ze.vec3.transformMat4(S,S,A),Ze.vec3.transformMat4(R,R,A),Ze.vec3.transformMat4(L,L,A),g[0]=Ta(g[0],R,l),g[1]=Ta(g[1],L,l),g[2]=Ta(g[2],S,l),g[3]=Ta(g[3],F,l),$n.fromPoints(g)},h.bb=ms,h.bc=Xo,h.bd=Ta,h.be=_m,h.bf=Wn,h.bg=XC,h.bh=Pm,h.bi=Tr,h.bj=function(d){const a=[];for(const l in d)a.push(d[l]);return a},h.bk=function(d,a){const l=[];for(const p in d)p in a||l.push(p);return l},h.bl=vo,h.bm=["type","source","source-layer","minzoom","maxzoom","filter","layout"],h.bn=fa,h.bo=function(d,a){const{x:l,y:p}=d.point,g=lc(l,p,d.worldSize/d._pixelsPerMercatorPixel,0,0);return Ze.mat4.multiply(g,g,Ko(aa(a)))},h.bp=Om,h.bq=Yc,h.br=Fy,h.bs=function(d,a,l,p,g){const m=5*a+2;d.float32[m+0]=l,d.float32[m+1]=p,d.float32[m+2]=g},h.bt=p1,h.bu=nC,h.bv=ie,h.bw=24,h.bx=X0,h.by=DC,h.bz=Q0,h.c=ch,h.c$=(d,a,l,p,g,m,b,T)=>{const k=d.transform,F=k.pitch<15?wA(.07,.7,ht((14-k.zoom)/5,0,1)):.07,S="none"===l.paint.get("line-trim-color-use-theme").constantOr("default");return{u_matrix:o1(d,a,l,p),u_texsize:a.imageAtlasTexture?a.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:k.calculatePixelsToTileUnitsMatrix(a),u_device_pixel_ratio:g,u_width_scale:m,u_floor_width_scale:b,u_image:0,u_tile_units_to_pixels:Oy(a,k),u_units_to_pixels:[1/k.pixelsToGLUnits[0],1/k.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:T,u_trim_fade_range:l.paint.get("line-trim-fade-range"),u_trim_color:l.paint.get("line-trim-color").toRenderColor(S?null:l.lut).toArray01(),u_emissive_strength:l.paint.get("line-emissive-strength"),u_zbias_factor:F,u_tile_to_meter:s(a.tileID.canonical,0)}},h.c0=o2,h.c1=function(d){const a=o2(d,!0);return Ze.mat2.invert([],[a[0],a[1],a[4],a[5]])},h.c2=uo,h.c3=function(d){const{x:a,y:l}=d.point,{lng:p,lat:g}=d._center;return lc(a,l,d.worldSize,p,g)},h.c4=Nr,h.c5=en,h.c6=5,h.c7=function(d){const a=Math.round((d+45+360)%360/90)%4;return Ue[a]},h.c8=45,h.c9=Mp,h.cA=class extends Id{constructor(d){super(d),this.current=yg}set(d,a,l){if(this.fetchUniformLocation(d,a))for(let p=0;p<9;p++)if(l[p]!==this.current[p]){this.current=l,this.gl.uniformMatrix3fv(this.location,!1,l);break}}},h.cB=ue,h.cC=function(d,a,l){const p=fs(l.zoom),g=d.style.map._antialias,m=d.terrain&&d.terrain.exaggeration()>0;return 0===p&&!g&&!m},h.cD=function(d){const a=d.pixelsPerMeter,l=a/sl(1,d.center.lat),p=Ze.mat4.identity(new Float64Array(16));return Ze.mat4.translate(p,p,[d.point.x,d.point.y,0]),Ze.mat4.scale(p,p,[l,l,a]),Float32Array.from(p)},h.cE=Mr,h.cF=function(d){const a=Xr-5;d=ht(d,-a,a)/a*90;const l=Math.pow(Math.abs(Math.sin(Li(d))),3);return Math.round(l*(Sm.length-1))},h.cG=function(d,a,l,p){const g=a.getNorth(),m=a.getSouth(),b=a.getWest(),T=a.getEast(),k=1<0){const P=180/p;Ze.mat3.multiply(A,A,[P/F+1,0,0,0,P/S+1,0,-.5*P/R,.5*P/L,1])}return A[2]=k,A[5]=d.x,A[8]=d.y,A},h.cH=aa,h.cI=function(d,a,l){const p=Ze.mat4.identity(new Float64Array(16)),g=(a/(1<1)return!1;const l=a.getSource().maxzoom,p=1<1)return a;const g=p.getSource().maxzoom,m=1<{const m=this.getAtTileOffset(d,g.x,g.y),b=p.upVector(d.canonical,g.x,g.y),T=p.upVectorScale(d.canonical,a,l).metersToTile;return Ze.vec3.scale(b,b,m*T),b}}getForTilePoints(d,a,l,p){if(this.isUsingMockSource())return!1;const g=Kg.create(this,d,p);return!!g&&(a.forEach(m=>{m[2]=this.exaggeration()*g.getElevationAt(m[0],m[1],l)}),!0)}getMinMaxForTile(d){if(this.isUsingMockSource())return null;const a=this.findDEMTileFor(d);if(!a||!a.dem)return null;const l=a.dem.tree,p=a.tileID,g=1<({u_camera_to_center_distance:new Er(d),u_extrude_scale:new uy(d),u_device_pixel_ratio:new Er(d),u_matrix:new Cp(d),u_inv_rot_matrix:new Cp(d),u_merc_center:new Qa(d),u_tile_id:new wm(d),u_zoom_transition:new Er(d),u_up_dir:new wm(d),u_emissive_strength:new Er(d)}),h.cT=d=>({u_matrix:new Cp(d),u_pixels_to_tile_units:new uy(d),u_device_pixel_ratio:new Er(d),u_width_scale:new Er(d),u_floor_width_scale:new Er(d),u_units_to_pixels:new Qa(d),u_dash_image:new xm(d),u_gradient_image:new xm(d),u_image_height:new Er(d),u_texsize:new Qa(d),u_tile_units_to_pixels:new Er(d),u_alpha_discard_threshold:new Er(d),u_trim_offset:new Qa(d),u_trim_fade_range:new Qa(d),u_trim_color:new wp(d),u_emissive_strength:new Er(d),u_zbias_factor:new Er(d),u_tile_to_meter:new Er(d)}),h.cU=d=>({u_matrix:new Cp(d),u_texsize:new Qa(d),u_pixels_to_tile_units:new uy(d),u_device_pixel_ratio:new Er(d),u_width_scale:new Er(d),u_floor_width_scale:new Er(d),u_image:new xm(d),u_units_to_pixels:new Qa(d),u_tile_units_to_pixels:new Er(d),u_alpha_discard_threshold:new Er(d),u_trim_offset:new Qa(d),u_trim_fade_range:new Qa(d),u_trim_color:new wp(d),u_emissive_strength:new Er(d),u_zbias_factor:new Er(d),u_tile_to_meter:new Er(d)}),h.cV=pg,h.cW=TA,h.cX=DA,h.cY=Ap,h.cZ=(d,a,l,p,g,m)=>{const b=d.transform,T="globe"===b.projection.name;let k;if("map"===m.paint.get("circle-pitch-alignment"))if(T){const S=qc(b.zoom,a.canonical)*b._pixelsPerMercatorPixel;k=Float32Array.from([S,0,0,S])}else k=b.calculatePixelsToTileUnitsMatrix(l);else k=new Float32Array([b.pixelsToGLUnits[0],0,0,b.pixelsToGLUnits[1]]);const F={u_camera_to_center_distance:d.transform.getCameraToCenterDistance(b.projection),u_matrix:d.translatePosMatrix(a.projMatrix,l,m.paint.get("circle-translate"),m.paint.get("circle-translate-anchor")),u_device_pixel_ratio:ke.devicePixelRatio,u_extrude_scale:k,u_inv_rot_matrix:hu,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:m.paint.get("circle-emissive-strength")};if(T){F.u_inv_rot_matrix=p,F.u_merc_center=g,F.u_tile_id=[a.canonical.x,a.canonical.y,1<0?Math.acos(l/p)*wa:0;let m=0!==d||0!==a?Math.atan2(-a,-d)*wa+90:0;return m<0&&(m+=360),[p,m,g]},h.cc=s,h.cd=$n,h.ce=Vs,h.cf=function(d){return[Math.pow(d[0],1/2.2),Math.pow(d[1],1/2.2),Math.pow(d[2],1/2.2)]},h.cg=function(d,a){return d.readFields(f2,{icons:[]},a)},h.ch=function(d){return d({pluginStatus:Zl,pluginURL:Ru}),Ef.on("pluginStateChange",d),d},h.ci=tv,h.cj=Hg,h.ck=iC,h.cl=qr,h.cm=O0,h.cn=qe,h.co=jl,h.cp=Bs,h.cq=function(d){const a=d.indexOf("\x1f");return a>=0?d.slice(0,a):d},h.cr=function(d){return d.indexOf("\x1f")>=0},h.cs=function(d){const a=d.indexOf("\x1f");return a>=0?d.slice(a+1):""},h.ct=function(d){const a=[],l=d.id;return void 0===l&&a.push({message:`layers.${l}: missing required property "id"`}),void 0===d.render&&a.push({message:`layers.${l}: missing required method "render"`}),d.renderingMode&&"2d"!==d.renderingMode&&"3d"!==d.renderingMode&&a.push({message:`layers.${l}: property "renderingMode" must be either "2d" or "3d"`}),a},h.cu=function(d,a,l,p){return"custom"===d.type?new jA(d,a):new KA[d.type](d,a,l,p)},h.cv=nc,h.cw=class extends c_{constructor(d,a){super(d._vectorTileFeature,d._z,d._x,d._y,d.id),d.state&&(this.state=Object.assign({},d.state)),this.target=a.target,this.namespace=a.namespace,a.properties&&(this.properties=a.properties),this.target&&("featuresetId"in this.target&&!this.target.importId||"layerId"in this.target)&&(this.source=d.source,this.sourceLayer=d.sourceLayer,this.layer=d.layer)}toJSON(){const d=super.toJSON();return d.target=this.target,d.namespace=this.namespace,d}},h.cx=Ef,h.cy=Zo,h.cz=Vf,h.d=function(d){return zr.API_TILEJSON_REGEX.test(d)},h.d$=oS,h.d0=(d,a,l,p,g,m,b,T,k)=>{const F=d.transform,S=F.calculatePixelsToTileUnitsMatrix(a),R="none"===l.paint.get("line-trim-color-use-theme").constantOr("default"),L=F.pitch<15?wA(.07,.7,ht((14-F.zoom)/5,0,1)):.07;return{u_matrix:o1(d,a,l,p),u_pixels_to_tile_units:S,u_device_pixel_ratio:m,u_width_scale:b,u_floor_width_scale:T,u_units_to_pixels:[1/F.pixelsToGLUnits[0],1/F.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:g,u_texsize:Yf(l)&&a.lineAtlasTexture?a.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Oy(a,d.transform),u_alpha_discard_threshold:0,u_trim_offset:k,u_trim_fade_range:l.paint.get("line-trim-fade-range"),u_trim_color:l.paint.get("line-trim-color").toRenderColor(R?null:l.lut).toArray01(),u_emissive_strength:l.paint.get("line-emissive-strength"),u_zbias_factor:L,u_tile_to_meter:s(a.tileID.canonical,0)}},h.d1=dr,h.d2=_y,h.d3=TD,h.d4=Sn,h.d5=qf,h.d6=km,h.d7=450,h.d8=7,h.d9=pF,h.dA=et,h.dB=f,h.dC=Mh,h.dD=function([d,a,l]){const p=Math.hypot(d,a,l),g=Math.atan2(d,l),m=.5*Math.PI-Math.acos(-a/p);return new Co(Nr(g),Nr(m))},h.dE=a2,h.dF=function(d){const a=d.navigator?d.navigator.userAgent:null;return!!function(l){if(null==sh){const p=l.navigator?l.navigator.userAgent:null;sh=!!l.safari||!(!p||!(/\b(iPad|iPhone|iPod)\b/.test(p)||p.match("Safari")&&!p.match("Chrome")))}return sh}(d)&&a&&(a.match("Version/15.4")||a.match("Version/15.5")||a.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},h.dG=function(d,a){We=d,it=a},h.dH=xc,h.dI=Pn,h.dJ=function(d){const a=[0,0,0],l=Ze.mat4.identity(new Float64Array(16));return Ze.mat4.multiply(l,d.pixelMatrix,d.globeMatrix),Ze.vec3.transformMat4(a,a,l),new Xt(a[0],a[1])},h.dK=function(d,a,l=!1){if(Zl===ig||Zl===ey||Zl===R0)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ru=ke.resolveURL(d),Zl=ig,ty=a,P0(),l||pm()},h.dL=og,h.dM=function(){tv().acquire(M1)},h.dN=function(){const d=$u;d&&(d.isPreloaded()&&1===d.numActive()?(d.release(M1),$u=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},h.dO=Qg,h.dP=function(d){const a=on();if(!a)return;const l=a.delete(Ee);d&&l.catch(d).then(()=>d())},h.dQ=i_,h.dR=ob,h.dS=function(d){jm=ke.resolveURL(d),s_||(s_=new Fp(tv(),new ze)),s_.broadcast("setDracoUrl",jm)},h.dT=mk,h.dU=function(d){Bh=ke.resolveURL(d),s_||(s_=new Fp(tv(),new ze)),s_.broadcast("setMeshoptUrl",Bh)},h.dV=En,h.dW=Im,h.dX=2,h.dY=Mm,h.dZ=class{constructor(d,a){this.pos=d,this.dir=a}intersectsPlane(d,a,l){const p=Ze.vec2.dot(a,this.dir);if(Math.abs(p)<1e-6)return!1;const g=((d[0]-this.pos[0])*a[0]+(d[1]-this.pos[1])*a[1])/p;return l[0]=this.pos[0]+this.dir[0]*g,l[1]=this.pos[1]+this.dir[1]*g,!0}},h.d_=B2,h.da=wo,h.db=Dd,h.dc=256,h.dd=Ko,h.de=Cl,h.df=yp,h.dg=ay,h.dh=function(d,a,l,p,g){return ht((d-a)/(l-a)*(g-p)+p,p,g)},h.di=Is,h.dj=uu,h.dk=class{constructor(d,a,l,p){this.context=d,this.format=p,this.size=l,this.texture=d.gl.createTexture();const[g,m,b]=this.size,{gl:T}=d;T.bindTexture(T.TEXTURE_3D,this.texture),d.pixelStoreUnpackFlipY.set(!1),d.pixelStoreUnpack.set(1),d.pixelStoreUnpackPremultiplyAlpha.set(!1),T.texImage3D(T.TEXTURE_3D,0,this.format,g,m,b,0,xC(this.format),Jf(this.format),a.data)}bind(d,a){const{context:l}=this,{gl:p}=l;p.bindTexture(p.TEXTURE_3D,this.texture),d!==this.minFilter&&(p.texParameteri(p.TEXTURE_3D,p.TEXTURE_MAG_FILTER,d),p.texParameteri(p.TEXTURE_3D,p.TEXTURE_MIN_FILTER,d),this.minFilter=d),a!==this.wrapS&&(p.texParameteri(p.TEXTURE_3D,p.TEXTURE_WRAP_S,a),p.texParameteri(p.TEXTURE_3D,p.TEXTURE_WRAP_T,a),this.wrapS=a)}destroy(){const{gl:d}=this.context;d.deleteTexture(this.texture),this.texture=null}},h.dl=s2,h.dm=[1,1,1],h.dn=Kg,h.dp=Qy,h.dq=fe,h.dr=Nu,h.ds=Ep,h.dt=Nf,h.du=Sd,h.dv=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Xt(1/0,1/0),max:new Xt(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(d,a=!1){const l=$f(new Xt(0,0),new Xt(pn,pn),d),p=[];if(a&&!K0(l,this._globalClipBounds))return p;for(const g of this._activeRegions){if(g.hiddenByOverlap||!K0(l,g))continue;const m=xD(g.min,g.max,d);p.push({min:m.min,max:m.max,sourceId:this._sourceIds[g.priority],footprint:g.footprint,footprintTileId:g.tileId,order:g.order,clipMask:g.clipMask,clipScope:g.clipScope})}return p}setSources(d){this._setSources(d.map(a=>({getSourceId:()=>a.cache.id,getFootprints:()=>{const l=[];for(const p of a.cache.getVisibleCoordinates()){const g=a.cache.getTile(p).buckets[a.layer];g&&g.updateFootprints(p.toUnwrapped(),l)}return l},getOrder:()=>a.order,getClipMask:()=>a.clipMask,getClipScope:()=>a.clipScope})))}_addSource(d){const a=d.getFootprints();if(0===a.length)return;const l=d.getOrder(),p=d.getClipMask(),g=d.getClipScope();for(const m of a){if(!m.footprint)continue;const b=$f(m.footprint.min,m.footprint.max,m.id);this._activeRegions.push({min:b.min,max:b.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:m.id,footprint:m.footprint,order:l,clipMask:p,clipScope:g})}this._sourceIds.push(d.getSourceId())}_computeReplacement(){this._activeRegions.sort((a,l)=>a.priority-l.priority||Ig(a.min,l.min)||Ig(a.max,l.max)||a.order-l.order||a.clipMask-l.clipMask||function(p,g){const m=(b,T)=>b+T;return p.length-g.length||p.reduce(m,"").localeCompare(g.reduce(m,""))}(a.clipScope,l.clipScope));let d=this._activeRegions.length!==this._prevRegions.length;if(!d){let a=0;for(;!d&&a!==this._activeRegions.length;){const l=this._activeRegions[a],p=this._prevRegions[a];d=l.priority!==p.priority||!Ty(l,p)||l.order!==p.order||l.clipMask!==p.clipMask||!fa(l.clipScope,p.clipScope),++a}}if(d){++this._updateTime;for(const l of this._activeRegions)l.order!==Am&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,l.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,l.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,l.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,l.max.y));const a=l=>{const p=this._activeRegions;if(l>=p.length)return l;const g=p[l].priority;for(;l1){let l=0,p=a(l);for(;l!==p;){let g=l;const m=l;for(;g!==p;){const b=this._activeRegions[g];b.hiddenByOverlap=!1;for(let T=0;T=0;a--)this._addSource(d[a]);this._computeReplacement()}},h.dw=class{constructor(d){this._createGrid(d),this._createPoles(d)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const d of this._poleSegments)d.destroy();for(const d of this._gridSegments)d.withSkirts.destroy(),d.withoutSkirts.destroy()}_fillGridMeshWithLods(d,a){const l=new Cd,p=new Ir,g=[],m=d+1+2,b=a[0]+1,T=a[0]+1+(1+a.length),k=(F,S,R)=>{let L=F===m-1?F-2:0===F?F:F-1;return L+=R?24575:0,[L,S]};for(let F=0;F24*bn)}let gn=Z?"center":A.get("text-justify").evaluate(le,{},T);const dn="point"===A.get("symbol-placement"),Qt=dn?24*A.get("text-max-width").evaluate(le,{},T):1/0,Wt=Vn=>{d.allowVerticalPlacement&&hm(Je)&&(Fe.vertical=Kf(Se,a,l,g,xe,Qt,Qe,jt,Vn,It,Ge,Yc.vertical,!0,ye,ve))};if(!Z&&Et){const Vn="auto"===gn?Et.map(An=>Gg(An)):[gn];let bn=!1;for(let An=0;An=0||!hm(Je)){const Vn=Kf(Se,a,l,g,xe,Qt,Qe,jt,gn,It,Ge,Yc.horizontal,!1,ye,ve);Vn&&(Fe.horizontal[gn]=Vn)}Wt(dn?"left":gn)}}let He=!1;if(le.icon&&le.icon.namePrimary){const Je=s1(d.iconSizeData,P["icon-size"],T,d.zoom,le)*z.iconScaleFactor*R,rt=le.icon.getPrimary().scaleSelf(Je).serialize(),Qe=p[rt];Qe&&(Ne=Qw(g[rt],le.icon.nameSecondary?g[le.icon.getSecondary().scaleSelf(Je).serialize()]:void 0,A.get("icon-offset").evaluate(le,{},T),A.get("icon-anchor").evaluate(le,{},T)),He=Qe.sdf,void 0===d.sdfIcons?d.sdfIcons=Qe.sdf:d.sdfIcons!==Qe.sdf&&ki("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Qe.pixelRatio!==d.pixelRatio||0!==A.get("icon-rotate").constantOr(1))&&(d.iconsNeedLinear=!0))}const Xe=Nm(Fe.horizontal)||Fe.vertical;d.iconsInText||(d.iconsInText=!!Xe&&Xe.iconsInText),(Xe||Ne)&&sC(d,le,Fe,Ne,p,z,ye,0,Ge,He,b,T,F,L,oe)}m&&d.generateCollisionDebugBuffers(k,d.collisionBoxArray,z.textScaleFactor)},h.e5=Hm,h.e6=Wo,h.e7=wy,h.e8=zy,h.e9=_t,h.ea=function(d){let a=0;if(new Uint32Array(d,0,1)[0]!==_k){const l=new Uint32Array(d,0,7),[,,p,g,m,b]=l;a=l.byteLength+g+m+b+m,(p!==d.byteLength||a>=d.byteLength)&&ki("Invalid b3dm header information.")}return xk(d,a)},h.eb=function(d,a){const l=iS(d);for(const p of l){for(const g of p.meshes)fv(g);p.lights&&(p.lightMeshIndex=p.meshes.length,p.meshes.push(z2(p.lights,a)))}return l},h.ec=E1,h.ed=Ao,h.ee=go,h.ef=function(d){kt(),ot?.then(a=>{a.keys().then(l=>{for(let p=0;p"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)).join(""))},h.k=function(d){return btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(a,l)=>String.fromCharCode(+("0x"+l))))},h.l=fo,h.m=ni,h.n=function(d,a){return Zo(fo(d,{type:"json"}),a)},h.o=Or,h.p=function(d,a){return Zo(fo(d,{method:"POST"}),a)},h.q=ke,h.r=Ms,h.s=function(d){try{const a=self[d];return a.setItem("_mapbox_test_",1),a.removeItem("_mapbox_test_"),!0}catch{return!1}},h.t=_e,h.u=function(){return function d(a){return a?(a^Math.random()*(16>>a/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,d)}()},h.v=function(d){return!!d&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(d)},h.w=ki,h.x=function(){return A1||(A1=new Qg),A1},h.y=eo,h.z=lo}),bt(0,function(h){function _t(ft){const re=ft?ft.url.toString():void 0;return re?performance.getEntriesByName(re):[]}function Ot(ft){if("number"==typeof ft||"boolean"==typeof ft||"string"==typeof ft||null==ft)return JSON.stringify(ft);if(Array.isArray(ft)){let se="[";for(const _e of ft)se+=`${Ot(_e)},`;return`${se}]`}let re="{";for(const se of Object.keys(ft).sort())re+=`${se}:${Ot(ft[se])},`;return`${re}}`}function Pt(ft){let re="";for(const se of h.bm)("model"!==ft.type||"minzoom"!==se&&"maxzoom"!==se)&&(re+=`/${Ot(ft[se])}`);return re}class Be{constructor(re){this.keyCache={},this._layers={},this._layerConfigs={},re&&this.replace(re)}replace(re,se){this._layerConfigs={},this._layers={},this.update(re,[],se)}update(re,se,_e){this._options=_e;for(const Oe of re)this._layerConfigs[Oe.id]=Oe,(this._layers[Oe.id]=h.cu(Oe,this.scope,null,this._options)).compileFilter(_e),this.keyCache[Oe.id]&&delete this.keyCache[Oe.id];for(const Oe of se)delete this.keyCache[Oe],delete this._layerConfigs[Oe],delete this._layers[Oe];this.familiesBySource={};const ke=function(Oe,qe){const Ee={};for(let it=0;itthis._layers[St.id]),Ee=qe[0];if("none"===Ee.visibility)continue;const We=Ee.source||"";let it=this.familiesBySource[We];it||(it=this.familiesBySource[We]={});const dt=Ee.sourceLayer||"_geojsonTileLayer";let ot=it[dt];ot||(ot=it[dt]=[]),ot.push(qe)}}}const kn=1*h.dX;class Yn{constructor(re){const se={},_e=[];for(const Ee in re){const We=re[Ee],it=se[Ee]={};for(const dt in We.glyphs){const ot=We.glyphs[+dt];if(!ot||0===ot.bitmap.width||0===ot.bitmap.height)continue;const St=ot.metrics.localGlyph?kn:1,on={x:0,y:0,w:ot.bitmap.width+2*St,h:ot.bitmap.height+2*St};_e.push(on),it[dt]=on}}const{w:ke,h:Oe}=h.F(_e),qe=new h.dW({width:ke||1,height:Oe||1});for(const Ee in re){const We=re[Ee];for(const it in We.glyphs){const dt=We.glyphs[+it];if(!dt||0===dt.bitmap.width||0===dt.bitmap.height)continue;const ot=se[Ee][it],St=dt.metrics.localGlyph?kn:1;h.dW.copy(dt.bitmap,qe,{x:0,y:0},{x:ot.x+St,y:ot.y+St},dt.bitmap)}}this.image=qe,this.positions=se}}h.dV(Yn,"GlyphAtlas");const Fn="3d_elevation_id",vn="hd_road_elevation";class un{constructor(){this._valid=!1}reset(re){return this.feature=re,this._valid=!0,this._geometry=re.loadGeometry(),0!==this._geometry.length&&0!==this._geometry[0].length||(this._valid=!1),this}geometry(re,se){return this._valid&&re(se(this._geometry)),this}require(re,se,_e){return this.get(re,!0,se,_e)}optional(re,se,_e){return this.get(re,!1,se,_e)}success(){return this._valid}get(re,se,_e,ke){const Oe=this.feature.properties.hasOwnProperty(re)?+this.feature.properties[re]:void 0;return this._valid&&void 0!==Oe?_e(ke?ke(Oe):Oe):se&&(this._valid=!1),this}}class ln{constructor(re,se){this.featureFunc=re,this.vertexFunc=se}parseFeature(re,se,_e){return this.featureFunc(re,se,_e)}parseVertex(re,se,_e){return this.vertexFunc(re,se,_e)}}const ui=new ln((ft,re,se)=>ft.reset(re).require(Fn,_e=>{se.id=_e}).optional("fixed_height_relative",_e=>{se.constantHeight=_e},Dn.decodeRelativeHeight).geometry(_e=>{se.bounds=_e},Dn.computeBounds).success(),(ft,re,se)=>ft.reset(re).require(Fn,_e=>{se.id=_e}).require("elevation_idx",_e=>{se.idx=_e}).require("extent",_e=>{se.extent=_e}).require("height_relative",_e=>{se.height=_e},Dn.decodeRelativeHeight).geometry(_e=>{se.position=_e},Dn.getPoint).success()),Gi=new ln((ft,re,se)=>ft.reset(re).require(Fn,_e=>{se.id=_e}).optional("fixed_height",_e=>{se.constantHeight=_e},Dn.decodeMetricHeight).geometry(_e=>{se.bounds=_e},Dn.computeBounds).success(),(ft,re,se)=>ft.reset(re).require(Fn,_e=>{se.id=_e}).require("elevation_idx",_e=>{se.idx=_e}).require("extent",_e=>{se.extent=_e}).require("height",_e=>{se.height=_e},Dn.decodeMetricHeight).geometry(_e=>{se.position=_e},Dn.getPoint).success());class Dn{static computeBounds(re){const se=new h.P(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),_e=new h.P(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(const ke of re[0])se.x>ke.x&&(se.x=ke.x),se.y>ke.y&&(se.y=ke.y),_e.xEe.a0?h.ab.vec2.dot(ct,ni)/ii:0,Ai=h.aw(Mi,0,1),Di=Math.abs((Mi-Ai)*this.edgeProps[qe].len),Wi=h.ab.vec2.subtract(h.ab.vec2.create(),Oe,dt),Hi=Di+Math.abs(h.ab.vec2.dot(Wi,h.ab.vec2.fromValues(We[1],-We[0])));Hi<_e&&(se=qe,_e=Hi,ke=Ai)}return[se,ke]}tessellate(re){for(let se=this.edges.length-1;se>=0;--se){const _e=this.edges[se].a,ke=this.edges[se].b,{position:Oe,height:qe,extent:Ee}=this.vertices[_e],{position:We,height:it,extent:dt}=this.vertices[ke],ot=this.vertexProps[_e].dir,St=this.vertexProps[ke].dir,on=h.ab.vec3.fromValues(Oe[0]/re,Oe[1]/re,qe),kt=h.ab.vec3.fromValues(We[0]/re,We[1]/re,it),Zn=h.ab.vec3.fromValues(ot[1],-ot[0],0);h.ab.vec3.scale(Zn,Zn,Ee);const ni=h.ab.vec3.fromValues(St[1],-St[0],0);if(h.ab.vec3.scale(ni,ni,dt),this.distSqLines(h.ab.vec3.fromValues(on[0]+.5*Zn[0],on[1]+.5*Zn[1],on[2]+.5*Zn[2]),h.ab.vec3.fromValues(kt[0]-.5*ni[0],kt[1]-.5*ni[1],kt[2]-.5*ni[2]),h.ab.vec3.fromValues(on[0]-.5*Zn[0],on[1]-.5*Zn[1],on[2]-.5*Zn[2]),h.ab.vec3.fromValues(kt[0]+.5*ni[0],kt[1]+.5*ni[1],kt[2]+.5*ni[2]))<=.05*.05)continue;const ct=this.vertices.length,ii=h.ab.vec2.add(h.ab.vec2.create(),Oe,We);this.vertices.push({position:h.ab.vec2.scale(ii,ii,.5),height:.5*(qe+it),extent:.5*(Ee+dt)});const Mi=h.ab.vec2.add(h.ab.vec2.create(),ot,St);this.vertexProps.push({dir:h.ab.vec2.normalize(Mi,Mi)}),this.edges.splice(se,1),this.edgeProps.splice(se,1),this.edges.push({a:_e,b:ct}),this.edges.push({a:ct,b:ke});const Ai=h.ab.vec2.subtract(h.ab.vec2.create(),this.vertices[ct].position,Oe),Di=h.ab.vec2.length(Ai),Wi={vec:Ai,dir:h.ab.vec2.scale(h.ab.vec2.create(),Ai,1/Di),len:Di};this.edgeProps.push(Wi),this.edgeProps.push(Wi)}}distSqLines(re,se,_e,ke){const Oe=h.ab.vec3.subtract(h.ab.vec3.create(),se,re),qe=h.ab.vec3.subtract(h.ab.vec3.create(),ke,_e),Ee=h.ab.vec3.subtract(h.ab.vec3.create(),re,_e),We=h.ab.vec3.dot(Oe,Oe),it=h.ab.vec3.dot(Oe,qe),dt=h.ab.vec3.dot(Oe,Ee),ot=h.ab.vec3.dot(qe,qe),St=h.ab.vec3.dot(qe,Ee),on=We*ot-it*it;if(0===on){const ii=h.ab.vec3.dot(Ee,qe)/h.ab.vec3.dot(qe,qe),Mi=h.ab.vec3.lerp(h.ab.vec3.create(),_e,ke,ii);return h.ab.vec3.squaredDistance(Mi,re)}const kt=(it*St-dt*ot)/on,Zn=(We*St-it*dt)/on,ni=h.ab.vec3.lerp(h.ab.vec3.create(),re,se,kt),ct=h.ab.vec3.lerp(h.ab.vec3.create(),_e,ke,Zn);return h.ab.vec3.squaredDistance(ni,ct)}}class oi{static parseFrom(re,se){const _e=Dn.parse(re);if(!_e)return[];let{vertices:ke,features:Oe}=_e;const qe=1/h.cc(se);Oe.sort((dt,ot)=>dt.id-ot.id),ke.sort((dt,ot)=>dt.id-ot.id||dt.idx-ot.idx),ke=ke.filter((dt,ot,St)=>ot===St.findIndex(on=>on.id===dt.id&&on.idx===dt.idx));const Ee=new Array;let We=0;const it=ke.length;for(const dt of Oe){if(dt.constantHeight){Ee.push(new yi(dt.id,dt.bounds,dt.constantHeight));continue}for(;We!==it&&ke[We].id=Tr.maxzoom||"none"!==Tr.visibility&&(Ji(Zo,this.zoom,dt.brightness,_e),(We[Tr.id]=Tr.createBucket({index:Ee.bucketLayerIDs.length,layers:Zo,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Hi,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(Go,dt,this.tileID.canonical,this.tileTransform),Ee.bucketLayerIDs.push(Zo.map(ss=>h.aC(ss.id,ss.scope)))))}}let St,on,kt,Zn;it.trim();const ni={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},ct=()=>{if(St)return this.status="done",Oe(St);if(this.extraShadowCaster)this.status="done",Oe(null,{buckets:h.bj(We).filter(ii=>!ii.isEmpty()),featureIndex:Ee,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:dt.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(on&&kt&&Zn){const ii=new Yn(on),Mi=new h.e3(kt,Zn,this.lut);for(const Ai in We){const Di=We[Ai];Di instanceof h.aX?(Ji(Di.layers,this.zoom,dt.brightness,_e),h.e4(Di,on,ii.positions,kt,Mi.iconPositions,this.showCollisionBoxes,_e,this.tileID.canonical,this.tileZoom,this.projection,this.scaleFactor,this.pixelRatio,this.brightness)):Di.hasPattern&&(Di instanceof h.b1||Di instanceof h.b2||Di instanceof h.d5)&&(Ji(Di.layers,this.zoom,dt.brightness,_e),Di.addFeatures(dt,this.tileID.canonical,Mi.patternPositions,_e,this.tileTransform,this.brightness))}this.status="done",Oe(null,{buckets:h.bj(We).filter(Ai=>!Ai.isEmpty()),featureIndex:Ee,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ii.image,lineAtlas:it,imageAtlas:Mi,brightness:dt.brightness})}};if(!this.extraShadowCaster){const ii=h.e1(dt.glyphDependencies,Di=>Object.keys(Di).map(Number));Object.keys(ii).length?ke.send("getGlyphs",{uid:this.uid,stacks:ii,scope:this.scope},(Di,Wi)=>{St||(St=Di,on=Wi,ct())},void 0,!1,ni):on={};const Mi=Object.keys(dt.iconDependencies);Mi.length?ke.send("getImages",{icons:Mi,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},(Di,Wi)=>{if(St)return;St=Di;const Hi={};Object.values(Wi).some(Go=>Go.usvg)?this.rasterize(ke,Hi,Wi,dt.iconDependencies,()=>{kt=Hi,ct()}):(this.fillImageMap(Hi,dt.iconDependencies,Wi),kt=Hi,ct())},void 0,!1,ni):kt={};const Ai=Object.keys(dt.patternDependencies);Ai.length?ke.send("getImages",{icons:Ai,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},(Di,Wi)=>{if(!St){St=Di;const Hi={};Object.values(Wi).some(Go=>Go.usvg)?this.rasterize(ke,Hi,Wi,dt.patternDependencies,()=>{Zn=Hi,ct()}):(this.fillImageMap(Hi,dt.patternDependencies,Wi),Zn=Hi,ct())}},void 0,!1,ni):Zn={}}ct()}fillImageMap(re,se,_e){for(const ke in _e){const Oe=se[ke]||[];for(const qe of Oe)_e[qe.id].usvg||(re[qe.serialize()]=_e[qe.id])}}getImageTaskQueue(re,se,_e){const ke={};for(const Oe in se){const qe=_e[Oe]||[];for(const Ee of qe){const We=Ee.serialize();se[Ee.id].usvg?ke[We]||(ke[We]=Ee):re[We]=se[Ee.id]}}return ke}rasterize(re,se,_e,ke,Oe){const qe=this.getImageTaskQueue(se,_e,ke);this.rasterizeTask=re.send("rasterizeImages",{scope:this.scope,imageTasks:qe},(Ee,We)=>{if(!Ee)for(const it in We){const{id:dt}=h.e2.deserializeFromString(it);se[it]=Object.assign({},_e[dt],{data:We[it]})}Oe()})}cancelRasterize(){this.rasterizeTask&&this.rasterizeTask.cancel()}}function Ji(ft,re,se,_e){const ke=new h.a8(re,{brightness:se});for(const Oe of ft)Oe.recalculate(ke,_e)}class $o extends h.E{constructor(re,se,_e,ke,Oe,qe){super(),this.actor=re,this.layerIndex=se,this.availableImages=_e,this.loadVectorData=Oe||h.aD,this.loading={},this.loaded={},this.deduped=new h.aB(re.scheduler),this.isSpriteLoaded=ke,this.scheduler=re.scheduler,this.brightness=qe}loadTile(re,se){const _e=re.uid,ke=re&&re.request,Oe=ke&&ke.collectResourceTiming,qe=this.loading[_e]=new hn(re);qe.abort=this.loadVectorData(re,(Ee,We)=>{const it=!this.loading[_e];if(delete this.loading[_e],qe.cancelRasterize(),it||Ee||!We)return qe.status="done",it||(this.loaded[_e]=qe),se(Ee);const dt=We.rawData,ot={};We.expires&&(ot.expires=We.expires),We.cacheControl&&(ot.cacheControl=We.cacheControl),qe.vectorTile=We.vectorTile||new h.dY.VectorTile(new h.bh(dt));const St=()=>{qe.parse(qe.vectorTile,this.layerIndex,this.availableImages,this.actor,(on,kt)=>{if(on||!kt)return se(on);const Zn={};if(Oe){const ni=_t(ke);ni.length>0&&(Zn.resourceTiming=JSON.parse(JSON.stringify(ni)))}se(null,h.l({rawTileData:dt.slice(0)},kt,ot,Zn))})};this.isSpriteLoaded?St():this.once("isSpriteLoaded",()=>{this.scheduler?this.scheduler.add(St,{type:"parseTile",isSymbolTile:re.isSymbolTile,zoom:re.tileZoom}):St()}),this.loaded=this.loaded||{},this.loaded[_e]=qe})}reloadTile(re,se){const _e=this.loaded,ke=re.uid;if(_e&&_e[ke]){const Oe=_e[ke];Oe.scaleFactor=re.scaleFactor,Oe.showCollisionBoxes=re.showCollisionBoxes,Oe.projection=re.projection,Oe.brightness=re.brightness,Oe.tileTransform=h.aQ(re.tileID.canonical,re.projection),Oe.extraShadowCaster=re.extraShadowCaster,Oe.lut=re.lut;const qe=(Ee,We)=>{const it=Oe.reloadCallback;it&&(delete Oe.reloadCallback,Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor,it)),se(Ee,We)};"parsing"===Oe.status?Oe.reloadCallback=qe:"done"===Oe.status&&(Oe.vectorTile?Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor,qe):qe())}else se(null,void 0)}abortTile(re,se){const _e=re.uid,ke=this.loading[_e];ke&&(ke.abort&&ke.abort(),delete this.loading[_e]),se()}removeTile(re,se){const _e=this.loaded,ke=re.uid;_e&&_e[ke]&&delete _e[ke],se()}}class sn{loadTile(re,se){const{uid:_e,encoding:ke,rawImageData:Oe,padding:qe}=re,Ee=ImageBitmap&&Oe instanceof ImageBitmap?this.getImageData(Oe,qe):Oe;se(null,new h.e5(_e,Ee,ke,qe<1))}getImageData(re,se){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(re.width,re.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=re.width,this.offscreenCanvas.height=re.height,this.offscreenCanvasContext.drawImage(re,0,0,re.width,re.height);const _e=this.offscreenCanvasContext.getImageData(-se,-se,re.width+2*se,re.height+2*se);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),_e}}h.bg.setPbf(h.bh);class wn{decodeRasterArray({task:re,buffer:se},_e){h.bg.performDecoding(se,re).then(ke=>{_e(null,ke)},ke=>{_e(ke)})}}const Ti=h.dY.VectorTileFeature.prototype.toGeoJSON;class ri{constructor(re){this._feature=re,this.extent=h.ag,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))}loadGeometry(){if(1===this._feature.type){const re=[];for(const se of this._feature.geometry)re.push([new h.P(se[0],se[1])]);return re}{const re=[];for(const se of this._feature.geometry){const _e=[];for(const ke of se)_e.push(new h.P(ke[0],ke[1]));re.push(_e)}return re}}toGeoJSON(re,se,_e){return Ti.call(this,re,se,_e)}}class qi{constructor(re){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=h.ag,this.length=re.length,this._features=re}feature(re){return new ri(this._features[re])}}const Cn=64/4096;class Ui{constructor(){this.features=new Map}clear(){this.features.clear()}load(re=[],se){for(const _e of re){const ke=_e.id;if(null==ke)continue;let Oe=this.features.get(ke);Oe&&this.updateCache(Oe,se),_e.geometry?(Oe=mi(_e),this.updateCache(Oe,se),this.features.set(ke,Oe)):this.features.delete(ke),this.updateCache(Oe,se)}}updateCache(re,se){for(const{canonical:_e,uid:ke}of Object.values(se)){const{z:Oe,x:qe,y:Ee}=_e;Ri(re,Math.pow(2,Oe),qe,Ee)&&delete se[ke]}}getTile(re,se,_e){const ke=Math.pow(2,re),Oe=[];for(const qe of this.features.values())Ri(qe,ke,se,_e)&&Oe.push(wi(qe,ke,se,_e));return{features:Oe}}getFeatures(){return[...this.features.values()]}}function Ri({minX:ft,minY:re,maxX:se,maxY:_e},ke,Oe,qe){return ft<(Oe+1+Cn)/ke&&re<(qe+1+Cn)/ke&&se>(Oe-Cn)/ke&&_e>(qe-Cn)/ke}function mi(ft){const{id:re,geometry:se,properties:_e}=ft;if(!se)return;if("GeometryCollection"===se.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:ke,coordinates:Oe}=se,qe={id:re,type:1,geometry:[],tags:_e,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},Ee=qe.geometry;if("Point"===ke)$r(Oe,Ee,qe);else if("MultiPoint"===ke)for(const We of Oe)$r(We,Ee,qe);else if("LineString"===ke)qe.type=2,pc(Oe,Ee,qe);else if("MultiLineString"===ke)qe.type=2,Vl(Oe,Ee,qe);else if("Polygon"===ke)qe.type=3,Vl(Oe,Ee,qe,!0);else{if("MultiPolygon"!==ke)throw new Error("Input data is not a valid GeoJSON object.");qe.type=3;for(const We of Oe)Vl(We,Ee,qe,!0)}return qe}function $r([ft,re],se,_e){const ke=h.at(ft);let Oe=h.aA(re);Oe=Oe<0?0:Oe>1?1:Oe,se.push(ke,Oe),_e.minX=Math.min(_e.minX,ke),_e.minY=Math.min(_e.minY,Oe),_e.maxX=Math.max(_e.maxX,ke),_e.maxY=Math.max(_e.maxY,Oe)}function pc(ft,re,se,_e=!1,ke=!1){const Oe=[];for(const qe of ft)$r(qe,Oe,se);re.push(Oe),_e&&function(qe,Ee){let We=0;for(let it=0,dt=qe.length,ot=dt-2;it0===Ee)for(let it=0,dt=qe.length;it
=qe&&ot>=qe||(it>=qe?(dt+=Math.round(kt*((qe-it)/on)),it=qe):ot>=qe&&(St=dt+Math.round(kt*((qe-it)/on)),ot=qe),dt>=qe&&St>=qe||(dt>=qe?(it+=Math.round(on*((qe-dt)/kt)),dt=qe):St>=qe&&(ot=it+Math.round(on*((qe-dt)/kt)),St=qe),Ee&&it===Ee[Ee.length-1][0]&&dt===Ee[Ee.length-1][1]||(Ee=[[it,dt]],ke.push(Ee)),Ee.push([ot,St])))))}}var hr,lr,Ul,Fs={exports:{}},Ns=function(){if(Ul)return Fs.exports;Ul=1;var ft=h.e8(),re=function(){if(lr)return hr;lr=1;var dt=h.e6(),ot=h.e7().VectorTileFeature;function St(kt,Zn){this.options=Zn||{},this.features=kt,this.length=kt.length}function on(kt,Zn){this.id="number"==typeof kt.id?kt.id:void 0,this.type=kt.type,this.rawGeometry=1===kt.type?[kt.geometry]:kt.geometry,this.properties=kt.tags,this.extent=Zn||4096}return hr=St,St.prototype.feature=function(kt){return new on(this.features[kt],this.options.extent)},on.prototype.loadGeometry=function(){var kt=this.rawGeometry;this.geometry=[];for(var Zn=0;Zn>31}function We(dt,ot){for(var St=dt.loadGeometry(),on=dt.type,kt=0,Zn=0,ni=St.length,ct=0;ctft},yr=Math.fround||(Wo=new Float32Array(1),ft=>(Wo[0]=+ft,Wo[0]));var Wo;class wa{constructor(re){this.options=Object.assign(Object.create(cr),re),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(re){const{log:se,minZoom:_e,maxZoom:ke}=this.options;se&&console.time("total time");const Oe=`prepare ${re.length} points`;se&&console.time(Oe),this.points=re;const qe=[];for(let We=0;We=_e;We--){const it=+Date.now();Ee=this.trees[We]=this._createTree(this._cluster(Ee,We)),se&&console.log("z%d: %d clusters in %dms",We,Ee.numItems,+Date.now()-it)}return se&&console.timeEnd("total time"),this}getClusters(re,se){let _e=((re[0]+180)%360+360)%360-180;const ke=Math.max(-90,Math.min(90,re[1]));let Oe=180===re[2]?180:((re[2]+180)%360+360)%360-180;const qe=Math.max(-90,Math.min(90,re[3]));if(re[2]-re[0]>=360)_e=-180,Oe=180;else if(_e>Oe){const ot=this.getClusters([_e,ke,180,qe],se),St=this.getClusters([-180,ke,Oe,qe],se);return ot.concat(St)}const Ee=this.trees[this._limitZoom(se)],We=Ee.range(Ue(_e),ue(qe),Ue(Oe),ue(ke)),it=Ee.data,dt=[];for(const ot of We){const St=this.stride*ot;dt.push(it[St+5]>1?Li(it,St,this.clusterProps):this.points[it[St+3]])}return dt}getChildren(re){const se=this._getOriginId(re),_e=this._getOriginZoom(re),ke="No cluster with the specified id.",Oe=this.trees[_e];if(!Oe)throw new Error(ke);const qe=Oe.data;if(se*this.stride>=qe.length)throw new Error(ke);const Ee=this.options.radius/(this.options.extent*Math.pow(2,_e-1)),We=Oe.within(qe[se*this.stride],qe[se*this.stride+1],Ee),it=[];for(const dt of We){const ot=dt*this.stride;qe[ot+4]===re&&it.push(qe[ot+5]>1?Li(qe,ot,this.clusterProps):this.points[qe[ot+3]])}if(0===it.length)throw new Error(ke);return it}getLeaves(re,se,_e){const ke=[];return this._appendLeaves(ke,re,se=se||10,_e=_e||0,0),ke}getTile(re,se,_e){const ke=this.trees[this._limitZoom(re)],Oe=Math.pow(2,re),{extent:qe,radius:Ee}=this.options,We=Ee/qe,it=(_e-We)/Oe,dt=(_e+1+We)/Oe,ot={features:[]};return this._addTileFeatures(ke.range((se-We)/Oe,it,(se+1+We)/Oe,dt),ke.data,se,_e,Oe,ot),0===se&&this._addTileFeatures(ke.range(1-We/Oe,it,1,dt),ke.data,Oe,_e,Oe,ot),se===Oe-1&&this._addTileFeatures(ke.range(0,it,We/Oe,dt),ke.data,-1,_e,Oe,ot),ot.features.length?ot:null}getClusterExpansionZoom(re){let se=this._getOriginZoom(re)-1;for(;se<=this.options.maxZoom;){const _e=this.getChildren(re);if(se++,1!==_e.length)break;re=_e[0].properties.cluster_id}return se}_appendLeaves(re,se,_e,ke,Oe){const qe=this.getChildren(se);for(const Ee of qe){const We=Ee.properties;if(We&&We.cluster?Oe+We.point_count<=ke?Oe+=We.point_count:Oe=this._appendLeaves(re,We.cluster_id,_e,ke,Oe):Oe1;let dt,ot,St;if(it)dt=Nr(se,We,this.clusterProps),ot=se[We],St=se[We+1];else{const Zn=this.points[se[We+3]];dt=Zn.properties;const[ni,ct]=Zn.geometry.coordinates;ot=Ue(ni),St=ue(ct)}const on={type:1,geometry:[[Math.round(this.options.extent*(ot*Oe-_e)),Math.round(this.options.extent*(St*Oe-ke))]],tags:dt};let kt;kt=it||this.options.generateId?se[We+3]:this.points[se[We+3]].id,void 0!==kt&&(on.id=kt),qe.features.push(on)}}_limitZoom(re){return Math.max(this.options.minZoom,Math.min(Math.floor(+re),this.options.maxZoom+1))}_cluster(re,se){const{radius:_e,extent:ke,reduce:Oe,minPoints:qe}=this.options,Ee=_e/(ke*Math.pow(2,se)),We=re.data,it=[],dt=this.stride;for(let ot=0;otse&&(ni+=We[ii+5])}if(ni>Zn&&ni>=qe){let ct,ii=St*Zn,Mi=on*Zn,Ai=-1;const Di=(ot/dt<<5)+(se+1)+this.points.length;for(const Wi of kt){const Hi=Wi*dt;if(We[Hi+2]<=se)continue;We[Hi+2]=se;const Go=We[Hi+5];ii+=We[Hi]*Go,Mi+=We[Hi+1]*Go,We[Hi+4]=Di,Oe&&(ct||(ct=this._map(We,ot,!0),Ai=this.clusterProps.length,this.clusterProps.push(ct)),Oe(ct,this._map(We,Hi)))}We[ot+4]=Di,it.push(ii/ni,Mi/ni,1/0,Di,-1,ni),Oe&&it.push(Ai)}else{for(let ct=0;ct1)for(const ct of kt){const ii=ct*dt;if(!(We[ii+2]<=se)){We[ii+2]=se;for(let Mi=0;Mi>5}_getOriginZoom(re){return(re-this.points.length)%32}_map(re,se,_e){if(re[se+5]>1){const qe=this.clusterProps[re[se+6]];return _e?Object.assign({},qe):qe}const ke=this.points[re[se+3]].properties,Oe=this.options.map(ke);return _e&&Oe===ke?Object.assign({},Oe):Oe}}function Li(ft,re,se){return{type:"Feature",id:ft[re+3],properties:Nr(ft,re,se),geometry:{type:"Point",coordinates:[(_e=ft[re],360*(_e-.5)),pe(ft[re+1])]}};var _e}function Nr(ft,re,se){const _e=ft[re+5],ke=_e>=1e4?`${Math.round(_e/1e3)}k`:_e>=1e3?Math.round(_e/100)/10+"k":_e,Oe=ft[re+6],qe=-1===Oe?{}:Object.assign({},se[Oe]);return Object.assign(qe,{cluster:!0,cluster_id:ft[re+3],point_count:_e,point_count_abbreviated:ke})}function Ue(ft){return ft/360+.5}function ue(ft){const re=Math.sin(ft*Math.PI/180),se=.5-.25*Math.log((1+re)/(1-re))/Math.PI;return se<0?0:se>1?1:se}function pe(ft){const re=(180-360*ft)*Math.PI/180;return 360*Math.atan(Math.exp(re))/Math.PI-90}function et(ft,re,se,_e){let ke=_e;const Oe=re+(se-re>>1);let qe,Ee=se-re;const We=ft[re],it=ft[re+1],dt=ft[se],ot=ft[se+1];for(let St=re+3;Stke)qe=St,ke=on;else if(on===ke){const kt=Math.abs(St-Oe);kt_e&&(qe-re>3&&et(ft,re,qe,_e),ft[qe+2]=ke,se-qe>3&&et(ft,qe,se,_e))}function ht(ft,re,se,_e,ke,Oe){let qe=ke-se,Ee=Oe-_e;if(0!==qe||0!==Ee){const We=((ft-se)*qe+(re-_e)*Ee)/(qe*qe+Ee*Ee);We>1?(se=ke,_e=Oe):We>0&&(se+=qe*We,_e+=Ee*We)}return qe=ft-se,Ee=re-_e,qe*qe+Ee*Ee}function _n(ft,re,se,_e){const ke={id:ft??null,type:re,geometry:se,tags:_e,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===re||"MultiPoint"===re||"LineString"===re)an(ke,se);else if("Polygon"===re)an(ke,se[0]);else if("MultiLineString"===re)for(const Oe of se)an(ke,Oe);else if("MultiPolygon"===re)for(const Oe of se)an(ke,Oe[0]);return ke}function an(ft,re){for(let se=0;se0&&(qe+=_e?(ke*dt-it*Oe)/2:Math.sqrt(Math.pow(it-ke,2)+Math.pow(dt-Oe,2))),ke=it,Oe=dt}const Ee=re.length-3;re[2]=1,et(re,0,Ee,se),re[Ee+2]=1,re.size=Math.abs(qe),re.start=0,re.end=re.size}function ai(ft,re,se,_e){for(let ke=0;ke1?1:se}function Fa(ft,re,se,_e,ke,Oe,qe,Ee){if(_e/=re,Oe>=(se/=re)&&qe<_e)return ft;if(qe=_e)return null;const We=[];for(const it of ft){const dt=it.geometry;let ot=it.type;const St=0===ke?it.minX:it.minY,on=0===ke?it.maxX:it.maxY;if(St>=se&&on<_e){We.push(it);continue}if(on=_e)continue;let kt=[];if("Point"===ot||"MultiPoint"===ot)zs(dt,kt,se,_e,ke);else if("LineString"===ot)nc(dt,kt,se,_e,ke,!1,Ee.lineMetrics);else if("MultiLineString"===ot)Pc(dt,kt,se,_e,ke,!1);else if("Polygon"===ot)Pc(dt,kt,se,_e,ke,!0);else if("MultiPolygon"===ot)for(const Zn of dt){const ni=[];Pc(Zn,ni,se,_e,ke,!0),ni.length&&kt.push(ni)}if(kt.length){if(Ee.lineMetrics&&"LineString"===ot){for(const Zn of kt)We.push(_n(it.id,ot,Zn,it.tags));continue}"LineString"!==ot&&"MultiLineString"!==ot||(1===kt.length?(ot="LineString",kt=kt[0]):ot="MultiLineString"),"Point"!==ot&&"MultiPoint"!==ot||(ot=3===kt.length?"Point":"MultiPoint"),We.push(_n(it.id,ot,kt,it.tags))}}return We.length?We:null}function zs(ft,re,se,_e,ke){for(let Oe=0;Oe=se&&qe<=_e&&ki(re,ft[Oe],ft[Oe+1],ft[Oe+2])}}function nc(ft,re,se,_e,ke,Oe,qe){let Ee=Bs(ft);const We=0===ke?Lc:im;let it,dt,ot=ft.start;for(let ni=0;nise&&(dt=We(Ee,ct,ii,Ai,Di,se),qe&&(Ee.start=ot+it*dt)):Wi>_e?Hi<_e&&(dt=We(Ee,ct,ii,Ai,Di,_e),qe&&(Ee.start=ot+it*dt)):ki(Ee,ct,ii,Mi),Hi=se&&(dt=We(Ee,ct,ii,Ai,Di,se),Go=!0),Hi>_e&&Wi<=_e&&(dt=We(Ee,ct,ii,Ai,Di,_e),Go=!0),!Oe&&Go&&(qe&&(Ee.end=ot+it*dt),re.push(Ee),Ee=Bs(ft)),qe&&(ot+=it)}let St=ft.length-3;const on=ft[St],kt=ft[St+1],Zn=0===ke?on:kt;Zn>=se&&Zn<=_e&&ki(Ee,on,kt,ft[St+2]),St=Ee.length-3,Oe&&St>=3&&(Ee[St]!==Ee[0]||Ee[St+1]!==Ee[1])&&ki(Ee,Ee[0],Ee[1],Ee[2]),Ee.length&&re.push(Ee)}function Bs(ft){const re=[];return re.size=ft.size,re.start=ft.start,re.end=ft.end,re}function Pc(ft,re,se,_e,ke,Oe){for(const qe of ft)nc(qe,re,se,_e,ke,Oe,!1)}function ki(ft,re,se,_e){ft.push(re,se,_e)}function Lc(ft,re,se,_e,ke,Oe){const qe=(Oe-re)/(_e-re);return ki(ft,Oe,se+(ke-se)*qe,1),qe}function im(ft,re,se,_e,ke,Oe){const qe=(Oe-se)/(ke-se);return ki(ft,re+(_e-re)*qe,Oe,1),qe}function Vs(ft,re){const se=[];for(let _e=0;_e0&&re.size<(ke?qe:_e))return void(se.numPoints+=re.length/3);const Ee=[];for(let We=0;Weqe)&&(se.numSimplified++,Ee.push(re[We],re[We+1])),se.numPoints++;ke&&function(We,it){let dt=0;for(let ot=0,St=We.length,on=St-2;ot0===it)for(let ot=0,St=We.length;ot24)throw new Error("maxZoom should be in the 0-24 range");if(se.promoteId&&se.generateId)throw new Error("promoteId and generateId cannot be used together.");let ke=function(Oe,qe){const Ee=[];if("FeatureCollection"===Oe.type)for(let We=0;We1&&console.time("creation"),on=this.tiles[St]=md(re,se,_e,ke,it),this.tileCoords.push({z:se,x:_e,y:ke}),dt)){dt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",se,_e,ke,on.numFeatures,on.numPoints,on.numSimplified),console.timeEnd("creation"));const Go=`z${se}`;this.stats[Go]=(this.stats[Go]||0)+1,this.total++}if(on.source=re,null==Oe){if(se===it.indexMaxZoom||on.numPoints<=it.indexMaxPoints)continue}else{if(se===it.maxZoom||se===Oe)continue;if(null!=Oe){const Go=Oe-se;if(_e!==qe>>Go||ke!==Ee>>Go)continue}}if(on.source=null,0===re.length)continue;dt>1&&console.time("clipping");const kt=.5*it.buffer/it.extent,Zn=.5-kt,ni=.5+kt,ct=1+kt;let ii=null,Mi=null,Ai=null,Di=null,Wi=Fa(re,ot,_e-kt,_e+ni,0,on.minX,on.maxX,it),Hi=Fa(re,ot,_e+Zn,_e+ct,0,on.minX,on.maxX,it);re=null,Wi&&(ii=Fa(Wi,ot,ke-kt,ke+ni,1,on.minY,on.maxY,it),Mi=Fa(Wi,ot,ke+Zn,ke+ct,1,on.minY,on.maxY,it),Wi=null),Hi&&(Ai=Fa(Hi,ot,ke-kt,ke+ni,1,on.minY,on.maxY,it),Di=Fa(Hi,ot,ke+Zn,ke+ct,1,on.minY,on.maxY,it),Hi=null),dt>1&&console.timeEnd("clipping"),We.push(ii||[],se+1,2*_e,2*ke),We.push(Mi||[],se+1,2*_e,2*ke+1),We.push(Ai||[],se+1,2*_e+1,2*ke),We.push(Di||[],se+1,2*_e+1,2*ke+1)}}getTile(re,se,_e){re=+re,se=+se,_e=+_e;const ke=this.options,{extent:Oe,debug:qe}=ke;if(re<0||re>24)return null;const Ee=1<1&&console.log("drilling down to z%d-%d-%d",re,se,_e);let it,dt=re,ot=se,St=_e;for(;!it&&dt>0;)dt--,ot>>=1,St>>=1,it=this.tiles[zr(dt,ot,St)];return it&&it.source?(qe>1&&(console.log("found parent tile z%d-%d-%d",dt,ot,St),console.time("drilling down")),this.splitTile(it.source,dt,ot,St,re,se,_e),qe>1&&console.timeEnd("drilling down"),this.tiles[We]?pd(this.tiles[We],Oe):null):null}}function zr(ft,re,se){return 32*((1<{if(Oe||!qe)return se(Oe);if("object"!=typeof qe)return se(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`));{try{if(re.filter){const We=h.U(re.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===We.result)throw new Error(We.value.map(it=>`${it.key}: ${it.message}`).join(", "));qe.features=qe.features.filter(it=>We.value.evaluate({zoom:0},it))}re.dynamic?("Feature"===qe.type&&(qe={type:"FeatureCollection",features:[qe]}),re.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(qe.features,this.loaded),re.cluster&&(qe.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=re.cluster?new wa(function({superclusterOptions:We,clusterProperties:it}){if(!it||!We)return We;const dt={},ot={},St={accumulated:null,zoom:0},on={properties:null},kt=Object.keys(it);for(const Zn of kt){const[ni,ct]=it[Zn],ii=h.U(ct),Mi=h.U("string"==typeof ni?[ni,["accumulated"],["get",Zn]]:ni);dt[Zn]=ii.value,ot[Zn]=Mi.value}return We.map=Zn=>{on.properties=Zn;const ni={};for(const ct of kt)ni[ct]=dt[ct].evaluate(St,on);return ni},We.reduce=(Zn,ni)=>{on.properties=ni;for(const ct of kt)St.accumulated=Zn[ct],Zn[ct]=ot[ct].evaluate(St,on)},We}(re)).load(qe.features):re.dynamic?this._dynamicIndex:new fd(We=qe,re.geojsonVtOptions)}catch(We){return se(We)}const Ee={};if(ke){const We=_t(_e);We&&(Ee.resourceTiming={},Ee.resourceTiming[re.source]=JSON.parse(JSON.stringify(We)))}se(null,Ee)}var We})}reloadTile(re,se){const _e=this.loaded;return _e&&_e[re.uid]?re.partial?se(null,void 0):super.reloadTile(re,se):this.loadTile(re,se)}loadGeoJSON(re,se){if(re.request)h.n(re.request,se);else{if("string"!=typeof re.data)return se(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`));try{return se(null,JSON.parse(re.data))}catch{return se(new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(re,se){try{se(null,this._geoJSONIndex.getClusterExpansionZoom(re.clusterId))}catch(_e){se(_e)}}getClusterChildren(re,se){try{se(null,this._geoJSONIndex.getChildren(re.clusterId))}catch(_e){se(_e)}}getClusterLeaves(re,se){try{se(null,this._geoJSONIndex.getLeaves(re.clusterId,re.limit,re.offset))}catch(_e){se(_e)}}}class Jh{constructor(re,se){this.tileID=new h.aG(re.tileID.overscaledZ,re.tileID.wrap,re.tileID.canonical.z,re.tileID.canonical.x,re.tileID.canonical.y),this.tileZoom=re.tileZoom,this.uid=re.uid,this.zoom=re.zoom,this.canonical=re.tileID.canonical,this.pixelRatio=re.pixelRatio,this.tileSize=re.tileSize,this.source=re.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=re.projection,this.brightness=se}parse(re,se,_e,ke){this.status="parsing";const Oe=new h.aG(_e.tileID.overscaledZ,_e.tileID.wrap,_e.tileID.canonical.z,_e.tileID.canonical.x,_e.tileID.canonical.y),qe=[],Ee=se.familiesBySource[_e.source],We=new h.d$(Oe,_e.promoteId);return We.bucketLayerIDs=[],We.is3DTile=!0,h.ea(re).then(it=>{if(!it)return ke(new Error("Could not parse tile"));const dt=h.eb(it,1/h.cc(_e.tileID.canonical)),ot=it.json.extensionsUsed&&it.json.extensionsUsed.includes("MAPBOX_mesh_features")||it.json.asset.extras&&it.json.asset.extras.MAPBOX_mesh_features,St=it.json.extensionsUsed&&it.json.extensionsUsed.includes("EXT_meshopt_compression"),on=new h.a8(this.zoom,{brightness:this.brightness});for(const kt in Ee)for(const Zn of Ee[kt]){const ni=Zn[0];We.bucketLayerIDs.push(Zn.map(ii=>h.aC(ii.id,ii.scope))),ni.recalculate(on,[]);const ct=new h.ec(Zn,dt,Oe,ot,St,this.brightness,We);ot||(ct.needsUpload=!0),qe.push(ct),ct.evaluate(ni)}this.status="done",ke(null,{buckets:qe,featureIndex:We,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:null})}).catch(it=>ke(new Error(it.message)))}}class Na{constructor(re,se,_e,ke,Oe,qe){this.actor=re,this.layerIndex=se,this.availableImages=_e,this.brightness=qe,this.loading={},this.loaded={}}loadTile(re,se){const _e=re.uid,ke=this.loading[_e]=new Jh(re,this.brightness);h.bi(re.request,(Oe,qe)=>{const Ee=!this.loading[_e];return delete this.loading[_e],Ee||Oe?(ke.status="done",Ee||(this.loaded[_e]=ke),se(Oe)):qe&&0!==qe.byteLength?void ke.parse(qe,this.layerIndex,re,(We,it)=>{ke.status="done",this.loaded=this.loaded||{},this.loaded[_e]=ke,We||!it?se(We):se(null,it)}):(ke.status="done",this.loaded[_e]=ke,se())})}reloadTile(re,se){const _e=this.loaded,ke=re.uid;if(_e&&_e[ke]){const Oe=_e[ke];Oe.projection=re.projection,Oe.brightness=re.brightness;const qe=(Ee,We)=>{Oe.reloadCallback&&(delete Oe.reloadCallback,this.loadTile(re,se)),se(Ee,We)};"parsing"===Oe.status?Oe.reloadCallback=qe:"done"===Oe.status&&this.loadTile(re,se)}}abortTile(re,se){const _e=re.uid;this.loading[_e]&&delete this.loading[_e],se()}removeTile(re,se){const _e=this.loaded,ke=re.uid;_e&&_e[ke]&&delete _e[ke],se()}}class za{constructor(re){this.self=re,this.actor=new h.ed(re,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.imageRasterizer=new h.I,this.projections={},this.defaultProjection=h.bP({name:"mercator"}),this.workerSourceTypes={vector:$o,geojson:ch,"batched-model":Na},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(se,_e)=>{if(this.workerSourceTypes[se])throw new Error(`Worker source with name "${se}" already registered.`);this.workerSourceTypes[se]=_e},this.self.registerRTLTextPlugin=se=>{if(h.ee.isParsed())throw new Error("RTL text plugin already registered.");h.ee.applyArabicShaping=se.applyArabicShaping,h.ee.processBidirectionalText=se.processBidirectionalText,h.ee.processStyledBidirectionalText=se.processStyledBidirectionalText}}clearCaches(re,se,_e){delete this.layerIndexes[re],delete this.availableImages[re],delete this.workerSources[re],delete this.demWorkerSources[re],delete this.rasterArrayWorkerSource,_e()}checkIfReady(re,se,_e){_e()}setReferrer(re,se){this.referrer=se}spriteLoaded(re,{scope:se,isLoaded:_e}){if(this.isSpriteLoaded[re]||(this.isSpriteLoaded[re]={}),this.isSpriteLoaded[re][se]=_e,this.workerSources[re]&&this.workerSources[re][se])for(const ke in this.workerSources[re][se]){const Oe=this.workerSources[re][se][ke];for(const qe in Oe){const Ee=Oe[qe];Ee instanceof $o&&(Ee.isSpriteLoaded=_e,Ee.fire(new h.z("isSpriteLoaded")))}}}setImages(re,{scope:se,images:_e},ke){if(this.availableImages[re]||(this.availableImages[re]={}),this.availableImages[re][se]=_e,this.workerSources[re]&&this.workerSources[re][se]){for(const Oe in this.workerSources[re][se]){const qe=this.workerSources[re][se][Oe];for(const Ee in qe)qe[Ee].availableImages=_e}ke()}else ke()}setProjection(re,se){this.projections[re]=h.bP(se)}setBrightness(re,se,_e){this.brightness=se,_e()}setLayers(re,se,_e){this.getLayerIndex(re,se.scope).replace(se.layers,se.options),_e()}updateLayers(re,se,_e){this.getLayerIndex(re,se.scope).update(se.layers,se.removedIds,se.options),_e()}loadTile(re,se,_e){se.projection=this.projections[re]||this.defaultProjection,this.getWorkerSource(re,se.type,se.source,se.scope).loadTile(se,_e)}loadDEMTile(re,se,_e){this.getDEMWorkerSource(re,se.source,se.scope).loadTile(se,_e)}decodeRasterArray(re,se,_e){this.getRasterArrayWorkerSource().decodeRasterArray(se,_e)}reloadTile(re,se,_e){se.projection=this.projections[re]||this.defaultProjection,this.getWorkerSource(re,se.type,se.source,se.scope).reloadTile(se,_e)}abortTile(re,se,_e){this.getWorkerSource(re,se.type,se.source,se.scope).abortTile(se,_e)}removeTile(re,se,_e){this.getWorkerSource(re,se.type,se.source,se.scope).removeTile(se,_e)}removeSource(re,se,_e){if(!(this.workerSources[re]&&this.workerSources[re][se.scope]&&this.workerSources[re][se.scope][se.type]&&this.workerSources[re][se.scope][se.type][se.source]))return;const ke=this.workerSources[re][se.scope][se.type][se.source];delete this.workerSources[re][se.scope][se.type][se.source],void 0!==ke.removeSource?ke.removeSource(se,_e):_e()}loadWorkerSource(re,se,_e){try{this.self.importScripts(se.url),_e()}catch(ke){_e(ke.toString())}}syncRTLPluginState(re,se,_e){try{h.ee.setState(se);const ke=h.ee.getPluginURL();if(h.ee.isLoaded()&&!h.ee.isParsed()&&null!=ke){this.self.importScripts(ke);const Oe=h.ee.isParsed();_e(Oe?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ke}`),Oe)}}catch(ke){_e(ke.toString())}}setDracoUrl(re,se){this.dracoUrl=se}getAvailableImages(re,se){this.availableImages[re]||(this.availableImages[re]={});let _e=this.availableImages[re][se];return _e||(_e=[]),_e}getLayerIndex(re,se){this.layerIndexes[re]||(this.layerIndexes[re]={});let _e=this.layerIndexes[re][se];return _e||(_e=this.layerIndexes[re][se]=new Be,_e.scope=se),_e}getWorkerSource(re,se,_e,ke){return this.workerSources[re]||(this.workerSources[re]={}),this.workerSources[re][ke]||(this.workerSources[re][ke]={}),this.workerSources[re][ke][se]||(this.workerSources[re][ke][se]={}),this.isSpriteLoaded[re]||(this.isSpriteLoaded[re]={}),this.workerSources[re][ke][se][_e]||(this.workerSources[re][ke][se][_e]=new this.workerSourceTypes[se]({send:(Oe,qe,Ee,We,it,dt)=>{this.actor.send(Oe,qe,Ee,re,it,dt)},scheduler:this.actor.scheduler},this.getLayerIndex(re,ke),this.getAvailableImages(re,ke),this.isSpriteLoaded[re][ke],void 0,this.brightness)),this.workerSources[re][ke][se][_e]}rasterizeImages(re,se,_e){const{imageTasks:ke,scope:Oe}=se,qe={};for(const Ee in ke){const{image:We,imageIdWithOptions:it}=ke[Ee];qe[Ee]=this.imageRasterizer.rasterize(it,We,Oe,re)}_e(void 0,qe)}removeRasterizedImages(re,se,_e){const{imageIds:ke,scope:Oe}=se;this.imageRasterizer.removeImagesFromCacheByIds(ke,Oe,re),_e()}getDEMWorkerSource(re,se,_e){return this.demWorkerSources[re]||(this.demWorkerSources[re]={}),this.demWorkerSources[re][_e]||(this.demWorkerSources[re][_e]={}),this.demWorkerSources[re][_e][se]||(this.demWorkerSources[re][_e][se]=new sn),this.demWorkerSources[re][_e][se]}getRasterArrayWorkerSource(){return this.rasterArrayWorkerSource||(this.rasterArrayWorkerSource=new wn),this.rasterArrayWorkerSource}enforceCacheSizeLimit(re,se){h.ef(se)}getWorkerPerformanceMetrics(re,se,_e){_e(void 0,void 0)}}return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new za(self)),za}),bt(0,function(h){var _t="3.10.0";const Ot={create:"create",load:"load",fullLoad:"fullLoad"},Pt={mark(f){performance.mark(f)},measure(f,s,c){performance.measure(f,s,c)}};function Be(f){const s=f.name.split("?")[0];return h.a(s)&&s.includes("mapbox-gl.js")?"javascript":h.a(s)&&s.includes("mapbox-gl.css")?"css":h.b(s)?"fontRange":h.c(s)?"sprite":h.i(s)?"style":h.d(s)?"tilejson":"other"}var kn,Yn={},Fn=function(){if(kn)return Yn;function f(_){return!s(_)}function s(_){return typeof window>"u"||typeof document>"u"?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var C,D,O=new Blob([""],{type:"text/javascript"}),B=URL.createObjectURL(O);try{D=new Worker(B),C=!0}catch{C=!1}return D&&D.terminate(),URL.revokeObjectURL(B),C}()?function(){var C=document.createElement("canvas");C.width=C.height=1;var D=C.getContext("2d");if(!D)return!1;var O=D.getImageData(0,0,1,1);return O&&O.width===C.width}()?(void 0===c[v=_&&_.failIfMajorPerformanceCaveat]&&(c[v]=function(C){var D,B,U,H,O=(B=C,U=document.createElement("canvas"),(H=Object.create(f.webGLContextAttributes)).failIfMajorPerformanceCaveat=B,U.getContext("webgl2",H));if(!O)return!1;try{D=O.createShader(O.VERTEX_SHADER)}catch{return!1}return!(!D||O.isContextLost())&&(O.shaderSource(D,"void main() {}"),O.compileShader(D),!0===O.getShaderParameter(D,O.COMPILE_STATUS))}(v)),c[v]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var v}kn=1,Yn.supported=f,Yn.notSupportedReason=s;var c={};return f.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},Yn}();function vn(f,s,c){const _=document.createElement(f);return null!=s&&(_.className=s),c&&c.appendChild(_),_}function un(f,s,c){const _=document.createElementNS("http://www.w3.org/2000/svg",f);for(const v of Object.keys(s))_.setAttributeNS(null,v,String(s[v]));return c&&c.appendChild(_),_}const ln=typeof document<"u"?document.documentElement&&document.documentElement.style:null,ui=ln&&void 0!==ln.userSelect?"userSelect":"WebkitUserSelect";let Gi;function Dn(){ln&&ui&&(Gi=ln[ui],ln[ui]="none")}function yi(){ln&&ui&&(ln[ui]=Gi)}function oi(f){f.preventDefault(),f.stopPropagation(),window.removeEventListener("click",oi,!0)}function hn(){window.addEventListener("click",oi,!0),window.setTimeout(()=>{window.removeEventListener("click",oi,!0)},0)}function Ji(f,s){const c=f.getBoundingClientRect();return wn(f,c,s)}function $o(f,s){const c=f.getBoundingClientRect(),_=[];for(let v=0;vthis._skuTokenExpiresAt}transformRequest(s,c){return this._transformRequestFn&&this._transformRequestFn(s,c)||{url:s}}normalizeStyleURL(s,c){if(!h.f(s))return s;const _=ci(s);return _.params.push(`sdk=js-${_t}`),_.path=`/styles/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||c)}normalizeGlyphsURL(s,c){if(!h.f(s))return s;const _=ci(s);return _.path=`/fonts/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||c)}normalizeModelURL(s,c){if(!h.f(s))return s;const _=ci(s);return _.path=`/models/v1${_.path}`,this._makeAPIURL(_,this._customAccessToken||c)}normalizeSourceURL(s,c,_,v){if(!h.f(s))return s;const C=ci(s);return C.path=`/v4/${C.authority}.json`,C.params.push("secure"),_&&C.params.push(`language=${_}`),v&&C.params.push(`worldview=${v}`),this._makeAPIURL(C,this._customAccessToken||c)}normalizeIconsetURL(s,c){const _=ci(s);return h.f(s)?(_.path=`/styles/v1${_.path}/iconset.pbf`,this._makeAPIURL(_,this._customAccessToken||c)):Ui(_)}normalizeSpriteURL(s,c,_,v){const C=ci(s);return h.f(s)?(C.path=`/styles/v1${C.path}/sprite${c}${_}`,this._makeAPIURL(C,this._customAccessToken||v)):(C.path+=`${c}${_}`,Ui(C))}normalizeTileURL(s,c,_){if(this._isSkuTokenExpired()&&this._createSkuToken(),s&&!h.f(s))return s;const v=ci(s);v.path=v.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${c||_&&"raster"!==v.authority&&512===_?"@2x":""}${h.m.supported?".webp":"$1"}`),"raster"===v.authority?v.path=`/${h.e.RASTER_URL_PREFIX}${v.path}`:"rasterarrays"===v.authority?v.path=`/${h.e.RASTERARRAYS_URL_PREFIX}${v.path}`:"3dtiles"===v.authority?v.path=`/${h.e.TILES3D_URL_PREFIX}${v.path}`:(v.path=v.path.replace(/^.+\/v4\//,"/"),v.path=`/${h.e.TILE_URL_VERSION}${v.path}`);const C=this._customAccessToken||function(D){for(const O of D){const B=O.match(/^access_token=(.*)$/);if(B)return B[1]}return null}(v.params)||h.e.ACCESS_TOKEN;return h.e.REQUIRE_ACCESS_TOKEN&&C&&this._skuToken&&v.params.push(`sku=${this._skuToken}`),this._makeAPIURL(v,C)}canonicalizeTileURL(s,c){const _=ci(s);if(!_.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!_.path.match(/\.[\w]+$/))return s;let v="mapbox://";_.path.match(/^\/raster\/v1\//)?v+=`raster/${_.path.replace(`/${h.e.RASTER_URL_PREFIX}/`,"")}`:_.path.match(/^\/rasterarrays\/v1\//)?v+=`rasterarrays/${_.path.replace(`/${h.e.RASTERARRAYS_URL_PREFIX}/`,"")}`:v+=`tiles/${_.path.replace(`/${h.e.TILE_URL_VERSION}/`,"")}`;let C=_.params;return c&&(C=C.filter(D=>!D.match(/^access_token=/))),C.length&&(v+=`?${C.join("&")}`),v}canonicalizeTileset(s,c){const _=!!c&&h.f(c),v=[];for(const C of s.tiles||[])h.h(C)?v.push(this.canonicalizeTileURL(C,_)):v.push(C);return v}_makeAPIURL(s,c){const _="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",v=ci(h.e.API_URL);if(s.protocol=v.protocol,s.authority=v.authority,"http"===s.protocol){const C=s.params.indexOf("secure");C>=0&&s.params.splice(C,1)}if("/"!==v.path&&(s.path=`${v.path}${s.path}`),!h.e.REQUIRE_ACCESS_TOKEN)return Ui(s);if(c=c||h.e.ACCESS_TOKEN,!this._silenceAuthErrors){if(!c)throw new Error(`An API access token is required to use Mapbox GL. ${_}`);if("s"===c[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${_}`)}return s.params=s.params.filter(C=>-1===C.indexOf("access_token")),s.params.push(`access_token=${c||""}`),Ui(s)}}const Cn=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function ci(f){const s=f.match(Cn);if(!s)throw new Error("Unable to parse URL object");return{protocol:s[1],authority:s[2],path:s[3]||"/",params:s[4]?s[4].split("&"):[]}}function Ui(f){const s=f.params.length?`?${f.params.join("&")}`:"";return`${f.protocol}://${f.authority}${f.path}${s}`}const Ri="mapbox.eventData";function mi(f){if(!f)return null;const s=f.split(".");if(!s||3!==s.length)return null;try{return JSON.parse(h.j(s[1]))}catch{return null}}class $r{constructor(s){this.type=s,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(s){const c=mi(h.e.ACCESS_TOKEN);let _="";return _=c&&c.u?h.k(c.u):h.e.ACCESS_TOKEN||"",s?`${Ri}.${s}:${_}`:`${Ri}:${_}`}fetchEventData(){const s=h.s("localStorage"),c=this.getStorageKey(),_=this.getStorageKey("uuid");if(s)try{const v=localStorage.getItem(c);v&&(this.eventData=JSON.parse(v));const C=localStorage.getItem(_);C&&(this.anonId=C)}catch{h.w("Unable to read from LocalStorage")}}saveEventData(){const s=h.s("localStorage"),c=this.getStorageKey(),_=this.getStorageKey("uuid"),v=this.anonId;if(s&&v)try{localStorage.setItem(_,v),Object.keys(this.eventData).length>=1&&localStorage.setItem(c,JSON.stringify(this.eventData))}catch{h.w("Unable to write to LocalStorage")}}processRequests(s){}postEvent(s,c,_,v){if(!h.e.EVENTS_URL)return;const C=ci(h.e.EVENTS_URL);C.params.push(`access_token=${v||h.e.ACCESS_TOKEN||""}`);const D={event:this.type,created:new Date(s).toISOString()},O=c?h.l(D,c):D,B={url:Ui(C),headers:{"Content-Type":"text/plain"},body:JSON.stringify([O])};this.pendingRequest=h.p(B,U=>{this.pendingRequest=null,_(U),this.saveEventData(),this.processRequests(v)})}queueRequest(s,c){this.queue.push(s),this.processRequests(c)}}const pc=new class extends $r{constructor(f){super("appUserTurnstile"),this._customAccessToken=f}postTurnstileEvent(f,s){h.e.EVENTS_URL&&h.e.ACCESS_TOKEN&&Array.isArray(f)&&f.some(c=>h.f(c)||h.h(c))&&this.queueRequest(Date.now(),s)}processRequests(f){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const s=mi(h.e.ACCESS_TOKEN),c=s?s.u:h.e.ACCESS_TOKEN;let _=c!==this.eventData.tokenU;h.v(this.anonId)||(this.anonId=h.u(),_=!0);const v=this.queue.shift();if(this.eventData.lastSuccess){const C=new Date(this.eventData.lastSuccess),D=new Date(v),O=(v-this.eventData.lastSuccess)/864e5;_=_||O>=1||O<-1||C.getDate()!==D.getDate()}else _=!0;_?this.postEvent(v,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_t,skuId:Ti,"enabled.telemetry":!1,userId:this.anonId},C=>{C||(this.eventData.lastSuccess=v,this.eventData.tokenU=c)},f):this.processRequests()}},Vl=pc.postTurnstileEvent.bind(pc),wi=new class extends $r{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(f,s,c,_){this.skuToken=s,this.errorCb=_,h.e.EVENTS_URL&&(c||h.e.ACCESS_TOKEN?this.queueRequest({id:f,timestamp:Date.now()},c):this.errorCb(new Error(ri)))}processRequests(f){if(this.pendingRequest||0===this.queue.length)return;const{id:s,timestamp:c}=this.queue.shift();s&&this.success[s]||(this.anonId||this.fetchEventData(),h.v(this.anonId)||(this.anonId=h.u()),this.postEvent(c,{sdkIdentifier:"mapbox-gl-js",sdkVersion:_t,skuId:Ti,skuToken:this.skuToken,userId:this.anonId},_=>{_?this.errorCb(_):s&&(this.success[s]=!0)},f))}remove(){this.errorCb=null}},Oc=wi.postMapLoadEvent.bind(wi),hr=new class extends $r{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(f){let s=this.mapInstanceIdMap.get(f);return s||(s=h.u(),this.mapInstanceIdMap.set(f,s)),s}getEventId(f){const s=this.eventIdPerMapInstanceMap.get(f)||0;return this.eventIdPerMapInstanceMap.set(f,s+1),s}postStyleLoadEvent(f,s){const{map:c,style:_,importedStyles:v}=s;if(!h.e.EVENTS_URL||!f&&!h.e.ACCESS_TOKEN)return;const C=this.getMapInstanceId(c),D={mapInstanceId:C,eventId:this.getEventId(C),style:_};v.length&&(D.importedStyles=v),this.queueRequest({timestamp:Date.now(),payload:D},f)}processRequests(f){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:s,payload:c}=this.queue.shift();this.postEvent(s,c,()=>{},f)}},lr=hr.postStyleLoadEvent.bind(hr),Ul=new class extends $r{constructor(){super("gljs.performance")}postPerformanceEvent(f,s){h.e.EVENTS_URL&&(f||h.e.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:s},f)}processRequests(f){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:s,performanceData:c}=this.queue.shift(),_=function(v){const C=performance.getEntriesByType("resource"),D=performance.getEntriesByType("mark"),O=function(Q){const ae={};if(Q)for(const ie in Q)if("other"!==ie)for(const ce of Q[ie]){const de=`${ie}ResolveRangeMin`,be=`${ie}ResolveRangeMax`,De=`${ie}RequestCount`,Te=`${ie}RequestCachedCount`;ae[de]=Math.min(ae[de]||1/0,ce.startTime),ae[be]=Math.max(ae[be]||-1/0,ce.responseEnd);const Le=Me=>{void 0===ae[Me]&&(ae[Me]=0),++ae[Me]};void 0!==ce.transferSize&&0===ce.transferSize&&Le(Te),Le(De)}return ae}(function(Q,ae){const ie={};if(Q)for(const ce of Q){const de=ae(ce);void 0===ie[de]&&(ie[de]=[]),ie[de].push(ce)}return ie}(C,Be)),B=window.devicePixelRatio,U=navigator.connection||navigator.mozConnection||navigator.webkitConnection,H=U?U.effectiveType:void 0,G={counters:[],metadata:[],attributes:[]},W=(Q,ae,ie)=>{null!=ie&&Q.push({name:ae,value:ie.toString()})};for(const Q in O)W(G.counters,Q,O[Q]);if(v.interactionRange[0]!==1/0&&v.interactionRange[1]!==-1/0&&(W(G.counters,"interactionRangeMin",v.interactionRange[0]),W(G.counters,"interactionRangeMax",v.interactionRange[1])),D)for(const Q of Object.keys(Ot)){const ae=Ot[Q],ie=D.find(ce=>ce.name===ae);ie&&W(G.counters,ae,ie.startTime)}return W(G.counters,"visibilityHidden",v.visibilityHidden),W(G.attributes,"style",function(Q){if(Q)for(const ae of Q){const ie=ae.name.split("?")[0];if(h.i(ie)){const ce=ie.split("/").slice(-2);if(2===ce.length)return`mapbox://styles/${ce[0]}/${ce[1]}`}}}(C)),W(G.attributes,"terrainEnabled",v.terrainEnabled?"true":"false"),W(G.attributes,"fogEnabled",v.fogEnabled?"true":"false"),W(G.attributes,"projection",v.projection),W(G.attributes,"zoom",v.zoom),W(G.metadata,"devicePixelRatio",B),W(G.metadata,"connectionEffectiveType",H),W(G.metadata,"navigatorUserAgent",navigator.userAgent),W(G.metadata,"screenWidth",window.screen.width),W(G.metadata,"screenHeight",window.screen.height),W(G.metadata,"windowWidth",window.innerWidth),W(G.metadata,"windowHeight",window.innerHeight),W(G.metadata,"mapWidth",v.width/B),W(G.metadata,"mapHeight",v.height/B),W(G.metadata,"webglRenderer",v.renderer),W(G.metadata,"webglVendor",v.vendor),W(G.metadata,"sdkVersion",_t),W(G.metadata,"sdkIdentifier","mapbox-gl-js"),G}(c);for(const v of _.metadata);for(const v of _.counters);for(const v of _.attributes);this.postEvent(s,_,()=>{},f)}},Fs=Ul.postPerformanceEvent.bind(Ul),Ns=new class extends $r{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(f,s,c,_){if(!h.e.API_URL||!h.e.SESSION_PATH)return;const v=ci(h.e.API_URL+h.e.SESSION_PATH);v.params.push(`sku=${s||""}`),v.params.push(`access_token=${_||h.e.ACCESS_TOKEN||""}`);const C={url:Ui(v),headers:{"Content-Type":"text/plain"}};this.pendingRequest=h.g(C,D=>{this.pendingRequest=null,c(D),this.saveEventData(),this.processRequests(_)})}getSessionAPI(f,s,c,_){this.skuToken=s,this.errorCb=_,h.e.SESSION_PATH&&h.e.API_URL&&(c||h.e.ACCESS_TOKEN?this.queueRequest({id:f,timestamp:Date.now()},c):this.errorCb(new Error(ri)))}processRequests(f){if(this.pendingRequest||0===this.queue.length)return;const{id:s,timestamp:c}=this.queue.shift();s&&this.success[s]||this.getSession(c,this.skuToken,_=>{_?this.errorCb(_):s&&(this.success[s]=!0)},f)}remove(){this.errorCb=null}},Ze=Ns.getSessionAPI.bind(Ns),cr=new Set;function yr(f,s){s?cr.add(f):cr.delete(f)}class Wo{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(s,c){this._updatedSourceCaches[s]=c,this.setDirty()}discardSourceCacheUpdate(s){delete this._updatedSourceCaches[s]}updateLayer(s){const c=s.scope;this._updatedLayers[c]=this._updatedLayers[c]||new Set,this._updatedLayers[c].add(s.id),this.setDirty()}removeLayer(s){const c=s.scope;this._removedLayers[c]=this._removedLayers[c]||{},this._updatedLayers[c]=this._updatedLayers[c]||new Set,this._removedLayers[c][s.id]=s,this._updatedLayers[c].delete(s.id),this._updatedPaintProps.delete(s.fqid),this.setDirty()}getRemovedLayer(s){return this._removedLayers[s.scope]?this._removedLayers[s.scope][s.id]:null}discardLayerRemoval(s){this._removedLayers[s.scope]&&delete this._removedLayers[s.scope][s.id]}getLayerUpdatesByScope(){const s={};for(const c in this._updatedLayers)s[c]=s[c]||{},s[c].updatedIds=Array.from(this._updatedLayers[c].values());for(const c in this._removedLayers)s[c]=s[c]||{},s[c].removedIds=Object.keys(this._removedLayers[c]);return s}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(s){this._updatedPaintProps.add(s.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(s){this._updatedImages.add(s),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}function Xt(f){const{userImage:s}=f;return!!(s&&s.render&&s.render())&&(f.data.replace(new Uint8Array(s.data.buffer)),!0)}class fa extends h.E{constructor(s){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0,this.spriteFormat=s,"raster"!==s&&h.t()&&(this.imageRasterizerDispatcher=new h.D(h.x(),this,"Image Rasterizer Worker",1))}get imageRasterizer(){return this._imageRasterizer||(this._imageRasterizer=new h.I),this._imageRasterizer}createScope(s){this.images[s]={},this.loaded[s]=!1,this.updatedImages[s]={},this.patterns[s]={},this.callbackDispatchedThisFrame[s]={},this.atlasImage[s]=new h.r({width:1,height:1})}isLoaded(){for(const s in this.loaded)if(!this.loaded[s])return!1;return!0}setLoaded(s,c){if(this.loaded[c]!==s&&(this.loaded[c]=s,s)){for(const{ids:_,callback:v}of this.requestors)this._notify(_,c,v);this.requestors=[]}}hasImage(s,c){return!!this.getImage(s,c)}getImage(s,c){return this.images[c][s]}addImage(s,c,_){this._validate(s,_)&&(this.images[c][s]=_)}_validate(s,c){let _=!0;return this._validateStretch(c.stretchX,c.data&&c.data.width)||(this.fire(new h.y(new Error(`Image "${s}" has invalid "stretchX" value`))),_=!1),this._validateStretch(c.stretchY,c.data&&c.data.height)||(this.fire(new h.y(new Error(`Image "${s}" has invalid "stretchY" value`))),_=!1),this._validateContent(c.content,c)||(this.fire(new h.y(new Error(`Image "${s}" has invalid "content" value`))),_=!1),_}_validateStretch(s,c){if(!s)return!0;let _=0;for(const v of s){if(v[0]<_||v[1]1?H-1:H,h.r.copy(Q,D,{x:0,y:0},{x:G,y:W},{width:ae,height:ie},c),h.r.copy(Q,D,{x:0,y:ie-H},{x:G,y:W-H},{width:ae,height:H},c),h.r.copy(Q,D,{x:0,y:0},{x:G,y:W+ie},{width:ae,height:H},c),h.r.copy(Q,D,{x:ae-H,y:0},{x:G-H,y:W},{width:H,height:ie},c),h.r.copy(Q,D,{x:0,y:0},{x:G+ae,y:W},{width:H,height:ie},c),h.r.copy(Q,D,{x:ae-H,y:ie-H},{x:G-H,y:W-H},{width:H,height:H},c),h.r.copy(Q,D,{x:0,y:ie-H},{x:G+ae,y:W-H},{width:H,height:H},c),h.r.copy(Q,D,{x:0,y:0},{x:G+ae,y:W+ie},{width:H,height:H},c),h.r.copy(Q,D,{x:ae-H,y:0},{x:G-H,y:W+ie},{width:H,height:H},c)}this.dirty=!0}beginFrame(){for(const s in this.images)this.callbackDispatchedThisFrame[s]={}}dispatchRenderCallbacks(s,c){for(const _ of s){if(this.callbackDispatchedThisFrame[c][_])continue;this.callbackDispatchedThisFrame[c][_]=!0;const v=this.images[c][_];Xt(v)&&this.updateImage(_,c,v)}}}function Gr(f){const s=f.key,c=f.value,_=f.valueSpec||{},v=f.objectElementValidators||{},C=f.style,D=f.styleSpec;let O=[];const B=h.H(c);if("object"!==B)return[new h.V(s,c,`object expected, ${B} found`)];for(const U in c){const H=U.split(".")[0];let G;v[H]?G=v[H]:_[H]?G=ki:v["*"]?G=v["*"]:_["*"]&&(G=ki),G?O=O.concat(G({key:(s&&`${s}.`)+U,value:c[U],valueSpec:_[H]||_["*"],style:C,styleSpec:D,object:c,objectKey:U},c)):O.push(new h.G(s,c[U],`unknown property "${U}"`))}for(const U in _)v[U]||_[U].required&&void 0===_[U].default&&void 0===c[U]&&O.push(new h.V(s,c,`missing required property "${U}"`));return O}function wa(f){const s=f.value,c=f.valueSpec,_=f.style,v=f.styleSpec,C=f.key,D=f.arrayElementValidator||ki;if("array"!==h.H(s))return[new h.V(C,s,`array expected, ${h.H(s)} found`)];if(c.length&&s.length!==c.length)return[new h.V(C,s,`array length ${c.length} expected, length ${s.length} found`)];if(c["min-length"]&&s.lengthC)return[new h.V(s,c,`${c} is greater than the maximum value ${C}`)]}return[]}function Nr(f){const s=f.valueSpec,c=h.K(f.value.type);let _,v,C,D={};const O="categorical"!==c&&void 0===f.value.property,B=!O,U="array"===h.H(f.value.stops)&&"array"===h.H(f.value.stops[0])&&"object"===h.H(f.value.stops[0][0]),H=Gr({key:f.key,value:f.value,valueSpec:f.styleSpec.function,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{stops:function(Q){if("identity"===c)return[new h.V(Q.key,Q.value,'identity function may not have a "stops" property')];let ae=[];const ie=Q.value;return ae=ae.concat(wa({key:Q.key,value:ie,valueSpec:Q.valueSpec,style:Q.style,styleSpec:Q.styleSpec,arrayElementValidator:G})),"array"===h.H(ie)&&0===ie.length&&ae.push(new h.V(Q.key,ie,"array must have at least one stop")),ae},default:function(Q){return ki({key:Q.key,value:Q.value,valueSpec:s,style:Q.style,styleSpec:Q.styleSpec})}}});return"identity"===c&&O&&H.push(new h.V(f.key,f.value,'missing required property "property"')),"identity"===c||f.value.stops||H.push(new h.V(f.key,f.value,'missing required property "stops"')),"exponential"===c&&f.valueSpec.expression&&!h.L(f.valueSpec)&&H.push(new h.V(f.key,f.value,"exponential functions not supported")),f.styleSpec.$version>=8&&(B&&!h.M(f.valueSpec)?H.push(new h.V(f.key,f.value,"property functions not supported")):O&&!h.N(f.valueSpec)&&H.push(new h.V(f.key,f.value,"zoom functions not supported"))),"categorical"!==c&&!U||void 0!==f.value.property||H.push(new h.V(f.key,f.value,'"property" property is required')),H;function G(Q){let ae=[];const ie=Q.value,ce=Q.key;if("array"!==h.H(ie))return[new h.V(ce,ie,`array expected, ${h.H(ie)} found`)];if(2!==ie.length)return[new h.V(ce,ie,`array length 2 expected, length ${ie.length} found`)];if(U){if("object"!==h.H(ie[0]))return[new h.V(ce,ie,`object expected, ${h.H(ie[0])} found`)];if(void 0===ie[0].zoom)return[new h.V(ce,ie,"object stop key must have zoom")];if(void 0===ie[0].value)return[new h.V(ce,ie,"object stop key must have value")];const de=h.K(ie[0].zoom);if("number"!=typeof de)return[new h.V(ce,ie[0].zoom,"stop zoom values must be numbers")];if(C&&C>de)return[new h.V(ce,ie[0].zoom,"stop zoom values must appear in ascending order")];de!==C&&(C=de,v=void 0,D={}),ae=ae.concat(Gr({key:`${ce}[0]`,value:ie[0],valueSpec:{zoom:{}},style:Q.style,styleSpec:Q.styleSpec,objectElementValidators:{zoom:Li,value:W}}))}else ae=ae.concat(W({key:`${ce}[0]`,value:ie[0],valueSpec:{},style:Q.style,styleSpec:Q.styleSpec},ie));return h.O(h.Q(ie[1]))?ae.concat([new h.V(`${ce}[1]`,ie[1],"expressions are not allowed in function stops.")]):ae.concat(ki({key:`${ce}[1]`,value:ie[1],valueSpec:s,style:Q.style,styleSpec:Q.styleSpec}))}function W(Q,ae){const ie=h.H(Q.value),ce=h.K(Q.value),de=null!==Q.value?Q.value:ae;if(_){if(ie!==_)return[new h.V(Q.key,de,`${ie} stop domain type must match previous stop domain type ${_}`)]}else _=ie;if("number"!==ie&&"string"!==ie&&"boolean"!==ie&&"number"!=typeof ce&&"string"!=typeof ce&&"boolean"!=typeof ce)return[new h.V(Q.key,de,"stop domain value must be a number, string, or boolean")];if("number"!==ie&&"categorical"!==c){let be=`number expected, ${ie} found`;return h.M(s)&&void 0===c&&(be+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new h.V(Q.key,de,be)]}return"categorical"!==c||"number"!==ie||"number"==typeof ce&&isFinite(ce)&&Math.floor(ce)===ce?"categorical"!==c&&"number"===ie&&"number"==typeof ce&&"number"==typeof v&&void 0!==v&&cenew h.V(`${f.key}${_.key}`,f.value,_.message));const c=s.value.expression||s.value._styleExpression.expression;if("property"===f.expressionContext&&"text-font"===f.propertyKey&&!c.outputDefined())return[new h.V(f.key,f.value,`Invalid data expression for "${f.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===f.expressionContext&&"layout"===f.propertyType&&!h.W(c))return[new h.V(f.key,f.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===f.expressionContext)return ue(c,f);if(f.expressionContext&&0===f.expressionContext.indexOf("cluster")){if(!h.X(c,["zoom","feature-state"]))return[new h.V(f.key,f.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===f.expressionContext&&!h.Y(c))return[new h.V(f.key,f.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ue(f,s){const c=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(s.valueSpec&&s.valueSpec.expression)for(const v of s.valueSpec.expression.parameters)c.delete(v);if(0===c.size)return[];const _=[];return f instanceof h.Z&&c.has(f.name)?[new h.V(s.key,s.value,`["${f.name}"] expression is not supported in a filter for a ${s.object.type} layer with id: ${s.object.id}`)]:(f.eachChild(v=>{_.push(...ue(v,s))}),_)}function pe(f){const s=f.key,c=f.value,_=f.valueSpec,v=[];return Array.isArray(_.values)?-1===_.values.indexOf(h.K(c))&&v.push(new h.V(s,c,`expected one of [${_.values.join(", ")}], ${JSON.stringify(c)} found`)):-1===Object.keys(_.values).indexOf(h.K(c))&&v.push(new h.V(s,c,`expected one of [${Object.keys(_.values).join(", ")}], ${JSON.stringify(c)} found`)),v}function et(f){return h.$(h.Q(f.value))?Ue(h.J({},f,{expressionContext:"filter",valueSpec:f.styleSpec[`filter_${f.layerType||"fill"}`]})):ht(f)}function ht(f){const s=f.value,c=f.key;if("array"!==h.H(s))return[new h.V(c,s,`array expected, ${h.H(s)} found`)];const _=f.styleSpec;let v,C=[];if(s.length<1)return[new h.V(c,s,"filter array must have at least 1 element")];switch(C=C.concat(pe({key:`${c}[0]`,value:s[0],valueSpec:_.filter_operator,style:f.style,styleSpec:f.styleSpec})),h.K(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"===h.K(s[1])&&C.push(new h.V(c,s,`"$type" cannot be use with operator "${s[0]}"`));case"==":case"!=":3!==s.length&&C.push(new h.V(c,s,`filter array for operator "${s[0]}" must have 3 elements`));case"in":case"!in":s.length>=2&&(v=h.H(s[1]),"string"!==v&&C.push(new h.V(`${c}[1]`,s[1],`string expected, ${v} found`)));for(let D=2;D{U in c&&s.push(new h.V(_,c[U],`"${U}" is prohibited for ref layers`))}),v.layers.forEach(U=>{h.K(U.id)===O&&(B=U)}),B?B.ref?s.push(new h.V(_,c.ref,"ref cannot reference another ref layer")):D=h.K(B.type):"string"==typeof O&&s.push(new h.V(_,c.ref,`ref layer "${O}" not found`))}else if("background"!==D&&"sky"!==D&&"slot"!==D)if(c.source){const B=v.sources&&v.sources[c.source],U=B&&h.K(B.type);B?"vector"===U&&"raster"===D?s.push(new h.V(_,c.source,`layer "${c.id}" requires a raster source`)):"raster"===U&&"raster"!==D?s.push(new h.V(_,c.source,`layer "${c.id}" requires a vector source`)):"vector"!==U||c["source-layer"]?"raster-dem"===U&&"hillshade"!==D?s.push(new h.V(_,c.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==U||["raster","raster-particle"].includes(D)?"line"!==D||!c.paint||!c.paint["line-gradient"]&&!c.paint["line-trim-offset"]||"geojson"===U&&B.lineMetrics?"raster-particle"===D&&"raster-array"!==U&&s.push(new h.V(_,c.source,`layer "${c.id}" requires a 'raster-array' source.`)):s.push(new h.V(_,c,`layer "${c.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):s.push(new h.V(_,c.source,"raster-array source can only be used with layer type 'raster'.")):s.push(new h.V(_,c,`layer "${c.id}" must specify a "source-layer"`)):s.push(new h.V(_,c.source,`source "${c.source}" not found`))}else s.push(new h.V(_,c,'missing required property "source"'));return s=s.concat(Gr({key:_,value:c,valueSpec:C.layer,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":()=>[],type:()=>ki({key:`${_}.type`,value:c.type,valueSpec:C.layer.type,style:f.style,styleSpec:f.styleSpec,object:c,objectKey:"type"}),filter:B=>et(h.J({layerType:D},B)),layout:B=>Gr({layer:c,key:B.key,value:B.value,valueSpec:{},style:B.style,styleSpec:B.styleSpec,objectElementValidators:{"*":U=>vo(h.J({layerType:D},U))}}),paint:B=>Gr({layer:c,key:B.key,value:B.value,valueSpec:{},style:B.style,styleSpec:B.styleSpec,objectElementValidators:{"*":U=>an(h.J({layerType:D,layer:c},U))}})}})),s}function Ho(f){const s=f.value,c=f.key,_=h.H(s);return"string"!==_?[new h.V(c,s,`string expected, ${_} found`)]:[]}const ai={promoteId:function f({key:s,value:c}){if("string"===h.H(c))return Ho({key:s,value:c});if(Array.isArray(c)){const _=[],v=h.Q(c),C=h.U(v);return"error"===C.result&&C.value.forEach(D=>{_.push(new h.V(`${s}${D.key}`,null,`${D.message}`))}),h.X(C.value.expression,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])||_.push(new h.V(`${s}`,null,"promoteId expression should be only feature dependent")),_}{const _=[];for(const v in c)_.push(...f({key:`${s}.${v}`,value:c[v]}));return _}}};function dr(f){const s=f.value,c=f.key,_=f.styleSpec,v=f.style;if(!s.type)return[new h.V(c,s,'"type" is required')];const C=h.K(s.type);let D=[];switch(["vector","raster","raster-dem","raster-array"].includes(C)&&(s.url||s.tiles||D.push(new h.G(c,s,'Either "url" or "tiles" is required.'))),C){case"vector":case"raster":case"raster-dem":case"raster-array":return D=D.concat(Gr({key:c,value:s,valueSpec:_[`source_${C.replace("-","_")}`],style:f.style,styleSpec:_,objectElementValidators:ai})),D;case"geojson":if(D=Gr({key:c,value:s,valueSpec:_.source_geojson,style:v,styleSpec:_,objectElementValidators:ai}),s.cluster)for(const O in s.clusterProperties){const[B,U]=s.clusterProperties[O],H="string"==typeof B?[B,["accumulated"],["get",O]]:B;D.push(...Ue({key:`${c}.${O}.map`,value:U,expressionContext:"cluster-map"})),D.push(...Ue({key:`${c}.${O}.reduce`,value:H,expressionContext:"cluster-reduce"}))}return D;case"video":return Gr({key:c,value:s,valueSpec:_.source_video,style:v,styleSpec:_});case"image":return Gr({key:c,value:s,valueSpec:_.source_image,style:v,styleSpec:_});case"canvas":return[new h.V(c,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pe({key:`${c}.type`,value:s.type,valueSpec:{values:Hl(_)},style:v,styleSpec:_})}}function Hl(f){return f.source.reduce((s,c)=>{const _=f[c];return"enum"===_.type.type&&(s=s.concat(Object.keys(_.type.values))),s},[])}function Fa(f){const s=f.value,c=f.styleSpec,_=c.light,v=f.style;let C=[];const D=h.H(s);if(void 0===s)return C;if("object"!==D)return C=C.concat([new h.V("light",s,`object expected, ${D} found`)]),C;for(const O in s){const B=O.match(/^(.*)-transition$/),U=O.match(/^(.*)-use-theme$/);C=C.concat(U&&_[U[1]]?ki({key:O,value:s[O],valueSpec:{type:"string"},style:v,styleSpec:c}):B&&_[B[1]]&&_[B[1]].transition?ki({key:O,value:s[O],valueSpec:c.transition,style:v,styleSpec:c}):_[O]?ki({key:O,value:s[O],valueSpec:_[O],style:v,styleSpec:c}):[new h.V(O,s[O],`unknown property "${O}"`)])}return C}function zs(f){const s=f.value;let c=[];if(!s)return c;const _=h.H(s);if("object"!==_)return c=c.concat([new h.V("light-3d",s,`object expected, ${_} found`)]),c;const v=f.styleSpec,C=v["light-3d"],D=f.key,O=f.style,B=f.style.lights;for(const G of["type","id"])if(!(G in s))return c=c.concat([new h.V("light-3d",s,`missing property ${G} on light`)]),c;if(s.type&&B)for(let G=0;G[],array:wa,boolean:function(f){const s=f.value,c=f.key,_=h.H(s);return"boolean"!==_?[new h.V(c,s,`boolean expected, ${_} found`)]:[]},number:Li,color:function(f){const s=f.key,c=f.value,_=h.H(c);return"string"!==_?[new h.V(s,c,`color expected, ${_} found`)]:null===h._.parseCSSColor(c)?[new h.V(s,c,`color expected, "${c}" found`)]:[]},enum:pe,filter:et,function:Nr,layer:fo,object:Gr,source:dr,model:h.a2,light:Fa,"light-3d":zs,terrain:nc,fog:Bs,string:Ho,formatted:function(f){return 0===Ho(f).length?[]:Ue(f)},resolvedImage:function(f){return 0===Ho(f).length?[]:Ue(f)},projection:function(f){const s=f.value,c=f.styleSpec,_=c.projection,v=f.style;let C=[];const D=h.H(s);if("object"===D)for(const O in s)C=C.concat(ki({key:O,value:s[O],valueSpec:_[O],style:v,styleSpec:c}));else"string"!==D&&(C=C.concat([new h.V("projection",s,`object or string expected, ${D} found`)]));return C},import:function(f){const{value:s,styleSpec:c}=f,{data:_,...v}=s;Object.defineProperty(v,"__line__",{value:s.__line__,enumerable:!1});let C=Gr(h.J({},f,{value:v,valueSpec:c.import}));return""===h.K(v.id)&&C.push(new h.V(`${f.key}.id`,v,"import id can't be an empty string")),_&&(C=C.concat(im(_,c,{key:`${f.key}.data`}))),C}};function ki(f,s=!1){const c=f.value,_=f.valueSpec,v=f.styleSpec;if(_.expression&&h.a0(h.K(c)))return Nr(f);if(_.expression&&h.O(h.Q(c)))return Ue(f);if(_.type&&Pc[_.type]){const C=Pc[_.type](f);return!0===s&&C.length>0&&"array"===h.H(f.value)?Ue(f):C}return Gr(h.J({},f,{valueSpec:_.type?v[_.type]:_}))}function Lc(f){const s=f.value,c=f.key,_=Ho(f);return _.length||(-1===s.indexOf("{fontstack}")&&_.push(new h.V(c,s,'"glyphs" url must include a "{fontstack}" token')),-1===s.indexOf("{range}")&&_.push(new h.V(c,s,'"glyphs" url must include a "{range}" token'))),_}function im(f,s=h.a3,c={}){return ki({key:c.key||"",value:f,valueSpec:s.$root,styleSpec:s,style:f,objectElementValidators:{glyphs:Lc,"*":()=>[]}})}function Vs(f,s=h.a3){return Na(im(f,s))}const as=f=>Na(dr(f)),pd=f=>Na(Fa(f)),sh=f=>Na(zs(f)),md=f=>Na(nc(f)),Qh=f=>Na(Bs(f)),Fc=f=>Na(function(s){const c=s.value,_=s.style,v=s.styleSpec,C=v.snow;let D=[];const O=h.H(c);if(void 0===c)return D;if("object"!==O)return D=D.concat([new h.V("snow",c,`object expected, ${O} found`)]),D;for(const B in c){const U=B.match(/^(.*)-transition$/);D=D.concat(U&&C[U[1]]&&C[U[1]].transition?ki({key:B,value:c[B],valueSpec:v.transition,style:_,styleSpec:v}):C[B]?ki({key:B,value:c[B],valueSpec:C[B],style:_,styleSpec:v}):[new h.G(B,c[B],`unknown property "${B}"`)])}return D}(f)),om=f=>Na(function(s){const c=s.value,_=s.style,v=s.styleSpec,C=v.rain;let D=[];const O=h.H(c);if(void 0===c)return D;if("object"!==O)return D=D.concat([new h.V("rain",c,`object expected, ${O} found`)]),D;for(const B in c){const U=B.match(/^(.*)-transition$/);D=D.concat(U&&C[U[1]]&&C[U[1]].transition?ki({key:B,value:c[B],valueSpec:v.transition,style:_,styleSpec:v}):C[B]?ki({key:B,value:c[B],valueSpec:C[B],style:_,styleSpec:v}):[new h.G(B,c[B],`unknown property "${B}"`)])}return D}(f)),fd=f=>Na(fo(f)),zr=f=>Na(et(f)),lh=f=>Na(an(f)),ch=f=>Na(vo(f)),Jh=f=>Na(h.a2(f));function Na(f){return f.slice().sort((s,c)=>s.line&&c.line?s.line-c.line:0)}function za(f,s){let c=!1;if(s&&s.length)for(const _ of s)_ instanceof h.G?h.w(_.message):(f.fire(new h.y(new Error(_.message))),c=!0);return c}let ft;class re extends h.E{constructor(s,c="flat"){super(),this._transitionable=new h.a4(ft||(ft=new h.a5({anchor:new h.a6(h.a3.light.anchor),position:new h.a7(h.a3.light.position),color:new h.a6(h.a3.light.color),intensity:new h.a6(h.a3.light.intensity)}))),this.setLight(s,c),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(s,c,_={}){this._validate(pd,s,_)||(this._transitionable.setTransitionOrValue(s),this.id=c)}updateTransitions(s){this._transitioning=this._transitionable.transitioned(s,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(s){this.properties=this._transitioning.possiblyEvaluate(s)}_validate(s,c,_){return(!_||!1!==_.validate)&&za(this,s.call(Vs,h.l({value:c,style:{glyphs:!0,sprite:!0},styleSpec:h.a3})))}}let se=class extends h.E{constructor(f,s,c,_){super(),this.scope=c,this._transitionable=new h.a4(new h.a5({source:new h.a6(h.a3.terrain.source),exaggeration:new h.a6(h.a3.terrain.exaggeration)}),c,_),this._transitionable.setTransitionOrValue(f,_),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=s}get(){return this._transitionable.serialize()}set(f,s){this._transitionable.setTransitionOrValue(f,s)}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}getExaggeration(f){return this._transitioning.possiblyEvaluate(new h.a8(f)).get("exaggeration")}getAttenuationRange(){if(!this.isZoomDependent())return null;const f=this._transitionable._values.exaggeration;if(!f)return null;const s=f.value.expression;if(!s)return null;let c=-1,_=-1,v=1;for(const C of s.zoomStops)v=s.evaluate(new h.a8(C)),v>.01?(c=C,_=-1):_=C;return v<.01&&c>0&&_>c?[c,_]:null}isZoomDependent(){const f=this._transitionable._values.exaggeration;return null!=f&&null!=f.value&&null!=f.value.expression&&f.value.expression instanceof h.a9}};const Oe=.05;function qe(f,s,c,_){const v=h.ac(45,65,c),[C,D]=Ee(f,_);let O=1-Math.min(1,Math.exp((s-C)/(D-C)*-6));return O*=O*O,O=Math.min(1,1.00747*O),O*v*f.alpha}function Ee(f,s){const c=.5/Math.tan(.5*s);return[f.range[0]+c,f.range[1]+c]}function We(f,s,c,_,v){const C=h.ab.vec3.transformMat4([],[s,c,_],v.mercatorFogMatrix);return qe(f,h.ab.vec3.length(C),v.pitch,v._fov)}function it(f,s,c,_,v,C,D){const O=[[c,_,0],[v,_,0],[v,C,0],[c,C,0]];let B=Number.MAX_VALUE,U=-Number.MAX_VALUE;for(const H of O){const G=h.ab.vec3.transformMat4([],H,s),W=h.ab.vec3.length(G);B=Math.min(B,W),U=Math.max(U,W)}return[qe(f,B,D.pitch,D._fov),qe(f,U,D.pitch,D._fov)]}class dt extends h.E{constructor(s,c,_,v){super();const C=new h.a5({range:new h.a6(h.a3.fog.range),color:new h.a6(h.a3.fog.color),"color-use-theme":new h.a6({type:"string","property-type":"data-constant",default:"default"}),"high-color":new h.a6(h.a3.fog["high-color"]),"high-color-use-theme":new h.a6({type:"string","property-type":"data-constant",default:"default"}),"space-color":new h.a6(h.a3.fog["space-color"]),"space-color-use-theme":new h.a6({type:"string","property-type":"data-constant",default:"default"}),"horizon-blend":new h.a6(h.a3.fog["horizon-blend"]),"star-intensity":new h.a6(h.a3.fog["star-intensity"]),"vertical-range":new h.a6(h.a3.fog["vertical-range"])});this._transitionable=new h.a4(C,_,new Map(v)),this.set(s,v),this._transitioning=this._transitionable.untransitioned(),this._transform=c,this.properties=new h.ad(C),this.scope=_}get state(){const s=this._transform,c="globe"===s.projection.name,_=h.ae(s.zoom),v=this.properties.get("range"),C=[.5,3];return{range:c?[h.af(C[0],v[0],_),h.af(C[1],v[1],_)]:v,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(s,c,_={}){if(this._validate(Qh,s,_))return;const v=h.l({},s);for(const C of Object.keys(h.a3.fog))void 0===v[C]&&(v[C]=h.a3.fog[C].default);this._options=v,this._transitionable.setTransitionOrValue(this._options,c)}getOpacity(s){if(!this._transform.projection.supportsFog)return 0;const c=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:h.ac(45,65,s))*c.a}getOpacityAtLatLng(s,c){return this._transform.projection.supportsFog?function(_,v,C){const D=h.aa.fromLngLat(v),O=C.elevation?C.elevation.getAtPointOrZero(D):0;return We(_,D.x,D.y,O,C)}(this.state,s,c):0}getOpacityForTile(s){if(!this._transform.projection.supportsFog)return[1,1];const c=this._transform.calculateFogTileMatrix(s.toUnwrapped());return it(this.state,c,0,0,h.ag,h.ag,this._transform)}getOpacityForBounds(s,c,_,v,C){return this._transform.projection.supportsFog?it(this.state,s,c,_,v,C,this._transform):[1,1]}getFovAdjustedRange(s){return this._transform.projection.supportsFog?Ee(this.state,s):[0,1]}isVisibleOnFrustum(s){if(!this._transform.projection.supportsFog)return!1;const c=[4,5,6,7];for(const _ of c){const v=s.points[_];let C;if(v[2]>=0)C=v;else{const D=s.points[_-4];C=h.ah(D,v,D[2]/(D[2]-v[2]))}if(We(this.state,C[0],C[1],0,this._transform)>=Oe)return!0}return!1}updateConfig(s){this._transitionable.setTransitionOrValue(this._options,new Map(s))}updateTransitions(s){this._transitioning=this._transitionable.transitioned(s,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(s){this.properties=this._transitioning.possiblyEvaluate(s)}_validate(s,c,_){return(!_||!1!==_.validate)&&za(this,s.call(Vs,h.l({value:c,style:{glyphs:!0,sprite:!0},styleSpec:h.a3})))}}let ot,St,on,kt,Zn=class extends h.E{constructor(f,s,c,_){super();const v=ot||(ot=new h.a5({density:new h.a6(h.a3.snow.density),intensity:new h.a6(h.a3.snow.intensity),color:new h.a6(h.a3.snow.color),opacity:new h.a6(h.a3.snow.opacity),vignette:new h.a6(h.a3.snow.vignette),"vignette-color":new h.a6(h.a3.snow["vignette-color"]),"center-thinning":new h.a6(h.a3.snow["center-thinning"]),direction:new h.a6(h.a3.snow.direction),"flake-size":new h.a6(h.a3.snow["flake-size"])}));this._transitionable=new h.a4(v,c,new Map(_)),this.set(f,_),this._transitioning=this._transitionable.untransitioned(),this.properties=new h.ad(v),this.scope=c}get state(){const f=this.properties.get("opacity"),s=this.properties.get("color"),c=this.properties.get("direction"),_=h.ai(c[0]),v=-Math.max(h.ai(c[1]),.01),C=[Math.cos(_)*Math.cos(v),Math.sin(_)*Math.cos(v),Math.sin(v)],D=this.properties.get("vignette"),O=this.properties.get("vignette-color");return O.a=D,{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new h.aj(s.r,s.g,s.b,s.a*f),direction:C,centerThinning:this.properties.get("center-thinning"),flakeSize:this.properties.get("flake-size"),vignetteColor:O}}get(){return this._transitionable.serialize()}set(f,s,c={}){if(this._validate(Fc,f,c))return;const _=h.l({},f);for(const v of Object.keys(h.a3.snow))void 0===_[v]&&(_[v]=h.a3.snow[v].default);this._options=_,this._transitionable.setTransitionOrValue(this._options,s)}updateConfig(f){this._transitionable.setTransitionOrValue(this._options,new Map(f))}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}_validate(f,s,c){return(!c||!1!==c.validate)&&za(this,f.call(Vs,h.l({value:s,style:{glyphs:!0,sprite:!0},styleSpec:h.a3})))}},ni=class extends h.E{constructor(f,s,c,_){super();const v=St||(St=new h.a5({density:new h.a6(h.a3.rain.density),intensity:new h.a6(h.a3.rain.intensity),color:new h.a6(h.a3.rain.color),opacity:new h.a6(h.a3.rain.opacity),vignette:new h.a6(h.a3.rain.vignette),"vignette-color":new h.a6(h.a3.rain["vignette-color"]),"center-thinning":new h.a6(h.a3.rain["center-thinning"]),direction:new h.a6(h.a3.rain.direction),"droplet-size":new h.a6(h.a3.rain["droplet-size"]),"distortion-strength":new h.a6(h.a3.rain["distortion-strength"])}));this._transitionable=new h.a4(v,c,new Map(_)),this.set(f,_),this._transitioning=this._transitionable.untransitioned(),this.properties=new h.ad(v),this.scope=c}get state(){const f=this.properties.get("opacity"),s=this.properties.get("color"),c=this.properties.get("direction"),_=h.ai(c[0]),v=-Math.max(h.ai(c[1]),.01),C=[Math.cos(_)*Math.cos(v),Math.sin(_)*Math.cos(v),Math.sin(v)],D=this.properties.get("vignette-color");return D.a=this.properties.get("vignette"),{density:this.properties.get("density"),intensity:this.properties.get("intensity"),color:new h.aj(s.r,s.g,s.b,s.a*f),direction:C,centerThinning:this.properties.get("center-thinning"),dropletSize:this.properties.get("droplet-size"),distortionStrength:this.properties.get("distortion-strength"),vignetteColor:D}}get(){return this._transitionable.serialize()}set(f,s,c={}){if(this._validate(om,f,c))return;const _=h.l({},f);for(const v of Object.keys(h.a3.rain))void 0===_[v]&&(_[v]=h.a3.rain[v].default);this._options=_,this._transitionable.setTransitionOrValue(this._options,s)}updateConfig(f){this._transitionable.setTransitionOrValue(this._options,new Map(f))}updateTransitions(f){this._transitioning=this._transitionable.transitioned(f,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(f){this.properties=this._transitioning.possiblyEvaluate(f)}_validate(f,s,c){return(!c||!1!==c.validate)&&za(this,f.call(Vs,h.l({value:s,style:{glyphs:!0,sprite:!0},styleSpec:h.a3})))}};class ct extends h.E{constructor(s,c,_,v){super(),this.scope=_,this._options=s,this.properties=new h.ad(c),this._transitionable=new h.a4(c,_,new Map(v)),this._transitionable.setTransitionOrValue(s.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(s){this._transitionable.setTransitionOrValue(this._options.properties,new Map(s))}updateTransitions(s){this._transitioning=this._transitionable.transitioned(s,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(s){this.properties=this._transitioning.possiblyEvaluate(s)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(s,c){this._options=s,this._transitionable.setTransitionOrValue(s.properties,c)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}class ii{constructor(s,c,_,v){this.screenBounds=s,this.cameraPoint=c,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=_,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,v)}static createFromScreenPoints(s,c){let _,v;if(s instanceof h.P||"number"==typeof s[0]){const C=h.P.convert(s);_=[C],v=c.isPointAboveHorizon(C)}else{const C=h.P.convert(s[0]),D=h.P.convert(s[1]);_=[C,D],v=h.al(C,D).every(O=>c.isPointAboveHorizon(O))}return new ii(_,c.getCameraPoint(),v,c)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(s){return h.al(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],s)}bufferedCameraGeometry(s){const c=this.screenBounds[0],_=1===this.screenBounds.length?this.screenBounds[0].add(new h.P(1,1)):this.screenBounds[1],v=h.al(c,_,0,!1);return this.cameraPoint.y>_.y&&(this.cameraPoint.x>c.x&&this.cameraPoint.x<_.x?v.splice(3,0,this.cameraPoint):this.cameraPoint.x>=_.x?v[2]=this.cameraPoint:this.cameraPoint.x<=c.x&&(v[3]=this.cameraPoint)),h.am(v,s)}bufferedCameraGeometryGlobe(s){const c=this.screenBounds[0],_=1===this.screenBounds.length?this.screenBounds[0].add(new h.P(1,1)):this.screenBounds[1],v=h.al(c,_,s),C=this.cameraPoint.clone();switch(3*((C.y>c.y)+(C.y>_.y))+((C.x>c.x)+(C.x>_.x))){case 0:v[0]=C,v[4]=C.clone();break;case 1:v.splice(1,0,C);break;case 2:v[1]=C;break;case 3:v.splice(4,0,C);break;case 5:v.splice(2,0,C);break;case 6:v[3]=C;break;case 7:v.splice(3,0,C);break;case 8:v[2]=C}return v}containsTile(s,c,_,v=0){const C=s.queryPadding/c._pixelsPerMercatorPixel+1,D=_?this._bufferedCameraMercator(C,c):this._bufferedScreenMercator(C,c);let O=s.tileID.wrap+(D.unwrapped?v:0);const B=D.polygon.map(ce=>h.an(s.tileTransform,ce,O));if(!h.ao(B,0,0,h.ag,h.ag))return;O=s.tileID.wrap+(this.screenGeometryMercator.unwrapped?v:0);const U=this.screenGeometryMercator.polygon.map(ce=>h.ap(s.tileTransform,ce,O)),H=U.map(ce=>new h.P(ce[0],ce[1])),G=c.getFreeCameraOptions().position||new h.aa(0,0,0),W=h.ap(s.tileTransform,G,O),Q=U.map(ce=>{const de=h.ab.vec3.sub(ce,ce,W);return h.ab.vec3.normalize(de,de),new h.aq(W,de)}),ae=h.ar(s,1,c.zoom)*c._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:H,tilespaceRays:Q,bufferedTilespaceGeometry:B,bufferedTilespaceBounds:(ie=h.as(B),ie.min.x=h.aw(ie.min.x,0,h.ag),ie.min.y=h.aw(ie.min.y,0,h.ag),ie.max.x=h.aw(ie.max.x,0,h.ag),ie.max.y=h.aw(ie.max.y,0,h.ag),ie),tile:s,tileID:s.tileID,pixelToTileUnitsFactor:ae};var ie}_bufferedScreenMercator(s,c){const _=Di(s);if(this._screenRaycastCache[_])return this._screenRaycastCache[_];{let v;return v="globe"===c.projection.name?this._projectAndResample(this.bufferedScreenGeometry(s),c):{polygon:this.bufferedScreenGeometry(s).map(C=>c.pointCoordinate3D(C)),unwrapped:!0},this._screenRaycastCache[_]=v,v}}_bufferedCameraMercator(s,c){const _=Di(s);if(this._cameraRaycastCache[_])return this._cameraRaycastCache[_];{let v;return v="globe"===c.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(s),c):{polygon:this.bufferedCameraGeometry(s).map(C=>c.pointCoordinate3D(C)),unwrapped:!0},this._cameraRaycastCache[_]=v,v}}_projectAndResample(s,c){const _=function(C,D){const O=h.ab.mat4.multiply([],D.pixelMatrix,D.globeMatrix),B=[0,-h.ax,0,1],U=[0,h.ax,0,1],H=[0,0,0,1];h.ab.vec4.transformMat4(B,B,O),h.ab.vec4.transformMat4(U,U,O),h.ab.vec4.transformMat4(H,H,O);const G=new h.P(B[0]/B[3],B[1]/B[3]),W=new h.P(U[0]/U[3],U[1]/U[3]),Q=h.au(C,G)&&B[3]1?Mi(C.slice(0,ce),D):[],De=cenew h.P(Ai(Pe.x),Pe.y)),De=De.map(Pe=>new h.P(Ai(Pe.x),Pe.y));const Te=[...be];0===Te.length&&Te.push(De[De.length-1]);const Le=h.af(Te[Te.length-1].y,(0===De.length?be[0]:De[0]).y,de);let Me;return Me=Q?[new h.P(0,Le),new h.P(0,0),new h.P(1,0),new h.P(1,Le)]:[new h.P(1,Le),new h.P(1,1),new h.P(0,1),new h.P(0,Le)],Te.push(...Me),0===De.length?Te.push(be[0]):Te.push(...De),{polygon:Te.map(Pe=>new h.aa(Pe.x,Pe.y)),unwrapped:!1}}(s,c);if(_)return _;const v=function(C,D){let O=!1,B=-1/0,U=0;for(let G=0;GB&&(B=C[G].x,U=G);for(let G=0;G.5&&(Q.x{G.x-=1}),{polygon:C,unwrapped:O}}(Mi(s,c).map(C=>new h.P(Ai(C.x),C.y)),c);return{polygon:v.polygon.map(C=>new h.aa(C.x,C.y)),unwrapped:v.unwrapped}}}function Mi(f,s){return h.av(f,c=>{const _=s.pointCoordinate3D(c);c.x=_.x,c.y=_.y},1/256)}function Ai(f){return f<0?1+f%1:f%1}function Di(f){return 100*f|0}function Wi(f,s,c,_,v){const C=function(O,B){if(O)return v(O);if(B){if(f.url&&B.tiles&&f.tiles&&delete f.tiles,B.variants){if(!Array.isArray(B.variants))return v(new Error("variants must be an array"));for(const H of B.variants){if(null==H||"object"!=typeof H||H.constructor!==Object)return v(new Error("variant must be an object"));if(!Array.isArray(H.capabilities))return v(new Error("capabilities must be an array"));if(1===H.capabilities.length&&"meshopt"===H.capabilities[0]){B=h.l(B,H);break}}}const U=h.ay(h.l({},B,f),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding","vector_layers","raster_layers","worldview_options","worldview_default","worldview"]);U.tiles=s.canonicalizeTileset(U,f.url),v(null,U)}},D=function(O,B,U){if(!O)return null;if(!B&&!U)return O;U=U||O.worldview_default;const H=Object.values(O.language||{});if(0===H.length)return null;const G=Object.values(O.worldview||{});if(0===G.length)return null;const W=H.every(ae=>ae===B),Q=G.every(ae=>ae===U);return W&&Q?O:B in(O.language_options||{})||U in(O.worldview_options||{})?null:O.language_options&&O.worldview_options?O:null}(f.data,c,_);return D?h.q.frame(()=>C(null,D)):f.url?h.n(s.transformRequest(s.normalizeSourceURL(f.url,null,c,_),h.R.Source),C):h.q.frame(()=>{const{data:O,...B}=f;C(null,B)})}class Hi{constructor(s,c,_){this.bounds=h.az.convert(this.validateBounds(s)),this.minzoom=c||0,this.maxzoom=_||24}validateBounds(s){return Array.isArray(s)&&4===s.length?[Math.max(-180,s[0]),Math.max(-90,s[1]),Math.min(180,s[2]),Math.min(90,s[3])]:[-180,-90,180,90]}contains(s){const c=Math.pow(2,s.z),_=Math.floor(h.at(this.bounds.getWest())*c),v=Math.floor(h.aA(this.bounds.getNorth())*c),C=Math.ceil(h.at(this.bounds.getEast())*c),D=Math.ceil(h.aA(this.bounds.getSouth())*c);return s.x>=_&&s.x=v&&s.y{if(this._tileJSONRequest=null,this._loaded=!0,v)c&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${c}`),_&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${_}`),this.fire(new h.y(v));else if(C){if(h.l(this,C),this.hasWorldviews=!!C.worldview_options,C.worldview_default&&(this.worldviewDefault=C.worldview_default),C.vector_layers){this.vectorLayers=C.vector_layers,this.vectorLayerIds=[],this.localizableLayerIds=new Set;for(const D of C.vector_layers)this.vectorLayerIds.push(D.id),C.worldview&&C.worldview[D.source]&&this.localizableLayerIds.add(D.id)}C.bounds&&(this.tileBounds=new Hi(C.bounds,this.minzoom,this.maxzoom)),Vl(C.tiles,this.map._requestManager._customAccessToken),this.fire(new h.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.z("data",{dataType:"source",sourceDataType:"content"}))}s&&s(v)})}loaded(){return this._loaded}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}onAdd(s){this.map=s,this.load()}reload(){this.cancelTileJSONRequest();const s=h.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(s))}setTiles(s){return this._options.tiles=s,this.reload(),this}setUrl(s){return this.url=s,this._options.url=s,this.reload(),this}onRemove(s){this.cancelTileJSONRequest()}serialize(){return h.l({},this._options)}loadTile(s,c){const _=s.tileID.canonical.url(this.tiles,this.scheme),v=this.map._requestManager.normalizeTileURL(_),C=this.map._requestManager.transformRequest(v,h.R.Tile),D=this.map.style?this.map.style.getLut(this.scope):null,O=D?{image:D.image.clone()}:null,B={request:C,data:void 0,uid:s.uid,tileID:s.tileID,tileZoom:s.tileZoom,zoom:s.tileID.overscaledZ,maxZoom:this.maxzoom,lut:O,tileSize:this.tileSize*s.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:h.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:s.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:s.isExtraShadowCaster,tessellationStep:this.map._tessellationStep,scaleFactor:this.map.getScaleFactor()};if(this.hasWorldviews&&h.f(_)&&(B.worldview=this.map.getWorldview()||this.worldviewDefault,B.localizableLayerIds=this.localizableLayerIds),B.request.collectResourceTiming=this._collectResourceTiming,s.actor&&"expired"!==s.state)"loading"===s.state?s.reloadCallback=c:s.request=s.actor.send("reloadTile",B,U.bind(this));else if(s.actor=this._tileWorkers[v]=this._tileWorkers[v]||this.dispatcher.getActor(),this.dispatcher.ready)s.request=s.actor.send("loadTile",B,U.bind(this),void 0,!0);else{const H=h.aD.call({deduped:this._deduped},B,(G,W)=>{G||!W?U.call(this,G):(B.data={cacheControl:W.cacheControl,expires:W.expires,rawData:W.rawData.slice(0)},s.actor&&s.actor.send("loadTile",B,U.bind(this),void 0,!0))},!0);s.request={cancel:H}}function U(H,G){return delete s.request,s.aborted?c(null):H&&404!==H.status?c(H):(G&&G.resourceTiming&&(s.resourceTiming=G.resourceTiming),this.map._refreshExpiredTiles&&G&&s.setExpiryData(G),s.loadVectorData(G,this.map.painter),h.aE(this.dispatcher),c(null),void(s.reloadCallback&&(this.loadTile(s,s.reloadCallback),s.reloadCallback=null)))}}abortTile(s){s.request&&(s.request.cancel(),delete s.request),s.actor&&s.actor.send("abortTile",{uid:s.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(s,c){s.actor&&s.actor.send("removeTile",{uid:s.uid,type:this.type,source:this.id,scope:this.scope}),s.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class qr extends h.E{constructor(s,c,_,v){super(),this.id=s,this.dispatcher=_,this.setEventedParent(v),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.l({type:"raster"},c),h.l(this,h.ay(c,["url","scheme","tileSize"]))}load(s){this._loaded=!1,this.fire(new h.z("dataloading",{dataType:"source"})),this._tileJSONRequest=Wi(this._options,this.map._requestManager,null,null,(c,_)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new h.y(c)):_&&(h.l(this,_),_.raster_layers&&(this.rasterLayers=_.raster_layers,this.rasterLayerIds=this.rasterLayers.map(v=>v.id)),_.bounds&&(this.tileBounds=new Hi(_.bounds,this.minzoom,this.maxzoom)),Vl(_.tiles),this.fire(new h.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.z("data",{dataType:"source",sourceDataType:"content"}))),s&&s(c)})}loaded(){return this._loaded}onAdd(s){this.map=s,this.load()}reload(){this.cancelTileJSONRequest();const s=h.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(s))}setTiles(s){return this._options.tiles=s,this.reload(),this}setUrl(s){return this.url=s,this._options.url=s,this.reload(),this}onRemove(s){this.cancelTileJSONRequest()}serialize(){return h.l({},this._options)}hasTile(s){return!this.tileBounds||this.tileBounds.contains(s.canonical)}loadTile(s,c){const _=h.q.devicePixelRatio>=2,v=this.map._requestManager.normalizeTileURL(s.tileID.canonical.url(this.tiles,this.scheme),_,this.tileSize);s.request=h.o(this.map._requestManager.transformRequest(v,h.R.Tile),(C,D,O,B)=>(delete s.request,s.aborted?(s.state="unloaded",c(null)):C?(s.state="errored",c(C)):D?(this.map._refreshExpiredTiles&&s.setExpiryData({cacheControl:O,expires:B}),s.setTexture(D,this.map.painter),s.state="loaded",h.aE(this.dispatcher),void c(null)):c(null)))}abortTile(s,c){s.request&&(s.request.cancel(),delete s.request),c&&c()}unloadTile(s,c){s.texture&&s.texture instanceof h.T?(s.destroy(!0),s.texture&&s.texture instanceof h.T&&this.map.painter.saveTileTexture(s.texture)):s.destroy(),c&&c()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Zo extends qr{constructor(s,c,_,v){super(s,c,_,v),this.type="raster-array",this.maxzoom=22,this._options=h.l({type:"raster-array"},c)}triggerRepaint(s){const c=this.map.painter._terrain,_=this.map.style.getSourceCache(this.id);c&&c.enabled&&_&&c._clearRenderCacheForTile(_.id,s.tileID),this.map.triggerRepaint()}loadTile(s,c){const _=this.map._requestManager.normalizeTileURL(s.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),v=this.map._requestManager.transformRequest(_,h.R.Tile);s.requestParams=v,s.actor||(s.actor=this.dispatcher.getActor()),s.request=s.fetchHeader(void 0,(C,D,O,B)=>(delete s.request,s.aborted?(s.state="unloaded",c(null)):C?20===C.code?void 0:(s.state="errored",c(C)):(this.map._refreshExpiredTiles&&s.setExpiryData({cacheControl:O,expires:B}),s.state="empty",void c(null))))}unloadTile(s,c){const _=s.texture;_&&_ instanceof h.T?(s.destroy(!0),this.map.painter.saveTileTexture(_)):(s.destroy(),s.flushQueues(),s._isHeaderLoaded=!1,delete s._mrt,delete s.textureDescriptor),s.fbo&&(s.fbo.destroy(),delete s.fbo),delete s.request,delete s.requestParams,delete s.neighboringTiles,s.state="unloaded"}prepareTile(s,c,_){s._isHeaderLoaded&&("empty"!==s.state&&(s.state="reloading"),s.fetchBand(c,_,(v,C)=>{if(v)return s.state="errored",this.fire(new h.y(v)),void this.triggerRepaint(s);C&&(s.setTexture(C,this.map.painter),s.state="loaded",this.triggerRepaint(s))}))}getInitialBand(s){if(!this.rasterLayers)return 0;const c=this.rasterLayers.find(({id:C})=>C===s),_=c&&c.fields,v=_&&_.bands&&_.bands;return v?v[0]:0}getTextureDescriptor(s,c,_){if(!s)return;const v=c.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!v)return;let C=null;c instanceof h.aH?C=c.paint.get("raster-array-band"):c instanceof h.aI&&(C=c.paint.get("raster-particle-array-band"));const D=C||this.getInitialBand(v);if(null!=D)if(s.textureDescriptor){if(!s.updateNeeded(v,D)||_)return Object.assign({},s.textureDescriptor,{texture:s.texture})}else this.prepareTile(s,v,D)}}const Tr={vector:Go,raster:qr,"raster-dem":class extends qr{constructor(f,s,c,_){super(f,s,c,_),this.type="raster-dem",this.maxzoom=22,this._options=h.l({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}loadTile(f,s){const c=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function _(v,C){v&&(f.state="errored",s(v)),C&&(f.dem=C,f.dem.onDeserialize(),f.needsHillshadePrepare=!0,f.needsDEMTextureUpload=!0,f.state="loaded",s(null))}f.request=h.o(this.map._requestManager.transformRequest(c,h.R.Tile),function(v,C,D,O){if(delete f.request,f.aborted)f.state="unloaded",s(null);else if(v)f.state="errored",s(v);else if(C){this.map._refreshExpiredTiles&&f.setExpiryData({cacheControl:D,expires:O});const B=ImageBitmap&&C instanceof ImageBitmap&&h.t(),U=1-(C.width-h.aF(C.width))/2;U<1||f.neighboringTiles||(f.neighboringTiles=this._getNeighboringTiles(f.tileID));const H=B?C:h.q.getImageData(C,U),G={uid:f.uid,coord:f.tileID,source:this.id,scope:this.scope,rawImageData:H,encoding:this.encoding,padding:U};f.actor&&"expired"!==f.state||(f.actor=this.dispatcher.getActor(),f.actor.send("loadDEMTile",G,_.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(f){const s=f.canonical,c=Math.pow(2,s.z),_=(s.x-1+c)%c,v=0===s.x?f.wrap-1:f.wrap,C=(s.x+1+c)%c,D=s.x+1===c?f.wrap+1:f.wrap,O={};return O[new h.aG(f.overscaledZ,v,s.z,_,s.y).key]={backfilled:!1},O[new h.aG(f.overscaledZ,D,s.z,C,s.y).key]={backfilled:!1},s.y>0&&(O[new h.aG(f.overscaledZ,v,s.z,_,s.y-1).key]={backfilled:!1},O[new h.aG(f.overscaledZ,f.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},O[new h.aG(f.overscaledZ,D,s.z,C,s.y-1).key]={backfilled:!1}),s.y+1{if(this._loaded=!0,this._pendingLoad=null,_)this.fire(new h.y(_));else{const C={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&v&&v.resourceTiming&&v.resourceTiming[this.id]&&(C.resourceTiming=v.resourceTiming[this.id]),f&&(this._partialReload=!0),this.fire(new h.z("data",C)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(f),this._coalesce=!1)})}loaded(){return this._loaded}reload(){const f=h.aC(this.id,this.scope);this.map.style.clearSource(f),this._updateWorkerData()}loadTile(f,s){const c=f.actor?"reloadTile":"loadTile";f.actor=this.actor;const _=this.map.style?this.map.style.getLut(this.scope):null,v=_?{image:_.image.clone()}:null,C=this._partialReload,D={type:this.type,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:v,scope:this.scope,pixelRatio:h.q.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,scaleFactor:this.map.getScaleFactor(),partial:C};f.request=this.actor.send(c,D,(O,B)=>C&&!B?(f.state="loaded",s(null)):(delete f.request,f.destroy(),f.aborted?s(null):O?s(O):(f.loadVectorData(B,this.map.painter,"reloadTile"===c),s(null))),void 0,"loadTile"===c)}abortTile(f){f.request&&(f.request.cancel(),delete f.request),f.aborted=!0}unloadTile(f,s){this.actor.send("removeTile",{uid:f.uid,type:this.type,source:this.id,scope:this.scope}),f.destroy()}onRemove(f){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return h.l({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends h.aJ{constructor(f,s,c,_){super(f,s,c,_),this.roundZoom=!0,this.type="video",this.options=s}load(){this._loaded=!1;const f=this.options;this.urls=[];for(const s of f.urls)this.urls.push(this.map._requestManager.transformRequest(s,h.R.Source).url);h.aK(this.urls,(s,c)=>{this._loaded=!0,s?this.fire(new h.y(s)):c&&(this.video=c,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(f){if(this.video){const s=this.video.seekable;fs.end(0)?this.fire(new h.y(new h.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${s.start(0)} and ${s.end(0)}-second mark.`))):this.video.currentTime=f}}getVideo(){return this.video}onAdd(f){this.map||(this.map=f,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const f=this.map.painter.context,s=f.gl;this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new h.T(f,this.video,s.RGBA8),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(f)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:h.aJ,model:class extends h.E{constructor(f,s,c,_){super(),this.id=f,this.type="model",this.models=[],this._loaded=!1,this._options=s}load(){const f=[];for(const s in this._options.models){const c=this._options.models[s],_=h.aM(this.map._requestManager.transformRequest(c.uri,h.R.Model).url).then(v=>{if(!v)return;const C=h.aN(v),D=new h.aO(s,c.position,c.orientation,C);D.computeBoundsAndApplyParent(),this.models.push(D)}).catch(v=>{this.fire(new h.y(new Error(`Could not load model ${s} from ${c.uri}: ${v.message}`)))});f.push(_)}return Promise.allSettled(f).then(()=>{this._loaded=!0,this.fire(new h.z("data",{dataType:"source",sourceDataType:"metadata"}))}).catch(s=>{this.fire(new h.y(new Error(`Could not load models: ${s.message}`)))})}onAdd(f){this.map=f,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(f,s){}serialize(){return{type:"model"}}},"batched-model":class extends h.E{constructor(f,s,c,_){super(),this.type="batched-model",this.id=f,this.tileSize=512,this._options=s,this.tiles=this._options.tiles,this.maxzoom=s.maxzoom||19,this.minzoom=s.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=c,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(_)}onAdd(f){this.map=f,this.load()}reload(){this.cancelTileJSONRequest();const f=h.aC(this.id,this.scope);this.load(()=>this.map.style.clearSource(f))}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}load(f){this._loaded=!1,this.fire(new h.z("dataloading",{dataType:"source"}));const s=Array.isArray(this.map._language)?this.map._language.join():this.map._language,c=this.map.getWorldview();this._tileJSONRequest=Wi(this._options,this.map._requestManager,s,c,(_,v)=>{this._tileJSONRequest=null,this._loaded=!0,_?(s&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${s}`),c&&2!==c.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${c}`),this.fire(new h.y(_))):v&&(h.l(this,v),v.bounds&&(this.tileBounds=new Hi(v.bounds,this.minzoom,this.maxzoom)),Vl(v.tiles,this.map._requestManager._customAccessToken),this.fire(new h.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.z("data",{dataType:"source",sourceDataType:"content"}))),f&&f(_)})}hasTransition(){return!1}hasTile(f){return!this.tileBounds||this.tileBounds.contains(f.canonical)}loaded(){return this._loaded}loadTile(f,s){const c=this.map._requestManager.normalizeTileURL(f.tileID.canonical.url(this.tiles,this.scheme)),_={request:this.map._requestManager.transformRequest(c,h.R.Tile),data:void 0,uid:f.uid,tileID:f.tileID,tileZoom:f.tileZoom,zoom:f.tileID.overscaledZ,tileSize:this.tileSize*f.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:f.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,lut:null,maxZoom:null,promoteId:null,pixelRatio:null,scaleFactor:null};if(f.actor&&"expired"!==f.state)if("loading"===f.state)f.reloadCallback=s;else{if(f.buckets){const C=Object.values(f.buckets);for(const D of C)D.dirty=!0;return void(f.state="loaded")}f.request=f.actor.send("reloadTile",_,v.bind(this))}else f.actor=this.dispatcher.getActor(),f.request=f.actor.send("loadTile",_,v.bind(this),void 0,!0);function v(C,D){return f.aborted?s(null):C&&404!==C.status?s(C):(this.map._refreshExpiredTiles&&D&&f.setExpiryData(D),f.loadModelData(D,this.map.painter),f.state="loaded",void s(null))}}serialize(){return h.l({},this._options)}},canvas:class extends h.aJ{constructor(f,s,c,_){super(f,s,c,_),s.coordinates?Array.isArray(s.coordinates)&&4===s.coordinates.length&&!s.coordinates.some(v=>!Array.isArray(v)||2!==v.length||v.some(C=>"number"!=typeof C))||this.fire(new h.y(new h.V(`sources.${f}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.y(new h.V(`sources.${f}`,null,'missing required property "coordinates"'))),s.animate&&"boolean"!=typeof s.animate&&this.fire(new h.y(new h.V(`sources.${f}`,null,'optional "animate" property must be a boolean value'))),s.canvas?"string"==typeof s.canvas||s.canvas instanceof HTMLCanvasElement||this.fire(new h.y(new h.V(`sources.${f}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.y(new h.V(`sources.${f}`,null,'missing required property "canvas"'))),this.options=s,this.animate=void 0===s.animate||s.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new h.y(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(f){this.map=f,this.load(),this.canvas&&this.animate&&this.play()}onRemove(f){this.pause()}prepare(){let f=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,f=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,f=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;const s=this.map.painter.context;this.texture?!f&&!this._playing||this.texture instanceof h.aL||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new h.T(s,this.canvas,s.gl.RGBA8,{premultiply:!0}),this._prepareData(s)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const f of[this.canvas.width,this.canvas.height])if(isNaN(f)||f<=0)return!0;return!1}},custom:class extends h.E{constructor(f,s,c,_){super(),this.id=f,this.type="custom",this._dataType="raster",this._dispatcher=c,this._implementation=s,this.setEventedParent(_),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new h.y(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new h.y(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Hi(this._implementation.bounds,this.minzoom,this.maxzoom)),s.update=this._update.bind(this),s.clearTiles=this._clearTiles.bind(this),s.coveringTiles=this._coveringTiles.bind(this),h.l(this,h.ay(s,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return h.ay(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new h.z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.z("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(f){this.map=f,this._loaded=!1,this.fire(new h.z("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(f),this.load()}onRemove(f){this._implementation.onRemove&&this._implementation.onRemove(f)}hasTile(f){if(this._implementation.hasTile){const{x:s,y:c,z:_}=f.canonical;return this._implementation.hasTile({x:s,y:c,z:_})}return!this.tileBounds||this.tileBounds.contains(f.canonical)}loadTile(f,s){const{x:c,y:_,z:v}=f.tileID.canonical,C=new AbortController;f.request=Promise.resolve(this._implementation.loadTile({x:c,y:_,z:v},{signal:C.signal})).then(function(D){return delete f.request,f.aborted?(f.state="unloaded",s(null)):void 0===D?(f.state="errored",s(null)):null===D?(this.loadTileData(f,{width:this.tileSize,height:this.tileSize,data:null}),f.state="loaded",s(null)):(O=D)instanceof ImageData||O instanceof HTMLCanvasElement||O instanceof ImageBitmap||O instanceof HTMLImageElement?(this.loadTileData(f,D),f.state="loaded",void s(null)):(f.state="errored",s(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)));var O}.bind(this)).catch(D=>{20!==D.code&&(f.state="errored",s(D))}),f.request.cancel=()=>C.abort()}loadTileData(f,s){f.setTexture(s,this.map.painter)}unloadTile(f,s){if(f.texture&&f.texture instanceof h.T?(f.destroy(!0),f.texture&&f.texture instanceof h.T&&this.map.painter.saveTileTexture(f.texture)):f.destroy(),this._implementation.unloadTile){const{x:c,y:_,z:v}=f.tileID.canonical;this._implementation.unloadTile({x:c,y:_,z:v})}s&&s()}abortTile(f,s){f.request&&f.request.cancel&&(f.request.cancel(),delete f.request),s&&s()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map(f=>({x:f.canonical.x,y:f.canonical.y,z:f.canonical.z}))}_clearTiles(){const f=h.aC(this.id,this.scope);this.map.style.clearSource(f)}_update(){this.fire(new h.z("data",{dataType:"source",sourceDataType:"content"}))}}},ss=function(f,s,c,_){const v=new Tr[s.type](f,s,c,_);if(v.id!==f)throw new Error(`Expected Source id to be ${f} instead of ${v.id}`);return h.aP(["load","abort","unload","serialize","prepare"],v),v};function Nc(f,s,c=""){return`${c}:${s.id||""}:${s.layer.id}:${function(_){if("layerId"in _)return`layer:${_.layerId}`;{const{featuresetId:v,importId:C}=_;return`featureset:${v}${C?`:import:${C}`:""}`}}(f.target)}`}function Wr(f,s,c,_=""){if(f.uniqueFeatureID){const v=Nc(f,s,_);if(c.has(v))return!0;c.add(v)}return!1}function Iu(f,s,c,_,v=!1){const C=s.sourceCache.transform,D=s.sourceCache.tilesIn(f,s.has3DLayers,v);D.sort(rm);const O=[];for(const B of D){const U=B.tile.queryRenderedFeatures(s,B,c,_,C,v);Object.keys(U).length&&O.push({wrappedTileID:B.tile.tileID.wrapped().key,queryResults:U})}return 0===O.length?{}:function(B){const U={},H={};for(const G of B){const W=G.queryResults,Q=G.wrappedTileID,ae=H[Q]=H[Q]||{};for(const ie in W){const ce=W[ie],de=ae[ie]=ae[ie]||{},be=U[ie]=U[ie]||[];for(const De of ce)de[De.featureIndex]||(de[De.featureIndex]=!0,be.push(De))}}return U}(O)}function Or(f,s,c,_,v){const C={},D=_.queryRenderedSymbols(f),O=[];for(const B of Object.keys(D).map(Number))O.push(v[B]);O.sort(rm);for(const B of O){const U=B.featureIndex.lookupSymbolFeatures(D[B.bucketInstanceId],B.bucketIndex,B.sourceLayerIndex,s,c);for(const H in U){const G=C[H]=C[H]||[],W=U[H];W.sort((Q,ae)=>{const ie=B.featureSortOrder;if(ie){const ce=ie.indexOf(Q.featureIndex);return ie.indexOf(ae.featureIndex)-ce}return ae.featureIndex-Q.featureIndex});for(const Q of W)G.push(Q)}}return C}function pf(f,s){const c=f.getRenderableIds().map(C=>f.getTileByID(C)),_=[],v={};for(let C=0;Cs.getLayer(C)).filter(Boolean);if(0!==v.length){_.layers=v,_.stateDependentLayerIds&&(_.stateDependentLayers=_.stateDependentLayerIds.map(C=>v.filter(D=>D.id===C)[0]));for(const C of v)c[C.fqid]=_}}return c}const mc=new Uint16Array(8184);for(let f=0;f<2046;f++){let s=f+2,c=0,_=0,v=0,C=0,D=0,O=0;for(1&s?v=C=D=32:c=_=O=32;(s>>=1)>1;){const U=c+v>>1,H=_+C>>1;1&s?(v=c,C=_,c=D,_=O):(c=v,_=C,v=D,C=O),D=U,O=H}const B=4*f;mc[B+0]=c,mc[B+1]=_,mc[B+2]=v,mc[B+3]=C}const zc=new Uint16Array(2178),jl=new Uint8Array(1089),lo=new Uint16Array(1089);function eo(f){return 0===f?-.03125:32===f?.03125:0}const dh={type:2,extent:h.ag,loadGeometry:()=>[[new h.P(0,0),new h.P(h.ag+1,0),new h.P(h.ag+1,h.ag+1),new h.P(0,h.ag+1),new h.P(0,0)]]};class Ie{constructor(s,c,_,v,C){this.tileID=s,this.uid=h.aV(),this.uses=0,this.tileSize=c,this.tileZoom=_,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=C,v&&v.style&&(this._lastUpdatedBrightness=v.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",v&&v.transform&&(this.projection=v.transform.projection)}registerFadeDuration(s){const c=s+this.timeAdded;c_)v=!1;else if(c)if(this.expirationTime0&&!c;ae&&!O.stateDependentLayers.length&&!c||O.update(W,H,v,Q,ae?O.stateDependentLayers:O.layers,c,C),(O instanceof h.b1||O instanceof h.b2)&&s._terrain&&s._terrain.enabled&&G&&O.programConfigurations.needsUpload&&s._terrain._clearRenderCacheForTile(G.id,this.tileID);const ie=s&&s.style&&s.style.getOwnLayer(D);ie&&(this.queryPadding=Math.max(this.queryPadding,ie.queryRadius(O)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil=0;ce--){const de=4*ce,be=mc[de+0],De=mc[de+1],Te=mc[de+2],Le=mc[de+3],Me=be+Te>>1,Pe=De+Le>>1,Ae=Me+Pe-De,Ve=Pe+be-Me,Ye=33*De+be,vt=33*Le+Te,Ke=33*Pe+Me,Mt=Math.hypot((zc[2*Ye+0]+zc[2*vt+0])/2-zc[2*Ke+0],(zc[2*Ye+1]+zc[2*vt+1])/2-zc[2*Ke+1])>=16;jl[Ke]=jl[Ke]||(Mt?1:0),ce<1022&&(jl[Ke]=jl[Ke]||jl[33*(De+Ve>>1)+(be+Ae>>1)]||jl[33*(Le+Ve>>1)+(Te+Ae>>1)])}const G=new h.aT,W=new h.aU;let Q=0;function ae(ce,de){const be=33*de+ce;return 0===lo[be]&&(G.emplaceBack(zc[2*be+0],zc[2*be+1],ce*h.ag/32,de*h.ag/32),lo[be]=++Q),lo[be]-1}function ie(ce,de,be,De,Te,Le){const Me=ce+be>>1,Pe=de+De>>1;if(Math.abs(ce-Te)+Math.abs(de-Le)>1&&jl[33*Pe+Me])ie(Te,Le,ce,de,Me,Pe),ie(be,De,Te,Le,Me,Pe);else{const Ae=ae(ce,de),Ve=ae(be,De),Ye=ae(Te,Le);W.emplaceBack(Ae,Ve,Ye)}}return ie(0,0,32,32,32,0),ie(32,32,0,0,0,32),{vertices:G,indices:W}}(this.tileID.canonical,c);v=D.vertices,C=D.indices}else{v=new h.aT,C=new h.aU;for(const{x:O,y:B}of _)v.emplaceBack(O,B,0,0);const D=h.b8(v.int16,void 0,4);for(let O=0;O0&&(B=h.ab.mat4.invert(new Float64Array(16),c.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(s,v,c,D,B,O),this._makeGlobeTileDebugTextBuffer(s,v,c,D,B,O)}_globePoint(s,c,_,v,C,D,O){let B=h.bc(s,c,_);if(D){const U=1<<_.z,H=h.at(v.center.lng),G=h.aA(v.center.lat),W=(_.x+.5)/U-H;let Q=0;W>.5?Q=-1:W<-.5&&(Q=1);let ae=(s/h.ag+_.x)/U+Q,ie=(c/h.ag+_.y)/U;ae=(ae-H)*v._pixelsPerMercatorPixel+H,ie=(ie-G)*v._pixelsPerMercatorPixel+G;const ce=[ae*v.worldSize,ie*v.worldSize,0];h.ab.vec3.transformMat4(ce,ce,D),B=h.bd(B,ce,O)}return h.ab.vec3.transformMat4(B,B,C)}_makeGlobeTileDebugBorderBuffer(s,c,_,v,C,D){const O=new h.b4,B=new h.b5,U=new h.be,H=(W,Q,ae,ie,ce)=>{const de=(ae-W)/(ce-1),be=(ie-Q)/(ce-1),De=O.length;for(let Te=0;TeG*Q+ae;for(let Q=0;Q{if(C)c(C);else try{const U=_.getHeaderLength(D);if(U>s)return void(this.request=this.fetchHeader(U,c));_.parseHeader(D),this._isHeaderLoaded=!0;let H=0;for(const G of Object.values(_.layers))H=Math.max(H,G.dataIndex[G.dataIndex.length-1].last_byte);D.byteLength>=H&&(this.entireBuffer=D),c(null,this.entireBuffer||D,O,B)}catch(U){c(U)}}),this.request}fetchBand(s,c,_){const v=this._mrt;if(!this._isHeaderLoaded||!v)return void _(new Error("Tile header is not ready"));const C=this.actor;if(!C)return void _(new Error("Can't fetch tile band without an actor"));let D;const O=(G,W)=>{D.complete(G,W),G?_(G):(this.updateTextureDescriptor(s,c),_(null,this.textureDescriptor&&this.textureDescriptor.img))},B=(G,W)=>{if(G)return _(G);const Q=C.send("decodeRasterArray",{buffer:W,task:D},O,void 0,!0);this._workQueue.push(()=>{Q&&Q.cancel(),D.cancel()})},U=v.getLayer(s);if(!U)return void _(new Error(`Unknown sourceLayer "${s}"`));if(U.hasDataForBand(c))return this.updateTextureDescriptor(s,c),void _(null,this.textureDescriptor?this.textureDescriptor.img:null);const H=U.getDataRange([c]);if(D=v.createDecodingTask(H),!D||D.tasks.length)if(this.flushQueues(),this.entireBuffer)B(null,this.entireBuffer.slice(H.firstByte,H.lastByte+1));else{const G=Object.assign({},this.requestParams,{headers:{Range:`bytes=${H.firstByte}-${H.lastByte}`}}),W=h.bi(G,B);this._fetchQueue.push(()=>{W.cancel(),D.cancel()})}else _(null)}updateNeeded(s,c){return(!this.textureDescriptor||this.textureDescriptor.band!==c||this.textureDescriptor.layer!==s)&&"errored"!==this.state}updateTextureDescriptor(s,c){if(!this._mrt)return;const _=this._mrt.getLayer(s);if(!_||!_.hasBand(c)||!_.hasDataForBand(c))return;const{bytes:v,tileSize:C,buffer:D,offset:O,scale:B}=_.getBandView(c),U=C+2*D,H={data:v,width:U,height:U},G=this.texture;G&&G instanceof h.T&&G.update(H,{premultiply:!1}),this.textureDescriptor={layer:s,band:c,img:H,buffer:D,offset:O,tileSize:C,format:_.pixelFormat,mix:[B,256*B,65536*B,16777216*B]}}}class ut{constructor(s,c){this.max=s,this.onRemove=c,this.reset()}reset(){for(const s in this.data)for(const c of this.data[s])c.timeout&&clearTimeout(c.timeout),this.onRemove(c.value);return this.data={},this.order=[],this}add(s,c,_){const v=s.wrapped().key;void 0===this.data[v]&&(this.data[v]=[]);const C={value:c,timeout:void 0};if(void 0!==_&&(C.timeout=setTimeout(()=>{this.remove(s,C)},_)),this.data[v].push(C),this.order.push(v),this.order.length>this.max){const D=this._getAndRemoveByKey(this.order[0]);D&&this.onRemove(D)}return this}has(s){return s.wrapped().key in this.data}getAndRemove(s){return this.has(s)?this._getAndRemoveByKey(s.wrapped().key):null}_getAndRemoveByKey(s){const c=this.data[s].shift();return c.timeout&&clearTimeout(c.timeout),0===this.data[s].length&&delete this.data[s],this.order.splice(this.order.indexOf(s),1),c.value}getByKey(s){const c=this.data[s];return c?c[0].value:null}get(s){return this.has(s)?this.data[s.wrapped().key][0].value:null}remove(s,c){if(!this.has(s))return this;const _=s.wrapped().key,v=void 0===c?0:this.data[_].indexOf(c),C=this.data[_][v];return this.data[_].splice(v,1),C.timeout&&clearTimeout(C.timeout),0===this.data[_].length&&delete this.data[_],this.onRemove(C.value),this.order.splice(this.order.indexOf(_),1),this}setMaxSize(s){for(this.max=s;this.order.length>this.max;){const c=this._getAndRemoveByKey(this.order[0]);c&&this.onRemove(c)}return this}filter(s){const c=[];for(const _ in this.data)for(const v of this.data[_])s(v.value)||c.push(v);for(const _ of c)this.remove(_.value.tileID,_)}}class Zt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(s,c,_){const v=String(c);if(this.stateChanges[s]=this.stateChanges[s]||{},this.stateChanges[s][v]=this.stateChanges[s][v]||{},h.l(this.stateChanges[s][v],_),null===this.deletedStates[s]){this.deletedStates[s]={};for(const C in this.state[s])C!==v&&(this.deletedStates[s][C]=null)}else if(this.deletedStates[s]&&null===this.deletedStates[s][v]){this.deletedStates[s][v]={};for(const C in this.state[s][v])_[C]||(this.deletedStates[s][v][C]=null)}else for(const C in _)this.deletedStates[s]&&this.deletedStates[s][v]&&null===this.deletedStates[s][v][C]&&delete this.deletedStates[s][v][C]}removeFeatureState(s,c,_){if(null===this.deletedStates[s])return;const v=String(c);if(this.deletedStates[s]=this.deletedStates[s]||{},_&&void 0!==c)null!==this.deletedStates[s][v]&&(this.deletedStates[s][v]=this.deletedStates[s][v]||{},this.deletedStates[s][v][_]=null);else if(void 0!==c)if(this.stateChanges[s]&&this.stateChanges[s][v])for(_ in this.deletedStates[s][v]={},this.stateChanges[s][v])this.deletedStates[s][v][_]=null;else this.deletedStates[s][v]=null;else this.deletedStates[s]=null}getState(s,c){const _=this.state[s]||{},v=this.stateChanges[s]||{},C=this.deletedStates[s];if(null===C)return{};if(void 0!==c){const O=String(c),B=h.l({},_[O],v[O]);if(C){const U=C[c];if(null===U)return{};for(const H in U)delete B[H]}return B}const D=h.l({},_,v);if(C)for(const O in C)delete D[O];return D}initializeTileState(s,c){s.refreshFeatureState(c)}coalesceChanges(s,c){const _={};for(const v in this.stateChanges){this.state[v]=this.state[v]||{};const C={};for(const D in this.stateChanges[v])this.state[v][D]||(this.state[v][D]={}),h.l(this.state[v][D],this.stateChanges[v][D]),C[D]=this.state[v][D];_[v]=C}for(const v in this.deletedStates){this.state[v]=this.state[v]||{};const C={};if(null===this.deletedStates[v])for(const D in this.state[v])C[D]={},this.state[v][D]={};else for(const D in this.deletedStates[v]){if(null===this.deletedStates[v][D])this.state[v][D]={};else if(this.state[v][D])for(const O of Object.keys(this.deletedStates[v][D]))delete this.state[v][D][O];C[D]=this.state[v][D]}_[v]=_[v]||{},h.l(_[v],C)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(_).length)for(const v in s)s[v].refreshFeatureState(c)}}class yn extends h.E{constructor(s,c,_){super(),this.id=s,this._onlySymbols=_,c.on("data",v=>{"source"===v.dataType&&"metadata"===v.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===v.dataType&&"content"===v.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))}),c.on("error",()=>{this._sourceErrored=!0}),this._source=c,this._tiles={},this._cache=new ut(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=c.minTileCacheSize,this._maxTileCacheSize=c.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Zt,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(s){this.map=s,this._minTileCacheSize=void 0===this._minTileCacheSize&&s?s._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&s?s._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const s in this._tiles){const c=this._tiles[s];if("loaded"!==c.state&&"errored"!==c.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const s=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,s&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(s,c){return s.isSymbolTile=this._onlySymbols,s.isExtraShadowCaster=this._shadowCasterTiles[s.tileID.key],this._source.loadTile(s,c)}_unloadTile(s){if(this._source.unloadTile)return this._source.unloadTile(s)}_abortTile(s){if(this._source.abortTile)return this._source.abortTile(s)}serialize(){return this._source.serialize()}prepare(s){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const c in this._tiles){const _=this._tiles[c];_.upload(s),_.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return h.bj(this._tiles).map(s=>s.tileID).sort(In).map(s=>s.key)}getRenderableIds(s,c){const _=[];for(const v in this._tiles)this._isIdRenderable(+v,s,c)&&_.push(this._tiles[v]);return s?_.sort((v,C)=>{const D=v.tileID,O=C.tileID,B=new h.P(D.canonical.x,D.canonical.y)._rotate(this.transform.angle),U=new h.P(O.canonical.x,O.canonical.y)._rotate(this.transform.angle);return D.overscaledZ-O.overscaledZ||U.y-B.y||U.x-B.x}).map(v=>v.tileID.key):_.map(v=>v.tileID).sort(In).map(v=>v.key)}hasRenderableParent(s){const c=this.findLoadedParent(s,0);return!!c&&this._isIdRenderable(c.tileID.key)}_isIdRenderable(s,c,_){return this._tiles[s]&&this._tiles[s].hasData()&&!this._coveredTiles[s]&&(c||!this._tiles[s].holdingForFade())&&(_||!this._shadowCasterTiles[s])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const s in this._tiles)"errored"!==this._tiles[s].state&&this._reloadTile(+s,"reloading")}}_reloadTile(s,c){const _=this._tiles[s];_&&("loading"!==_.state&&(_.state=c),this._loadTile(_,this._tileLoaded.bind(this,_,s,c)))}_tileLoaded(s,c,_,v){if(v)if(s.state="errored",404!==v.status)this._source.fire(new h.y(v,{tile:s}));else{if(this._source.fire(new h.z("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:s})),!(s.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const C=this.map.painter.terrain;this.update(this.transform,C.getScaledDemTileSize(),!0),C.resetTileLookupCache(this.id)}else this.update(this.transform)}else s.timeAdded=h.q.now(),"expired"===_&&(s.refreshedUponExpiration=!0),this._setTileReloadTimer(c,s),"raster-dem"===this._source.type&&s.dem&&this._backfillDEM(s),this._state.initializeTileState(s,this.map?this.map.painter:null),this._source.fire(new h.z("data",{dataType:"source",tile:s,coord:s.tileID,sourceCacheId:this.id}))}_backfillDEM(s){const c=this.getRenderableIds();for(let v=0;v1||(Math.abs(D)>1&&(1===Math.abs(D+B)?D+=B:1===Math.abs(D-B)&&(D-=B)),C.dem&&v.dem&&(v.dem.backfillBorder(C.dem,D,O),v.neighboringTiles&&v.neighboringTiles[U]&&(v.neighboringTiles[U].backfilled=!0)))}}getTile(s){return this.getTileByID(s.key)}getTileByID(s){return this._tiles[s]}_retainLoadedChildren(s,c,_,v){for(const C in this._tiles){let D=this._tiles[C];if(v[C]||!D.hasData()||D.tileID.overscaledZ<=c||D.tileID.overscaledZ>_)continue;let O=D.tileID;for(;D&&D.tileID.overscaledZ>c+1;){const U=D.tileID.scaledTo(D.tileID.overscaledZ-1);D=this._tiles[U.key],D&&D.hasData()&&(O=U)}let B=O;for(;B.overscaledZ>c;)if(B=B.scaledTo(B.overscaledZ-1),s[B.key]){v[O.key]=O;break}}}findLoadedParent(s,c){if(s.key in this._loadedParentTiles){const _=this._loadedParentTiles[s.key];return _&&_.tileID.overscaledZ>=c?_:null}for(let _=s.overscaledZ-1;_>=c;_--){const v=s.scaledTo(_),C=this._getLoadedTile(v);if(C)return C}}_getLoadedTile(s){const c=this._tiles[s.key];return c&&c.hasData()?c:this._cache.getByKey(this._source.reparseOverscaled?s.wrapped().key:s.canonical.key)}updateCacheSize(s,c){c=c||this._source.tileSize;const _=Math.ceil(s.width/c)+1,v=Math.ceil(s.height/c)+1,C=Math.floor(_*v*5),D="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,C):C,O="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,D):D;this._cache.setMaxSize(O)}handleWrapJump(s){const c=Math.round((s-(void 0===this._prevLng?s:this._prevLng))/360);if(this._prevLng=s,c){const _={};for(const v in this._tiles){const C=this._tiles[v];C.tileID=C.tileID.unwrapTo(C.tileID.wrap+c),_[C.tileID.key]=C}this._tiles=_;for(const v in this._timers)clearTimeout(this._timers[v]),delete this._timers[v];for(const v in this._tiles)this._setTileReloadTimer(+v,this._tiles[v])}}update(s,c,_,v){if(this.transform=s,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage||this.usedForTerrain&&!_)return;this.updateCacheSize(s,c),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const C="batched-model"===this._source.type;let D,O=this._source.maxzoom;const B=this.map&&this.map.painter?this.map.painter._terrain:null;if(B&&B.sourceCache===this&&B.attenuationRange()){const G=B.attenuationRange()[0],W=Math.floor(G)-Math.log2(B.getDemUpscale());O>W&&(O=W)}if(this.used||this.usedForTerrain){if(this._source.tileID)D=s.getVisibleUnwrappedCoordinates(this._source.tileID).map(G=>new h.aG(G.canonical.z,G.wrap,G.canonical.z,G.canonical.x,G.canonical.y));else if(0!==this.tileCoverLift){const G=s.clone();G.tileCoverLift=this.tileCoverLift,D=G.coveringTiles({tileSize:c||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:O,roundZoom:this._source.roundZoom&&!_,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:C}),this._source.minzoom<=1&&"globe"===s.projection.name&&(D.push(new h.aG(1,0,1,0,0)),D.push(new h.aG(1,0,1,1,0)),D.push(new h.aG(1,0,1,0,1)),D.push(new h.aG(1,0,1,1,1)))}else if(D=s.coveringTiles({tileSize:c||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:O,roundZoom:this._source.roundZoom&&!_,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:C}),this._source.hasTile){const G=this._source.hasTile.bind(this._source);D=D.filter(W=>G(W))}}else D=[];if(D.length>0&&this.castsShadows&&v&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!zo(this._source.type)){const G=s.coveringZoomLevel({tileSize:c||this._source.tileSize,roundZoom:this._source.roundZoom&&!_}),W=Math.min(G,this._source.maxzoom);if(C){const Q=s.extendTileCover(D,W);for(const ae of Q)D.push(ae)}else{const Q=s.extendTileCover(D,W,v);for(const ae of Q)this._shadowCasterTiles[ae.key]=!0,D.push(ae)}}const U=this._updateRetainedTiles(D);if(zo(this._source.type)&&0!==D.length){const G={},W={},Q=Object.keys(U);for(const ie of Q){const ce=U[ie],de=this._tiles[ie];if(!de||de.fadeEndTime&&de.fadeEndTime<=h.q.now())continue;const be=this.findLoadedParent(ce,Math.max(ce.overscaledZ-yn.maxOverzooming,this._source.minzoom));be&&(this._addTile(be.tileID),G[be.tileID.key]=be.tileID),W[ie]=ce}const ae=D[D.length-1].overscaledZ;for(const ie in this._tiles){const ce=this._tiles[ie];if(U[ie]||!ce.hasData())continue;let de=ce.tileID;for(;de.overscaledZ>ae;){de=de.scaledTo(de.overscaledZ-1);const be=this._tiles[de.key];if(be&&be.hasData()&&W[de.key]){U[ie]=ce.tileID;break}}}for(const ie in G)U[ie]||(this._coveredTiles[ie]=!0,U[ie]=G[ie])}for(const G in U)this._tiles[G].clearFadeHold();const H=h.bk(this._tiles,U);for(const G of H){const W=this._tiles[G];W.hasSymbolBuckets&&!W.holdingForFade()?W.setHoldDuration(this.map._fadeDuration):W.hasSymbolBuckets&&!W.symbolFadeFinished()||this._removeTile(+G)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const s in this._tiles)this._tiles[s].holdingForFade()&&this._removeTile(+s)}_updateRetainedTiles(s){const c={};if(0===s.length)return c;const _={},v=s.reduce((U,H)=>Math.min(U,H.overscaledZ),1/0),C=s[0].overscaledZ,D=Math.max(C-yn.maxOverzooming,this._source.minzoom),O=Math.max(C+yn.maxUnderzooming,this._source.minzoom),B={};for(const U of s){const H=this._addTile(U);c[U.key]=U,H.hasData()||v=this._source.maxzoom){const W=U.children(this._source.maxzoom)[0],Q=this.getTile(W);if(Q&&Q.hasData()){c[W.key]=W;continue}}else{const W=U.children(this._source.maxzoom);if(c[W[0].key]&&c[W[1].key]&&c[W[2].key]&&c[W[3].key])continue}let G=H.wasRequested();for(let W=U.overscaledZ-1;W>=D;--W){const Q=U.scaledTo(W);if(_[Q.key]||(_[Q.key]=!0,H=this.getTile(Q),!H&&G&&(H=this._addTile(Q)),H&&(c[Q.key]=Q,G=H.wasRequested(),H.hasData())))break}}return c}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const s in this._tiles){const c=[];let _,v=this._tiles[s].tileID;for(;v.overscaledZ>0;){if(v.key in this._loadedParentTiles){_=this._loadedParentTiles[v.key];break}c.push(v.key);const C=v.scaledTo(v.overscaledZ-1);if(_=this._getLoadedTile(C),_)break;v=C}for(const C of c)this._loadedParentTiles[C]=_}}_addTile(s){let c=this._tiles[s.key];if(c)return!0!==c.isExtraShadowCaster||this._shadowCasterTiles[s.key]||this._reloadTile(s.key,"reloading"),c;c=this._cache.getAndRemove(s),c&&(this._setTileReloadTimer(s.key,c),c.tileID=s,this._state.initializeTileState(c,this.map?this.map.painter:null),this._cacheTimers[s.key]&&(clearTimeout(this._cacheTimers[s.key]),delete this._cacheTimers[s.key],this._setTileReloadTimer(s.key,c)));const _=!!c;if(!_){const v=this.map?this.map.painter:null,C=this._source.tileSize*s.overscaleFactor();c="raster-array"===this._source.type?new ze(s,C,this.transform.tileZoom,v,this._isRaster):new Ie(s,C,this.transform.tileZoom,v,this._isRaster),this._loadTile(c,this._tileLoaded.bind(this,c,s.key,c.state))}return c?(c.uses++,this._tiles[s.key]=c,_||this._source.fire(new h.z("dataloading",{tile:c,coord:c.tileID,dataType:"source"})),c):null}_setTileReloadTimer(s,c){s in this._timers&&(clearTimeout(this._timers[s]),delete this._timers[s]);const _=c.getExpiryTimeout();_&&(this._timers[s]=setTimeout(()=>{this._reloadTile(s,"expired"),delete this._timers[s]},_))}_removeTile(s){const c=this._tiles[s];c&&(c.uses--,delete this._tiles[s],this._timers[s]&&(clearTimeout(this._timers[s]),delete this._timers[s]),c.uses>0||(c.hasData()&&"reloading"!==c.state||"empty"===c.state?this._cache.add(c.tileID,c,c.getExpiryTimeout()):(c.aborted=!0,this._abortTile(c),this._unloadTile(c))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const s in this._tiles)this._removeTile(+s);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(s,c,_){const v=[],C=this.transform;if(!C)return v;const D="globe"===C.projection.name,O=h.at(C.center.lng);for(const B in this._tiles){const U=this._tiles[B];if(_&&U.clearQueryDebugViz(),U.holdingForFade())continue;let H;if(D){const G=U.tileID.canonical;if(0===G.z){const W=[Math.abs(h.aw(O,...Un(G,-1))-O),Math.abs(h.aw(O,...Un(G,1))-O)];H=[0,2*W.indexOf(Math.min(...W))-1]}else{const W=[Math.abs(h.aw(O,...Un(G,-1))-O),Math.abs(h.aw(O,...Un(G,0))-O),Math.abs(h.aw(O,...Un(G,1))-O)];H=[W.indexOf(Math.min(...W))-1]}}else H=[0];for(const G of H){const W=s.containsTile(U,C,c,G);W&&v.push(W)}}return v}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(s){return this._getRenderableCoordinates(s)}_getRenderableCoordinates(s,c){const _=this.getRenderableIds(s,c).map(C=>this._tiles[C].tileID),v="globe"===this.transform.projection.name;for(const C of _)C.projMatrix=this.transform.calculateProjMatrix(C.toUnwrapped()),C.expandedProjMatrix=v?this.transform.calculateProjMatrix(C.toUnwrapped(),!1,!0):C.projMatrix;return _}sortCoordinatesByDistance(s){const c=s.slice(),_=this.transform._camera.position,v=this.transform._camera.forward(),C={};for(const D of c){const O=1/(1<C[D.key]-C[O.key]),c}hasTransition(){if(this._source.hasTransition())return!0;if(zo(this._source.type))for(const s in this._tiles){const c=this._tiles[s];if(void 0!==c.fadeEndTime&&c.fadeEndTime>=h.q.now())return!0}return!1}setFeatureState(s,c,_){this._state.updateState(s=s||"_geojsonTileLayer",c,_)}removeFeatureState(s,c,_){this._state.removeFeatureState(s=s||"_geojsonTileLayer",c,_)}getFeatureState(s,c){return this._state.getState(s=s||"_geojsonTileLayer",c)}setDependencies(s,c,_){const v=this._tiles[s];v&&v.setDependencies(c,_)}reloadTilesForDependencies(s,c){for(const _ in this._tiles)this._tiles[_].hasDependency(s,c)&&this._reloadTile(+_,"reloading");this._cache.filter(_=>!_.hasDependency(s,c))}_preloadTiles(s,c){if(!this._sourceLoaded){const B=()=>{this._sourceLoaded&&(this._source.off("data",B),this._preloadTiles(s,c))};return void this._source.on("data",B)}const _=new Map,v=Array.isArray(s)?s:[s],C=this.map.painter.terrain,D=this.usedForTerrain&&C?C.getScaledDemTileSize():this._source.tileSize;for(const B of v){const U=B.coveringTiles({tileSize:D,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const H of U)_.set(H.key,H);this.usedForTerrain&&B.updateElevation(!1)}const O=Array.from(_.values());h.bl(O,(B,U)=>{const H=new Ie(B,this._source.tileSize*B.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(H,G=>{"raster-dem"===this._source.type&&H.dem&&this._backfillDEM(H),U(G,H)})},c)}}function In(f,s){const c=Math.abs(2*f.wrap)-+(f.wrap<0),_=Math.abs(2*s.wrap)-+(s.wrap<0);return f.overscaledZ-s.overscaledZ||_-c||s.canonical.y-f.canonical.y||s.canonical.x-f.canonical.x}function zo(f){return"raster"===f||"image"===f||"video"===f||"custom"===f}function Un(f,s){const c=1<0:"model"===_.type&&(v=!_.isHidden(s)&&_.paint.get("model-opacity").constantOr(1)>0),this.layersGotHidden=this.layersGotHidden||!v&&c.visible,c.visible=v}}updateZOffset(s,c){this.currentBuildingBuckets=[];for(const v of this.layers){const C=v.layer,D=this.style.getLayerSourceCache(C);let O=1;"fill-extrusion"===C.type&&(O=v.visible?C.paint.get("fill-extrusion-vertical-scale"):0);let B=D?D.getTile(c):null;if(!B&&D&&c.canonical.z>D.getSource().minzoom){let U=c.scaledTo(Math.min(D.getSource().maxzoom,c.overscaledZ-1));for(;U.overscaledZ>=D.getSource().minzoom&&(B=D.getTile(U),!B&&0!==U.overscaledZ);)U=U.scaledTo(U.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:B?B.getBucket(C):null,tileID:B?B.tileID:c,verticalScale:O})}s.hasAnyZOffset=!1;let _=!1;for(let v=0;v{_ in s&&(c[_]=s[_])}),c}function ic(f){f=f.slice();const s=Object.create(null);for(let c=0;c0?(v-D)/O:0;return this.points[C].mult(1-B).add(this.points[c].mult(B))}}class N_{constructor(s,c,_){const v=this.boxCells=[],C=this.circleCells=[];this.xCellCount=Math.ceil(s/_),this.yCellCount=Math.ceil(c/_);for(let D=0;Dthis.width||v<0||c>this.height)return!C&&[];const O=[];if(s<=0&&c<=0&&this.width<=_&&this.height<=v){if(C)return!0;for(let B=0;B0:O}_queryCircle(s,c,_,v,C){const D=s-_,O=s+_,B=c-_,U=c+_;if(O<0||D>this.width||U<0||B>this.height)return!v&&[];const H=[];return this._forEachCell(D,B,O,U,this._queryCellCircle,H,{hitTest:v,circle:{x:s,y:c,radius:_},seenUids:{box:{},circle:{}}},C),v?H.length>0:H}query(s,c,_,v,C){return this._query(s,c,_,v,!1,C)}hitTest(s,c,_,v,C){return this._query(s,c,_,v,!0,C)}hitTestCircle(s,c,_,v){return this._queryCircle(s,c,_,!0,v)}_queryCell(s,c,_,v,C,D,O,B){const U=O.seenUids,H=this.boxCells[C];if(null!==H){const W=this.bboxes;for(const Q of H)if(!U.box[Q]){U.box[Q]=!0;const ae=4*Q;if(s<=W[ae+2]&&c<=W[ae+3]&&_>=W[ae+0]&&v>=W[ae+1]&&(!B||B(this.boxKeys[Q]))){if(O.hitTest)return D.push(!0),!0;D.push({key:this.boxKeys[Q],x1:W[ae],y1:W[ae+1],x2:W[ae+2],y2:W[ae+3]})}}}const G=this.circleCells[C];if(null!==G){const W=this.circles;for(const Q of G)if(!U.circle[Q]){U.circle[Q]=!0;const ae=3*Q;if(this._circleAndRectCollide(W[ae],W[ae+1],W[ae+2],s,c,_,v)&&(!B||B(this.circleKeys[Q]))){if(O.hitTest)return D.push(!0),!0;{const ie=W[ae],ce=W[ae+1],de=W[ae+2];D.push({key:this.circleKeys[Q],x1:ie-de,y1:ce-de,x2:ie+de,y2:ce+de})}}}}}_queryCellCircle(s,c,_,v,C,D,O,B){const U=O.circle,H=O.seenUids,G=this.boxCells[C];if(null!==G){const Q=this.bboxes;for(const ae of G)if(!H.box[ae]){H.box[ae]=!0;const ie=4*ae;if(this._circleAndRectCollide(U.x,U.y,U.radius,Q[ie+0],Q[ie+1],Q[ie+2],Q[ie+3])&&(!B||B(this.boxKeys[ae])))return D.push(!0),!0}}const W=this.circleCells[C];if(null!==W){const Q=this.circles;for(const ae of W)if(!H.circle[ae]){H.circle[ae]=!0;const ie=3*ae;if(this._circlesCollide(Q[ie],Q[ie+1],Q[ie+2],U.x,U.y,U.radius)&&(!B||B(this.circleKeys[ae])))return D.push(!0),!0}}}_forEachCell(s,c,_,v,C,D,O,B){const U=this._convertToXCellCoord(s),H=this._convertToYCellCoord(c),G=this._convertToXCellCoord(_),W=this._convertToYCellCoord(v);for(let Q=U;Q<=G;Q++)for(let ae=H;ae<=W;ae++)if(C.call(this,s,c,_,v,this.xCellCount*ae+Q,D,O,B))return}_convertToXCellCoord(s){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(s*this.xScale)))}_convertToYCellCoord(s){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(s*this.yScale)))}_circlesCollide(s,c,_,v,C,D){const O=v-s,B=C-c,U=_+D;return U*U>O*O+B*B}_circleAndRectCollide(s,c,_,v,C,D,O){const B=(D-v)/2,U=Math.abs(s-(v+B));if(U>B+_)return!1;const H=(O-C)/2,G=Math.abs(c-(C+H));if(G>H+_)return!1;if(U<=B||G<=H)return!0;const W=U-B,Q=G-H;return W*W+Q*Q<=_*_}}const _i_unknown=0,_i_flipRequired=1,_i_flipNotRequired=2,hh=Math.tan(85*Math.PI/180);function Ss(f,s,c,_,v,C,D){const O=h.ab.mat4.create();if(c)if("globe"===C.name){const B=h.bo(v,s);h.ab.mat4.multiply(O,O,B)}else{const B=h.ab.mat2.invert([],D);O[0]=B[0],O[1]=B[1],O[4]=B[2],O[5]=B[3],_||h.ab.mat4.rotateZ(O,O,v.angle)}else h.ab.mat4.multiply(O,v.labelPlaneMatrix,f);return O}function Br(f,s,c,_,v,C,D){const O=Ss(f,s,c,_,v,C,D);return"globe"===C.name&&c||(O[2]=O[6]=O[10]=O[14]=0),O}function zb(f,s,c,_,v,C,D){if(c){if("globe"===C.name){const O=Ss(f,s,c,_,v,C,D);return h.ab.mat4.invert(O,O),h.ab.mat4.multiply(O,f,O),O}{const O=h.ab.mat4.clone(f),B=h.ab.mat4.identity([]);return B[0]=D[0],B[1]=D[1],B[4]=D[2],B[5]=D[3],h.ab.mat4.multiply(O,O,B),_||h.ab.mat4.rotateZ(O,O,-v.angle),O}}return v.glCoordMatrix}function Us(f,s,c,_){const v=[f,s,c,1];c?h.ab.vec4.transformMat4(v,v,_):$l(v,v,_);const C=v[3];return v[0]/=C,v[1]/=C,v[2]/=C,v}function ep(f,s){return Math.min(.5+f/s*.5,1.5)}function tp(f,s){const c=f[0]/f[3],_=f[1]/f[3];return c>=-s[0]&&c<=s[0]&&_>=-s[1]&&_<=s[1]}function mf(f,s,c,_,v,C,D,O,B,U){const H=c.transform,G=_?f.textSizeData:f.iconSizeData,W=h.bp(G,c.transform.zoom),Q="globe"===H.projection.name,ae=[256/c.width*2+1,256/c.height*2+1],ie=_?f.text.dynamicLayoutVertexArray:f.icon.dynamicLayoutVertexArray;ie.clear();let ce=null;Q&&(ce=_?f.text.globeExtVertexArray:f.icon.globeExtVertexArray);const de=f.lineVertexArray,be=_?f.text.placedSymbolArray:f.icon.placedSymbolArray,De=c.transform.width/c.transform.height;let Te,Le=!1;for(let Me=0;MeMath.abs(c)?{useVertical:!0}:f===h.bq.vertical?_>0?{needsFlipping:!0}:null:s!==_i_unknown&&(0===(v=c)||Math.abs(_/v)>hh)?s===_i_flipRequired?{needsFlipping:!0}:null:c<0?{needsFlipping:!0}:null;var v}function Bc(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de,be){const De=s/24,Te=f.lineOffsetX*De,Le=f.lineOffsetY*De,{lineStartIndex:Me,glyphStartIndex:Pe,numGlyphs:Ae,segment:Ve,writingMode:Ye,flipState:vt}=f,Ke=Me+f.lineLength,Mt=Rt=>{if(H){const[tt,zt,xt]=Rt.up,rn=U.length;h.bs(H,rn+0,tt,zt,xt),h.bs(H,rn+1,tt,zt,xt),h.bs(H,rn+2,tt,zt,xt),h.bs(H,rn+3,tt,zt,xt)}const[nt,wt,Ut]=Rt.point;h.bt(U,nt,wt,Ut,Rt.angle)};if(Ae>1){const Rt=ff(De,O,Te,Le,c,G,W,f,B,C,Q,ie,!1,ce,de,be);if(!Rt)return{notEnoughRoom:!0};if(_&&!c){let[nt,wt,Ut]=Rt.first.point,[tt,zt,xt]=Rt.last.point;[nt,wt]=Us(nt,wt,Ut,D),[tt,zt]=Us(tt,zt,xt,D);const rn=yt(Ye,vt,(tt-nt)*ae,zt-wt);if(f.flipState=rn&&rn.needsFlipping?_i_flipRequired:_i_flipNotRequired,rn)return rn}Mt(Rt.first);for(let nt=Pe+1;nt0?tt:z_(W,Ut,nt,1,v,void 0,ce,de.canonical),xt=yt(Ye,vt,(zt[0]-nt[0])*ae,zt[1]-nt[1]);if(f.flipState=xt&&xt.needsFlipping?_i_flipRequired:_i_flipNotRequired,xt)return xt}const Rt=_d(De*O.getoffsetX(Pe),Te,Le,c,G,W,Ve,Me,Ke,B,C,Q,ie,!1,!1,ce,de,be);if(!Rt)return{notEnoughRoom:!0};Mt(Rt)}return{}}function Za(f,s,c,_,v){const{x:C,y:D,z:O}=_.projectTilePoint(f.x,f.y,s);if(!v)return Us(C,D,O,c);const[B,U,H]=v(f);return Us(C+B,D+U,O+H,c)}function z_(f,s,c,_,v,C,D,O){const B=Za(f.sub(s)._unit()._add(f),O,v,D,C);return h.ab.vec3.sub(B,c,B),h.ab.vec3.normalize(B,B),h.ab.vec3.scaleAndAdd(B,c,B,_)}function _d(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de){const be=_?f-s:f+s;let De=be>0?1:-1,Te=0;_&&(De*=-1,Te=Math.PI),De<0&&(Te+=Math.PI);let Le=O+D+(De>0?0:1)|0,Me=v,Pe=v,Ae=0,Ve=0;const Ye=Math.abs(be),vt=[],Ke=[];let Mt=C,Rt=Mt;const nt=()=>z_(Rt,Mt,Pe,Ye-Ae+1,H,W,ie,ce.canonical);for(;Ae+Ve<=Ye;){if(Le+=De,Le=B)return null;if(Pe=Me,Rt=Mt,vt.push(Pe),Q&&Ke.push(Rt),Mt=new h.P(U.getx(Le),U.gety(Le)),Me=G[Le],!Me){const Kt=Za(Mt,ce.canonical,H,ie,W);Me=Kt[3]>0?G[Le]=Kt:nt()}Ae+=Ve,Ve=h.ab.vec3.distance(Pe,Me)}ae&&W&&(G[Le]&&(Me=nt(),Ve=h.ab.vec3.distance(Pe,Me)),G[Le]=Me);const wt=(Ye-Ae)/Ve,Ut=Mt.sub(Rt)._mult(wt)._add(Rt),tt=h.ab.vec3.sub([],Me,Pe),zt=h.ab.vec3.scaleAndAdd([],Pe,tt,wt);let xt=[0,0,1],rn=tt[0],$t=tt[1];if(de&&(xt=ie.upVector(ce.canonical,Ut.x,Ut.y),0!==xt[0]||0!==xt[1]||1!==xt[2])){const Kt=[xt[2],0,-xt[0]],en=h.ab.vec3.cross([],xt,Kt);h.ab.vec3.normalize(Kt,Kt),h.ab.vec3.normalize(en,en),rn=h.ab.vec3.dot(tt,Kt),$t=h.ab.vec3.dot(tt,en)}if(c){const Kt=h.ab.vec3.cross([],xt,tt);h.ab.vec3.normalize(Kt,Kt),h.ab.vec3.scaleAndAdd(zt,zt,Kt,c*De)}const Ft=Te+Math.atan2($t,rn);return vt.push(zt),Q&&Ke.push(Ut),{point:zt,angle:Ft,path:vt,tilePath:Ke,up:xt}}function Vr(f,s){const c=s.length,_=c+4*f;s.resize(_),s.float32.fill(-1/0,4*c,4*_)}function $l(f,s,c){const _=s[0],v=s[1];return f[0]=c[0]*_+c[4]*v+c[12],f[1]=c[1]*_+c[5]*v+c[13],f[3]=c[3]*_+c[7]*v+c[15],f}const Hs=100;class Ca{constructor(s,c,_=new N_(s.width+200,s.height+200,25),v=new N_(s.width+200,s.height+200,25)){this.transform=s,this.grid=_,this.ignoredGrid=v,this.pitchfactor=Math.cos(s._pitch)*s.cameraToCenterDistance,this.screenRightBoundary=s.width+Hs,this.screenBottomBoundary=s.height+Hs,this.gridRightBoundary=s.width+200,this.gridBottomBoundary=s.height+200,this.fogState=c}placeCollisionBox(s,c,_,v,C,D,O,B){let U=_.projectedAnchorX,H=_.projectedAnchorY,G=_.projectedAnchorZ;const W=_.elevation,Q=_.tileID,ae=s.getProjection();if(W&&Q){const[Me,Pe,Ae]=ae.upVector(Q.canonical,_.tileAnchorX,_.tileAnchorY),Ve=ae.upVectorScale(Q.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;U+=Me*W*Ve,H+=Pe*W*Ve,G+=Ae*W*Ve}const ie=this.projectAndGetPerspectiveRatio(O,U,H,G,_.tileID,"globe"===ae.name||!!W||this.transform.pitch>0,ae),ce=D*ie.perspectiveRatio,de=(_.x1*c+v.x-_.padding)*ce+ie.point.x,be=(_.y1*c+v.y-_.padding)*ce+ie.point.y,De=(_.x2*c+v.x+_.padding)*ce+ie.point.x,Te=(_.y2*c+v.y+_.padding)*ce+ie.point.y,Le=ie.perspectiveRatio<=.55||ie.occluded;return!this.isInsideGrid(de,be,De,Te)||!C&&this.grid.hitTest(de,be,De,Te,B)||Le?{box:[],offscreen:!1,occluded:ie.occluded}:{box:[de,be,De,Te],offscreen:this.isOffscreen(de,be,De,Te),occluded:!1}}placeCollisionCircles(s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie){const ce=[],de=this.transform.elevation,be=s.getProjection(),De=de?de.getAtTileOffsetFunc(ie,this.transform.center.lat,this.transform.worldSize,be):null,Te=new h.P(_.tileAnchorX,_.tileAnchorY);let{x:Le,y:Me,z:Pe}=be.projectTilePoint(Te.x,Te.y,ie.canonical);if(De){const[Ut,tt,zt]=De(Te);Le+=Ut,Me+=tt,Pe+=zt}const Ae="globe"===be.name,Ve=this.projectAndGetPerspectiveRatio(O,Le,Me,Pe,ie,Ae||!!de||this.transform.pitch>0,be),{perspectiveRatio:Ye}=Ve,vt=(G?D/Ye:D*Ye)/h.bw,Ke=Us(Le,Me,Pe,B),Mt=Ve.signedDistanceFromCamera>0?ff(vt,C,_.lineOffsetX*vt,_.lineOffsetY*vt,!1,Ke,Te,_,v,B,{},de&&!G?De:null,G&&!!de,be,ie,G):null;let Rt=!1,nt=!1,wt=!0;if(Mt&&!Ve.occluded){const Ut=.5*Q*Ye+ae,tt=new h.P(-100,-100),zt=new h.P(this.screenRightBoundary,this.screenBottomBoundary),xt=new Nt,{first:rn,last:$t}=Mt,Ft=rn.path.length;let Kt=[];for(let Rn=Ft-1;Rn>=1;Rn--)Kt.push(rn.path[Rn]);for(let Rn=1;Rn<$t.path.length;Rn++)Kt.push($t.path[Rn]);const en=2.5*Ut;U&&(Kt=Kt.map(([Rn,Tt,Wn],Xn)=>(De&&!Ae&&(Wn=De(XnRn[3]<=0)&&(Kt=[]));let Sn=[];if(Kt.length>0){let Rn=1/0,Tt=-1/0,Wn=1/0,Xn=-1/0;for(const vi of Kt)Rn=Math.min(Rn,vi[0]),Wn=Math.min(Wn,vi[1]),Tt=Math.max(Tt,vi[0]),Xn=Math.max(Xn,vi[1]);Tt>=tt.x&&Rn<=zt.x&&Xn>=tt.y&&Wn<=zt.y&&(Sn=[Kt.map(vi=>new h.P(vi[0],vi[1]))],(Rnzt.x||Wnzt.y)&&(Sn=h.bu(Sn,tt.x,tt.y,zt.x,zt.y)))}for(const Rn of Sn){xt.reset(Rn,.25*Ut);let Tt=0;Tt=xt.length<=.5*Ut?1:Math.ceil(xt.paddedLength/en)+1;for(let Wn=0;Wn0?(h.ab.vec4.transformMat4(B,B,s),this.fogState&&C&&"globe"!==O.name&&(U=function(W,Q,ae,ie,ce,de){const be=de.calculateFogTileMatrix(ce),De=[Q,ae,ie];return h.ab.vec3.transformMat4(De,De,be),qe(W,h.ab.vec3.length(De),de.pitch,de._fov)}(this.fogState,c,_,v,C.toUnwrapped(),this.transform)>.9)):$l(B,B,s);const H=B[3];return{point:new h.P((B[0]/H+1)/2*this.transform.width+Hs,(-B[1]/H+1)/2*this.transform.height+Hs),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(O)/H*.5,1.5),signedDistanceFromCamera:H,occluded:D&&B[2]>H||U}}isOffscreen(s,c,_,v){return _=this.screenRightBoundary||vthis.screenBottomBoundary}isInsideGrid(s,c,_,v){return _>=0&&s=0&&c_.collisionGroupID===c}}return this.collisionGroups[s]}}function Ts(f,s,c,_,v){const{horizontalAlign:C,verticalAlign:D}=h.bD(f),O=-(C-.5)*s,B=-(D-.5)*c,U=h.bC(f,_);return new h.P(O+U[0]*v,B+U[1]*v)}function V_(f,s,c,_,v){const C=new h.P(f,s);return c&&C._rotate(_?v:-v),C}class _o{constructor(s,c,_,v,C,D){this.transform=s.clone(),this.projection=s.projection.name,this.collisionIndex=new Ca(this.transform,C),this.buildingIndex=D,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=c,this.retainedQueryData={},this.collisionGroups=new bd(_),this.collisionCircleArrays={},this.prevPlacement=v,v&&(v.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(s,c,_,v,C=1){const D=_.getBucket(c),O=_.latestFeatureIndex;if(!D||!O||c.fqid!==D.layerIds[0])return;const B=D.layers[0].layout,U=D.layers[0].paint,H=_.collisionBoxArray,G=Math.pow(2,this.transform.zoom-_.tileID.overscaledZ),W=_.tileSize/h.ag,Q=_.tileID.toUnwrapped();this.transform.setProjection(D.projection);const ae=(ie=_.tileID,ce=D.getProjection(),de=this.transform,ce.name===this.projection?de.calculateProjMatrix(ie.toUnwrapped()):B_(de,ce,ie));var ie,ce,de;const be="map"===B.get("text-pitch-alignment"),De="map"===B.get("text-rotation-alignment");c.compileFilter(c.options);const Te=c.dynamicFilter(),Le=c.dynamicFilterNeedsFeature(),Me=this.transform.calculatePixelsToTileUnitsMatrix(_),Pe=Br(ae,_.tileID.canonical,be,De,this.transform,D.getProjection(),Me);let Ae=null;if(be){const Ut=zb(ae,_.tileID.canonical,be,De,this.transform,D.getProjection(),Me);Ae=h.ab.mat4.multiply([],this.transform.labelPlaneMatrix,Ut)}let Ve=null;Te&&_.latestFeatureIndex&&(Ve={unwrappedTileID:Q,dynamicFilter:Te,dynamicFilterNeedsFeature:Le}),this.retainedQueryData[D.bucketInstanceId]=new w0(D.bucketInstanceId,O,D.sourceLayerIndex,D.index,_.tileID);const[Ye,vt]=D.layers[0].layout.get("text-size-scale-range"),Ke=h.aw(C,Ye,vt),[Mt,Rt]=B.get("icon-size-scale-range"),nt=h.aw(C,Mt,Rt),wt={bucket:D,layout:B,paint:U,posMatrix:ae,textLabelPlaneMatrix:Pe,labelToScreenMatrix:Ae,clippingData:Ve,scale:G,textPixelRatio:W,holdingForFade:_.holdingForFade(),collisionBoxArray:H,partiallyEvaluatedTextSize:h.bp(D.textSizeData,this.transform.zoom,Ke),partiallyEvaluatedIconSize:h.bp(D.iconSizeData,this.transform.zoom,nt),collisionGroup:this.collisionGroups.get(D.sourceID),latestFeatureIndex:_.latestFeatureIndex};if(v)for(const Ut of D.sortKeyRanges){const{sortKey:tt,symbolInstanceStart:zt,symbolInstanceEnd:xt}=Ut;s.push({sortKey:tt,symbolInstanceStart:zt,symbolInstanceEnd:xt,parameters:wt})}else s.push({symbolInstanceStart:0,symbolInstanceEnd:D.symbolInstances.length,parameters:wt})}attemptAnchorPlacement(s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de,be){const{textOffset0:De,textOffset1:Te,crossTileID:Le}=W,Me=[De,Te],Pe=Ts(s,_,v,Me,C),Ae=this.collisionIndex.placeCollisionBox(ae,C,c,V_(Pe.x,Pe.y,D,O,this.transform.angle),G,B,U,H.predicate);if(ce){const Ve=ae.getSymbolInstanceIconSize(be,this.transform.zoom,W.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(ae,Ve,ce,V_(Pe.x,Pe.y,D,O,this.transform.angle),G,B,U,H.predicate).box.length)return}if(Ae.box.length>0){let Ve;return this.prevPlacement&&this.prevPlacement.variableOffsets[Le]&&this.prevPlacement.placements[Le]&&this.prevPlacement.placements[Le].text&&(Ve=this.prevPlacement.variableOffsets[Le].anchor),this.variableOffsets[Le]={textOffset:Me,width:_,height:v,anchor:s,textScale:C,prevAnchor:Ve},this.markUsedJustification(ae,s,W,ie),ae.allowVerticalPlacement&&(this.markUsedOrientation(ae,ie,W),this.placedOrientations[Le]=ie),{shift:Pe,placedGlyphBoxes:Ae}}}placeLayerBucketPart(s,c,_,v,C=1){const{bucket:D,layout:O,paint:B,posMatrix:U,textLabelPlaneMatrix:H,labelToScreenMatrix:G,clippingData:W,textPixelRatio:Q,holdingForFade:ae,collisionBoxArray:ie,partiallyEvaluatedTextSize:ce,partiallyEvaluatedIconSize:de,collisionGroup:be,latestFeatureIndex:De}=s.parameters,Te=O.get("text-optional"),Le=O.get("icon-optional"),Me=O.get("text-allow-overlap"),Pe=O.get("icon-allow-overlap"),Ae="map"===O.get("text-rotation-alignment"),Ve="map"===O.get("text-pitch-alignment"),Ye=O.get("symbol-z-elevate"),vt=B.get("symbol-z-offset"),Ke="sea"===O.get("symbol-elevation-reference"),[Mt,Rt]=O.get("text-size-scale-range"),[nt,wt]=O.get("icon-size-scale-range"),Ut=h.aw(C,Mt,Rt),tt=h.aw(C,nt,wt);this.transform.setProjection(D.projection);let zt=Me&&(Pe||!D.hasIconData()||Le),xt=Pe&&(Me||!D.hasTextData()||Te);const rn=!vt.isConstant();!D.collisionArrays&&ie&&D.deserializeCollisionBoxes(ie),_&&v&&D.updateCollisionDebugBuffers(this.transform.zoom,ie,Ut,tt);const $t=(Ft,Kt,en)=>{const{crossTileID:Sn,numVerticalGlyphVertices:Rn}=Ft;let Tt=null;if(W&&W.dynamicFilterNeedsFeature||rn){const bo=this.retainedQueryData[D.bucketInstanceId];Tt=De.loadFeature({featureIndex:Ft.featureIndex,bucketIndex:bo.bucketIndex,sourceLayerIndex:bo.sourceLayerIndex,layoutVertexArrayOffset:0})}if(W&&!(0,W.dynamicFilter)({zoom:this.transform.zoom,pitch:this.transform.pitch},Tt,this.retainedQueryData[D.bucketInstanceId].tileID.canonical,new h.P(Ft.tileAnchorX,Ft.tileAnchorY),this.transform.calculateDistanceTileData(W.unwrappedTileID)))return this.placements[Sn]=new _f(!1,!1,!1,!0),void c.add(Sn);const Wn=vt.evaluate(Tt,{});if(c.has(Sn))return;if(ae)return void(this.placements[Sn]=new _f(!1,!1,!1));let Xn=!1,vi=!1,uo=!0,Fo=!1,_r=!1,ur=null,tn={box:null,offscreen:null,occluded:null},yo={box:null,offscreen:null,occluded:null},$n=null,no=null,Mo=null,Do=0,xr=0,Ua=0;en.textFeatureIndex?Do=en.textFeatureIndex:Ft.useRuntimeCollisionCircles&&(Do=Ft.featureIndex),en.verticalTextFeatureIndex&&(xr=en.verticalTextFeatureIndex);const aa=bo=>{bo.tileID=this.retainedQueryData[D.bucketInstanceId].tileID;const Xo=this.transform.elevation;bo.elevation=Ke?Wn:Wn+(Xo?Xo.getAtTileOffset(bo.tileID,bo.tileAnchorX,bo.tileAnchorY):0),bo.elevation+=Ft.zOffset},Ta=en.textBox;if(Ta){aa(Ta);const bo=ao=>{let _a=h.bq.horizontal;if(D.allowVerticalPlacement&&!ao&&this.prevPlacement){const ms=this.prevPlacement.placedOrientations[Sn];ms&&(this.placedOrientations[Sn]=ms,_a=ms,this.markUsedOrientation(D,_a,Ft))}return _a},Xo=(ao,_a)=>{if(D.allowVerticalPlacement&&Rn>0&&en.verticalTextBox){for(const ms of D.writingModes)if(ms===h.bq.vertical?(tn=_a(),yo=tn):tn=ao(),tn&&tn.box&&tn.box.length)break}else tn=ao()};if(O.get("text-variable-anchor")){let ao=O.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[Sn]){const Ko=this.prevPlacement.variableOffsets[Sn];ao.indexOf(Ko.anchor)>0&&(ao=ao.filter(ll=>ll!==Ko.anchor),ao.unshift(Ko.anchor))}const _a=(Ko,ll,qc)=>{const lc=D.getSymbolInstanceTextSize(ce,Ft,this.transform.zoom,Kt),fs=(Ko.x2-Ko.x1)*lc+2*Ko.padding,Pn=(Ko.y2-Ko.y1)*lc+2*Ko.padding,xc=Ft.hasIconTextFit&&!Pe?ll:null;xc&&aa(xc);let Gs={box:[],offscreen:!1,occluded:!1};const Dm=Me?2*ao.length:ao.length;for(let Da=0;Da=ao.length,Ft,Kt,D,qc,xc,ce,de);if(hu&&(Gs=hu.placedGlyphBoxes,Gs&&Gs.box&&Gs.box.length)){Xn=!0,ur=hu.shift;break}}return Gs};Xo(()=>_a(Ta,en.iconBox,h.bq.horizontal),()=>{const Ko=en.verticalTextBox;return Ko&&aa(Ko),D.allowVerticalPlacement&&!(tn&&tn.box&&tn.box.length)&&Rn>0&&Ko?_a(Ko,en.verticalIconBox,h.bq.vertical):{box:null,offscreen:null,occluded:null}}),tn&&(Xn=tn.box,uo=tn.offscreen,Fo=tn.occluded);const ms=bo(!(!tn||!tn.box));if(!Xn&&this.prevPlacement){const Ko=this.prevPlacement.variableOffsets[Sn];Ko&&(this.variableOffsets[Sn]=Ko,this.markUsedJustification(D,Ko.anchor,Ft,ms))}}else{const ao=(_a,ms)=>{const Ko=D.getSymbolInstanceTextSize(ce,Ft,this.transform.zoom,Kt,C),ll=this.collisionIndex.placeCollisionBox(D,Ko,_a,new h.P(0,0),Me,Q,U,be.predicate);return ll&&ll.box&&ll.box.length&&(this.markUsedOrientation(D,ms,Ft),this.placedOrientations[Sn]=ms),ll};Xo(()=>ao(Ta,h.bq.horizontal),()=>{const _a=en.verticalTextBox;return D.allowVerticalPlacement&&Rn>0&&_a?(aa(_a),ao(_a,h.bq.vertical)):{box:null,offscreen:null,occluded:null}}),bo(!!(tn&&tn.box&&tn.box.length))}}if($n=tn,Xn=$n&&$n.box&&$n.box.length>0,uo=$n&&$n.offscreen,Fo=$n&&$n.occluded,Ft.useRuntimeCollisionCircles){const bo=D.text.placedSymbolArray.get(Ft.centerJustifiedTextSymbolIndex>=0?Ft.centerJustifiedTextSymbolIndex:Ft.verticalPlacedTextSymbolIndex),Xo=h.br(D.textSizeData,ce,bo),ao=O.get("text-padding");no=this.collisionIndex.placeCollisionCircles(D,Me,bo,D.lineVertexArray,D.glyphOffsetArray,Xo,U,H,G,_,Ve,be.predicate,Ft.collisionCircleDiameter*Xo/h.bw,ao,this.retainedQueryData[D.bucketInstanceId].tileID),Xn=Me||no.circles.length>0&&!no.collisionDetected,uo=uo&&no.offscreen,Fo=no.occluded}if(en.iconFeatureIndex&&(Ua=en.iconFeatureIndex),en.iconBox){const bo=Xo=>{aa(Xo);const ao=Ft.hasIconTextFit&&ur?V_(ur.x,ur.y,Ae,Ve,this.transform.angle):new h.P(0,0),_a=D.getSymbolInstanceIconSize(de,this.transform.zoom,Ft.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(D,_a,Xo,ao,Pe,Q,U,be.predicate)};yo&&yo.box&&yo.box.length&&en.verticalIconBox?(Mo=bo(en.verticalIconBox),vi=Mo.box.length>0):(Mo=bo(en.iconBox),vi=Mo.box.length>0),uo=uo&&Mo.offscreen,_r=Mo.occluded}const vc=Te||0===Ft.numHorizontalGlyphVertices&&0===Rn,$s=Le||0===Ft.numIconVertices;if(vc||$s?$s?vc||(vi=vi&&Xn):Xn=vi&&Xn:vi=Xn=vi&&Xn,Xn&&$n&&$n.box&&this.collisionIndex.insertCollisionBox($n.box,O.get("text-ignore-placement"),D.bucketInstanceId,yo&&yo.box&&xr?xr:Do,be.ID),vi&&Mo&&this.collisionIndex.insertCollisionBox(Mo.box,O.get("icon-ignore-placement"),D.bucketInstanceId,Ua,be.ID),no&&(Xn&&this.collisionIndex.insertCollisionCircles(no.circles,O.get("text-ignore-placement"),D.bucketInstanceId,Do,be.ID),_)){const bo=D.bucketInstanceId;let Xo=this.collisionCircleArrays[bo];void 0===Xo&&(Xo=this.collisionCircleArrays[bo]=new gd);for(let ao=0;ao=0;--Kt){const en=Ft[Kt];$t(D.symbolInstances.get(en),en,D.collisionArrays[en])}D.hasAnyZOffset&&h.w(`${D.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(D.hasAnyZOffset){const Ft=D.getSortedIndexesByZOffset();for(let Kt=0;Kt=0&&(s.text.placedSymbolArray.get(C).crossTileID=G>=0&&C!==G?0:U),D>=0&&(s.text.placedSymbolArray.get(D).crossTileID=G>=0&&D!==G?0:U),O>=0&&(s.text.placedSymbolArray.get(O).crossTileID=G>=0&&O!==G?0:U),B>=0&&(s.text.placedSymbolArray.get(B).crossTileID=G>=0&&B!==G?0:U)}markUsedOrientation(s,c,_){const v=c===h.bq.horizontal||c===h.bq.horizontalOnly?c:0,C=c===h.bq.vertical?c:0,{leftJustifiedTextSymbolIndex:D,centerJustifiedTextSymbolIndex:O,rightJustifiedTextSymbolIndex:B,verticalPlacedTextSymbolIndex:U}=_,H=s.text.placedSymbolArray;D>=0&&(H.get(D).placedOrientation=v),O>=0&&(H.get(O).placedOrientation=v),B>=0&&(H.get(B).placedOrientation=v),U>=0&&(H.get(U).placedOrientation=C)}commit(s){this.commitTime=s,this.zoomAtLastRecencyCheck=this.transform.zoom;const c=this.prevPlacement;let _=!1;this.prevZoomAdjustment=c?c.zoomAdjustment(this.transform.zoom):0;const v=c?c.symbolFadeChange(s):1,C=c?c.opacities:{},D=c?c.variableOffsets:{},O=c?c.placedOrientations:{};for(const B in this.placements){const U=this.placements[B],H=C[B];H?(this.opacities[B]=new fl(H,v,U.text,U.icon,null,U.clipped),_=_||U.text!==H.text.placed||U.icon!==H.icon.placed):(this.opacities[B]=new fl(null,v,U.text,U.icon,U.skipFade,U.clipped),_=_||U.text||U.icon)}for(const B in C){const U=C[B];if(!this.opacities[B]){const H=new fl(U,v,!1,!1);H.isHidden()||(this.opacities[B]=H,_=_||U.text.placed||U.icon.placed)}}for(const B in D)this.variableOffsets[B]||!this.opacities[B]||this.opacities[B].isHidden()||(this.variableOffsets[B]=D[B]);for(const B in O)this.placedOrientations[B]||!this.opacities[B]||this.opacities[B].isHidden()||(this.placedOrientations[B]=O[B]);_?this.lastPlacementChangeTime=s:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=c?c.lastPlacementChangeTime:s)}updateLayerOpacities(s,c,_,v){const C=new Set;for(const D of c){const O=D.getBucket(s);O&&D.latestFeatureIndex&&s.fqid===O.layerIds[0]&&(this.updateBucketOpacities(O,C,D,D.collisionBoxArray,_,v,D.tileID,s.scope),O.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(O,D.tileID),O.updateZOffset()))}}updateBucketOpacities(s,c,_,v,C,D,O,B){s.hasTextData()&&s.text.opacityVertexArray.clear(),s.hasIconData()&&s.icon.opacityVertexArray.clear(),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexArray.clear(),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexArray.clear();const U=s.layers[0].layout,H=s.layers[0].paint,G=!!s.layers[0].dynamicFilter(),W=new fl(null,0,!1,!1,!0),Q=U.get("text-allow-overlap"),ae=U.get("icon-allow-overlap"),ie=U.get("text-variable-anchor"),ce="map"===U.get("text-rotation-alignment"),de="map"===U.get("text-pitch-alignment"),be=H.get("symbol-z-offset"),De="sea"===U.get("symbol-elevation-reference"),Te=!be.isConstant(),Le=new fl(null,0,Q&&(ae||!s.hasIconData()||U.get("icon-optional")),ae&&(Q||!s.hasTextData()||U.get("text-optional")),!0);!s.collisionArrays&&v&&(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData())&&s.deserializeCollisionBoxes(v);const Me=(Ae,Ve,Ye)=>{for(let vt=0;vt0||vt>0,$t=Mt>0,Ft=this.placedOrientations[Ke],Kt=Ft===h.bq.vertical,en=Ft===h.bq.horizontal||Ft===h.bq.horizontalOnly;!rn&&!$t||xt.isHidden()||Pe++;let Sn=!1;if((rn||$t)&&D)for(const Rn of s.activeReplacements){if(h.bx(Rn,C,h.by.Symbol,B)||Rn.min.x>Rt||Rt>Rn.max.x||Rn.min.y>nt||nt>Rn.max.y)continue;const Tt=h.bz(Rt,nt,O.canonical,Rn.footprintTileId.canonical);if(Sn=h.bA(Tt,Rn.footprint),Sn)break}if(rn){const Rn=Sn?Jd:bf(xt.text);Me(s.text,Ye,Kt?Jd:Rn),Me(s.text,vt,en?Jd:Rn);const Tt=xt.text.isHidden(),{leftJustifiedTextSymbolIndex:Wn,centerJustifiedTextSymbolIndex:Xn,rightJustifiedTextSymbolIndex:vi,verticalPlacedTextSymbolIndex:uo}=Ve,Fo=s.text.placedSymbolArray,_r=Tt||Kt?1:0;Wn>=0&&(Fo.get(Wn).hidden=_r),Xn>=0&&(Fo.get(Xn).hidden=_r),vi>=0&&(Fo.get(vi).hidden=_r),uo>=0&&(Fo.get(uo).hidden=Tt||en?1:0);const ur=this.variableOffsets[Ke];ur&&this.markUsedJustification(s,ur.anchor,Ve,Ft);const tn=this.placedOrientations[Ke];tn&&(this.markUsedJustification(s,"left",Ve,tn),this.markUsedOrientation(s,tn,Ve))}if($t){const Rn=Sn?Jd:bf(xt.icon),{placedIconSymbolIndex:Tt,verticalPlacedIconSymbolIndex:Wn}=Ve,Xn=s.icon.placedSymbolArray,vi=xt.icon.isHidden()?1:0;Tt>=0&&(Me(s.icon,Mt,Kt?Jd:Rn),Xn.get(Tt).hidden=vi),Wn>=0&&(Me(s.icon,Ve.numVerticalIconVertices,en?Jd:Rn),Xn.get(Wn).hidden=vi)}if(s.hasIconCollisionBoxData()||s.hasTextCollisionBoxData()){const Rn=s.collisionArrays[Ae];if(Rn){let Tt=new h.P(0,0),Wn=!0;if(Rn.textBox||Rn.verticalTextBox){if(ie){const vi=this.variableOffsets[Ke];vi?(Tt=Ts(vi.anchor,vi.width,vi.height,vi.textOffset,vi.textScale),ce&&Tt._rotate(de?this.transform.angle:-this.transform.angle)):Wn=!1}G&&(Wn=!xt.clipped),Rn.textBox&&er(s.textCollisionBox.collisionVertexArray,xt.text.placed,!Wn||Kt,tt,De,Tt.x,Tt.y),Rn.verticalTextBox&&er(s.textCollisionBox.collisionVertexArray,xt.text.placed,!Wn||en,tt,De,Tt.x,Tt.y)}const Xn=Wn&&!(en||!Rn.verticalIconBox);Rn.iconBox&&er(s.iconCollisionBox.collisionVertexArray,xt.icon.placed,Xn,tt,De,Ve.hasIconTextFit?Tt.x:0,Ve.hasIconTextFit?Tt.y:0),Rn.verticalIconBox&&er(s.iconCollisionBox.collisionVertexArray,xt.icon.placed,!Xn,tt,De,Ve.hasIconTextFit?Tt.x:0,Ve.hasIconTextFit?Tt.y:0)}}}if(s.fullyClipped=0===Pe,s.sortFeatures(this.transform.angle),this.retainedQueryData[s.bucketInstanceId]&&(this.retainedQueryData[s.bucketInstanceId].featureSortOrder=s.featureSortOrder),s.hasTextData()&&s.text.opacityVertexBuffer&&s.text.opacityVertexBuffer.updateData(s.text.opacityVertexArray),s.hasIconData()&&s.icon.opacityVertexBuffer&&s.icon.opacityVertexBuffer.updateData(s.icon.opacityVertexArray),s.hasIconCollisionBoxData()&&s.iconCollisionBox.collisionVertexBuffer&&s.iconCollisionBox.collisionVertexBuffer.updateData(s.iconCollisionBox.collisionVertexArray),s.hasTextCollisionBoxData()&&s.textCollisionBox.collisionVertexBuffer&&s.textCollisionBox.collisionVertexBuffer.updateData(s.textCollisionBox.collisionVertexArray),s.bucketInstanceId in this.collisionCircleArrays){const Ae=this.collisionCircleArrays[s.bucketInstanceId];s.placementInvProjMatrix=Ae.invProjMatrix,s.placementViewportMatrix=Ae.viewportMatrix,s.collisionCircleArray=Ae.circles,delete this.collisionCircleArrays[s.bucketInstanceId]}}symbolFadeChange(s){return 0===this.fadeDuration?1:(s-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(s){return Math.max(0,(this.transform.zoom-s)/1.5)}hasTransitions(s){return this.stale||s-this.lastPlacementChangeTimes}setStale(){this.stale=!0}}function er(f,s,c,_,v,C,D){f.emplaceBack(s?1:0,c?1:0,C||0,D||0,_,v?1:0),f.emplaceBack(s?1:0,c?1:0,C||0,D||0,_,v?1:0),f.emplaceBack(s?1:0,c?1:0,C||0,D||0,_,v?1:0),f.emplaceBack(s?1:0,c?1:0,C||0,D||0,_,v?1:0)}const U_=Math.pow(2,25),dw=Math.pow(2,24),C0=Math.pow(2,17),H_=Math.pow(2,16),gf=Math.pow(2,9),Bb=Math.pow(2,8),To=Math.pow(2,1);function bf(f){if(0===f.opacity&&!f.placed)return 0;if(1===f.opacity&&f.placed)return 4294967295;const s=f.placed?1:0,c=Math.floor(127*f.opacity);return c*U_+s*dw+c*C0+s*H_+c*gf+s*Bb+c*To+s}const Jd=0;class Ya{constructor(s){this._sortAcrossTiles="viewport-y"!==s.layout.get("symbol-z-order")&&void 0!==s.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(s,c,_,v,C,D){const O=this._bucketParts;for(;this._currentTileIndexB.sortKey-U.sortKey));this._currentPartIndex{const B=h.q.now()-D;return!this._forceFullPlacement&&B>2};for(;this._currentPlacementIndex>=0;){const B=c[s[this._currentPlacementIndex]],U=this.placement.collisionIndex.transform.zoom;if("symbol"===B.type&&(!B.minzoom||B.minzoom<=U)&&(!B.maxzoom||B.maxzoom>U)){const H=B,G=H.layout.get("symbol-z-elevate"),W=void 0!==H.layout.get("symbol-sort-key").constantOr(1),Q=H.layout.get("symbol-z-order"),ae="viewport-y"===Q||"auto"===Q&&!("viewport-y"!==Q&&W),ie=H.layout.get("text-allow-overlap")||H.layout.get("icon-allow-overlap")||H.layout.get("text-ignore-placement")||H.layout.get("icon-ignore-placement"),ce=ae&&ie,de=this._inProgressLayer=this._inProgressLayer||new Ya(H),be=h.aC(B.source,B.scope);if(de.continuePlacement(G||ce?v[be]:_[be],this.placement,this._showCollisionBoxes,B,O,C))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(s){return this.placement.commit(s),this.placement}}const T0=512/h.ag/2;class oD{constructor(s,c,_){this.tileID=s,this.bucketInstanceId=_,this.index=new h.bE(c.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const v=s.canonical.x*h.ag,C=s.canonical.y*h.ag;for(let D=0;Ds.overscaledZ)for(const O in D){const B=D[O];B.tileID.isChildOf(s)&&B.findMatches(c.symbolInstances,s,v)}else{const O=D[s.scaledTo(Number(C)).key];O&&O.findMatches(c.symbolInstances,s,v)}}for(let C=0;C{c[_]=!0});for(const _ in this.layerIndexes)c[_]||delete this.layerIndexes[_]}}class zi{constructor(s,c,_,v){this.blendFunction=s,this.blendColor=c,this.mask=_,this.blendEquation=v}}zi.Replace=[1,0,1,0],zi.disabled=new zi(zi.Replace,h.aj.transparent,[!1,!1,!1,!1]),zi.unblended=new zi(zi.Replace,h.aj.transparent,[!0,!0,!0,!0]),zi.alphaBlended=new zi([1,771,1,771],h.aj.transparent,[!0,!0,!0,!0]),zi.alphaBlendedNonPremultiplied=new zi([770,771,770,771],h.aj.transparent,[!0,!0,!0,!0]),zi.multiply=new zi([774,0,774,0],h.aj.transparent,[!0,!0,!0,!0]);class Jn{constructor(s,c,_){this.func=s,this.mask=c,this.range=_}}Jn.ReadOnly=!1,Jn.ReadWrite=!0,Jn.disabled=new Jn(519,Jn.ReadOnly,[0,1]);class pi{constructor(s,c,_,v,C,D){this.test=s,this.ref=c,this.mask=_,this.fail=v,this.depthFail=C,this.pass=D}}pi.disabled=new pi({func:519,mask:0},0,0,7680,7680,7680);class gi{constructor(s,c,_){this.enable=s,this.mode=c,this.frontFace=_}}function Y(f,s){const c=h.bG(f,3);h.ab.mat4.fromQuat(f,s),h.bI(f,3,c)}function tu(f,s){const c=h.ab.quat.identity([]);return h.ab.quat.rotateZ(c,c,-s),h.ab.quat.rotateX(c,c,-f),c}function yf(f,s){const c=[f[0],f[1],0],_=[s[0],s[1],0];if(h.ab.vec3.length(c)>=1e-15){const D=h.ab.vec3.normalize([],c);h.ab.vec3.scale(_,D,h.ab.vec3.dot(_,D)),s[0]=_[0],s[1]=_[1]}const v=h.ab.vec3.cross([],s,f);if(h.ab.vec3.len(v)<1e-15)return null;const C=Math.atan2(-v[1],v[0]);return tu(Math.atan2(Math.sqrt(f[0]*f[0]+f[1]*f[1]),-f[2]),C)}gi.disabled=new gi(!1,1029,2305),gi.backCCW=new gi(!0,1029,2305),gi.backCW=new gi(!0,1029,2304),gi.frontCW=new gi(!0,1028,2304),gi.frontCCW=new gi(!0,1028,2305);class mh{constructor(s,c){this.position=s,this.orientation=c}get position(){return this._position}set position(s){if(s){const c=s instanceof h.aa?s:new h.aa(s[0],s[1],s[2]);this._renderWorldCopies&&(c.x=h.bF(c.x,0,1)),this._position=c}else this._position=null}lookAtPoint(s,c){if(this.orientation=null,!this.position)return;const _=this.position,v=this._elevation?this._elevation.getAtPointOrZero(h.aa.fromLngLat(s)):0,C=h.aa.fromLngLat(s,v),D=[C.x-_.x,C.y-_.y,C.z-_.z];c||(c=[0,0,1]),c[2]=Math.abs(c[2]),this.orientation=yf(D,c)}setPitchBearing(s,c){this.orientation=tu(h.ai(s),h.ai(-c))}}class Gl{constructor(s,c){this._transform=h.ab.mat4.identity([]),this.orientation=c,this.position=s}get mercatorPosition(){const s=this.position;return new h.aa(s[0],s[1],s[2])}get position(){const s=h.bG(this._transform,3);return[s[0],s[1],s[2]]}set position(s){var c;s&&h.bI(this._transform,3,[(c=s)[0],c[1],c[2],1])}get orientation(){return this._orientation}set orientation(s){this._orientation=s||h.ab.quat.identity([]),s&&Y(this._transform,this._orientation)}getPitchBearing(){const s=this.forward(),c=this.right();return{bearing:Math.atan2(-c[1],c[0]),pitch:Math.atan2(Math.sqrt(s[0]*s[0]+s[1]*s[1]),-s[2])}}setPitchBearing(s,c){this._orientation=tu(s,c),Y(this._transform,this._orientation)}forward(){const s=h.bG(this._transform,2);return[-s[0],-s[1],-s[2]]}up(){const s=h.bG(this._transform,1);return[-s[0],-s[1],-s[2]]}right(){const s=h.bG(this._transform,0);return[s[0],s[1],s[2]]}getCameraToWorld(s,c){const _=new Float64Array(16);return h.ab.mat4.invert(_,this.getWorldToCamera(s,c)),_}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(s,c,_){const v=this.position;h.ab.vec3.scale(v,v,-s);const C=new Float64Array(16);return h.ab.mat4.fromScaling(C,[_,_,_]),h.ab.mat4.translate(C,C,v),C[10]*=c,C}getWorldToCamera(s,c){const _=new Float64Array(16),v=new Float64Array(4),C=this.position;return h.ab.quat.conjugate(v,this._orientation),h.ab.vec3.scale(C,C,-s),h.ab.mat4.fromQuat(_,v),h.ab.mat4.translate(_,_,C),_[1]*=-1,_[5]*=-1,_[9]*=-1,_[13]*=-1,_[8]*=c,_[9]*=c,_[10]*=c,_[11]*=c,_}getCameraToClipPerspective(s,c,_,v){const C=new Float64Array(16);return h.ab.mat4.perspective(C,s,c,_,v),C}getCameraToClipOrthographic(s,c,_,v,C,D){const O=new Float64Array(16);return h.ab.mat4.ortho(O,s,c,_,v,C,D),O}getDistanceToElevation(s,c=!1){const _=0===s?0:h.bH(s,c?h.aS(this.position[1]):this.position[1]),v=this.forward();return(_-this.position[2])/v[2]}clone(){return new Gl([...this.position],[...this.orientation])}}const js_BaseColor=5,js_MetallicRoughness=6,js_Normal=7,js_Occlusion=8,js_Emission=9,js_LUT=10,js_ShadowMap0=11;class pn{constructor(s=0,c=0,_=0,v=0){if(isNaN(s)||s<0||isNaN(c)||c<0||isNaN(_)||_<0||isNaN(v)||v<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=s,this.bottom=c,this.left=_,this.right=v}interpolate(s,c,_){return null!=c.top&&null!=s.top&&(this.top=h.af(s.top,c.top,_)),null!=c.bottom&&null!=s.bottom&&(this.bottom=h.af(s.bottom,c.bottom,_)),null!=c.left&&null!=s.left&&(this.left=h.af(s.left,c.left,_)),null!=c.right&&null!=s.right&&(this.right=h.af(s.right,c.right,_)),this}getCenter(s,c){const _=h.aw((this.left+s-this.right)/2,0,s),v=h.aw((this.top+c-this.bottom)/2,0,c);return new h.P(_,v)}equals(s){return this.top===s.top&&this.bottom===s.bottom&&this.left===s.left&&this.right===s.right}clone(){return new pn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Ub=(f,s,c)=>(1-c)*f+c*s,oc=f=>f*f*f*f*f;class vf{constructor(s,c,_,v,C,D,O){this.tileSize=512,this._renderWorldCopies=void 0===C||C,this._minZoom=s||0,this._maxZoom=c||22,this._minPitch=_??0,this._maxPitch=v??60,this.setProjection(D),this.setMaxBounds(O),this.width=0,this.height=0,this._center=new h.bO(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new pn,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new Gl,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1}clone(){const s=new vf(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return s._elevation=this._elevation,s._centerAltitude=this._centerAltitude,s._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,s.tileSize=this.tileSize,s.mercatorFromTransition=this.mercatorFromTransition,s.width=this.width,s.height=this.height,s.cameraElevationReference=this.cameraElevationReference,s._center=this._center,s._setZoom(this.zoom),s._seaLevelZoom=this._seaLevelZoom,s.angle=this.angle,s._fov=this._fov,s._pitch=this._pitch,s._nearZ=this._nearZ,s._farZ=this._farZ,s._averageElevation=this._averageElevation,s._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,s._unmodified=this._unmodified,s._edgeInsets=this._edgeInsets.clone(),s._camera=this._camera.clone(),s._calcMatrices(),s.freezeTileCoverage=this.freezeTileCoverage,s.frustumCorners=this.frustumCorners,s}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(s){this._elevation!==s&&(this._elevation=s,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(s,c=!1){const _=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||_)&&this._updateCameraOnTerrain(),(s||_)&&this._constrainCamera(c),this._calcMatrices()}getProjection(){return h.ay(this.projection,["name","center","parallels"])}setProjection(s){this.projectionOptions=s||{name:"mercator"};const c=this.projection?this.getProjection():void 0;this.projection=h.bP(this.projectionOptions);const _=this.getProjection(),v=!h.bn(c,_);return v&&this._calcMatrices(),this.mercatorFromTransition=!1,v}setOrthographicProjectionAtLowPitch(s){return this._orthographicProjectionAtLowPitch!==s&&(this._orthographicProjectionAtLowPitch=s,this._calcMatrices(),!0)}setMercatorFromTransition(){const s=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=h.bP({name:"mercator"});const c=s!==this.projection.name;return c&&this._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(s){this._minZoom!==s&&(this._minZoom=s,this.zoom=Math.max(this.zoom,s))}get maxZoom(){return this._maxZoom}set maxZoom(s){this._maxZoom!==s&&(this._maxZoom=s,this.zoom=Math.min(this.zoom,s))}get minPitch(){return this._minPitch}set minPitch(s){this._minPitch!==s&&(this._minPitch=s,this.pitch=Math.max(this.pitch,s))}get maxPitch(){return this._maxPitch}set maxPitch(s){this._maxPitch!==s&&(this._maxPitch=s,this.pitch=Math.min(this.pitch,s))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(s){void 0===s?s=!0:null===s&&(s=!1),this._renderWorldCopies=s}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const s=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(s))}get cameraWorldSize(){const s=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(s))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return h.bH(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.P(this.width,this.height)}get bearing(){return h.bF(this.rotation,-180,180)}set bearing(s){this.rotation=s}get rotation(){return-this.angle/Math.PI*180}set rotation(s){const c=-s*Math.PI/180;this.angle!==c&&(this._unmodified=!1,this.angle=c,this._calcMatrices(),this.rotationMatrix=h.ab.mat2.create(),h.ab.mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(s){const c=h.aw(s,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==c&&(this._unmodified=!1,this._pitch=c,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const s=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/s)}set fov(s){s=Math.max(.01,Math.min(60,s)),this._fov!==s&&(this._unmodified=!1,this._fov=h.ai(s),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(s){this._averageElevation=s,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(s){const c=Math.min(Math.max(s,this.minZoom),this.maxZoom);this._zoom!==c&&(this._unmodified=!1,this._setZoom(c),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(s){this._zoom=s,this.scale=this.zoomScale(s),this.tileZoom=Math.floor(s),this.zoomFraction=s-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(s){this._tileCoverLift!==s&&(this._tileCoverLift=s)}_updateCameraOnTerrain(){const s=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,c=this.elevation&&s===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||s===Number.NEGATIVE_INFINITY&&(!c||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const _=this._elevation;c||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&_.exaggeration()&&this._centerAltitudeValidForExaggeration!==_.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*_.exaggeration(),this._centerAltitudeValidForExaggeration=_.exaggeration()):(this._centerAltitude=s||0,this._centerAltitudeValidForExaggeration=_.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const s=this._elevation,c=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],_=this.horizonLineFromTop();let v=0,C=0;for(let D=0;D{const ie=h.c5(G,H,W,Q,ae);O.has(ie)||(v.push(new h.aG(H,G,W,Q,ae)),O.add(ie))};for(let H=0;H0,be=W.y+10,Te=G.wrap-(de?0:1),Le=G.wrap+(ce?0:1),Me=de?W.x-1:ie-1,Pe=ce?W.x+1:0;if(C)_[0]<0?(B(Q,Le,W.z,Pe,W.y),_[1]<0&&be&&(B(Q,ae,W.z,W.x,W.y+1),B(Q,Le,W.z,Pe,W.y+1)),_[1]>0&&De&&(B(Q,ae,W.z,W.x,W.y-1),B(Q,Le,W.z,Pe,W.y-1))):_[0]>0?(B(Q,Te,W.z,Me,W.y),_[1]<0&&be&&(B(Q,ae,W.z,W.x,W.y+1),B(Q,Te,W.z,Me,W.y+1)),_[1]>0&&De&&(B(Q,ae,W.z,W.x,W.y-1),B(Q,Te,W.z,Me,W.y-1))):_[1]<0&&be?B(Q,ae,W.z,W.x,W.y+1):De&&B(Q,ae,W.z,W.x,W.y-1);else{const Ae=G.visibleQuadrants;1&Ae&&(B(Q,Te,W.z,Me,W.y),De&&(B(Q,ae,W.z,W.x,W.y-1),B(Q,Te,W.z,Me,W.y-1))),2&Ae&&(B(Q,Le,W.z,Pe,W.y),De&&(B(Q,ae,W.z,W.x,W.y-1),B(Q,Le,W.z,Pe,W.y-1))),4&Ae&&(B(Q,Te,W.z,Me,W.y),be&&(B(Q,ae,W.z,W.x,W.y+1),B(Q,Te,W.z,Me,W.y+1))),8&Ae&&(B(Q,Le,W.z,Pe,W.y),be&&(B(Q,ae,W.z,W.x,W.y+1),B(Q,Le,W.z,Pe,W.y+1)))}}const U=[];for(const H of v)v.some(G=>H.isChildOf(G))||U.push(H);if(v=U.filter(H=>!s.some(G=>!!(H.overscaledZ{const ce=ie.canonical.x+.5-W[0],de=ie.canonical.y+.5-W[1];return ce*ce+de*des.maxzoom&&(c=s.maxzoom);const O=this.locationCoordinate(this.center),B=this.center.lat,U=1<{const xt=new h.aa(tt.x+25e-6,tt.y,tt.z),rn=new h.aa(tt.x,tt.y+25e-6,tt.z),$t=tt.toLngLat(),Ft=xt.toLngLat(),Kt=rn.toLngLat(),en=this.locationCoordinate($t),Sn=this.locationCoordinate(Ft),Rn=this.locationCoordinate(Kt),Tt=Math.hypot(Sn.x-en.x,Sn.y-en.y),Wn=Math.hypot(Rn.x-en.x,Rn.y-en.y);return Math.sqrt(Tt*Wn)*Pe/25e-6},Ve=tt=>{const zt=Le,xt=Me;return{aabb:h.bV(this,U,0,0,0,tt,xt,zt,this.projection),zoom:0,x:0,y:0,minZ:xt,maxZ:zt,wrap:tt,fullyVisible:!1}},Ye=[];let vt=[];const Ke=c,Mt=s.reparseOverscaled?_:c,Rt=(ce-this._centerAltitude)*ie,nt=tt=>{if(!this._elevation||!tt.tileID||!D)return;const zt=this._elevation.getMinMaxForTile(tt.tileID),xt=tt.aabb;zt?(xt.min[2]=zt.min,xt.max[2]=zt.max,xt.center[2]=(xt.min[2]+xt.max[2])/2):(tt.shouldSplit=Ut(tt),tt.shouldSplit||(xt.min[2]=xt.max[2]=xt.center[2]=this._centerAltitude))},wt=(tt,zt)=>{if(.707*zt{if(tt.zoom=.9)return!0}else if(C&&(rn=tt.aabb.distanceZ(de)*ie),this.projection.isReprojectedInTileSpace&&_<=5){const Wn=Math.pow(2,tt.zoom),Xn=Ae(new h.aa((tt.x+.5)/Wn,(tt.y+.5)/Wn));$t=Xn>.85?1:Xn}if(!D){const Wn=Math.sqrt(zt*zt+xt*xt+rn*rn);let Xn=(1<0;){const tt=Ye.pop(),zt=tt.x,xt=tt.y;let rn=tt.fullyVisible;const $t=()=>"globe"===this.projection.name&&(0===tt.y||tt.y===(1<>1),Sn={aabb:D?tt.aabb.quadrant(Ft):h.bV(this,U,tt.zoom+1,Kt,en,tt.wrap,tt.minZ,tt.maxZ,this.projection),zoom:tt.zoom+1,x:Kt,y:en,wrap:tt.wrap,fullyVisible:rn,tileID:void 0,shouldSplit:void 0,minZ:tt.minZ,maxZ:tt.maxZ};C&&!G&&(Sn.tileID=new h.aG(tt.zoom+1===Ke?Mt:tt.zoom+1,tt.wrap,tt.zoom+1,Kt,en),nt(Sn)),Ye.push(Sn)}else{const Ft=tt.zoom===Ke?Mt:tt.zoom;if(s.minzoom&&s.minzoom>Ft)continue;let Kt=0;if(!rn){let Tt=be?tt.aabb.intersectsPrecise(Q):tt.aabb.intersectsPreciseFlat(Q);if(0===Tt&&$t()){const Wn=new h.bT(tt.zoom,zt,xt);Tt=h.bU(this,U,Wn,!0).intersectsPrecise(Q)}if(0===Tt)continue;if(s.calculateQuadrantVisibility)if(Q.containsPoint(tt.aabb.center))Kt=15;else for(let Wn=0;Wn<4;Wn++)0!==tt.aabb.quadrant(Wn).intersects(Q)&&(Kt|=1<{const rn=[0,0,0,1],$t=[h.ag,h.ag,0,1],Ft=this.calculateFogTileMatrix(xt.tileID.toUnwrapped());h.ab.vec4.transformMat4(rn,rn,Ft),h.ab.vec4.transformMat4($t,$t,Ft);const Kt=h.ab.vec4.min([],rn,$t),en=h.ab.vec4.max([],rn,$t),Sn=h.bW(Kt,en);if(0===Sn)return!0;let Rn=!1;const Tt=this._elevation;if(Tt&&Sn>tt&&0!==zt){const Wn=this.calculateProjMatrix(xt.tileID.toUnwrapped());let Xn;s.isTerrainDEM||(Xn=Tt.getMinMaxForTile(xt.tileID)),Xn||(Xn={min:Me,max:Le});const vi=h.c7(this.rotation),uo=[vi[0]*h.ag,vi[1]*h.ag,Xn.max];h.ab.vec3.transformMat4(uo,uo,Wn),Rn=(1-uo[1])*this.height*.5tt.distanceSq-zt.distanceSq).map(tt=>tt.tileID)}resize(s,c){this.width=s,this.height=c,this.pixelsToGLUnits=[2/s,-2/c],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(s){return Math.pow(2,s)}scaleZoom(s){return Math.log(s)/Math.LN2}project(s){const c=h.aw(s.lat,-h.bX,h.bX),_=this.projection.project(s.lng,c);return new h.P(_.x*this.worldSize,_.y*this.worldSize)}unproject(s){return this.projection.unproject(s.x/this.worldSize,s.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/h.bH(1,this.center.lat)/this.worldSize}setLocationAtPoint(s,c){let _,v;const C=this.centerPoint;if("globe"===this.projection.name){const O=this.worldSize;_=(c.x-C.x)/O,v=(c.y-C.y)/O}else{const O=this.pointCoordinate(c),B=this.pointCoordinate(C);_=O.x-B.x,v=O.y-B.y}const D=this.locationCoordinate(s);this.setLocation(new h.aa(D.x-_,D.y-v))}setLocation(s){this.center=this.coordinateLocation(s),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(s){return this.projection.locationPoint(this,s)}locationPoint3D(s){return this.projection.locationPoint(this,s,!0)}pointLocation(s){return this.coordinateLocation(this.pointCoordinate(s))}pointLocation3D(s){return this.coordinateLocation(this.pointCoordinate3D(s))}locationCoordinate(s,c){const _=c?h.bH(c,s.lat):void 0,v=this.projection.project(s.lng,s.lat);return new h.aa(v.x,v.y,_)}coordinateLocation(s){return this.projection.unproject(s.x,s.y)}pointRayIntersection(s,c){const _=c??this._centerAltitude,v=[s.x,s.y,0,1],C=[s.x,s.y,1,1];h.ab.vec4.transformMat4(v,v,this.pixelMatrixInverse),h.ab.vec4.transformMat4(C,C,this.pixelMatrixInverse);const D=C[3];h.ab.vec4.scale(v,v,1/v[3]),h.ab.vec4.scale(C,C,1/D);const O=v[2],B=C[2];return{p0:v,p1:C,t:O===B?0:(_-O)/(B-O)}}screenPointToMercatorRay(s){const c=[s.x,s.y,0,1],_=[s.x,s.y,1,1];return h.ab.vec4.transformMat4(c,c,this.pixelMatrixInverse),h.ab.vec4.transformMat4(_,_,this.pixelMatrixInverse),h.ab.vec4.scale(c,c,1/c[3]),h.ab.vec4.scale(_,_,1/_[3]),c[2]=h.bH(c[2],this._center.lat)*this.worldSize,_[2]=h.bH(_[2],this._center.lat)*this.worldSize,h.ab.vec4.scale(c,c,1/this.worldSize),h.ab.vec4.scale(_,_,1/this.worldSize),new h.aq([c[0],c[1],c[2]],h.ab.vec3.normalize([],h.ab.vec3.sub([],_,c)))}rayIntersectionCoordinate(s){const{p0:c,p1:_,t:v}=s,C=h.bH(c[2],this._center.lat),D=h.bH(_[2],this._center.lat);return new h.aa(h.af(c[0],_[0],v)/this.worldSize,h.af(c[1],_[1],v)/this.worldSize,h.af(C,D,v))}pointCoordinate(s,c=this._centerAltitude){return this.projection.pointCoordinate(this,s.x,s.y,c)}pointCoordinate3D(s){if(!this.elevation)return this.pointCoordinate(s);let c=this.projection.pointCoordinate3D(this,s.x,s.y);if(c)return new h.aa(c[0],c[1],c[2]);let _=0,v=this.horizonLineFromTop();if(s.y>v)return this.pointCoordinate(s);const C=.02*v,D=s.clone();for(let O=0;O<10&&v-_>C;O++){D.y=h.af(_,v,.66);const B=this.projection.pointCoordinate3D(this,D.x,D.y);B?(v=D.y,c=B):_=D.y}return c?new h.aa(c[0],c[1],c[2]):this.pointCoordinate(s)}isPointAboveHorizon(s){return this.projection.isPointAboveHorizon(this,s)}isPointOnSurface(s){if(s.y<0||s.y>this.height||s.x<0||s.x>this.width)return!1;if(this.elevation||this.zoom>=h.bY)return!this.isPointAboveHorizon(s);const c=this.pointCoordinate(s);return c.y>=0&&c.y<=1}_coordinatePoint(s,c){const _=c&&this.elevation?this.elevation.getAtPointOrZero(s,this._centerAltitude):this._centerAltitude,v=[s.x*this.worldSize,s.y*this.worldSize,_+s.toAltitude(),1];return h.ab.vec4.transformMat4(v,v,this.pixelMatrix),v[3]>0?new h.P(v[0]/v[3],v[1]/v[3]):new h.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:s,left:c}=this._edgeInsets,_=this.height-this._edgeInsets.bottom,v=this.width-this._edgeInsets.right,C=this.pointLocation3D(new h.P(c,s)),D=this.pointLocation3D(new h.P(v,s)),O=this.pointLocation3D(new h.P(v,_)),B=this.pointLocation3D(new h.P(c,_));let U=Math.min(C.lng,D.lng,O.lng,B.lng),H=Math.max(C.lng,D.lng,O.lng,B.lng),G=Math.min(C.lat,D.lat,O.lat,B.lat),W=Math.max(C.lat,D.lat,O.lat,B.lat);const Q=Math.pow(2,-this.zoom)/16*270,ae="globe"===this.projection.name?1:4,ie=(ce,de,be,De,Te)=>{const Le=(ce+be)/2,Me=(de+De)/2,Pe=new h.P(Le,Me),{lng:Ae,lat:Ve}=this.pointLocation3D(Pe),Ye=Math.max(0,U-Ae,G-Ve,Ae-H,Ve-W);U=Math.min(U,Ae),H=Math.max(H,Ae),G=Math.min(G,Ve),W=Math.max(W,Ve),(TeQ)&&(ie(ce,de,Le,Me,Te+1),ie(Le,Me,be,De,Te+1))};if(ie(c,s,v,s,1),ie(v,s,v,_,1),ie(v,_,c,_,1),ie(c,_,c,s,1),"globe"===this.projection.name){const[ce,de]=h.bZ(this);ce?(W=90,H=180,U=-180):de&&(G=-90,H=180,U=-180)}return new h.az(new h.bO(U,G),new h.bO(H,W))}_getBoundsRectangular(s,c){const{top:_,left:v}=this._edgeInsets,C=this.height-this._edgeInsets.bottom,D=this.width-this._edgeInsets.right,O=new h.P(v,_),B=new h.P(D,_),U=new h.P(D,C),H=new h.P(v,C);let G=this.pointCoordinate(O,s),W=this.pointCoordinate(B,s);const Q=this.pointCoordinate(U,c),ae=this.pointCoordinate(H,c),ie=(ce,de)=>(de.y-ce.y)/(de.x-ce.x);return G.y>1&&W.y>=0?G=new h.aa((1-ae.y)/ie(ae,G)+ae.x,1):G.y<0&&W.y<=1&&(G=new h.aa(-ae.y/ie(ae,G)+ae.x,0)),W.y>1&&G.y>=0?W=new h.aa((1-Q.y)/ie(Q,W)+Q.x,1):W.y<0&&G.y<=1&&(W=new h.aa(-Q.y/ie(Q,W)+Q.x,0)),(new h.az).extend(this.coordinateLocation(G)).extend(this.coordinateLocation(W)).extend(this.coordinateLocation(ae)).extend(this.coordinateLocation(Q))}_getBoundsRectangularTerrain(){const s=this.elevation;if(!s.visibleDemTiles.length||s.isUsingMockSource())return this._getBoundsRectangular(0,0);const c=s.visibleDemTiles.reduce((_,v)=>{if(v.dem){const C=v.dem.tree;_.min=Math.min(_.min,C.minimums[0]),_.max=Math.max(_.max,C.maximums[0])}return _},{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(c.min*s.exaggeration(),c.max*s.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(s=!0){const c=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,_=this.height/2-c*(1-this._horizonShift);return s?Math.max(0,_):_}getMaxBounds(){return this.maxBounds}setMaxBounds(s){this.maxBounds=s,this.minLat=-h.bX,this.maxLat=h.bX,this.minLng=-180,this.maxLng=180,s&&(this.minLat=s.getSouth(),this.maxLat=s.getNorth(),this.minLng=s.getWest(),this.maxLng=s.getEast(),this.maxLngG&&(O=G-U),G-HQ&&(D=Q-B),Q-W{for(let Ut=0;Ut<16;Ut++)Mt[Ut]=Ub(Rt[Ut],nt[Ut],wt)})(O,O,B,oc(this.pitch>=15?1:this.pitch/15))}else O=B;const U=h.ab.mat4.mul([],B,D);let H=h.ab.mat4.mul([],O,D);if(this.projection.isReprojectedInTileSpace){const Ve=this.locationCoordinate(this.center),Ye=h.ab.mat4.identity([]);h.ab.mat4.translate(Ye,Ye,[Ve.x*this.worldSize,Ve.y*this.worldSize,0]),h.ab.mat4.multiply(Ye,Ye,h.c0(this)),h.ab.mat4.translate(Ye,Ye,[-Ve.x*this.worldSize,-Ve.y*this.worldSize,0]),h.ab.mat4.multiply(H,H,Ye),h.ab.mat4.multiply(U,U,Ye),this.inverseAdjustmentMatrix=h.c1(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=h.ab.mat4.scale([],H,[this.worldSize,this.worldSize,this.worldSize/C,1]),this.projMatrix=H,this.invProjMatrix=h.ab.mat4.invert(new Float64Array(16),this.projMatrix),c){const Ve=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);Ve[8]=2*-s.x/this.width,Ve[9]=2*s.y/this.height,this.expandedFarZProjMatrix=h.ab.mat4.mul([],Ve,D)}else this.expandedFarZProjMatrix=this.projMatrix;const G=h.ab.mat4.invert([],O);this.frustumCorners=h.c2.fromInvProjectionMatrix(G,this.horizonLineFromTop(),this.height),this.cameraFrustum=h.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!c);const W=new Float32Array(16);h.ab.mat4.identity(W),h.ab.mat4.scale(W,W,[1,-1,1]),h.ab.mat4.rotateX(W,W,this._pitch),h.ab.mat4.rotateZ(W,W,this.angle);const Q=h.ab.mat4.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=h.ab.mat4.clone(Q);const ae=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;Q[8]=2*-s.x/this.width,Q[9]=2*(s.y+ae)/this.height,this.skyboxMatrix=h.ab.mat4.multiply(W,Q,W);const ie=this.point,ce=ie.x,de=ie.y,be=this.width%2/2,De=this.height%2/2,Te=Math.cos(this.angle),Le=Math.sin(this.angle),Me=ce-Math.round(ce)+Te*be+Le*De,Pe=de-Math.round(de)+Te*De+Le*be,Ae=new Float64Array(H);if(h.ab.mat4.translate(Ae,Ae,[Me>.5?Me-1:Me,Pe>.5?Pe-1:Pe,0]),this.alignedProjMatrix=Ae,H=h.ab.mat4.create(),h.ab.mat4.scale(H,H,[this.width/2,-this.height/2,1]),h.ab.mat4.translate(H,H,[1,-1,0]),this.labelPlaneMatrix=H,H=h.ab.mat4.create(),h.ab.mat4.scale(H,H,[1,-1,1]),h.ab.mat4.translate(H,H,[-1,-1,0]),h.ab.mat4.scale(H,H,[2/this.width,2/this.height,1]),this.glCoordMatrix=H,this.pixelMatrix=h.ab.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,U),this._calcFogMatrices(),this._distanceTileDataCache={},H=h.ab.mat4.invert(new Float64Array(16),this.pixelMatrix),!H)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=H,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=h.c3(this);const Ve=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=h.ab.vec3.transformMat4(Ve,Ve,D),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=H;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const s=this.cameraWorldSizeForFog,c=this.cameraPixelsPerMeter,_=this._camera.position,v=1/this.height/this._pixelsPerMercatorPixel,C=[s,s,c];h.ab.vec3.scale(C,C,v),h.ab.vec3.scale(_,_,-1),h.ab.vec3.multiply(_,_,C);const D=h.ab.mat4.create();h.ab.mat4.translate(D,D,_),h.ab.mat4.scale(D,D,C),this.mercatorFogMatrix=D,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(s,c,v)}_computeCameraPosition(s){const c=(s=s||this.pixelsPerMeter)/this.pixelsPerMeter,_=this._camera.forward(),v=this.point,C=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*c-s/this.worldSize*this._centerAltitude;return[v.x/this.worldSize-_[0]*C,v.y/this.worldSize-_[1]*C,s/this.worldSize*this._centerAltitude-_[2]*C]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(s){const c=this._maxCameraBoundsDistance()*Math.cos(this._pitch),_=this._camera.position[2],v=s[2];let C=1;this.projection.wrap&&(this.center=this.center.wrap()),v>0&&(C=Math.min((c-_)/v,1)),this._camera.position=h.ab.vec3.scaleAndAdd([],this._camera.position,s,C),this._updateStateFromCamera()}_updateStateFromCamera(){const s=this._camera.position,c=this._camera.forward(),{pitch:_,bearing:v}=this._camera.getPitchBearing(),C=h.bH(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,D=this._mercatorZfromZoom(this._maxZoom)*Math.cos(h.ai(this._maxPitch)),O=Math.max((s[2]-C)/Math.cos(_),D),B=this._zoomFromMercatorZ(O);h.ab.vec3.scaleAndAdd(s,s,c,O),this._pitch=h.aw(_,h.ai(this.minPitch),h.ai(this.maxPitch)),this.angle=h.bF(v,-Math.PI,Math.PI),this._setZoom(h.aw(B,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new h.aa(s[0],s[1],s[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(s){return Math.pow(2,s)*this.tileSize}_mercatorZfromZoom(s){return this.cameraToCenterDistance/this._worldSizeFromZoom(s)}_minimumHeightOverTerrain(){const s=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(s)}_zoomFromMercatorZ(s){return this.scaleZoom(this.cameraToCenterDistance/(s*this.tileSize))}zoomFromMercatorZAdjusted(s){let c=0,_=h.bY,v=0,C=1/0;for(;_-c>1e-6&&_>c;){const D=c+.5*(_-c),O=this.tileSize*Math.pow(2,D),B=this.getCameraToCenterDistance(this.projection,D,O),U=this.scaleZoom(B/(s*this.tileSize)),H=Math.abs(D-U);HU||W.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+h.c4(this.fovAboveCenter)>88||this.anyCornerOffEdge(new h.P(0,0),new h.P(this.width,this.height))}zoomDeltaToMovement(s,c){const _=h.ab.vec3.length(h.ab.vec3.sub([],this._camera.position,s)),v=this._zoomFromMercatorZ(_)+c;return _-this._mercatorZfromZoom(v)}getCameraPoint(){if("globe"===this.projection.name){const s=function([c,_,v],C){const D=[c,_,v,1];h.ab.vec4.transformMat4(D,D,C);const O=D[3]=Math.max(D[3],1e-6);return D[0]/=O,D[1]/=O,D[2]/=O,D}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new h.P(s[0],s[1])}{const s=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.P(0,s))}}getCameraToCenterDistance(s,c=this.zoom,_=this.worldSize){const v=h.b$(s,c,this.width,this.height,1024),C=s.pixelSpaceConversion(this.center.lat,_,v);let D=.5/Math.tan(.5*this._fov)*this.height*C;return this.isOrthographic&&(D=Ub(1,D,oc(this.pitch>=15?1:this.pitch/15))),D}getWorldToCameraMatrix(){const s=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&h.ab.mat4.multiply(s,s,this.globeMatrix),s}getFrustum(s){return h.bR.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,s,"meters"===this.projection.zAxisUnit)}}const _l=(f,s)=>{if(s>0&&f.terrain&&h.w("Cutoff is currently disabled on terrain"),s<=0||f.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const c=f.transform,_=Math.max(Math.abs(c._zoom-(f.minCutoffZoom-1)),1),v=c.isLODDisabled(!1)?h.ac(60,45,c.pitch):h.ac(30,15,c.pitch),C=c._farZ-c._nearZ,D=s*c.height,O=((1-(B=v))*c.cameraToCenterDistance+B*(c._farZ+D))*_;var B;return{shouldRenderCutoff:v<1,uniformValues:{u_cutoff_params:[c._nearZ,c._farZ,(O-c._nearZ)/C,(O-D-c._nearZ)/C]}}},Ds={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class ql{constructor(s,c){this.aabb=s,this.lastCascade=c}}class Hb{add(s,c){const _=this.receivers[s.key];void 0!==_?(_.aabb.min[0]=Math.min(_.aabb.min[0],c.min[0]),_.aabb.min[1]=Math.min(_.aabb.min[1],c.min[1]),_.aabb.min[2]=Math.min(_.aabb.min[2],c.min[2]),_.aabb.max[0]=Math.max(_.aabb.max[0],c.max[0]),_.aabb.max[1]=Math.max(_.aabb.max[1],c.max[1]),_.aabb.max[2]=Math.max(_.aabb.max[2],c.max[2])):this.receivers[s.key]=new ql(c,null)}clear(){this.receivers={}}get(s){return this.receivers[s.key]}computeRequiredCascades(s,c,_){const v=h.cd.fromPoints(s.points);let C=0;for(const D in this.receivers){const O=this.receivers[D];if(!O||!v.intersectsAabb(O.aabb))continue;O.aabb.min=v.closestPoint(O.aabb.min),O.aabb.max=v.closestPoint(O.aabb.max);const B=O.aabb.getCorners();for(let U=0;U<_.length;U++){let H=!0;for(const G of B){const W=[G[0]*c,G[1]*c,G[2]];if(h.ab.vec3.transformMat4(W,W,_[U].matrix),W[0]<-1||W[0]>1||W[1]<-1||W[1]>1){H=!1;break}}if(O.lastCascade=U,C=Math.max(C,U),H)break}}return C+1}}class cs{constructor(s){this.painter=s,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new Hb,this._depthMode=new Jn(s.context.gl.LEQUAL,Jn.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,s.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},()=>{this.painter.style.map.triggerRepaint()}),s.tp.registerParameter(Ds,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),s.tp.registerParameter(Ds,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),s.tp.registerParameter(Ds,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),s.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const s of this._cascades)s.texture.destroy(),s.framebuffer.destroy();this._cascades=[]}updateShadowParameters(s,c){const _=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!c||!c.properties)return;const v=c.properties.get("shadow-intensity");if(!c.shadowsEnabled()||v<=0||(this._shadowLayerCount=_.style.order.reduce((ae,ie)=>{const ce=_.style._mergedLayers[ie];return ae+(ce.hasShadowPass()&&!ce.isHidden(s.zoom)?1:0)},0),this._enabled=this._shadowLayerCount>0,!this.enabled))return;const C=_.context,D=Ds.shadowMapResolution,O=Ds.shadowMapResolution;if(0===this._cascades.length||Ds.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let ae=0;aece.dem).forEach(ce=>{const de=ce.dem.tree;ie[0]=Math.min(ie[0],de.minimums[0]),ie[1]=Math.max(ie[1],de.maximums[0])}),1e4!==ie[0]&&(B=(ie[1]-ie[0])*ae.exaggeration())}const U=1.5*s.cameraToCenterDistance,H=3*U,G=new Float64Array(16);for(let ae=0;ae=0)return{};const C=function(B,U,H){const G=H/(1<0&&(h.ab.vec3.add(C[1],C[1],[v[0]*D,0,0]),h.ab.vec3.add(C[2],C[2],[v[0]*D,0,0])),v[1]<0?(h.ab.vec3.add(C[0],C[0],[0,v[1]*D,0]),h.ab.vec3.add(C[1],C[1],[0,v[1]*D,0])):v[1]>0&&(h.ab.vec3.add(C[2],C[2],[0,v[1]*D,0]),h.ab.vec3.add(C[3],C[3],[0,v[1]*D,0]));const O={};return O.vertices=C,O.planes=[Vc(C[1],C[0],C[4]),Vc(C[2],C[1],C[5]),Vc(C[3],C[2],C[6]),Vc(C[0],C[3],C[7])],O}addShadowReceiver(s,c,_){this._receivers.add(s,h.cd.fromTileIdAndHeight(s,c,_))}getMaxCascadeForTile(s){const c=this._receivers.get(s);return c&&c.lastCascade?c.lastCascade:0}}function Vc(f,s,c){const _=h.ab.vec3.sub([],c,s),v=h.ab.vec3.sub([],f,s),C=h.ab.vec3.cross([],_,v),D=h.ab.vec3.length(C);return 0===D?[0,0,1,0]:(h.ab.vec3.scale(C,C,1/D),[C[0],C[1],C[2],-h.ab.vec3.dot(C,s)])}function fh(f){const s=f.properties.get("direction"),c=h.cb(s.x,s.y,s.z);c[2]=h.aw(c[2],0,75);const _=h.ce([c[0],c[1],c[2]]);return h.ab.vec3.fromValues(_.x,_.y,_.z)}function lm(f,s,c){const _="none"===s.properties.get("color-use-theme"),v=s.properties.get("color"),C=s.properties.get("intensity"),D=s.properties.get("direction"),O=[D.x,D.y,D.z],B="none"===c.properties.get("color-use-theme"),U=c.properties.get("color"),H=c.properties.get("intensity"),G=Math.max(h.ab.vec3.dot([0,0,1],O),0),W=[0,0,0];h.ab.vec3.scale(W,U.toRenderColor(B?null:f.getLut(s.scope)).toArray01Linear().slice(0,3),H);const Q=[0,0,0];return h.ab.vec3.scale(Q,v.toRenderColor(_?null:f.getLut(c.scope)).toArray01Linear().slice(0,3),G*C),h.cf([W[0]>0?W[0]/(W[0]+Q[0]):0,W[1]>0?W[1]/(W[1]+Q[1]):0,W[2]>0?W[2]/(W[2]+Q[2]):0])}function G_(f,s,c,_,v,C){const D=f.zoom,O=f.scale,B=f.worldSize,U=1/B,H=f.aspect,G=Math.sqrt(1+H*H)*Math.tan(.5*f.fovX),W=G*G,Q=_-c,ae=_+c;let ie,ce;W>Q/ae?(ie=_,ce=_*G):(ie=.5*ae*(1+W),ce=.5*Math.sqrt(Q*Q+2*(_*_+c*c)*W+ae*ae*W*W));const de=f.projection.pixelsPerMeter(f.center.lat,B),be=f._camera.getCameraToWorldMercator(),De=[0,0,-ie*U];h.ab.vec3.transformMat4(De,De,be);let Te=ce*U;const Le=f._edgeInsets;if(!(0===Le.left&&0===Le.top&&0===Le.right&&0===Le.bottom||Le.left===Le.right&&Le.top===Le.bottom)){const rn=f._camera.getWorldToCamera(f.worldSize,"meters"===f.projection.zAxisUnit?de:1),$t=f._camera.getCameraToClipPerspective(f._fov,f.width/f.height,c,_);$t[8]=2*-f.centerOffset.x/f.width,$t[9]=2*f.centerOffset.y/f.height;const Ft=new Float64Array(16);h.ab.mat4.mul(Ft,$t,rn);const Kt=new Float64Array(16);h.ab.mat4.invert(Kt,Ft);const en=h.bR.fromInvProjectionMatrix(Kt,B,D,!0);for(const Sn of en.points){const Rn=((Me=Sn)[0]/=O,Me[1]/=O,Me[2]=h.bH(Me[2],f._center.lat),Me);Te=Math.max(Te,h.ab.vec3.len(h.ab.vec3.subtract([],De,Rn)))}}var Me;Te*=v/(v-1);const Pe=Math.acos(s[2]),Ae=Math.atan2(-s[0],-s[1]),Ve=new Gl;Ve.position=De,Ve.setPitchBearing(Pe,Ae);const Ye=Ve.getWorldToCamera(B,de),vt=Te*B,Ke=Math.min(f._mercatorZfromZoom(17)*B*-2,-2*vt),Mt=Ve.getCameraToClipOrthographic(-vt,vt,-vt,vt,Ke,(vt+C*de)/s[2]),Rt=new Float64Array(16);h.ab.mat4.multiply(Rt,Mt,Ye);const nt=h.ab.vec3.fromValues(Math.floor(1e6*De[0])/1e6*B,Math.floor(1e6*De[1])/1e6*B,0),wt=.5*v,Ut=[0,0,0];h.ab.vec3.transformMat4(Ut,nt,Rt),h.ab.vec3.scale(Ut,Ut,wt);const tt=[Math.floor(Ut[0]),Math.floor(Ut[1]),Math.floor(Ut[2])],zt=[0,0,0];h.ab.vec3.sub(zt,Ut,tt),h.ab.vec3.scale(zt,zt,-1/wt);const xt=new Float64Array(16);return h.ab.mat4.identity(xt),h.ab.mat4.translate(xt,xt,zt),h.ab.mat4.multiply(Rt,xt,Rt),[Rt,vt]}class q_ extends h.E{constructor(s){super(),this.requestManager=s,this.models={"":{}},this.modelUris={"":{}},this.numModelsLoading={}}loadModel(s,c){return h.aM(this.requestManager.transformRequest(c,h.R.Model).url).then(_=>{if(!_)return;const v=h.aN(_),C=new h.aO(s,void 0,void 0,v);return C.computeBoundsAndApplyParent(),C}).catch(_=>{if(_&&404===_.status)return null;this.fire(new h.y(new Error(`Could not load model ${s} from ${c}: ${_.message}`)))})}load(s,c,_={keepNumReferences:!1}){this.models[c]||(this.models[c]={});const v=Object.keys(s);this.numModelsLoading[c]=(this.numModelsLoading[c]||0)+v.length;const C=[];for(const D of v)C.push(this.loadModel(D,s[D]));Promise.allSettled(C).then(D=>{for(let O=0;O{this.fire(new h.y(new Error(`Could not load models: ${D.message}`)))})}isLoaded(){for(const s in this.numModelsLoading)if(this.numModelsLoading[s]>0)return!1;return!0}hasModel(s,c){return!!this.getModel(s,c)}getModel(s,c){return this.models[c]||(this.models[c]={}),this.models[c][s]?this.models[c][s].model:void 0}addModel(s,c,_){this.models[_]||(this.models[_]={}),this.modelUris[_]||(this.modelUris[_]={}),this.hasModel(s,_)&&this.models[_][s].numReferences++,this.modelUris[_][s]=this.requestManager.normalizeModelURL(c),this.load({[s]:this.modelUris[_][s]},_)}addModels(s,c){this.models[c]||(this.models[c]={}),this.modelUris[c]||(this.modelUris[c]={});const _=this.modelUris[c];for(const v in s)this.models[c][v]={},_[v]=this.requestManager.normalizeModelURL(s[v]);this.load(_,c,{keepNumReferences:!0})}reloadModels(s){this.load(this.modelUris[s],s)}addModelsFromBucket(s,c){this.models[c]||(this.models[c]={}),this.modelUris[c]||(this.modelUris[c]={});const _={};for(const v of s)this.hasModel(v,c)?this.models[c][v].numReferences++:(this.modelUris[c][v]=this.requestManager.normalizeModelURL(v),_[v]=this.modelUris[c][v]);this.load(_,c)}removeModel(s,c){if(this.models[c]&&this.models[c][s]&&(this.models[c][s].numReferences--,0===this.models[c][s].numReferences)){const _=this.models[c][s].model;delete this.models[c][s],delete this.modelUris[c][s],_.destroy()}}listModels(s){return this.models[s]||(this.models[s]={}),Object.keys(this.models[s])}upload(s,c){this.models[c]||(this.models[c]={});for(const _ in this.models[c])this.models[c][_].model&&this.models[c][_].model.upload(s.context)}}const D0=new h.a5({data:new h.a6(h.a3.colorTheme.data)}),rc={"mbx-indoor-active-floorplans":{default:["literal",[]]},"mbx-indoor-underground":{default:["literal",!1]},"mbx-indoor-loaded-levels":{default:["literal",[]]},"mbx-indoor-level-height":{default:["literal",{}]},"mbx-indoor-level-base":{default:["literal",{}]},"mbx-indoor-level-selected":{default:["literal",{}]},"mbx-indoor-level-overlapped":{default:["literal",{}]}};function xf(f){return f=f||{},Object.assign(f,rc)}class ip extends h.E{constructor(s){super(),this.mergeFloors=!0,this._scope=void 0,this._queryFeatureSetId=void 0,this._buildingEntryFeatureSetId=void 0,this._selectedFloorplan=void 0,this._indoorData=void 0,this._selectedLevel=void 0,this._floorplanStates={},h.aP(["_onLoad","_onMove","_checkFloorplanVisible"],this),this._map=s,this._checkFloorplanVisible(!0),this._map.on("load",this._onLoad),this._map.on("move",this._onMove)}destroy(){this._map.indoor.off("load",this._onLoad),this._map.indoor.off("move",this._onMove),this._map=void 0}_onLoad(){this._map.style.forEachFragmentStyle(s=>{s.stylesheet.indoor&&(this._queryFeatureSetId?this.fire(new h.y(new Error("Multiple indoor map styles detected, simultaneous usage is not allowed currently."))):(this._queryFeatureSetId=s.stylesheet.indoor.floorplanFeaturesetId,this._buildingEntryFeatureSetId=s.stylesheet.indoor.buildingFeaturesetId,this._scope=s.scope))}),this._queryFeatureSetId&&this._buildingEntryFeatureSetId&&this._map.addInteraction("mbx-indoor-buildingclick",{type:"click",target:{featuresetId:this._buildingEntryFeatureSetId,importId:this._scope},handler:s=>(s.feature&&s.feature.properties.floorplan&&this.selectFloorplan(s.feature.properties.floorplan),!0)}),this._checkFloorplanVisible(!0)}_onMove(){this._checkFloorplanVisible(!1)}_checkFloorplanVisible(s){if(!this._queryFeatureSetId||!this._map.isStyleLoaded()||this._map.transform.zoom<13)return;this._indoorData&&!function(D,O){const[B,U]=D,{center:H,radius:G}=O,[W,Q]=H,ae=Math.abs(B-W);return Math.sqrt((ae>180?360-ae:ae)**2+(U-Q)**2)<=G}([this._map.getCenter().lng,this._map.getCenter().lat],this._indoorData.circumCircle)&&(this._indoorData=void 0,this._selectedFloorplan=void 0,this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",["literal",[]]),this.fire(new h.z("floorplangone")));const c={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},_=new h.P(this._map.transform.width/2,this._map.transform.height/2),v=[new h.P(0,0),new h.P(this._map.transform.width,this._map.transform.height)],C=this._map.queryRenderedFeatures(s?v:_,c);C.length>0&&(this._selectedFloorplan&&C[0].properties.id===this._selectedFloorplan.properties.id||(this._selectedFloorplan=C[0],this._floorplanSelected(!1)))}_floorplanSelected(s){this._indoorData=JSON.parse(this._selectedFloorplan.properties["indoor-data"]),this._indoorData.id=this._selectedFloorplan.properties.id,this._indoorData.circumCircle=function(C){const[[D,O],[B,U]]=C,H=(B-D+360)%360,G=H>180?360-H:H;return{center:[(D+G/2+360)%360,(O+U)/2],radius:Math.sqrt(G**2+(U-O)**2)/2}}(this._indoorData.extent),this._floorplanStates[this._indoorData.id]||(this._floorplanStates[this._indoorData.id]={});const c=this._floorplanStates[this._indoorData.id].selectedBuilding,_=this._floorplanStates[this._indoorData.id].selectedLevel;let v;if(this._map.setConfigProperty(this._scope,"mbx-indoor-active-floorplans",this._indoorData.floorplanIDs),this._selectedLevel)for(const C of this._indoorData.levels)C.id===this._selectedLevel.id&&(v=C.id);if(this.fire(new h.z("floorplanselected",{buildings:this._indoorData.buildings,levels:this._indoorData.levels,selectedLevelId:v})),c){const C=this._indoorData.buildings.find(D=>D.id===c);this._buildingSelected(C,!1)}else this._indoorData.buildings.length>0&&this._buildingSelected(this._indoorData.buildings[0],!1);if(_){const C=this._indoorData.levels.find(D=>D.id===_);this._updateLevels(C,s)}else s&&this._indoorData["default-levels"].length>0&&this.selectLevel(this._indoorData["default-levels"][0])}_buildingSelected(s,c){c&&s&&s.extent&&this._map.fitBounds(s.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}),this._floorplanStates[this._indoorData.id].selectedBuilding=s?s.id:void 0;const _=this._indoorData.levels.filter(v=>s.levels.includes(v.id));this.fire(new h.z("buildingselected",{buildingId:s.id,levels:_}))}_levelSelected(s){if("overview"===s)this._updateLevels(void 0,!0);else{const c=this._indoorData.levels.find(_=>_.id===s);this._updateLevels(c,!0)}this.fire(new h.z("levelselected",{levelId:"overview"===s?void 0:s}))}_updateLevels(s,c){if(!s)return this._map.setConfigProperty(this._scope,"mbx-indoor-loaded-levels",["literal",[]]),this._map.setConfigProperty(this._scope,"mbx-indoor-underground",!1),this._floorplanStates[this._indoorData.id].selectedLevel=void 0,void(c&&this._indoorData.extent&&this._map.fitBounds(this._indoorData.extent,{pitch:this._map.getPitch(),bearing:this._map.getBearing()}));function _(U){const H=U.indexOf("/floor/");if(-1===H)return U;const G=H+7,W=U.indexOf("/",G);return-1===W?U.slice(G):U.slice(G,W)}this._selectedLevel=s,this._floorplanStates[this._indoorData.id].selectedLevel=s?s.id:void 0;const v=[],C={},D={},O={},B={};for(const U of this._indoorData.levels)if(v.push(U.id),C[U.id]=U.height,D[U.id]=U.base,s){if(this.mergeFloors){const H=_(s.id),G=_(U.id);O[U.id]=G===H?"true":"false"}else O[U.id]=U.id===s.id?"true":"false";B[U.id]=U.base=1?{pitch:this._map.getPitch(),bearing:this._map.getBearing()}:{pitch:this._map.getPitch(),bearing:this._map.getBearing(),zoom:H})}}selectFloorplan(s){const c={target:{featuresetId:this._queryFeatureSetId,importId:this._scope}},_=[new h.P(0,0),new h.P(this._map.transform.width,this._map.transform.height)],v=this._map.queryRenderedFeatures(_,c);if(v.length>0)for(const C of v)if(JSON.parse(C.properties["indoor-data"]).floorplanIDs.includes(s)){this._selectedFloorplan=C,this._floorplanSelected(!0);break}}selectBuilding(s){const c=this._indoorData.buildings.find(_=>_.id===s);this._buildingSelected(c,!0)}selectLevel(s){this._levelSelected(s)}}function uw(f){if(!f.metadata||!f.metadata.content_area)return;const s=h.q.devicePixelRatio,{left:c,top:_,width:v,height:C}=f.metadata.content_area,D=c*s,O=_*s;return[D,O,D+v*s,O+C*s]}function Uc(f){if(f)return f.map(([s,c])=>[s*h.q.devicePixelRatio,c*h.q.devicePixelRatio])}const qo=(f,s)=>za(f,s&&s.filter(c=>"source.canvas"!==c.identifier)),Hc=h.ay(Zi,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setSnow","setRain","setProjection","setCamera","addImport","removeImport","updateImport"]),jb=h.ay(Zi,["setCenter","setZoom","setBearing","setPitch"]),wf=new Set(["background","sky","slot","custom"]),_h={version:8,layers:[],sources:{}},ac={duration:300,delay:0};class co extends h.E{constructor(s,c={}){super(),this.map=s,this.scope=c.scope||"",this.globalId=null,this.fragments=[],this.importDepth=c.importDepth||0,this.importsCache=c.importsCache||new Map,this.resolvedImports=c.resolvedImports||new Set,this.transition=h.l({},ac),this._buildingIndex=new Cs(this),this.crossTileSymbolIndex=new j_,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerPresent=!1,this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=c.styleChanges||new Wo,this.dispatcher=c.dispatcher?c.dispatcher:new h.D(h.ci(),this),c.imageManager?this.imageManager=c.imageManager:(this.imageManager=new fa(this.map._spriteFormat),this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=c.glyphManager?c.glyphManager:new h.cj(s._requestManager,c.localFontFamily?h.ck.all:c.localIdeographFontFamily?h.ck.ideographs:h.ck.none,c.localFontFamily||c.localIdeographFontFamily),c.modelManager?this.modelManager=c.modelManager:(this.modelManager=new q_(s._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this.options=c.configOptions?c.configOptions:new Map,this._configDependentLayers=c.configDependentLayers?c.configDependentLayers:new Set,this._config=c.config,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null,colorThemeOverride:c.colorThemeOverride},this._styleColorThemeForScope={},this._initialConfig=c.initialConfig,this.dispatcher.broadcast("setReferrer",h.cl());const _=this;this._rtlTextPluginCallback=co.registerForPluginStateChange(v=>{_.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:v.pluginStatus,pluginURL:v.pluginURL},(C,D)=>{if(h.cm(C),D&&D.every(O=>O))for(const O in _._sourceCaches){const B=_._sourceCaches[O],U=B.getSource().type;"vector"!==U&&"geojson"!==U||B.reload()}})}),this.on("data",v=>{if("source"!==v.dataType||"metadata"!==v.sourceDataType)return;const C=this.getOwnSource(v.sourceId);if(C&&C.vectorLayerIds)for(const D in this._layers){const O=this._layers[D];O.source===C.id&&this._validateLayer(O)}})}load(s){return s?("string"==typeof s?this.loadURL(s):this.loadJSON(s),this):this}_getGlobalId(s){if(!s)return null;if("string"==typeof s){if(h.f(s))return s;const c=h.cn(s);if(!c.startsWith("http"))try{return new URL(c,location.href).toString()}catch{return c}return c}return`json://${h.co(JSON.stringify(s))}`}_diffStyle(s,c,_){this.globalId=this._getGlobalId(s);const v=(C,D)=>{try{D(null,this.setState(C,_))}catch(O){D(O,!1)}};if("string"==typeof s){const C=this.map._requestManager.normalizeStyleURL(s),D=this.map._requestManager.transformRequest(C,h.R.Style);h.n(D,(O,B)=>{O?this.fire(new h.y(O)):B&&v(B,c)})}else"object"==typeof s&&v(s,c)}loadURL(s,c={}){this.fire(new h.z("dataloading",{dataType:"style"}));const _="boolean"==typeof c.validate?c.validate:!h.f(s);this.globalId=this._getGlobalId(s),s=this.map._requestManager.normalizeStyleURL(s,c.accessToken),this.resolvedImports.add(s);const v=this.importsCache.get(s);if(v)return this._load(v,_);const C=this.map._requestManager.transformRequest(s,h.R.Style);this._request=h.n(C,(D,O)=>{if(this._request=null,D)this.fire(new h.y(D));else if(O)return this.importsCache.set(s,O),this._load(O,_)})}loadJSON(s,c={}){this.fire(new h.z("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(s),this._request=h.q.frame(()=>{this._request=null,this._load(s,!1!==c.validate)})}loadEmpty(){this.fire(new h.z("dataloading",{dataType:"style"})),this._load(_h,!1)}_loadImports(s,c,_){if(this.importDepth>=4)return h.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const v=[];for(const C of s){const D=this._createFragmentStyle(C),O=new Promise(H=>{D.once("style.import.load",H),D.once("error",H)}).then(()=>this.mergeAll());if(v.push(O),this.resolvedImports.has(C.url)){D.loadEmpty();continue}const B=C.data||this.importsCache.get(C.url);B?(D.loadJSON(B,{validate:c}),this._isInternalStyle(B)&&(D.globalId=null)):C.url?D.loadURL(C.url,{validate:c}):D.loadEmpty();const U={style:D,id:C.id,config:C.config};if(_){const H=this.fragments.findIndex(({id:G})=>G===_);this.fragments=this.fragments.slice(0,H).concat(U).concat(this.fragments.slice(H))}else this.fragments.push(U)}return Promise.allSettled(v)}getImportGlobalIds(s=this,c=new Set){for(const _ of s.fragments)_.style.globalId&&c.add(_.style.globalId),this.getImportGlobalIds(_.style,c);return[...c.values()]}_createFragmentStyle(s){const c=this.scope?h.aC(s.id,this.scope):s.id;let _;const v=this._initialConfig&&this._initialConfig[c];(s.config||v)&&(_=h.l({},s.config,v));const C=new co(this.map,{scope:c,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:_,configOptions:this.options,colorThemeOverride:s["color-theme"],configDependentLayers:this._configDependentLayers});return C.setEventedParent(this.map,{style:C}),C}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(s){return this.isRootStyle()&&(s.fragment||!!s.schema&&!1!==s.fragment)}_load(s,c){const _=s.indoor?xf(s.schema):s.schema;if(this._isInternalStyle(s)){const D=h.l({},_h,{imports:[{id:"basemap",data:s,url:""}]});return void this._load(D,c)}if(this.updateConfig(this._config,_),c&&qo(this,Vs(s)))return;this._loaded=!0,this.stylesheet=h.cp(s);const v=()=>{for(const U in s.sources)this.addSource(U,s.sources[U],{validate:!1,isInitialLoad:!0});s.sprite?this._loadIconset(s.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(s.glyphs,this.scope);const D=ic(this.stylesheet.layers);if(this._order=D.map(U=>U.id),this.stylesheet.light&&h.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const U=this.stylesheet.lights[0];this.light=new re(U.properties,U.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new re(this.stylesheet.light)),this._layers={};for(const U of D){const H=h.cu(U,this.scope,this._styleColorTheme.lut,this.options);0!==H.configDependencies.size&&this._configDependentLayers.add(H.fqid),H.setEventedParent(this,{layer:{id:H.id}}),this._layers[H.id]=H;const G=this.getOwnLayerSourceCache(H),W=!!this.directionalLight&&this.directionalLight.shadowsEnabled();G&&H.canCastShadows()&&W&&(G.castsShadows=!0)}this.stylesheet.featuresets&&this.setFeaturesetSelectors(this.stylesheet.featuresets),this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const O=this.stylesheet.terrain;O&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(O,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.snow&&this._createSnow(this.stylesheet.snow),this.stylesheet.rain&&this._createRain(this.stylesheet.rain),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new h.z("data",{dataType:"style"}));const B=this.isRootStyle();s.imports?this._loadImports(s.imports,c).then(()=>{this._reloadImports(),this.fire(new h.z(B?"style.load":"style.import.load"))}):(this._reloadImports(),this.fire(new h.z(B?"style.load":"style.import.load")))};this._styleColorTheme.colorTheme=this.stylesheet["color-theme"];const C=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(C){const D=this._evaluateColorThemeData(C);this._loadColorTheme(D).then(()=>{v()}).catch(O=>{h.w(`Couldn't load color theme from the stylesheet: ${O}`),v()})}else this._styleColorTheme.lut=null,v()}isRootStyle(){return 0===this.importDepth}mergeAll(){let s,c,_,v,C,D,O,B,U,H;const G={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(W=>{if(W.stylesheet){if(null!=W.light&&(s=W.light),W.stylesheet.lights)for(const Q of W.stylesheet.lights)"ambient"===Q.type&&null!=W.ambientLight&&(c=W.ambientLight),"directional"===Q.type&&null!=W.directionalLight&&(_=W.directionalLight);v=this._prioritizeTerrain(v,W.terrain,W.stylesheet.terrain),W.stylesheet.fog&&null!=W.fog&&(C=W.fog),W.stylesheet.snow&&null!=W.snow&&(D=W.snow),W.stylesheet.rain&&null!=W.rain&&(O=W.rain),null!=W.stylesheet.camera&&(H=W.stylesheet.camera),null!=W.stylesheet.projection&&(B=W.stylesheet.projection),null!=W.stylesheet.transition&&(U=W.stylesheet.transition),G[W.scope]=W._styleColorTheme}}),this.light=s,this.ambientLight=c,this.directionalLight=_,this.fog=C,this.snow=D,this.rain=O,this._styleColorThemeForScope=G,null===v?delete this.terrain:this.terrain=v,this.camera=H||{"camera-projection":"perspective"},this.projection=B||{name:"mercator"},this.transition=h.l({},ac,U),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(s){const c=_=>{for(const v of _.fragments)c(v.style);s(_)};c(this)}_prioritizeTerrain(s,c,_){const v=s&&0===s.drapeRenderMode;return null===_?c&&0===c.drapeRenderMode?c:v?s:null:null!=c&&(!s||v||c&&1===c.drapeRenderMode)?c:s}mergeTerrain(){let s;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle(c=>{s=this._prioritizeTerrain(s,c.terrain,c.stylesheet.terrain)}),null===s?delete this.terrain:this.terrain=s}mergeProjection(){let s;this.forEachFragmentStyle(c=>{null!=c.stylesheet.projection&&(s=c.stylesheet.projection)}),this.projection=s||{name:"mercator"}}mergeSources(){const s={},c={},_={};this.forEachFragmentStyle(v=>{for(const C in v._sourceCaches){const D=h.aC(C,v.scope);s[D]=v._sourceCaches[C]}for(const C in v._otherSourceCaches){const D=h.aC(C,v.scope);c[D]=v._otherSourceCaches[C]}for(const C in v._symbolSourceCaches){const D=h.aC(C,v.scope);_[D]=v._symbolSourceCaches[C]}}),this._mergedSourceCaches=s,this._mergedOtherSourceCaches=c,this._mergedSymbolSourceCaches=_}mergeLayers(){const s={},c=[],_={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle(C=>{for(const D of C._order){const O=C._layers[D];if("slot"===O.type){const B=h.cq(D);if(s[B])continue;s[B]=[]}O.slot&&s[O.slot]?s[O.slot].push(O):c.push(O)}}),this._mergedOrder=[];const v=(C=[])=>{for(const D of C)if("slot"===D.type){const O=h.cq(D.id);s[O]&&v(s[O]),this._mergedSlots.push(O)}else{const O=h.aC(D.id,D.scope);this._mergedOrder.push(O),_[O]=D,D.is3D()&&(this._has3DLayers=!0),"circle"===D.type&&(this._hasCircleLayers=!0),"symbol"===D.type&&(this._hasSymbolLayers=!0),"clip"===D.type&&(this._clipLayerPresent=!0)}};v(c),this._mergedOrder.sort((C,D)=>{const O=_[C],B=_[D];return O.hasInitialOcclusionOpacityProperties?B.is3D()?1:0:O.is3D()&&B.hasInitialOcclusionOpacityProperties?-1:0}),this._mergedLayers=_,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(s){return this.stylesheet.camera=h.l({},this.stylesheet.camera,s),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(s){return s.data?function(c,_,v){const C=h.l({},_);for(const O of Object.keys(h.a3.colorTheme))void 0===C[O]&&(C[O]=h.a3.colorTheme[O].default);const D=new h.a4(D0,c,new Map(v));return D.setTransitionOrValue(C,v),D.untransitioned().possiblyEvaluate(new h.a8(0))}(this.scope,s,this.options).get("data"):null}_loadColorTheme(s){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const c=this._styleColorTheme.lutLoadingCorrelationID;return new Promise((_,v)=>{const C="data:image/png;base64,";if(!s||0===s.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void _();let D=s;D.startsWith(C)||(D=C+D);const O="mapbox-reserved-lut",B=new Image;B.src=D,B.onerror=()=>{this._styleColorTheme.lutLoading=!1,v(new Error("Failed to load image data"))},B.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==c)return void _();this._styleColorTheme.lutLoading=!1;const{width:U,height:H,data:G}=h.q.getImageData(B);if(H>32)return void v(new Error("The height of the image must be less than or equal to 32 pixels."));if(U!==H*H)return void v(new Error("The width of the image must be equal to the height squared."));this.getImage(O)&&this.removeImage(O),this.addImage(O,{data:new h.r({width:U,height:H},G),pixelRatio:1,sdf:!1,usvg:!1,version:0});const W=this.imageManager.getImage(O,this.scope);W?(this._styleColorTheme.lut={image:W.data,data:s},_()):v(new Error("Missing LUT image."))}})}getLut(s){const c=this._styleColorThemeForScope[s];return c?c.lut:null}setProjection(s){s?this.stylesheet.projection=s:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(s){this._spriteRequest=function(c,_,v){let C,D,O;const B=h.q.devicePixelRatio>1?"@2x":"";let U=h.n(_.transformRequest(_.normalizeSpriteURL(c,B,".json"),h.R.SpriteJSON),(W,Q)=>{U=null,O||(O=W,C=Q,G())}),H=h.o(_.transformRequest(_.normalizeSpriteURL(c,B,".png"),h.R.SpriteImage),(W,Q)=>{H=null,O||(O=W,D=Q,G())});function G(){if(O)v(O);else if(C&&D){const W=h.q.getImageData(D),Q={};for(const ae in C){const{width:ie,height:ce,x:de,y:be,sdf:De,pixelRatio:Te,stretchX:Le,stretchY:Me,content:Pe}=C[ae],Ae=new h.r({width:ie,height:ce});h.r.copy(W,Ae,{x:de,y:be},{x:0,y:0},{width:ie,height:ce},null),Q[ae]={data:Ae,pixelRatio:Te,sdf:De,stretchX:Le,stretchY:Me,content:Pe,usvg:!1}}v(null,Q)}}return{cancel(){U&&(U.cancel(),U=null),H&&(H.cancel(),H=null)}}}(s,this.map._requestManager,(c,_)=>{if(this._spriteRequest=null,c)this.fire(new h.y(c));else if(_)for(const v in _)this.imageManager.addImage(v,this.scope,_[v]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new h.z("data",{dataType:"style"}))})}_loadIconset(s){if(!h.f(s)&&"icon_set"!==this.map._spriteFormat||"raster"===this.map._spriteFormat)return void this._loadSprite(s);const c="auto"===this.map._spriteFormat;var _,v;this._spriteRequest=(v=(C,D)=>{if(this._spriteRequest=null,C)c?this._loadSprite(s):this.fire(new h.y(C));else if(D)for(const O in D)this.imageManager.addImage(O,this.scope,D[O]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new h.z("data",{dataType:"style"}))},h.bi((_=this.map._requestManager).transformRequest(_.normalizeIconsetURL(s),h.R.Iconset),(C,D)=>{if(C)return void v(C);const O={},B=h.cg(new h.bh(D));for(const U of B.icons){const H={version:1,pixelRatio:h.q.devicePixelRatio,content:uw(U),stretchX:U.metadata?Uc(U.metadata.stretch_x_areas):void 0,stretchY:U.metadata?Uc(U.metadata.stretch_y_areas):void 0,sdf:!1,usvg:!0,icon:U};O[U.name]=H}v(null,O)}))}_validateLayer(s){const c=this.getOwnSource(s.source);if(!c)return;const _=s.sourceLayer;_&&("geojson"===c.type||c.vectorLayerIds&&-1===c.vectorLayerIds.indexOf(_))&&this.fire(new h.y(new Error(`Source layer "${_}" does not exist on source "${c.id}" as specified by style layer "${s.id}"`)))}loaded(){if(!this._loaded||Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const s in this._sourceCaches)if(!this._sourceCaches[s].loaded())return!1;if(!this.imageManager.isLoaded()||!this.modelManager.isLoaded()||this._styleColorTheme.lutLoading)return!1;for(const{style:s}of this.fragments)if(!s.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map((s,c)=>{const _=this.fragments[c];return _&&_.style&&(s.data=_.style.serialize()),s})}_serializeSources(){const s={};for(const c in this._sourceCaches){const _=this._sourceCaches[c].getSource();s[_.id]||(s[_.id]=_.serialize())}return s}_serializeLayers(s){const c=[];for(const _ of s){const v=this._layers[_];v&&"custom"!==v.type&&c.push(v.serialize())}return c}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasSnowTransition(){return!!this.snow&&this.snow.hasTransition()}hasRainTransition(){return!!this.rain&&this.rain.hasTransition()}hasTransitions(){if(this.hasLightTransitions()||this.hasFogTransition()||this.hasSnowTransition()||this.hasRainTransition())return!0;for(const s in this._sourceCaches)if(this._sourceCaches[s].hasTransition())return!0;for(const s in this._layers)if(this._layers[s].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}_getOrder(s){return s?this.order:this._mergedOrder}isLayerDraped(s){return!!this.terrain&&s.isDraped(this.getLayerSourceCache(s))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(s){const c=this.getOwnLayer(s);if(c)return c;this.fire(new h.y(new Error(`The layer '${s}' does not exist in the map's style.`)))}_checkSource(s){const c=this.getOwnSource(s);if(c)return c;this.fire(new h.y(new Error(`The source '${s}' does not exist in the map's style.`)))}precompilePrograms(s,c){const _=this.map.painter;if(_)for(let v=s.minzoom||0;v<(s.maxzoom||25.5);v++){const C=s.getProgramIds();if(C)for(const D of C){const O=s.getDefaultProgramParams(D,c.zoom,this._styleColorTheme.lut);O&&(_.style=this,this.fog&&(_._fogVisible=!0,O.overrideFog=!0,_.getOrCreateProgram(D,O)),_._fogVisible=!1,O.overrideFog=!1,_.getOrCreateProgram(D,O),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(O.overrideRtt=!0,_.getOrCreateProgram(D,O)))}}}update(s){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(s),this.directionalLight&&this.directionalLight.recalculate(s);const c=this.calculateLightsBrightness();s.brightness=c||0,c!==this._brightness&&(this._brightness=c,this.dispatcher.broadcast("setBrightness",c));const _=this._changes.isDirty();let v=!1;if(this._changes.isDirty()){const D=this._changes.getLayerUpdatesByScope();for(const O in D){const{updatedIds:B,removedIds:U}=D[O];(B||U)&&(this._updateWorkerLayers(O,B,U),v=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(s),this.light&&this.light.updateTransitions(s),this.ambientLight&&this.ambientLight.updateTransitions(s),this.directionalLight&&this.directionalLight.updateTransitions(s),this.fog&&this.fog.updateTransitions(s),this.snow&&this.snow.updateTransitions(s),this.rain&&this.rain.updateTransitions(s),this._changes.reset()}const C={};for(const D in this._mergedSourceCaches){const O=this._mergedSourceCaches[D];C[D]=O.used,O.used=!1,O.tileCoverLift=0}for(const D of this._mergedOrder){const O=this._mergedLayers[D];if(O.recalculate(s,this._availableImages),!O.isHidden(s.zoom)){const B=this.getLayerSourceCache(O);B&&(B.used=!0,B.tileCoverLift=Math.max(B.tileCoverLift,O.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback(()=>{this.precompilePrograms(O,s)}):this.precompilePrograms(O,s))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&v&&this.mergeLayers();for(const D in C){const O=this._mergedSourceCaches[D];C[D]!==O.used&&O.getSource().fire(new h.z("data",{sourceDataType:"visibility",dataType:"source",sourceId:O.getSource().id}))}this.light&&this.light.recalculate(s),this.terrain&&this.terrain.recalculate(s),this.fog&&this.fog.recalculate(s),this.snow&&this.snow.recalculate(s),this.rain&&this.rain.recalculate(s),this.z=s.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),_&&this.fire(new h.z("data",{dataType:"style"}))}_updateTilesForChangedImages(){const s=this._changes.getUpdatedImages();if(s.length){for(const c in this._sourceCaches)this._sourceCaches[c].reloadTilesForDependencies(["icons","patterns"],s);this._changes.resetUpdatedImages()}}_updateWorkerLayers(s,c,_){const v=this.getFragmentStyle(s);v&&this.dispatcher.broadcast("updateLayers",{layers:c?v._serializeLayers(c):[],scope:s,removedIds:_||[],options:v.options})}setState(s,c){if(this._checkLoaded(),qo(this,Vs(s)))return!1;(s=h.cp(s)).layers=ic(s.layers);const _=function(D,O){if(!D)return[{command:Zi.setStyle,args:[O]}];let B=[];try{if(!h.bn(D.version,O.version))return[{command:Zi.setStyle,args:[O]}];if(h.bn(D.center,O.center)||B.push({command:Zi.setCenter,args:[O.center]}),h.bn(D.zoom,O.zoom)||B.push({command:Zi.setZoom,args:[O.zoom]}),h.bn(D.bearing,O.bearing)||B.push({command:Zi.setBearing,args:[O.bearing]}),h.bn(D.pitch,O.pitch)||B.push({command:Zi.setPitch,args:[O.pitch]}),h.bn(D.sprite,O.sprite)||B.push({command:Zi.setSprite,args:[O.sprite]}),h.bn(D.glyphs,O.glyphs)||B.push({command:Zi.setGlyphs,args:[O.glyphs]}),h.bn(D.imports,O.imports)||function(Q=[],ae=[],ie){ae=ae||[];const ce=(Q=Q||[]).map(ml),de=ae.map(ml),be=Q.reduce(uh,{}),De=ae.reduce(uh,{}),Te=ce.slice();let Le,Me,Pe,Ae;for(Le=0,Me=0;Le{Q.source&&U[Q.source]?B.push({command:Zi.removeLayer,args:[Q.id]}):G.push(Q)});let W=D.terrain;W&&U[W.source]&&(B.push({command:Zi.setTerrain,args:[void 0]}),W=void 0),B=B.concat(H),h.bn(W,O.terrain)||B.push({command:Zi.setTerrain,args:[O.terrain]}),function(Q,ae,ie){ae=ae||[];const ce=(Q=Q||[]).map(ml),de=ae.map(ml),be=Q.reduce(uh,{}),De=ae.reduce(uh,{}),Te=ce.slice(),Le=Object.create(null);let Me,Pe,Ae,Ve,Ye,vt,Ke;for(Me=0,Pe=0;Me!(D.command in jb));if(0===_.length)return!1;const v=_.filter(D=>!(D.command in Hc));if(v.length>0)throw new Error(`Unimplemented: ${v.map(D=>D.command).join(", ")}.`);const C=[];return _.forEach(D=>{C.push(this[D.command].apply(this,D.args))}),c&&Promise.all(C).then(c),this.stylesheet=s,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(s,c){return this.getImage(s)?this.fire(new h.y(new Error("An image with this name already exists."))):(this.imageManager.addImage(s,this.scope,c),this._afterImageUpdated(s),this)}updateImage(s,c,_=!1){this.imageManager.updateImage(s,this.scope,c),_&&this._afterImageUpdated(s)}getImage(s){return this.imageManager.getImage(s,this.scope)}removeImage(s){return this.getImage(s)?(this.imageManager.removeImage(s,this.scope),this._afterImageUpdated(s),this):this.fire(new h.y(new Error("No image with this name exists.")))}_afterImageUpdated(s){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(s),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new h.z("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(s,c,_={}){return this._checkLoaded(),this._validate(Jh,`models.${s}`,c,null,_)||(this.modelManager.addModel(s,c,this.scope),this._changes.setDirty()),this}hasModel(s){return this.modelManager.hasModel(s,this.scope)}removeModel(s){return this.hasModel(s)?(this.modelManager.removeModel(s,this.scope),this):this.fire(new h.y(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(s,c,_={}){if(this._checkLoaded(),void 0!==this.getOwnSource(s))throw new Error(`There is already a source with ID "${s}".`);if(!c.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(c).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(c.type)>=0&&this._validate(as,`sources.${s}`,c,null,_))return;this.map&&this.map._collectResourceTiming&&(c.collectResourceTiming=!0);const v=ss(s,c,this.dispatcher,this);v.scope=this.scope,v.setEventedParent(this,()=>({isSourceLoaded:this._isSourceCacheLoaded(v.id),source:v.serialize(),sourceId:v.id}));const C=D=>{const O=(D?"symbol:":"other:")+v.id,B=h.aC(O,this.scope),U=this._sourceCaches[O]=new yn(B,v,D);(D?this._symbolSourceCaches:this._otherSourceCaches)[v.id]=U,U.onAdd(this.map)};C(!1),"vector"!==c.type&&"geojson"!==c.type||C(!0),v.onAdd&&v.onAdd(this.map),_.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(s){this._checkLoaded();const c=this.getOwnSource(s);if(!c)throw new Error("There is no source with this ID");for(const v in this._layers)if(this._layers[v].source===s)return this.fire(new h.y(new Error(`Source "${s}" cannot be removed while layer "${v}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===s)return this.fire(new h.y(new Error(`Source "${s}" cannot be removed while terrain is using it.`)));const _=this.getOwnSourceCaches(s);for(const v of _){const C=h.cq(v.id);delete this._sourceCaches[C],this._changes.discardSourceCacheUpdate(v.id),v.fire(new h.z("data",{sourceDataType:"metadata",dataType:"source",sourceId:v.getSource().id})),v.setEventedParent(null),v.clearTiles()}return delete this._otherSourceCaches[s],delete this._symbolSourceCaches[s],this.mergeSources(),c.setEventedParent(null),c.onRemove&&c.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(s,c){this._checkLoaded(),this.getOwnSource(s).setData(c),this._changes.setDirty()}getOwnSource(s){const c=this.getOwnSourceCache(s);return c&&c.getSource()}getOwnSources(){const s=[];for(const c in this._otherSourceCaches){const _=this.getOwnSourceCache(c);_&&s.push(_.getSource())}return s}areTilesLoaded(){const s=this._mergedSourceCaches;for(const c in s){const _=s[c]._tiles;for(const v in _){const C=_[v];if("loaded"!==C.state&&"errored"!==C.state)return!1}}return!0}setLights(s){if(this._checkLoaded(),!s)return delete this.ambientLight,void delete this.directionalLight;const c=this._getTransitionParameters();for(const v of s){if(this._validate(sh,"lights",v))return;switch(v.type){case"ambient":if(this.ambientLight){const C=this.ambientLight;C.set(v),C.updateTransitions(c)}else this.ambientLight=new ct(v,on||(on=new h.a5({color:new h.a6(h.a3.properties_light_ambient.color),"color-use-theme":new h.a6({type:"string",default:"default","property-type":"data-constant"}),intensity:new h.a6(h.a3.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const C=this.directionalLight;C.set(v),C.updateTransitions(c)}else this.directionalLight=new ct(v,kt||(kt=new h.a5({direction:new h.ak(h.a3.properties_light_directional.direction),color:new h.a6(h.a3.properties_light_directional.color),"color-use-theme":new h.a6({type:"string",default:"default","property-type":"data-constant"}),intensity:new h.a6(h.a3.properties_light_directional.intensity),"cast-shadows":new h.a6(h.a3.properties_light_directional["cast-shadows"]),"shadow-quality":new h.a6(h.a3.properties_light_directional["shadow-quality"]),"shadow-intensity":new h.a6(h.a3.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const _=new h.a8(this.z||0,c);this.ambientLight&&this.ambientLight.recalculate(_),this.directionalLight&&this.directionalLight.recalculate(_),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const s=this.directionalLight,c=this.ambientLight;if(!s||!c)return;const _=W=>.2126*(W[0]<=.03928?W[0]/12.92:Math.pow((W[0]+.055)/1.055,2.4))+.7152*(W[1]<=.03928?W[1]/12.92:Math.pow((W[1]+.055)/1.055,2.4))+.0722*(W[2]<=.03928?W[2]/12.92:Math.pow((W[2]+.055)/1.055,2.4)),v=s.properties.get("color").toRenderColor(null).toArray01(),C=s.properties.get("intensity"),D=s.properties.get("direction"),O=1-h.cb(D.x,D.y,D.z)[2]/90,B=_(v)*C*O,U=c.properties.get("color").toRenderColor(null).toArray01(),H=c.properties.get("intensity"),G=_(U)*H;return Number(((B+G)/2).toFixed(6))}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const s=[];return this.directionalLight&&s.push(this.directionalLight.get()),this.ambientLight&&s.push(this.ambientLight.get()),s}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(s){if(!s)return this;if(h.cr(s)){const c=h.cs(s),_=this.fragments.find(({id:C})=>C===c);if(!_)throw new Error(`Style import '${s}' not found`);const v=h.cq(s);return _.style.getFragmentStyle(v)}{const c=this.fragments.find(({id:_})=>_===s);return c?c.style:void 0}}setFeaturesetSelectors(s){if(!s)return;const c={},_=(v,C="")=>`${v}::${C}`;this._featuresetSelectors={};for(const v in s){const C=this._featuresetSelectors[v]=[];for(const D of s[v].selectors){if(D.featureNamespace){const B=this.getOwnLayer(D.layer);if(!B){h.w(`Layer is undefined for selector: ${D.layer}`);continue}const U=_(B.source,B.sourceLayer);if(U in c&&c[U]!==D.featureNamespace){h.w(`"featureNamespace ${D.featureNamespace} of featureset ${v}'s selector is not associated to the same source, skip this selector`);continue}c[U]=D.featureNamespace}let O;if(D.properties)for(const B in D.properties){const U=h.U(D.properties[B]);"success"===U.result&&(O=O||{},O[B]=U.value)}C.push({layerId:D.layer,namespace:D.featureNamespace,properties:O,uniqueFeatureID:D._uniqueFeatureID})}}}getFeaturesetDescriptors(s){const c=this.getFragmentStyle(s);if(!c||!c.stylesheet.featuresets)return[];const _=[];for(const v in c.stylesheet.featuresets)_.push({featuresetId:v,importId:c.scope?c.scope:void 0});return _}getFeaturesetLayers(s,c){const _=this.getFragmentStyle(c),v=_.stylesheet.featuresets;if(!v||!v[s])return this.fire(new h.y(new Error(`The featureset '${s}' does not exist in the map's style and cannot be queried.`))),[];const C=[];for(const D of v[s].selectors){const O=_.getOwnLayer(D.layer);O&&C.push(O)}return C}getConfigProperty(s,c){const _=this.getFragmentStyle(s);if(!_)return null;const v=h.aC(c,_.scope),C=_.options.get(v),D=C?C.value||C.default:null;return D?D.serialize():null}setConfigProperty(s,c,_){const v=this.getFragmentStyle(s);if(!v)return;const C=v.stylesheet.indoor?xf(v.stylesheet.schema):v.stylesheet.schema;if(!C||!C[c])return;const D=h.U(_);if("success"!==D.result)return void qo(this,D.value);const O=D.value.expression,B=h.aC(c,v.scope),U=v.options.get(B);if(!U)return;let H;const{minValue:G,maxValue:W,stepValue:Q,type:ae,values:ie}=C[c],ce=h.U(C[c].default);"success"===ce.result&&(H=ce.value.expression),H?(this.options.set(B,Object.assign({},U,{value:O,default:H,minValue:G,maxValue:W,stepValue:Q,type:ae,values:ie})),this.updateConfigDependencies(c)):this.fire(new h.y(new Error(`No schema defined for the config option "${c}" in the "${s}" fragment.`)))}getConfig(s){const c=this.getFragmentStyle(s);if(!c)return null;const _=c.stylesheet.schema;if(!_)return null;const v={};for(const C in _){const D=h.aC(C,c.scope),O=c.options.get(D),B=O?O.value||O.default:null;v[C]=B?B.serialize():null}return v}setConfig(s,c){const _=this.getFragmentStyle(s);_&&(_.updateConfig(c,_.stylesheet.schema),this.updateConfigDependencies())}getSchema(s){const c=this.getFragmentStyle(s);return c?c.stylesheet.schema:null}setSchema(s,c){const _=this.getFragmentStyle(s);_&&(_.stylesheet.schema=c,_.updateConfig(_._config,c),this.updateConfigDependencies())}updateConfig(s,c){if(this._config=s,s||c)if(c)for(const _ in c){let v,C;const D=h.U(c[_].default);if("success"===D.result&&(v=D.value.expression),s&&void 0!==s[_]){const W=h.U(s[_]);"success"===W.result&&(C=W.value.expression)}const{minValue:O,maxValue:B,stepValue:U,type:H,values:G}=c[_];if(v){const W=h.aC(_,this.scope);this.options.set(W,{default:v,value:C,minValue:O,maxValue:B,stepValue:U,type:H,values:G})}else this.fire(new h.y(new Error(`No schema defined for config option "${_}".`)))}else this.fire(new h.y(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(s){for(const c of this._configDependentLayers){const _=this.getLayer(c);if(_){if(s&&!_.configDependencies.has(s))continue;_.possiblyEvaluateVisibility(),this._updateLayer(_)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.snow&&this.snow.updateConfig(this.options),this.rain&&this.rain.updateConfig(this.options),this.forEachFragmentStyle(c=>{const _=c._styleColorTheme.colorThemeOverride?c._styleColorTheme.colorThemeOverride:c._styleColorTheme.colorTheme;if(_){const v=c._evaluateColorThemeData(_);(!c._styleColorTheme.lut&&""!==v||c._styleColorTheme.lut&&v!==c._styleColorTheme.lut.data)&&c.setColorTheme(_)}}),this._changes.setDirty()}addLayer(s,c,_={}){this._checkLoaded();const v=s.id;if(this._layers[v])return void this.fire(new h.y(new Error(`Layer with id "${v}" already exists on this map`)));let C;if("custom"===s.type){if(qo(this,h.ct(s)))return;C=h.cu(s,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof s.source&&(this.addSource(v,s.source),s=h.cp(s),s=h.l(s,{source:v})),this._validate(fd,`layers.${v}`,s,{arrayIndex:-1},_))return;C=h.cu(s,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(C),C.setEventedParent(this,{layer:{id:v}})}0!==C.configDependencies.size&&this._configDependentLayers.add(C.fqid);let D=this._order.length;if(c){const H=this._order.indexOf(c);if(-1===H)return void this.fire(new h.y(new Error(`Layer with id "${c}" does not exist on this map.`)));C.slot===this._layers[c].slot?D=H:h.w(`Layer with id "${c}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(D,0,v),this._layerOrderChanged=!0,this._layers[v]=C;const O=this.getOwnLayerSourceCache(C),B=!!this.directionalLight&&this.directionalLight.shadowsEnabled();O&&C.canCastShadows()&&B&&(O.castsShadows=!0);const U=this._changes.getRemovedLayer(C);if(U&&C.source&&O&&"custom"!==C.type){this._changes.discardLayerRemoval(C);const H=h.aC(C.source,C.scope);U.type!==C.type?this._changes.updateSourceCache(H,"clear"):(this._changes.updateSourceCache(H,"reload"),O.pause())}this._updateLayer(C),C.onAdd&&C.onAdd(this.map),C.scope=this.scope,this.mergeLayers()}moveLayer(s,c){this._checkLoaded();const _=this._checkLayer(s);if(!_||s===c)return;const v=this._order.indexOf(s);this._order.splice(v,1);let C=this._order.length;if(c){const D=this._order.indexOf(c);if(-1===D)return void this.fire(new h.y(new Error(`Layer with id "${c}" does not exist on this map.`)));_.slot===this._layers[c].slot?C=D:h.w(`Layer with id "${c}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(C,0,s),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(s){this._checkLoaded();const c=this._checkLayer(s);if(!c)return;c.setEventedParent(null);const _=this._order.indexOf(s);this._order.splice(_,1),delete this._layers[s],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(c.fqid),this._changes.removeLayer(c);const v=this.getOwnLayerSourceCache(c);if(v&&v.castsShadows){let C=!1;for(const D in this._layers)if(this._layers[D].source===c.source&&this._layers[D].canCastShadows()){C=!0;break}v.castsShadows=C}c.onRemove&&c.onRemove(this.map),this.mergeLayers()}getOwnLayer(s){return this._layers[s]}hasLayer(s){return s in this._mergedLayers}hasLayerType(s){for(const c in this._layers)if(this._layers[c].type===s)return!0;return!1}setLayerZoomRange(s,c,_){this._checkLoaded();const v=this._checkLayer(s);v&&(v.minzoom===c&&v.maxzoom===_||(null!=c&&(v.minzoom=c),null!=_&&(v.maxzoom=_),this._updateLayer(v)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(s,c){this._checkLoaded();const _=this._checkLayer(s);_&&_.slot!==c&&(_.slot=c,this._updateLayer(_))}setFilter(s,c,_={}){this._checkLoaded();const v=this._checkLayer(s);if(v&&!h.bn(v.filter,c))return null==c?(v.filter=void 0,void this._updateLayer(v)):void(this._validate(zr,`layers.${v.id}.filter`,c,{layerType:v.type},_)||(v.filter=h.cp(c),this._updateLayer(v)))}getFilter(s){const c=this._checkLayer(s);if(c)return h.cp(c.filter)}setLayoutProperty(s,c,_,v={}){this._checkLoaded();const C=this._checkLayer(s);if(C&&!h.bn(C.getLayoutProperty(c),_)){if(null!=_&&(!v||!1!==v.validate)&&qo(C,ch.call(Vs,{key:`layers.${s}.layout.${c}`,layerType:C.type,objectKey:c,value:_,styleSpec:h.a3,style:{glyphs:!0,sprite:!0}})))return;C.setLayoutProperty(c,_),0!==C.configDependencies.size&&this._configDependentLayers.add(C.fqid),this._updateLayer(C)}}getLayoutProperty(s,c){const _=this._checkLayer(s);if(_)return _.getLayoutProperty(c)}setPaintProperty(s,c,_,v={}){this._checkLoaded();const C=this._checkLayer(s);if(!C||h.bn(C.getPaintProperty(c),_)||null!=_&&(!v||!1!==v.validate)&&qo(C,lh.call(Vs,{key:`layers.${s}.paint.${c}`,layerType:C.type,objectKey:c,value:_,styleSpec:h.a3})))return;const D=C.setPaintProperty(c,_);0!==C.configDependencies.size&&this._configDependentLayers.add(C.fqid),D&&this._updateLayer(C),this._changes.updatePaintProperties(C)}getPaintProperty(s,c){const _=this._checkLayer(s);if(_)return _.getPaintProperty(c)}setFeatureState(s,c){if(this._checkLoaded(),"target"in s){if("featuresetId"in s.target){const{featuresetId:B,importId:U}=s.target,H=this.getFragmentStyle(U),G=H.getFeaturesetLayers(B);for(const{source:W,sourceLayer:Q}of G)H.setFeatureState({id:s.id,source:W,sourceLayer:Q},c)}else if("layerId"in s.target){const{layerId:B}=s.target,U=this.getLayer(B);this.setFeatureState({id:s.id,source:U.source,sourceLayer:U.sourceLayer},c)}return}const _=s.source,v=s.sourceLayer,C=this._checkSource(_);if(!C)return;const D=C.type;if("geojson"===D&&v)return void this.fire(new h.y(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===D&&!v)return void this.fire(new h.y(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===s.id&&this.fire(new h.y(new Error("The feature id parameter must be provided.")));const O=this.getOwnSourceCaches(_);for(const B of O)B.setFeatureState(v,s.id,c)}removeFeatureState(s,c){if(this._checkLoaded(),"target"in s){if("featuresetId"in s.target){const{featuresetId:B,importId:U}=s.target,H=this.getFragmentStyle(U),G=H.getFeaturesetLayers(B);for(const{source:W,sourceLayer:Q}of G)H.removeFeatureState({id:s.id,source:W,sourceLayer:Q},c)}else if("layerId"in s.target){const{layerId:B}=s.target,U=this.getLayer(B);this.removeFeatureState({id:s.id,source:U.source,sourceLayer:U.sourceLayer},c)}return}const _=s.source,v=this._checkSource(_);if(!v)return;const C=v.type,D="vector"===C?s.sourceLayer:void 0;if("vector"===C&&!D)return void this.fire(new h.y(new Error("The sourceLayer parameter must be provided for vector source types.")));if(c&&"string"!=typeof s.id&&"number"!=typeof s.id)return void this.fire(new h.y(new Error("A feature id is required to remove its specific state property.")));const O=this.getOwnSourceCaches(_);for(const B of O)B.removeFeatureState(D,s.id,c)}getFeatureState(s){if(this._checkLoaded(),"target"in s){let C;if("featuresetId"in s.target){const{featuresetId:D,importId:O}=s.target,B=this.getFragmentStyle(O),U=B.getFeaturesetLayers(D);for(const{source:H,sourceLayer:G}of U){const W=B.getFeatureState({id:s.id,source:H,sourceLayer:G});if(W&&!C)C=W;else if(!h.bn(C,W))return void this.fire(new h.y(new Error("The same feature id exists in multiple sources in the featureset, but their feature states are not consistent through the sources.")))}}else if("layerId"in s.target){const{layerId:D}=s.target,O=this.getLayer(D);C=this.getFeatureState({id:s.id,source:O.source,sourceLayer:O.sourceLayer})}return C}const c=s.source,_=s.sourceLayer,v=this._checkSource(c);if(v){if("vector"!==v.type||_)return void 0===s.id&&this.fire(new h.y(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(c)[0].getFeatureState(_,s.id);this.fire(new h.y(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(s){return this.stylesheet.transition=h.l({},this.stylesheet.transition,s),this.transition=this.stylesheet.transition,this}getTransition(){return h.l({},this.stylesheet.transition)}serialize(){this._checkLoaded();const s=this.getTerrain(),c=s&&this.terrain&&this.terrain.scope===this.scope?s:this.stylesheet.terrain;return h.cv({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:c,fog:this.stylesheet.fog,snow:this.stylesheet.snow,rain:this.stylesheet.rain,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},_=>void 0!==_)}_updateFilteredLayers(s){for(const c of Object.values(this._mergedLayers))s(c)&&this._updateLayer(c)}_updateLayer(s){this._changes.updateLayer(s);const c=this.getLayerSourceCache(s),_=h.aC(s.source,s.scope),v=this._changes.getUpdatedSourceCaches();s.source&&!v[_]&&c&&"raster"!==c.getSource().type&&(this._changes.updateSourceCache(_,"reload"),c.pause()),s.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(s){const c=O=>this._mergedLayers[O].is3D(),_=this.order,v={},C=[];for(let O=_.length-1;O>=0;O--){const B=_[O];if(c(B)){v[B]=O;for(const U of s){const H=U[B];if(H)for(const G of H)C.push(G)}}}C.sort((O,B)=>B.intersectionZ-O.intersectionZ);const D=[];for(let O=_.length-1;O>=0;O--){const B=_[O];if(c(B))for(let U=C.length-1;U>=0;U--){const H=C[U].feature;if(H.layer&&v[H.layer.id]{if(wf.has(H.type))return;const G=this.getOwnLayerSourceCache(H),W=C[G.id]=C[G.id]||{sourceCache:G,layers:{},has3DLayers:!1};H.is3D()&&(W.has3DLayers=!0),W.layers[H.fqid]=W.layers[H.fqid]||{styleLayer:H,targets:[]},W.layers[H.fqid].targets.push({filter:v})};if(c&&c.layers){if(!Array.isArray(c.layers))return this.fire(new h.y(new Error("parameters.layers must be an Array."))),[];for(const H of c.layers){const G=this._layers[H];if(!G)return this.fire(new h.y(new Error(`The layer '${H}' does not exist in the map's style and cannot be queried for features.`))),[];D(G)}}else for(const H in this._layers)D(this._layers[H]);const O=this._queryRenderedFeatures(s,C,_),B=this._flattenAndSortRenderedFeatures(O),U=[];for(const H of B)h.cs(H.layer.id)===this.scope&&U.push(H);return U}queryRenderedFeatureset(s,c,_){let v;c&&!Array.isArray(c)&&c.filter&&(this._validate(zr,"queryRenderedFeatures.filter",c.filter,null,c),v=h.aZ(c.filter));const C="mock",D=[];if(c&&c.target)D.push(Object.assign({},c,{targetId:C,filter:v}));else{const H=this.getFeaturesetDescriptors();for(const G of H)D.push({targetId:C,filter:v,target:G});for(const{style:G}of this.fragments){const W=G.getFeaturesetDescriptors();for(const Q of W)D.push({targetId:C,filter:v,target:Q})}}const O=this.queryRenderedTargets(s,D,_),B=[],U=new Set;for(const H of O)for(const G of H.variants[C])Wr(G,H,U)||B.push(new h.cw(H,G));return B}queryRenderedTargets(s,c,_){const v={},C=(O,B,U,H)=>{const G=v[B.id]=v[B.id]||{sourceCache:B,layers:{},has3DLayers:!1};if(G.layers[O.fqid]=G.layers[O.fqid]||{styleLayer:O,targets:[]},O.is3D()&&(G.has3DLayers=!0),!H)return U.uniqueFeatureID=!1,void G.layers[O.fqid].targets.push(U);G.layers[O.fqid].targets.push(Object.assign({},U,{namespace:H.namespace,properties:H.properties,uniqueFeatureID:H.uniqueFeatureID}))};for(const O of c)if("featuresetId"in O.target){const{featuresetId:B,importId:U}=O.target,H=this.getFragmentStyle(U);if(!H||!H._featuresetSelectors)continue;const G=H._featuresetSelectors[B];if(!G){this.fire(new h.y(new Error(`The featureset '${B}' does not exist in the map's style and cannot be queried for features.`)));continue}for(const W of G){const Q=H.getOwnLayer(W.layerId);Q&&!wf.has(Q.type)&&C(Q,H.getOwnLayerSourceCache(Q),O,W)}}else if("layerId"in O.target){const{layerId:B}=O.target,U=this.getLayer(B);if(!U||wf.has(U.type))continue;C(U,this.getLayerSourceCache(U),O)}const D=this._queryRenderedFeatures(s,v,_);return this._flattenAndSortRenderedFeatures(D)}_queryRenderedFeatures(s,c,_){const v=[],C=!!this.map._showQueryGeometry,D=ii.createFromScreenPoints(s,_);for(const O in c){const B=Iu(D,c[O],this._availableImages,_,C);Object.keys(B).length&&v.push(B)}if(this.placement)for(const O in c){if(!c[O].sourceCache._onlySymbols)continue;const B=Or(D.screenGeometry,c[O],this._availableImages,this.placement.collisionIndex,this.placement.retainedQueryData);Object.keys(B).length&&v.push(B)}return v}querySourceFeatures(s,c){const _=c&&c.filter;_&&this._validate(zr,"querySourceFeatures.filter",_,null,c);let v=[];const C=this.getOwnSourceCaches(s);for(const D of C)v=v.concat(pf(D,c));return v}addSourceType(s,c,_){return co.getSourceType(s)?_(new Error(`A source type called "${s}" already exists.`)):(co.setSourceType(s,c),c.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:s,url:c.workerSourceURL},_):_(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(s,c,_={}){this._checkLoaded();const v=this.light.getLight();let C=!1;for(const O in s)if(!h.bn(s[O],v[O])){C=!0;break}if(!C)return;const D=this._getTransitionParameters();this.light.setLight(s,c,_),this.light.updateTransitions(D)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=h.q.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&h.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(s,c=1){if(this._checkLoaded(),!s)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===c&&delete this.terrain,null===s?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let _=s;const v=null==s.source;if(1===c){if(this.disableElevatedTerrain)return;if("object"==typeof _.source){const O="terrain-dem-src";this.addSource(O,_.source),_=h.cp(_),_=h.l(_,{source:O})}const C=h.l({},_),D={};if(this.terrain&&v){C.source=this.terrain.get().source;const O=this.terrain?this.getFragmentStyle(this.terrain.scope):null;O&&(D.style=O.serialize())}if(this._validate(md,"terrain",C,D))return}if(!this.terrain||this.terrain.scope!==this.scope&&!v||this.terrain&&c!==this.terrain.drapeRenderMode){if(!_)return;this._createTerrain(_,c),this.fire(new h.z("data",{dataType:"style"}))}else{const C=this.terrain,D=C.get();for(const O of Object.keys(h.a3.terrain))!_.hasOwnProperty(O)&&h.a3.terrain[O].default&&(_[O]=h.a3.terrain[O].default);for(const O in s)if(!h.bn(s[O],D[O])){C.set(s,this.options),this.stylesheet.terrain=s;const B=this._getTransitionParameters({duration:0});C.updateTransitions(B),this.fire(new h.z("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(s){const c=this.fog=new dt(s,this.map.transform,this.scope,this.options);this.stylesheet.fog=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}_createSnow(s){const c=this.snow=new Zn(s,this.map.transform,this.scope,this.options);this.stylesheet.snow=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}_createRain(s){const c=this.rain=new ni(s,this.map.transform,this.scope,this.options);this.stylesheet.rain=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask(()=>{for(const s of this.map._markers)s._evaluateOpacity()})}getFog(){return this.fog?this.fog.get():null}setFog(s){if(this._checkLoaded(),!s)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const c=this.fog;if(!h.bn(c.get(),s)){c.set(s,this.options),this.stylesheet.fog=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}}else this._createFog(s);this._markersNeedUpdate=!0}getSnow(){return this.snow?this.snow.get():null}setSnow(s){if(this._checkLoaded(),!s)return delete this.snow,void delete this.stylesheet.snow;if(this.snow){const c=this.snow;if(!h.bn(c.get(),s)){c.set(s,this.options),this.stylesheet.snow=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}}else this._createSnow(s);this._markersNeedUpdate=!0}getRain(){return this.rain?this.rain.get():null}setRain(s){if(this._checkLoaded(),!s)return delete this.rain,void delete this.stylesheet.rain;if(this.rain){const c=this.rain;if(!h.bn(c.get(),s)){c.set(s,this.options),this.stylesheet.rain=c.get();const _=this._getTransitionParameters({duration:0});c.updateTransitions(_)}}else this._createRain(s);this._markersNeedUpdate=!0}_reloadColorTheme(){const s=()=>{for(const v in this._layers)this._layers[v].lut=this._styleColorTheme.lut;for(const v in this._sourceCaches)this._sourceCaches[v].clearTiles()},c=this._styleColorTheme.colorThemeOverride?this._styleColorTheme.colorThemeOverride:this._styleColorTheme.colorTheme;if(!c)return this._styleColorTheme.lut=null,void s();const _=this._evaluateColorThemeData(c);this._loadColorTheme(_).then(()=>{this.fire(new h.z("colorthemeset")),s()}).catch(v=>{h.w(`Couldn't set color theme: ${v}`)})}setColorTheme(s){this._checkLoaded(),this._styleColorTheme.colorThemeOverride&&h.w("Note: setColorTheme is called on a style with a color-theme override, the passed color-theme won't be visible."),this._styleColorTheme.colorTheme=s,this._reloadColorTheme()}setImportColorTheme(s,c){const _=this.getFragmentStyle(s);_&&(_._styleColorTheme.colorThemeOverride=c,_._reloadColorTheme())}_getTransitionParameters(s){return{now:h.q.now(),transition:h.l(this.transition,s)}}updateDrapeFirstLayers(){if(!this.terrain)return;const s=[],c=[];for(const _ of this._mergedOrder)this.isLayerDraped(this._mergedLayers[_])?s.push(_):c.push(_);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...s),this._drapedFirstOrder.push(...c)}_createTerrain(s,c){const _=this.terrain=new se(s,c,this.scope,this.options);1===c&&(this.stylesheet.terrain=s),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const v=this._getTransitionParameters({duration:0});_.updateTransitions(v)}_force3DLayerUpdate(){for(const s in this._layers){const c=this._layers[s];"fill-extrusion"===c.type&&this._updateLayer(c)}}_forceSymbolLayerUpdate(){for(const s in this._layers){const c=this._layers[s];"symbol"===c.type&&this._updateLayer(c)}}_validate(s,c,_,v,C={}){if(C&&!1===C.validate)return!1;const D=h.l({},this.serialize());return qo(this,s.call(Vs,h.l({key:c,style:D,value:_,styleSpec:h.a3},v)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),h.cx.off("pluginStateChange",this._rtlTextPluginCallback);for(const s in this._mergedLayers)this._mergedLayers[s].setEventedParent(null);for(const s in this._mergedSourceCaches)this._mergedSourceCaches[s].clearTiles(),this._mergedSourceCaches[s].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.snow,delete this.rain,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(s){const c=this.getSourceCaches(s);for(const _ of c)_.clearTiles()}clearSources(){for(const s in this._mergedSourceCaches)this._mergedSourceCaches[s].clearTiles()}reloadSource(s){const c=this.getSourceCaches(s);for(const _ of c)_.resume(),_.reload()}reloadSources(){for(const s of this.getSources())s.reload&&s.reload()}reloadModels(){this.modelManager.reloadModels(""),this.forEachFragmentStyle(s=>{s.modelManager.reloadModels(s.scope)})}updateSources(s){let c;this.directionalLight&&(c=fh(this.directionalLight));for(const _ in this._mergedSourceCaches)this._mergedSourceCaches[_].update(s,void 0,void 0,c)}_generateCollisionBoxes(){for(const s in this._sourceCaches){const c=this._sourceCaches[s];c.resume(),c.reload()}}_updatePlacement(s,c,_,v,C,D,O=!1){let B=!1,U=!1;const H={},G={};for(const W of this._mergedOrder){const Q=this._mergedLayers[W];if("symbol"!==Q.type)continue;const ae=h.aC(Q.source,Q.scope);let ie=H[ae];if(!ie){const de=this.getLayerSourceCache(Q);if(!de)continue;const be=de.getRenderableIds(!0).map(De=>de.getTileByID(De));G[ae]=be.slice(),ie=H[ae]=be.sort((De,Te)=>Te.tileID.overscaledZ-De.tileID.overscaledZ||(De.tileID.isLessThan(Te.tileID)?-1:1))}const ce=this.crossTileSymbolIndex.addLayer(Q,ie,c.center.lng,c.projection);B=B||ce}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),O=O||this._layerOrderChanged||0===v,this._layerOrderChanged&&this.fire(new h.z("neworder")),(O||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(h.q.now(),c.zoom))&&(this.pauseablePlacement=new S0(c,this._mergedOrder,O,_,v,C,this.placement,this.fog&&c.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,H,G,this.map.painter.scaleFactor),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(h.q.now()),U=!0),B&&this.pauseablePlacement.placement.setStale()),U||B){this._buildingIndex.onNewFrame(c.zoom);for(let W=0;WC===s.id))return void this.fire(new h.y(new Error(`Import with id '${s.id}' already exists in the map's style.`)));if(!c)return _.push(s),this._loadImports([s],!0);const v=_.findIndex(({id:C})=>C===c);return-1===v&&this.fire(new h.y(new Error(`Import with id "${c}" does not exist on this map.`))),this.stylesheet.imports=_.slice(0,v).concat(s).concat(_.slice(v)),this._loadImports([s],!0,c)}updateImport(s,c){this._checkLoaded();const _=this.stylesheet.imports||[],v=this.getImportIndex(s);return-1===v?this:"string"==typeof c?(this.setImportUrl(s,c),this):(c.url&&c.url!==_[v].url&&this.setImportUrl(s,c.url),h.bn(c.config,_[v].config)||this.setImportConfig(s,c.config,c.data.schema),h.bn(c.data,_[v].data)||this.setImportData(s,c.data),this)}moveImport(s,c){this._checkLoaded();let _=this.stylesheet.imports||[];const v=this.getImportIndex(s);if(-1===v)return this;const C=this.getImportIndex(c);if(-1===C)return this;const D=_[v],O=this.fragments[v];return _=_.filter(({id:B})=>B!==s),this.fragments=this.fragments.filter(({id:B})=>B!==s),this.stylesheet.imports=_.slice(0,C).concat(D).concat(_.slice(C)),this.fragments=this.fragments.slice(0,C).concat(O).concat(this.fragments.slice(C)),this.mergeLayers(),this}setImportUrl(s,c){this._checkLoaded();const _=this.stylesheet.imports||[],v=this.getImportIndex(s);if(-1===v)return this;_[v].url=c;const C=this.fragments[v];return C.style=this._createFragmentStyle(_[v]),C.style.on("style.import.load",()=>this.mergeAll()),C.style.loadURL(c),this}setImportData(s,c){this._checkLoaded();const _=this.getImportIndex(s),v=this.stylesheet.imports||[];return-1===_?this:c?(this.fragments[_].style.setState(c),this._reloadImports(),this):(delete v[_].data,this.setImportUrl(s,v[_].url))}setImportConfig(s,c,_){this._checkLoaded();const v=this.getImportIndex(s),C=this.stylesheet.imports||[];if(-1===v)return this;c?C[v].config=c:delete C[v].config;const D=this.fragments[v];_&&D.style.stylesheet&&(D.style.stylesheet.schema=_);const O=D.style.stylesheet&&D.style.stylesheet.schema;return D.config=c,D.style.updateConfig(c,O),this.updateConfigDependencies(),this}removeImport(s){this._checkLoaded();const c=this.stylesheet.imports||[],_=this.getImportIndex(s);-1!==_&&(c.splice(_,1),this.fragments[_].style._remove(),this.fragments.splice(_,1),this._reloadImports())}getImportIndex(s){const c=(this.stylesheet.imports||[]).findIndex(_=>_.id===s);return-1===c&&this.fire(new h.y(new Error(`Import '${s}' does not exist in the map's style and cannot be updated.`))),c}getLayer(s){return this._mergedLayers[s]}getSources(){const s=[];for(const c in this._mergedOtherSourceCaches){const _=this._mergedOtherSourceCaches[c];_&&s.push(_.getSource())}return s}getSource(s,c){const _=this.getSourceCache(s,c);return _&&_.getSource()}getLayerSource(s){const c=this.getLayerSourceCache(s);return c&&c.getSource()}getSourceCache(s,c){const _=h.aC(s,c);return this._mergedOtherSourceCaches[_]}getLayerSourceCache(s){const c=h.aC(s.source,s.scope);return"symbol"===s.type?this._mergedSymbolSourceCaches[c]:this._mergedOtherSourceCaches[c]}getSourceCaches(s){if(null==s)return Object.values(this._mergedSourceCaches);const c=[];return this._mergedOtherSourceCaches[s]&&c.push(this._mergedOtherSourceCaches[s]),this._mergedSymbolSourceCaches[s]&&c.push(this._mergedSymbolSourceCaches[s]),c}updateSourceCaches(){const s=this._changes.getUpdatedSourceCaches();for(const c in s){const _=s[c];"reload"===_?this.reloadSource(c):"clear"===_&&this.clearSource(c)}}updateLayers(s){const c=this._changes.getUpdatedPaintProperties();for(const _ of c){const v=this.getLayer(_);v&&v.updateTransitions(s)}}getImages(s,c,_){this.imageManager.getImages(c.icons,c.scope,_),this._updateTilesForChangedImages();const v=C=>{C&&C.setDependencies(c.tileID.key,c.type,c.icons)};v(this._otherSourceCaches[c.source]),v(this._symbolSourceCaches[c.source])}rasterizeImages(s,c,_){this.imageManager.rasterizeImages(c,_)}getGlyphs(s,c,_){this.glyphManager.getGlyphs(c.stacks,c.scope,_)}getResource(s,c,_){return h.cy(c,_)}getOwnSourceCache(s){return this._otherSourceCaches[s]}getOwnLayerSourceCache(s){return"symbol"===s.type?this._symbolSourceCaches[s.source]:this._otherSourceCaches[s.source]}getOwnSourceCaches(s){const c=[];return this._otherSourceCaches[s]&&c.push(this._otherSourceCaches[s]),this._symbolSourceCaches[s]&&c.push(this._symbolSourceCaches[s]),c}_isSourceCacheLoaded(s){const c=this.getOwnSourceCaches(s);return 0===c.length?(this.fire(new h.y(new Error(`There is no source with ID '${s}'`))),!1):c.every(_=>_.loaded())}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(s,c){if(!this._clipLayerPresent&&"fill-extrusion"!==s.type)return!1;const _="fill-extrusion"===s.type&&"building"===s.sourceLayer;if(s.is3D()){if(_||c&&"batched-model"===c.type||"model"===s.type)return!0}else if("symbol"===s.type)return!0;return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach(s=>{s.style._remove()}),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}co.getSourceType=function(f){return Tr[f]},co.setSourceType=function(f,s){Tr[f]=s},co.registerForPluginStateChange=h.ch;var ds="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",tl="\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec3 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color,float height) {\n#ifdef INDICATOR_CUTOUT\nfloat verticalFadeRange=u_indicator_cutout_centers.z*0.25;float holeMinOpacity=mix(1.0,u_indicator_cutout_params.x,smoothstep(u_indicator_cutout_centers.z,u_indicator_cutout_centers.z+verticalFadeRange,height));float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,highp vec2 pos,highp vec2 lod_coord) {highp vec2 size=vec2(textureSize(image,0));highp vec2 dx=dFdx(lod_coord.xy*size);highp vec2 dy=dFdy(lod_coord.xy*size);highp float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));highp float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",nu="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const vec2 units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (units_to_pixels*pos+offset)/pattern_size;}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {return get_pattern_pos(pixel_coord_upper,pixel_coord_lower,pattern_size,vec2(tile_units_to_pixels),pos);}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}",Wl="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",$b="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif//DEPTH_OCCLUSION",Gb="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",Eu="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {return color;}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",op="#ifdef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",gh="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",W_="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",Mu="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef TEXTURE_GATHER\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz/=light_view_pos0.w;vec2 abs_bounds=abs(light_view_pos0.xy);if (abs_bounds.x >=1.0 || abs_bounds.y >=1.0) {return 0.0;}light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}highp vec2 compute_receiver_plane_depth_bias(highp vec3 pos_dx,highp vec3 pos_dy)\n{highp vec2 biasUV=vec2(\npos_dy.y*pos_dx.z-pos_dx.y*pos_dy.z,pos_dx.x*pos_dy.z-pos_dy.x*pos_dx.z);biasUV*=1.0/((pos_dx.x*pos_dy.y)-(pos_dx.y*pos_dy.x));return biasUV;}float shadowed_light_factor_plane_bias(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {highp vec3 light_view_pos0_xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;highp vec3 light_view_pos0_ddx=dFdx(light_view_pos0_xyz);highp vec3 light_view_pos0_ddy=dFdy(light_view_pos0_xyz);highp vec2 plane_depth_bias=compute_receiver_plane_depth_bias(light_view_pos0_ddx,light_view_pos0_ddy);highp float bias=dot(vec2(u_shadow_texel_size,u_shadow_texel_size),plane_depth_bias)+0.0001;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const rp=[];Au(ds,rp),Au(nu,rp),Au(tl,rp);const bh={"_prelude_fog.vertex.glsl":Gb,"_prelude_terrain.vertex.glsl":$b,"_prelude_shadow.vertex.glsl":W_,"_prelude_fog.fragment.glsl":Eu,"_prelude_shadow.fragment.glsl":Mu,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":op,"_prelude_raster_particle.glsl":gh},cm={};to("",$b),to(Eu,Gb),to(Mu,W_),to(op,""),to(gh,"");const Cf=to(tl,nu),yd=ds;var dm={background:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in highp vec2 v_pos;void main() {highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec2 u_pattern_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_pattern_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float antialiase_blur_opacity=smoothstep(0.0,antialiasblur,extrude_length-1.0);float opacity_t=blur_positive==1.0 ? \nsmoothstep(0.0,-antialiased_blur,1.0-extrude_length) : \nsmoothstep(antialiased_blur,0.0,extrude_length-1.0)-antialiase_blur_opacity;float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\n#ifdef ELEVATED_ROADS\nin float a_circle_z_offset;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\n#ifdef ELEVATED_ROADS\nworld_center.z+=a_circle_z_offset+ELEVATION_BIAS;\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:to("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:to('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:to("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:to("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in vec2 a_elevation_from_sea;in float a_size_scale;in vec2 a_padding;in float a_auto_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {float feature_elevation=a_elevation_from_sea.x+a_auto_z_offset;float terrain_elevation=(a_elevation_from_sea.y==1.0 ? 0.0 : elevation(a_anchor_pos));vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(feature_elevation+terrain_elevation),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:to("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:to("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),fill:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=opacity;\n#ifdef INDICATOR_CUTOUT\nif (v_z_offset >=0.0) {out_color=applyCutout(out_color,v_z_offset);}\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=z_offset;\n#endif\n}'),fillOutline:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nuniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp float z_offset\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nin highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in highp vec2 v_pos;uniform float u_emissive_strength;\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);out_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;\n#ifdef ELEVATED_ROADS\nin float a_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\nout highp vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define highp float z_offset\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize highp float z_offset\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;\n#ifdef ELEVATED_ROADS\nz_offset+=a_road_z_offset;\n#endif\nfloat hidden=float(opacity==0.0);gl_Position=mix(u_matrix*vec4(a_pos,z_offset,1),AWAY,hidden);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=vec3(a_pos,z_offset);vec3 shd_pos1=vec3(a_pos,z_offset);\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nin float v_height;\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float emissive_strength\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,h);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;vec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp float emissive_strength\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0) || (color.a==0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);scaled_pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;scaled_pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);float ndotl=calculate_NdotL(normal);v_flat.rgb=sRGBToLinear(color.rgb);v_flat.rgb=v_flat.rgb*(ndotl+(1.0-min(ndotl*57.29,1.0))*emissive_strength);v_flat=vec4(linearTosRGB(v_flat.rgb),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:to("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_width_scale;uniform float u_vertical_scale;\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nin vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\n#pragma mapbox: define highp vec4 color\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\n#pragma mapbox: initialize highp vec4 color\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;float ele=elevation(pos_nx.xy);float c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);float h=t > 0.0 ? max(h_base,h_height) : h_base;pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);pos.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;pos.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin highp vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;highp vec2 imagecoord=mod(v_pos,1.0);highp vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);highp vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,height);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec3 a_join_normal_inside;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\n#ifdef TERRAIN\nuniform int u_height_type;uniform int u_base_type;\n#endif\nout highp vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool is_flat_height=centroid_pos.x !=0.0 && u_height_type==1;bool is_flat_base=centroid_pos.x !=0.0 && u_base_type==1;ele=elevation(pos_nx.xy);c_ele=is_flat_height || is_flat_base ? (centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos)) : ele;float h_height=is_flat_height ? max(c_ele+height,ele+base+2.0) : ele+height;float h_base=is_flat_base ? max(c_ele+base,ele+base) : ele+(base==0.0 ?-5.0 : base);h=t > 0.0 ? max(h_base,h_height) : h_base;p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside.xy/EXTENT);p.xy+=(1.0-a_join_normal_inside.z)*wall_offset*0.5;p.xy-=a_join_normal_inside.z*wall_offset*0.5;\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (color.a==0.0));gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:to('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor_plane_bias(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0),0.0).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:to("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp float u_dynamic_offset;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(u_dynamic_offset,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:to("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform lowp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_floor_width_scale;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;float scaled_floorwidth=(floorwidth*u_floor_width_scale);alpha*=linearstep(0.5-sdfgamma/scaled_floorwidth,0.5+sdfgamma/scaled_floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=1.0-transition_factor;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=((border_width*u_width_scale)+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color=mix(border_color*trim_alpha,out_color,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\nout_color.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\nout_color.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS) || defined(VARIABLE_LINE_WIDTH)\nin vec3 a_z_offset_width;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec3 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;uniform float u_width_scale;uniform highp float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec3 v_uv;\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth;\n#ifdef VARIABLE_LINE_WIDTH\nfloat left=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);halfwidth=(u_width_scale*(left==1.0 ? a_z_offset_width.y : a_z_offset_width.z))/2.0;\n#else\nhalfwidth=(u_width_scale*width)/2.0;\n#endif\noffset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nhighp float a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float line_progress=a_packed[2];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec3(a_uv_x,a_split_index*texel_height-half_texel_height,line_progress);\n#else\nv_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/(floorwidth*u_floor_width_scale),(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),linePattern:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_shadow.fragment.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_width_scale;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nin highp float v_road_z_offset;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform vec3 u_ground_shadow_factor;in highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in highp float v_depth;\n#endif\nuniform float u_emissive_strength;\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;highp float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(u_width_scale*blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;highp float x=mod(pattern_x,1.0);highp float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;highp vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));highp vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=v_uv[2];if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);color=mix(color,color.a*u_trim_color,transition_factor);}\n#endif\n#ifdef LINE_JOIN_NONE\nhighp float pattern_len=pattern_size/aspect;highp float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);highp float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;highp float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_with_emission_ground(color,u_emissive_strength);\n#ifdef RENDER_SHADOWS\nfloat light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#ifdef ELEVATED_ROADS\ncolor.rgb*=mix(v_road_z_offset > 0.0 ? u_ground_shadow_factor : vec3(1.0),vec3(1.0),light);\n#else\ncolor.rgb*=mix(u_ground_shadow_factor,vec3(1.0),light);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color,v_z_offset);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\nin vec3 a_z_offset_width;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec3 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;uniform float u_width_scale;uniform float u_floor_width_scale;\n#ifdef ELEVATED\nuniform lowp float u_zbias_factor;uniform lowp float u_tile_to_meter;float sample_elevation(vec2 apos) {\n#ifdef ELEVATION_REFERENCE_SEA\nreturn 0.0;\n#else\nreturn elevation(apos);\n#endif\n}\n#endif\nout vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec3 v_uv;\n#endif\n#ifdef ELEVATED_ROADS\nout highp float v_road_z_offset;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out highp float v_depth;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\nfloat a_z_offset;\n#if defined(ELEVATED) || defined(ELEVATED_ROADS)\na_z_offset=a_z_offset_width.x;\n#endif\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=(u_width_scale*width)/2.0;offset=-1.0*offset*u_width_scale;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float hidden=float(opacity==0.0);vec2 extrude=dist*u_pixels_to_tile_units;vec4 projected_extrude=u_matrix*vec4(extrude,0.0,0.0);vec2 projected_extrude_xy=projected_extrude.xy;\n#ifdef ELEVATED_ROADS\nv_road_z_offset=a_z_offset;gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,a_z_offset,1.0)+projected_extrude;\n#else\n#ifdef ELEVATED\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 offset_pos=pos+offsetTile;float ele=0.0;\n#ifdef CROSS_SLOPE_VERTICAL\nfloat top=a_pos_normal.y-2.0*floor(a_pos_normal.y*0.5);float line_height=2.0*u_tile_to_meter*outset*top*u_pixels_to_tile_units[1][1]+a_z_offset;ele=sample_elevation(offset_pos)+line_height;projected_extrude=vec4(0);\n#else\n#ifdef CROSS_SLOPE_HORIZONTAL\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,max(ele1,ele2));ele=ele_max+a_z_offset;\n#else\nfloat ele0=sample_elevation(offset_pos);float ele1=max(sample_elevation(offset_pos+extrude),sample_elevation(offset_pos+extrude/2.0));float ele2=max(sample_elevation(offset_pos-extrude),sample_elevation(offset_pos-extrude/2.0));float ele_max=max(ele0,0.5*(ele1+ele2));ele=ele_max-ele0+ele1+a_z_offset;\n#endif\n#endif\ngl_Position=u_matrix*vec4(offset_pos,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*u_zbias_factor*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);gl_Position=mix(gl_Position,AWAY,hidden);\n#else\ngl_Position=mix(u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude,AWAY,hidden);\n#endif\n#endif\n#ifdef ELEVATED_ROADS\n#ifdef RENDER_SHADOWS\nvec3 shd_pos=vec3(pos+(offset2+dist)*u_pixels_to_tile_units,a_z_offset);vec3 shd_pos0=shd_pos;vec3 shd_pos1=shd_pos;\n#ifdef NORMAL_OFFSET\nvec3 shd_pos_offset=shadow_normal_offset(vec3(0.0,0.0,1.0));shd_pos0+=shd_pos_offset*shadow_normal_offset_multiplier0();shd_pos1+=shd_pos_offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);v_depth=gl_Position.w;\n#endif\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude_xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=mix(extrude_length_without_perspective/extrude_length_with_perspective,1.0,step(0.01,blur));\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float a_uv_x=a_packed[0];highp float line_progress=a_packed[2];v_uv=vec3(a_uv_x,0.0,line_progress);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=(floorwidth*u_floor_width_scale);\n#ifdef LINE_JOIN_NONE\nv_width=(floorwidth*u_floor_width_scale)+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=a_z_offset;\n#endif\n}'),raster:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform highp sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:to("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:to("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:to('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbol:to('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;uniform lowp float u_scale_factor;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#ifdef INDICATOR_CUTOUT\nin highp float v_z_offset;\n#endif\nin vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\nin float v_draw_halo;in vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nin float is_sdf;in vec2 v_tex_a_icon;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nvec4 out_color;float fade_opacity=v_gamma_scale_size_fade_opacity[2];\n#ifdef RENDER_TEXT_AND_SYMBOL\nif (is_sdf==ICON) {vec2 tex_icon=v_tex_a_icon;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}\n#endif\n#ifdef RENDER_SDF\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_gamma_scale_size_fade_opacity.x;float size=v_gamma_scale_size_fade_opacity.y;float fontScale=u_is_text ? size/24.0 : size;out_color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_halo) {out_color=halo_color;gamma=(halo_blur*u_scale_factor*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width*u_scale_factor/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,v_tex_a).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);out_color*=alpha;\n#else\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\n#endif\nout_color*=opacity*fade_opacity;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color,v_z_offset);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_auto_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nout highp float v_z_offset;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_elevation_from_sea;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_draw_halo;out vec3 v_gamma_scale_size_fade_opacity;\n#ifdef RENDER_TEXT_AND_SYMBOL\nout float is_sdf;out vec2 v_tex_a_icon;\n#endif\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\n#pragma mapbox: define lowp float z_offset\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\n#pragma mapbox: initialize lowp float z_offset\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=u_elevation_from_sea ? z_offset : z_offset+elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_auto_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\n#ifdef PROJECTED_POS_ON_VIEWPORT\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xyz+h,1.0);\n#else\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz,mercator_pos,u_zoom_transition)+h;projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0); \n#endif\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\n#ifdef Z_OFFSET\nz+=u_pitch_with_map ? a_auto_z_offset+(u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#else\nz+=u_pitch_with_map ? (u_elevation_from_sea ? z_offset : z_offset) : 0.0;\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));\n#ifdef DEPTH_OCCLUSION\nfloat depth_occlusion=occlusionFadeMultiSample(projected_point);float depth_occlusion_multplier=mix(occlusion_opacity,1.0,depth_occlusion);out_fade_opacity*=depth_occlusion_multplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_gamma_scale_size_fade_opacity=vec3(gamma_scale,size,out_fade_opacity);v_tex_a=a_tex/u_texsize;\n#ifdef RENDER_TEXT_AND_SYMBOL\nis_sdf=a_size[0]-2.0*a_size_min;v_tex_a_icon=a_tex/u_texsize_icon;\n#endif\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\n#ifdef INDICATOR_CUTOUT\nv_z_offset=e;\n#endif\n}'),terrainRaster:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:to("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:to('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Wl),skyboxGradient:to('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',Wl),skyboxCapture:to("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nhighp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;highp float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);highp float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(clamp(raster.rgb,vec3(0),vec3(1))*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:to('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;glFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:to('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform highp vec2 u_inv_depth_size;uniform highp vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nhighp float unpack_depth(highp float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {highp vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor,v_position_height.w);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:to("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:to("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),snowParticle:to("in highp vec2 uv;in highp float alphaMultiplier;uniform vec4 u_particleColor;uniform vec2 u_simpleShapeParameters;void main() {float t=clamp((length(uv)-u_simpleShapeParameters.x)/(1.0-u_simpleShapeParameters.x),0.0,1.0);float alpha=1.0-pow(t,pow(10.0,u_simpleShapeParameters.y));alpha*=alphaMultiplier;alpha*=u_particleColor.a;vec3 color=u_particleColor.rgb*alpha;glFragColor=vec4(color,alpha) ;HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_snowParticleData;in highp vec4 a_snowParticleDataHorizontalOscillation;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform vec2 u_screenSize;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity;uniform vec3 u_direction;uniform float u_horizontalOscillationRadius; \nuniform float u_horizontalOscillationRate; \nuniform float u_billboardSize;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;out highp vec2 uv;out highp float alphaMultiplier;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos.xyz*=halfBoxSize;pos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_snowParticleData.z;float coneAngleHeadingRad=a_snowParticleData.w*radians(360.0);vec3 localZ=normalize(u_direction);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 direction;direction.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);direction.z=cos(coneAnglePichRad);direction=normalize(direction);vec3 simPosLocal=vec3(0,0,0);float velocityScale=(1.0+3.0*a_snowParticleData.y)*u_velocity;simPosLocal+=direction*velocityScale*u_time;float horizontalOscillationRadius=u_horizontalOscillationRadius*a_snowParticleDataHorizontalOscillation.x;float horizontalOscillationAngle=u_horizontalOscillationRate*u_time*(-1.0+2.0*a_snowParticleDataHorizontalOscillation.y);simPosLocal.xy+=horizontalOscillationRadius*vec2(cos(horizontalOscillationAngle),sin(horizontalOscillationAngle));vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);float clipZ=-u_cam_pos.z+pos.z;vec4 posView=u_modelview*vec4(pos,1.0);float size=u_billboardSize;alphaMultiplier=1.0;vec4 posScreen=u_projection*posView;posScreen/=posScreen.w;posScreen.xy=vec2(0.5)+posScreen.xy*0.5;posScreen.xy*=u_screenSize;vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=u_screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-posScreen.xy)/(0.5*u_screenSize));screenDist+=a_snowParticleData.x*u_thinningParticleOffset;float scaleFactorMode=0.0;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);if (a_snowParticleData.x < u_thinningAffectedRatio) {scaleFactorMode=1.0-thinningFadeRatio;alphaMultiplier=thinningFadeRatio;}}vec4 posScreen1=u_projection*vec4(posView.x-size,posView.yzw);posScreen1/=posScreen1.w;vec4 posScreen2=u_projection*vec4(posView.x+size,posView.yzw);posScreen2/=posScreen2.w;posScreen1.xy=vec2(0.5)+posScreen1.xy*0.5;posScreen1.xy*=u_screenSize;posScreen2.xy=vec2(0.5)+posScreen2.xy*0.5;posScreen2.xy*=u_screenSize;float screenLength=length(posScreen1.xy-posScreen2.xy);float screenEpsilon=3.0;float scaleFactor=1.0;if (screenLength < screenEpsilon) {scaleFactor=screenEpsilon/max(screenLength,0.01);scaleFactor=mix(scaleFactor,1.0,scaleFactorMode);}float screenEpsilon2=15.0;if (screenLength > screenEpsilon2) {scaleFactor=screenEpsilon2/max(screenLength,0.01);}size*=scaleFactor;vec2 right=size*vec2(1,0);vec2 up=size*vec2(0,1);posView.xy+=right*a_uv.x;posView.xy+=up*a_uv.y;uv=a_uv;gl_Position=u_projection*posView;}"),rainParticle:to("in highp vec2 uv;in highp float particleRandomValue;uniform sampler2D u_texScreen;uniform float u_distortionStrength;uniform vec4 u_color;uniform vec2 u_thinningCenterPos;uniform vec3 u_thinningShape;uniform float u_thinningAffectedRatio;uniform float u_thinningParticleOffset;uniform float u_shapeDirectionalPower;uniform float u_mode;void main() {vec2 st=uv*0.5+vec2(0.5);vec2 uvm=uv;uvm.y=-1.0+2.0*pow(st.y,u_shapeDirectionalPower);float shape=clamp(1.0-length(uvm),0.0,1.0);float alpha=abs(shape)*u_color.a;vec2 screenSize=vec2(textureSize(u_texScreen,0));vec2 thinningCenterPos=u_thinningCenterPos.xy;thinningCenterPos.y=screenSize.y-thinningCenterPos.y;float screenDist=length((thinningCenterPos-gl_FragCoord.xy)/(0.5*screenSize));screenDist+=(0.5+0.5*particleRandomValue)*u_thinningParticleOffset;float thinningShapeDist=u_thinningShape.x+u_thinningShape.y;float thinningAlpha=1.0;if (screenDist < thinningShapeDist) {float thinningFadeRatio=clamp((screenDist-u_thinningShape.x)/u_thinningShape.y,0.0,1.0);thinningFadeRatio=pow(thinningFadeRatio,u_thinningShape.z);thinningAlpha*=thinningFadeRatio;}vec2 offsetXY=normalize(uvm)*abs(shape);vec2 stScreen=(gl_FragCoord.xy+offsetXY*u_distortionStrength*thinningAlpha)/screenSize;vec3 colorScreen=texture(u_texScreen,stScreen).rgb;alpha*=thinningAlpha;glFragColor=mix(vec4(colorScreen,1.0),vec4(u_color.rgb*alpha,alpha),u_mode);HANDLE_WIREFRAME_DEBUG;}","\nin highp vec3 a_pos_3f;in highp vec2 a_uv;in highp vec4 a_rainParticleData;uniform mat4 u_modelview;uniform mat4 u_projection;uniform vec3 u_cam_pos;uniform float u_time;uniform float u_boxSize;uniform float u_velocityConeAperture; \nuniform float u_velocity; \nuniform vec2 u_rainDropletSize;uniform vec3 u_rainDirection;out highp vec2 uv;out highp float particleRandomValue;void main() {vec3 pos=a_pos_3f;float halfBoxSize=0.5*u_boxSize;pos*=halfBoxSize; \npos+=u_cam_pos;float velocityConeApertureRad=radians(u_velocityConeAperture*0.5);float coneAnglePichRad=velocityConeApertureRad*a_rainParticleData.z;float coneAngleHeadingRad=a_rainParticleData.w*radians(360.0);vec3 localZ=normalize(u_rainDirection);vec3 localX=normalize(cross(localZ,vec3(1,0,0)));vec3 localY=normalize(cross(localZ,localX));vec3 directionLocal;directionLocal.x=cos(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.y=sin(coneAngleHeadingRad)*sin(coneAnglePichRad);directionLocal.z=cos(coneAnglePichRad);directionLocal=normalize(directionLocal);vec3 directionWorld=localX*directionLocal.x+localY*directionLocal.y+localZ*directionLocal.z;float velocityScale=(1.0+3.0*a_rainParticleData.y)*u_velocity;vec3 simPosLocal=vec3(0,0,0);simPosLocal+=directionLocal*velocityScale*u_time;vec3 simPos=localX*simPosLocal.x+\nlocalY*simPosLocal.y+localZ*simPosLocal.z;pos+=simPos;pos=fract((pos+vec3(halfBoxSize))/vec3(u_boxSize))*u_boxSize-vec3(halfBoxSize);vec4 posView=u_modelview*vec4(pos,1.0);vec3 directionView=normalize((u_modelview*vec4(directionWorld,0.0)).xyz);vec3 side=cross(directionView,normalize(posView.xyz));posView.xyz+=side*a_uv.x*u_rainDropletSize.x;posView.xyz+=directionView*a_uv.y*u_rainDropletSize.y;uv=a_uv;particleRandomValue=a_rainParticleData.x;gl_Position=u_projection*posView;}"),vignette:to("uniform vec3 u_vignetteShape;uniform vec4 u_vignetteColor;in vec2 st;void main() {float screenDist=length(st);float alpha=clamp((screenDist-u_vignetteShape.x)/u_vignetteShape.y,0.0,1.0);alpha=pow(alpha,u_vignetteShape.z)*u_vignetteColor.a;vec3 color=u_vignetteColor.rgb;glFragColor=vec4(color*alpha,alpha) ;}","in vec2 a_pos_2f;out vec2 st;void main() {st=a_pos_2f;gl_Position=vec4(a_pos_2f,0,1);}"),occlusion:to("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function Au(f,s){const c=f.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let _ of c)if(_=_.trim(),"#"===_[0]&&_.includes("if")&&!_.includes("endif")){_=_.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const v=_.split(" ");for(const C of v)s.includes(C)||s.push(C)}}function to(f,s){const c=/#include\s+"([^"]+)"/g,_=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let v=s.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);v&&(v=v.map(U=>{const H=U.split(" ");return H[H.length-1]}),v=[...new Set(v)]);const C={},D=[],O=[];if(f=f.replace(c,(U,H)=>(O.push(H),"")),(s=s.replace(c,(U,H)=>(D.push(H),""))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let B=[...rp];Au(f,B),Au(s,B);for(const U of[...D,...O])bh[U]||console.error(`Undefined include: ${U}`),cm[U]||(cm[U]=[],Au(bh[U],cm[U])),B=[...B,...cm[U]];return{fragmentSource:f=f.replace(_,(U,H,G,W,Q)=>(C[Q]=!0,"define"===H?`\n#ifndef HAS_UNIFORM_u_${Q}\nin ${G} ${W} ${Q};\n#else\nuniform ${G} ${W} u_${Q};\n#endif\n`:"initialize"===H?`\n#ifdef HAS_UNIFORM_u_${Q}\n ${G} ${W} ${Q} = u_${Q};\n#endif\n`:"define-attribute"===H?`\n#ifdef HAS_ATTRIBUTE_a_${Q}\n in ${G} ${W} ${Q};\n#endif\n`:"initialize-attribute"===H?"":void 0)),vertexSource:s=s.replace(_,(U,H,G,W,Q)=>{const ae="float"===W?"vec2":W,ie=Q.match(/color/)?"color":ae;return"define-attribute-vertex-shader-only"===H?`\n#ifdef HAS_ATTRIBUTE_a_${Q}\nin ${G} ${W} a_${Q};\n#endif\n`:C[Q]?"define"===H?`\n#ifndef HAS_UNIFORM_u_${Q}\nuniform lowp float u_${Q}_t;\nin ${G} ${ae} a_${Q};\nout ${G} ${W} ${Q};\n#else\nuniform ${G} ${W} u_${Q};\n#endif\n`:"initialize"===H?"vec4"===ie?`\n#ifndef HAS_UNIFORM_u_${Q}\n ${Q} = a_${Q};\n#else\n ${G} ${W} ${Q} = u_${Q};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${Q}\n ${Q} = unpack_mix_${ie}(a_${Q}, u_${Q}_t);\n#else\n ${G} ${W} ${Q} = u_${Q};\n#endif\n`:"define-attribute"===H?`\n#ifdef HAS_ATTRIBUTE_a_${Q}\n in ${G} ${W} a_${Q};\n out ${G} ${W} ${Q};\n#endif\n`:"initialize-attribute"===H?`\n#ifdef HAS_ATTRIBUTE_a_${Q}\n ${Q} = a_${Q};\n#endif\n`:void 0:"define"===H?`\n#ifndef HAS_UNIFORM_u_${Q}\nuniform lowp float u_${Q}_t;\nin ${G} ${ae} a_${Q};\n#else\nuniform ${G} ${W} u_${Q};\n#endif\n`:"define-instanced"===H?"mat4"===ie?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${Q}0;\nin vec4 a_${Q}1;\nin vec4 a_${Q}2;\nin vec4 a_${Q}3;\n#else\nuniform ${G} ${W} u_${Q};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${G} ${ae} a_${Q};\n#else\nuniform ${G} ${W} u_${Q};\n#endif\n`:"initialize-attribute-custom"===H?`\n#ifdef HAS_ATTRIBUTE_a_${Q}\n ${G} ${W} ${Q} = a_${Q};\n#endif\n`:"vec4"===ie?`\n#ifndef HAS_UNIFORM_u_${Q}\n ${G} ${W} ${Q} = a_${Q};\n#else\n ${G} ${W} ${Q} = u_${Q};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${Q}\n ${G} ${W} ${Q} = unpack_mix_${ie}(a_${Q}, u_${Q}_t);\n#else\n ${G} ${W} ${Q} = u_${Q};\n#endif\n`}),staticAttributes:v,usedDefines:B,vertexIncludes:D,fragmentIncludes:O}}class qb{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(s,c,_,v,C,D,O,B){this.context=s;let U=this.boundPaintVertexBuffers.length!==v.length;for(let G=0;!U&&G{const Te=be.paint.get("hillshade-shadow-color"),Le="none"===be.paint.get("hillshade-shadow-color-use-theme").constantOr("default"),Me=be.paint.get("hillshade-highlight-color"),Pe="none"===be.paint.get("hillshade-highlight-color-use-theme").constantOr("default"),Ae=be.paint.get("hillshade-accent-color"),Ve="none"===be.paint.get("hillshade-accent-color-use-theme").constantOr("default"),Ye=be.paint.get("hillshade-emissive-strength");let vt=h.ai(be.paint.get("hillshade-illumination-direction"));if("viewport"===be.paint.get("hillshade-illumination-anchor"))vt-=ce.transform.angle;else if(ce.style&&ce.style.enable3dLights()&&ce.style.directionalLight){const Mt=ce.style.directionalLight.properties.get("direction"),Rt=h.cb(Mt.x,Mt.y,Mt.z);vt=h.ai(Rt[1])}const Ke=!ce.options.moving;return{u_matrix:De||ce.transform.calculateProjMatrix(de.tileID.toUnwrapped(),Ke),u_image:0,u_latrange:yh(0,de.tileID),u_light:[be.paint.get("hillshade-exaggeration"),vt],u_shadow:Te.toRenderColor(Le?null:be.lut),u_highlight:Me.toRenderColor(Pe?null:be.lut),u_emissive_strength:Ye,u_accent:Ae.toRenderColor(Ve?null:be.lut)}})(f,c,_,f.terrain?s.projMatrix:null);f.uploadCommonUniforms(O,G,s.toUnwrapped());const{tileBoundsBuffer:Q,tileBoundsIndexBuffer:ae,tileBoundsSegments:ie}=f.getTileBoundsBuffers(c);G.draw(f,B.TRIANGLES,v,C,D,gi.disabled,W,_.id,Q,ae,ie)}function us(f,s,c){if(!s.needsDEMTextureUpload)return;const _=f.context,v=_.gl;_.pixelStoreUnpackPremultiplyAlpha.set(!1),s.demTexture=s.demTexture||f.getTileTexture(c.stride);const C=c.getPixels();s.demTexture?s.demTexture.update(C,{premultiply:!1}):s.demTexture=new h.T(_,C,v.R32F,{premultiply:!1}),s.needsDEMTextureUpload=!1}function ap(f,s,c){const _=f.context,v=_.gl;if(!s.dem)return;const C=s.dem;if(_.activeTexture.set(v.TEXTURE1),us(f,s,C),!s.demTexture)return;s.demTexture.bind(v.NEAREST,v.CLAMP_TO_EDGE);const D=C.dim;_.activeTexture.set(v.TEXTURE0);let O=s.hillshadeFBO;if(!O){const W=new h.T(_,{width:D,height:D,data:null},v.RGBA8);W.bind(v.LINEAR,v.CLAMP_TO_EDGE),O=s.hillshadeFBO=_.createFramebuffer(D,D,!0,"renderbuffer"),O.colorAttachment.set(W.texture)}_.bindFramebuffer.set(O.framebuffer),_.viewport.set([0,0,D,D]);const{tileBoundsBuffer:B,tileBoundsIndexBuffer:U,tileBoundsSegments:H}=f.getMercatorTileBoundsBuffers(),G=[];f.linearFloatFilteringSupported()&&G.push("TERRAIN_DEM_FLOAT_FORMAT"),f.getOrCreateProgram("hillshadePrepare",{defines:G}).draw(f,v.TRIANGLES,Jn.disabled,pi.disabled,zi.unblended,gi.disabled,((W,Q)=>{const ae=Q.stride,ie=h.ab.mat4.create();return h.ab.mat4.ortho(ie,0,h.ag,-h.ag,0,0,1),h.ab.mat4.translate(ie,ie,[0,-h.ag,0]),{u_matrix:ie,u_image:1,u_dimension:[ae,ae],u_zoom:W.overscaledZ}})(s.tileID,C),c.id,B,U,H),s.needsHillshadePrepare=!1}class rr{constructor(s){this.gl=s.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(s){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Wb extends rr{getDefault(){return h.aj.transparent}set(s){const c=this.current;(s.r!==c.r||s.g!==c.g||s.b!==c.b||s.a!==c.a||this.dirty)&&(this.gl.clearColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class Zb extends rr{getDefault(){return 1}set(s){(s!==this.current||this.dirty)&&(this.gl.clearDepth(s),this.current=s,this.dirty=!1)}}class Z_ extends rr{getDefault(){return 0}set(s){(s!==this.current||this.dirty)&&(this.gl.clearStencil(s),this.current=s,this.dirty=!1)}}class sp extends rr{getDefault(){return[!0,!0,!0,!0]}set(s){const c=this.current;(s[0]!==c[0]||s[1]!==c[1]||s[2]!==c[2]||s[3]!==c[3]||this.dirty)&&(this.gl.colorMask(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class lp extends rr{getDefault(){return!0}set(s){(s!==this.current||this.dirty)&&(this.gl.depthMask(s),this.current=s,this.dirty=!1)}}class I0 extends rr{getDefault(){return 255}set(s){(s!==this.current||this.dirty)&&(this.gl.stencilMask(s),this.current=s,this.dirty=!1)}}class hw extends rr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(s){const c=this.current;(s.func!==c.func||s.ref!==c.ref||s.mask!==c.mask||this.dirty)&&(this.gl.stencilFunc(s.func,s.ref,s.mask),this.current=s,this.dirty=!1)}}class Tf extends rr{getDefault(){const s=this.gl;return[s.KEEP,s.KEEP,s.KEEP]}set(s){const c=this.current;(s[0]!==c[0]||s[1]!==c[1]||s[2]!==c[2]||this.dirty)&&(this.gl.stencilOp(s[0],s[1],s[2]),this.current=s,this.dirty=!1)}}class cp extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;s?c.enable(c.STENCIL_TEST):c.disable(c.STENCIL_TEST),this.current=s,this.dirty=!1}}class fc extends rr{getDefault(){return[0,1]}set(s){const c=this.current;(s[0]!==c[0]||s[1]!==c[1]||this.dirty)&&(this.gl.depthRange(s[0],s[1]),this.current=s,this.dirty=!1)}}class gl extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;s?c.enable(c.DEPTH_TEST):c.disable(c.DEPTH_TEST),this.current=s,this.dirty=!1}}class vh extends rr{getDefault(){return this.gl.LESS}set(s){(s!==this.current||this.dirty)&&(this.gl.depthFunc(s),this.current=s,this.dirty=!1)}}class ku extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;s?c.enable(c.BLEND):c.disable(c.BLEND),this.current=s,this.dirty=!1}}class Y_ extends rr{getDefault(){const s=this.gl;return[s.ONE,s.ZERO,s.ONE,s.ZERO]}set(s){const c=this.current;(s[0]!==c[0]||s[1]!==c[1]||s[2]!==c[2]||s[3]!==c[3]||this.dirty)&&(this.gl.blendFuncSeparate(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class Yb extends rr{getDefault(){return h.aj.transparent}set(s){const c=this.current;(s.r!==c.r||s.g!==c.g||s.b!==c.b||s.a!==c.a||this.dirty)&&(this.gl.blendColor(s.r,s.g,s.b,s.a),this.current=s,this.dirty=!1)}}class Xa extends rr{getDefault(){return this.gl.FUNC_ADD}set(s){(s!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(s,s),this.current=s,this.dirty=!1)}}class Df extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;s?c.enable(c.CULL_FACE):c.disable(c.CULL_FACE),this.current=s,this.dirty=!1}}class Xb extends rr{getDefault(){return this.gl.BACK}set(s){(s!==this.current||this.dirty)&&(this.gl.cullFace(s),this.current=s,this.dirty=!1)}}class dp extends rr{getDefault(){return this.gl.CCW}set(s){(s!==this.current||this.dirty)&&(this.gl.frontFace(s),this.current=s,this.dirty=!1)}}let X_=class extends rr{getDefault(){return null}set(f){(f!==this.current||this.dirty)&&(this.gl.useProgram(f),this.current=f,this.dirty=!1)}};class E0 extends rr{getDefault(){return this.gl.TEXTURE0}set(s){(s!==this.current||this.dirty)&&(this.gl.activeTexture(s),this.current=s,this.dirty=!1)}}class M0 extends rr{getDefault(){const s=this.gl;return[0,0,s.drawingBufferWidth,s.drawingBufferHeight]}set(s){const c=this.current;(s[0]!==c[0]||s[1]!==c[1]||s[2]!==c[2]||s[3]!==c[3]||this.dirty)&&(this.gl.viewport(s[0],s[1],s[2],s[3]),this.current=s,this.dirty=!1)}}class um extends rr{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.bindFramebuffer(c.FRAMEBUFFER,s),this.current=s,this.dirty=!1}}class pw extends rr{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.bindRenderbuffer(c.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class mw extends rr{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.bindTexture(c.TEXTURE_2D,s),this.current=s,this.dirty=!1}}class Kb extends rr{getDefault(){return null}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.bindBuffer(c.ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class K_ extends rr{getDefault(){return null}set(s){const c=this.gl;c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,s),this.current=s,this.dirty=!1}}class Dr extends rr{getDefault(){return null}set(s){this.gl&&(s!==this.current||this.dirty)&&(this.gl.bindVertexArray(s),this.current=s,this.dirty=!1)}}class Ln extends rr{getDefault(){return 4}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.pixelStorei(c.UNPACK_ALIGNMENT,s),this.current=s,this.dirty=!1}}class Yi extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s),this.current=s,this.dirty=!1}}class ia extends rr{getDefault(){return!1}set(s){if(s===this.current&&!this.dirty)return;const c=this.gl;c.pixelStorei(c.UNPACK_FLIP_Y_WEBGL,s),this.current=s,this.dirty=!1}}class Is extends rr{constructor(s,c){super(s),this.context=s,this.parent=c}getDefault(){return null}}class Sa extends Is{setDirty(){this.dirty=!0}set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const c=this.gl;c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,s,0),this.current=s,this.dirty=!1}}class nl extends Is{attachment(){return this.gl.DEPTH_ATTACHMENT}set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const c=this.gl;c.framebufferRenderbuffer(c.FRAMEBUFFER,this.attachment(),c.RENDERBUFFER,s),this.current=s,this.dirty=!1}}class up extends Is{attachment(){return this.gl.DEPTH_ATTACHMENT}set(s){if(s===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const c=this.gl;c.framebufferTexture2D(c.FRAMEBUFFER,this.attachment(),c.TEXTURE_2D,s,0),this.current=s,this.dirty=!1}}class mr extends nl{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}const oa=(f,s,c)=>({u_matrix:f,u_image0:0,u_skirt_height:s,u_ground_shadow_factor:c}),il=(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie)=>({u_proj_matrix:Float32Array.from(f),u_globe_matrix:s,u_normalize_matrix:Float32Array.from(_),u_merc_matrix:c,u_zoom_transition:v,u_merc_center:C,u_image0:0,u_frustum_tl:D,u_frustum_tr:O,u_frustum_br:B,u_frustum_bl:U,u_globe_pos:H,u_globe_radius:G,u_viewport:W,u_grid_matrix:ie?Float32Array.from(ie):new Float32Array(9),u_skirt_height:Q,u_far_z_cutoff:ae});function Qi(f,s){return null!=f&&null!=s&&!(!f.hasData()||!s.hasData())&&null!=f.demTexture&&null!=s.demTexture&&f.tileID.key!==s.tileID.key}const Es=new class{constructor(){this.operations={}}newMorphing(f,s,c,_,v){if(f in this.operations){const C=this.operations[f];C.to.tileID.key!==c.tileID.key&&(C.queued=c)}else this.operations[f]={startTime:_,phase:0,duration:v,from:s,to:c,queued:null}}getMorphValuesForProxy(f){if(!(f in this.operations))return null;const s=this.operations[f];return{from:s.from,to:s.to,phase:s.phase}}update(f){for(const s in this.operations){const c=this.operations[s];for(c.phase=(f-c.startTime)/c.duration;c.phase>=1||!this._validOp(c);)if(!this._nextOp(c,f)){delete this.operations[s];break}}}_nextOp(f,s){return!!f.queued&&(f.from=f.to,f.to=f.queued,f.queued=null,f.phase=0,f.startTime=s,!0)}_validOp(f){return f.from.hasData()&&f.to.hasData()}},hp={0:null,1:"TERRAIN_VERTEX_MORPHING"};function iu(f,s,c){if(0===s)return 0;const _=s<1&&514===c?.25/s:1;return 6*Math.pow(1.5,22-f)*Math.max(s,1)*_}function ra(f,s){const c=1<({u_matrix:f});function ru(f,s,c,_,v){if(v>0){const C=h.q.now(),D=(C-f.timeAdded)/v,O=s?(C-s.timeAdded)/v:-1,B=c.getSource(),U=_.coveringZoomLevel({tileSize:B.tileSize,roundZoom:B.roundZoom}),H=!s||Math.abs(s.tileID.overscaledZ-U)>Math.abs(f.tileID.overscaledZ-U),G=H&&f.refreshedUponExpiration?1:h.aw(H?D:1-O,0,1);return f.refreshedUponExpiration&&D>=1&&(f.refreshedUponExpiration=!1),s?{opacity:1,mix:1-G}:{opacity:G,mix:0}}return{opacity:1,mix:0}}class vd extends yn{constructor(s){const c={type:"raster-dem",maxzoom:s.transform.maxZoom},_=new h.D(h.ci(),null),v=ss("mock-dem",c,_,s.style);super("mock-dem",v,!1),v.setEventedParent(this),this._sourceLoaded=!0}_loadTile(s,c){s.state="loaded",c(null)}}class If extends yn{constructor(s){const c=ss("proxy",{type:"geojson",maxzoom:s.transform.maxZoom},new h.D(h.ci(),null),s.style);super("proxy",c,!1),c.setEventedParent(this),this.map=this.getSource().map=s,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(s,c,_){if(s.freezeTileCoverage)return;this.transform=s;const v=s.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce((C,D)=>{if(C[D.key]="",!this._tiles[D.key]){const O=new Ie(D,this._source.tileSize*D.overscaleFactor(),s.tileZoom);O.state="loaded",this._tiles[D.key]=O}return C},{});for(const C in this._tiles)C in v||(this.freeFBO(C),this._tiles[C].unloadVectorData(),delete this._tiles[C])}freeFBO(s){const c=this.proxyCachedFBO[s];if(void 0!==c){const _=Object.values(c);this.renderCachePool.push(..._),delete this.proxyCachedFBO[s]}}deallocRenderCache(){this.renderCache.forEach(s=>s.fb.destroy()),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Q_ extends h.aG{constructor(s,c,_){super(s.overscaledZ,s.wrap,s.canonical.z,s.canonical.x,s.canonical.y),this.proxyTileKey=c,this.projMatrix=_}}class _c extends h.cJ{constructor(s,c){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},s.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},()=>{this._style.map.triggerRepaint()}),s.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},()=>{this._style.map.triggerRepaint()}),s.tp.registerButton(["Terrain"],"Invalidate Render Cache",()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()}),this.painter=s,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[_,v,C]=function(){const U=new h.b4,H=new h.aU,G=131;U.reserve(17161),H.reserve(33800);const W=h.ag/128,Q=h.ag+W/2,ae=Q+W;for(let ce=-W;ceQ||ce<0||ce>Q?24575:0,De=h.aw(Math.round(de),0,h.ag),Te=h.aw(Math.round(ce),0,h.ag);U.emplaceBack(De+be,Te)}const ie=(ce,de)=>{const be=de*G+ce;H.emplaceBack(be+1,be,be+G),H.emplaceBack(be+G,be+G+1,be+1)};for(let ce=1;ce<129;ce++)for(let de=1;de<129;de++)ie(de,ce);return[0,129].forEach(ce=>{for(let de=0;de<130;de++)ie(de,ce),ie(ce,de)}),[U,H,32768]}(),D=s.context;this.gridBuffer=D.createVertexBuffer(_,h.b6.members),this.gridIndexBuffer=D.createIndexBuffer(v),this.gridSegments=h.b7.simpleSegment(0,0,_.length,v.length),this.gridNoSkirtSegments=h.b7.simpleSegment(0,0,_.length,C),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new If(c.map),this.orthoMatrix=h.ab.mat4.create(),h.ab.mat4.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,h.ag,0,h.ag,0,1);const O=D.gl;this._overlapStencilMode=new pi({func:O.GEQUAL,mask:255},0,255,O.KEEP,O.KEEP,O.REPLACE),this._previousZoom=s.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=c,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new vd(c.map),this._pendingGroundEffectLayers=[]}set style(s){s.on("data",this._onStyleDataEvent.bind(this)),this._style=s,this._style.map.on("moveend",()=>{this._clearLineLayersFromRenderCache()})}update(s,c,_){if(s&&s.terrain){this._style!==s&&(this.style=s,this._evaluationZoom=void 0);const v=s.terrain.properties,C=0===s.terrain.drapeRenderMode,D=s.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=h.q.now();const O=s.terrain&&s.terrain.scope,B=v.get("source"),U=C?this._mockSourceCache:s.getSourceCache(B,O);if(!U)return void h.w(`Couldn't find terrain source "${B}".`);if(this.sourceCache=U,this._attenuationRange=s.terrain.getAttenuationRange(),this._exaggeration=D?this.calculateExaggeration(c):v.get("exaggeration"),!c.projection.requiresDraping&&D&&0===this._exaggeration)return void this._disable();this.enabled=!0;const H=()=>{this.sourceCache.used&&h.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const G=this.getScaledDemTileSize();this.sourceCache.update(c,G,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,H(),this._initializing=!0),H(),c.updateElevation(!0,_),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(c),this._emptyDEMTextureDirty=!0,this._previousZoom=c.zoom}else this._disable()}calculateExaggeration(s){if(this._attenuationRange&&s.zoom>=Math.ceil(this._attenuationRange[1]))return this._style.terrain.getExaggeration(s.zoom);const c=this._previousCameraAltitude,_=s.getFreeCameraOptions().position.z/s.pixelsPerMeter*s.worldSize;this._previousCameraAltitude=_;const v=null!=c?_-c:Number.MAX_VALUE;if(Math.abs(v)<2)return this._exaggeration;const C=s.zoom,D=this._style.terrain;if(!this._previousUpdateTimestamp)return D.getExaggeration(C);let O=C-this._previousZoom;const B=this._previousUpdateTimestamp;let U=C;null!=this._evaluationZoom&&(U=this._evaluationZoom,Math.abs(C-U)>.5&&(O=.5*(C-U+O)),O*v<0&&(U+=O)),this._evaluationZoom=U;const H=D.getExaggeration(U),G=H===D.getExaggeration(Math.max(0,U-.1));if(G&&Math.abs(H-this._exaggeration)<.01)return H;let W=Math.min(.1,.00375*(this._updateTimestamp-B));return(G||H<.1||Math.abs(O)<1e-4)&&(W=Math.min(.2,4*W)),h.af(this._exaggeration,H,W)}resetTileLookupCache(s){this._findCoveringTileCache[s]={}}attenuationRange(){return this._attenuationRange}getDemUpscale(){return this.proxySourceCache.getSource().tileSize/128}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(s){s.coord&&"source"===s.dataType?this._clearRenderCacheForTile(s.sourceCacheId,s.coord):"style"===s.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const s in this._style._mergedSourceCaches)this._style._mergedSourceCaches[s].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach(s=>s.fb.destroy()),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const s=2*this.proxySourceCache.getSource().tileSize;return[s,s]}set useVertexMorphing(s){this._useVertexMorphing=s}updateTileBinding(s){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const c=this.proxySourceCache,_=this.painter.transform;this._initializing&&(this._initializing=0===_._centerAltitude&&-1===this.getAtPointOrZero(h.aa.fromLngLat(_.center),-1),this._emptyDEMTextureDirty=!this._initializing);const v=this.proxyCoords=c.getIds().map(B=>{const U=c.getTileByID(B).tileID;return U.projMatrix=_.calculateProjMatrix(U.toUnwrapped()),U});!function(B,U){const H=U.transform.pointCoordinate(U.transform.getCameraPoint()),G=new h.P(H.x,H.y);B.sort((W,Q)=>{if(Q.overscaledZ-W.overscaledZ)return Q.overscaledZ-W.overscaledZ;const ae=new h.P(W.canonical.x+(1<{this.proxyToSource[B.key]={}}),this.terrainTileForTile={};const D=this._style._mergedSourceCaches;for(const B in D){const U=D[B];if(!U.used||(U!==this.sourceCache&&this.resetTileLookupCache(U.id),this._setupProxiedCoordsForOrtho(U,s[B],C),U.usedForTerrain))continue;const H=s[B];U.getSource().reparseOverscaled&&this._assignTerrainTiles(H)}this.proxiedCoords[c.id]=v.map(B=>new Q_(B,B.key,this.orthoMatrix)),this._assignTerrainTiles(v),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(C),this.renderingToTexture=!1;const O={};this._visibleDemTiles=[];for(const B of this.proxyCoords){const U=this.terrainTileForTile[B.key];if(!U)continue;const H=U.tileID.key;H in O||(this._visibleDemTiles.push(U),O[H]=H)}}_assignTerrainTiles(s){this._initializing||s.forEach(c=>{if(this.terrainTileForTile[c.key])return;const _=this._findTileCoveringTileID(c,this.sourceCache);_&&(this.terrainTileForTile[c.key]=_)})}_prepareDEMTextures(){const s=this.painter.context,c=s.gl;for(const _ in this.terrainTileForTile){const v=this.terrainTileForTile[_],C=v.dem;!C||v.demTexture&&!v.needsDEMTextureUpload||(s.activeTexture.set(c.TEXTURE1),us(this.painter,v,C))}}_prepareDemTileUniforms(s,c,_,v){if(!c||null==c.demTexture)return!1;const C=s.tileID.canonical,D=Math.pow(2,c.tileID.canonical.z-C.z),O=v||"";return _[`u_dem_tl${O}`]=[C.x*D%1,C.y*D%1],_[`u_dem_scale${O}`]=D,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let s=0;const c=this._visibleDemTiles.reduce((_,v)=>{if(!v.dem)return _;const C=v.dem.tree.minimums[0];return C>0&&s++,_+C},0);return s?c/s:0}_updateEmptyDEMTexture(){const s=this.painter.context,c=s.gl;s.activeTexture.set(c.TEXTURE2);const _=this._getLoadedAreaMinimum(),v=new h.cK({width:1,height:1},new Float32Array([_]));this._emptyDEMTextureDirty=!1;let C=this._emptyDEMTexture;return C?C.update(v,{premultiply:!1}):C=this._emptyDEMTexture=new h.T(s,v,c.R32F,{premultiply:!1}),C}setupElevationDraw(s,c,_){const v=this.painter.context,C=v.gl,D={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};D.u_exaggeration=this.exaggeration();let O=null,B=null,U=1;if(_&&_.morphing&&this._useVertexMorphing){const Q=_.morphing.srcDemTile,ae=_.morphing.dstDemTile;U=_.morphing.phase,Q&&ae&&(this._prepareDemTileUniforms(s,Q,D,"_prev")&&(B=Q),this._prepareDemTileUniforms(s,ae,D)&&(O=ae))}const H=Q=>Q&&Q.demTexture&&this.painter.linearFloatFilteringSupported()?C.LINEAR:C.NEAREST;let G=null;var W;if(this.enabled?B&&O?(G=O.demTexture,v.activeTexture.set(C.TEXTURE4),B.demTexture.bind(H(B),C.CLAMP_TO_EDGE),D.u_dem_lerp=U):(O=this.terrainTileForTile[s.tileID.key],G=this._prepareDemTileUniforms(s,O,D)?O.demTexture:this.emptyDEMTexture):G=this.emptyDEMTexture,v.activeTexture.set(C.TEXTURE2),G&&(D.u_dem_size=1===(W=G).size[0]?1:W.size[0]-2,G.bind(H(O),C.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(_&&_.useDepthForOcclusion,c,D),_&&_.useMeterToDem&&O){const Q=(1<{if(de===Rt)return;const nt=[hp[Rt],"PROJECTION_GLOBE_VIEW"];De&&nt.push("CUSTOM_ANTIALIASING");const wt=U.isTileAffectedByFog(Mt);ce=U.getOrCreateProgram("globeRaster",{defines:nt,overrideFog:wt}),de=Rt},Le=U.colorModeForRenderPass(),Me=new Jn(ie.LEQUAL,Jn.ReadWrite,U.depthRangeFor3D);Es.update(Q);const Pe=h.cD(be),Ae=[h.at(be.center.lng),h.aA(be.center.lat)],Ve=U.globeSharedBuffers,Ye=[be.width*h.q.devicePixelRatio,be.height*h.q.devicePixelRatio],vt=Float32Array.from(be.globeMatrix),Ke={useDenormalizedUpVectorScale:!0};{const Mt=U.transform,Rt=iu(Mt.zoom,H.exaggeration(),H.sourceCache._source.tileSize);de=-1;const nt=ie.TRIANGLES;for(const wt of W){const Ut=G.getTile(wt),tt=pi.disabled,zt=H.prevTerrainTileForTile[wt.key],xt=H.terrainTileForTile[wt.key];Qi(zt,xt)&&Es.newMorphing(wt.key,zt,xt,Q,250),ae.activeTexture.set(ie.TEXTURE0),Ut.texture&&Ut.texture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE);const rn=Es.getMorphValuesForProxy(wt.key),$t=rn?1:0;rn&&h.J(Ke,{morphing:{srcDemTile:rn.from,dstDemTile:rn.to,phase:h.cB(rn.phase)}});const Ft=h.cE(wt.canonical),Kt=h.cF(Ft.getCenter().lat),en=h.cG(wt.canonical,Ft,Kt,Mt.worldSize/Mt._pixelsPerMercatorPixel),Sn=h.bb(h.cH(wt.canonical)),Rn=il(Mt.expandedFarZProjMatrix,vt,Pe,Sn,h.ae(Mt.zoom),Ae,Mt.frustumCorners.TL,Mt.frustumCorners.TR,Mt.frustumCorners.BR,Mt.frustumCorners.BL,Mt.globeCenterInViewSpace,Mt.globeRadius,Ye,Rt,Mt._farZ,en);if(Te(wt,$t),ce&&(H.setupElevationDraw(Ut,ce,Ke),U.uploadCommonUniforms(ae,ce,wt.toUnwrapped()),Ve)){const[Tt,Wn,Xn]=Ve.getGridBuffers(Kt,0!==Rt);ce.draw(U,nt,Me,tt,Le,gi.backCCW,Rn,"globe_raster",Tt,Wn,Xn)}}}if(Ve&&(U.renderDefaultNorthPole||U.renderDefaultSouthPole)){const Mt=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];De&&Mt.push("CUSTOM_ANTIALIASING"),ce=U.getOrCreateProgram("globeRaster",{defines:Mt});for(const Rt of W){const{x:nt,y:wt,z:Ut}=Rt.canonical,tt=0===wt,zt=wt===(1<Tt.draw(U,ie.TRIANGLES,Me,pi.disabled,Le,gi.disabled,il(be.expandedFarZProjMatrix,en,en,Sn,0,Ae,be.frustumCorners.TL,be.frustumCorners.TR,be.frustumCorners.BR,be.frustumCorners.BL,be.globeCenterInViewSpace,be.globeRadius,Ye,0,be._farZ),"globe_pole_raster",Wn,$t,Ft);H.setupElevationDraw(Kt,ce,Ke),U.uploadCommonUniforms(ae,ce,Rt.toUnwrapped()),tt&&U.renderDefaultNorthPole&&Rn(ce,xt),zt&&U.renderDefaultSouthPole&&(en=h.ab.mat4.scale(h.ab.mat4.create(),en,[1,-1,1]),Rn(ce,rn))}}}}(v,C,D,O,B);else{const U=v.context,H=U.gl;let G,W;const Q=v.shadowRenderer,ae=_l(v,v.longestCutoffRange),ie=Le=>{if(W===Le)return;const Me=[];Me.push(hp[Le]),ae.shouldRenderCutoff&&Me.push("RENDER_CUTOFF"),Q&&(Me.push("RENDER_SHADOWS","DEPTH_TEXTURE"),Q.useNormalOffset&&Me.push("NORMAL_OFFSET")),G=v.getOrCreateProgram("terrainRaster",{defines:Me}),W=Le},ce=v.colorModeForRenderPass(),de=new Jn(H.LEQUAL,Jn.ReadWrite,v.depthRangeFor3D);Es.update(B);const be=v.transform,De=iu(be.zoom,C.exaggeration(),C.sourceCache._source.tileSize);let Te=[0,0,0];if(Q){const Le=v.style.directionalLight,Me=v.style.ambientLight;Le&&Me&&(Te=lm(v.style,Le,Me))}{W=-1;const Le=H.TRIANGLES,[Me,Pe]=[C.gridIndexBuffer,C.gridSegments];for(const Ae of O){const Ve=D.getTile(Ae),Ye=pi.disabled,vt=C.prevTerrainTileForTile[Ae.key],Ke=C.terrainTileForTile[Ae.key];Qi(vt,Ke)&&Es.newMorphing(Ae.key,vt,Ke,B,250),U.activeTexture.set(H.TEXTURE0),Ve.texture&&Ve.texture.bind(H.LINEAR,H.CLAMP_TO_EDGE);const Mt=Es.getMorphValuesForProxy(Ae.key),Rt=Mt?1:0;let nt;Mt&&(nt={morphing:{srcDemTile:Mt.from,dstDemTile:Mt.to,phase:h.cB(Mt.phase)}});const wt=oa(Ae.projMatrix,ra(Ae.canonical,be.renderWorldCopies)?De/10:De,Te);if(ie(Rt),!G)continue;C.setupElevationDraw(Ve,G,nt);const Ut=Ae.toUnwrapped();Q&&Q.setupShadows(Ut,G),v.uploadCommonUniforms(U,G,Ut,null,ae),G.draw(v,Le,de,Ye,ce,gi.backCCW,wt,"terrain_raster",C.gridBuffer,Me,Pe)}}}}(c,this,this.proxySourceCache,s,this._updateTimestamp),this.renderingToTexture=!0,c.gpuTimingDeferredRenderEnd(),s.splice(0,s.length))}renderBatch(s){if(0===this._drapedRenderBatches.length)return s+1;this.renderingToTexture=!0;const c=this.painter,_=this.painter.context,v=this.proxySourceCache,C=this.proxiedCoords[v.id],D=this._drapedRenderBatches.shift(),O=c.style.order,B=[];let U=0;for(const H of C){const G=v.getTileByID(H.proxyTileKey),W=v.proxyCachedFBO[H.key]?v.proxyCachedFBO[H.key][s]:void 0,Q=void 0!==W?v.renderCache[W]:this.pool[U++],ae=void 0!==W;if(G.texture=Q.tex,ae&&!Q.dirty){B.push(G.tileID);continue}let ie;_.bindFramebuffer.set(Q.fb.framebuffer),this.renderedToTile=!1,Q.dirty&&(_.clear({color:h.aj.transparent,stencil:0}),Q.dirty=!1);for(let ce=D.start;ce<=D.end;++ce){const de=c.style._mergedLayers[O[ce]];if(de.isHidden(c.transform.zoom))continue;const be=c.style.getLayerSourceCache(de),De=be?this.proxyToSource[H.key][be.id]:[H];if(!De)continue;const Te=De;_.viewport.set([0,0,Q.fb.width,Q.fb.height]),ie!==(be?be.id:null)&&(this._setupStencil(Q,De,de,be),ie=be?be.id:null),c.renderLayer(c,be,de,Te)}if(0===this._drapedRenderBatches.length)for(const ce of this._pendingGroundEffectLayers){const de=c.style._mergedLayers[O[ce]];if(de.isHidden(c.transform.zoom))continue;const be=c.style.getLayerSourceCache(de),De=be?this.proxyToSource[H.key][be.id]:[H];if(!De)continue;const Te=De;_.viewport.set([0,0,Q.fb.width,Q.fb.height]),ie!==(be?be.id:null)&&(this._setupStencil(Q,De,de,be),ie=be?be.id:null),c.renderLayer(c,be,de,Te)}this.renderedToTile?(Q.dirty=!0,B.push(G.tileID)):ae||--U,5===U&&(U=0,this.renderToBackBuffer(B))}return this.renderToBackBuffer(B),this.renderingToTexture=!1,_.bindFramebuffer.set(null),_.viewport.set([0,0,c.width,c.height]),D.end+1}postRender(){}isLayerOrderingCorrect(s){const c=s.order.length;let _=-1,v=c;for(let C=0;C_}getMinElevationBelowMSL(){let s=0;return this._visibleDemTiles.filter(c=>c.dem).forEach(c=>{s=Math.min(s,c.dem.tree.minimums[0])}),0===s?s:(s-30)*this._exaggeration}raycast(s,c,_){if(!this._visibleDemTiles)return null;const v=this._visibleDemTiles.filter(C=>C.dem).map(C=>{const D=C.tileID,O=1<(null!==C.t?C.t:Number.MAX_VALUE)-(null!==D.t?D.t:Number.MAX_VALUE));for(const C of v){if(null==C.t)return null;const D=C.tile.dem.tree.raycast(C.minx,C.miny,C.maxx,C.maxy,s,c,_);if(null!=D)return D}return null}_createFBO(){const s=this.painter.context,c=s.gl,_=this.drapeBufferSize;s.activeTexture.set(c.TEXTURE0);const v=new h.T(s,{width:_[0],height:_[1],data:null},c.RGBA8);v.bind(c.LINEAR,c.CLAMP_TO_EDGE);const C=s.createFramebuffer(_[0],_[1],!0,null);return C.colorAttachment.set(v.texture),C.depthAttachment=new mr(s,C.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=s.createRenderbuffer(s.gl.DEPTH_STENCIL,_[0],_[1]),this._stencilRef=0,C.depthAttachment.set(this._sharedDepthStencil),s.clear({stencil:0})):C.depthAttachment.set(this._sharedDepthStencil),s.extTextureFilterAnisotropic&&c.texParameterf(c.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax),{fb:C,tex:v,dirty:!1}}_initFBOPool(){for(;this.pool.length{const c=this._style._mergedLayers[s],_=c.isHidden(this.painter.transform.zoom);return"hillshade"===c.type||"custom"===c.type?!_&&c.shouldRedrape():!_&&c.hasTransition()})}_clearLineLayersFromRenderCache(){let s=!1;for(const _ of this._style.getSources())if(_ instanceof Go){s=!0;break}if(!s)return;const c={};for(let _=0;_B>O.end)||h.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=_}_setupRenderCache(s){const c=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,c.renderCache.length>c.renderCachePool.length){const D=Object.values(c.proxyCachedFBO);c.proxyCachedFBO={};for(let O=0;O=0;D--){const O=_[D];if(c.getTileByID(O.key),void 0!==c.proxyCachedFBO[O.key]){const B=s[O.key],U=this.proxyToSource[O.key];let H=0;for(const G in U){const W=U[G],Q=B[G];if(!Q||Q.length!==W.length||W.some((ae,ie)=>ae!==Q[ie]||v[G]&&v[G].hasOwnProperty(ae.key))){H=-1;break}++H}for(const G in c.proxyCachedFBO[O.key])c.renderCache[c.proxyCachedFBO[O.key][G]].dirty=H<0||H!==Object.values(B).length}}const C=[...this._drapedRenderBatches];C.sort((D,O)=>O.end-O.start-(D.end-D.start));for(const D of C)for(const O of _){if(c.proxyCachedFBO[O.key])continue;let B=c.renderCachePool.pop();void 0===B&&c.renderCache.length<50&&(B=c.renderCache.length,c.renderCache.push(this._createFBO())),void 0!==B&&(c.proxyCachedFBO[O.key]={},c.proxyCachedFBO[O.key][D.start]=B,c.renderCache[B].dirty=!0)}this._tilesDirty={}}_setupStencil(s,c,_,v){if(!v||!this._sourceTilesOverlap[v.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const C=this.painter.context,D=C.gl;if(c.length<=1)return void(this._overlapStencilType=!1);let O;if(_.isTileClipped())O=c.length,this._overlapStencilMode.test={func:D.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(c[0].overscaledZ>c[c.length-1].overscaledZ))return void(this._overlapStencilType=!1);O=1,this._overlapStencilMode.test={func:D.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+O>255&&(C.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=O,this._overlapStencilMode.ref=this._stencilRef,_.isTileClipped()&&this._renderTileClippingMasks(c,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(s){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[s.key]),this._overlapStencilMode):pi.disabled}_renderTileClippingMasks(s,c){const _=this.painter,v=this.painter.context,C=v.gl;_._tileClippingMaskIDs={},v.setColorMode(zi.disabled),v.setDepthMode(Jn.disabled);const D=_.getOrCreateProgram("clippingMask");for(const O of s){const B=_._tileClippingMaskIDs[O.key]=--c;D.draw(_,C.TRIANGLES,Jn.disabled,new pi({func:C.ALWAYS,mask:0},B,255,C.KEEP,C.KEEP,C.REPLACE),zi.disabled,gi.disabled,ou(O.projMatrix),"$clipping",_.tileExtentBuffer,_.quadTriangleIndexBuffer,_.tileExtentSegments)}}pointCoordinate(s){const c=this.painter.transform;if(s.x<0||s.x>c.width||s.y<0||s.y>c.height)return null;const _=[s.x,s.y,1,1];h.ab.vec4.transformMat4(_,_,c.pixelMatrixInverse),h.ab.vec4.scale(_,_,1/_[3]),_[0]/=c.worldSize,_[1]/=c.worldSize;const v=c._camera.position,C=h.bH(1,c.center.lat),D=[v[0],v[1],v[2]/C,0],O=h.ab.vec3.subtract([],_.slice(0,3),D);h.ab.vec3.normalize(O,O);const B=this.raycast(D,O,this._exaggeration);return null!==B&&B?(h.ab.vec3.scaleAndAdd(D,D,O,B),D[3]=D[2],D[2]*=C,D):null}_setupProxiedCoordsForOrtho(s,c,_){if(s.getSource()instanceof h.aJ)return this._setupProxiedCoordsForImageSource(s,c,_);this._findCoveringTileCache[s.id]=this._findCoveringTileCache[s.id]||{};const v=this.proxiedCoords[s.id]=[],C=this.proxyCoords;for(let B=0;BH.overscaledZ-U.overscaledZ)}_setupProxiedCoordsForImageSource(s,c,_){if(!s.getSource().loaded())return;const v=this.proxiedCoords[s.id]=[],C=this.proxyCoords,D=s.getSource(),O=D.tileID;if(!O)return;const B=new h.P(O.x,O.y)._div(1<(G.min.x=Math.min(G.min.x,W.x-B.x),G.min.y=Math.min(G.min.y,W.y-B.y),G.max.x=Math.max(G.max.x,W.x-B.x),G.max.y=Math.max(G.max.y,W.y-B.y),G),{min:new h.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new h.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),H=(G,W)=>{const Q=G.wrap+G.canonical.x/(1<ce+U.max.x||ae+iede+U.max.y};for(let G=0;GD.key===c.tileID.key);if(C)return C}if(c.tileID.key!==s.key){const C=s.canonical.z-c.tileID.canonical.z;let D,O,B;v=h.ab.mat4.create();const U=c.tileID.wrap-s.wrap<0?(D=h.ag>>C,O=D*((c.tileID.canonical.x<=G){const W=s.canonical.z-G;c.getSource().reparseOverscaled?(O=Math.max(s.canonical.z+2,c.transform.tileZoom),D=new h.aG(O,s.wrap,G,s.canonical.x>>W,s.canonical.y>>W)):0!==W&&(O=G,D=new h.aG(O,s.wrap,G,s.canonical.x>>W,s.canonical.y>>W))}D.key!==s.key&&(U.push(D.key),_=c.getTile(D))}const H=G=>{U.forEach(W=>{v[W]=G}),U.length=0};for(O-=1;O>=B&&(!_||!_.hasData());O--){_&&H(_.tileID.key);const G=D.calculateScaledKey(O);if(_=c.getTileByID(G),_&&_.hasData())break;const W=v[G];if(null===W)break;void 0===W?U.push(G):_=c.getTileByID(W)}return H(_?_.tileID.key:null),_&&_.hasData()?_:null}findDEMTileFor(s){return this.enabled?this._findTileCoveringTileID(s,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(s,c){let _=this._tilesDirty[s];_||(_=this._tilesDirty[s]={}),_[c.key]=!0}}function J_(f,s,c){const _=function(O,B,U){const H=h.ab.vec3.dot(B,O),G=h.ab.vec3.dot(U,[.2126,.7152,.0722]),W=(ae,ie,ce)=>(1-ce)*ae+ce*ie,Q=W(1-.3*Math.min(G,1),1,Math.min(H+1,1));return W(.92,1,Math.asin(h.aw(B[2],-1,1))/Math.PI+.5)*Q}(f,[0,0,1],s),v=[0,0,0];h.ab.vec3.scale(v,c.slice(0,3),_);const C=[0,0,0];h.ab.vec3.scale(C,s.slice(0,3),f[2]);const D=[0,0,0];return h.ab.vec3.add(D,v,C),h.cf(D)}const pp=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],sc=["stars","rainParticle","snowParticle","fillExtrusion","fillExtrusionGroundEffect","model","symbol"];class mp{static cacheKey(s,c,_,v){let C=`${c}${v?v.cacheKey:""}`;for(const D of _)s.usedDefines.includes(D)&&(C+=`/${D}`);return C}constructor(s,c,_,v,C,D){const O=s.gl;this.program=O.createProgram(),this.configuration=v,this.name=c,this.fixedDefines=[...D];const B=v?v.getBinderAttributes():[],U=(_.staticAttributes||[]).concat(B);let H=v?v.defines():[];H=H.concat(D.map(ce=>`#define ${ce}`));const G="#version 300 es\n";let W=G+H.concat("precision mediump float;",yd,Cf.fragmentSource).join("\n");for(const ce of _.fragmentIncludes)W+=`\n${bh[ce]}`;W+=`\n${_.fragmentSource}`;let Q=G+H.concat("precision highp float;",yd,Cf.vertexSource).join("\n");for(const ce of _.vertexIncludes)Q+=`\n${bh[ce]}`;this.forceManualRenderingForInstanceIDShaders=s.forceManualRenderingForInstanceIDShaders&&-1!==_.vertexSource.indexOf("gl_InstanceID"),this.forceManualRenderingForInstanceIDShaders&&(Q+="\nuniform int u_instanceID;\n"),Q+=`\n${_.vertexSource}`,this.forceManualRenderingForInstanceIDShaders&&(Q=Q.replaceAll("gl_InstanceID","u_instanceID"));const ae=O.createShader(O.FRAGMENT_SHADER);if(O.isContextLost())return void(this.failedToCreate=!0);O.shaderSource(ae,W),O.compileShader(ae),O.attachShader(this.program,ae);const ie=O.createShader(O.VERTEX_SHADER);if(O.isContextLost())this.failedToCreate=!0;else{O.shaderSource(ie,Q),O.compileShader(ie),O.attachShader(this.program,ie),this.attributes={},this.numAttributes=U.length;for(let ce=0;ce({u_tile_tl_up:new h.bL(ce),u_tile_tr_up:new h.bL(ce),u_tile_br_up:new h.bL(ce),u_tile_bl_up:new h.bL(ce),u_tile_up_scale:new h.bM(ce)}))(s)),D.includes("FOG")&&(this.fogUniforms=(ce=>({u_fog_matrix:new h.bJ(ce),u_fog_range:new h.bK(ce),u_fog_color:new h.ca(ce),u_fog_horizon_blend:new h.bM(ce),u_fog_vertical_limit:new h.bK(ce),u_fog_temporal_offset:new h.bM(ce),u_frustum_tl:new h.bL(ce),u_frustum_tr:new h.bL(ce),u_frustum_br:new h.bL(ce),u_frustum_bl:new h.bL(ce),u_globe_pos:new h.bL(ce),u_globe_radius:new h.bM(ce),u_globe_transition:new h.bM(ce),u_is_globe:new h.bN(ce),u_viewport:new h.bK(ce)}))(s)),D.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(ce=>({u_cutoff_params:new h.ca(ce)}))(s)),D.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(ce=>({u_lighting_ambient_color:new h.bL(ce),u_lighting_directional_dir:new h.bL(ce),u_lighting_directional_color:new h.bL(ce),u_ground_radiance:new h.bL(ce)}))(s)),D.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(ce=>({u_light_matrix_0:new h.bJ(ce),u_light_matrix_1:new h.bJ(ce),u_fade_range:new h.bK(ce),u_shadow_normal_offset:new h.bL(ce),u_shadow_intensity:new h.bM(ce),u_shadow_texel_size:new h.bM(ce),u_shadow_map_resolution:new h.bM(ce),u_shadow_direction:new h.bL(ce),u_shadow_bias:new h.bL(ce),u_shadowmap_0:new h.bN(ce),u_shadowmap_1:new h.bN(ce)}))(s))}var ce}setTerrainUniformValues(s,c){if(!this.terrainUniforms)return;const _=this.terrainUniforms;if(!this.failedToCreate){s.program.set(this.program);for(const v in c)_[v]&&_[v].set(this.program,v,c[v])}}setGlobeUniformValues(s,c){if(!this.globeUniforms)return;const _=this.globeUniforms;if(!this.failedToCreate){s.program.set(this.program);for(const v in c)_[v]&&_[v].set(this.program,v,c[v])}}setFogUniformValues(s,c){if(!this.fogUniforms)return;const _=this.fogUniforms;if(!this.failedToCreate){s.program.set(this.program);for(const v in c)_[v].set(this.program,v,c[v])}}setCutoffUniformValues(s,c){if(!this.cutoffUniforms)return;const _=this.cutoffUniforms;if(!this.failedToCreate){s.program.set(this.program);for(const v in c)_[v].set(this.program,v,c[v])}}setLightsUniformValues(s,c){if(!this.lightsUniforms)return;const _=this.lightsUniforms;if(!this.failedToCreate){s.program.set(this.program);for(const v in c)_[v].set(this.program,v,c[v])}}setShadowUniformValues(s,c){if(this.failedToCreate||!this.shadowUniforms)return;const _=this.shadowUniforms;s.program.set(this.program);for(const v in c)_[v].set(this.program,v,c[v])}_drawDebugWireframe(s,c,_,v,C,D,O,B,U,H){const G=s.options.wireframe;if(!1===G.terrain&&!1===G.layers2D&&!1===G.layers3D)return;const W=s.context;if(!(G.terrain&&("terrainRaster"===this.name||"globeRaster"===this.name)||!(!G.layers2D||s._terrain&&s._terrain.renderingToTexture)&&pp.includes(this.name)||G.layers3D&&sc.includes(this.name)))return;const Q=W.gl,ae=s.wireframeDebugCache.getLinesFromTrianglesBuffer(s.frameCounter,C,W);if(!ae)return;const ie=[...this.fixedDefines];ie.push("DEBUG_WIREFRAME");const ce=s.getOrCreateProgram(this.name,{config:this.configuration,defines:ie});W.program.set(ce.program);const de=(Te,Le,Me)=>{if(Le[Te]&&Me[Te])for(const Pe in Le[Te])Me[Te][Pe]&&Me[Te][Pe].set(Me.program,Pe,Le[Te][Pe].current)};U&&U.setUniforms(ce.program,W,ce.binderUniforms,O,{zoom:B}),de("fixedUniforms",this,ce),de("terrainUniforms",this,ce),de("globeUniforms",this,ce),de("fogUniforms",this,ce),de("lightsUniforms",this,ce),de("shadowUniforms",this,ce),ae.bind(),W.setColorMode(new zi([Q.ONE,Q.ONE_MINUS_SRC_ALPHA,Q.ZERO,Q.ONE],h.aj.transparent,[!0,!0,!0,!1])),W.setDepthMode(new Jn(c.func===Q.LESS?Q.LEQUAL:c.func,Jn.ReadOnly,c.range)),W.setStencilMode(pi.disabled);const be=3*D.primitiveLength*2,De=3*D.primitiveOffset*2*2;if(this.forceManualRenderingForInstanceIDShaders){const Te=H||1;for(let Le=0;Le1?Q.drawElementsInstanced(Q.LINES,be,Q.UNSIGNED_SHORT,De,H):Q.drawElements(Q.LINES,be,Q.UNSIGNED_SHORT,De);C.bind(),W.program.set(this.program),W.setDepthMode(c),W.setStencilMode(_),W.setColorMode(v)}checkUniforms(s,c,_){if(this.fixedDefines.includes(c))for(const v of Object.keys(_))if(!_[v].initialized)throw new Error(`Program '${this.name}', from draw '${s}': uniform ${v} not set but required by ${c} being defined`)}draw(s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce){const de=s.context,be=de.gl;if(this.failedToCreate)return;de.program.set(this.program),de.setDepthMode(_),de.setStencilMode(v),de.setColorMode(C),de.setCullFace(D);for(const Le of Object.keys(this.fixedUniforms))this.fixedUniforms[Le].set(this.program,Le,O[Le]);ae&&ae.setUniforms(this.program,de,this.binderUniforms,W,{zoom:Q});const De={[be.POINTS]:1,[be.LINES]:2,[be.TRIANGLES]:3,[be.LINE_STRIP]:1}[c];this.checkUniforms(B,"RENDER_SHADOWS",this.shadowUniforms);const Te=ce&&ce>0?1:void 0;for(const Le of G.get()){const Me=Le.vaos||(Le.vaos={});if((Me[B]||(Me[B]=new qb)).bind(de,this,U,ae?ae.getPaintVertexBuffers():[],H,Le.vertexOffset,ie||[],Te),this.forceManualRenderingForInstanceIDShaders){const Pe=ce||1;for(let Ae=0;Ae1?be.drawElementsInstanced(c,Le.primitiveLength*De,be.UNSIGNED_SHORT,Le.primitiveOffset*De*2,ce):H?be.drawElements(c,Le.primitiveLength*De,be.UNSIGNED_SHORT,Le.primitiveOffset*De*2):be.drawArrays(c,Le.vertexOffset,Le.vertexLength);c===be.TRIANGLES&&H&&this._drawDebugWireframe(s,_,v,C,H,Le,W,Q,ae,ce)}}}function bi(f,s){const c=Math.pow(2,s.tileID.overscaledZ),_=s.tileSize*Math.pow(2,f.transform.tileZoom)/c,v=_*(s.tileID.canonical.x+s.tileID.wrap*c),C=_*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture?s.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/h.ar(s,1,f.transform.tileZoom),u_pixel_coord_upper:[v>>16,C>>16],u_pixel_coord_lower:[65535&v,65535&C]}}const xh={terrain:0,flat:1},bl=h.ab.mat4.create(),gc=(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de)=>{const be=s.style.light,De=be.properties.get("position"),Te=[De.x,De.y,De.z],Le=h.ab.mat3.create();"viewport"===be.properties.get("anchor")&&(h.ab.mat3.fromRotation(Le,-s.transform.angle),h.ab.vec3.transformMat3(Te,Te,Le));const Me=be.properties.get("color"),Pe=s.transform,Ae={u_matrix:f,u_lightpos:Te,u_lightintensity:be.properties.get("intensity"),u_lightcolor:[Me.r,Me.g,Me.b],u_vertical_gradient:+c,u_opacity:_,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:bl,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_height_type:xh[U],u_base_type:xh[H],u_ao:v,u_edge_radius:C,u_width_scale:D,u_flood_light_color:ae,u_vertical_scale:ie,u_flood_light_intensity:ce,u_ground_shadow_factor:de};return"globe"===Pe.projection.name&&(Ae.u_tile_id=[O.canonical.x,O.canonical.y,1<({u_matrix:f,u_edge_radius:s,u_width_scale:c,u_vertical_scale:_,u_height_type:xh[v],u_base_type:xh[C]}),fp=(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce)=>{const de=gc(f,s,c,_,v,C,D,O,U,H,G,W,Q,ae,ie,ce,1,[0,0,0]),be={u_height_factor:-Math.pow(2,O.overscaledZ)/B.tileSize/8};return h.l(de,bi(s,B),be)},Pr=(f,s)=>({u_matrix:f,u_emissive_strength:s}),Zr=(f,s,c,_)=>h.l(Pr(f,s),bi(c,_)),Ka=(f,s,c)=>({u_matrix:f,u_world:c,u_emissive_strength:s}),eg=(f,s,c,_,v)=>h.l(Zr(f,s,c,_),{u_world:v}),xd=(f,s,c,_)=>{const v=h.ag/c.tileSize;return{u_matrix:f,u_camera_to_center_distance:s.getCameraToCenterDistance(_),u_extrude_scale:[s.pixelsToGLUnits[0]/v,s.pixelsToGLUnits[1]/v]}},au=(f,s,c=1)=>({u_matrix:f,u_color:s.toRenderColor(null),u_overlay:0,u_overlay_scale:c}),yl=h.ab.mat4.create(),En=(f,s,c,_,v,C,D)=>{const O=f.transform,B="globe"===O.projection.name,U=B?h.cN(O.zoom,s.canonical)*O._pixelsPerMercatorPixel:h.ar(c,1,C),H={u_matrix:s.projMatrix,u_extrude_scale:U,u_intensity:D,u_inv_rot_matrix:yl,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(B){H.u_inv_rot_matrix=_,H.u_merc_center=v,H.u_tile_id=[s.canonical.x,s.canonical.y,1<({u_matrix:f,u_normalize_matrix:s,u_globe_matrix:c,u_merc_matrix:_,u_grid_matrix:v,u_tl_parent:C,u_scale_parent:U,u_fade_t:H.mix,u_opacity:H.opacity*G.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:G.paint.get("raster-brightness-min"),u_brightness_high:G.paint.get("raster-brightness-max"),u_saturation_factor:h.cO(G.paint.get("raster-saturation")),u_contrast_factor:h.cP(G.paint.get("raster-contrast")),u_spin_weights:Ch(G.paint.get("raster-hue-rotate")),u_perspective_transform:W,u_raster_elevation:Q,u_zoom_transition:D,u_merc_center:O,u_cutoff_params:B,u_colorization_mix:tg(h.cQ,ie,de),u_colorization_offset:Qb(h.cQ,ce,de),u_color_ramp:ae,u_texture_offset:[De/(be+2*De),be/(be+2*De)],u_texture_res:[be+2*De,be+2*De],u_emissive_strength:Te});function Ch(f){f*=Math.PI/180;const s=Math.sin(f),c=Math.cos(f);return[(2*c+1)/3,(-Math.sqrt(3)*s-c+1)/3,(Math.sqrt(3)*s-c+1)/3]}const Gn=.05,hm=(f,s,c,_,v,C,D,O,B,U,H,G)=>({u_matrix:f,u_normalize_matrix:s,u_globe_matrix:c,u_merc_matrix:_,u_grid_matrix:v,u_tl_parent:C,u_scale_parent:U,u_fade_t:H.mix,u_opacity:H.opacity,u_image0:0,u_image1:1,u_raster_elevation:G,u_zoom_transition:D,u_merc_center:O,u_cutoff_params:B}),rD=(f,s,c,_,v,C,D,O,B,U)=>({u_particle_texture:f,u_particle_texture_side_len:s,u_tile_offset:c,u_velocity:_,u_color_ramp:C,u_velocity_res:v,u_max_speed:D,u_uv_offset:O,u_data_scale:[255*B[0],255*B[1]],u_data_offset:U,u_particle_pos_scale:1.1,u_particle_pos_offset:[Gn,Gn]}),aD=(f,s,c,_,v,C,D,O,B,U)=>({u_particle_texture:f,u_particle_texture_side_len:s,u_velocity:c,u_velocity_res:_,u_max_speed:v,u_speed_factor:C,u_reset_rate:D,u_rand_seed:Math.random(),u_uv_offset:O,u_data_scale:[255*B[0],255*B[1]],u_data_offset:U,u_particle_pos_scale:1.1,u_particle_pos_offset:[Gn,Gn]}),Jb=h.ab.mat4.create(),A0=(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de,be,De,Te,Le)=>{const Me=v.transform,Pe={u_is_size_zoom_constant:+("constant"===f||"source"===f),u_is_size_feature_constant:+("constant"===f||"camera"===f),u_size_t:s?s.uSizeT:0,u_size:s?s.uSize:0,u_camera_to_center_distance:Me.getCameraToCenterDistance(be),u_rotate_symbol:+c,u_aspect_ratio:Me.width/Me.height,u_fade_change:v.options.fadeDuration?v.symbolFadeChange:1,u_matrix:C,u_label_plane_matrix:D,u_coord_matrix:O,u_is_text:+U,u_elevation_from_sea:B?1:0,u_pitch_with_map:+_,u_texsize:H,u_texsize_icon:G,u_texture:0,u_texture_icon:1,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Jb,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:Jb,u_up_vector:[0,-1,0],u_color_adj_mat:De,u_icon_transition:Te||0,u_gamma_scale:_?v.transform.getCameraToCenterDistance(be)*Math.cos(v.terrain?0:v.transform._pitch):1,u_device_pixel_ratio:h.q.devicePixelRatio,u_is_halo:+W,u_scale_factor:Le||1};return"globe"===be.name&&(Pe.u_tile_id=[Q.canonical.x,Q.canonical.y,1<({u_matrix:f,u_emissive_strength:s,u_opacity:c,u_color:_}),fw=(f,s,c,_,v,C,D,O,B)=>h.l(function(U,H,G,W,Q,ae){const{width:ie,height:ce}=W.imageManager.getPixelSize(H),de=Math.pow(2,ae.tileID.overscaledZ),be=ae.tileSize*Math.pow(2,W.transform.tileZoom)/de,De=be*(ae.tileID.canonical.x+ae.tileID.wrap*de),Te=be*ae.tileID.canonical.y;return{u_image:0,u_pattern_tl:G.tl,u_pattern_br:G.br,u_texsize:[ie,ce],u_pattern_size:G.displaySize,u_pattern_units_to_pixels:Q?[W.transform.width,-1*W.transform.height]:[1/h.ar(ae,1,W.transform.tileZoom),1/h.ar(ae,1,W.transform.tileZoom)],u_pixel_coord_upper:[De>>16,Te>>16],u_pixel_coord_lower:[65535&De,65535&Te]}}(0,C,D,_,O,B),{u_matrix:f,u_emissive_strength:s,u_opacity:c}),ng=new Float32Array(h.ab.mat4.identity([])),ig=(f,s,c,_,v,C,D,O,B,U,H,G,W,Q=[0,0,0],ae)=>{const ie=v.style.light,ce=ie.properties.get("position"),de=[-ce.x,-ce.y,ce.z],be=h.ab.mat3.create();"viewport"===ie.properties.get("anchor")&&(h.ab.mat3.fromRotation(be,-v.transform.angle),h.ab.vec3.transformMat3(de,de,be));const De="MASK"===H.alphaMode,Te=ie.properties.get("color").toRenderColor(null),Le=W.paint.get("model-ambient-occlusion-intensity"),Me=W.paint.get("model-color").constantOr(h.aj.white).toRenderColor(null),Pe=W.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:f,u_lighting_matrix:s,u_normal_matrix:c,u_node_matrix:_||ng,u_lightpos:de,u_lightintensity:ie.properties.get("intensity"),u_lightcolor:[Te.r,Te.g,Te.b],u_camera_pos:Q,u_opacity:C,u_baseTextureIsAlpha:0,u_alphaMask:+De,u_alphaCutoff:H.alphaCutoff,u_baseColorFactor:[D.r,D.g,D.b,D.a],u_emissiveFactor:[O[0],O[1],O[2],1],u_metallicFactor:B,u_roughnessFactor:U,u_baseColorTexture:js_BaseColor,u_metallicRoughnessTexture:js_MetallicRoughness,u_normalTexture:js_Normal,u_occlusionTexture:js_Occlusion,u_emissionTexture:js_Emission,u_lutTexture:js_LUT,u_color_mix:[Me.r,Me.g,Me.b,Pe],u_aoIntensity:Le,u_emissive_strength:G,u_occlusionTextureTransform:ae||[0,0,0,0]}},ey=(f,s=ng,c=ng)=>({u_matrix:f,u_instance:s,u_node_matrix:c}),R0={fillExtrusion:f=>({u_matrix:new h.bJ(f),u_lightpos:new h.bL(f),u_lightintensity:new h.bM(f),u_lightcolor:new h.bL(f),u_vertical_gradient:new h.bM(f),u_opacity:new h.bM(f),u_edge_radius:new h.bM(f),u_width_scale:new h.bM(f),u_ao:new h.bK(f),u_height_type:new h.bN(f),u_base_type:new h.bN(f),u_tile_id:new h.bL(f),u_zoom_transition:new h.bM(f),u_inv_rot_matrix:new h.bJ(f),u_merc_center:new h.bK(f),u_up_dir:new h.bL(f),u_height_lift:new h.bM(f),u_flood_light_color:new h.bL(f),u_vertical_scale:new h.bM(f),u_flood_light_intensity:new h.bM(f),u_ground_shadow_factor:new h.bL(f)}),fillExtrusionDepth:f=>({u_matrix:new h.bJ(f),u_edge_radius:new h.bM(f),u_width_scale:new h.bM(f),u_vertical_scale:new h.bM(f),u_height_type:new h.bN(f),u_base_type:new h.bN(f)}),fillExtrusionPattern:f=>({u_matrix:new h.bJ(f),u_lightpos:new h.bL(f),u_lightintensity:new h.bM(f),u_lightcolor:new h.bL(f),u_vertical_gradient:new h.bM(f),u_height_factor:new h.bM(f),u_edge_radius:new h.bM(f),u_width_scale:new h.bM(f),u_ao:new h.bK(f),u_height_type:new h.bN(f),u_base_type:new h.bN(f),u_tile_id:new h.bL(f),u_zoom_transition:new h.bM(f),u_inv_rot_matrix:new h.bJ(f),u_merc_center:new h.bK(f),u_up_dir:new h.bL(f),u_height_lift:new h.bM(f),u_image:new h.bN(f),u_texsize:new h.bK(f),u_pixel_coord_upper:new h.bK(f),u_pixel_coord_lower:new h.bK(f),u_tile_units_to_pixels:new h.bM(f),u_opacity:new h.bM(f)}),fillExtrusionGroundEffect:f=>({u_matrix:new h.bJ(f),u_opacity:new h.bM(f),u_ao_pass:new h.bM(f),u_meter_to_tile:new h.bM(f),u_ao:new h.bK(f),u_flood_light_intensity:new h.bM(f),u_flood_light_color:new h.bL(f),u_attenuation:new h.bM(f),u_edge_radius:new h.bM(f),u_fb:new h.bN(f),u_fb_size:new h.bM(f),u_dynamic_offset:new h.bM(f)}),fill:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f)}),fillPattern:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f),u_image:new h.bN(f),u_texsize:new h.bK(f),u_pixel_coord_upper:new h.bK(f),u_pixel_coord_lower:new h.bK(f),u_tile_units_to_pixels:new h.bM(f)}),fillOutline:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f),u_world:new h.bK(f)}),fillOutlinePattern:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f),u_world:new h.bK(f),u_image:new h.bN(f),u_texsize:new h.bK(f),u_pixel_coord_upper:new h.bK(f),u_pixel_coord_lower:new h.bK(f),u_tile_units_to_pixels:new h.bM(f)}),circle:h.cS,collisionBox:f=>({u_matrix:new h.bJ(f),u_camera_to_center_distance:new h.bM(f),u_extrude_scale:new h.bK(f)}),collisionCircle:f=>({u_matrix:new h.bJ(f),u_inv_matrix:new h.bJ(f),u_camera_to_center_distance:new h.bM(f),u_viewport_size:new h.bK(f)}),debug:f=>({u_color:new h.cz(f),u_matrix:new h.bJ(f),u_overlay:new h.bN(f),u_overlay_scale:new h.bM(f)}),clippingMask:f=>({u_matrix:new h.bJ(f)}),heatmap:f=>({u_extrude_scale:new h.bM(f),u_intensity:new h.bM(f),u_matrix:new h.bJ(f),u_inv_rot_matrix:new h.bJ(f),u_merc_center:new h.bK(f),u_tile_id:new h.bL(f),u_zoom_transition:new h.bM(f),u_up_dir:new h.bL(f)}),heatmapTexture:f=>({u_image:new h.bN(f),u_color_ramp:new h.bN(f),u_opacity:new h.bM(f)}),hillshade:f=>({u_matrix:new h.bJ(f),u_image:new h.bN(f),u_latrange:new h.bK(f),u_light:new h.bK(f),u_shadow:new h.cz(f),u_highlight:new h.cz(f),u_emissive_strength:new h.bM(f),u_accent:new h.cz(f)}),hillshadePrepare:f=>({u_matrix:new h.bJ(f),u_image:new h.bN(f),u_dimension:new h.bK(f),u_zoom:new h.bM(f)}),line:h.cT,linePattern:h.cU,raster:f=>({u_matrix:new h.bJ(f),u_normalize_matrix:new h.bJ(f),u_globe_matrix:new h.bJ(f),u_merc_matrix:new h.bJ(f),u_grid_matrix:new h.cA(f),u_tl_parent:new h.bK(f),u_scale_parent:new h.bM(f),u_fade_t:new h.bM(f),u_opacity:new h.bM(f),u_image0:new h.bN(f),u_image1:new h.bN(f),u_brightness_low:new h.bM(f),u_brightness_high:new h.bM(f),u_saturation_factor:new h.bM(f),u_contrast_factor:new h.bM(f),u_spin_weights:new h.bL(f),u_perspective_transform:new h.bK(f),u_raster_elevation:new h.bM(f),u_zoom_transition:new h.bM(f),u_merc_center:new h.bK(f),u_cutoff_params:new h.ca(f),u_colorization_mix:new h.ca(f),u_colorization_offset:new h.bM(f),u_color_ramp:new h.bN(f),u_texture_offset:new h.bK(f),u_texture_res:new h.bK(f),u_emissive_strength:new h.bM(f)}),rasterParticle:f=>({u_matrix:new h.bJ(f),u_normalize_matrix:new h.bJ(f),u_globe_matrix:new h.bJ(f),u_merc_matrix:new h.bJ(f),u_grid_matrix:new h.cA(f),u_tl_parent:new h.bK(f),u_scale_parent:new h.bM(f),u_fade_t:new h.bM(f),u_opacity:new h.bM(f),u_image0:new h.bN(f),u_image1:new h.bN(f),u_raster_elevation:new h.bM(f),u_zoom_transition:new h.bM(f),u_merc_center:new h.bK(f),u_cutoff_params:new h.ca(f)}),rasterParticleTexture:f=>({u_texture:new h.bN(f),u_opacity:new h.bM(f)}),rasterParticleDraw:f=>({u_particle_texture:new h.bN(f),u_particle_texture_side_len:new h.bM(f),u_tile_offset:new h.bK(f),u_velocity:new h.bN(f),u_color_ramp:new h.bN(f),u_velocity_res:new h.bK(f),u_max_speed:new h.bM(f),u_uv_offset:new h.bK(f),u_data_scale:new h.bK(f),u_data_offset:new h.bM(f),u_particle_pos_scale:new h.bM(f),u_particle_pos_offset:new h.bK(f)}),rasterParticleUpdate:f=>({u_particle_texture:new h.bN(f),u_particle_texture_side_len:new h.bM(f),u_velocity:new h.bN(f),u_velocity_res:new h.bK(f),u_max_speed:new h.bM(f),u_speed_factor:new h.bM(f),u_reset_rate:new h.bM(f),u_rand_seed:new h.bM(f),u_uv_offset:new h.bK(f),u_data_scale:new h.bK(f),u_data_offset:new h.bM(f),u_particle_pos_scale:new h.bM(f),u_particle_pos_offset:new h.bK(f)}),symbol:f=>({u_is_size_zoom_constant:new h.bN(f),u_is_size_feature_constant:new h.bN(f),u_size_t:new h.bM(f),u_size:new h.bM(f),u_camera_to_center_distance:new h.bM(f),u_rotate_symbol:new h.bN(f),u_aspect_ratio:new h.bM(f),u_fade_change:new h.bM(f),u_matrix:new h.bJ(f),u_label_plane_matrix:new h.bJ(f),u_coord_matrix:new h.bJ(f),u_is_text:new h.bN(f),u_elevation_from_sea:new h.bN(f),u_pitch_with_map:new h.bN(f),u_texsize:new h.bK(f),u_texsize_icon:new h.bK(f),u_texture:new h.bN(f),u_texture_icon:new h.bN(f),u_gamma_scale:new h.bM(f),u_device_pixel_ratio:new h.bM(f),u_tile_id:new h.bL(f),u_zoom_transition:new h.bM(f),u_inv_rot_matrix:new h.bJ(f),u_merc_center:new h.bK(f),u_camera_forward:new h.bL(f),u_tile_matrix:new h.bJ(f),u_up_vector:new h.bL(f),u_ecef_origin:new h.bL(f),u_is_halo:new h.bN(f),u_icon_transition:new h.bM(f),u_color_adj_mat:new h.bJ(f),u_scale_factor:new h.bM(f)}),background:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f),u_opacity:new h.bM(f),u_color:new h.cz(f)}),backgroundPattern:f=>({u_matrix:new h.bJ(f),u_emissive_strength:new h.bM(f),u_opacity:new h.bM(f),u_image:new h.bN(f),u_pattern_tl:new h.bK(f),u_pattern_br:new h.bK(f),u_texsize:new h.bK(f),u_pattern_size:new h.bK(f),u_pixel_coord_upper:new h.bK(f),u_pixel_coord_lower:new h.bK(f),u_pattern_units_to_pixels:new h.bK(f)}),terrainRaster:f=>({u_matrix:new h.bJ(f),u_image0:new h.bN(f),u_skirt_height:new h.bM(f),u_ground_shadow_factor:new h.bL(f)}),skybox:f=>({u_matrix:new h.bJ(f),u_sun_direction:new h.bL(f),u_cubemap:new h.bN(f),u_opacity:new h.bM(f),u_temporal_offset:new h.bM(f)}),skyboxGradient:f=>({u_matrix:new h.bJ(f),u_color_ramp:new h.bN(f),u_center_direction:new h.bL(f),u_radius:new h.bM(f),u_opacity:new h.bM(f),u_temporal_offset:new h.bM(f)}),skyboxCapture:f=>({u_matrix_3f:new h.cA(f),u_sun_direction:new h.bL(f),u_sun_intensity:new h.bM(f),u_color_tint_r:new h.ca(f),u_color_tint_m:new h.ca(f),u_luminance:new h.bM(f)}),globeRaster:f=>({u_proj_matrix:new h.bJ(f),u_globe_matrix:new h.bJ(f),u_normalize_matrix:new h.bJ(f),u_merc_matrix:new h.bJ(f),u_zoom_transition:new h.bM(f),u_merc_center:new h.bK(f),u_image0:new h.bN(f),u_grid_matrix:new h.cA(f),u_skirt_height:new h.bM(f),u_far_z_cutoff:new h.bM(f),u_frustum_tl:new h.bL(f),u_frustum_tr:new h.bL(f),u_frustum_br:new h.bL(f),u_frustum_bl:new h.bL(f),u_globe_pos:new h.bL(f),u_globe_radius:new h.bM(f),u_viewport:new h.bK(f)}),globeAtmosphere:f=>({u_frustum_tl:new h.bL(f),u_frustum_tr:new h.bL(f),u_frustum_br:new h.bL(f),u_frustum_bl:new h.bL(f),u_horizon:new h.bM(f),u_transition:new h.bM(f),u_fadeout_range:new h.bM(f),u_color:new h.ca(f),u_high_color:new h.ca(f),u_space_color:new h.ca(f),u_temporal_offset:new h.bM(f),u_horizon_angle:new h.bM(f)}),model:f=>({u_matrix:new h.bJ(f),u_lighting_matrix:new h.bJ(f),u_normal_matrix:new h.bJ(f),u_node_matrix:new h.bJ(f),u_lightpos:new h.bL(f),u_lightintensity:new h.bM(f),u_lightcolor:new h.bL(f),u_camera_pos:new h.bL(f),u_opacity:new h.bM(f),u_baseColorFactor:new h.ca(f),u_emissiveFactor:new h.ca(f),u_metallicFactor:new h.bM(f),u_roughnessFactor:new h.bM(f),u_baseTextureIsAlpha:new h.bN(f),u_alphaMask:new h.bN(f),u_alphaCutoff:new h.bM(f),u_baseColorTexture:new h.bN(f),u_metallicRoughnessTexture:new h.bN(f),u_normalTexture:new h.bN(f),u_occlusionTexture:new h.bN(f),u_emissionTexture:new h.bN(f),u_lutTexture:new h.bN(f),u_color_mix:new h.ca(f),u_aoIntensity:new h.bM(f),u_emissive_strength:new h.bM(f),u_occlusionTextureTransform:new h.ca(f)}),modelDepth:f=>({u_matrix:new h.bJ(f),u_instance:new h.bJ(f),u_node_matrix:new h.bJ(f)}),groundShadow:f=>({u_matrix:new h.bJ(f),u_ground_shadow_factor:new h.bL(f)}),stars:f=>({u_matrix:new h.bJ(f),u_up:new h.bL(f),u_right:new h.bL(f),u_intensity_multiplier:new h.bM(f)}),snowParticle:f=>({u_modelview:new h.bJ(f),u_projection:new h.bJ(f),u_time:new h.bM(f),u_cam_pos:new h.bL(f),u_velocityConeAperture:new h.bM(f),u_velocity:new h.bM(f),u_horizontalOscillationRadius:new h.bM(f),u_horizontalOscillationRate:new h.bM(f),u_boxSize:new h.bM(f),u_billboardSize:new h.bM(f),u_simpleShapeParameters:new h.bK(f),u_screenSize:new h.bK(f),u_thinningCenterPos:new h.bK(f),u_thinningShape:new h.bL(f),u_thinningAffectedRatio:new h.bM(f),u_thinningParticleOffset:new h.bM(f),u_particleColor:new h.ca(f),u_direction:new h.bL(f)}),rainParticle:f=>({u_modelview:new h.bJ(f),u_projection:new h.bJ(f),u_time:new h.bM(f),u_cam_pos:new h.bL(f),u_texScreen:new h.bN(f),u_velocityConeAperture:new h.bM(f),u_velocity:new h.bM(f),u_boxSize:new h.bM(f),u_rainDropletSize:new h.bK(f),u_distortionStrength:new h.bM(f),u_rainDirection:new h.bL(f),u_color:new h.ca(f),u_screenSize:new h.bK(f),u_thinningCenterPos:new h.bK(f),u_thinningShape:new h.bL(f),u_thinningAffectedRatio:new h.bM(f),u_thinningParticleOffset:new h.bM(f),u_shapeDirectionalPower:new h.bM(f),u_shapeNormalPower:new h.bM(f),u_mode:new h.bM(f)}),vignette:f=>({u_vignetteShape:new h.bL(f),u_vignetteColor:new h.ca(f)}),occlusion:f=>({u_matrix:new h.bJ(f),u_anchorPos:new h.bL(f),u_screenSizePx:new h.bK(f),u_occluderSizePx:new h.bK(f),u_color:new h.ca(f)})};let ty=(()=>{class f{constructor(c,_,v,C){this.id=f.uniqueIdxCounter,f.uniqueIdxCounter++,this.context=c;const D=c.gl;this.buffer=D.createBuffer(),this.dynamicDraw=!!v,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),D.bufferData(D.ELEMENT_ARRAY_BUFFER,_.arrayBuffer,this.dynamicDraw?D.DYNAMIC_DRAW:D.STATIC_DRAW),this.dynamicDraw||C||_.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){this.id=f.uniqueIdxCounter,f.uniqueIdxCounter++;const _=this.context.gl;this.context.unbindVAO(),this.bind(),_.bufferSubData(_.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}return f.uniqueIdxCounter=0,f})();const Zl={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ru{constructor(s,c,_,v,C,D){this.length=c.length,this.attributes=_,this.itemSize=c.bytesPerElement,this.dynamicDraw=v,this.instanceCount=D,this.context=s;const O=s.gl;this.buffer=O.createBuffer(),s.bindVertexBuffer.set(this.buffer),O.bufferData(O.ARRAY_BUFFER,c.arrayBuffer,this.dynamicDraw?O.DYNAMIC_DRAW:O.STATIC_DRAW),this.dynamicDraw||C||c.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(s){const c=this.context.gl;this.bind(),c.bufferSubData(c.ARRAY_BUFFER,0,s.arrayBuffer)}enableAttributes(s,c){for(let _=0;_0&&s.vertexAttribDivisor(C,_)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class O0{constructor(s,c,_,v,C){this.context=s,this.width=c,this.height=_;const D=this.framebuffer=s.gl.createFramebuffer();v&&(this.colorAttachment=new Sa(s,D)),C&&(this.depthAttachmentType=C,this.depthAttachment="renderbuffer"===C?new nl(s,D):new up(s,D))}destroy(){const s=this.context.gl;if(this.colorAttachment){const c=this.colorAttachment.get();c&&s.deleteTexture(c)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const c=this.depthAttachment.get();c&&s.deleteRenderbuffer(c)}else{const c=this.depthAttachment.get();c&&s.deleteTexture(c)}s.deleteFramebuffer(this.framebuffer)}}class P0{constructor(s,c){this.gl=s,this.clearColor=new Wb(this),this.clearDepth=new Zb(this),this.clearStencil=new Z_(this),this.colorMask=new sp(this),this.depthMask=new lp(this),this.stencilMask=new I0(this),this.stencilFunc=new hw(this),this.stencilOp=new Tf(this),this.stencilTest=new cp(this),this.depthRange=new fc(this),this.depthTest=new gl(this),this.depthFunc=new vh(this),this.blend=new ku(this),this.blendFunc=new Y_(this),this.blendColor=new Yb(this),this.blendEquation=new Xa(this),this.cullFace=new Df(this),this.cullFaceSide=new Xb(this),this.frontFace=new dp(this),this.program=new X_(this),this.activeTexture=new E0(this),this.viewport=new M0(this),this.bindFramebuffer=new um(this),this.bindRenderbuffer=new pw(this),this.bindTexture=new mw(this),this.bindVertexBuffer=new Kb(this),this.bindElementBuffer=new K_(this),this.bindVertexArrayOES=new Dr(this),this.pixelStoreUnpack=new Ln(this),this.pixelStoreUnpackPremultiplyAlpha=new Yi(this),this.pixelStoreUnpackFlipY=new ia(this),this.options=c?Object.assign({},c):{},this.options.extTextureFilterAnisotropicForceOff||(this.extTextureFilterAnisotropic=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=s.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))),this.extDebugRendererInfo=s.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=s.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=s.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.forceManualRenderingForInstanceIDShaders=c&&!!c.forceManualRenderingForInstanceIDShaders||this.renderer&&-1!==this.renderer.indexOf("PowerVR"),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=s.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=s.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=s.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),this.maxPointSize=s.getParameter(s.ALIASED_POINT_SIZE_RANGE)[1]}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(s,c,_){return new ty(this,s,c,_)}createVertexBuffer(s,c,_,v,C){return new Ru(this,s,c,_,v,C)}createRenderbuffer(s,c,_){const v=this.gl,C=v.createRenderbuffer();return this.bindRenderbuffer.set(C),v.renderbufferStorage(v.RENDERBUFFER,s,c,_),this.bindRenderbuffer.set(null),C}createFramebuffer(s,c,_,v){return new O0(this,s,c,_,v)}clear({color:s,depth:c,stencil:_,colorMask:v}){const C=this.gl;let D=0;s&&(D|=C.COLOR_BUFFER_BIT,this.clearColor.set(s),this.colorMask.set(v||[!0,!0,!0,!0])),void 0!==c&&(D|=C.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(c),this.depthMask.set(!0)),void 0!==_&&(D|=C.STENCIL_BUFFER_BIT,this.clearStencil.set(_),this.stencilMask.set(255)),C.clear(D)}setCullFace(s){!1===s.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(s.mode),this.frontFace.set(s.frontFace))}setDepthMode(s){s.func!==this.gl.ALWAYS||s.mask?(this.depthTest.set(!0),this.depthFunc.set(s.func),this.depthMask.set(s.mask),this.depthRange.set(s.range)):this.depthTest.set(!1)}setStencilMode(s){s.test.func!==this.gl.ALWAYS||s.mask?(this.stencilTest.set(!0),this.stencilMask.set(s.mask),this.stencilOp.set([s.fail,s.depthFail,s.pass]),this.stencilFunc.set({func:s.test.func,ref:s.ref,mask:s.test.mask})):this.stencilTest.set(!1)}setColorMode(s){h.bn(s.blendFunction,zi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(s.blendFunction),this.blendColor.set(s.blendColor),s.blendEquation?this.blendEquation.set(s.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(s.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}let Ef;function og(f,s,c,_,v,C,D){const O=f.context,B=O.gl,U=f.transform,H=f.getOrCreateProgram("collisionBox"),G=[];let W=0,Q=0;for(let Te=0;Te<_.length;Te++){const Le=_[Te],Me=s.getTile(Le),Pe=Me.getBucket(c);if(!Pe)continue;const Ae=Qd(Le,Pe,U);let Ve=Ae;0===v[0]&&0===v[1]||(Ve=f.translatePosMatrix(Ae,Me,v,C));const Ye=D?Pe.textCollisionBox:Pe.iconCollisionBox,vt=Pe.collisionCircleArray;if(vt.length>0){const Ke=h.ab.mat4.create(),Mt=Ve;h.ab.mat4.mul(Ke,Pe.placementInvProjMatrix,U.glCoordMatrix),h.ab.mat4.mul(Ke,Ke,Pe.placementViewportMatrix),G.push({circleArray:vt,circleOffset:Q,transform:Mt,invTransform:Ke,projection:Pe.getProjection()}),W+=vt.length/4,Q=W}Ye&&(f.terrain&&f.terrain.setupElevationDraw(Me,H),H.draw(f,B.LINES,Jn.disabled,pi.disabled,f.colorModeForRenderPass(),gi.disabled,xd(Ve,U,Me,Pe.getProjection()),c.id,Ye.layoutVertexBuffer,Ye.indexBuffer,Ye.segments,null,U.zoom,null,[Ye.collisionVertexBuffer,Ye.collisionVertexBufferExt]))}if(!D||!G.length)return;const ae=f.getOrCreateProgram("collisionCircle"),ie=new h.cV;ie.resize(4*W),ie._trim();let ce=0;for(const Te of G)for(let Le=0;Le=0&&(ae[Te.associatedIconIndex]={x:Ke,y:Mt,z:Rt,angle:zt})}else Vr(Pe,W)}if(H){Q.clear();const De=f.icon.placedSymbolArray;for(let Te=0;Te{Ae.depthOcclusionForSymbolsAndCircles&&(c.hasInitialOcclusionOpacityProperties||f.terrain)&&(Mo.push("DEPTH_D24"),Mo.push("DEPTH_OCCLUSION"))},uo=()=>{const Mo=Ve&&"point"!==c.layout.get("symbol-placement"),Do=[];vi(Do);const xr=Mo||Wn,Ua=c.paint.get("icon-image-cross-fade").constantOr(0);f.terrainRenderModeElevated()&&vt&&Do.push("PITCH_WITH_MAP_TERRAIN"),Kt&&(Do.push("PROJECTION_GLOBE_VIEW"),xr&&Do.push("PROJECTED_POS_ON_VIEWPORT")),Ua>0&&Do.push("ICON_TRANSITION"),Ft.icon.zOffsetVertexBuffer&&Do.push("Z_OFFSET"),0===de&&0===be&&0===De&&1===Te||Do.push("COLOR_ADJUSTMENT"),Ft.sdfIcons&&Do.push("RENDER_SDF");const aa=Ft.icon.programConfigurations.get(c.id),Ta=f.getOrCreateProgram("symbol",{config:aa,defines:Do}),vc=$t.imageAtlasTexture?$t.imageAtlasTexture.size:[0,0],$s=Ft.iconSizeData,Mr=h.bp($s,Ae.zoom),bo=vt||0!==Ae.pitch,Xo=Ss(Sn,$t.tileID.canonical,vt,Ve,Ae,Ft.getProjection(),Rn),ao=zb(Sn,$t.tileID.canonical,vt,Ve,Ae,Ft.getProjection(),Rn),_a=f.translatePosMatrix(ao,$t,O,U,!0),ms=f.translatePosMatrix(Sn,$t,O,U),Ko=xr?pm:Xo,ll=Ve&&!vt&&!Mo;let qc=xt;!tt&&!Ae.mercatorFromTransition||Ve||(qc=go(Ae));const lc=Kt?qc:xt,fs=c.getColorAdjustmentMatrix(de,be,De,Te),Pn=A0($s.kind,Mr,ll,vt,f,ms,Ko,_a,Le,!1,vc,[0,0],!0,rn,en,wt,Xn,lc,Ft.getProjection(),fs,Ua),xc=$t.imageAtlasTexture?$t.imageAtlasTexture:null,Gs=1!==c.layout.get("icon-size").constantOr(0)||Ft.iconsNeedLinear,Dm=Ft.sdfIcons||f.options.rotating||f.options.zooming||Gs||bo?Pe.LINEAR:Pe.NEAREST,Da=Ft.sdfIcons&&0!==c.paint.get("icon-halo-width").constantOr(1),hu=f.terrain&&vt&&Mo?h.ab.mat4.invert(h.ab.mat4.create(),Xo):pm;if(Mo&&Ft.icon){const Ap=Ae.elevation,vg=Ap?Ap.getAtTileOffsetFunc(rn,Ae.center.lat,Ae.worldSize,Ft.getProjection()):null,Od=Br(Sn,$t.tileID.canonical,vt,Ve,Ae,Ft.getProjection(),Rn);mf(Ft,Sn,f,!1,Od,ao,vt,ie,vg,rn)}return{program:Ta,buffers:Ft.icon,uniformValues:Pn,atlasTexture:xc,atlasTextureIcon:null,atlasInterpolation:Dm,atlasInterpolationIcon:null,isSDF:Ft.sdfIcons,hasHalo:Da,tile:$t,labelPlaneMatrixInv:hu}},Fo=()=>{const Mo=Ye&&"point"!==c.layout.get("symbol-placement"),Do=[],xr=Mo||Ut||Wn;f.terrainRenderModeElevated()&&Ke&&Do.push("PITCH_WITH_MAP_TERRAIN"),Kt&&(Do.push("PROJECTION_GLOBE_VIEW"),xr&&Do.push("PROJECTED_POS_ON_VIEWPORT")),Ft.text.zOffsetVertexBuffer&&Do.push("Z_OFFSET"),Ft.iconsInText&&Do.push("RENDER_TEXT_AND_SYMBOL"),Do.push("RENDER_SDF"),vi(Do);const Ua=Ft.text.programConfigurations.get(c.id),aa=f.getOrCreateProgram("symbol",{config:Ua,defines:Do});let Ta,vc=[0,0],$s=null;const Mr=Ft.textSizeData;Ft.iconsInText&&(vc=$t.imageAtlasTexture?$t.imageAtlasTexture.size:[0,0],$s=$t.imageAtlasTexture?$t.imageAtlasTexture:null,Ta=Ke||0!==Ae.pitch||f.options.rotating||f.options.zooming||"composite"===Mr.kind||"camera"===Mr.kind?Pe.LINEAR:Pe.NEAREST);const bo=$t.glyphAtlasTexture?$t.glyphAtlasTexture.size:[0,0],Xo=c.layout.get("text-size-scale-range"),ao=h.aw(f.scaleFactor,Xo[0],Xo[1]),_a=h.bp(Mr,Ae.zoom,ao),ms=Ss(Sn,$t.tileID.canonical,Ke,Ye,Ae,Ft.getProjection(),Rn),Ko=zb(Sn,$t.tileID.canonical,Ke,Ye,Ae,Ft.getProjection(),Rn),ll=f.translatePosMatrix(Ko,$t,B,H,!0),qc=f.translatePosMatrix(Sn,$t,B,H),lc=xr?pm:ms,fs=Ye&&!Ke&&!Mo;let Pn=xt;!tt&&!Ae.mercatorFromTransition||Ye||(Pn=go(Ae));const xc=A0(Mr.kind,_a,fs,Ke,f,qc,lc,ll,Le,!0,bo,vc,!0,rn,en,wt,Xn,Kt?Pn:xt,Ft.getProjection(),null,null,ao),Gs=$t.glyphAtlasTexture?$t.glyphAtlasTexture:null,Dm=Pe.LINEAR,Da=0!==c.paint.get("text-halo-width").constantOr(1),hu=f.terrain&&Ke&&Mo?h.ab.mat4.invert(h.ab.mat4.create(),ms):pm;if(Mo&&Ft.text){const Ap=Ae.elevation,vg=Ap?Ap.getAtTileOffsetFunc(rn,Ae.center.lat,Ae.worldSize,Ft.getProjection()):null,Od=Br(Sn,$t.tileID.canonical,Ke,Ye,Ae,Ft.getProjection(),Rn);mf(Ft,Sn,f,!0,Od,Ko,Ke,ce,vg,rn)}return{program:aa,buffers:Ft.text,uniformValues:xc,atlasTexture:Gs,atlasTextureIcon:$s,atlasInterpolation:Dm,atlasInterpolationIcon:Ta,isSDF:!0,hasHalo:Da,tile:$t,labelPlaneMatrixInv:hu}},_r=Ft.icon.segments.get().length,ur=Ft.text.segments.get().length,tn=_r&&!D.onlyText?uo():null,yo=ur&&!D.onlyIcons?Fo():null,$n=c.paint.get("icon-opacity").constantOr(1),no=c.paint.get("text-opacity").constantOr(1);if(Mt&&Ft.canOverlap){Rt=!0;const Mo=$n&&!D.onlyText?Ft.icon.segments.get():[],Do=no&&!D.onlyIcons?Ft.text.segments.get():[];for(const xr of Mo)zt.push({segments:new h.b7([xr]),sortKey:xr.sortKey,state:tn});for(const xr of Do)zt.push({segments:new h.b7([xr]),sortKey:xr.sortKey,state:yo})}else D.onlyText||zt.push({segments:$n?Ft.icon.segments:new h.b7([]),sortKey:0,state:tn}),D.onlyIcons||zt.push({segments:no?Ft.text.segments:new h.b7([]),sortKey:0,state:yo})}Rt&&zt.sort((rn,$t)=>rn.sortKey-$t.sortKey);for(const rn of zt){const $t=rn.state;if($t)if(f.terrain?f.terrain.setupElevationDraw($t.tile,$t.program,{useDepthForOcclusion:Ae.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:$t.labelPlaneMatrixInv}):f.setupDepthForOcclusion(Ae.depthOcclusionForSymbolsAndCircles,$t.program),Me.activeTexture.set(Pe.TEXTURE0),$t.atlasTexture&&$t.atlasTexture.bind($t.atlasInterpolation,Pe.CLAMP_TO_EDGE,!0),$t.atlasTextureIcon&&(Me.activeTexture.set(Pe.TEXTURE1),$t.atlasTextureIcon&&$t.atlasTextureIcon.bind($t.atlasInterpolationIcon,Pe.CLAMP_TO_EDGE,!0)),f.uploadCommonLightUniforms(f.context,$t.program),$t.hasHalo){const Ft=$t.uniformValues;Ft.u_is_halo=1,Af($t.buffers,rn.segments,c,f,$t.program,nt,v,C,Ft,2),Ft.u_is_halo=0}else{if($t.isSDF){const Ft=$t.uniformValues;$t.hasHalo&&(Ft.u_is_halo=1,Af($t.buffers,rn.segments,c,f,$t.program,nt,v,C,Ft,1)),Ft.u_is_halo=0}Af($t.buffers,rn.segments,c,f,$t.program,nt,v,C,$t.uniformValues,1)}}}function Af(f,s,c,_,v,C,D,O,B,U){const H=[f.dynamicLayoutVertexBuffer,f.opacityVertexBuffer,f.iconTransitioningVertexBuffer,f.globeExtVertexBuffer,f.zOffsetVertexBuffer];v.draw(_,_.context.gl.TRIANGLES,C,D,O,gi.disabled,B,c.id,f.layoutVertexBuffer,f.indexBuffer,s,c.paint,_.transform.zoom,f.programConfigurations.get(c.id),H,U)}function ag(f,s,c,_,v,C,D){const O=f.context.gl,B=c.paint.get("fill-pattern"),U=c.is3D(),H=U?f.stencilModeFor3D():pi.disabled,G=B&&B.constantOr(1);let W,Q,ae,ie,ce;D?(Q=G&&!c.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",W=O.LINES):(Q=G?"fillPattern":"fill",W=O.TRIANGLES);for(const de of _){const be=s.getTile(de);if(G&&!be.patternsLoaded())continue;const De=be.getBucket(c);if(!De)continue;f.prepareDrawTile();const Te=De.programConfigurations.get(c.id),Le=f.isTileAffectedByFog(de),Me=f.getOrCreateProgram(Q,{config:Te,overrideFog:Le});G&&(f.context.activeTexture.set(O.TEXTURE0),be.imageAtlasTexture&&be.imageAtlasTexture.bind(O.LINEAR,O.CLAMP_TO_EDGE),Te.updatePaintBuffers());const Pe=B.constantOr(null);if(Pe&&be.imageAtlas){const Ye=be.imageAtlas,vt=h.A.from(Pe).getPrimary().scaleSelf(h.q.devicePixelRatio).serialize(),Ke=Ye.patternPositions[vt];Ke&&Te.setConstantPatternPositions(Ke)}const Ae=f.translatePosMatrix(de.projMatrix,be,c.paint.get("fill-translate"),c.paint.get("fill-translate-anchor")),Ve=c.paint.get("fill-emissive-strength");if(D){ie=De.indexBuffer2,ce=De.segments2;const Ye=f.terrain&&f.terrain.renderingToTexture?f.terrain.drapeBufferSize:[O.drawingBufferWidth,O.drawingBufferHeight];ae="fillOutlinePattern"===Q&&G?eg(Ae,Ve,f,be,Ye):Ka(Ae,Ve,Ye)}else ie=De.indexBuffer,ce=De.segments,ae=G?Zr(Ae,Ve,f,be):Pr(Ae,Ve);f.uploadCommonUniforms(f.context,Me,de.toUnwrapped()),Me.draw(f,W,v,U?H:f.stencilModeForClipping(de),C,gi.disabled,ae,c.id,De.layoutVertexBuffer,ie,ce,c.paint,f.transform.zoom,Te,void 0)}}function kf(f,s,c,_,v,C,D,O){c.resetLayerRenderingStats(f);const B=f.context,U=B.gl,H=f.transform,G=c.paint.get("fill-extrusion-pattern"),W=G.constantOr(1),Q=c.paint.get("fill-extrusion-opacity"),ae=f.style.enable3dLights(),ie=c.paint.get(ae&&!W?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),ce=[c.paint.get("fill-extrusion-ambient-occlusion-intensity"),ie],de=c.layout.get("fill-extrusion-edge-radius"),be=de>0&&!c.paint.get("fill-extrusion-rounded-roof"),De=be?0:de,Te="globe"===H.projection.name?h.d3():0,Le="globe"===H.projection.name,Me=Le?h.ae(H.zoom):0,Pe=[h.at(H.center.lng),h.aA(H.center.lat)],Ae="none"===c.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),Ve=c.paint.get("fill-extrusion-flood-light-color").toRenderColor(Ae?null:c.lut).toArray01().slice(0,3),Ye=c.paint.get("fill-extrusion-flood-light-intensity"),vt=c.paint.get("fill-extrusion-vertical-scale"),Ke=0!==c.paint.get("fill-extrusion-line-width").constantOr(1),Mt=c.paint.get("fill-extrusion-height-alignment"),Rt=c.paint.get("fill-extrusion-base-alignment"),nt=_l(f,c.paint.get("fill-extrusion-cutoff-fade-range")),wt=[];let Ut;Le&&wt.push("PROJECTION_GLOBE_VIEW"),ce[0]>0&&wt.push("FAUX_AO"),be&&wt.push("ZERO_ROOF_RADIUS"),O&&wt.push("HAS_CENTROID"),Ye>0&&wt.push("FLOOD_LIGHT"),nt.shouldRenderCutoff&&wt.push("RENDER_CUTOFF"),Ke&&wt.push("RENDER_WALL_MODE");const tt="shadow"===f.renderPass,zt=f.shadowRenderer,xt=tt&&!!zt;f.shadowRenderer&&(f.shadowRenderer.useNormalOffset=!0);let rn=[0,0,0];if(zt){const Kt=f.style.directionalLight,en=f.style.ambientLight;Kt&&en&&(rn=lm(f.style,Kt,en)),tt||(wt.push("RENDER_SHADOWS","DEPTH_TEXTURE"),zt.useNormalOffset&&wt.push("NORMAL_OFFSET")),Ut=wt.concat(["SHADOWS_SINGLE_CASCADE"])}const $t=xt?"fillExtrusionDepth":W?"fillExtrusionPattern":"fillExtrusion",Ft=c.getLayerRenderingStats();for(const Kt of _){const en=s.getTile(Kt),Sn=en.getBucket(c);if(!Sn||Sn.projection.name!==H.projection.name)continue;let Rn=!1;zt&&(Rn=0===zt.getMaxCascadeForTile(Kt.toUnwrapped()));const Tt=f.isTileAffectedByFog(Kt),Wn=Sn.programConfigurations.get(c.id),Xn=f.getOrCreateProgram($t,{config:Wn,defines:Rn?Ut:wt,overrideFog:Tt});if(f.terrain&&f.terrain.setupElevationDraw(en,Xn,{useMeterToDem:!0}),!Sn.centroidVertexBuffer){const yo=Xn.attributes.a_centroid_pos;void 0!==yo&&U.vertexAttrib2f(yo,0,0)}!tt&&zt&&zt.setupShadows(en.tileID.toUnwrapped(),Xn,"vector-tile",en.tileID.overscaledZ),W&&(f.context.activeTexture.set(U.TEXTURE0),en.imageAtlasTexture&&en.imageAtlasTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE),Wn.updatePaintBuffers());const vi=G.constantOr(null);if(vi&&en.imageAtlas){const yo=en.imageAtlas,$n=h.A.from(vi).getPrimary().scaleSelf(h.q.devicePixelRatio),no=yo.patternPositions[$n.serialize()];no&&Wn.setConstantPatternPositions(no)}const uo=c.paint.get("fill-extrusion-vertical-gradient"),Fo=1/Sn.tileToMeter;let _r;if(tt&&zt){if(jo(en.tileID,Sn,f))continue;const yo=zt.calculateShadowPassMatrixFromTile(en.tileID.toUnwrapped());_r=wh(yo,De,Fo,vt,Mt,Rt)}else{const yo=f.translatePosMatrix(Kt.expandedProjMatrix,en,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),$n=H.projection.createInversionMatrix(H,Kt.canonical);_r=W?fp(yo,f,uo,Q,ce,De,Fo,Kt,en,Te,Mt,Rt,Me,Pe,$n,Ve,vt):gc(yo,f,uo,Q,ce,De,Fo,Kt,Te,Mt,Rt,Me,Pe,$n,Ve,vt,Ye,rn)}f.uploadCommonUniforms(B,Xn,Kt.toUnwrapped(),null,nt);let ur=Sn.segments;if("mercator"===H.projection.name&&!tt&&(ur=Sn.getVisibleSegments(en.tileID,f.terrain,f.transform.getFrustum(0)),!ur.get().length))continue;if(Ft)if(tt)for(const yo of ur.get())Ft.numRenderedVerticesInShadowPass+=yo.primitiveLength;else for(const yo of ur.get())Ft.numRenderedVerticesInTransparentPass+=yo.primitiveLength;const tn=[];(f.terrain||O)&&tn.push(Sn.centroidVertexBuffer),Le&&tn.push(Sn.layoutVertexExtBuffer),Ke&&tn.push(Sn.wallVertexBuffer),Xn.draw(f,B.gl.TRIANGLES,v,C,D,gi.backCCW,_r,c.id,Sn.layoutVertexBuffer,Sn.indexBuffer,ur,c.paint,f.transform.zoom,Wn,tn)}f.shadowRenderer&&(f.shadowRenderer.useNormalOffset=!1)}function Sh(f,s,c,_,v,C,D,O,B,U,H,G,W,Q,ae,ie,ce,de,be){const De=f.context,Te=De.gl,Le=f.transform,Me=f.transform.zoom,Pe=[],Ae=_l(f,c.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===U?(Pe.push("CLEAR_SUBPASS"),be&&(Pe.push("CLEAR_FROM_TEXTURE"),De.activeTexture.set(Te.TEXTURE0),be.bind(Te.LINEAR,Te.CLAMP_TO_EDGE))):"sdf"===U&&Pe.push("SDF_SUBPASS"),ce&&Pe.push("HAS_CENTROID"),Ae.shouldRenderCutoff&&Pe.push("RENDER_CUTOFF");const Ve=c.layout.get("fill-extrusion-edge-radius"),Ye=(vt,Ke,Mt,Rt,nt)=>{const wt=Ke.programConfigurations.get(c.id),Ut=f.isTileAffectedByFog(vt),tt=f.getOrCreateProgram("fillExtrusionGroundEffect",{config:wt,defines:Pe,overrideFog:Ut}),zt=((rn,$t,Ft,Kt,en,Sn,Rn,Tt,Wn,Xn,vi)=>({u_matrix:$t,u_opacity:Ft,u_ao_pass:Kt?1:0,u_meter_to_tile:en,u_ao:Sn,u_flood_light_intensity:Rn,u_flood_light_color:Tt,u_attenuation:Wn,u_edge_radius:Xn,u_fb:0,u_fb_size:vi,u_dynamic_offset:1}))(0,Rt,H,B,nt,[G,W*nt],Q,ae,ie,Me>=17?0:Ve*nt,be?be.size[0]:0),xt=[];ce&&xt.push(Ke.hiddenByLandmarkVertexBuffer),f.uploadCommonUniforms(De,tt,vt.toUnwrapped(),null,Ae),tt.draw(f,De.gl.TRIANGLES,v,C,D,O,zt,c.id,Ke.vertexBuffer,Ke.indexBuffer,Mt,c.paint,Me,wt,xt)};for(const vt of _){const Ke=s.getTile(vt),Mt=Ke.getBucket(c);if(!Mt||Mt.projection.name!==Le.projection.name||!Mt.groundEffect||Mt.groundEffect&&!Mt.groundEffect.hasData())continue;const Rt=Mt.groundEffect,nt=1/Mt.tileToMeter;{const wt=f.translatePosMatrix(vt.projMatrix,Ke,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),Ut=Rt.getDefaultSegment();Ye(vt,Rt,Ut,wt,nt)}if(de)for(let wt=0;wt<4;wt++){const Ut=h.d4[wt](vt),tt=s.getTile(Ut);if(!tt)continue;const zt=tt.getBucket(c);if(!zt||zt.projection.name!==Le.projection.name||!zt.groundEffect||zt.groundEffect&&!zt.groundEffect.hasData())continue;const xt=zt.groundEffect;let rn,$t;0===wt?(rn=[-h.ag,0,0],$t=1):1===wt?(rn=[h.ag,0,0],$t=0):2===wt?(rn=[0,-h.ag,0],$t=3):(rn=[0,h.ag,0],$t=2);const Ft=xt.regionSegments[$t];if(!Ft)continue;const Kt=new Float32Array(16);h.ab.mat4.translate(Kt,vt.projMatrix,rn),Ye(vt,xt,Ft,f.translatePosMatrix(Kt,Ke,c.paint.get("fill-extrusion-translate"),c.paint.get("fill-extrusion-translate-anchor")),nt)}}}function mm(f,s,c,_,v,C,D){0===_.centroidVertexArray.length&&_.createCentroidsBuffer();const O=C?C.findDEMTileFor(c):null;if(!(O&&O.dem||D))return;C&&O&&O.dem&&_.selfDEMTileTimestamp!==O.dem._timestamp&&(_.borderDoneWithNeighborZ=[-1,-1,-1,-1],_.selfDEMTileTimestamp=O.dem._timestamp);const B=de=>new h.P(Math.ceil((de+h.d7)*h.d8),0),U=de=>{const be=s.getSource().minzoom,De=Le=>{const Me=s.getTileByID(Le);if(Me&&Me.hasData())return Me.getBucket(v)},Te=[0,-1,1];for(const Le of Te){if(de.overscaledZ+Le(H[0]=Math.min(de.min.y,be.min.y),H[1]=Math.max(de.max.y,be.max.y),H[2]=h.ag-be.min.x>de.max.x?be.min.x-h.ag:de.max.x,H),W=(de,be)=>(H[0]=Math.min(de.min.x,be.min.x),H[1]=Math.max(de.max.x,be.max.x),H[2]=h.ag-be.min.y>de.max.y?be.min.y-h.ag:de.max.y,H),Q=[(de,be)=>G(de,be),(de,be)=>G(be,de),(de,be)=>W(de,be),(de,be)=>W(be,de)],ae=(de,be,De,Te,Le,Me,Pe)=>{if(!C)return 0;const Ae=[[Me?De:de,Me?de:De,0],[Me?De:be,Me?be:De,0]],Ve=Pe<0?h.ag+Pe:Pe,Ye=[Me?Ve:(de+be)/2,Me?(de+be)/2:Ve,0];return 0===De&&Pe<0||0!==De&&Pe>0?C.getForTilePoints(Le,[Ye],!0,Te):Ae.push(Ye),C.getForTilePoints(c,Ae,!0,O),Math.max(Ae[0][2],Ae[1][2],Ye[2])/C.exaggeration()};for(let de=0;de<4;de++){const be=_.borderFeatureIndices[de];if(0===be.length)continue;const De=h.d4[de](c),Te=U(De);if(!(Te&&Te instanceof h.d5))continue;const Le=C?C.findDEMTileFor(De):null;if(!(Le&&Le.dem||D)||(C&&Le&&Le.dem&&_.borderDEMTileTimestamp[de]!==Le.dem._timestamp&&(_.borderDoneWithNeighborZ[de]=-1,_.borderDEMTileTimestamp[de]=Le.dem._timestamp),_.borderDoneWithNeighborZ[de]===Te.canonical.z))continue;0===Te.centroidVertexArray.length&&Te.createCentroidsBuffer();const Me=(de<2?1:5)-de,Pe=Te.borderDoneWithNeighborZ[Me]!==_.canonical.z,Ae=Te.borderFeatureIndices[Me];let Ve=0;if(_.canonical.z!==Te.canonical.z){for(const Ye of be)_.showCentroid(_.featuresOnBorder[Ye]);if(Pe)for(const Ye of Ae)Te.showCentroid(Te.featuresOnBorder[Ye]);_.borderDoneWithNeighborZ[de]=Te.canonical.z,Te.borderDoneWithNeighborZ[Me]=_.canonical.z}for(const Ye of be){const vt=_.featuresOnBorder[Ye],Ke=_.centroidData[vt.centroidDataIndex],Mt=vt.borders[de];let Rt;for(;VeMt[0]+3||nt[0]>Mt[0]-3)break;Te.showCentroid(Rt),Ve++}if(Rt&&VeMt[1]-3)&&(wt++,++Ve!==Ae.length);)Rt=Te.featuresOnBorder[Ae[Ve]];Rt=Te.featuresOnBorder[Ae[nt]];let Ut=!1;if(wt>=1){const xt=Rt.borders[Me];Math.abs(Mt[0]-xt[0])<3&&Math.abs(Mt[1]-xt[1])<3&&(wt=1,Ut=!0,Ve=nt+1)}else if(0===wt){_.showCentroid(vt);continue}const tt=Te.centroidData[Rt.centroidDataIndex];D&&Ut&&(((ie=Ke).flags|(ce=tt).flags)&h.d6?(ie.flags|=h.d6,ce.flags|=h.d6):(ie.flags&=~h.d6,ce.flags&=~h.d6));const zt=vt.intersectsCount()>1||Rt.intersectsCount()>1;if(wt>1)Ve=nt,Ke.centroidXY=tt.centroidXY=new h.P(0,0);else if(Le&&Le.dem&&!zt){const xt=Q[de](Ke,tt),rn=de%2?h.ag-1:0,$t=ae(xt[0],Math.min(h.ag-1,xt[1]),rn,Le,De,de<2,xt[2]);Ke.centroidXY=tt.centroidXY=B($t)}else zt?Ke.centroidXY=tt.centroidXY=new h.P(0,0):(Ke.centroidXY=_.encodeBorderCentroid(vt),tt.centroidXY=Te.encodeBorderCentroid(Rt));_.writeCentroidToBuffer(Ke),Te.writeCentroidToBuffer(tt)}else _.showCentroid(vt)}_.borderDoneWithNeighborZ[de]=Te.canonical.z,Te.borderDoneWithNeighborZ[Me]=_.canonical.z}var ie,ce;(_.needsCentroidUpdate||!_.centroidVertexBuffer&&0!==_.centroidVertexArray.length)&&_.uploadCentroid(f)}const tr=[1,0,0],nn=[0,1,0],Tn=[0,0,1];function jo(f,s,c){const _=c.transform,v=c.shadowRenderer;if(!v)return!0;const C=f.toUnwrapped(),D=_.tileSize*v._cascades[c.currentShadowCascade].scale;let O=s.maxHeight;if(_.elevation){const ie=_.elevation.getMinMaxForTile(f);ie&&(O+=ie.max)}const B=[...v.shadowDirection];B[2]=-B[2];const U=v.computeSimplifiedTileShadowVolume(C,O,D,B);if(!U)return!1;const H=[tr,nn,Tn,B,[B[0],0,B[2]],[0,B[1],B[2]]],G="globe"===_.projection.name,W=_.scaleZoom(D),Q=h.bR.fromInvProjectionMatrix(_.invProjMatrix,_.worldSize,W,!G),ae=v.getCurrentCascadeFrustum();return 0===Q.intersectsPrecise(U.vertices,U.planes,H)||0===ae.intersectsPrecise(U.vertices,U.planes,H)}function fr(f){return[f[0]*h.d9,f[1]*h.d9,f[2]*h.d9,0]}function lt(f,s,c,_,v,C,D,O,B){const U=_.getSource(),H=c.globeSharedBuffers;if(!H)return;let G,W,Q;if(s&&(G=_.getTile(s)),U instanceof h.aJ?(W=U.texture,Q=h.cI(0,0,c.transform)):G&&s&&(W=G.texture,Q=h.cI(s.canonical.z,s.canonical.x,c.transform)),!W||!Q)return;f||(Q=h.ab.mat4.scale(h.ab.mat4.create(),Q,[1,-1,1]));const ae=c.context,ie=ae.gl,ce="nearest"===v.paint.get("raster-resampling")?ie.NEAREST:ie.LINEAR,de=c.colorModeForDrapableLayerRenderPass(C),be=D.defines;be.push("GLOBE_POLES");const De=new Jn(ie.LEQUAL,Jn.ReadWrite,c.depthRangeFor3D),Te=Float32Array.from(c.transform.expandedFarZProjMatrix),Le=Float32Array.from(h.bb(h.cH(new h.bT(0,0,0))));c.terrain&&c.terrain.prepareDrawTile(),ae.activeTexture.set(ie.TEXTURE0),W.bind(ce,ie.CLAMP_TO_EDGE),ae.activeTexture.set(ie.TEXTURE1),W.bind(ce,ie.CLAMP_TO_EDGE),W.useMipmap&&ae.extTextureFilterAnisotropic&&c.transform.pitch>20&&ie.texParameterf(ie.TEXTURE_2D,ae.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,ae.extTextureFilterAnisotropicMax);const[Me,Pe,Ae,Ve]=s?H.getPoleBuffers(s.canonical.z,!1):H.getPoleBuffers(0,!0),Ye=v.paint.get("raster-elevation");let vt;f?(vt=Me,c.renderDefaultNorthPole=0!==Ye):(vt=Pe,c.renderDefaultSouthPole=0!==Ye);const Ke=fr(D.mix),Mt=(nt=Te,wt=Le,Ut=Q,tt=h.ae(c.transform.zoom),xt=v,$t=Ye,Kt=Ke,en=D.offset,Sn=D.range,Rn=C,vl(nt,wt,Ut,new Float32Array(16),new Float32Array(9),[0,0],tt,[0,0],[0,0,0,0],1,{opacity:1,mix:0},xt,[0,0],$t,2,Kt,en,Sn,1,0,Rn)),Rt=c.getOrCreateProgram("raster",{defines:be});var nt,wt,Ut,tt,xt,$t,Kt,en,Sn,Rn;c.uploadCommonUniforms(ae,Rt,null),Rt.draw(c,ie.TRIANGLES,De,B,de,O,Mt,v.id,vt,Ae,Ve)}function xl(f){const s=f._nearZ,c=f.projection.farthestPixelDistance(f),_=c-s,v=.2*f.height,C=s+v;return[s,c,(C-v-s)/_,(C-s)/_]}function sg(f,s,c,_){if(f)return s instanceof Zo&&f instanceof ze?s.getTextureDescriptor(f,c,!0):{texture:f.texture,mix:fr(_.mix),offset:_.offset,buffer:0,tileSize:1}}var Ou=h.da([{name:"a_index",type:"Int16",components:1}]);class Th{constructor(s,c,_,v){const C={width:_[0],height:_[1],data:null},D=s.gl;this.targetColorTexture=new h.T(s,C,D.RGBA8,{useMipmap:!1}),this.backgroundColorTexture=new h.T(s,C,D.RGBA8,{useMipmap:!1}),this.context=s,this.updateParticleTexture(c,v),this.lastInvalidatedAt=0}updateParticleTexture(s,c){if(this.particleTextureDimension===c.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const _=this.context.gl,v=c.width*c.height;this.particleTexture0=new h.T(this.context,c,_.RGBA8,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new h.T(this.context,c,_.RGBA8,{premultiply:!1,useMipmap:!1});const C=new h.db;C.reserve(v);for(let D=0;D0){const Ke=h.ba(c.canonical,B),Mt=h.dd(Ke);W=h.ab.mat4.multiply(new Float32Array(16),B.globeMatrix,Mt),h.ab.mat4.multiply(W,B.projMatrix,W)}const Q=h.ab.mat4.create();Q[12]+=2*v/(h.q.devicePixelRatio*B.width),Q[13]+=2*C/(h.q.devicePixelRatio*B.height),h.ab.mat4.multiply(W,Q,W);const ae=f.getOrCreateProgram("debug",{defines:G}),ie=s.getTileByID(c.key);f.terrain&&f.terrain.setupElevationDraw(ie,ae);const ce=Jn.disabled,de=pi.disabled,be=f.colorModeForRenderPass();O.activeTexture.set(U.TEXTURE0),f.emptyTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE),H?ie._makeGlobeTileDebugBuffers(f.context,B):ie._makeDebugTileBoundsBuffers(f.context,B.projection);const Te=ie._tileDebugBuffer||f.debugBuffer,Le=ie._tileDebugIndexBuffer||f.debugIndexBuffer,Me=ie._tileDebugSegments||f.debugSegments;if(ae.draw(f,U.LINE_STRIP,ce,de,be,gi.disabled,au(W,_),"$debug",Te,Le,Me,null,null,null,[ie._globeTileDebugBorderBuffer]),D){const Ke=ie.latestRawTileData,Mt=Math.floor((Ke&&Ke.byteLength||0)/1024);let Rt=c.canonical.toString();c.overscaledZ!==c.canonical.z&&(Rt+=` => ${c.overscaledZ}`),Rt+=` ${ie.state}`,Rt+=` ${Mt}kb`,function(nt,wt){nt.initDebugOverlayCanvas();const Ut=nt.debugOverlayCanvas,tt=nt.context.gl,zt=nt.debugOverlayCanvas.getContext("2d");zt.clearRect(0,0,Ut.width,Ut.height),zt.shadowColor="white",zt.shadowBlur=2,zt.lineWidth=1.5,zt.strokeStyle="white",zt.textBaseline="top",zt.font="bold 36px Open Sans, sans-serif",zt.fillText(wt,5,5),zt.strokeText(wt,5,5),nt.debugOverlayTexture.update(Ut),nt.debugOverlayTexture.bind(tt.LINEAR,tt.CLAMP_TO_EDGE)}(f,Rt)}const Pe=s.getTile(c).tileSize,Ae=512/Math.min(Pe,512)*(c.overscaledZ/B.zoom)*.5,Ve=ie._tileDebugTextBuffer||f.debugBuffer,Ye=ie._tileDebugTextIndexBuffer||f.quadTriangleIndexBuffer,vt=ie._tileDebugTextSegments||f.debugSegments;ae.draw(f,U.TRIANGLES,ce,de,zi.alphaBlended,gi.disabled,au(W,h.aj.transparent,Ae),"$debug",Ve,Ye,vt,null,null,null,[ie._globeTileDebugTextBuffer])}function cg(f,s,c,_){Pu(f,0,s+c/2,f.transform.width,c,_)}function _p(f,s,c,_){Pu(f,s-c/2,0,c,f.transform.height,_)}function Pu(f,s,c,_,v,C){const D=f.context,O=D.gl;O.enable(O.SCISSOR_TEST),O.scissor(s*h.q.devicePixelRatio,c*h.q.devicePixelRatio,_*h.q.devicePixelRatio,v*h.q.devicePixelRatio),D.clear({color:C}),O.disable(O.SCISSOR_TEST)}const Lu=h.da([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:yc}=Lu;function wd(f,s,c,_){f.emplaceBack(s,c,_)}class lu{constructor(s){this.vertexArray=new h.de,this.indices=new h.aU,wd(this.vertexArray,-1,-1,1),wd(this.vertexArray,1,-1,1),wd(this.vertexArray,-1,1,1),wd(this.vertexArray,1,1,1),wd(this.vertexArray,-1,-1,-1),wd(this.vertexArray,1,-1,-1),wd(this.vertexArray,-1,1,-1),wd(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=s.createVertexBuffer(this.vertexArray,yc),this.indexBuffer=s.createIndexBuffer(this.indices),this.segment=h.b7.simpleSegment(0,0,36,12)}}function Ba(f,s,c,_,v,C){const D=f.context.gl,O=s.paint.get("sky-atmosphere-color"),B=s.paint.get("sky-atmosphere-halo-color"),U=s.paint.get("sky-atmosphere-sun-intensity"),H={u_matrix_3f:h.ab.mat3.fromMat4(h.ab.mat3.create(),_),u_sun_direction:v,u_sun_intensity:U,u_color_tint_r:[(ae=O).r,ae.g,ae.b,ae.a],u_color_tint_m:[(ie=B).r,ie.g,ie.b,ie.a],u_luminance:5e-5};var ae,ie;D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+C,s.skyboxTexture,0),c.draw(f,D.TRIANGLES,Jn.disabled,pi.disabled,zi.unblended,gi.frontCW,H,"skyboxCapture",s.skyboxGeometry.vertexBuffer,s.skyboxGeometry.indexBuffer,s.skyboxGeometry.segment)}const iy=h.da([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Of{constructor(s){const c=new h.df;c.emplaceBack(-1,1,1,0,0),c.emplaceBack(1,1,1,1,0),c.emplaceBack(1,-1,1,1,1),c.emplaceBack(-1,-1,1,0,1);const _=new h.aU;_.emplaceBack(0,1,2),_.emplaceBack(2,3,0),this.vertexBuffer=s.createVertexBuffer(c,iy.members),this.indexBuffer=s.createIndexBuffer(_),this.segments=h.b7.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const si=h.da([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class wo{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class dg{constructor(s){this.colorModeAlphaBlendedWriteRGB=new zi([1,771,1,771],h.aj.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new zi([1,0,1,0],h.aj.transparent,[!1,!1,!1,!0]),this.params=new wo,this.updateNeeded=!0,s.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},()=>{this.updateNeeded=!0}),s.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),s.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0}),s.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},()=>{this.updateNeeded=!0})}update(s){const c=s.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new Of(c);const _=this.params.sizeRange,v=this.params.intensityRange,C=function(H){const G=h.di(30),W=[];for(let Q=0;Q{const Ae="globe"===C.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];Pe&&Ae.push("ALPHA_PASS");const Ve=s.getOrCreateProgram("globeAtmosphere",{defines:Ae}),Ye=((Ke,Mt,Rt,nt,wt,Ut,tt,zt,xt,rn,$t,Ft)=>({u_frustum_tl:Ke,u_frustum_tr:Mt,u_frustum_br:Rt,u_frustum_bl:nt,u_horizon:wt,u_transition:Ut,u_fadeout_range:tt,u_color:zt,u_high_color:xt,u_space_color:rn,u_temporal_offset:$t,u_horizon_angle:Ft}))(C.frustumCorners.TL,C.frustumCorners.TR,C.frustumCorners.BR,C.frustumCorners.BL,C.frustumCorners.horizon,O,ce,H,W,ae,be,Le);s.uploadCommonUniforms(_,Ve);const vt=this.atmosphereBuffer;vt&&Ve.draw(s,v.TRIANGLES,D,pi.disabled,Pe?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,gi.backCW,Ye,Pe?"atmosphere_glow_alpha":"atmosphere_glow",vt.vertexBuffer,vt.indexBuffer,vt.segments)};Me(!1),Me(!0)}drawStars(s,c){const _=h.aw(c.properties.get("star-intensity"),0,1);if(0===_)return;const v=s.context,C=v.gl,D=s.transform,O=s.getOrCreateProgram("stars"),B=h.ab.quat.identity([]);h.ab.quat.rotateX(B,B,-D._pitch),h.ab.quat.rotateZ(B,B,-D.angle),h.ab.quat.rotateX(B,B,h.ai(D._center.lat)),h.ab.quat.rotateY(B,B,-h.ai(D._center.lng));const U=h.ab.mat4.fromQuat(new Float32Array(16),B),H=h.ab.mat4.multiply([],D.starsProjMatrix,U),G=h.ab.mat3.fromMat4([],U),W=h.ab.mat3.invert([],G),Q=[0,1,0];h.ab.vec3.transformMat3(Q,Q,W),h.ab.vec3.scale(Q,Q,this.params.sizeMultiplier);const ae=[1,0,0];h.ab.vec3.transformMat3(ae,ae,W),h.ab.vec3.scale(ae,ae,this.params.sizeMultiplier);const ie=(ce=Q,de=ae,be=_,{u_matrix:Float32Array.from(H),u_up:ce,u_right:de,u_intensity_multiplier:be});var ce,de,be;s.uploadCommonUniforms(v,O),this.starsVx&&this.starsIdx&&O.draw(s,C.TRIANGLES,Jn.disabled,pi.disabled,this.colorModeAlphaBlendedWriteRGB,gi.disabled,ie,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function Cd(f,s){const c=[...f],_=s.cameraWorldSizeForFog/s.worldSize,v=h.ab.mat4.identity([]);return h.ab.mat4.scale(v,v,[_,_,1]),h.ab.mat4.multiply(c,v,c),h.ab.mat4.multiply(c,s.worldToFogMatrix,c),c}function _m(f,s,c,_,v){const C=c.material,D=_.context,{baseColorTexture:O,metallicRoughnessTexture:B}=C.pbrMetallicRoughness,{normalTexture:U,occlusionTexture:H,emissionTexture:G}=C;function W(ae,ie,ce){if(ae&&(f.push(ie),D.activeTexture.set(D.gl.TEXTURE0+ce),ae.gfxTexture)){const{minFilter:de,magFilter:be,wrapS:De,wrapT:Te}=ae.sampler;ae.gfxTexture.bindExtraParam(de,be,De,Te)}}W(O,"HAS_TEXTURE_u_baseColorTexture",js_BaseColor),W(B,"HAS_TEXTURE_u_metallicRoughnessTexture",js_MetallicRoughness),W(U,"HAS_TEXTURE_u_normalTexture",js_Normal),W(H,"HAS_TEXTURE_u_occlusionTexture",js_Occlusion),W(G,"HAS_TEXTURE_u_emissionTexture",js_Emission),v&&(v.texture||(v.texture=new h.dk(_.context,v.image,[v.image.height,v.image.height,v.image.height],D.gl.RGBA8)),D.activeTexture.set(D.gl.TEXTURE0+js_LUT),v.texture&&v.texture.bind(D.gl.LINEAR,D.gl.CLAMP_TO_EDGE),f.push("APPLY_LUT_ON_GPU")),c.texcoordBuffer&&(f.push("HAS_ATTRIBUTE_a_uv_2f"),s.push(c.texcoordBuffer)),c.colorBuffer&&(f.push(12===c.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),s.push(c.colorBuffer)),c.normalBuffer&&(f.push("HAS_ATTRIBUTE_a_normal_3f"),s.push(c.normalBuffer)),c.pbrBuffer&&(f.push("HAS_ATTRIBUTE_a_pbr"),f.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),s.push(c.pbrBuffer)),"OPAQUE"!==C.alphaMode&&"MASK"!==C.alphaMode||f.push("UNPREMULT_TEXTURE_IN_SHADER"),C.defined||f.push("DIFFUSE_SHADED");const Q=_.shadowRenderer;Q&&(f.push("RENDER_SHADOWS","DEPTH_TEXTURE"),Q.useNormalOffset&&f.push("NORMAL_OFFSET"))}function Fu(f,s,c,_,v,C){const D=c.paint.get("model-opacity").constantOr(1),O=s.context,B=new Jn(s.context.gl.LEQUAL,Jn.ReadWrite,s.depthRangeFor3D),U=s.transform,H=f.mesh,G=H.material,W=G.pbrMetallicRoughness,Q=s.style.fog;let ae;ae="pixels"===s.transform.projection.zAxisUnit?[...f.nodeModelMatrix]:h.ab.mat4.multiply([],_.zScaleMatrix,f.nodeModelMatrix),h.ab.mat4.multiply(ae,_.negCameraPosMatrix,ae);const ie=h.ab.mat4.invert([],ae);h.ab.mat4.transpose(ie,ie);const ce="none"===c.paint.get("model-color-use-theme").constantOr("default"),de=c.paint.get("model-emissive-strength").constantOr(0),be=ig(new Float32Array(f.worldViewProjection),new Float32Array(ae),new Float32Array(ie),null,s,D,W.baseColorFactor.toRenderColor(null),G.emissiveFactor,W.metallicFactor,W.roughnessFactor,G,de,c),De={defines:[]},Te=[],Le=s.shadowRenderer;Le&&(Le.useNormalOffset=!1),_m(De.defines,Te,H,s,ce?null:c.lut);let Me=null;if(Q){const Ve=Cd(f.nodeModelMatrix,s.transform);if(Me=new Float32Array(Ve),"globe"!==U.projection.name){const Ye=H.aabb.min,vt=H.aabb.max,[Ke,Mt]=Q.getOpacityForBounds(Ve,Ye[0],Ye[1],vt[0],vt[1]);De.overrideFog=Ke>=Oe||Mt>=Oe}}const Pe=_l(s,c.paint.get("model-cutoff-fade-range"));Pe.shouldRenderCutoff&&De.defines.push("RENDER_CUTOFF");const Ae=s.getOrCreateProgram("model",De);s.uploadCommonUniforms(O,Ae,null,Me,Pe),"shadow"!==s.renderPass&&Le&&Le.setupShadowsFromMatrix(f.nodeModelMatrix,Ae),Ae.draw(s,O.gl.TRIANGLES,B,v,C,H.material.doubleSided?gi.disabled:gi.backCCW,be,c.id,H.vertexBuffer,H.indexBuffer,H.segments,c.paint,s.transform.zoom,void 0,Te)}function ug(f,s,c,_,v,C,D){let O;O="globe"===f.projection.name?h.dl(c,f):[...c],h.ab.mat4.multiply(O,O,s.matrix);const B=h.ab.mat4.multiply([],_,O);if(s.meshes)for(const U of s.meshes){if("BLEND"!==U.material.alphaMode){D.push({mesh:U,depth:0,modelIndex:v,worldViewProjection:B,nodeModelMatrix:O});continue}const H=h.ab.vec3.transformMat4([],U.centroid,B);!f.isOrthographic&&H[2]<=0||C.push({mesh:U,depth:H[2],modelIndex:v,worldViewProjection:B,nodeModelMatrix:O})}if(s.children)for(const U of s.children)ug(f,U,c,_,v,C,D)}function gp(f,s,c,_){const v=c.shadowRenderer;if(!v)return;const C=v.getShadowPassDepthMode(),D=v.getShadowPassColorMode(),O=v.calculateShadowPassMatrixFromMatrix(s),B=ey(O);c.getOrCreateProgram("modelDepth",{defines:c._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(c,c.context.gl.TRIANGLES,C,pi.disabled,D,gi.backCCW,B,_.id,f.vertexBuffer,f.indexBuffer,f.segments,_.paint,c.transform.zoom,void 0,void 0)}function Cl(f,s,c){const _=s.updateZoomBasedPaintProperties(),v=function(C,D,O){let B,U,H,G=C.terrain?C.terrain.exaggeration():0;if(C.terrain&&G>0){const W=C.terrain,Q=W.findDEMTileFor(O);Q&&Q.dem?B=h.dn.create(W,O,Q):G=0}if(0===G&&(D.terrainElevationMin=0,D.terrainElevationMax=0),G===D.validForExaggeration&&(0===G||B&&B._demTile&&B._demTile.tileID===D.validForDEMTile.id&&B._dem._timestamp===D.validForDEMTile.timestamp))return!1;for(const W in D.instancesPerModel){const Q=D.instancesPerModel[W];for(let ae=0;aeU&&(U=Q.max)}const H=h.aw(_.x,C,D)-_.x,G=h.aw(_.y,O,B)-_.y,W=h.bH(U,s.center.lat)-_.z;return s._zoomFromMercatorZ(Math.sqrt(H*H+G*G+W*W))}function Pf(f,s,c,_,v,C,D){const O=f.context,B="shadow"===f.renderPass,U=f.shadowRenderer,H=B&&U?U.getShadowPassDepthMode():new Jn(O.gl.LEQUAL,Jn.ReadWrite,f.depthRangeFor3D),G=f.isTileAffectedByFog(C);if(c.meshes)for(const W of c.meshes){const Q=["MODEL_POSITION_ON_GPU"],ae=[];let ie,ce,de;_.instancedDataArray.length>20&&Q.push("INSTANCED_ARRAYS");const be=_l(f,s.paint.get("model-cutoff-fade-range"));if(be.shouldRenderCutoff&&Q.push("RENDER_CUTOFF"),B&&U)ie=f.getOrCreateProgram("modelDepth",{defines:Q}),ce=ey(D.shadowTileMatrix,D.shadowTileMatrix,Float32Array.from(c.matrix)),de=U.getShadowPassColorMode();else{_m(Q,ae,W,f,"none"===s.paint.get("model-color-use-theme").constantOr("default")?null:s.lut),ie=f.getOrCreateProgram("model",{defines:Q,overrideFog:G});const Te=W.material,Le=Te.pbrMetallicRoughness,Me=s.paint.get("model-opacity").constantOr(1),Pe=s.paint.get("model-emissive-strength").constantOr(0);ce=ig(C.expandedProjMatrix,Float32Array.from(c.matrix),new Float32Array(16),null,f,Me,Le.baseColorFactor.toRenderColor(null),Te.emissiveFactor,Le.metallicFactor,Le.roughnessFactor,Te,Pe,s,v),U&&(D.shadowUniformsInitialized?ie.setShadowUniformValues(O,U.getShadowUniformValues()):(U.setupShadows(C.toUnwrapped(),ie,"model-tile",C.overscaledZ),D.shadowUniformsInitialized=!0)),de=be.shouldRenderCutoff||Me<1||"OPAQUE"!==Te.alphaMode?zi.alphaBlended:zi.unblended}f.uploadCommonUniforms(O,ie,C.toUnwrapped(),null,be);const De=W.material.doubleSided?gi.disabled:gi.backCCW;if(_.instancedDataArray.length>20)ae.push(_.instancedDataBuffer),ie.draw(f,O.gl.TRIANGLES,H,pi.disabled,de,De,ce,s.id,W.vertexBuffer,W.indexBuffer,W.segments,s.paint,f.transform.zoom,void 0,ae,_.instancedDataArray.length);else{const Te=B?"u_instance":"u_normal_matrix";for(let Le=0;Le<_.instancedDataArray.length;++Le)ce[Te]=new Float32Array(_.instancedDataArray.arrayBuffer,64*Le,16),ie.draw(f,O.gl.TRIANGLES,H,pi.disabled,de,De,ce,s.id,W.vertexBuffer,W.indexBuffer,W.segments,s.paint,f.transform.zoom,void 0,ae)}}if(c.children)for(const W of c.children)Pf(f,s,W,_,v,C,D)}const oy=[1,-1,1];function ry(f,s,c,_){if(!c.modelManager)return!0;const v=c.modelManager;if(!c.shadowRenderer)return!0;const C=c.shadowRenderer,D=s.aabb;let O=!0,B=f.maxHeight;if(0===B){let H=0;for(const G in f.instancesPerModel){const W=v.getModel(G,_);W?H=Math.max(H,Math.max(Math.max(W.aabb.max[0],W.aabb.max[1]),W.aabb.max[2])):O=!1}B=f.maxScale*H*1.41+f.maxVerticalOffset,O&&(f.maxHeight=B)}D.max[2]=B,D.min[2]+=f.terrainElevationMin,D.max[2]+=f.terrainElevationMax,h.ab.vec3.transformMat4(D.min,D.min,s.tileMatrix),h.ab.vec3.transformMat4(D.max,D.max,s.tileMatrix);const U=D.intersects(C.getCurrentCascadeFrustum());return 0===c.currentShadowCascade&&(f.isInsideFirstShadowMapFrustum=2===U),0===U}function Yt(f,s){const c=f.uniformValues.u_cutoff_params[0],_=f.uniformValues.u_cutoff_params[1],v=f.uniformValues.u_cutoff_params[2],C=f.uniformValues.u_cutoff_params[3];return _===c||C===v?1:h.aw(((s-c)/(_-c)-v)/(C-v),0,1)}function io(f,s,c,_){if(s.pitch<20)return 1;const v=s.getWorldToCameraMatrix();h.ab.mat4.multiply(v,v,f);const C=h.ab.vec4.fromValues(c.min[0],c.min[1],c.min[2],1);let D=h.ab.vec4.transformMat4(h.ab.vec4.create(),C,v),O=D,B=D;C[1]=c.max[1],D=h.ab.vec4.transformMat4(h.ab.vec4.create(),C,v),O=D[1]B[1]?D:B,C[0]=c.max[0],D=h.ab.vec4.transformMat4(h.ab.vec4.create(),C,v),O=D[1]B[1]?D:B,C[1]=c.min[1],D=h.ab.vec4.transformMat4(h.ab.vec4.create(),C,v),O=D[1]B[1]?D:B;const U=h.aw(_[0],0,1),H=100*s.pixelsPerMeter*h.aw(_[1],0,1),G=h.aw(_[2],0,1),W=h.ab.vec4.lerp(h.ab.vec4.create(),O,B,U),Q=Math.tan(.5*s.fovX),ae=-W[2]*Q;if(0===H)return W[1]<-Math.abs(ae)?G:1;const ie=(-Math.abs(ae)-W[1])/H,ce=(be,De,Te)=>(1-Te)*be+Te*De,de=h.aw(ce(1,G,ie),G,1);return ce(1,de,h.aw((s.pitch-20)/20,0,1))}class fe{}class ge{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(s,c,_){{const G=this._storage.get(c.id);if(G)return G.lastUsedFrameIdx=s,G.buf}const v=_.gl,C=v.getBufferParameter(v.ELEMENT_ARRAY_BUFFER,v.BUFFER_SIZE),D=new ArrayBuffer(C),O=new Int16Array(D);v.getBufferSubData(v.ELEMENT_ARRAY_BUFFER,0,new Int16Array(D));const B=new h.dq;for(let G=0;G30&&(_.buf.destroy(),this._storage.delete(c))}destroy(){for(const[s,c]of this._storage)c.buf.destroy(),this._storage.delete(s)}}class Lo{constructor(s){this.occluderSize=30,this.depthOffset=-1e-4,s.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),s.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const pg=h.da([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_rainParticleData",components:4}]);class bp{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}class Ir{constructor(s,c){this.revealStart=11,this.revealRange=2,s.registerParameter(this,[...c,"Reveal"],"revealStart",{min:0,max:17,step:.05}),s.registerParameter(this,[...c,"Reveal"],"revealRange",{min:.1,max:5.1,step:.05})}}const Lf=h.da([{type:"Float32",name:"a_pos_2f",components:2}]);class Ff{destroy(){this.vignetteVx&&this.vignetteVx.destroy(),this.vignetteIdx&&this.vignetteIdx.destroy()}draw(s,c){const _=s.getOrCreateProgram("vignette");if(!this.vignetteVx||!this.vignetteIdx){const D=new h.dr,O=new h.aU;D.emplaceBack(-1,-1),D.emplaceBack(1,-1),D.emplaceBack(1,1),D.emplaceBack(-1,1),O.emplaceBack(0,1,2),O.emplaceBack(0,2,3),this.vignetteVx=s.context.createVertexBuffer(D,Lf.members),this.vignetteIdx=s.context.createIndexBuffer(O)}const v=h.b7.simpleSegment(0,0,4,6);if(this.vignetteVx&&this.vignetteIdx){s.uploadCommonUniforms(s.context,_);const D={u_vignetteShape:(C={vignetteShape:[c.start,c.range,Math.pow(10,c.fadePower)],vignetteColor:[c.color.r,c.color.g,c.color.b,c.color.a*c.strength]}).vignetteShape,u_vignetteColor:C.vignetteColor};_.draw(s,s.context.gl.TRIANGLES,Jn.disabled,pi.disabled,zi.alphaBlended,gi.disabled,D,"vignette",this.vignetteVx,this.vignetteIdx,v,{})}var C}}class gm{constructor(){this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0}update(s,c){const _=s.getFreeCameraOptions().position,v=_.toAltitude(),C=_.toLngLat(),D=h.ai(C.lng),O=h.ai(C.lat),B=s.pixelsPerMeter/c,U=D*h.ds,H=h.ds*Math.log(Math.tan(Math.PI/4+O/2));if(void 0===this._offsetXPrev)this._offsetXPrev=0,this._offsetYPrev=0,this._elevationPrev=0,this._accumulatedOffsetX=0,this._accumulatedOffsetY=0,this._accumulatedElevation=0;else{const G=-this._offsetYPrev+H,W=-this._elevationPrev+v;this._accumulatedOffsetX+=(-this._offsetXPrev+U)*B,this._accumulatedOffsetY+=G*B,this._accumulatedElevation+=W*B,this._offsetXPrev=U,this._offsetYPrev=H,this._elevationPrev=v}}getPosition(){return[this._accumulatedOffsetX,this._accumulatedOffsetY,this._accumulatedElevation]}}function yp(f,s){return[-(f[0]-Math.floor(f[0]/s)*s),-(f[1]-Math.floor(f[1]/s)*s),-(f[2]-Math.floor(f[2]/s)*s)]}function ay(f){const s=h.di(1323123451230),c=[];for(let _=0;__)return;const v=Sd(0,1,c.revealStart,c.revealStart+c.revealRange,_);if(!this.particlesVx||!this.particlesIdx)return;const C=structuredClone(this._params);let D=[-C.direction.x,C.direction.y,-100];h.ab.vec3.normalize(D,D);const O=structuredClone(this._vignetteParams);O.strength*=v,C.overrideStyleParameters||(C.intensity=s.style.rain.state.density,C.timeFactor=s.style.rain.state.intensity,C.color=structuredClone(s.style.rain.state.color),D=structuredClone(s.style.rain.state.direction),C.screenThinning.intensity=s.style.rain.state.centerThinning,C.dropletSizeX=s.style.rain.state.dropletSize[0],C.dropletSizeYScale=s.style.rain.state.dropletSize[1]/s.style.rain.state.dropletSize[0],C.distortionStrength=100*s.style.rain.state.distortionStrength,O.strength=1,O.color=structuredClone(s.style.rain.state.vignetteColor));const B=this.updateOnRender(s,C.timeFactor),U=s.context,H=U.gl,G=s.transform;this.screenTexture&&this.screenTexture.size[0]===s.width&&this.screenTexture.size[1]===s.height||(this.screenTexture=new h.T(U,{width:s.width,height:s.height,data:null},H.RGBA8)),C.distortionStrength>0&&(U.activeTexture.set(H.TEXTURE0),this.screenTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE),H.copyTexSubImage2D(H.TEXTURE_2D,0,0,0,0,0,s.width,s.height));const W=s.getOrCreateProgram("rainParticle");s.uploadCommonUniforms(U,W),U.activeTexture.set(H.TEXTURE0),this.screenTexture.bind(H.LINEAR,H.CLAMP_TO_EDGE);const Q=[C.color.r,C.color.g,C.color.b,C.color.a],ae=(ie,ce)=>{const de=yp(this._movement.getPosition(),ie),be=C.dropletSizeX,De=C.dropletSizeX*C.dropletSizeYScale,Te=s.width/2,Le=s.height/2,Me=Sd(0,C.screenThinning.start,0,1,C.screenThinning.intensity),Pe=Sd(.001,C.screenThinning.range,0,1,C.screenThinning.intensity),Ae=Sd(0,C.screenThinning.particleOffset,0,1,C.screenThinning.intensity),Ve=(Ye={modelview:B.modelviewMatrix,projection:B.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:de,velocityConeAperture:C.velocityConeAperture,velocity:C.velocity,boxSize:ie,rainDropletSize:[be,De],distortionStrength:C.distortionStrength,rainDirection:D,color:Q,screenSize:[G.width,G.height],thinningCenterPos:[Te,Le],thinningShape:[Me,Pe,Math.pow(10,C.screenThinning.fadePower)],thinningAffectedRatio:C.screenThinning.affectedRatio,thinningParticleOffset:Ae,shapeDirectionalPower:C.shapeDirPower,shapeNormalPower:C.shapeNormalPower,mode:ce?0:1},{u_modelview:Float32Array.from(Ye.modelview),u_projection:Float32Array.from(Ye.projection),u_time:Ye.time,u_cam_pos:Ye.camPos,u_texScreen:0,u_velocityConeAperture:Ye.velocityConeAperture,u_velocity:Ye.velocity,u_boxSize:Ye.boxSize,u_rainDropletSize:Ye.rainDropletSize,u_distortionStrength:Ye.distortionStrength,u_rainDirection:Ye.rainDirection,u_color:Ye.color,u_screenSize:Ye.screenSize,u_thinningCenterPos:Ye.thinningCenterPos,u_thinningShape:Ye.thinningShape,u_thinningAffectedRatio:Ye.thinningAffectedRatio,u_thinningParticleOffset:Ye.thinningParticleOffset,u_shapeDirectionalPower:Ye.shapeDirectionalPower,u_shapeNormalPower:Ye.shapeNormalPower,u_mode:Ye.mode});var Ye;const vt=Math.round(C.intensity*this.particlesCount),Ke=h.b7.simpleSegment(0,0,4*vt,2*vt);W.draw(s,H.TRIANGLES,Jn.disabled,pi.disabled,zi.alphaBlended,gi.disabled,Ve,"rain_particles",this.particlesVx,this.particlesIdx,Ke,{})};C.distortionStrength>0&&ae(C.boxSize,!0),ae(C.boxSize,!1),this._vignette.draw(s,O)}}const rl=h.da([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_snowParticleData",components:4},{type:"Float32",name:"a_snowParticleDataHorizontalOscillation",components:2}]);class Td extends Nf{constructor(s){super(2.25),this._params={overrideStyleParameters:!1,intensity:.85,timeFactor:.75,velocityConeAperture:70,velocity:40,horizontalOscillationRadius:4,horizontalOscillationRate:1.5,boxSize:2e3,billboardSize:2,shapeFadeStart:.27,shapeFadePower:.21,screenThinning:{intensity:.4,start:.15,range:1.4,fadePower:.24,affectedRatio:1,particleOffset:-.2},color:{r:1,g:1,b:1,a:1},direction:{x:-50,y:-35}},this._revealParams=new Ir(s.tp,["Precipitation","Snow"]),this._vignetteParams={strength:.3,start:.78,range:.46,fadePower:.2,color:{r:1,g:1,b:1,a:1}},this.particlesCount=16e3}update(s){const c=s.context;if(!this.particlesVx){const _=ay(this.particlesCount),v=new h.du,C=new h.aU;let D=0;const O=h.di(1323123451230);for(let B=0;B<_.length;++B){const U=_[B],H=O(),G=O(),W=O(),Q=[B/_.length,H,G,W],ae=[O(),O()];v.emplaceBack(U[0],U[1],U[2],-1,-1,...Q,...ae),v.emplaceBack(U[0],U[1],U[2],1,-1,...Q,...ae),v.emplaceBack(U[0],U[1],U[2],1,1,...Q,...ae),v.emplaceBack(U[0],U[1],U[2],-1,1,...Q,...ae),C.emplaceBack(D+0,D+1,D+2),C.emplaceBack(D+0,D+2,D+3),D+=4}this.particlesVx=c.createVertexBuffer(v,rl.members),this.particlesIdx=c.createIndexBuffer(C)}}draw(s){if(!this._params.overrideStyleParameters&&!s.style.snow)return;const c=structuredClone(this._params);let _=[-c.direction.x,c.direction.y,-100];h.ab.vec3.normalize(_,_);const v=structuredClone(this._vignetteParams),C=c.overrideStyleParameters?this._revealParams:{revealStart:0,revealRange:.01},D=s.transform.zoom;if(C.revealStart>D)return;const O=Sd(0,1,C.revealStart,C.revealStart+C.revealRange,D);v.strength*=O,c.overrideStyleParameters||(c.intensity=s.style.snow.state.density,c.timeFactor=s.style.snow.state.intensity,c.color=structuredClone(s.style.snow.state.color),_=structuredClone(s.style.snow.state.direction),c.screenThinning.intensity=s.style.snow.state.centerThinning,c.billboardSize=2.79*s.style.snow.state.flakeSize,v.strength=1,v.color=structuredClone(s.style.snow.state.vignetteColor));const B=this.updateOnRender(s,c.timeFactor);if(!this.particlesVx||!this.particlesIdx)return;const U=s.context,H=U.gl,G=s.transform,W=s.getOrCreateProgram("snowParticle");s.uploadCommonUniforms(U,W),((Q,ae,ie)=>{const ce=yp(this._movement.getPosition(),Q),de=G.width/2,be=G.height/2,De=Sd(0,ie.screenThinning.start,0,1,ie.screenThinning.intensity),Te=Sd(.001,ie.screenThinning.range,0,1,ie.screenThinning.intensity),Le=Sd(0,ie.screenThinning.particleOffset,0,1,ie.screenThinning.intensity),Me=(Pe={modelview:B.modelviewMatrix,projection:B.projectionMatrix,time:this._accumulatedTimeFromStart,camPos:ce,velocityConeAperture:ie.velocityConeAperture,velocity:ie.velocity,horizontalOscillationRadius:ie.horizontalOscillationRadius,horizontalOscillationRate:ie.horizontalOscillationRate,boxSize:Q,billboardSize:1*ie.billboardSize,simpleShapeParameters:[ie.shapeFadeStart,ie.shapeFadePower],screenSize:[G.width,G.height],thinningCenterPos:[de,be],thinningShape:[De,Te,Math.pow(10,ie.screenThinning.fadePower)],thinningAffectedRatio:ie.screenThinning.affectedRatio,thinningParticleOffset:Le,color:[ie.color.r,ie.color.g,ie.color.b,ie.color.a],direction:_},{u_modelview:Float32Array.from(Pe.modelview),u_projection:Float32Array.from(Pe.projection),u_time:Pe.time,u_cam_pos:Pe.camPos,u_velocityConeAperture:Pe.velocityConeAperture,u_velocity:Pe.velocity,u_horizontalOscillationRadius:Pe.horizontalOscillationRadius,u_horizontalOscillationRate:Pe.horizontalOscillationRate,u_boxSize:Pe.boxSize,u_billboardSize:Pe.billboardSize,u_simpleShapeParameters:Pe.simpleShapeParameters,u_screenSize:Pe.screenSize,u_thinningCenterPos:Pe.thinningCenterPos,u_thinningShape:Pe.thinningShape,u_thinningAffectedRatio:Pe.thinningAffectedRatio,u_thinningParticleOffset:Pe.thinningParticleOffset,u_particleColor:Pe.color,u_direction:Pe.direction});var Pe;const Ae=Math.round(ie.intensity*this.particlesCount),Ve=h.b7.simpleSegment(0,0,4*Ae,2*Ae);this.particlesVx&&this.particlesIdx&&W.draw(s,H.TRIANGLES,Jn.disabled,pi.disabled,zi.alphaBlended,gi.disabled,Me,"snow_particles",this.particlesVx,this.particlesIdx,Ve,{})})(c.boxSize,0,c),this._vignette.draw(s,v)}}const bm={symbol:function(f,s,c,_,v){if("translucent"!==f.renderPass)return;const C=pi.disabled,D=f.colorModeForRenderPass(),O=c.layout.get("text-variable-anchor"),B=c.layout.get("text-size-scale-range"),U=h.aw(f.scaleFactor,B[0],B[1]);O&&function(W,Q,ae,ie,ce,de,be,De){const Te=Q.transform,Le="map"===ce,Me="map"===de;for(const Pe of W){const Ae=ie.getTile(Pe),Ve=Ae.getBucket(ae);if(!Ve||!Ve.text||!Ve.text.segments.get().length)continue;const Ye=h.bp(Ve.textSizeData,Te.zoom,De),vt=am(Pe,Ve.getProjection(),Te),Ke=Te.calculatePixelsToTileUnitsMatrix(Ae),Mt=Ss(vt,Ae.tileID.canonical,Me,Le,Te,Ve.getProjection(),Ke),Rt=Ve.hasIconTextFit()&&Ve.hasIconData();if(Ye){const nt=Math.pow(2,Te.zoom-Ae.tileID.overscaledZ);rg(Ve,Le,Me,be,h.cX,Te,Mt,Pe,nt,Ye,Rt)}}}(_,f,c,s,c.layout.get("text-rotation-alignment"),c.layout.get("text-pitch-alignment"),v,U);const H=0!==c.paint.get("icon-opacity").constantOr(1),G=0!==c.paint.get("text-opacity").constantOr(1);void 0!==c.layout.get("symbol-sort-key").constantOr(1)&&(H||G)?Mf(f,s,c,_,C,D):(H&&Mf(f,s,c,_,C,D,{onlyIcons:!0}),G&&Mf(f,s,c,_,C,D,{onlyText:!0})),s.map.showCollisionBoxes&&(og(f,s,c,_,c.paint.get("text-translate"),c.paint.get("text-translate-anchor"),!0),og(f,s,c,_,c.paint.get("icon-translate"),c.paint.get("icon-translate-anchor"),!1))},circle:function(f,s,c,_){if("translucent"!==f.renderPass)return;const v=c.paint.get("circle-opacity"),C=c.paint.get("circle-stroke-width"),D=c.paint.get("circle-stroke-opacity"),O=void 0!==c.layout.get("circle-sort-key").constantOr(1),B=c.paint.get("circle-emissive-strength");if(0===v.constantOr(1)&&(0===C.constantOr(1)||0===D.constantOr(1)))return;const U=f.context,H=U.gl,G=f.transform,W=f.depthModeForSublayer(0,Jn.ReadOnly),Q=pi.disabled,ae=f.colorModeForDrapableLayerRenderPass(B),ie="globe"===G.projection.name,ce=[h.at(G.center.lng),h.aA(G.center.lat)],de=[];for(let De=0;De<_.length;De++){const Te=_[De],Le=s.getTile(Te),Me=Le.getBucket(c);if(!Me||Me.projection.name!==G.projection.name)continue;const Pe=Me.programConfigurations.get(c.id),Ae=h.cY(c),Ve=f.isTileAffectedByFog(Te);ie&&Ae.push("PROJECTION_GLOBE_VIEW"),Ae.push("DEPTH_D24"),f.terrain&&G.depthOcclusionForSymbolsAndCircles&&Ae.push("DEPTH_OCCLUSION");const Ye=f.getOrCreateProgram("circle",{config:Pe,defines:Ae,overrideFog:Ve}),vt=Me.layoutVertexBuffer,Ke=Me.globeExtVertexBuffer,Mt=Me.indexBuffer,Rt=G.projection.createInversionMatrix(G,Te.canonical),nt={programConfiguration:Pe,program:Ye,layoutVertexBuffer:vt,globeExtVertexBuffer:Ke,indexBuffer:Mt,uniformValues:h.cZ(f,Te,Le,Rt,ce,c),tile:Le};if(O){const wt=Me.segments.get();for(const Ut of wt)de.push({segments:new h.b7([Ut]),sortKey:Ut.sortKey,state:nt})}else de.push({segments:Me.segments,sortKey:0,state:nt})}O&&de.sort((De,Te)=>De.sortKey-Te.sortKey);const be={useDepthForOcclusion:G.depthOcclusionForSymbolsAndCircles};for(const De of de){const{programConfiguration:Te,program:Le,layoutVertexBuffer:Me,globeExtVertexBuffer:Pe,indexBuffer:Ae,uniformValues:Ve,tile:Ye}=De.state,vt=De.segments;f.terrain&&f.terrain.setupElevationDraw(Ye,Le,be),f.uploadCommonUniforms(U,Le,Ye.tileID.toUnwrapped()),Le.draw(f,H.TRIANGLES,W,Q,ae,gi.disabled,Ve,c.id,Me,Ae,vt,c.paint,G.zoom,Te,[Pe])}},heatmap:function(f,s,c,_){if(0!==c.paint.get("heatmap-opacity"))if("offscreen"===f.renderPass){const v=f.context,C=v.gl,D=pi.disabled,O=new zi([C.ONE,C.ONE,C.ONE,C.ONE],h.aj.transparent,[!0,!0,!0,!0]);(function(Q,ae,ie,ce){const de=Q.gl,be=ae.width*ce,De=ae.height*ce;Q.activeTexture.set(de.TEXTURE1),Q.viewport.set([0,0,be,De]);let Te=ie.heatmapFbo;if(!Te||Te&&(Te.width!==be||Te.height!==De)){Te&&Te.destroy();const Le=de.createTexture();de.bindTexture(de.TEXTURE_2D,Le),de.texParameteri(de.TEXTURE_2D,de.TEXTURE_WRAP_S,de.CLAMP_TO_EDGE),de.texParameteri(de.TEXTURE_2D,de.TEXTURE_WRAP_T,de.CLAMP_TO_EDGE),de.texParameteri(de.TEXTURE_2D,de.TEXTURE_MIN_FILTER,de.LINEAR),de.texParameteri(de.TEXTURE_2D,de.TEXTURE_MAG_FILTER,de.LINEAR),Te=ie.heatmapFbo=Q.createFramebuffer(be,De,!0,null),function(Me,Pe,Ae,Ve,Ye,vt){const Ke=Me.gl;Ke.texImage2D(Ke.TEXTURE_2D,0,Me.extRenderToTextureHalfFloat?Ke.RGBA16F:Ke.RGBA,Ye,vt,0,Ke.RGBA,Me.extRenderToTextureHalfFloat?Ke.HALF_FLOAT:Ke.UNSIGNED_BYTE,null),Ve.colorAttachment.set(Ae)}(Q,0,Le,Te,be,De)}else de.bindTexture(de.TEXTURE_2D,Te.colorAttachment.get()),Q.bindFramebuffer.set(Te.framebuffer)})(v,f,c,"globe"===f.transform.projection.name?.5:.25),v.clear({color:h.aj.transparent});const B=f.transform,U="globe"===B.projection.name,H=U?["PROJECTION_GLOBE_VIEW"]:[],G=U?gi.frontCCW:gi.disabled,W=[h.at(B.center.lng),h.aA(B.center.lat)];for(let Q=0;Q<_.length;Q++){const ae=_[Q];if(s.hasRenderableParent(ae))continue;const ie=s.getTile(ae),ce=ie.getBucket(c);if(!ce||ce.projection.name!==B.projection.name)continue;const de=f.isTileAffectedByFog(ae),be=ce.programConfigurations.get(c.id),De=f.getOrCreateProgram("heatmap",{config:be,defines:H,overrideFog:de}),{zoom:Te}=f.transform;f.terrain&&f.terrain.setupElevationDraw(ie,De),f.uploadCommonUniforms(v,De,ae.toUnwrapped());const Le=B.projection.createInversionMatrix(B,ae.canonical);De.draw(f,C.TRIANGLES,Jn.disabled,D,O,G,En(f,ae,ie,Le,W,Te,c.paint.get("heatmap-intensity")),c.id,ce.layoutVertexBuffer,ce.indexBuffer,ce.segments,c.paint,f.transform.zoom,be,U?[ce.globeExtVertexBuffer]:null)}v.viewport.set([0,0,f.width,f.height])}else"translucent"===f.renderPass&&(f.context.setColorMode(f.colorModeForRenderPass()),function(v,C){const D=v.context,O=D.gl,B=C.heatmapFbo;if(!B)return;D.activeTexture.set(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,B.colorAttachment.get()),D.activeTexture.set(O.TEXTURE1);let U=C.colorRampTexture;U||(U=C.colorRampTexture=new h.T(D,C.colorRamp,O.RGBA8)),U.bind(O.LINEAR,O.CLAMP_TO_EDGE),v.getOrCreateProgram("heatmapTexture").draw(v,O.TRIANGLES,Jn.disabled,pi.disabled,v.colorModeForRenderPass(),gi.disabled,{u_image:0,u_color_ramp:1,u_opacity:C.paint.get("heatmap-opacity")},C.id,v.viewportBuffer,v.quadTriangleIndexBuffer,v.viewportSegments,C.paint,v.transform.zoom)}(f,c))},line:function(f,s,c,_){if("translucent"!==f.renderPass)return;const v=c.paint.get("line-opacity"),C=c.paint.get("line-width");if(0===v.constantOr(1)||0===C.constantOr(1))return;const D=c.paint.get("line-emissive-strength"),O=c.paint.get("line-occlusion-opacity"),B=c.layout.get("line-elevation-reference"),U="meters"===c.layout.get("line-width-unit"),H="sea"===B,G=f.context,W=G.gl;if(c.hasElevatedBuckets&&"globe"===f.transform.projection.name)return;const Q=c.layout.get("line-cross-slope"),ae=void 0!==Q,ie=Q<1,ce=f.colorModeForDrapableLayerRenderPass(D),de=f.terrain&&f.terrain.renderingToTexture,be=de?1:h.q.devicePixelRatio,De=c.paint.get("line-dasharray"),Te=De.constantOr(1),Le=c.layout.get("line-cap"),Me=De.constantOr(null),Pe=Le.constantOr(null),Ae=c.paint.get("line-pattern"),Ve=Ae.constantOr(1),Ye=Ae.constantOr(null),vt=c.paint.get("line-opacity").constantOr(1);let Ke=!Ve&&1!==vt||f.depthOcclusion&&O>0&&O<1;const Mt=c.paint.get("line-gradient"),Rt=Ve?"linePattern":"line",nt=h.c_(c);let wt;if(de&&f.terrain&&f.terrain.clipOrMaskOverlapStencilType()&&(Ke=!1),0!==O&&f.depthOcclusion){const tt=c.paint._values["line-opacity"];tt&&tt.value&&"constant"===tt.value.kind?wt=tt.value:h.w(`Occlusion opacity for layer ${c.id} is supported only when line-opacity isn't data-driven.`)}"constant"!==C.value.kind&&!1===C.value.isLineProgressConstant&&nt.push("VARIABLE_LINE_WIDTH");const Ut=(tt,zt,xt,rn,$t)=>{for(const Ft of tt){const Kt=s.getTile(Ft);if(Ve&&!Kt.patternsLoaded())continue;const en=Kt.getBucket(c);if(!en||en.hasZOffset&&!$t||!en.hasZOffset&&$t)continue;f.prepareDrawTile();const Sn=en.programConfigurations.get(c.id),Rn=f.isTileAffectedByFog(Ft),Tt=f.getOrCreateProgram(Rt,{config:Sn,defines:zt,overrideFog:Rn,overrideRtt:!$t&&void 0});if(Ye&&Kt.imageAtlas){const tn=h.A.from(Ye).getPrimary().scaleSelf(be).serialize(),yo=Kt.imageAtlas.patternPositions[tn];yo&&Sn.setConstantPatternPositions(yo)}if(!Ve&&Me&&Pe&&Kt.lineAtlas){const tn=Kt.lineAtlas.getDash(Me,Pe);tn&&Sn.setConstantPatternPositions(tn)}let[Wn,Xn]=c.paint.get("line-trim-offset");("round"===Pe||"square"===Pe)&&Wn!==Xn&&(0===Wn&&(Wn-=1),1===Xn&&(Xn+=1));const vi=de?Ft.projMatrix:null,uo=U?1/en.tileToMeter/h.ar(Kt,1,f.transform.zoom):1,Fo=U?1/en.tileToMeter/h.ar(Kt,1,Math.floor(f.transform.zoom)):1,_r=Ve?h.c$(f,Kt,c,vi,be,uo,Fo,[Wn,Xn]):h.d0(f,Kt,c,vi,en.lineClipsArray.length,be,uo,Fo,[Wn,Xn]);if(Mt){const tn=en.gradients[c.id];let yo=tn.texture;if(c.gradientVersion!==tn.version){let $n=256;if(c.stepInterpolant){const no=s.getSource().maxzoom,Mo=Ft.canonical.z===no?Math.ceil(1<{null!=wt&&(wt.value=vt*O),Tt.draw(f,W.TRIANGLES,xt,tn,ce,gi.disabled,_r,c.id,en.layoutVertexBuffer,en.indexBuffer,en.segments,c.paint,f.transform.zoom,Sn,[en.layoutVertexBuffer2,en.patternVertexBuffer,en.zOffsetVertexBuffer]),null!=wt&&(wt.value=vt)};if(Ke&&!$t){const tn=f.stencilModeForClipping(Ft).ref;0===tn&&de&&G.clear({stencil:0});const yo={func:W.EQUAL,mask:255};_r.u_alpha_discard_threshold=.8,ur(new pi(yo,tn,255,W.KEEP,W.KEEP,W.INVERT)),_r.u_alpha_discard_threshold=0,ur(new pi(yo,tn,255,W.KEEP,W.KEEP,W.KEEP))}else Ke&&$t&&(_r.u_alpha_discard_threshold=.001),ur($t?rn:f.stencilModeForClipping(Ft))}};if(c.hasNonElevatedBuckets){const tt=!de&&f.terrain;0!==O&&tt?h.w(`Occlusion opacity for layer ${c.id} is supported on terrain only if the layer has line-z-offset enabled.`):tt?h.w(`Cannot render non-elevated lines in immediate mode when terrain is enabled. Layer: ${c.id}.`):Ut(_,nt,f.depthModeForSublayer(0,Jn.ReadOnly),pi.disabled,!1)}if(c.hasElevatedBuckets){nt.push("ELEVATED"),ae&&nt.push(ie?"CROSS_SLOPE_HORIZONTAL":"CROSS_SLOPE_VERTICAL"),H&&nt.push("ELEVATION_REFERENCE_SEA");const tt=Ke?f.stencilModeFor3D():pi.disabled,zt=new Jn(f.depthOcclusion?W.GREATER:W.LEQUAL,Jn.ReadOnly,f.depthRangeFor3D);f.forceTerrainMode=!0,Ut(_,nt,zt,tt,!0),f.forceTerrainMode=!1}Ke&&(f.resetStencilClippingMasks(),de&&G.clear({stencil:0})),0===O||f.depthOcclusion||de||f.layersWithOcclusionOpacity.push(f.currentLayer)},fill:function(f,s,c,_){const v=c.paint.get("fill-color"),C=c.paint.get("fill-opacity"),D=c.is3D(),O=new Jn(f.context.gl.LEQUAL,Jn.ReadWrite,f.depthRangeFor3D);if(0===C.constantOr(1))return;const B=c.paint.get("fill-emissive-strength"),U=f.colorModeForDrapableLayerRenderPass(B),H=c.paint.get("fill-pattern"),G=f.opaquePassEnabledForLayer()&&!H.constantOr(1)&&1===v.constantOr(h.aj.transparent).a&&1===C.constantOr(0)?"opaque":"translucent";if(f.renderPass===G){const W=D?O:f.depthModeForSublayer(1,"opaque"===f.renderPass?Jn.ReadWrite:Jn.ReadOnly);ag(f,s,c,_,W,U,!1)}if(!D&&"translucent"===f.renderPass&&c.paint.get("fill-antialias")){const W=D?O:f.depthModeForSublayer(c.getPaintProperty("fill-outline-color")?2:0,Jn.ReadOnly);ag(f,s,c,_,W,U,!0)}},"fill-extrusion":function(f,s,c,_){const v=c.paint.get("fill-extrusion-opacity"),C=f.context,D=C.gl,O=f.terrain,B=O&&O.renderingToTexture;if(0===v)return;const U=f.conflationActive&&f.style.isLayerClipped(c,s.getSource()),H=f.style.order.indexOf(c.fqid);if(U&&function(G,W,Q,ae,ie){for(const ce of ae){const de=W.getTile(ce).getBucket(Q);de&&(de.updateReplacement(ce,G.replacementSource,ie),de.uploadCentroid(G.context))}}(f,s,c,_,H),O||U)for(const G of _){const W=s.getTile(G).getBucket(c);W&&mm(f.context,s,G,W,c,O,U)}if("shadow"===f.renderPass&&f.shadowRenderer){const G=f.shadowRenderer;if(O&&v<.65&&c._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof h.a9)return;const W=G.getShadowPassDepthMode(),Q=G.getShadowPassColorMode();kf(f,s,c,_,W,pi.disabled,Q,U)}else if("translucent"===f.renderPass){const G=!c.paint.get("fill-extrusion-pattern").constantOr(1),W=c.paint.get("fill-extrusion-color").constantOr(h.aj.white);if(!B&&0!==W.a){const Q=new Jn(f.context.gl.LEQUAL,Jn.ReadWrite,f.depthRangeFor3D);1===v&&G?kf(f,s,c,_,Q,pi.disabled,zi.unblended,U):(kf(f,s,c,_,Q,pi.disabled,zi.disabled,U),kf(f,s,c,_,Q,f.stencilModeFor3D(),f.colorModeForRenderPass(),U),f.resetStencilClippingMasks())}if(f.style.enable3dLights()&&G&&(!O&&"globe"!==f.transform.projection.name||B)){const Q=c.paint.get("fill-extrusion-opacity"),ae=c.paint.get("fill-extrusion-ambient-occlusion-intensity"),ie=c.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),ce=c.paint.get("fill-extrusion-flood-light-intensity"),de="none"===c.paint.get("fill-extrusion-flood-light-color-use-theme").constantOr("default"),be=c.paint.get("fill-extrusion-flood-light-color").toRenderColor(de?null:c.lut).toArray01().slice(0,3),De=ae>0&&ie>0,Te=ce>0,Le=(Pe,Ae,Ve)=>(1-Ve)*Pe+Ve*Ae,Me=Pe=>{const Ae=f.depthModeForSublayer(1,Jn.ReadOnly,D.LEQUAL,!0),Ve=c.paint.get(Pe?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Ye=Le(.1,3,Ve),vt=f._showOverdrawInspector;if(!vt){const Ke=new pi({func:D.ALWAYS,mask:255},255,255,D.KEEP,D.KEEP,D.REPLACE),Mt=new zi([D.ONE,D.ONE,D.ONE,D.ONE],h.aj.transparent,[!1,!1,!1,!0],D.MIN);Sh(f,s,c,_,Ae,Ke,Mt,gi.disabled,Pe,"sdf",Q,ae,ie,ce,be,Ye,U,!1)}{const Ke=vt?pi.disabled:new pi({func:D.EQUAL,mask:255},255,255,D.KEEP,D.DECR,D.DECR),Mt=vt?f.colorModeForRenderPass():new zi([D.ONE_MINUS_DST_ALPHA,D.DST_ALPHA,D.ONE,D.ONE],h.aj.transparent,[!0,!0,!0,!0]);Sh(f,s,c,_,Ae,Ke,Mt,gi.disabled,Pe,"color",Q,ae,ie,ce,be,Ye,U,!1)}};if(B){const Pe=(Ae,Ve,Ye)=>{const vt=f.depthModeForSublayer(1,Jn.ReadOnly,D.LEQUAL,!1),Ke=c.paint.get(Ae?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),Mt=Le(.1,3,Ke);{const Rt=new zi([D.ONE,D.ONE,D.ONE,D.ONE],h.aj.transparent,[!1,!1,!1,!0]);Sh(f,s,c,_,vt,pi.disabled,Rt,gi.disabled,Ae,"clear",Q,ae,ie,ce,be,Mt,U,Ve)}{const Rt=new pi({func:D.ALWAYS,mask:255},255,255,D.KEEP,D.KEEP,D.REPLACE),nt=new zi([D.ONE,D.ONE,D.ONE,D.ONE],h.aj.transparent,[!1,!1,!1,!0],D.MIN);Sh(f,s,c,_,vt,Rt,nt,gi.disabled,Ae,"sdf",Q,ae,ie,ce,be,Mt,U,Ve)}{const Rt=Ae?D.ZERO:D.ONE_MINUS_DST_ALPHA,nt=new pi({func:D.EQUAL,mask:255},255,255,D.KEEP,D.DECR,D.DECR),wt=new zi([Rt,D.DST_ALPHA,D.ONE_MINUS_DST_ALPHA,D.ZERO],h.aj.transparent,[!0,!0,!0,!0]);Sh(f,s,c,_,vt,nt,wt,gi.disabled,Ae,"color",Q,ae,ie,ce,be,Mt,U,Ve)}{const Rt=new zi([D.ONE,D.ONE,D.ONE,Ae?D.ZERO:D.ONE],h.aj.transparent,[!1,!1,!1,!0],Ae?D.FUNC_ADD:D.MAX);Sh(f,s,c,_,vt,pi.disabled,Rt,gi.disabled,Ae,"clear",Q,ae,ie,ce,be,Mt,U,Ve,Ye)}};if(De||Te){let Ae;if(f.prepareDrawTile(),O){const Ve=O.drapeBufferSize[0],Ye=O.drapeBufferSize[1];Ae=O.framebufferCopyTexture,Ae&&(!Ae||Ae.size[0]===Ve&&Ae.size[1]===Ye)||(Ae&&Ae.destroy(),Ae=O.framebufferCopyTexture=new h.T(C,new h.r({width:Ve,height:Ye}),D.RGBA8)),Ae.bind(D.LINEAR,D.CLAMP_TO_EDGE),D.copyTexSubImage2D(D.TEXTURE_2D,0,0,0,0,0,Ve,Ye)}De&&Pe(!0,!1,Ae),Te&&Pe(!1,!0,Ae)}}else De&&Me(!0),Te&&Me(!1),(De||Te)&&f.resetStencilClippingMasks()}}},hillshade:function(f,s,c,_){if("offscreen"!==f.renderPass&&"translucent"!==f.renderPass||f.style.disableElevatedTerrain)return;const v=f.context,C=f.terrain&&f.terrain.renderingToTexture,[D,O]="translucent"!==f.renderPass||C?[{},_]:f.stencilConfigForOverlap(_);for(const B of O){const U=s.getTile(B);if(U.needsHillshadePrepare&&"offscreen"===f.renderPass)ap(f,U,c);else if("translucent"===f.renderPass){const H=f.depthModeForSublayer(0,Jn.ReadOnly),G=c.paint.get("hillshade-emissive-strength"),W=f.colorModeForDrapableLayerRenderPass(G),Q=C&&f.terrain?f.terrain.stencilModeForRTTOverlap(B):D[B.overscaledZ];Sf(f,B,U,c,H,Q,W)}}v.viewport.set([0,0,f.width,f.height]),f.resetStencilClippingMasks()},raster:function(f,s,c,_,v,C){if("translucent"!==f.renderPass||0===c.paint.get("raster-opacity"))return;const D="globe"===f.transform.projection.name,O=0!==c.paint.get("raster-elevation"),B=O&&D;if(f.renderElevatedRasterBackface&&!B)return;const U=f.context,H=U.gl,G=s.getSource(),W=function(Me,Pe,Ae,Ve){const Ye=Pe.paint.get("raster-color"),vt="raster-array"===Me.type,Ke=[],Mt=Pe.paint.get("raster-resampling"),Rt=Pe.paint.get("raster-color-mix");let nt=Pe.paint.get("raster-color-range");const wt=[Rt[0],Rt[1],Rt[2],0],Ut=Rt[3];let tt="nearest"===Mt?Ve.NEAREST:Ve.LINEAR;if(vt&&(Ke.push("RASTER_ARRAY"),Ye||Ke.push("RASTER_COLOR"),"linear"===Mt&&Ke.push("RASTER_ARRAY_LINEAR"),tt=Ve.NEAREST,!nt&&Me.rasterLayers)){const zt=Me.rasterLayers.find(({id:xt})=>xt===Pe.sourceLayer);zt&&zt.fields&&zt.fields.range&&(nt=zt.fields.range)}if(nt=nt||[0,1],Ye){Ke.push("RASTER_COLOR"),Ae.activeTexture.set(Ve.TEXTURE2),Pe.updateColorRamp(nt);let zt=Pe.colorRampTexture;zt||(zt=Pe.colorRampTexture=new h.T(Ae,Pe.colorRamp,Ve.RGBA8)),zt.bind(Ve.LINEAR,Ve.CLAMP_TO_EDGE)}return{mix:wt,range:nt,offset:Ut,defines:Ke,resampling:tt}}(G,c,U,H);if(G instanceof h.aJ&&!_.length&&!D)return;const Q=c.paint.get("raster-emissive-strength"),ae=f.colorModeForDrapableLayerRenderPass(Q),ie=f.terrain&&f.terrain.renderingToTexture,ce=!f.options.moving,de="nearest"===c.paint.get("raster-resampling")?H.NEAREST:H.LINEAR;if(G instanceof h.aJ&&!_.length&&(G.onNorthPole||G.onSouthPole)){const Me=O?f.stencilModeFor3D():pi.disabled;return void lt(!!G.onNorthPole,null,f,s,c,Q,W,gi.disabled,Me)}if(!_.length)return;const[be,De]=G instanceof h.aJ||ie?[{},_]:f.stencilConfigForOverlap(_),Te=De[De.length-1].overscaledZ;B&&W.defines.push("PROJECTION_GLOBE_VIEW"),O&&W.defines.push("RENDER_CUTOFF");const Le=(Me,Pe,Ae)=>{for(const Ve of Me){const Ye=Ve.toUnwrapped(),vt=s.getTile(Ve);if(ie&&(!vt||!vt.hasData()))continue;U.activeTexture.set(H.TEXTURE0);const Ke=sg(vt,G,c,W);if(!Ke||!Ke.texture)continue;const{texture:Mt,mix:Rt,offset:nt,tileSize:wt,buffer:Ut}=Ke;let tt,zt;ie?(tt=Jn.disabled,zt=Ve.projMatrix):O?(tt=new Jn(H.LEQUAL,Jn.ReadWrite,f.depthRangeFor3D),zt=D?Float32Array.from(f.transform.expandedFarZProjMatrix):f.transform.calculateProjMatrix(Ye,ce)):(tt=f.depthModeForSublayer(Ve.overscaledZ-Te,1===c.paint.get("raster-opacity")?Jn.ReadWrite:Jn.ReadOnly,H.LESS),zt=f.transform.calculateProjMatrix(Ye,ce));const xt=f.terrain&&ie?f.terrain.stencilModeForRTTOverlap(Ve):be[Ve.overscaledZ],rn=C?0:c.paint.get("raster-fade-duration");vt.registerFadeDuration(rn);const $t=s.findLoadedParent(Ve,0),Ft=ru(vt,$t,s,f.transform,rn);let Kt,en;f.terrain&&f.terrain.prepareDrawTile(),U.activeTexture.set(H.TEXTURE0),Mt.bind(de,H.CLAMP_TO_EDGE),U.activeTexture.set(H.TEXTURE1),$t?($t.texture&&$t.texture.bind(de,H.CLAMP_TO_EDGE),Kt=Math.pow(2,$t.tileID.overscaledZ-vt.tileID.overscaledZ),en=[vt.tileID.canonical.x*Kt%1,vt.tileID.canonical.y*Kt%1]):Mt.bind(de,H.CLAMP_TO_EDGE),Mt.useMipmap&&U.extTextureFilterAnisotropic&&f.transform.pitch>20&&H.texParameterf(H.TEXTURE_2D,U.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,U.extTextureFilterAnisotropicMax);const Sn=f.transform;let Rn;const Tt=O?xl(Sn):[0,0,0,0];let Wn,Xn,vi,uo,Fo,_r=0;if(B&&G instanceof h.aJ&&G.coordinates.length>3)Wn=Float32Array.from(h.bb(h.cH(new h.bT(0,0,0)))),Xn=Float32Array.from(Sn.globeMatrix),vi=Float32Array.from(h.cD(Sn)),uo=[h.at(Sn.center.lng),h.aA(Sn.center.lat)],Rn=G.elevatedGlobePerspectiveTransform,Fo=G.elevatedGlobeGridMatrix||new Float32Array(9);else if(B){const $n=h.cE(Ve.canonical);_r=h.cF($n.getCenter().lat),Wn=Float32Array.from(h.bb(h.cH(Ve.canonical))),Xn=Float32Array.from(Sn.globeMatrix),vi=Float32Array.from(h.cD(Sn)),uo=[h.at(Sn.center.lng),h.aA(Sn.center.lat)],Rn=[0,0],Fo=Float32Array.from(h.cG(Ve.canonical,$n,_r,Sn.worldSize/Sn._pixelsPerMercatorPixel))}else Rn=G instanceof h.aJ?G.perspectiveTransform:[0,0],Wn=new Float32Array(16),Xn=new Float32Array(9),vi=new Float32Array(16),uo=[0,0],Fo=new Float32Array(9);const ur=vl(zt,Wn,Xn,vi,Fo,en||[0,0],h.ae(f.transform.zoom),uo,Tt,Kt||1,Ft,c,Rn,O?c.paint.get("raster-elevation"):0,2,Rt,nt,W.range,wt,Ut,Q),tn=f.isTileAffectedByFog(Ve),yo=f.getOrCreateProgram("raster",{defines:W.defines,overrideFog:tn});if(f.uploadCommonUniforms(U,yo,Ye),G instanceof h.aJ){const $n=G.elevatedGlobeVertexBuffer,no=G.elevatedGlobeIndexBuffer;if(ie||!D)G.boundsBuffer&&G.boundsSegments&&yo.draw(f,H.TRIANGLES,tt,pi.disabled,ae,gi.disabled,ur,c.id,G.boundsBuffer,f.quadTriangleIndexBuffer,G.boundsSegments);else if($n&&no){const Mo=Sn.zoom<=h.c6?G.elevatedGlobeSegments:G.getSegmentsForLongitude(Sn.center.lng);Mo&&yo.draw(f,H.TRIANGLES,tt,pi.disabled,ae,Pe,ur,c.id,$n,no,Mo)}}else if(B){tt=new Jn(H.LEQUAL,Jn.ReadOnly,f.depthRangeFor3D);const $n=f.globeSharedBuffers;if($n){const[no,Mo,Do]=$n.getGridBuffers(_r,!1);yo.draw(f,H.TRIANGLES,tt,Ae||xt,f.colorModeForRenderPass(),Pe,ur,c.id,no,Mo,Do)}}else{const{tileBoundsBuffer:$n,tileBoundsIndexBuffer:no,tileBoundsSegments:Mo}=f.getTileBoundsBuffers(vt);yo.draw(f,H.TRIANGLES,tt,xt,ae,gi.disabled,ur,c.id,$n,no,Mo)}}if(!(G instanceof h.aJ)&&B)for(const Ve of Me){const Ye=Ve.canonical.y===(1<>>16,2654435769),((Ve=Math.imul(Ve^Ve>>>16,2654435769))>>>0)/4294967296},Ae=1/1.1;for(let Ve=0;Veh.d4[xt](Mt));Ut.push(Mt);const tt=Mt.canonical.x,zt=Mt.canonical.y;for(const xt of Ut){const rn=Te.getTile(Ye?xt.wrapped():xt);if(!rn)continue;const $t=rn.rasterParticleState;if(!$t)continue;const Ft=xt.canonical.x+(1<Me.tileID)),Q&&(U.activeTexture.set(H.TEXTURE0),f.imageManager.bind(f.context,c.scope)),B){const Me=f.getOrCreateProgram(De,{overrideFog:!1,overrideRtt:!0}),Pe=new Float32Array(h.ab.mat4.identity([])),Ae=new h.aG(0,0,0,0,0),Ve=Q?fw(Pe,O,D,f,0,c.scope,ae,B,{tileID:Ae,tileSize:W}):k0(Pe,O,D,v.toRenderColor(C?null:c.lut));Me.draw(f,H.TRIANGLES,de,ce,be,gi.disabled,Ve,c.id,f.viewportBuffer,f.quadTriangleIndexBuffer,f.viewportSegments)}else for(const Me of Le){const Pe=f.isTileAffectedByFog(Me),Ae=f.getOrCreateProgram(De,{overrideFog:Pe}),Ve=Me.toUnwrapped(),Ye=_?Me.projMatrix:f.transform.calculateProjMatrix(Ve);f.prepareDrawTile();const vt=s?s.getTile(Me):Te?Te[Me.key]:new Ie(Me,W,G.zoom,f),Ke=Q?fw(Ye,O,D,f,0,c.scope,ae,B,{tileID:Me,tileSize:W}):k0(Ye,O,D,v.toRenderColor(C?null:c.lut));f.uploadCommonUniforms(U,Ae,Ve);const{tileBoundsBuffer:Mt,tileBoundsIndexBuffer:Rt,tileBoundsSegments:nt}=f.getTileBoundsBuffers(vt);Ae.draw(f,H.TRIANGLES,de,ce,be,gi.disabled,Ke,c.id,Mt,Rt,nt)}},sky:function(f,s,c){const _=f._atmosphere?h.ae(f.transform.zoom):1,v=c.paint.get("sky-opacity")*_;if(0===v)return;const C=f.context,D=c.paint.get("sky-type"),O=new Jn(C.gl.LEQUAL,Jn.ReadOnly,[0,1]),B=f.frameCounter/1e3%1;"atmosphere"===D?"offscreen"===f.renderPass?c.needsSkyboxCapture(f)&&(function(U,H){const Q=U.context,ae=Q.gl;let ie=H.skyboxFbo;if(!ie){ie=H.skyboxFbo=Q.createFramebuffer(32,32,!0,null),H.skyboxGeometry=new lu(Q),H.skyboxTexture=Q.gl.createTexture(),ae.bindTexture(ae.TEXTURE_CUBE_MAP,H.skyboxTexture),ae.texParameteri(ae.TEXTURE_CUBE_MAP,ae.TEXTURE_WRAP_S,ae.CLAMP_TO_EDGE),ae.texParameteri(ae.TEXTURE_CUBE_MAP,ae.TEXTURE_WRAP_T,ae.CLAMP_TO_EDGE),ae.texParameteri(ae.TEXTURE_CUBE_MAP,ae.TEXTURE_MIN_FILTER,ae.LINEAR),ae.texParameteri(ae.TEXTURE_CUBE_MAP,ae.TEXTURE_MAG_FILTER,ae.LINEAR);for(let De=0;De<6;++De)ae.texImage2D(ae.TEXTURE_CUBE_MAP_POSITIVE_X+De,0,ae.RGBA,32,32,0,ae.RGBA,ae.UNSIGNED_BYTE,null)}Q.bindFramebuffer.set(ie.framebuffer),Q.viewport.set([0,0,32,32]);const ce=H.getCenter(U,!0),de=U.getOrCreateProgram("skyboxCapture"),be=new Float64Array(16);h.ab.mat4.identity(be),h.ab.mat4.rotateY(be,be,.5*-Math.PI),Ba(U,H,de,be,ce,0),h.ab.mat4.identity(be),h.ab.mat4.rotateY(be,be,.5*Math.PI),Ba(U,H,de,be,ce,1),h.ab.mat4.identity(be),h.ab.mat4.rotateX(be,be,.5*-Math.PI),Ba(U,H,de,be,ce,2),h.ab.mat4.identity(be),h.ab.mat4.rotateX(be,be,.5*Math.PI),Ba(U,H,de,be,ce,3),h.ab.mat4.identity(be),Ba(U,H,de,be,ce,4),h.ab.mat4.identity(be),h.ab.mat4.rotateY(be,be,Math.PI),Ba(U,H,de,be,ce,5),Q.viewport.set([0,0,U.width,U.height])}(f,c),c.markSkyboxValid(f)):"sky"===f.renderPass&&function(U,H,G,W,Q){const ae=U.context,ie=ae.gl,ce=U.transform,de=U.getOrCreateProgram("skybox");ae.activeTexture.set(ie.TEXTURE0),ie.bindTexture(ie.TEXTURE_CUBE_MAP,H.skyboxTexture);const be=((De,Te,Le,Me,Pe)=>({u_matrix:De,u_sun_direction:Te,u_cubemap:0,u_opacity:Me,u_temporal_offset:Pe}))(ce.skyboxMatrix,H.getCenter(U,!1),0,W,Q);U.uploadCommonUniforms(ae,de),de.draw(U,ie.TRIANGLES,G,pi.disabled,U.colorModeForRenderPass(),gi.backCW,be,"skybox",H.skyboxGeometry.vertexBuffer,H.skyboxGeometry.indexBuffer,H.skyboxGeometry.segment)}(f,c,O,v,B):"gradient"===D&&"sky"===f.renderPass&&function(U,H,G,W,Q){const ae=U.context,ie=ae.gl,ce=U.transform,de=U.getOrCreateProgram("skyboxGradient");H.skyboxGeometry||(H.skyboxGeometry=new lu(ae)),ae.activeTexture.set(ie.TEXTURE0);let be=H.colorRampTexture;be||(be=H.colorRampTexture=new h.T(ae,H.colorRamp,ie.RGBA8)),be.bind(ie.LINEAR,ie.CLAMP_TO_EDGE);const De=(Te=ce.skyboxMatrix,Le=H.getCenter(U,!1),Me=H.paint.get("sky-gradient-radius"),Pe=W,Ae=Q,{u_matrix:Te,u_color_ramp:0,u_center_direction:Le,u_radius:h.ai(Me),u_opacity:Pe,u_temporal_offset:Ae});var Te,Le,Me,Pe,Ae;U.uploadCommonUniforms(ae,de),de.draw(U,ie.TRIANGLES,G,pi.disabled,U.colorModeForRenderPass(),gi.backCW,De,"skyboxGradient",H.skyboxGeometry.vertexBuffer,H.skyboxGeometry.indexBuffer,H.skyboxGeometry.segment)}(f,c,O,v,B)},debug:function(f,s,c,_,v,C){for(let D=0;D{D&&(D.useNormalOffset=!0,O||(D.enabled=!0))},U=s.getSource();if("light-beam"===f.renderPass&&"batched-model"!==U.type)return;if("vector"===U.type||"geojson"===U.type)return function(de,be,De,Te,Le){const Me=de.transform;if("mercator"!==Me.projection.name)return void h.w(`Drawing 3D models for ${Me.projection.name} projection is not yet implemented`);const Pe=Me.getFreeCameraOptions().position;if(!de.modelManager)return;const Ae=de.modelManager;De.modelManager=Ae;const Ve=de.shadowRenderer;if(!De._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const Ye=De._unevaluatedLayout._values["model-id"],vt=Object.assign({},De.layout.get("model-id").parameters),Ke=de.style.order.indexOf(De.fqid);for(const Mt of Te){const Rt=be.getTile(Mt).getBucket(De);if(!Rt||Rt.projection.name!==Me.projection.name)continue;const nt=Rt.getModelUris();nt&&!Rt.modelsRequested&&(Ae.addModelsFromBucket(nt,Le),Rt.modelsRequested=!0);const wt=hg(Mt,Me);vt.zoom=wt;const Ut=Ye.possiblyEvaluate(vt);if(Cl(de,Rt,Mt),ol.shadowUniformsInitialized=!1,ol.useSingleShadowCascade=!!Ve&&0===Ve.getMaxCascadeForTile(Mt.toUnwrapped()),"shadow"===de.renderPass&&Ve){if(1===de.currentShadowCascade&&Rt.isInsideFirstShadowMapFrustum)continue;const xt=Me.calculatePosMatrix(Mt.toUnwrapped(),Me.worldSize);if(ol.tileMatrix.set(xt),ol.shadowTileMatrix=Float32Array.from(Ve.calculateShadowPassMatrixFromMatrix(xt)),ol.aabb.min.fill(0),ol.aabb.max[0]=ol.aabb.max[1]=h.ag,ol.aabb.max[2]=0,ry(Rt,ol,de,De.scope))continue}const tt=1<0&&de.style.isLayerClipped(De,be.getSource())&&Rt.updateReplacement(Mt,de.replacementSource,Ke,Le)&&(Rt.uploaded=!1,Rt.upload(de.context));for(let xt in Rt.instancesPerModel){const rn=Rt.instancesPerModel[xt];rn.features.length>0&&(xt=Ut.evaluate(rn.features[0].feature,{}));const $t=Ae.getModel(xt,Le);if($t&&$t.uploaded)for(const Ft of $t.nodes)Pf(de,De,Ft,rn,zt,Mt,ol)}}}(f,s,c,_,"vector"===U.type?c.scope:""),void B();if(!U.loaded())return;if("batched-model"===U.type)return function(de,be,De,Te){De.resetLayerRenderingStats(de);const Le=de.context,Me=de.transform,Pe=de.style.fog,Ae=de.shadowRenderer;if("mercator"!==Me.projection.name)return void h.w(`Drawing 3D landmark models for ${Me.projection.name} projection is not yet implemented`);const Ve=de.transform.getFreeCameraOptions().position,Ye=h.ab.vec3.scale([],[Ve.x,Ve.y,Ve.z],de.transform.worldSize),vt=h.ab.vec3.negate([],Ye),Ke=h.ab.mat4.identity([]),Mt=h.dj(Me.center.lat,Me.zoom),Rt=h.ab.mat4.fromScaling([],[1,1,1/Mt]);h.ab.mat4.translate(Ke,Ke,vt);const nt=De.paint.get("model-opacity").constantOr(1),wt=new Jn(Le.gl.LEQUAL,Jn.ReadWrite,de.depthRangeFor3D),Ut=new Jn(Le.gl.LEQUAL,Jn.ReadOnly,de.depthRangeFor3D),tt=new h.cd([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),zt="shadow"===de.renderPass,xt=zt&&Ae?Ae.getCurrentCascadeFrustum():Me.getFrustum(Me.scaleZoom(Me.worldSize)),rn=De.paint.get("model-front-cutoff"),$t=rn[2]<1,Ft=_l(de,De.paint.get("model-cutoff-fade-range")),Kt=De.getLayerRenderingStats();(function(en,Sn,Rn,Tt){const Wn=en.terrain?en.terrain.exaggeration():0,Xn=en.transform.zoom;for(const vi of Tt){const uo=Sn.getTile(vi).getBucket(Rn);uo&&(en.conflationActive&&uo.updateReplacement(vi,en.replacementSource),uo.evaluateScale(en,Rn),en.terrain&&Wn>0&&uo.elevationUpdate(en.terrain,Wn,vi,Rn.source),uo.needsReEvaluation(en,Xn,Rn)&&uo.evaluate(Rn))}})(de,be,De,Te),function(){let en,Sn,Rn;$t?(en=Te.length-1,Sn=-1,Rn=-1):(en=0,Sn=Te.length,Rn=1);const Tt=new Float64Array(16),Wn=h.ab.vec3.create(),Xn=new h.P(0,0);for(let vi=en;vi!==Sn;vi+=Rn){const uo=Te[vi],Fo=be.getTile(uo).getBucket(De);if(!Fo||!Fo.uploaded)continue;let _r=!1;Ae&&(_r=0===Ae.getMaxCascadeForTile(uo.toUnwrapped()));const ur=Me.calculatePosMatrix(uo.toUnwrapped(),Me.worldSize),tn=Fo.modelTraits;!zt&&$t&&(h.ab.mat4.invert(Tt,ur),h.ab.vec3.transformMat4(Wn,Ye,Tt),Xn.x=Wn[0],Xn.y=Wn[1]);const yo=[];for(const $n of Fo.getNodesInfo()){if($n.hiddenByReplacement||!$n.node.meshes)continue;const no=$n.node;let Mo=0;de.terrain&&no.elevation&&(Mo=no.elevation*de.terrain.exaggeration());const Do=(()=>{const ao=$n.aabb;return tt.min=[...ao.min],tt.max=[...ao.max],tt.min[2]+=Mo,tt.max[2]+=Mo,h.ab.vec3.transformMat4(tt.min,tt.min,ur),h.ab.vec3.transformMat4(tt.max,tt.max,ur),tt})(),xr=$n.evaluatedScale;if(xr[0]<=1&&xr[1]<=1&&xr[2]<=1&&0===Do.intersects(xt))continue;if(!zt&&$t){const ao=.16666666666666666;$n.cameraCollisionOpacity=Ye[0]>Do.min[0]&&Ye[0]Do.min[1]&&Ye[1]!$t||1===$n.opacity&&1===no.opacity?$n.depthno.depth?-1:1);for(const $n of yo){const no=$n.nodeInfo,Mo=no.node;let Do=h.ab.mat4.multiply([],Rt,$n.tileModelMatrix);h.ab.mat4.multiply(Do,Ke,Do);const xr=h.ab.mat4.invert([],Do);h.ab.mat4.transpose(xr,xr),h.ab.mat4.scale(xr,xr,oy),Do=h.ab.mat4.multiply(Do,Do,Mo.matrix);const Ua="light-beam"===de.renderPass,aa="none"===De.paint.get("model-color-use-theme").constantOr("default"),Ta=tn&h.dp.HasMapboxMeshFeatures,vc=Ta?0:no.evaluatedRMEA[0][2];for(let $s=0;$s=Oe||Da>=Oe}}const Ko=Mr.material;let ll;Ko.occlusionTexture&&Ko.occlusionTexture.offsetScale&&(ll=Ko.occlusionTexture.offsetScale,ao.defines.push("OCCLUSION_TEXTURE_TRANSFORM"));const qc=de.getOrCreateProgram("model",ao);!zt&&Ae&&Ae.setupShadowsFromMatrix($n.tileModelMatrix,qc,Ae.useNormalOffset),de.uploadCommonUniforms(Le,qc,null,ms);const lc=Ko.pbrMetallicRoughness;lc.metallicFactor=.9,lc.roughnessFactor=.5;const fs=ig(new Float32Array(Xo),new Float32Array(Do),new Float32Array(xr),new Float32Array(Mo.matrix),de,$n.opacity,lc.baseColorFactor.toRenderColor(null),Ko.emissiveFactor,lc.metallicFactor,lc.roughnessFactor,Ko,vc,De,[0,0,0],ll);!bo&&(no.hasTranslucentParts||$n.opacity<1)&&qc.draw(de,Le.gl.TRIANGLES,wt,pi.disabled,zi.disabled,gi.backCCW,fs,De.id,Mr.vertexBuffer,Mr.indexBuffer,Mr.segments,De.paint,de.transform.zoom,void 0,_a),qc.draw(de,Le.gl.TRIANGLES,bo?Ut:wt,pi.disabled,bo||$n.opacity<1||no.hasTranslucentParts?zi.alphaBlended:zi.unblended,gi.backCCW,fs,De.id,Mr.vertexBuffer,Mr.indexBuffer,Mr.segments,De.paint,de.transform.zoom,void 0,_a)}}}}()}(f,s,c,_),void B();if("model"!==U.type)return;const H=U.getModels(),G=[],W=f.transform.getFreeCameraOptions().position,Q=h.ab.vec3.scale([],[W.x,W.y,W.z],f.transform.worldSize);h.ab.vec3.negate(Q,Q);const ae=[],ie=[];let ce=0;for(const de of H){const be=c.paint.get("model-rotation").constantOr(null),De=c.paint.get("model-scale").constantOr(null),Te=c.paint.get("model-translation").constantOr(null);de.computeModelMatrix(f,be,De,Te,!0,!0,!1);const Le=h.ab.mat4.identity([]),Me=h.dj(de.position.lat,f.transform.zoom),Pe=h.ab.mat4.fromScaling([],[1,1,1/Me]);h.ab.mat4.translate(Le,Le,Q),G.push({zScaleMatrix:Pe,negCameraPosMatrix:Le});for(const Ae of de.nodes)ug(f.transform,Ae,de.matrix,f.transform.expandedFarZProjMatrix,ce,ae,ie);ce++}if(ae.sort((de,be)=>be.depth-de.depth),"shadow"!==f.renderPass){if(1===v)for(const de of ie)Fu(de,f,c,G[de.modelIndex],pi.disabled,f.colorModeForRenderPass());else{for(const de of ie)Fu(de,f,c,G[de.modelIndex],pi.disabled,zi.disabled);for(const de of ie)Fu(de,f,c,G[de.modelIndex],f.stencilModeFor3D(),f.colorModeForRenderPass());f.resetStencilClippingMasks()}for(const de of ae)Fu(de,f,c,G[de.modelIndex],pi.disabled,f.colorModeForRenderPass());B()}else{for(const de of ie)gp(de.mesh,de.nodeModelMatrix,f,c);for(const de of ae)gp(de.mesh,de.nodeModelMatrix,f,c);B()}}},Sl={line:function(f,s,c){if(f.hasElevatedBuckets=!1,f.hasNonElevatedBuckets=!1,void 0!==f._unevaluatedLayout.getValue("line-elevation-reference")||void 0!==f._unevaluatedLayout.getValue("line-z-offset")){if(s){const _=s.getVisibleCoordinates();for(const v of _){const C=s.getTile(v).getBucket(f);if(C&&(C.hasZOffset?f.hasElevatedBuckets=!0:f.hasNonElevatedBuckets=!0,f.hasElevatedBuckets&&f.hasNonElevatedBuckets))break}}}else f.hasNonElevatedBuckets=!0},model:function(f,s,c){const _=s.getSource();if(!_.loaded())return;if("vector"===_.type||"geojson"===_.type)return void(c.modelManager&&c.modelManager.upload(c,"vector"===_.type?f.scope:""));if("batched-model"===_.type||"model"!==_.type)return;const v=_.getModels();for(const C of v)C.upload(c.context)},raster:function(f,s,c){const _=s.getSource();if(!(_ instanceof Zo&&_.loaded()))return;const v=f.sourceLayer||_.rasterLayerIds&&_.rasterLayerIds[0];if(!v)return;const C=f.paint.get("raster-array-band")||_.getInitialBand(v);if(null==C)return;const D=s.getIds().map(O=>s.getTileByID(O));for(const O of D)O.updateNeeded(v,C)&&_.prepareTile(O,v,C)},"raster-particle":function(f,s,c){const _=s.getSource();if(!(_ instanceof Zo&&_.loaded()))return;const v=f.sourceLayer||_.rasterLayerIds&&_.rasterLayerIds[0];if(!v)return;const C=f.paint.get("raster-particle-array-band")||_.getInitialBand(v);if(null==C)return;const D=s.getIds().map(O=>s.getTileByID(O));for(const O of D)O.updateNeeded(v,C)&&_.prepareTile(O,v,C)}};class Dd{constructor(s,c,_,v,C){this.context=new P0(s,c),this.transform=_,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=C,this._timeStamp=h.q.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={forceEnablePrecipitation:!1,showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const D=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const B of D)this._debugParams.enabledLayers[B]=!0;C.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},()=>{this.style.map.triggerRepaint()}),C.registerParameter(this._debugParams,["Precipitation"],"forceEnablePrecipitation"),C.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),C.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),C.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),C.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const B of D)C.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],B);this.occlusionParams=new Lo(C),this.setup(),this.numSublayers=yn.maxUnderzooming+yn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new h.dv,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new cs(this),this._wireframeDebugCache=new ge,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const O=new h.r({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new h.T(this.context,O,s.RGBA8),this._clippingActiveLastFrame=!1,this.scaleFactor=v}updateTerrain(s,c){const _=!!s&&!!s.terrain&&this.transform.projection.supportsTerrain;if(!(_||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new _c(this,s));const v=this._terrain;this.transform.elevation=_?v:null,v.update(s,this.transform,c),this.transform.elevation&&!v.enabled&&(this.transform.elevation=null)}_updateFog(s){const c=s.fog;if(!c||"globe"===this.transform.projection.name||c.getOpacity(this.transform.pitch)<1||c.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[_,v]=c.getFovAdjustedRange(this.transform._fov);if(_>v)return void(this.transform.fogCullDistSq=null);const C=_+.78*(v-_);this.transform.fogCullDistSq=C*C}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(s){s&&!this._terrain&&(this._terrain=new _c(this,this.style)),this._forceTerrainMode=s}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(s,c){if(this.width=s*h.q.devicePixelRatio,this.height=c*h.q.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const _ of this.style.order)this.style._mergedLayers[_].resize()}setup(){const s=this.context,c=new h.b4;c.emplaceBack(0,0),c.emplaceBack(h.ag,0),c.emplaceBack(0,h.ag),c.emplaceBack(h.ag,h.ag),this.tileExtentBuffer=s.createVertexBuffer(c,h.b6.members),this.tileExtentSegments=h.b7.simpleSegment(0,0,4,2);const _=new h.b4;_.emplaceBack(0,0),_.emplaceBack(h.ag,0),_.emplaceBack(0,h.ag),_.emplaceBack(h.ag,h.ag),this.debugBuffer=s.createVertexBuffer(_,h.b6.members),this.debugSegments=h.b7.simpleSegment(0,0,4,5);const v=new h.b4;v.emplaceBack(-1,-1),v.emplaceBack(1,-1),v.emplaceBack(-1,1),v.emplaceBack(1,1),this.viewportBuffer=s.createVertexBuffer(v,h.b6.members),this.viewportSegments=h.b7.simpleSegment(0,0,4,2);const C=new h.aT;C.emplaceBack(0,0,0,0),C.emplaceBack(h.ag,0,h.ag,0),C.emplaceBack(0,h.ag,0,h.ag),C.emplaceBack(h.ag,h.ag,h.ag,h.ag),this.mercatorBoundsBuffer=s.createVertexBuffer(C,h.b9.members),this.mercatorBoundsSegments=h.b7.simpleSegment(0,0,4,2);const D=new h.aU;D.emplaceBack(0,1,2),D.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=s.createIndexBuffer(D);const O=new h.b5;for(const U of[0,1,3,2,0])O.emplaceBack(U);this.debugIndexBuffer=s.createIndexBuffer(O),this.emptyTexture=new h.T(s,new h.r({width:1,height:1},Uint8Array.of(0,0,0,0)),s.gl.RGBA8),this.identityMat=h.ab.mat4.create();const B=this.context.gl;this.stencilClearMode=new pi({func:B.ALWAYS,mask:0},0,255,B.ZERO,B.ZERO,B.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(s){return s._makeTileBoundsBuffers(this.context,this.transform.projection),s._tileBoundsBuffer?{tileBoundsBuffer:s._tileBoundsBuffer,tileBoundsIndexBuffer:s._tileBoundsIndexBuffer,tileBoundsSegments:s._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const s=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,s.TRIANGLES,Jn.disabled,this.stencilClearMode,zi.disabled,gi.disabled,ou(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(s,c,_){if(!c||this.currentStencilSource===c.id||!s.isTileClipped()||!_||0===_.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let O=!1;for(const B of _)if(void 0===this._tileClippingMaskIDs[B.key]){O=!0;break}if(!O)return}this.currentStencilSource=c.id;const v=this.context,C=v.gl;this.nextStencilID+_.length>256&&this.clearStencil(),v.setColorMode(zi.disabled),v.setDepthMode(Jn.disabled);const D=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const O of _){const B=c.getTile(O),U=this._tileClippingMaskIDs[O.key]=this.nextStencilID++,{tileBoundsBuffer:H,tileBoundsIndexBuffer:G,tileBoundsSegments:W}=this.getTileBoundsBuffers(B);D.draw(this,C.TRIANGLES,Jn.disabled,new pi({func:C.ALWAYS,mask:0},U,255,C.KEEP,C.KEEP,C.REPLACE),zi.disabled,gi.disabled,ou(O.projMatrix),"$clipping",H,G,W)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const s=this.nextStencilID++,c=this.context.gl;return new pi({func:c.NOTEQUAL,mask:255},s,255,c.KEEP,c.KEEP,c.REPLACE)}stencilModeForClipping(s){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(s);const c=this.context.gl;return new pi({func:c.EQUAL,mask:255},this._tileClippingMaskIDs[s.key],0,c.KEEP,c.KEEP,c.REPLACE)}stencilConfigForOverlap(s){const c=this.context.gl,_=s.sort((D,O)=>O.overscaledZ-D.overscaledZ),v=_[_.length-1].overscaledZ,C=_[0].overscaledZ-v+1;if(C>1){this.currentStencilSource=void 0,this.nextStencilID+C>256&&this.clearStencil();const D={};for(let O=0;Othis._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce((s,c)=>s+c/this._fpsHistory.length,0))}render(s,c){const _=h.q.now();this._dt=_-this._timeStamp,this._timeStamp=_,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=s.map.repaint,this.style=s,this.options=c;const v=this.style._mergedLayers,C=!(!this.terrain||!this.terrain.enabled),D=()=>this.style._getOrder(C).filter(nt=>{const wt=v[nt];return!(wt.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[wt.type]});let O=D(),B=!1,U=!1;for(const nt of O){const wt=v[nt];"circle"===wt.type&&(B=!0),"symbol"===wt.type&&(wt.hasInitialOcclusionOpacityProperties?U=!0:B=!0)}let H=O.map(nt=>v[nt]);const G=this.style._mergedSourceCaches;this.imageManager=s.imageManager,this.modelManager=s.modelManager,this.symbolFadeChange=s.placement.symbolFadeChange(h.q.now()),this.imageManager.beginFrame();let W=0,Q=!1;for(const nt in G){const wt=G[nt];wt.used&&(wt.prepare(this.context),wt.getSource().usedInConflation&&++W)}let ae=!1;for(const nt of H)nt.isHidden(this.transform.zoom)||("clip"===nt.type&&(ae=!0),this.prepareLayer(nt));const ie={},ce={},de={},be={},De={};for(const nt in G){const wt=G[nt];ie[nt]=wt.getVisibleCoordinates(),ce[nt]=ie[nt].slice().reverse(),de[nt]=wt.getVisibleCoordinates(!0).reverse(),be[nt]=wt.getShadowCasterCoordinates(),De[nt]=wt.sortCoordinatesByDistance(ie[nt])}const Te=nt=>{const wt=this.style.getLayerSourceCache(nt);return wt&&wt.used?wt.getSource():null};if(W||ae||this._clippingActiveLastFrame){const nt=[],wt=[];let Ut=0;for(const tt of H)this.isSourceForClippingOrConflation(tt,Te(tt))&&(nt.push(tt),wt.push(Ut)),Ut++;if(nt&&(ae||nt.length>1)||this._clippingActiveLastFrame){ae=!1;const tt=[];for(let zt=0;zt0){const tt=Te(wt);tt&&(this.minCutoffZoom=Math.max(tt.minzoom,this.minCutoffZoom)),wt.minzoom&&(this.minCutoffZoom=Math.max(wt.minzoom,this.minCutoffZoom))}wt.is3D()&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=nt),this._lastOcclusionLayer=nt)}const Le=this.style&&this.style.fog;Le?(this._fogVisible=0!==Le.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=Le.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(de),this.opaquePassCutoff=0,O=D(),H=O.map(nt=>v[nt]));const Me=this._shadowRenderer;if(Me){Me.updateShadowParameters(this.transform,this.style.directionalLight);for(const nt in G)for(const wt of ie[nt]){let Ut={min:0,max:0};this.terrain&&(Ut=this.terrain.getMinMaxForTile(wt)||Ut),Me.addShadowReceiver(wt.toUnwrapped(),Ut.min,Ut.max)}}"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new h.dw(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new dg(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0);const Pe=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.snow),Ae=this._debugParams.forceEnablePrecipitation||!(!this.style||!this.style.rain);if(Pe&&!this._snow&&(this._snow=new Td(this)),!Pe&&this._snow&&(this._snow.destroy(),delete this._snow),Ae&&!this._rain&&(this._rain=new Nu(this)),!Ae&&this._rain&&(this._rain.destroy(),delete this._rain),this._snow&&this._snow.update(this),this._rain&&this._rain.update(this),!cr.has(this.context.gl))return;this.renderPass="offscreen";for(const nt of H){const wt=s.getLayerSourceCache(nt);if(!nt.hasOffscreenPass()||nt.isHidden(this.transform.zoom))continue;const Ut=wt?ce[wt.id]:void 0;("custom"===nt.type||"raster"===nt.type||"raster-particle"===nt.type||nt.isSky()||Ut&&Ut.length)&&this.renderLayer(this,wt,nt,Ut)}this.depthRangeFor3D=[0,1-(H.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,be)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const Ve="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),Ye=(()=>{if(c.showOverdrawInspector)return h.aj.black;const nt=this.style.fog;if(nt&&this.transform.projection.supportsFog){const wt=this.style.getLut(nt.scope);if(!Ve){const Ut="none"===nt.properties.get("color-use-theme"),tt=nt.properties.get("color").toRenderColor(Ut?null:wt).toArray01();return new h.aj(...tt)}if(Ve){const Ut="none"===nt.properties.get("space-color-use-theme"),tt=nt.properties.get("space-color").toRenderColor(Ut?null:wt).toArray01();return new h.aj(...tt)}}return h.aj.transparent})();if(this.context.clear({color:Ye,depth:1}),this.clearStencil(),this._showOverdrawInspector=c.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&Ve&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=O.length-1;this.currentLayer>=0;this.currentLayer--){const nt=H[this.currentLayer],wt=s.getLayerSourceCache(nt);if(nt.isSky())continue;const Ut=wt?(nt.is3D()?De:ce)[wt.id]:void 0;this._renderTileClippingMasks(nt,wt,Ut),this.renderLayer(this,wt,nt,Ut)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&Ve&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||h.ae(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer0&&nt.hasShadowPass()&&0==--Ke&&(Me.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const Ut=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=Ut;this.currentLayer++){const tt=H[this.currentLayer];if(!tt.hasLightBeamPass())continue;const zt=s.getLayerSourceCache(tt);this.renderLayer(this,zt,tt,zt?ce[zt.id]:void 0)}this.currentLayer=Ut,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const Ut=this.currentLayer;this.depthOcclusion=!0;for(const tt of this.layersWithOcclusionOpacity){this.currentLayer=tt;const zt=H[this.currentLayer],xt=s.getLayerSourceCache(zt),rn=xt?ce[xt.id]:void 0;zt.is3D()||this.terrain||this._renderTileClippingMasks(zt,xt,xt?ie[xt.id]:void 0),this.renderLayer(this,xt,zt,rn)}this.depthOcclusion=!1,this.currentLayer=Ut,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this._snow&&this._snow.draw(this),this._rain&&this._rain.draw(this),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let nt=null;H.forEach(wt=>{const Ut=s.getLayerSourceCache(wt);Ut&&!wt.isHidden(this.transform.zoom)&&Ut.getVisibleCoordinates().length&&(!nt||nt.getSource().maxzoom0?c.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(s,c,_){const v=void 0===_?this.terrain&&this.terrain.renderingToTexture:_,C=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===s||"terrainRaster"===s?(C.push("LIGHTING_3D_MODE"),C.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):v||C.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass&&(this._shadowMapDebug||C.push("DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(C.push("TERRAIN"),this.linearFloatFilteringSupported()&&C.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&C.push("GLOBE"),!this._fogVisible||v||void 0!==c&&!c||C.push("FOG","FOG_DITHERING"),v&&C.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&C.push("OVERDRAW_INSPECTOR"),C}getOrCreateProgram(s,c){this.cache=this.cache||{};const _=c&&c.defines||[],v=c&&c.config,C=this.currentGlobalDefines(s,c&&c.overrideFog,c&&c.overrideRtt).concat(_),D=mp.cacheKey(dm[s],s,C,v);return this.cache[D]||(this.cache[D]=new mp(this.context,s,dm[s],v,R0[s],C)),this.cache[D]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const s=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(s.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new h.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA8))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(s,c){if(this.style.enable3dLights()){const _=this.style.directionalLight,v=this.style.ambientLight;if(_&&v){const C=((D,O,B)=>{const U=D.properties.get("direction"),H="none"===D.properties.get("color-use-theme"),G=D.properties.get("color").toRenderColor(H?null:B.getLut(D.scope)).toArray01(),W=D.properties.get("intensity"),Q="none"===O.properties.get("color-use-theme"),ae=O.properties.get("color").toRenderColor(Q?null:B.getLut(O.scope)).toArray01(),ie=O.properties.get("intensity"),ce=[U.x,U.y,U.z],de=h.cM(ae,ie),be=h.cM(G,W);return{u_lighting_ambient_color:de,u_lighting_directional_dir:ce,u_lighting_directional_color:be,u_ground_radiance:J_(ce,be,de)}})(_,v,this.style);c.setLightsUniformValues(s,C)}}}uploadCommonUniforms(s,c,_,v,C){if(this.uploadCommonLightUniforms(s,c),this.terrain&&this.terrain.renderingToTexture)return;const D=this.style.fog;if(D){const O=D.getOpacity(this.transform.pitch),B=((U,H,G,W,Q,ae,ie,ce,de,be,De,Te)=>{const Le=U.transform,Me="none"===H.properties.get("color-use-theme"),Pe=H.properties.get("color").toRenderColor(Me?null:U.style.getLut(H.scope)).toArray01();Pe[3]=W;const Ae=U.frameCounter/1e3%1,[Ve,Ye]=H.properties.get("vertical-range");return{u_fog_matrix:G?Le.calculateFogTileMatrix(G):Te||U.identityMat,u_fog_range:H.getFovAdjustedRange(Le._fov),u_fog_color:Pe,u_fog_horizon_blend:H.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(Ve,Ye),Ye],u_fog_temporal_offset:Ae,u_frustum_tl:Q,u_frustum_tr:ae,u_frustum_br:ie,u_frustum_bl:ce,u_globe_pos:de,u_globe_radius:be,u_viewport:De,u_globe_transition:h.ae(Le.zoom),u_is_globe:+("globe"===Le.projection.name)}})(this,D,_,O,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*h.q.devicePixelRatio,this.transform.height*h.q.devicePixelRatio],v);c.setFogUniformValues(s,B)}C&&c.setCutoffUniformValues(s,C.uniformValues)}setTileLoadedFlag(s){this.tileLoaded=s}saveCanvasCopy(){const s=this.canvasCopy();s&&(this.frameCopies.push(s),this.tileLoaded=!1)}canvasCopy(){const s=this.context.gl,c=s.createTexture();return s.bindTexture(s.TEXTURE_2D,c),s.copyTexImage2D(s.TEXTURE_2D,0,s.RGBA,0,0,s.drawingBufferWidth,s.drawingBufferHeight,0),c}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const s=this.style&&this.style.fog;return!!s&&0!==s.getOpacity(this.transform.pitch)}getBackgroundTiles(){const s=this._backgroundTiles,c=this._backgroundTiles={},_=this.transform.coveringTiles({tileSize:512});for(const v of _)c[v.key]=s[v.key]||new Ie(v,512,this.transform.tileZoom,this);return c}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(s,c){return!(!s.is3D()||"clip"!==s.type&&(s.minzoom&&s.minzoom>this.transform.zoom||(this.style._clipLayerPresent||"building"!==s.sourceLayer)&&(!c||"batched-model"!==c.type)))}isTileAffectedByFog(s){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let c=this._cachedTileFogOpacities[s.key];return c||(this._cachedTileFogOpacities[s.key]=c=this.style.fog.getOpacityForTile(s)),c[0]>=Oe||c[1]>=Oe}setupDepthForOcclusion(s,c,_){const v=this.context,C=v.gl,D=!!_;var O;_||(_={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),v.activeTexture.set(C.TEXTURE3),s&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(C.NEAREST,C.CLAMP_TO_EDGE),_.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],_.u_depth_range_unpack=[2/((O=this.depthRangeFor3D)[1]-O[0]),-1-2*O[0]/(O[1]-O[0])],_.u_occluder_half_size=.5*this.occlusionParams.occluderSize,_.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(C.NEAREST,C.CLAMP_TO_EDGE),v.activeTexture.set(C.TEXTURE0),D||c.setTerrainUniformValues(v,_)}}function mg(f,s){let c=!1,_=null;const v=()=>{_=null,c&&(f(),_=setTimeout(v,s),c=!1)};return()=>(c=!0,_||v(),_)}class sy{constructor(s){this._hashName=s&&encodeURIComponent(s),h.aP(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=mg(this._updateHashUnthrottled.bind(this),300)}addTo(s){return this._map=s,window.addEventListener("hashchange",this._onHashChange,!1),s.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const s=this._map;if(!s)return"";const c=ly(s);if(this._hashName){const _=this._hashName;let v=!1;const C=location.hash.slice(1).split("&").map(D=>{const O=D.split("=")[0];return O===_?(v=!0,`${O}=${c}`):D}).filter(D=>D);return v||C.push(`${_}=${c}`),`#${C.join("&")}`}return`#${c}`}_getCurrentHash(){const s=location.hash.replace("#","");if(this._hashName){let c;return s.split("&").map(_=>_.split("=")).forEach(_=>{_[0]===this._hashName&&(c=_)}),(c&&c[1]||"").split("/")}return s.split("/")}_onHashChange(){const s=this._map;if(!s)return!1;const c=this._getCurrentHash();if(c.length>=3&&!c.some(_=>isNaN(_))){const _=s.dragRotate.isEnabled()&&s.touchZoomRotate.isEnabled()?+(c[3]||0):s.getBearing();return s.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:_,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function ly(f,s){const c=f.getCenter(),_=Math.round(100*f.getZoom())/100,v=Math.ceil((_*Math.LN2+Math.log(512/360/.5))/Math.LN10),C=Math.pow(10,v),D=Math.round(c.lng*C)/C,O=Math.round(c.lat*C)/C,B=f.getBearing(),U=f.getPitch();let H=s?`/${D}/${O}/${_}`:`${_}/${O}/${D}`;return(B||U)&&(H+="/"+Math.round(10*B)/10),U&&(H+=`/${Math.round(U)}`),H}const zf={linearity:.3,easing:h.dy(0,0,.3,1)},fg=h.l({deceleration:2500,maxSpeed:1400},zf),_g=h.l({deceleration:20,maxSpeed:1400},zf),gg=h.l({deceleration:1e3,maxSpeed:360},zf),Bf=h.l({deceleration:1e3,maxSpeed:90},zf);class L0{constructor(s){this._map=s,this.clear()}clear(){this._inertiaBuffer=[]}record(s){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:h.q.now(),settings:s})}_drainInertiaBuffer(){const s=this._inertiaBuffer,c=h.q.now();for(;s.length>0&&c-s[0].time>160;)s.shift()}_onMoveEnd(s){if(this._map._prefersReducedMotion()||(this._drainInertiaBuffer(),this._inertiaBuffer.length<2))return;const c={zoom:0,bearing:0,pitch:0,pan:new h.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:C}of this._inertiaBuffer)c.zoom+=C.zoomDelta||0,c.bearing+=C.bearingDelta||0,c.pitch+=C.pitchDelta||0,C.panDelta&&c.pan._add(C.panDelta),C.around&&(c.around=C.around),C.pinchAround&&(c.pinchAround=C.pinchAround);const _=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,v={};if(c.pan.mag()){const C=vp(c.pan.mag(),_,h.l({},fg,s||{}));v.offset=c.pan.mult(C.amount/c.pan.mag()),v.center=this._map.transform.center,ym(v,C)}if(c.zoom){const C=vp(c.zoom,_,_g);v.zoom=this._map.transform.zoom+C.amount,ym(v,C)}if(c.bearing){const C=vp(c.bearing,_,gg);v.bearing=this._map.transform.bearing+h.aw(C.amount,-179,179),ym(v,C)}if(c.pitch){const C=vp(c.pitch,_,Bf);v.pitch=this._map.transform.pitch+C.amount,ym(v,C)}if(v.zoom||v.bearing){const C=void 0===c.pinchAround?c.around:c.pinchAround;v.around=C?this._map.unproject(C):this._map.getCenter()}return this.clear(),v.noMoveStart=!0,v}}function ym(f,s){(!f.duration||f.durationc.unproject(B)),O=C.reduce((B,U,H,G)=>B.add(U.div(G.length)),new h.P(0,0));super(s,{points:C,point:O,lngLats:D,lngLat:c.unproject(O),originalEvent:_}),this._defaultPrevented=!1}}class cy extends h.z{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(s,c){super("wheel",{originalEvent:c}),this._defaultPrevented=!1}}class F0{constructor(s,c){this._map=s,this._clickTolerance=c.clickTolerance}reset(){this._mousedownPos=void 0}wheel(s){return this._firePreventable(new cy(this._map,s))}mousedown(s,c){return this._mousedownPos=c,this._firePreventable(new Yl(s.type,this._map,s))}mouseup(s){this._map.fire(new Yl(s.type,this._map,s))}preclick(s){const c=h.l({},s);c.type="preclick",this._map.fire(new Yl(c.type,this._map,c))}click(s,c){this._mousedownPos&&this._mousedownPos.dist(c)>=this._clickTolerance||(this.preclick(s),this._map.fire(new Yl(s.type,this._map,s)))}dblclick(s){return this._firePreventable(new Yl(s.type,this._map,s))}mouseover(s){this._map.fire(new Yl(s.type,this._map,s))}mouseout(s){this._map.fire(new Yl(s.type,this._map,s))}touchstart(s){return this._firePreventable(new vm(s.type,this._map,s))}touchmove(s){this._map.fire(new vm(s.type,this._map,s))}touchend(s){this._map.fire(new vm(s.type,this._map,s))}touchcancel(s){this._map.fire(new vm(s.type,this._map,s))}_firePreventable(s){if(this._map.fire(s),s.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class dy{constructor(s){this._map=s}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(s){this._map.fire(new Yl(s.type,this._map,s))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Yl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(s){this._delayContextMenu?this._contextMenuEvent=s:this._map.fire(new Yl(s.type,this._map,s)),this._map.listens("contextmenu")&&s.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Yr{constructor(s,c){this._map=s,this._el=s.getCanvasContainer(),this._container=s.getContainer(),this._clickTolerance=c.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(s,c){this.isEnabled()&&s.shiftKey&&0===s.button&&(Dn(),this._startPos=this._lastPos=c,this._active=!0)}mousemoveWindow(s,c){if(!this._active)return;const _=c,v=this._startPos,C=this._lastPos;if(!v||!C||C.equals(_)||!this._box&&_.dist(v){this._box&&(this._box.style.transform=`translate(${D}px,${B}px)`,this._box.style.width=O-D+"px",this._box.style.height=U-B+"px")})}mouseupWindow(s,c){if(!this._active)return;const _=this._startPos,v=c;if(_&&0===s.button){if(this.reset(),hn(),_.x!==v.x||_.y!==v.y)return this._map.fire(new h.z("boxzoomend",{originalEvent:s})),{cameraAnimation:C=>C.fitScreenCoordinates(_,v,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",s)}}keydown(s){this._active&&27===s.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",s))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),yi(),delete this._startPos,delete this._lastPos}_fireEvent(s,c){return this._map.fire(new h.z(s,{originalEvent:c}))}}function hs(f,s){const c={};for(let _=0;_this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=s.timeStamp),_.length===this.numTouches&&(this.centroid=function(v){const C=new h.P(0,0);for(const D of v)C._add(D);return C.div(v.length)}(c),this.touches=hs(_,c)))}touchmove(s,c,_){if(this.aborted||!this.centroid)return;const v=hs(_,c);for(const C in this.touches){const D=v[C];(!D||D.dist(this.touches[C])>30)&&(this.aborted=!0)}}touchend(s,c,_){if((!this.centroid||s.timeStamp-this.startTime>500)&&(this.aborted=!0),0===_.length){const v=!this.aborted&&this.centroid;if(this.reset(),v)return v}}}class vr{constructor(s){this.singleTap=new xp(s),this.numTaps=s.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(s,c,_){this.singleTap.touchstart(s,c,_)}touchmove(s,c,_){this.singleTap.touchmove(s,c,_)}touchend(s,c,_){const v=this.singleTap.touchend(s,c,_);if(v){const C=s.timeStamp-this.lastTime<500,D=!this.lastTap||this.lastTap.dist(v)<30;if(C&&D||this.reset(),this.count++,this.lastTime=s.timeStamp,this.lastTap=v,this.count===this.numTaps)return this.reset(),v}}}class Va{constructor(){this._zoomIn=new vr({numTouches:1,numTaps:2}),this._zoomOut=new vr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(s,c,_){this._zoomIn.touchstart(s,c,_),this._zoomOut.touchstart(s,c,_)}touchmove(s,c,_){this._zoomIn.touchmove(s,c,_),this._zoomOut.touchmove(s,c,_)}touchend(s,c,_){const v=this._zoomIn.touchend(s,c,_),C=this._zoomOut.touchend(s,c,_);return v?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()+1,around:D.unproject(v)},{originalEvent:s})}):C?(this._active=!0,s.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:D=>D.easeTo({duration:300,zoom:D.getZoom()-1,around:D.unproject(C)},{originalEvent:s})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const N0={0:1,2:2};class cu{constructor(s){this.reset(),this._clickTolerance=s.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(s,c){return!1}_move(s,c){return{}}mousedown(s,c){if(this._lastPoint)return;const _=sn(s);this._correctButton(s,_)&&(this._lastPoint=c,this._eventButton=_)}mousemoveWindow(s,c){const _=this._lastPoint;if(_)if(s.preventDefault(),null!=this._eventButton&&function(v,C){const D=N0[C];return void 0===v.buttons||(v.buttons&D)!==D}(s,this._eventButton))this.reset();else if(this._moved||!(c.dist(_)0&&(this._active=!0);const v=hs(_,c),C=new h.P(0,0),D=new h.P(0,0);let O=0;for(const U in v){const H=v[U],G=this._touches[U];G&&(C._add(H),D._add(H.sub(G)),O++,v[U]=H)}if(this._touches=v,O{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")},500)}}class Qa{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(s){}_move(s,c,_){return{}}touchstart(s,c,_){this._firstTwoTouches||_.length<2||(this._firstTwoTouches=[_[0].identifier,_[1].identifier],this._start([c[0],c[1]]))}touchmove(s,c,_){const v=this._firstTwoTouches;if(!v)return;s.preventDefault();const[C,D]=v,O=wm(_,c,C),B=wm(_,c,D);if(!O||!B)return;const U=this._aroundCenter?null:O.add(B).div(2);return this._move([O,B],U,s)}touchend(s,c,_){if(!this._firstTwoTouches)return;const[v,C]=this._firstTwoTouches,D=wm(_,c,v),O=wm(_,c,C);D&&O||(this._active&&hn(),this.reset())}touchcancel(){this.reset()}enable(s){this._enabled=!0,this._aroundCenter=!!s&&"center"===s.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function wm(f,s,c){for(let _=0;_Math.abs(f.x)}class z0 extends Qa{constructor(s){super(),this._map=s}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(s){this._lastPoints=s,yg(s[0].sub(s[1]))&&(this._valid=!1)}_move(s,c,_){const v=this._lastPoints;if(!v)return;const C=s[0].sub(v[0]),D=s[1].sub(v[1]);return this._map._cooperativeGestures&&!h.dz()&&_.touches.length<3||(this._valid=this.gestureBeginsVertically(C,D,_.timeStamp),!this._valid)?void 0:(this._lastPoints=s,this._active=!0,{pitchDelta:(C.y+D.y)/2*-.5})}gestureBeginsVertically(s,c,_){if(void 0!==this._valid)return this._valid;const v=s.mag()>=2,C=c.mag()>=2;if(!v&&!C)return;if(!v||!C)return null==this._firstMove&&(this._firstMove=_),_-this._firstMove<100&&void 0;const D=s.y>0==c.y>0;return yg(s)&&yg(c)&&D}}const uy={panStep:100,bearingStep:15,pitchStep:10};class Dh{constructor(){const s=uy;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(s){if(s.altKey||s.ctrlKey||s.metaKey)return;let c=0,_=0,v=0,C=0,D=0;switch(s.keyCode){case 61:case 107:case 171:case 187:c=1;break;case 189:case 109:case 173:c=-1;break;case 37:s.shiftKey?_=-1:(s.preventDefault(),C=-1);break;case 39:s.shiftKey?_=1:(s.preventDefault(),C=1);break;case 38:s.shiftKey?v=1:(s.preventDefault(),D=-1);break;case 40:s.shiftKey?v=-1:(s.preventDefault(),D=1);break;default:return}return this._rotationDisabled&&(_=0,v=0),{cameraAnimation:O=>{const B=O.getZoom();O.easeTo({duration:300,easeId:"keyboardHandler",easing:Ed,zoom:c?Math.round(B)+c*(s.shiftKey?2:1):B,bearing:O.getBearing()+_*this._bearingStep,pitch:O.getPitch()+v*this._pitchStep,offset:[-C*this._panStep,-D*this._panStep],center:O.getCenter()},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Ed(f){return f*(2-f)}const zu=4.000244140625,Md=1/450;class Ad{constructor(s,c){this._map=s,this._el=s.getCanvasContainer(),this._handler=c,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=Md,h.aP(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(s){this._defaultZoomRate=s}setWheelZoomRate(s){this._wheelZoomRate=s}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(s){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!s&&"center"===s.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(s){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(s.ctrlKey||s.metaKey||this.isZooming()||h.dz()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let c=s.deltaMode===WheelEvent.DOM_DELTA_LINE?40*s.deltaY:s.deltaY;const _=h.q.now(),v=_-(this._lastWheelEventTime||0);this._lastWheelEventTime=_,0!==c&&c%zu==0?this._type="wheel":0!==c&&Math.abs(c)<4?this._type="trackpad":v>400?(this._type=null,this._lastValue=c,this._timeout=window.setTimeout(this._onTimeout,40,s)):this._type||(this._type=Math.abs(v*c)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,c+=this._lastValue)),s.shiftKey&&c&&(c/=4),this._type&&(this._lastWheelEvent=s,this._delta-=c,this._active||this._start(s)),s.preventDefault()}_onTimeout(s){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)}_start(s){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const c=Ji(this._el,s);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:c,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const s=this._map.transform;"wheel"===this._type&&s.projection.wrap&&(s._center.lng>=180||s._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const c=()=>s._terrainEnabled()&&this._aroundCoord?s.computeZoomRelativeTo(this._aroundCoord):s.zoom;if(0!==this._delta){const U="wheel"===this._type&&Math.abs(this._delta)>zu?this._wheelZoomRate:this._defaultZoomRate;let H=2/(1+Math.exp(-Math.abs(this._delta*U)));this._delta<0&&0!==H&&(H=1/H);const G=c(),W=Math.pow(2,G),Q="number"==typeof this._targetZoom?s.zoomScale(this._targetZoom):W;this._targetZoom=Math.min(s.maxZoom,Math.max(s.minZoom,s.scaleZoom(Q*H))),"wheel"===this._type&&(this._startZoom=G,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const _="number"==typeof this._targetZoom?this._targetZoom:c(),v=this._startZoom,C=this._easing;let D,O=!1;if("wheel"===this._type&&v&&C){const U=Math.min((h.q.now()-this._lastWheelEventTime)/200,1),H=C(U);D=h.af(v,_,H),U<1?this._frameId||(this._frameId=!0):O=!0}else D=_,O=!0;this._active=!0,O&&(this._active=!1,this._finishTimeout=window.setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200));let B=D-c();return B*this._lastDelta<0&&(B=0),{noInertia:!0,needsRenderFrame:!O,zoomDelta:B,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(s){let c=h.dA;if(this._prevEase){const _=this._prevEase,v=(h.q.now()-_.start)/_.duration,C=_.easing(v+.01)-_.easing(v),D=.27/Math.sqrt(C*C+1e-4)*.01,O=Math.sqrt(.0729-D*D);c=h.dy(D,O,.25,1)}return this._prevEase={start:h.q.now(),duration:s,easing:c},c}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=vn("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout(()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")},200)}}class Ih{constructor(s,c){this._clickZoom=s,this._tapZoom=c}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Sp{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(s,c){return s.preventDefault(),{cameraAnimation:_=>{_.easeTo({duration:300,zoom:_.getZoom()+(s.shiftKey?-1:1),around:_.unproject(c)},{originalEvent:s})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Tp{constructor(){this._tap=new vr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(s,c,_){this._swipePoint||(this._tapTime&&s.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?_.length>0&&(this._swipePoint=c[0],this._swipeTouch=_[0].identifier):this._tap.touchstart(s,c,_))}touchmove(s,c,_){if(this._tapTime){if(this._swipePoint){if(_[0].identifier!==this._swipeTouch)return;const v=c[0],C=v.y-this._swipePoint.y;return this._swipePoint=v,s.preventDefault(),this._active=!0,{zoomDelta:C/128}}}else this._tap.touchmove(s,c,_)}touchend(s,c,_){this._tapTime?this._swipePoint&&0===_.length&&this.reset():this._tap.touchend(s,c,_)&&(this._tapTime=s.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sD{constructor(s,c,_){this._el=s,this._mousePan=c,this._touchPan=_}enable(s){this._inertiaOptions=s||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class gw{constructor(s,c,_){this._pitchWithRotate=s.pitchWithRotate,this._mouseRotate=c,this._mousePitch=_}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class B0{constructor(s,c,_,v){this._el=s,this._touchZoom=c,this._touchRotate=_,this._tapDragZoom=v,this._rotationDisabled=!1,this._enabled=!0}enable(s){this._touchZoom.enable(s),this._rotationDisabled||this._touchRotate.enable(s),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Hf=f=>f.zoom||f.drag||f.pitch||f.rotate;class Dp extends h.z{}class al{constructor(){this.constants=[1,1,.01],this.radius=0}setup(s,c){const _=h.ab.vec3.sub([],c,s);this.radius=h.ab.vec3.length(_[2]<0?h.ab.vec3.div([],_,this.constants):[_[0],_[1],0])}projectRay(s){h.ab.vec3.div(s,s,this.constants),h.ab.vec3.normalize(s,s),h.ab.vec3.mul(s,s,this.constants);const c=h.ab.vec3.scale([],s,this.radius);if(c[2]>0){const _=h.ab.vec3.scale([],[0,0,1],h.ab.vec3.dot(c,[0,0,1])),v=h.ab.vec3.scale([],h.ab.vec3.normalize([],[c[0],c[1],0]),this.radius),C=h.ab.vec3.add([],c,h.ab.vec3.scale([],h.ab.vec3.sub([],h.ab.vec3.add([],v,_),c),2));c[0]=C[0],c[1]=C[1]}return c}}function Eh(f){return f.panDelta&&f.panDelta.mag()||f.zoomDelta||f.bearingDelta||f.pitchDelta}class Cm{constructor(s,c){this._map=s,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new L0(s),this._bearingSnap=c.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new al,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(c),h.aP(["handleEvent","handleWindowEvent"],this);const _=this._el;this._listeners=[[_,"touchstart",{passive:!0}],[_,"touchmove",{passive:!1}],[_,"touchend",void 0],[_,"touchcancel",void 0],[_,"mousedown",void 0],[_,"mousemove",void 0],[_,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[_,"mouseover",void 0],[_,"mouseout",void 0],[_,"dblclick",void 0],[_,"click",void 0],[_,"keydown",{capture:!1}],[_,"keyup",void 0],[_,"wheel",{passive:!1}],[_,"contextmenu",void 0],[window,"blur",void 0]];for(const[v,C,D]of this._listeners){const O=v===document?this.handleWindowEvent:this.handleEvent;v.addEventListener(C,O,D)}}destroy(){for(const[s,c,_]of this._listeners){const v=s===document?this.handleWindowEvent:this.handleEvent;s.removeEventListener(c,v,_)}}_addDefaultHandlers(s){const c=this._map,_=c.getCanvasContainer();this._add("mapEvent",new F0(c,s));const v=c.boxZoom=new Yr(c,s);this._add("boxZoom",v);const C=new Va,D=new Sp;c.doubleClickZoom=new Ih(D,C),this._add("tapZoom",C),this._add("clickZoom",D);const O=new Tp;this._add("tapDragZoom",O);const B=c.touchPitch=new z0(c);this._add("touchPitch",B);const U=new Id(s),H=new xm(s);c.dragRotate=new gw(s,U,H),this._add("mouseRotate",U,["mousePitch"]),this._add("mousePitch",H,["mouseRotate"]);const G=new bg(s),W=new Er(c,s);c.dragPan=new sD(_,G,W),this._add("mousePan",G),this._add("touchPan",W,["touchZoom","touchRotate"]);const Q=new Cp,ae=new Vf;c.touchZoomRotate=new B0(_,ae,Q,O),this._add("touchRotate",Q,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),this._add("blockableMapEvent",new dy(c));const ie=c.scrollZoom=new Ad(c,this);this._add("scrollZoom",ie,["mousePan"]);const ce=c.keyboard=new Dh;this._add("keyboard",ce);for(const de of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])s.interactive&&s[de]&&c[de].enable(s[de])}_add(s,c,_){this._handlers.push({handlerName:s,handler:c,allowed:_}),this._handlersById[s]=c}stop(s){if(!this._updatingCamera){for(const{handler:c}of this._handlers)c.reset();this._inertia.clear(),this._fireEvents({},{},s),this._changes=[],this._originalZoom=void 0}}isActive(){for(const{handler:s}of this._handlers)if(s.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Hf(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(s,c,_){for(const v in s)if(v!==_&&(!c||c.indexOf(v)<0))return!0;return!1}handleWindowEvent(s){this.handleEvent(s,`${s.type}Window`)}_getMapTouches(s){const c=[];for(const _ of s)this._el.contains(_.target)&&c.push(_);return c}handleEvent(s,c){this._updatingCamera=!0;const _="renderFrame"===s.type,v=_?void 0:s,C={needsRenderFrame:!1},D={},O={},B=s.touches?this._getMapTouches(s.touches):void 0,U=B?$o(this._el,B):_?void 0:Ji(this._el,s);for(const{handlerName:W,handler:Q,allowed:ae}of this._handlers){if(!Q.isEnabled())continue;let ie;this._blockedByActive(O,ae,W)?Q.reset():Q[c||s.type]&&(ie=Q[c||s.type](s,U,B),this.mergeHandlerResult(C,D,ie,W,v),ie&&ie.needsRenderFrame&&this._triggerRenderFrame()),(ie||Q.isActive())&&(O[W]=Q)}const H={};for(const W in this._previousActiveHandlers)O[W]||(H[W]=v);this._previousActiveHandlers=O,(Object.keys(H).length||Eh(C))&&(this._changes.push([C,D,H]),this._triggerRenderFrame()),(Object.keys(O).length||Eh(C))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:G}=C;G&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],G(this._map))}mergeHandlerResult(s,c,_,v,C){if(!_)return;h.l(s,_);const D={handlerName:v,originalEvent:_.originalEvent||C};void 0!==_.zoomDelta&&(c.zoom=D),void 0!==_.panDelta&&(c.drag=D),void 0!==_.pitchDelta&&(c.pitch=D),void 0!==_.bearingDelta&&(c.rotate=D)}_applyChanges(){const s={},c={},_={};for(const[v,C,D]of this._changes)v.panDelta&&(s.panDelta=(s.panDelta||new h.P(0,0))._add(v.panDelta)),v.zoomDelta&&(s.zoomDelta=(s.zoomDelta||0)+v.zoomDelta),v.bearingDelta&&(s.bearingDelta=(s.bearingDelta||0)+v.bearingDelta),v.pitchDelta&&(s.pitchDelta=(s.pitchDelta||0)+v.pitchDelta),void 0!==v.around&&(s.around=v.around),void 0!==v.aroundCoord&&(s.aroundCoord=v.aroundCoord),void 0!==v.pinchAround&&(s.pinchAround=v.pinchAround),v.noInertia&&(s.noInertia=v.noInertia),h.l(c,C),h.l(_,D);this._updateMapTransform(s,c,_),this._changes=[]}_updateMapTransform(s,c,_){const v=this._map,C=v.transform,D=be=>[be.x,be.y,be.z];if((()=>{const De=this._eventsInProgress.drag;return De&&!this._handlersById[De.handlerName].isActive()})()&&!Eh(s)){const be=C.zoom;C.cameraElevationReference="sea",null!=this._originalZoom&&C._orthographicProjectionAtLowPitch&&"globe"!==C.projection.name&&0===C.pitch?(C.cameraElevationReference="ground",C.zoom=this._originalZoom):(C.recenterOnTerrain(),C.cameraElevationReference="ground"),be!==C.zoom&&this._map._update(!0)}if(C._isCameraConstrained&&v._stop(!0),!Eh(s))return void this._fireEvents(c,_,!0);let{panDelta:O,zoomDelta:B,bearingDelta:U,pitchDelta:H,around:G,aroundCoord:W,pinchAround:Q}=s;C._isCameraConstrained&&(B>0&&(B=0),C._isCameraConstrained=!1),void 0!==Q&&(G=Q),(B||(()=>c.drag&&!this._eventsInProgress.drag)())&&G&&(this._dragOrigin=D(C.pointCoordinate3D(G)),this._originalZoom=C.zoom,this._trackingEllipsoid.setup(C._camera.position,this._dragOrigin)),C.cameraElevationReference="sea",v._stop(!0),G=G||v.transform.centerPoint,U&&(C.bearing+=U),H&&(C.pitch+=H),C._updateCameraState();const ae=[0,0,0];if(O)if("mercator"===C.projection.name){const be=this._trackingEllipsoid.projectRay(C.screenPointToMercatorRay(G).dir),De=this._trackingEllipsoid.projectRay(C.screenPointToMercatorRay(G.sub(O)).dir);ae[0]=De[0]-be[0],ae[1]=De[1]-be[1]}else{const be=C.pointCoordinate(G);if("globe"===C.projection.name){O=O.rotate(-C.angle);const De=C._pixelsPerMercatorPixel/C.worldSize;ae[0]=-O.x*h.dB(h.aS(be.y))*De,ae[1]=-O.y*h.dB(C.center.lat)*De}else{const De=C.pointCoordinate(G.sub(O));be&&De&&(ae[0]=De.x-be.x,ae[1]=De.y-be.y)}}const ie=C.zoom,ce=[0,0,0];if(B){const be=D(W||C.pointCoordinate3D(G)),De={dir:h.ab.vec3.normalize([],h.ab.vec3.sub([],be,C._camera.position))};if(De.dir[2]<0){const Te=C.zoomDeltaToMovement(be,B);h.ab.vec3.scale(ce,De.dir,Te)}}const de=h.ab.vec3.add(ae,ae,ce);C._translateCameraConstrained(de),B&&Math.abs(C.zoom-ie)>1e-4&&C.recenterOnTerrain(),C.cameraElevationReference="ground",this._map._update(),s.noInertia||this._inertia.record(s),this._fireEvents(c,_,!0)}_fireEvents(s,c,_){const v=Hf(this._eventsInProgress),C=Hf(s),D={};for(const H in s){const{originalEvent:G}=s[H];this._eventsInProgress[H]||(D[`${H}start`]=G),this._eventsInProgress[H]=s[H]}!v&&C&&this._fireEvent("movestart",C.originalEvent);for(const H in D)this._fireEvent(H,D[H]);C&&this._fireEvent("move",C.originalEvent);for(const H in s){const{originalEvent:G}=s[H];this._fireEvent(H,G)}const O={};let B;for(const H in this._eventsInProgress){const{handlerName:G,originalEvent:W}=this._eventsInProgress[H];this._handlersById[G].isActive()||(delete this._eventsInProgress[H],B=c[G]||W,O[`${H}end`]=B)}for(const H in O)this._fireEvent(H,O[H]);const U=Hf(this._eventsInProgress);if(_&&(v||C)&&!U){this._updatingCamera=!0;const H=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),G=W=>0!==W&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Dp("renderFrame",{timeStamp:s})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const V0="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class du extends h.E{constructor(s,c){super(),this._moving=!1,this._zooming=!1,this.transform=s,this._bearingSnap=c.bearingSnap,this._respectPrefersReducedMotion=!1!==c.respectPrefersReducedMotion,h.aP(["_renderFrameCallback"],this)}getCenter(){return new h.bO(this.transform.center.lng,this.transform.center.lat)}setCenter(s,c){return this.jumpTo({center:s},c)}panBy(s,c,_){return s=h.P.convert(s).mult(-1),this.panTo(this.transform.center,h.l({offset:s},c),_)}panTo(s,c,_){return this.easeTo(h.l({center:s},c),_)}getZoom(){return this.transform.zoom}setZoom(s,c){return this.jumpTo({zoom:s},c),this}zoomTo(s,c,_){return this.easeTo(h.l({zoom:s},c),_)}zoomIn(s,c){return this.zoomTo(this.getZoom()+1,s,c),this}zoomOut(s,c){return this.zoomTo(this.getZoom()-1,s,c),this}getBearing(){return this.transform.bearing}setBearing(s,c){return this.jumpTo({bearing:s},c),this}getPadding(){return this.transform.padding}setPadding(s,c){return this.jumpTo({padding:s},c),this}rotateTo(s,c,_){return this.easeTo(h.l({bearing:s},c),_)}resetNorth(s,c){return this.rotateTo(0,h.l({duration:1e3},s),c),this}resetNorthPitch(s,c){return this.easeTo(h.l({bearing:0,pitch:0,duration:1e3},s),c),this}snapToNorth(s,c){return Math.abs(this.getBearing())s.aspect?_/(2*Math.tan(.5*s.fovX)*s.aspect):v/(2*Math.tan(.5*s.fovY)*s.aspect)}_cameraForBoundsOnGlobe(s,c,_,v,C,D){const O=s.clone(),B=this._extendCameraOptions(D);O.bearing=v,O.pitch=C;const U=h.bO.convert(c),H=h.bO.convert(_),G=.5*(U.lat+H.lat),W=.5*(U.lng+H.lng),Q=h.dC(G,W),ae=h.ab.vec3.normalize([],Q),ie=h.ab.vec3.normalize([],h.ab.vec3.cross([],ae,[0,1,0])),ce=h.ab.vec3.cross([],ie,ae),de=[ie[0],ie[1],ie[2],0,ce[0],ce[1],ce[2],0,ae[0],ae[1],ae[2],0,0,0,0,1],be=[Q,h.dC(U.lat,U.lng),h.dC(H.lat,U.lng),h.dC(H.lat,H.lng),h.dC(U.lat,H.lng),h.dC(G,U.lng),h.dC(G,H.lng),h.dC(U.lat,W),h.dC(H.lat,W)];let De=h.cd.fromPoints(be.map(xt=>[h.ab.vec3.dot(ie,xt),h.ab.vec3.dot(ce,xt),h.ab.vec3.dot(ae,xt)]));const Te=h.ab.vec3.transformMat4([],De.center,de);0===h.ab.vec3.squaredLength(Te)&&h.ab.vec3.set(Te,0,0,1),h.ab.vec3.normalize(Te,Te),h.ab.vec3.scale(Te,Te,h.ax),O.center=h.dD(Te);const Le=O.getWorldToCameraMatrix(),Me=h.ab.mat4.invert(new Float64Array(16),Le);De=h.cd.applyTransform(De,h.ab.mat4.multiply([],Le,de));const Pe=this._extendAABB(De,O,B,v);if(!Pe)return void h.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");De=Pe,h.ab.vec3.transformMat4(Te,Te,Le);const Ae=.5*(De.max[2]-De.min[2]),Ve=this._minimumAABBFrustumDistance(O,De),Ye=h.ab.vec3.scale([],[0,0,1],Ae),vt=h.ab.vec3.add(Ye,Te,Ye),Ke=Ve+(0===O.pitch?0:h.ab.vec3.distance(Te,vt)),Mt=O.globeCenterInViewSpace,Rt=h.ab.vec3.sub([],Te,[Mt[0],Mt[1],Mt[2]]);h.ab.vec3.normalize(Rt,Rt),h.ab.vec3.scale(Rt,Rt,Ke);const nt=h.ab.vec3.add([],Te,Rt);h.ab.vec3.transformMat4(nt,nt,Me);const wt=h.ds/h.ax,Ut=h.ab.vec3.length(nt),tt=h.bH(Math.max(Ut*wt-h.ds,Number.EPSILON),0),zt=Math.min(O.zoomFromMercatorZAdjusted(tt),B.maxZoom);return zt>.5*(h.c6+h.bY)?(O.setProjection({name:"mercator"}),O.zoom=zt,this._cameraForBounds(O,c,_,v,C,D)):{center:O.center,zoom:zt,bearing:v,pitch:C}}_extendAABB(s,c,_,v){const C=.5*((_.padding.left||0)+(_.padding.right||0)),D=.5*((_.padding.top||0)+(_.padding.bottom||0)),O=D,B=C,U=C,H=D,G=c.width-(B+U),W=c.height-(O+H),Q=h.ab.vec3.sub([],s.max,s.min),ae=Math.min(G/Q[0],W/Q[1]),ie=Math.min(c.scaleZoom(c.scale*ae),_.maxZoom);if(isNaN(ie))return null;const ce=c.scale/c.zoomScale(ie),de=new h.cd([s.min[0]-B*ce,s.min[1]-H*ce,s.min[2]],[s.max[0]+U*ce,s.max[1]+O*ce,s.max[2]]),be=("number"==typeof _.offset.x&&"number"==typeof _.offset.y?new h.P(_.offset.x,_.offset.y):h.P.convert(_.offset)).rotate(-h.ai(v));return de.center[0]-=be.x*ce,de.center[1]+=be.y*ce,de}queryTerrainElevation(s,c){const _=this.transform.elevation;return _?(c=h.l({},{exaggerated:!0},c),_.getAtPoint(h.aa.fromLngLat(s),null,c.exaggerated)):null}_cameraForBounds(s,c,_,v,C,D){if("globe"===s.projection.name)return this._cameraForBoundsOnGlobe(s,c,_,v,C,D);const O=s.clone(),B=this._extendCameraOptions(D);O.bearing=v,O.pitch=C;const U=h.bO.convert(c),H=h.bO.convert(_),G=new h.bO(U.lng,H.lat),W=new h.bO(H.lng,U.lat),Q=O.project(U),ae=O.project(H),ie=this.queryTerrainElevation(U),ce=this.queryTerrainElevation(H),de=this.queryTerrainElevation(G),be=this.queryTerrainElevation(W),De=[[Q.x,Q.y,Math.min(ie||0,ce||0,de||0,be||0)],[ae.x,ae.y,Math.max(ie||0,ce||0,de||0,be||0)]];let Te=h.cd.fromPoints(De);const Le=O.getWorldToCameraMatrix(),Me=h.ab.mat4.invert(new Float64Array(16),Le);Te=h.cd.applyTransform(Te,Le);const Pe=this._extendAABB(Te,O,B,v);if(!Pe)return void h.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");Te=Pe;const Ae=.5*h.ab.vec3.sub([],Te.max,Te.min)[2],Ve=this._minimumAABBFrustumDistance(O,Te),Ye=[0,0,1,0];h.ab.vec4.transformMat4(Ye,Ye,Le),h.ab.vec4.normalize(Ye,Ye);const vt=h.ab.vec3.scale([],Ye,Ve+Ae),Ke=h.ab.vec3.add([],Te.center,vt);h.ab.vec3.transformMat4(Te.center,Te.center,Me),h.ab.vec3.transformMat4(Ke,Ke,Me);const Mt=O.unproject(new h.P(Te.center[0],Te.center[1])),Rt=h.dE(O.projection,Mt),nt=Math.pow(2,Rt),wt=Math.min(O._zoomFromMercatorZ(Ke[2]*O.pixelsPerMeter*nt/O.worldSize),B.maxZoom);return O.mercatorFromTransition&&wt<.5*(h.c6+h.bY)?(O.setProjection({name:"globe"}),O.zoom=wt,this._cameraForBounds(O,c,_,v,C,D)):{center:Mt,zoom:wt,bearing:v,pitch:C}}fitBounds(s,c,_){const v=this.cameraForBounds(s,c);return this._fitInternal(v,c,_)}fitScreenCoordinates(s,c,_,v,C){const D=h.P.convert(s),O=h.P.convert(c),B=new h.P(Math.min(D.x,O.x),Math.min(D.y,O.y)),U=new h.P(Math.max(D.x,O.x),Math.max(D.y,O.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(D,O))return this;const H=this.transform.pointLocation3D(B),G=this.transform.pointLocation3D(U),W=this.transform.pointLocation3D(new h.P(B.x,U.y)),Q=this.transform.pointLocation3D(new h.P(U.x,B.y)),ae=[Math.min(H.lng,G.lng,W.lng,Q.lng),Math.min(H.lat,G.lat,W.lat,Q.lat)],ie=[Math.max(H.lng,G.lng,W.lng,Q.lng),Math.max(H.lat,G.lat,W.lat,Q.lat)],ce=v&&v.pitch?v.pitch:this.getPitch(),de=this._cameraForBounds(this.transform,ae,ie,_,ce,v);return this._fitInternal(de,v,C)}_fitInternal(s,c,_){return s?(c=h.l(s,c)).linear?this.easeTo(c,_):this.flyTo(c,_):this}jumpTo(s,c){this.stop();const _=s.preloadOnly?this.transform.clone():this.transform;let v=!1,C=!1,D=!1;"zoom"in s&&_.zoom!==+s.zoom&&(v=!0,_.zoom=+s.zoom),void 0!==s.center&&(_.center=h.bO.convert(s.center)),"bearing"in s&&_.bearing!==+s.bearing&&(C=!0,_.bearing=+s.bearing),"pitch"in s&&_.pitch!==+s.pitch&&(D=!0,_.pitch=+s.pitch);const O="number"==typeof s.padding?this._extendPadding(s.padding):s.padding;if(null!=s.padding&&!_.isPaddingEqual(O))if(!1===s.retainPadding){const B=_.clone();B.padding=O,_.setLocationAtPoint(_.center,B.centerPoint)}else _.padding=O;return s.preloadOnly?(this._preloadTiles(_),this):(this.fire(new h.z("movestart",c)).fire(new h.z("move",c)),v&&this.fire(new h.z("zoomstart",c)).fire(new h.z("zoom",c)).fire(new h.z("zoomend",c)),C&&this.fire(new h.z("rotatestart",c)).fire(new h.z("rotate",c)).fire(new h.z("rotateend",c)),D&&this.fire(new h.z("pitchstart",c)).fire(new h.z("pitch",c)).fire(new h.z("pitchend",c)),this.fire(new h.z("moveend",c)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||h.w(V0),this.transform.getFreeCameraOptions()}setFreeCameraOptions(s,c){const _=this.transform;if(!_.projection.supportsFreeCamera)return h.w(V0),this;this.stop();const v=_.zoom,C=_.pitch,D=_.bearing;_.setFreeCameraOptions(s);const O=v!==_.zoom,B=C!==_.pitch,U=D!==_.bearing;return this.fire(new h.z("movestart",c)).fire(new h.z("move",c)),O&&this.fire(new h.z("zoomstart",c)).fire(new h.z("zoom",c)).fire(new h.z("zoomend",c)),U&&this.fire(new h.z("rotatestart",c)).fire(new h.z("rotate",c)).fire(new h.z("rotateend",c)),B&&this.fire(new h.z("pitchstart",c)).fire(new h.z("pitch",c)).fire(new h.z("pitchend",c)),this.fire(new h.z("moveend",c)),this}easeTo(s,c){this._stop(!1,s.easeId),(!1===(s=h.l({offset:[0,0],duration:500,easing:h.dA},s)).animate||this._prefersReducedMotion(s))&&(s.duration=0);const _=this.transform,v=this.getZoom(),C=this.getBearing(),D=this.getPitch(),O=this.getPadding(),B="zoom"in s?+s.zoom:v,U="bearing"in s?this._normalizeBearing(s.bearing,C):C,H="pitch"in s?+s.pitch:D,G=this._extendPadding(s.padding),W=h.P.convert(s.offset);let Q,ae,ie;if("globe"===_.projection.name){const Ye=h.aa.fromLngLat(_.center),vt=W.rotate(-_.angle);Ye.x+=vt.x/_.worldSize,Ye.y+=vt.y/_.worldSize;const Ke=Ye.toLngLat(),Mt=h.bO.convert(s.center||Ke);this._normalizeCenter(Mt),Q=_.centerPoint.add(vt),ae=new h.P(Ye.x,Ye.y).mult(_.worldSize),ie=new h.P(h.at(Mt.lng),h.aA(Mt.lat)).mult(_.worldSize).sub(ae)}else{Q=_.centerPoint.add(W);const Ye=_.pointLocation(Q),vt=h.bO.convert(s.center||Ye);this._normalizeCenter(vt),ae=_.project(Ye),ie=_.project(vt).sub(ae)}const ce=_.zoomScale(B-v);let de,be;s.around&&(de=h.bO.convert(s.around),be=_.locationPoint(de));const De=this._zooming||B!==v,Te=this._rotating||C!==U,Le=this._pitching||H!==D,Me=!_.isPaddingEqual(G),Pe=!1===s.retainPadding?_.clone():_,Ae=Ye=>vt=>{if(De&&(Ye.zoom=h.af(v,B,vt)),Te&&(Ye.bearing=h.af(C,U,vt)),Le&&(Ye.pitch=h.af(D,H,vt)),Me&&(Pe.interpolatePadding(O,G,vt),Q=Pe.centerPoint.add(W)),de)Ye.setLocationAtPoint(de,be);else{const Ke=Ye.zoomScale(Ye.zoom-v),Mt=B>v?Math.min(2,ce):Math.max(.5,ce),Rt=Math.pow(Mt,1-vt),nt=Ye.unproject(ae.add(ie.mult(vt*Rt)).mult(Ke));Ye.setLocationAtPoint(Ye.renderWorldCopies?nt.wrap():nt,Q)}return s.preloadOnly||this._fireMoveEvents(c),Ye};if(s.preloadOnly){const Ye=this._emulate(Ae,s.duration,_);return this._preloadTiles(Ye),this}const Ve={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=De,this._rotating=Te,this._pitching=Le,this._padding=Me,this._easeId=s.easeId,this._prepareEase(c,s.noMoveStart,Ve),this._ease(Ae(_),Ye=>{"sea"===_.cameraElevationReference&&_.recenterOnTerrain(),this._afterEase(c,Ye)},s),this}_prepareEase(s,c,_={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),c||_.moving||this.fire(new h.z("movestart",s)),this._zooming&&!_.zooming&&this.fire(new h.z("zoomstart",s)),this._rotating&&!_.rotating&&this.fire(new h.z("rotatestart",s)),this._pitching&&!_.pitching&&this.fire(new h.z("pitchstart",s))}_fireMoveEvents(s){this.fire(new h.z("move",s)),this._zooming&&this.fire(new h.z("zoom",s)),this._rotating&&this.fire(new h.z("rotate",s)),this._pitching&&this.fire(new h.z("pitch",s))}_afterEase(s,c){if(this._easeId&&c&&this._easeId===c)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const _=this._zooming,v=this._rotating,C=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,_&&this.fire(new h.z("zoomend",s)),v&&this.fire(new h.z("rotateend",s)),C&&this.fire(new h.z("pitchend",s)),this.fire(new h.z("moveend",s))}flyTo(s,c){if(this._prefersReducedMotion(s)){const xt=h.ay(s,["center","zoom","bearing","pitch","around","padding","retainPadding"]);return this.jumpTo(xt,c)}this.stop(),s=h.l({offset:[0,0],speed:1.2,curve:1.42,easing:h.dA},s);const _=this.transform,v=this.getZoom(),C=this.getBearing(),D=this.getPitch(),O=this.getPadding(),B="zoom"in s?h.aw(+s.zoom,_.minZoom,_.maxZoom):v,U="bearing"in s?this._normalizeBearing(s.bearing,C):C,H="pitch"in s?+s.pitch:D,G=this._extendPadding(s.padding),W=_.zoomScale(B-v),Q=h.P.convert(s.offset);let ae=_.centerPoint.add(Q);const ie=_.pointLocation(ae),ce=h.bO.convert(s.center||ie);this._normalizeCenter(ce);const de=_.project(ie),be=_.project(ce).sub(de);let De=s.curve;const Te=Math.max(_.width,_.height),Le=Te/W,Me=be.mag();if("minZoom"in s){const xt=h.aw(Math.min(s.minZoom,v,B),_.minZoom,_.maxZoom),rn=Te/_.zoomScale(xt-v);De=Math.sqrt(rn/Me*2)}const Pe=De*De;function Ae(xt){const rn=(Le*Le-Te*Te+(xt?-1:1)*Pe*Pe*Me*Me)/(2*(xt?Le:Te)*Pe*Me);return Math.log(Math.sqrt(rn*rn+1)-rn)}function Ve(xt){return(Math.exp(xt)-Math.exp(-xt))/2}function Ye(xt){return(Math.exp(xt)+Math.exp(-xt))/2}const vt=Ae(0);let Ke=function(xt){return Ye(vt)/Ye(vt+De*xt)},Mt=function(xt){return Te*((Ye(vt)*(Ve(rn=vt+De*xt)/Ye(rn))-Ve(vt))/Pe)/Me;var rn},Rt=(Ae(1)-vt)/De;if(Math.abs(Me)<1e-6||!isFinite(Rt)){if(Math.abs(Te-Le)<1e-6)return this.easeTo(s,c);const xt=Les.maxDuration&&(s.duration=0);const nt=C!==U,wt=H!==D,Ut=!_.isPaddingEqual(G),tt=!1===s.retainPadding?_.clone():_,zt=xt=>rn=>{const $t=rn*Rt,Ft=1/Ke($t);xt.zoom=1===rn?B:v+xt.scaleZoom(Ft),nt&&(xt.bearing=h.af(C,U,rn)),wt&&(xt.pitch=h.af(D,H,rn)),Ut&&(tt.interpolatePadding(O,G,rn),ae=tt.centerPoint.add(Q));const Kt=1===rn?ce:xt.unproject(de.add(be.mult(Mt($t))).mult(Ft));return xt.setLocationAtPoint(xt.renderWorldCopies?Kt.wrap():Kt,ae),xt._updateCameraOnTerrain(),s.preloadOnly||this._fireMoveEvents(c),xt};if(s.preloadOnly){const xt=this._emulate(zt,s.duration,_);return this._preloadTiles(xt),this}return this._zooming=!0,this._rotating=nt,this._pitching=wt,this._padding=Ut,this._prepareEase(c,!1),this._ease(zt(_),()=>this._afterEase(c),s),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(s){}_cancelRenderFrame(s){}_stop(s,c){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const _=this._onEaseEnd;this._onEaseEnd=void 0,_.call(this,c)}if(!s){const _=this.handlers;_&&_.stop(!1)}return this}_ease(s,c,_){!1===_.animate||0===_.duration?(s(1),c()):(this._easeStart=h.q.now(),this._easeOptions=_,this._onEaseFrame=s,this._onEaseEnd=c,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const s=Math.min((h.q.now()-this._easeStart)/this._easeOptions.duration,1),c=this._onEaseFrame;c&&c(this._easeOptions.easing(s)),s<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(s,c){s=h.bF(s,-180,180);const _=Math.abs(s-c);return Math.abs(s-360-c)<_&&(s-=360),Math.abs(s+360-c)<_&&(s+=360),s}_normalizeCenter(s){const c=this.transform;if(c.maxBounds||"globe"!==c.projection.name&&!c.renderWorldCopies)return;const _=s.lng-c.center.lng;s.lng+=_>180?-360:_<-180?360:0}_prefersReducedMotion(s){return this._respectPrefersReducedMotion&&h.q.prefersReducedMotion&&!(s&&s.essential)}_emulate(s,c,_){const v=Math.ceil(15*c/1e3),C=[],D=s(_.clone());for(let O=0;O<=v;O++){const B=D(O/v);C.push(B.clone())}return C}_preloadTiles(s,c){}}class Sm{constructor(s={}){this.options=s,h.aP(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(s){const c=this.options&&this.options.compact,_=s._getUIString("AttributionControl.ToggleAttribution");this._map=s,this._container=vn("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=vn("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",_);const v=vn("span","mapboxgl-ctrl-icon",this._compactButton);return v.setAttribute("aria-hidden","true"),v.setAttribute("title",_),this._innerContainer=vn("div","mapboxgl-ctrl-attrib-inner",this._container),c&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===c&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let s=this._editLink;s||(s=this._editLink=this._container.querySelector(".mapbox-improve-map"));const c=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||h.e.ACCESS_TOKEN}];if(s){const _=c.reduce((v,C,D)=>(C.value&&(v+=`${C.key}=${C.value}${Dv.length-C.length),s=s.filter((v,C)=>{for(let D=C+1;D=0)return!1;return!0}),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?s=[...this.options.customAttribution,...s]:s.unshift(this.options.customAttribution));const _=s.join(" | ");_!==this._attribHTML&&(this._attribHTML=_,s.length?(this._innerContainer.innerHTML=_,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Tl{constructor(){h.aP(["_updateLogo","_updateCompact"],this)}onAdd(s){this._map=s,this._container=vn("div","mapboxgl-ctrl");const c=vn("a","mapboxgl-ctrl-logo");return c.target="_blank",c.rel="noopener nofollow",c.href="https://www.mapbox.com/",c.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),c.setAttribute("rel","noopener nofollow"),this._container.appendChild(c),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(s){s&&"metadata"!==s.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const s=this._map.style._sourceCaches;if(0===Object.entries(s).length)return!0;for(const c in s){const _=s[c].getSource();if(_.hasOwnProperty("mapbox_logo")&&!_.mapbox_logo)return!1}return!0}_updateCompact(){const s=this._container.children;if(s.length){const c=s[0];this._map.getCanvasContainer().offsetWidth<250?c.classList.add("mapboxgl-compact"):c.classList.remove("mapboxgl-compact")}}}class jc{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(s){const c=++this._id;return this._queue.push({callback:s,id:c,cancelled:!1}),c}remove(s){const c=this._currentlyRunning,_=c?this._queue.concat(c):this._queue;for(const v of _)if(v.id===s)return void(v.cancelled=!0)}run(s=0){const c=this._currentlyRunning=this._queue;this._queue=[];for(const _ of c)if(!_.cancelled&&(_.callback(s),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}class Ip{constructor(s){this.jumpTo(s)}getValue(s){if(s<=this._startTime)return this._start;if(s>=this._endTime)return this._end;const c=h.cB((s-this._startTime)/(this._endTime-this._startTime));return this._start*(1-c)+this._end*c}isEasing(s){return s>=this._startTime&&s<=this._endTime}jumpTo(s){this._startTime=-1/0,this._endTime=-1/0,this._start=s,this._end=s}easeTo(s,c,_){this._start=this.getValue(c),this._end=s,this._startTime=c,this._endTime=c+_}}const Mh={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class Ep extends h.z{constructor(s,c,_,v){const{point:C,lngLat:D,originalEvent:O,target:B}=s;super(s.type,{point:C,lngLat:D,originalEvent:O,target:B}),this.preventDefault=()=>{s.preventDefault()},this.id=c,this.interaction=_,this.feature=v}}class $c{constructor(s){this.map=s,this.interactionsByType=new Map,this.delegatedInteractions=new Map,this.typeById=new Map,this.filters=new Map,this.handleType=this.handleType.bind(this),this.handleMove=this.handleMove.bind(this),this.handleOut=this.handleOut.bind(this),this.hoveredFeatures=new Map,this.prevHoveredFeatures=new Map}add(s,c){if(this.typeById.has(s))throw new Error(`Interaction id "${s}" already exists.`);const _=c.filter;let v=c.type;_&&this.filters.set(s,h.aZ(_)),"mouseover"===v&&(v="mouseenter"),"mouseout"===v&&(v="mouseleave");const C=this.interactionsByType.get(v)||new Map;"mouseenter"===v||"mouseleave"===v?(0===this.delegatedInteractions.size&&(this.map.on("mousemove",this.handleMove),this.map.on("mouseout",this.handleOut)),this.delegatedInteractions.set(s,c)):0===C.size&&this.map.on(v,this.handleType),0===C.size&&this.interactionsByType.set(v,C),C.set(s,c),this.typeById.set(s,v)}get(s){const c=this.typeById.get(s);if(!c)return;const _=this.interactionsByType.get(c);return _?_.get(s):void 0}remove(s){const c=this.typeById.get(s);if(!c)return;this.typeById.delete(s),this.filters.delete(s);const _=this.interactionsByType.get(c);_&&(_.delete(s),"mouseenter"===c||"mouseleave"===c?(this.delegatedInteractions.delete(s),0===this.delegatedInteractions.size&&(this.map.off("mousemove",this.handleMove),this.map.off("mouseout",this.handleOut))):0===_.size&&this.map.off(c,this.handleType))}queryTargets(s,c){const _=[];for(const[v,C]of c)C.target&&_.push({targetId:v,target:C.target,filter:this.filters.get(v)});return this.map.style.queryRenderedTargets(s,_,this.map.transform)}handleMove(s){this.prevHoveredFeatures=this.hoveredFeatures,this.hoveredFeatures=new Map;const c=this.queryTargets(s.point,Array.from(this.delegatedInteractions).reverse());c.length&&(s.type="mouseenter",this.handleType(s,c));const _=new Map;for(const[v,{feature:C}]of this.prevHoveredFeatures)this.hoveredFeatures.has(v)||_.set(C.id,C);_.size&&(s.type="mouseleave",this.handleType(s,Array.from(_.values())))}handleOut(s){const c=Array.from(this.hoveredFeatures.values()).map(({feature:_})=>_);c.length&&(s.type="mouseleave",this.handleType(s,c)),this.hoveredFeatures.clear()}handleType(s,c){const _=Array.from(this.interactionsByType.get(s.type)).reverse(),v=!!c;c=c||this.queryTargets(s.point,_);const C="mouseenter"===s.type;let D=!1;const O=new Set;for(const B of c){for(const[U,H]of _){if(!H.target)continue;const G=B.variants?B.variants[U]:null;if(G){for(const W of G){if(Wr(W,B,O,U))continue;const Q=new h.cw(B,W),ae=Nc(W,B,U);v&&(Q.state=this.map.getFeatureState(Q));const ie=C?this.prevHoveredFeatures.get(ae):null,ce=new Ep(s,U,H,Q),de=ie?ie.stop:H.handler(ce);if(C&&this.hoveredFeatures.set(ae,{feature:B,stop:de}),!1!==de){D=!0;break}}if(D)break}}if(D)break}if(!D)for(const[B,U]of _){const{handler:H,target:G}=U;if(!G&&!1!==H(new Ep(s,B,U,null)))break}}}function Co(f,s){if(Array.isArray(f)&&Array.isArray(s)){const c=new Set(f),_=new Set(s);return c.size===_.size&&f.every(v=>_.has(v))}return h.bn(f,s)}const kd={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0,scaleFactor:1,spriteFormat:"auto"},hy={showCompass:!0,showZoom:!0,visualizePitch:!1};class U0{constructor(s,c,_=!1){this._clickTolerance=10,this.element=c,this.mouseRotate=new Id({clickTolerance:s.dragRotate._mouseRotate._clickTolerance}),this.map=s,_&&(this.mousePitch=new xm({clickTolerance:s.dragRotate._mousePitch._clickTolerance})),h.aP(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),c.addEventListener("mousedown",this.mousedown),c.addEventListener("touchstart",this.touchstart,{passive:!1}),c.addEventListener("touchmove",this.touchmove),c.addEventListener("touchend",this.touchend),c.addEventListener("touchcancel",this.reset)}down(s,c){this.mouseRotate.mousedown(s,c),this.mousePitch&&this.mousePitch.mousedown(s,c),Dn()}move(s,c){const _=this.map,v=this.mouseRotate.mousemoveWindow(s,c),C=v&&v.bearingDelta;if(C&&_.setBearing(_.getBearing()+C),this.mousePitch){const D=this.mousePitch.mousemoveWindow(s,c),O=D&&D.pitchDelta;O&&_.setPitch(_.getPitch()+O)}}off(){const s=this.element;s.removeEventListener("mousedown",this.mousedown),s.removeEventListener("touchstart",this.touchstart,{passive:!1}),s.removeEventListener("touchmove",this.touchmove),s.removeEventListener("touchend",this.touchend),s.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){yi(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(s){this.down(h.l({},s,{ctrlKey:!0,preventDefault:()=>s.preventDefault()}),Ji(this.element,s)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(s){this.move(s,Ji(this.element,s))}mouseup(s){this.mouseRotate.mouseupWindow(s),this.mousePitch&&this.mousePitch.mouseupWindow(s),this.offTemp()}touchstart(s){1!==s.targetTouches.length?this.reset():(this._startPos=this._lastPos=$o(this.element,s.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>s.preventDefault()},this._startPos))}touchmove(s){1!==s.targetTouches.length?this.reset():(this._lastPos=$o(this.element,s.targetTouches)[0],this.move({preventDefault:()=>s.preventDefault()},this._lastPos))}touchend(s){0===s.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)c.width||s.y>c.height;c.locationPoint(_).distSqr(s)180;){const _=c.locationPoint(f);if(_.x>=0&&_.y>=0&&_.x<=c.width&&_.y<=c.height)break;f.lng>c.center.lng?f.lng-=360:f.lng+=360}return f}const Gc={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Rd extends h.E{constructor(s,c){if(super(),(s instanceof HTMLElement||c)&&(s=h.l({element:s},c)),h.aP(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=s&&s.anchor||"center",this._color=s&&s.color||"#3FB1CE",this._scale=s&&s.scale||1,this._draggable=s&&s.draggable||!1,this._clickTolerance=s&&s.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=s&&s.rotation||0,this._rotationAlignment=s&&s.rotationAlignment||"auto",this._pitchAlignment=s&&s.pitchAlignment&&s.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=s&&s.occludedOpacity||.2,s&&s.element)this._element=s.element,this._offset=h.P.convert(s&&s.offset||[0,0]);else{this._defaultMarker=!0,this._element=vn("div");const C=41,D=27,O=un("svg",{display:"block",height:C*this._scale+"px",width:D*this._scale+"px",viewBox:`0 0 ${D} ${C}`},this._element),B=un("radialGradient",{id:"shadowGradient"},un("defs",{},O));un("stop",{offset:"10%","stop-opacity":.4},B),un("stop",{offset:"100%","stop-opacity":.05},B),un("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},O),un("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},O),un("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},O),un("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},O),this._offset=h.P.convert(s&&s.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",C=>{C.preventDefault()}),this._element.addEventListener("mousedown",C=>{C.preventDefault()});const _=this._element.classList;for(const C in Gc)_.remove(`mapboxgl-marker-anchor-${C}`);_.add(`mapboxgl-marker-anchor-${this._anchor}`);const v=s&&s.className?s.className.trim().split(/\s+/):[];_.add(...v),this._popup=null}addTo(s){return s===this._map||(this.remove(),this._map=s,s.getCanvasContainer().appendChild(this._element),s.on("move",this._updateMoving),s.on("moveend",this._update),s.on("remove",this._clearFadeTimer),s._addMarker(this),this.setDraggable(this._draggable),this._update(),s.on("click",this._onMapClick)),this}remove(){const s=this._map;return s&&(s.off("click",this._onMapClick),s.off("move",this._updateMoving),s.off("moveend",this._update),s.off("mousedown",this._addDragHandler),s.off("touchstart",this._addDragHandler),s.off("mouseup",this._onUp),s.off("touchend",this._onUp),s.off("mousemove",this._onMove),s.off("touchmove",this._onMove),s.off("remove",this._clearFadeTimer),s._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(s){return this._lngLat=h.bO.convert(s),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(s){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),s){if(!("offset"in s.options)){const v=Math.sqrt(Math.pow(13.5,2)/2);s.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[v,-1*(24.6+v)],"bottom-right":[-v,-1*(24.6+v)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=s,s._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(s){const c=s.code,_=s.charCode||s.keyCode;"Space"!==c&&"Enter"!==c&&32!==_&&13!==_||this.togglePopup()}_onMapClick(s){const c=s.originalEvent.target,_=this._element;this._popup&&(c===_||_.contains(c))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const s=this._popup;return s?(s.isOpen()?(s.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(s.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const s=this._map,c=this._pos;if(!s||!c)return!1;const _=s.unproject(c),v=s.getFreeCameraOptions();if(!v.position)return!1;const C=v.position.toLngLat();return C.distanceTo(_)<.9*C.distanceTo(this._lngLat)}_evaluateOpacity(){const s=this._map;if(!s)return;const c=this._pos;if(!c||c.x<0||c.x>s.transform.width||c.y<0||c.y>s.transform.height)return void this._clearFadeTimer();const _=s.unproject(c);let v;s._showingGlobe()&&h.dH(s.transform,this._lngLat)?v=0:(v=1-s._queryFogOpacity(_),s.transform._terrainEnabled()&&s.getTerrain()&&this._behindTerrain()&&(v*=this._occludedOpacity)),this._element.style.opacity=`${v}`,this._element.style.pointerEvents=v>0?"auto":"none",this._popup&&this._popup._setOpacity(v),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const s=this._pos;if(!s||!this._map)return;const c=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${s.x}px,${s.y}px)\n ${Gc[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${c.x}px,${c.y}px)\n `}_calculateXYTransform(){const s=this._pos,c=this._map,_=this.getPitchAlignment();if(!c||!s||"map"!==_)return"";if(!c._showingGlobe()){const B=c.getPitch();return B?`rotateX(${B}deg)`:""}const v=h.c4(h.dI(c.transform,this._lngLat)),C=s.sub(h.dJ(c.transform)),D=Math.abs(C.x)+Math.abs(C.y);if(0===D)return"";const O=v/D;return`rotateX(${-C.y*O}deg) rotateY(${C.x*O}deg)`}_calculateZTransform(){const s=this._pos,c=this._map;if(!c||!s)return"";let _=0;const v=this.getRotationAlignment();if("map"===v)if(c._showingGlobe()){const C=c.project(new h.bO(this._lngLat.lng,this._lngLat.lat+.001)),D=c.project(new h.bO(this._lngLat.lng,this._lngLat.lat-.001)).sub(C);_=h.c4(Math.atan2(D.y,D.x))-90}else _=-c.getBearing();else if("horizon"===v){const C=h.ac(4,6,c.getZoom()),D=h.dJ(c.transform);D.y+=C*c.transform.height;const O=s.sub(D),B=h.c4(Math.atan2(O.y,O.x));_=(B>90?B-270:B+90)*(1-C)}return _+=this._rotation,_?`rotateZ(${_}deg)`:""}_update(s){cancelAnimationFrame(this._updateFrameId);const c=this._map;c&&(c.transform.renderWorldCopies&&(this._lngLat=Mp(this._lngLat,this._pos,c.transform)),this._pos=c.project(this._lngLat),!0===s?this._updateFrameId=requestAnimationFrame(()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())}):this._pos=this._pos.round(),c._requestDomTask(()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(c._showingGlobe()||c.getTerrain()||c.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))}))}getOffset(){return this._offset}setOffset(s){return this._offset=h.P.convert(s),this._update(),this}addClassName(s){return this._element.classList.add(s),this}removeClassName(s){return this._element.classList.remove(s),this}toggleClassName(s){return this._element.classList.toggle(s)}_onMove(s){const c=this._map;if(!c)return;const _=this._pointerdownPos,v=this._positionDelta;if(_&&v){if(!this._isDragging){const C=this._clickTolerance||c._clickTolerance;if(s.point.dist(_)f.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=f.minPitch&&null!=f.maxPitch&&f.minPitch>f.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=f.minPitch&&f.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=f.maxPitch&&f.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(f.antialias&&h.dF(window)&&(f.antialias=!1,h.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new vf(f.minZoom,f.maxZoom,f.minPitch,f.maxPitch,f.renderWorldCopies),f),this._repaint=!!f.repaint,this._interactive=f.interactive,this._minTileCacheSize=f.minTileCacheSize,this._maxTileCacheSize=f.maxTileCacheSize,this._failIfMajorPerformanceCaveat=f.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=f.preserveDrawingBuffer,this._antialias=f.antialias,this._trackResize=f.trackResize,this._bearingSnap=f.bearingSnap,this._refreshExpiredTiles=f.refreshExpiredTiles,this._fadeDuration=f.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=f.crossSourceCollisions,this._collectResourceTiming=f.collectResourceTiming,this._language=this._parseLanguage(f.language),this._worldview=f.worldview,this._renderTaskQueue=new jc,this._domRenderTaskQueue=new jc,this._controls=[],this._markers=[],this._popups=[],this._mapId=h.aV(),this._locale=h.l({},Mh,f.locale),this._clickTolerance=f.clickTolerance,this._cooperativeGestures=f.cooperativeGestures,this._performanceMetricsCollection=f.performanceMetricsCollection,this._tessellationStep=f.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=f.precompilePrograms,this._scaleFactorChanged=!1,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Ip(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._scaleFactor=f.scaleFactor,this._requestManager=new qi(f.transformRequest,f.accessToken,f.testMode),this._silenceAuthErrors=!!f.testMode,this._contextCreateOptions=f.contextCreateOptions?Object.assign({},f.contextCreateOptions):{},"string"==typeof f.container){const c=document.getElementById(f.container);if(!c)throw new Error(`Container '${f.container.toString()}' not found.`);this._container=c}else{if(!(f.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=f.container}if(this._container.childNodes.length>0&&h.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),f.maxBounds&&this.setMaxBounds(f.maxBounds),this._spriteFormat=f.spriteFormat,h.aP(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new bp),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},()=>{this._update()}),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._tp.registerParameter(this,["Scaling"],"_scaleFactor",{min:.1,max:10,step:.1},()=>{this.setScaleFactor(this._scaleFactor)}),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Cm(this,f),this._localFontFamily=f.localFontFamily,this._localIdeographFontFamily=f.localIdeographFontFamily,(f.style||!f.testMode)&&this.setStyle(f.style||h.e.DEFAULT_STYLE,{config:f.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),f.projection&&this.setProjection(f.projection),this.indoor=new ip(this),f.hash&&(this._hash=new sy("string"==typeof f.hash&&f.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==s.center&&null==s.zoom||(this.transform._unmodified=!1),this.jumpTo({center:f.center,zoom:f.zoom,bearing:f.bearing,pitch:f.pitch});const c=f.bounds;c&&(this.resize(),this.fitBounds(c,h.l({},f.fitBoundsOptions,{duration:0})))}this.resize(),f.attributionControl&&this.addControl(new Sm({customAttribution:f.customAttribution})),this._logoControl=new Tl,this.addControl(this._logoControl,f.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()}),this.on("data",c=>{this._update("style"===c.dataType),this.fire(new h.z(`${c.dataType}data`,c))}),this.on("dataloading",c=>{this.fire(new h.z(`${c.dataType}dataloading`,c))}),this._interactions=new $c(this)}_getMapId(){return this._mapId}addControl(f,s){if(void 0===s&&(s=f.getDefaultPosition?f.getDefaultPosition():"top-right"),!f||!f.onAdd)return this.fire(new h.y(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const c=f.onAdd(this);this._controls.push(f);const _=this._controlPositions[s];return-1!==s.indexOf("bottom")?_.insertBefore(c,_.firstChild):_.appendChild(c),this}removeControl(f){if(!f||!f.onRemove)return this.fire(new h.y(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const s=this._controls.indexOf(f);return s>-1&&this._controls.splice(s,1),f.onRemove(this),this}hasControl(f){return this._controls.indexOf(f)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(f){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const s=!this._moving;return s&&this.fire(new h.z("movestart",f)).fire(new h.z("move",f)),this.fire(new h.z("resize",f)),s&&this.fire(new h.z("moveend",f)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(f){return this.transform.setMaxBounds(h.az.convert(f)),this._update()}setMinZoom(f){if((f=f??-2)>=-2&&f<=this.transform.maxZoom)return this.transform.minZoom=f,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=f,this._update(),this.getZoom()>f?this.setZoom(f):this.fire(new h.z("zoomstart")).fire(new h.z("zoom")).fire(new h.z("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(f){if((f=f??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(f>=0&&f<=this.transform.maxPitch)return this.transform.minPitch=f,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(f>=this.transform.minPitch)return this.transform.maxPitch=f,this._update(),this.getPitch()>f?this.setPitch(f):this.fire(new h.z("pitchstart")).fire(new h.z("pitch")).fire(new h.z("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getScaleFactor(){return this._scaleFactor}setScaleFactor(f){return this._scaleFactor=f,this.painter.scaleFactor=f,this._tp.refreshUI(),this._scaleFactorChanged=!0,this.style._updateFilteredLayers(s=>"symbol"===s.type),this._update(!0),this}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(f){return this.transform.renderWorldCopies=f,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(f){return"auto"===f?navigator.language:Array.isArray(f)?0===f.length?void 0:f.map(s=>"auto"===s?navigator.language:s):f}setLanguage(f){const s=this._parseLanguage(f);if(!this.style||s===this._language)return this;this._language=s,this.style.reloadSources();for(const c of this._controls)c._setLanguage&&c._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(f){return this.style&&f!==this._worldview?(this._worldview=f,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(f){return this._lazyInitEmptyStyle(),f?"string"==typeof f&&(f={name:f}):f=null,this._useExplicitProjection=!!f,this._prioritizeAndUpdateProjection(f,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const f=this.transform,s=f.projection.name;let c;"globe"===s&&f.zoom>=h.bY?(f.setMercatorFromTransition(),c=!0):"mercator"===s&&f.zoom=h.bY?this.transform.setMercatorFromTransition():this.transform.setProjection(f),this.style.applyProjectionUpdate(),s&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(f){return this.transform.locationPoint3D(h.bO.convert(f))}unproject(f){return this.transform.pointLocation3D(h.P.convert(f))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(f,s,c){const _=v=>{let C=[];if(Array.isArray(s)){const D=s.filter(O=>this.getLayer(O));C=D.length?this.queryRenderedFeatures(v,{layers:D}):[]}else C=this.queryRenderedFeatures(v,{target:s});return C};if("mouseenter"===f||"mouseover"===f){let v=!1;return{listener:c,targets:s,delegates:{mousemove:D=>{const O=_(D.point);O.length?v||(v=!0,c.call(this,new Yl(f,this,D.originalEvent,{features:O}))):v=!1},mouseout:()=>{v=!1}}}}if("mouseleave"===f||"mouseout"===f){let v=!1;return{listener:c,targets:s,delegates:{mousemove:O=>{_(O.point).length?v=!0:v&&(v=!1,c.call(this,new Yl(f,this,O.originalEvent)))},mouseout:O=>{v&&(v=!1,c.call(this,new Yl(f,this,O.originalEvent)))}}}}{const v=C=>{const D=_(C.point);D.length&&(C.features=D,c.call(this,C),delete C.features)};return{listener:c,targets:s,delegates:{[f]:v}}}}on(f,s,c){if("function"==typeof s||void 0===c)return super.on(f,s);if("string"==typeof s&&(s=[s]),!this._areTargetsValid(s))return this;const _=this._createDelegatedListener(f,s,c);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[f]=this._delegatedListeners[f]||[],this._delegatedListeners[f].push(_);for(const v in _.delegates)this.on(v,_.delegates[v]);return this}once(f,s,c){if("function"==typeof s||void 0===c)return super.once(f,s);if("string"==typeof s&&(s=[s]),!this._areTargetsValid(s))return this;const _=this._createDelegatedListener(f,s,c);for(const v in _.delegates)this.once(v,_.delegates[v]);return this}off(f,s,c){if("function"==typeof s||void 0===c)return super.off(f,s);if("string"==typeof s&&(s=[s]),!this._areTargetsValid(s))return this;const _=this._delegatedListeners?this._delegatedListeners[f]:void 0;return _&&(v=>{for(let C=0;C{c?(h.w(`Unable to perform style diff: ${String(c.message||c.error||c)}. Rebuilding the style from scratch.`),this._updateStyle(f,s)):_&&this._update(!0)},()=>{this._postStyleLoadEvent()}),this):(this._localIdeographFontFamily=s.localIdeographFontFamily,this._localFontFamily=s.localFontFamily,this._updateStyle(f,s))}_getUIString(f){const s=this._locale[f];if(null==s)throw new Error(`Missing UI string '${f}'`);return s}_updateStyle(f,s){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),f){const c=h.l({},s);s&&s.config&&(c.initialConfig=s.config,delete c.config),this.style=new co(this,c).load(f),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new co(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(h.w("There is no style added to the map."),!1)}_isValidId(f){return null==f?(this.fire(new h.y(new Error("IDs can't be empty."))),!1):!h.cr(f)||(this.fire(new h.y(new Error(`IDs can't contain special symbols: "${f}".`))),!1)}_isTargetValid(f){return"featuresetId"in f?this._isValidId("importId"in f?f.importId:f.featuresetId):"layerId"in f&&this._isValidId(f.layerId)}_areTargetsValid(f){if(Array.isArray(f)){for(const s of f)if(!this._isValidId(s))return!1;return!0}return this._isTargetValid(f)}addSource(f,s){return this._isValidId(f)?(this._lazyInitEmptyStyle(),this.style.addSource(f,s),this._update(!0)):this}isSourceLoaded(f){return!!this._isValidId(f)&&!!this.style&&this.style._isSourceCacheLoaded(f)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(f,s,c){this._lazyInitEmptyStyle(),this.style.addSourceType(f,s,c)}removeSource(f){return this._isValidId(f)?(this.style.removeSource(f),this._updateTerrain(),this._update(!0)):this}getSource(f){return this._isValidId(f)?this.style.getOwnSource(f):null}addImage(f,s,{pixelRatio:c=1,sdf:_=!1,stretchX:v,stretchY:C,content:D}={}){if(this._lazyInitEmptyStyle(),s instanceof HTMLImageElement||ImageBitmap&&s instanceof ImageBitmap){const{width:O,height:B,data:U}=h.q.getImageData(s);this.style.addImage(f,{data:new h.r({width:O,height:B},U),pixelRatio:c,stretchX:v,stretchY:C,content:D,sdf:_,version:0,usvg:!1})}else if(void 0===s.width||void 0===s.height)this.fire(new h.y(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:O,height:B}=s,U=s;this.style.addImage(f,{data:new h.r({width:O,height:B},new Uint8Array(U.data)),pixelRatio:c,stretchX:v,stretchY:C,content:D,sdf:_,usvg:!1,version:0,userImage:U}),U.onAdd&&U.onAdd(this,f)}}updateImage(f,s){this._lazyInitEmptyStyle();const c=this.style.getImage(f);if(!c)return void this.fire(new h.y(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const _=s instanceof HTMLImageElement||ImageBitmap&&s instanceof ImageBitmap?h.q.getImageData(s):s,{width:v,height:C,data:D}=_;if(void 0===v||void 0===C)return void this.fire(new h.y(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(v!==(c.usvg?c.icon.usvg_tree.width:c.data.width)||C!==(c.usvg?c.icon.usvg_tree.height:c.data.height))return void this.fire(new h.y(new Error(`The width and height of the updated image (${v}, ${C})\n must be that same as the previous version of the image\n (${c.data.width}, ${c.data.height})`)));const O=!(s instanceof HTMLImageElement||ImageBitmap&&s instanceof ImageBitmap);let B=!1;c.usvg?(c.data=new h.r({width:v,height:C},new Uint8Array(D)),c.usvg=!1,c.icon=void 0,B=!0):c.data.replace(D,O),this.style.updateImage(f,c,B)}hasImage(f){return f?!!this.style&&!!this.style.getImage(f):(this.fire(new h.y(new Error("Missing required image id"))),!1)}removeImage(f){this.style.removeImage(f)}loadImage(f,s){h.o(this._requestManager.transformRequest(f,h.R.Image),(c,_)=>{s(c,_ instanceof HTMLImageElement?h.q.getImageData(_):_)})}listImages(){return this.style.listImages()}addModel(f,s){this._lazyInitEmptyStyle(),this.style.addModel(f,s)}hasModel(f){return f?this.style.hasModel(f):(this.fire(new h.y(new Error("Missing required model id"))),!1)}removeModel(f){this.style.removeModel(f)}listModels(){return this.style.listModels()}addLayer(f,s){return this._isValidId(f.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(f,s),this._update(!0)):this}getSlot(f){const s=this.getLayer(f);return s&&s.slot||null}setSlot(f,s){return this.style.setSlot(f,s),this.style.mergeLayers(),this._update(!0)}addImport(f,s){return this.style.addImport(f,s),this}updateImport(f,s){return"string"!=typeof s&&s.id!==f?(this.removeImport(f),this.addImport(s)):(this.style.updateImport(f,s),this._update(!0))}removeImport(f){return this.style.removeImport(f),this}moveImport(f,s){return this.style.moveImport(f,s),this._update(!0)}moveLayer(f,s){return this._isValidId(f)?(this.style.moveLayer(f,s),this._update(!0)):this}removeLayer(f){return this._isValidId(f)?(this.style.removeLayer(f),this._update(!0)):this}getLayer(f){if(!this._isValidId(f))return null;const s=this.style.getOwnLayer(f);return s?"custom"===s.type?s.implementation:s.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(f,s,c){return this._isValidId(f)?(this.style.setLayerZoomRange(f,s,c),this._update(!0)):this}setFilter(f,s,c={}){return this._isValidId(f)?(this.style.setFilter(f,s,c),this._update(!0)):this}getFilter(f){return this._isValidId(f)?this.style.getFilter(f):null}setPaintProperty(f,s,c,_={}){return this._isValidId(f)?(this.style.setPaintProperty(f,s,c,_),this._update(!0)):this}getPaintProperty(f,s){return this._isValidId(f)?this.style.getPaintProperty(f,s):null}setLayoutProperty(f,s,c,_={}){return this._isValidId(f)?(this.style.setLayoutProperty(f,s,c,_),this._update(!0)):this}getLayoutProperty(f,s){return this._isValidId(f)?this.style.getLayoutProperty(f,s):null}getSchema(f){return this.style.getSchema(f)}setSchema(f,s){return this.style.setSchema(f,s),this._update(!0)}getConfig(f){return this.style.getConfig(f)}setConfig(f,s){return this.style.setConfig(f,s),this._update(!0)}getConfigProperty(f,s){return this.style.getConfigProperty(f,s)}setConfigProperty(f,s,c){return this.style.setConfigProperty(f,s,c),this._update(!0)}getFeaturesetDescriptors(f){return this.style.getFeaturesetDescriptors(f)}setLights(f){if(this._lazyInitEmptyStyle(),f&&1===f.length&&"flat"===f[0].type){const s=f[0];s.properties?this.style.setFlatLight(s.properties,s.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(f),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const f=this.style.getLights()||[];return 0===f.length&&f.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),f}setLight(f,s={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:f}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(f){return this._lazyInitEmptyStyle(),!f&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(f),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(f){return this._lazyInitEmptyStyle(),this.style.setFog(f),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setSnow(f){return this._lazyInitEmptyStyle(),this.style.setSnow(f),this._update(!0)}getSnow(){return this.style?this.style.getSnow():null}setRain(f){return this._lazyInitEmptyStyle(),this.style.setRain(f),this._update(!0)}getRain(){return this.style?this.style.getRain():null}setColorTheme(f){return this._lazyInitEmptyStyle(),this.style.setColorTheme(f),this._update(!0)}setImportColorTheme(f,s){return this._lazyInitEmptyStyle(),this.style.setImportColorTheme(f,s),this._update(!0)}setCamera(f){return this.style.setCamera(f),this._triggerCameraUpdate(f)}_triggerCameraUpdate(f){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===f["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(f){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(h.bO.convert(f),this.transform):0}setFeatureState(f,s){return f.source&&!this._isValidId(f.source)?this:(this.style.setFeatureState(f,s),this._update())}removeFeatureState(f,s){return f.source&&!this._isValidId(f.source)?this:(this.style.removeFeatureState(f,s),this._update())}getFeatureState(f){return f.source&&!this._isValidId(f.source)?null:this.style.getFeatureState(f)}_updateContainerDimensions(){if(!this._container)return;const f=this._container.getBoundingClientRect().width||400,s=this._container.getBoundingClientRect().height||300;let c,_,v,C=this._container;for(;C&&(!_||!v);){const D=window.getComputedStyle(C).transform;D&&"none"!==D&&(c=D.match(/matrix.*\((.+)\)/)[1].split(", "),c[0]&&"0"!==c[0]&&"1"!==c[0]&&(_=c[0]),c[3]&&"0"!==c[3]&&"1"!==c[3]&&(v=c[3])),C=C.parentElement}this._containerWidth=_?Math.abs(f/_):f,this._containerHeight=v?Math.abs(s/v):s}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&h.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const f=this._container;f.classList.add("mapboxgl-map"),(this._missingCSSCanary=vn("div","mapboxgl-canary",f)).style.visibility="hidden",this._detectMissingCSS();const s=this._canvasContainer=vn("div","mapboxgl-canvas-container",f);this._canvas=vn("canvas","mapboxgl-canvas",s),this._interactive&&(s.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const c=this._controlContainer=vn("div","mapboxgl-control-container",f),_=this._controlPositions={};["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].forEach(v=>{_[v]=vn("div",`mapboxgl-ctrl-${v}`,c)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(f,s){const c=h.q.devicePixelRatio||1;this._canvas.width=c*Math.ceil(f),this._canvas.height=c*Math.ceil(s),this._canvas.style.width=`${f}px`,this._canvas.style.height=`${s}px`}_addMarker(f){this._markers.push(f)}_removeMarker(f){const s=this._markers.indexOf(f);-1!==s&&this._markers.splice(s,1)}_addPopup(f){this._popups.push(f)}_removePopup(f){const s=this._popups.indexOf(f);-1!==s&&this._popups.splice(s,1)}_setupPainter(){const f=h.l({},Fn.supported.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),s=this._canvas.getContext("webgl2",f);s?(yr(s,!0),this.painter=new Dd(s,this._contextCreateOptions,this.transform,this._scaleFactor,this._tp),this.on("data",c=>{"source"===c.dataType&&this.painter.setTileLoadedFlag(!0)}),h.m.testSupport(s)):this.fire(new h.y(new Error("Failed to initialize WebGL")))}_contextLost(f){f.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new h.z("webglcontextlost",{originalEvent:f}))}_contextRestored(f){this._setupPainter(),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight)),this._updateTerrain(),this.style.reloadModels(),this.style.clearSources(),this._update(),this.fire(new h.z("webglcontextrestored",{originalEvent:f}))}_onMapScroll(f){if(f.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(f){return this.style?(this._styleDirty=this._styleDirty||f,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(f){return this._update(),this._renderTaskQueue.add(f)}_cancelRenderFrame(f){this._renderTaskQueue.remove(f)}_requestDomTask(f){!this.loaded()||this.loaded()&&!this.isMoving()?f():this._domRenderTaskQueue.add(f)}_render(f){let s;this.fire(new h.z("renderstart")),++this._frameId;const c=this.painter.context.extTimerQuery,_=h.q.now(),v=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(s=v.createQuery(),v.beginQuery(c.TIME_ELAPSED_EXT,s)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(f),this._domRenderTaskQueue.run(f),this._removed)return;this._updateProjectionTransition();const C=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const U=this.transform.zoom,H=this.transform.pitch,G=h.q.now(),W=new h.a8(U,{now:G,fadeDuration:C,pitch:H,transition:this.style.transition});this.style.update(W)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let D=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),D=this._updateAverageElevation(_),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):D=this._updateAverageElevation(_);const O=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,C,this._crossSourceCollisions,this.painter.replacementSource,this._scaleFactorChanged);if(this._scaleFactorChanged&&(this._scaleFactorChanged=!1),O&&(this._placementDirty=O.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:C,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new h.z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,Pt.mark(Ot.load),this.fire(new h.z("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&(this.style.snow||this.style.rain)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),s){const U=h.q.now()-_;v.endQuery(c.TIME_ELAPSED_EXT),setTimeout(()=>{const H=v.getQueryParameter(s,v.QUERY_RESULT)/1e6;v.deleteQuery(s),this.fire(new h.z("gpu-timing-frame",{cpuTime:U,gpuTime:H}))},50)}if(this.listens("gpu-timing-layer")){const U=this.painter.collectGpuTimers();setTimeout(()=>{const H=this.painter.queryGpuTimers(U);this.fire(new h.z("gpu-timing-layer",{layerTimes:H}))},50)}if(this.listens("gpu-timing-deferred-render")){const U=this.painter.collectDeferredRenderGpuQueries();setTimeout(()=>{const H=this.painter.queryGpuTimeDeferredRender(U);this.fire(new h.z("gpu-timing-deferred-render",{gpuTime:H}))},50)}const B=this._sourcesDirty||this._styleDirty||this._placementDirty||D;if(B||this._repaint)this.triggerRepaint();else{const U=this.idle();if(U&&(D=this._updateAverageElevation(_,!0)),D)this.triggerRepaint();else if(this._triggerFrame(!1),U&&(this.fire(new h.z("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const H=this._calculateSpeedIndex();this.fire(new h.z("speedindexcompleted",{speedIndex:H})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||B||(this._fullyLoaded=!0,Pt.mark(Ot.fullLoad),this._performanceMetricsCollection&&Fs(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(f){for(const s of this._markers)f&&!this.getRenderWorldCopies()&&(s._lngLat=s._lngLat.wrap()),s._update();for(const s of this._popups)!f||this.getRenderWorldCopies()||s._trackPointer||(s._lngLat=s._lngLat.wrap()),s._update()}_updateAverageElevation(f,s=!1){const c=v=>(this.transform.averageElevation=v,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&c(0);const _=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(_||(s||f-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(f)){const v=this.transform.averageElevation;let C=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(C)?C=0:this._averageElevationLastSampledAt=f;const D=Math.abs(v-C);if(D>1){if(this._isInitialLoad||_)return this._averageElevation.jumpTo(C),c(C);this._averageElevation.easeTo(C,f,300)}else if(D>1e-4)return this._averageElevation.jumpTo(C),c(C)}return!!this._averageElevation.isEasing(f)&&c(this._averageElevation.getValue(f))}_authenticate(){Ze(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,f=>{if(f&&(f.message===ri||401===f.status)){const s=this.painter.context.gl;yr(s,!1),this._logoControl instanceof Tl&&this._logoControl._updateLogo(),s&&s.clear(s.DEPTH_BUFFER_BIT|s.COLOR_BUFFER_BIT|s.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new h.y(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}}),Oc(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,()=>{})}_postStyleLoadEvent(){this.style.globalId&&lr(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const f=this._isDragging();this.painter.updateTerrain(this.style,f)}_calculateSpeedIndex(){const f=this.painter.canvasCopy(),s=this.painter.getCanvasCopiesAndTimestamps();s.timeStamps.push(performance.now());const c=this.painter.context.gl,_=c.createFramebuffer();function v(C){c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,C,0);const D=new Uint8Array(c.drawingBufferWidth*c.drawingBufferHeight*4);return c.readPixels(0,0,c.drawingBufferWidth,c.drawingBufferHeight,c.RGBA,c.UNSIGNED_BYTE,D),D}return c.bindFramebuffer(c.FRAMEBUFFER,_),this._canvasPixelComparison(v(f),s.canvasCopies.map(v),s.timeStamps)}_canvasPixelComparison(f,s,c){let _=c[1]-c[0];const v=f.length/4;for(let C=0;C{const c=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,c&&this._render(s)}))}_preloadTiles(f){const s=this.style?this.style.getSourceCaches():[];return h.bl(s,(c,_)=>c._preloadTiles(f,_),()=>{this.triggerRepaint()}),this}_onWindowOnline(){this._update()}_onWindowResize(f){this._trackResize&&this.resize({originalEvent:f})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(f){this._showTileBoundaries!==f&&(this._showTileBoundaries=f,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(f){this._showParseStatus!==f&&(this._showParseStatus=f,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(f){this._showTerrainWireframe!==f&&(this._showTerrainWireframe=f,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(f){this._showLayers2DWireframe!==f&&(this._showLayers2DWireframe=f,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(f){this._showLayers3DWireframe!==f&&(this._showLayers3DWireframe=f,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(f){this._speedIndexTiming!==f&&(this._speedIndexTiming=f,this._update())}get showPadding(){return!!this._showPadding}set showPadding(f){this._showPadding!==f&&(this._showPadding=f,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(f){this._showCollisionBoxes!==f&&(this._showCollisionBoxes=f,this._tp.refreshUI(),f?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(f){this._showOverdrawInspector!==f&&(this._showOverdrawInspector=f,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(f){this._repaint!==f&&(this._repaint=f,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(f){this._vertices=f,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(f){this._showTileAABBs!==f&&(this._showTileAABBs=f,this._tp.refreshUI(),f&&this._update())}_setCacheLimits(f,s){h.dG(f,s)}get version(){return _t}},NavigationControl:class{constructor(f={}){this.options=h.l({},hy,f),this._container=vn("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",s=>s.preventDefault()),this.options.showZoom&&(h.aP(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",s=>{this._map&&this._map.zoomIn({},{originalEvent:s})}),vn("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",s=>{this._map&&this._map.zoomOut({},{originalEvent:s})}),vn("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(h.aP(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",s=>{const c=this._map;c&&(this.options.visualizePitch?c.resetNorthPitch({},{originalEvent:s}):c.resetNorth({},{originalEvent:s}))}),this._compassIcon=vn("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const f=this._map;if(!f)return;const s=f.getZoom(),c=s===f.getMaxZoom(),_=s===f.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=_,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",_.toString())}_rotateCompassArrow(){const f=this._map;if(!f)return;const s=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(f.transform.pitch*(Math.PI/180)),.5)}) rotateX(${f.transform.pitch}deg) rotateZ(${f.transform.angle*(180/Math.PI)}deg)`:`rotate(${f.transform.angle*(180/Math.PI)}deg)`;f._requestDomTask(()=>{this._compassIcon&&(this._compassIcon.style.transform=s)})}onAdd(f){return this._map=f,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),f.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&f.on("pitch",this._rotateCompassArrow),f.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new U0(f,this._compass,this.options.visualizePitch)),this._container}onRemove(){const f=this._map;f&&(this._container.remove(),this.options.showZoom&&f.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&f.off("pitch",this._rotateCompassArrow),f.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(f,s){const c=vn("button",f,this._container);return c.type="button",c.addEventListener("click",s),c}_setButtonTitle(f,s){if(!this._map)return;const c=this._map._getUIString(`NavigationControl.${s}`);f.setAttribute("aria-label",c),f.firstElementChild&&f.firstElementChild.setAttribute("title",c)}},GeolocateControl:class extends h.E{constructor(f={}){super();const s=navigator.geolocation;this.options=h.l({geolocation:s},sl,f),h.aP(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=mg(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(f){return this._map=f,this._container=vn("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(f){const s=(c=!!this.options.geolocation)=>{this._supportsGeolocation=c,f(c)};void 0!==this._supportsGeolocation?f(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(c=>s("denied"!==c.state)).catch(()=>s()):s()}_isOutOfMapMaxBounds(f){const s=this._map.getMaxBounds(),c=f.coords;return!!s&&(c.longitudes.getEast()||c.latitudes.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(f){if(this._map){if(this._isOutOfMapMaxBounds(f))return this._setErrorState(),this.fire(new h.z("outofmaxbounds",f)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=f,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(f),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(f),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new h.z("geolocate",f)),this._finish()}}_updateCamera(f){const s=new h.bO(f.coords.longitude,f.coords.latitude),c=f.coords.accuracy,_=this._map.getBearing(),v=h.l({bearing:_},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(c),v,{geolocateSource:!0})}_updateMarker(f){if(f){const s=new h.bO(f.coords.longitude,f.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=f.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const f=this._map.transform,s=h.bH(1,f._center.lat)*f.worldSize,c=Math.ceil(2*this._accuracy*s);this._circleElement.style.width=`${c}px`,this._circleElement.style.height=`${c}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(f){if(this._map){if(this.options.trackUserLocation)if(1===f.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",s),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",s),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===f.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new h.z("error",f)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(f){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",s=>s.preventDefault()),this._geolocateButton=vn("button","mapboxgl-ctrl-geolocate",this._container),vn("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===f){h.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",s),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",s),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",s)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=vn("div","mapboxgl-user-location"),this._dotElement.appendChild(vn("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(vn("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Rd({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=vn("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rd({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",s=>{s.geolocateSource||"ACTIVE_LOCK"!==this._watchState||s.originalEvent&&"resize"===s.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new h.z("trackuserlocationend")))})}}_onDeviceOrientation(f){this._userLocationDotMarker&&(f.webkitCompassHeading?this._heading=f.webkitCompassHeading:!0===f.absolute&&(this._heading=-1*f.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return h.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new h.z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new h.z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new h.z("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let f;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(f={maximumAge:6e5,timeout:0},this._noTimeout=!0):(f=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,f),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const f=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};typeof DeviceMotionEvent<"u"&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(s=>{"granted"===s&&f()}).catch(console.error):f()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Sm,ScaleControl:class{constructor(f={}){this.options=h.l({},Xl,f),this._isNumberFormatSupported=function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch{return!1}}(),h.aP(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const f=this.options.maxWidth||100,s=this._map,c=s._containerHeight/2,_=s._containerWidth/2-f/2,v=s.unproject([_,c]),C=s.unproject([_+f,c]),D=v.distanceTo(C);if("imperial"===this.options.unit){const O=3.2808*D;O>5280?this._setScale(f,O/5280,"mile"):this._setScale(f,O,"foot")}else"nautical"===this.options.unit?this._setScale(f,D/1852,"nautical-mile"):D>=1e3?this._setScale(f,D/1e3,"kilometer"):this._setScale(f,D,"meter")}_setScale(f,s,c){this._map._requestDomTask(()=>{const _=function(C){const D=Math.pow(10,`${Math.floor(C)}`.length-1);let O=C/D;return O=O>=10?10:O>=5?5:O>=3?3:O>=2?2:O>=1?1:function(B){const U=Math.pow(10,Math.ceil(-Math.log(B)/Math.LN10));return Math.round(B*U)/U}(O),D*O}(s),v=_/s;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==c?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:c}).format(_):`${_} ${ps[c]}`,this._container.style.width=f*v+"px"})}onAdd(f){return this._map=f,this._language=f.getLanguage(),this._container=vn("div","mapboxgl-ctrl mapboxgl-ctrl-scale",f.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(f){this._language=f,this._update()}setUnit(f){this.options.unit=f,this._update()}},FullscreenControl:class{constructor(f={}){this._fullscreen=!1,f&&f.container&&(f.container instanceof HTMLElement?this._container=f.container:h.w("Full screen control 'container' must be a DOM element.")),h.aP(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(f){return this._map=f,this._container||(this._container=this._map.getContainer()),this._controlContainer=vn("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",h.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const f=this._fullscreenButton=vn("button","mapboxgl-ctrl-fullscreen",this._controlContainer);vn("span","mapboxgl-ctrl-icon",f).setAttribute("aria-hidden","true"),f.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const f=this._getTitle();this._fullscreenButton.setAttribute("aria-label",f),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",f)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends h.E{constructor(f){super(),this.options=h.l(Object.create(py),f),h.aP(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(f&&f.className?f.className.trim().split(/\s+/):[])}addTo(f){return this._map&&this.remove(),this._map=f,this.options.closeOnClick&&f.on("preclick",this._onClose),this.options.closeOnMove&&f.on("move",this._onClose),f.on("remove",this.remove),this._update(),f._addPopup(this),this._focusFirstElement(),this._trackPointer?(f.on("mousemove",this._onMouseEvent),f.on("mouseup",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")):f.on("move",this._update),this.fire(new h.z("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const f=this._map;return f&&(f.off("move",this._update),f.off("move",this._onClose),f.off("preclick",this._onClose),f.off("click",this._onClose),f.off("remove",this.remove),f.off("mousemove",this._onMouseEvent),f.off("mouseup",this._onMouseEvent),f.off("drag",this._onMouseEvent),f._canvasContainer&&f._canvasContainer.classList.remove("mapboxgl-track-pointer"),f._removePopup(this),this._map=void 0),this.fire(new h.z("close")),this}getLngLat(){return this._lngLat}setLngLat(f){this._lngLat=h.bO.convert(f),this._pos=null,this._trackPointer=!1,this._update();const s=this._map;return s&&(s.on("move",this._update),s.off("mousemove",this._onMouseEvent),s._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const f=this._map;return f&&(f.off("move",this._update),f.on("mousemove",this._onMouseEvent),f.on("drag",this._onMouseEvent),f._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(f){return this.setDOMContent(document.createTextNode(f))}setHTML(f){const s=document.createDocumentFragment(),c=document.createElement("body");let _;for(c.innerHTML=f;_=c.firstChild,_;)s.appendChild(_);return this.setDOMContent(s)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(f){return this.options.maxWidth=f,this._update(),this}setDOMContent(f){let s=this._content;if(s)for(;s.hasChildNodes();)s.firstChild&&s.removeChild(s.firstChild);else s=this._content=vn("div","mapboxgl-popup-content",this._container||void 0);if(s.appendChild(f),this.options.closeButton){const c=this._closeButton=vn("button","mapboxgl-popup-close-button",s);c.type="button",c.setAttribute("aria-label","Close popup"),c.innerHTML='',c.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(f){return this._classList.add(f),this._updateClassList(),this}removeClassName(f){return this._classList.delete(f),this._updateClassList(),this}setOffset(f){return this.options.offset=f,this._update(),this}toggleClassName(f){let s;return this._classList.delete(f)?s=!1:(this._classList.add(f),s=!0),this._updateClassList(),s}_onMouseEvent(f){this._update(f.point)}_getAnchor(f){if(this.options.anchor)return this.options.anchor;const s=this._map,c=this._container,_=this._pos;if(!s||!c||!_)return"bottom";const v=c.offsetWidth,C=c.offsetHeight,D=_.xs.transform.width-v/2;if(_.y+fs.transform.height-C){if(D)return"bottom-left";if(O)return"bottom-right"}return D?"left":O?"right":"bottom"}_updateClassList(){const f=this._container;if(!f)return;const s=[...this._classList];s.push("mapboxgl-popup"),this._anchor&&s.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&s.push("mapboxgl-popup-track-pointer"),f.className=s.join(" ")}_update(f){const s=this._map,c=this._content;if(!s||!this._lngLat&&!this._trackPointer||!c)return;let _=this._container;if(_||(_=this._container=vn("div","mapboxgl-popup",s.getContainer()),this._tip=vn("div","mapboxgl-popup-tip",_),_.appendChild(c)),this.options.maxWidth&&_.style.maxWidth!==this.options.maxWidth&&(_.style.maxWidth=this.options.maxWidth),s.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Mp(this._lngLat,this._pos,s.transform)),!this._trackPointer||f){const v=this._pos=this._trackPointer&&f instanceof h.P?f:s.project(this._lngLat),C=Tm(this.options.offset),D=this._anchor=this._getAnchor(C.y),O=Tm(this.options.offset,D),B=v.add(O).round();s._requestDomTask(()=>{this._container&&D&&(this._container.style.transform=`${Gc[D]} translate(${B.x}px,${B.y}px)`)})}if(!this._marker&&s._showingGlobe()){const v=h.dH(s.transform,this._lngLat)?0:1;this._setOpacity(v)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const f=this._container.querySelector(Xr);f&&f.focus()}_onClose(){this.remove()}_setOpacity(f){this._container&&(this._container.style.opacity=`${f}`),this._content&&(this._content.style.pointerEvents=f?"auto":"none")}},Marker:Rd,Style:co,LngLat:h.bO,LngLatBounds:h.az,Point:h.P,MercatorCoordinate:h.aa,FreeCameraOptions:mh,Evented:h.E,config:h.e,prewarm:h.dM,clearPrewarmedResources:h.dN,get accessToken(){return h.e.ACCESS_TOKEN},set accessToken(f){h.e.ACCESS_TOKEN=f},get baseApiUrl(){return h.e.API_URL},set baseApiUrl(f){h.e.API_URL=f},get workerCount(){return h.dO.workerCount},set workerCount(f){h.dO.workerCount=f},get maxParallelImageRequests(){return h.e.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(f){h.e.MAX_PARALLEL_IMAGE_REQUESTS=f},clearStorage(f){h.dP(f)},get workerUrl(){return h.dQ.workerUrl},set workerUrl(f){h.dQ.workerUrl=f},get workerClass(){return h.dQ.workerClass},set workerClass(f){h.dQ.workerClass=f},get workerParams(){return h.dQ.workerParams},set workerParams(f){h.dQ.workerParams=f},get dracoUrl(){return h.dR()},set dracoUrl(f){h.dS(f)},get meshoptUrl(){return h.dT()},set meshoptUrl(f){h.dU(f)},setNow:h.q.setNow,restoreNow:h.q.restoreNow}}),Dt}()},1252:(Eo,Ht,qt)=>{const Dt=qt(9089),bt=qt(3677),gt=qt(7424),h=qt(1677),_t=qt(377),Pt=Dt.getBCHDigit(7973);function kn(vn,un){return h.getCharCountIndicator(vn,un)+4}function Yn(vn,un){let ln=0;return vn.forEach(function(ui){const Gi=kn(ui.mode,un);ln+=Gi+ui.getBitsLength()}),ln}Ht.from=function(un,ln){return _t.isValid(un)?parseInt(un,10):ln},Ht.getCapacity=function(un,ln,ui){if(!_t.isValid(un))throw new Error("Invalid QR Code version");typeof ui>"u"&&(ui=h.BYTE);const yi=8*(Dt.getSymbolTotalCodewords(un)-bt.getTotalCodewordsCount(un,ln));if(ui===h.MIXED)return yi;const oi=yi-kn(ui,un);switch(ui){case h.NUMERIC:return Math.floor(oi/10*3);case h.ALPHANUMERIC:return Math.floor(oi/11*2);case h.KANJI:return Math.floor(oi/13);default:return Math.floor(oi/8)}},Ht.getBestVersionForData=function(un,ln){let ui;const Gi=gt.from(ln,gt.M);if(Array.isArray(un)){if(un.length>1)return function Fn(vn,un){for(let ln=1;ln<=40;ln++)if(Yn(vn,ln)<=Ht.getCapacity(ln,un,h.MIXED))return ln}(un,Gi);if(0===un.length)return 1;ui=un[0]}else ui=un;return function Be(vn,un,ln){for(let ui=1;ui<=40;ui++)if(un<=Ht.getCapacity(ui,ln,vn))return ui}(ui.mode,ui.getLength(),Gi)},Ht.getEncodedBits=function(un){if(!_t.isValid(un)||un<7)throw new Error("Invalid QR Code version");let ln=un<<12;for(;Dt.getBCHDigit(ln)-Pt>=0;)ln^=7973<{const Dt=qt(377),bt=qt(9359);Ht.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},Ht.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},Ht.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},Ht.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},Ht.MIXED={bit:-1},Ht.getCharCountIndicator=function(_t,Ot){if(!_t.ccBits)throw new Error("Invalid mode: "+_t);if(!Dt.isValid(Ot))throw new Error("Invalid version: "+Ot);return Ot>=1&&Ot<10?_t.ccBits[0]:Ot<27?_t.ccBits[1]:_t.ccBits[2]},Ht.getBestModeForData=function(_t){return bt.testNumeric(_t)?Ht.NUMERIC:bt.testAlphanumeric(_t)?Ht.ALPHANUMERIC:bt.testKanji(_t)?Ht.KANJI:Ht.BYTE},Ht.toString=function(_t){if(_t&&_t.id)return _t.id;throw new Error("Invalid mode")},Ht.isValid=function(_t){return _t&&_t.bit&&_t.ccBits},Ht.from=function(_t,Ot){if(Ht.isValid(_t))return _t;try{return function gt(h){if("string"!=typeof h)throw new Error("Param is not a string");switch(h.toLowerCase()){case"numeric":return Ht.NUMERIC;case"alphanumeric":return Ht.ALPHANUMERIC;case"kanji":return Ht.KANJI;case"byte":return Ht.BYTE;default:throw new Error("Unknown mode: "+h)}}(_t)}catch{return Ot}}},1744:(Eo,Ht,qt)=>{const Dt=qt(6686);Ht.mul=function(gt,h){const _t=new Uint8Array(gt.length+h.length-1);for(let Ot=0;Ot=0;){const Ot=_t[0];for(let Be=0;Be{Ht.read=function(qt,Dt,bt,gt,h){var _t,Ot,Pt=8*h-gt-1,Be=(1<>1,Yn=-7,Fn=bt?h-1:0,vn=bt?-1:1,un=qt[Dt+Fn];for(Fn+=vn,_t=un&(1<<-Yn)-1,un>>=-Yn,Yn+=Pt;Yn>0;_t=256*_t+qt[Dt+Fn],Fn+=vn,Yn-=8);for(Ot=_t&(1<<-Yn)-1,_t>>=-Yn,Yn+=gt;Yn>0;Ot=256*Ot+qt[Dt+Fn],Fn+=vn,Yn-=8);if(0===_t)_t=1-kn;else{if(_t===Be)return Ot?NaN:1/0*(un?-1:1);Ot+=Math.pow(2,gt),_t-=kn}return(un?-1:1)*Ot*Math.pow(2,_t-gt)},Ht.write=function(qt,Dt,bt,gt,h,_t){var Ot,Pt,Be,kn=8*_t-h-1,Yn=(1<>1,vn=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,un=gt?0:_t-1,ln=gt?1:-1,ui=Dt<0||0===Dt&&1/Dt<0?1:0;for(Dt=Math.abs(Dt),isNaN(Dt)||Dt===1/0?(Pt=isNaN(Dt)?1:0,Ot=Yn):(Ot=Math.floor(Math.log(Dt)/Math.LN2),Dt*(Be=Math.pow(2,-Ot))<1&&(Ot--,Be*=2),(Dt+=Ot+Fn>=1?vn/Be:vn*Math.pow(2,1-Fn))*Be>=2&&(Ot++,Be/=2),Ot+Fn>=Yn?(Pt=0,Ot=Yn):Ot+Fn>=1?(Pt=(Dt*Be-1)*Math.pow(2,h),Ot+=Fn):(Pt=Dt*Math.pow(2,Fn-1)*Math.pow(2,h),Ot=0));h>=8;qt[bt+un]=255&Pt,un+=ln,Pt/=256,h-=8);for(Ot=Ot<0;qt[bt+un]=255&Ot,un+=ln,Ot/=256,kn-=8);qt[bt+un-ln]|=128*ui}},2836:Eo=>{Eo.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},2868:(Eo,Ht,qt)=>{const Dt=qt(1677),bt=qt(6628),gt=qt(1018),h=qt(4969),_t=qt(3264),Ot=qt(9359),Pt=qt(9089),Be=qt(243);function kn(Dn){return unescape(encodeURIComponent(Dn)).length}function Yn(Dn,yi,oi){const hn=[];let Ji;for(;null!==(Ji=Dn.exec(oi));)hn.push({data:Ji[0],index:Ji.index,mode:yi,length:Ji[0].length});return hn}function Fn(Dn){const yi=Yn(Ot.NUMERIC,Dt.NUMERIC,Dn),oi=Yn(Ot.ALPHANUMERIC,Dt.ALPHANUMERIC,Dn);let hn,Ji;return Pt.isKanjiModeEnabled()?(hn=Yn(Ot.BYTE,Dt.BYTE,Dn),Ji=Yn(Ot.KANJI,Dt.KANJI,Dn)):(hn=Yn(Ot.BYTE_KANJI,Dt.BYTE,Dn),Ji=[]),yi.concat(oi,hn,Ji).sort(function(sn,wn){return sn.index-wn.index}).map(function(sn){return{data:sn.data,mode:sn.mode,length:sn.length}})}function vn(Dn,yi){switch(yi){case Dt.NUMERIC:return bt.getBitsLength(Dn);case Dt.ALPHANUMERIC:return gt.getBitsLength(Dn);case Dt.KANJI:return _t.getBitsLength(Dn);case Dt.BYTE:return h.getBitsLength(Dn)}}function Gi(Dn,yi){let oi;const hn=Dt.getBestModeForData(Dn);if(oi=Dt.from(yi,hn),oi!==Dt.BYTE&&oi.bit=0?yi[yi.length-1]:null;return hn&&hn.mode===oi.mode?(yi[yi.length-1].data+=oi.data,yi):(yi.push(oi),yi)},[])}(wn))},Ht.rawSplit=function(yi){return Ht.fromArray(Fn(yi,Pt.isKanjiModeEnabled()))}},3264:(Eo,Ht,qt)=>{const Dt=qt(1677),bt=qt(9089);function gt(h){this.mode=Dt.KANJI,this.data=h}gt.getBitsLength=function(_t){return 13*_t},gt.prototype.getLength=function(){return this.data.length},gt.prototype.getBitsLength=function(){return gt.getBitsLength(this.data.length)},gt.prototype.write=function(h){let _t;for(_t=0;_t=33088&&Ot<=40956)Ot-=33088;else{if(!(Ot>=57408&&Ot<=60351))throw new Error("Invalid SJIS character: "+this.data[_t]+"\nMake sure your charset is UTF-8");Ot-=49472}Ot=192*(Ot>>>8&255)+(255&Ot),h.put(Ot,13)}},Eo.exports=gt},3361:(Eo,Ht)=>{Ht.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function Dt(bt,gt,h){switch(bt){case Ht.Patterns.PATTERN000:return(gt+h)%2==0;case Ht.Patterns.PATTERN001:return gt%2==0;case Ht.Patterns.PATTERN010:return h%3==0;case Ht.Patterns.PATTERN011:return(gt+h)%3==0;case Ht.Patterns.PATTERN100:return(Math.floor(gt/2)+Math.floor(h/3))%2==0;case Ht.Patterns.PATTERN101:return gt*h%2+gt*h%3==0;case Ht.Patterns.PATTERN110:return(gt*h%2+gt*h%3)%2==0;case Ht.Patterns.PATTERN111:return(gt*h%3+(gt+h)%2)%2==0;default:throw new Error("bad maskPattern:"+bt)}}Ht.isValid=function(gt){return null!=gt&&""!==gt&&!isNaN(gt)&>>=0&><=7},Ht.from=function(gt){return Ht.isValid(gt)?parseInt(gt,10):void 0},Ht.getPenaltyN1=function(gt){const h=gt.size;let _t=0,Ot=0,Pt=0,Be=null,kn=null;for(let Yn=0;Yn=5&&(_t+=Ot-5+3),Be=vn,Ot=1),vn=gt.get(Fn,Yn),vn===kn?Pt++:(Pt>=5&&(_t+=Pt-5+3),kn=vn,Pt=1)}Ot>=5&&(_t+=Ot-5+3),Pt>=5&&(_t+=Pt-5+3)}return _t},Ht.getPenaltyN2=function(gt){const h=gt.size;let _t=0;for(let Ot=0;Ot=10&&(1488===Ot||93===Ot)&&_t++,Pt=Pt<<1&2047|gt.get(kn,Be),kn>=10&&(1488===Pt||93===Pt)&&_t++}return 40*_t},Ht.getPenaltyN4=function(gt){let h=0;const _t=gt.data.length;for(let Pt=0;Pt<_t;Pt++)h+=gt.data[Pt];return 10*Math.abs(Math.ceil(100*h/_t/5)-10)},Ht.applyMask=function(gt,h){const _t=h.size;for(let Ot=0;Ot<_t;Ot++)for(let Pt=0;Pt<_t;Pt++)h.isReserved(Pt,Ot)||h.xor(Pt,Ot,Dt(gt,Pt,Ot))},Ht.getBestMask=function(gt,h){const _t=Object.keys(Ht.Patterns).length;let Ot=0,Pt=1/0;for(let Be=0;Be<_t;Be++){h(Be),Ht.applyMask(Be,gt);const kn=Ht.getPenaltyN1(gt)+Ht.getPenaltyN2(gt)+Ht.getPenaltyN3(gt)+Ht.getPenaltyN4(gt);Ht.applyMask(Be,gt),kn{const Dt=qt(7424),bt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],gt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Ht.getBlocksCount=function(_t,Ot){switch(Ot){case Dt.L:return bt[4*(_t-1)+0];case Dt.M:return bt[4*(_t-1)+1];case Dt.Q:return bt[4*(_t-1)+2];case Dt.H:return bt[4*(_t-1)+3];default:return}},Ht.getTotalCodewordsCount=function(_t,Ot){switch(Ot){case Dt.L:return gt[4*(_t-1)+0];case Dt.M:return gt[4*(_t-1)+1];case Dt.Q:return gt[4*(_t-1)+2];case Dt.H:return gt[4*(_t-1)+3];default:return}}},3838:(Eo,Ht,qt)=>{"use strict";var bt=qt(3981),gt=qt(2020),h="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Ht.hp=Be,Ht.IS=50;var _t=2147483647;function Pt(Ue){if(Ue>_t)throw new RangeError('The value "'+Ue+'" is invalid for option "size"');var ue=new Uint8Array(Ue);return Object.setPrototypeOf(ue,Be.prototype),ue}function Be(Ue,ue,pe){if("number"==typeof Ue){if("string"==typeof ue)throw new TypeError('The "string" argument must be of type string. Received type number');return vn(Ue)}return kn(Ue,ue,pe)}function kn(Ue,ue,pe){if("string"==typeof Ue)return function un(Ue,ue){if(("string"!=typeof ue||""===ue)&&(ue="utf8"),!Be.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);var pe=0|hn(Ue,ue),et=Pt(pe),ht=et.write(Ue,ue);return ht!==pe&&(et=et.slice(0,ht)),et}(Ue,ue);if(ArrayBuffer.isView(Ue))return function ui(Ue){if(wa(Ue,Uint8Array)){var ue=new Uint8Array(Ue);return Gi(ue.buffer,ue.byteOffset,ue.byteLength)}return ln(Ue)}(Ue);if(null==Ue)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ue);if(wa(Ue,ArrayBuffer)||Ue&&wa(Ue.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(wa(Ue,SharedArrayBuffer)||Ue&&wa(Ue.buffer,SharedArrayBuffer)))return Gi(Ue,ue,pe);if("number"==typeof Ue)throw new TypeError('The "value" argument must not be of type number. Received type number');var et=Ue.valueOf&&Ue.valueOf();if(null!=et&&et!==Ue)return Be.from(et,ue,pe);var ht=function Dn(Ue){if(Be.isBuffer(Ue)){var ue=0|yi(Ue.length),pe=Pt(ue);return 0===pe.length||Ue.copy(pe,0,0,ue),pe}return void 0!==Ue.length?"number"!=typeof Ue.length||Li(Ue.length)?Pt(0):ln(Ue):"Buffer"===Ue.type&&Array.isArray(Ue.data)?ln(Ue.data):void 0}(Ue);if(ht)return ht;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof Ue[Symbol.toPrimitive])return Be.from(Ue[Symbol.toPrimitive]("string"),ue,pe);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Ue)}function Yn(Ue){if("number"!=typeof Ue)throw new TypeError('"size" argument must be of type number');if(Ue<0)throw new RangeError('The value "'+Ue+'" is invalid for option "size"')}function vn(Ue){return Yn(Ue),Pt(Ue<0?0:0|yi(Ue))}function ln(Ue){for(var ue=Ue.length<0?0:0|yi(Ue.length),pe=Pt(ue),et=0;et=_t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_t.toString(16)+" bytes");return 0|Ue}function hn(Ue,ue){if(Be.isBuffer(Ue))return Ue.length;if(ArrayBuffer.isView(Ue)||wa(Ue,ArrayBuffer))return Ue.byteLength;if("string"!=typeof Ue)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Ue);var pe=Ue.length,et=arguments.length>2&&!0===arguments[2];if(!et&&0===pe)return 0;for(var ht=!1;;)switch(ue){case"ascii":case"latin1":case"binary":return pe;case"utf8":case"utf-8":return yr(Ue).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*pe;case"hex":return pe>>>1;case"base64":return fa(Ue).length;default:if(ht)return et?-1:yr(Ue).length;ue=(""+ue).toLowerCase(),ht=!0}}function Ji(Ue,ue,pe){var et=!1;if((void 0===ue||ue<0)&&(ue=0),ue>this.length||((void 0===pe||pe>this.length)&&(pe=this.length),pe<=0)||(pe>>>=0)<=(ue>>>=0))return"";for(Ue||(Ue="utf8");;)switch(Ue){case"hex":return wi(this,ue,pe);case"utf8":case"utf-8":return Ri(this,ue,pe);case"ascii":return pc(this,ue,pe);case"latin1":case"binary":return Vl(this,ue,pe);case"base64":return Ui(this,ue,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oc(this,ue,pe);default:if(et)throw new TypeError("Unknown encoding: "+Ue);Ue=(Ue+"").toLowerCase(),et=!0}}function $o(Ue,ue,pe){var et=Ue[ue];Ue[ue]=Ue[pe],Ue[pe]=et}function sn(Ue,ue,pe,et,ht){if(0===Ue.length)return-1;if("string"==typeof pe?(et=pe,pe=0):pe>2147483647?pe=2147483647:pe<-2147483648&&(pe=-2147483648),Li(pe=+pe)&&(pe=ht?0:Ue.length-1),pe<0&&(pe=Ue.length+pe),pe>=Ue.length){if(ht)return-1;pe=Ue.length-1}else if(pe<0){if(!ht)return-1;pe=0}if("string"==typeof ue&&(ue=Be.from(ue,et)),Be.isBuffer(ue))return 0===ue.length?-1:wn(Ue,ue,pe,et,ht);if("number"==typeof ue)return ue&=255,"function"==typeof Uint8Array.prototype.indexOf?ht?Uint8Array.prototype.indexOf.call(Ue,ue,pe):Uint8Array.prototype.lastIndexOf.call(Ue,ue,pe):wn(Ue,[ue],pe,et,ht);throw new TypeError("val must be string, number or Buffer")}function wn(Ue,ue,pe,et,ht){var Ho,_n=1,an=Ue.length,vo=ue.length;if(void 0!==et&&("ucs2"===(et=String(et).toLowerCase())||"ucs-2"===et||"utf16le"===et||"utf-16le"===et)){if(Ue.length<2||ue.length<2)return-1;_n=2,an/=2,vo/=2,pe/=2}function fo(Fa,zs){return 1===_n?Fa[zs]:Fa.readUInt16BE(zs*_n)}if(ht){var ai=-1;for(Ho=pe;Hoan&&(pe=an-vo),Ho=pe;Ho>=0;Ho--){for(var dr=!0,Hl=0;Hlht&&(et=ht):et=ht;var _n=ue.length;et>_n/2&&(et=_n/2);for(var an=0;an>8,_n.push(pe%256),_n.push(et);return _n}(ue,Ue.length-pe),Ue,pe,et)}function Ui(Ue,ue,pe){return bt.fromByteArray(0===ue&&pe===Ue.length?Ue:Ue.slice(ue,pe))}function Ri(Ue,ue,pe){pe=Math.min(Ue.length,pe);for(var et=[],ht=ue;ht239?4:_n>223?3:_n>191?2:1;if(ht+vo<=pe)switch(vo){case 1:_n<128&&(an=_n);break;case 2:128==(192&(fo=Ue[ht+1]))&&(dr=(31&_n)<<6|63&fo)>127&&(an=dr);break;case 3:Ho=Ue[ht+2],128==(192&(fo=Ue[ht+1]))&&128==(192&Ho)&&(dr=(15&_n)<<12|(63&fo)<<6|63&Ho)>2047&&(dr<55296||dr>57343)&&(an=dr);break;case 4:Ho=Ue[ht+2],ai=Ue[ht+3],128==(192&(fo=Ue[ht+1]))&&128==(192&Ho)&&128==(192&ai)&&(dr=(15&_n)<<18|(63&fo)<<12|(63&Ho)<<6|63&ai)>65535&&dr<1114112&&(an=dr)}null===an?(an=65533,vo=1):an>65535&&(et.push((an-=65536)>>>10&1023|55296),an=56320|1023&an),et.push(an),ht+=vo}return function $r(Ue){var ue=Ue.length;if(ue<=mi)return String.fromCharCode.apply(String,Ue);for(var pe="",et=0;etht.length?Be.from(an).copy(ht,_n):Uint8Array.prototype.set.call(ht,an,_n);else{if(!Be.isBuffer(an))throw new TypeError('"list" argument must be an Array of Buffers');an.copy(ht,_n)}_n+=an.length}return ht},Be.byteLength=hn,Be.prototype._isBuffer=!0,Be.prototype.swap16=function(){var ue=this.length;if(ue%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var pe=0;pepe&&(ue+=" ... "),""},h&&(Be.prototype[h]=Be.prototype.inspect),Be.prototype.compare=function(ue,pe,et,ht,_n){if(wa(ue,Uint8Array)&&(ue=Be.from(ue,ue.offset,ue.byteLength)),!Be.isBuffer(ue))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ue);if(void 0===pe&&(pe=0),void 0===et&&(et=ue?ue.length:0),void 0===ht&&(ht=0),void 0===_n&&(_n=this.length),pe<0||et>ue.length||ht<0||_n>this.length)throw new RangeError("out of range index");if(ht>=_n&&pe>=et)return 0;if(ht>=_n)return-1;if(pe>=et)return 1;if(this===ue)return 0;for(var an=(_n>>>=0)-(ht>>>=0),vo=(et>>>=0)-(pe>>>=0),fo=Math.min(an,vo),Ho=this.slice(ht,_n),ai=ue.slice(pe,et),dr=0;dr>>=0,isFinite(et)?(et>>>=0,void 0===ht&&(ht="utf8")):(ht=et,et=void 0)}var _n=this.length-pe;if((void 0===et||et>_n)&&(et=_n),ue.length>0&&(et<0||pe<0)||pe>this.length)throw new RangeError("Attempt to write outside buffer bounds");ht||(ht="utf8");for(var an=!1;;)switch(ht){case"hex":return Ti(this,ue,pe,et);case"utf8":case"utf-8":return ri(this,ue,pe,et);case"ascii":case"latin1":case"binary":return qi(this,ue,pe,et);case"base64":return Cn(this,ue,pe,et);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ci(this,ue,pe,et);default:if(an)throw new TypeError("Unknown encoding: "+ht);ht=(""+ht).toLowerCase(),an=!0}},Be.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var mi=4096;function pc(Ue,ue,pe){var et="";pe=Math.min(Ue.length,pe);for(var ht=ue;htet)&&(pe=et);for(var ht="",_n=ue;_npe)throw new RangeError("Trying to access beyond buffer length")}function lr(Ue,ue,pe,et,ht,_n){if(!Be.isBuffer(Ue))throw new TypeError('"buffer" argument must be a Buffer instance');if(ue>ht||ue<_n)throw new RangeError('"value" argument is out of bounds');if(pe+et>Ue.length)throw new RangeError("Index out of range")}function Ul(Ue,ue,pe,et,ht,_n){if(pe+et>Ue.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("Index out of range")}function Fs(Ue,ue,pe,et,ht){return ue=+ue,pe>>>=0,ht||Ul(Ue,0,pe,4),gt.write(Ue,ue,pe,et,23,4),pe+4}function Ns(Ue,ue,pe,et,ht){return ue=+ue,pe>>>=0,ht||Ul(Ue,0,pe,8),gt.write(Ue,ue,pe,et,52,8),pe+8}Be.prototype.slice=function(ue,pe){var et=this.length;(ue=~~ue)<0?(ue+=et)<0&&(ue=0):ue>et&&(ue=et),(pe=void 0===pe?et:~~pe)<0?(pe+=et)<0&&(pe=0):pe>et&&(pe=et),pe>>=0,pe>>>=0,et||hr(ue,pe,this.length);for(var ht=this[ue],_n=1,an=0;++an>>=0,pe>>>=0,et||hr(ue,pe,this.length);for(var ht=this[ue+--pe],_n=1;pe>0&&(_n*=256);)ht+=this[ue+--pe]*_n;return ht},Be.prototype.readUint8=Be.prototype.readUInt8=function(ue,pe){return ue>>>=0,pe||hr(ue,1,this.length),this[ue]},Be.prototype.readUint16LE=Be.prototype.readUInt16LE=function(ue,pe){return ue>>>=0,pe||hr(ue,2,this.length),this[ue]|this[ue+1]<<8},Be.prototype.readUint16BE=Be.prototype.readUInt16BE=function(ue,pe){return ue>>>=0,pe||hr(ue,2,this.length),this[ue]<<8|this[ue+1]},Be.prototype.readUint32LE=Be.prototype.readUInt32LE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),(this[ue]|this[ue+1]<<8|this[ue+2]<<16)+16777216*this[ue+3]},Be.prototype.readUint32BE=Be.prototype.readUInt32BE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),16777216*this[ue]+(this[ue+1]<<16|this[ue+2]<<8|this[ue+3])},Be.prototype.readIntLE=function(ue,pe,et){ue>>>=0,pe>>>=0,et||hr(ue,pe,this.length);for(var ht=this[ue],_n=1,an=0;++an=(_n*=128)&&(ht-=Math.pow(2,8*pe)),ht},Be.prototype.readIntBE=function(ue,pe,et){ue>>>=0,pe>>>=0,et||hr(ue,pe,this.length);for(var ht=pe,_n=1,an=this[ue+--ht];ht>0&&(_n*=256);)an+=this[ue+--ht]*_n;return an>=(_n*=128)&&(an-=Math.pow(2,8*pe)),an},Be.prototype.readInt8=function(ue,pe){return ue>>>=0,pe||hr(ue,1,this.length),128&this[ue]?-1*(255-this[ue]+1):this[ue]},Be.prototype.readInt16LE=function(ue,pe){ue>>>=0,pe||hr(ue,2,this.length);var et=this[ue]|this[ue+1]<<8;return 32768&et?4294901760|et:et},Be.prototype.readInt16BE=function(ue,pe){ue>>>=0,pe||hr(ue,2,this.length);var et=this[ue+1]|this[ue]<<8;return 32768&et?4294901760|et:et},Be.prototype.readInt32LE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),this[ue]|this[ue+1]<<8|this[ue+2]<<16|this[ue+3]<<24},Be.prototype.readInt32BE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),this[ue]<<24|this[ue+1]<<16|this[ue+2]<<8|this[ue+3]},Be.prototype.readFloatLE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),gt.read(this,ue,!0,23,4)},Be.prototype.readFloatBE=function(ue,pe){return ue>>>=0,pe||hr(ue,4,this.length),gt.read(this,ue,!1,23,4)},Be.prototype.readDoubleLE=function(ue,pe){return ue>>>=0,pe||hr(ue,8,this.length),gt.read(this,ue,!0,52,8)},Be.prototype.readDoubleBE=function(ue,pe){return ue>>>=0,pe||hr(ue,8,this.length),gt.read(this,ue,!1,52,8)},Be.prototype.writeUintLE=Be.prototype.writeUIntLE=function(ue,pe,et,ht){ue=+ue,pe>>>=0,et>>>=0,ht||lr(this,ue,pe,et,Math.pow(2,8*et)-1,0);var an=1,vo=0;for(this[pe]=255&ue;++vo>>=0,et>>>=0,ht||lr(this,ue,pe,et,Math.pow(2,8*et)-1,0);var an=et-1,vo=1;for(this[pe+an]=255&ue;--an>=0&&(vo*=256);)this[pe+an]=ue/vo&255;return pe+et},Be.prototype.writeUint8=Be.prototype.writeUInt8=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,1,255,0),this[pe]=255&ue,pe+1},Be.prototype.writeUint16LE=Be.prototype.writeUInt16LE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,2,65535,0),this[pe]=255&ue,this[pe+1]=ue>>>8,pe+2},Be.prototype.writeUint16BE=Be.prototype.writeUInt16BE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,2,65535,0),this[pe]=ue>>>8,this[pe+1]=255&ue,pe+2},Be.prototype.writeUint32LE=Be.prototype.writeUInt32LE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,4,4294967295,0),this[pe+3]=ue>>>24,this[pe+2]=ue>>>16,this[pe+1]=ue>>>8,this[pe]=255&ue,pe+4},Be.prototype.writeUint32BE=Be.prototype.writeUInt32BE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,4,4294967295,0),this[pe]=ue>>>24,this[pe+1]=ue>>>16,this[pe+2]=ue>>>8,this[pe+3]=255&ue,pe+4},Be.prototype.writeIntLE=function(ue,pe,et,ht){if(ue=+ue,pe>>>=0,!ht){var _n=Math.pow(2,8*et-1);lr(this,ue,pe,et,_n-1,-_n)}var an=0,vo=1,fo=0;for(this[pe]=255&ue;++an>>=0,!ht){var _n=Math.pow(2,8*et-1);lr(this,ue,pe,et,_n-1,-_n)}var an=et-1,vo=1,fo=0;for(this[pe+an]=255&ue;--an>=0&&(vo*=256);)ue<0&&0===fo&&0!==this[pe+an+1]&&(fo=1),this[pe+an]=(ue/vo|0)-fo&255;return pe+et},Be.prototype.writeInt8=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,1,127,-128),ue<0&&(ue=255+ue+1),this[pe]=255&ue,pe+1},Be.prototype.writeInt16LE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,2,32767,-32768),this[pe]=255&ue,this[pe+1]=ue>>>8,pe+2},Be.prototype.writeInt16BE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,2,32767,-32768),this[pe]=ue>>>8,this[pe+1]=255&ue,pe+2},Be.prototype.writeInt32LE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,4,2147483647,-2147483648),this[pe]=255&ue,this[pe+1]=ue>>>8,this[pe+2]=ue>>>16,this[pe+3]=ue>>>24,pe+4},Be.prototype.writeInt32BE=function(ue,pe,et){return ue=+ue,pe>>>=0,et||lr(this,ue,pe,4,2147483647,-2147483648),ue<0&&(ue=4294967295+ue+1),this[pe]=ue>>>24,this[pe+1]=ue>>>16,this[pe+2]=ue>>>8,this[pe+3]=255&ue,pe+4},Be.prototype.writeFloatLE=function(ue,pe,et){return Fs(this,ue,pe,!0,et)},Be.prototype.writeFloatBE=function(ue,pe,et){return Fs(this,ue,pe,!1,et)},Be.prototype.writeDoubleLE=function(ue,pe,et){return Ns(this,ue,pe,!0,et)},Be.prototype.writeDoubleBE=function(ue,pe,et){return Ns(this,ue,pe,!1,et)},Be.prototype.copy=function(ue,pe,et,ht){if(!Be.isBuffer(ue))throw new TypeError("argument should be a Buffer");if(et||(et=0),!ht&&0!==ht&&(ht=this.length),pe>=ue.length&&(pe=ue.length),pe||(pe=0),ht>0&&ht=this.length)throw new RangeError("Index out of range");if(ht<0)throw new RangeError("sourceEnd out of bounds");ht>this.length&&(ht=this.length),ue.length-pe>>=0,et=void 0===et?this.length:et>>>0,ue||(ue=0),"number"==typeof ue)for(an=pe;an55295&&pe<57344){if(!ht){if(pe>56319){(ue-=3)>-1&&_n.push(239,191,189);continue}if(an+1===et){(ue-=3)>-1&&_n.push(239,191,189);continue}ht=pe;continue}if(pe<56320){(ue-=3)>-1&&_n.push(239,191,189),ht=pe;continue}pe=65536+(ht-55296<<10|pe-56320)}else ht&&(ue-=3)>-1&&_n.push(239,191,189);if(ht=null,pe<128){if((ue-=1)<0)break;_n.push(pe)}else if(pe<2048){if((ue-=2)<0)break;_n.push(pe>>6|192,63&pe|128)}else if(pe<65536){if((ue-=3)<0)break;_n.push(pe>>12|224,pe>>6&63|128,63&pe|128)}else{if(!(pe<1114112))throw new Error("Invalid code point");if((ue-=4)<0)break;_n.push(pe>>18|240,pe>>12&63|128,pe>>6&63|128,63&pe|128)}}return _n}function fa(Ue){return bt.toByteArray(function cr(Ue){if((Ue=(Ue=Ue.split("=")[0]).trim().replace(Ze,"")).length<2)return"";for(;Ue.length%4!=0;)Ue+="=";return Ue}(Ue))}function Gr(Ue,ue,pe,et){for(var ht=0;ht=ue.length||ht>=Ue.length);++ht)ue[ht+pe]=Ue[ht];return ht}function wa(Ue,ue){return Ue instanceof ue||null!=Ue&&null!=Ue.constructor&&null!=Ue.constructor.name&&Ue.constructor.name===ue.name}function Li(Ue){return Ue!=Ue}var Nr=function(){for(var Ue="0123456789abcdef",ue=new Array(256),pe=0;pe<16;++pe)for(var et=16*pe,ht=0;ht<16;++ht)ue[et+ht]=Ue[pe]+Ue[ht];return ue}()},3981:(Eo,Ht)=>{"use strict";Ht.byteLength=function Pt(un){var ln=Ot(un),Gi=ln[1];return 3*(ln[0]+Gi)/4-Gi},Ht.toByteArray=function kn(un){var ln,Ji,ui=Ot(un),Gi=ui[0],Dn=ui[1],yi=new bt(function Be(un,ln,ui){return 3*(ln+ui)/4-ui}(0,Gi,Dn)),oi=0,hn=Dn>0?Gi-4:Gi;for(Ji=0;Ji>16&255,yi[oi++]=ln>>8&255,yi[oi++]=255&ln;return 2===Dn&&(ln=Dt[un.charCodeAt(Ji)]<<2|Dt[un.charCodeAt(Ji+1)]>>4,yi[oi++]=255&ln),1===Dn&&(ln=Dt[un.charCodeAt(Ji)]<<10|Dt[un.charCodeAt(Ji+1)]<<4|Dt[un.charCodeAt(Ji+2)]>>2,yi[oi++]=ln>>8&255,yi[oi++]=255&ln),yi},Ht.fromByteArray=function vn(un){for(var ln,ui=un.length,Gi=ui%3,Dn=[],oi=0,hn=ui-Gi;oihn?hn:oi+16383));return 1===Gi?Dn.push(qt[(ln=un[ui-1])>>2]+qt[ln<<4&63]+"=="):2===Gi&&Dn.push(qt[(ln=(un[ui-2]<<8)+un[ui-1])>>10]+qt[ln>>4&63]+qt[ln<<2&63]+"="),Dn.join("")};for(var qt=[],Dt=[],bt=typeof Uint8Array<"u"?Uint8Array:Array,gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0;h<64;++h)qt[h]=gt[h],Dt[gt.charCodeAt(h)]=h;function Ot(un){var ln=un.length;if(ln%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ui=un.indexOf("=");return-1===ui&&(ui=ln),[ui,ui===ln?0:4-ui%4]}function Yn(un){return qt[un>>18&63]+qt[un>>12&63]+qt[un>>6&63]+qt[63&un]}function Fn(un,ln,ui){for(var Dn=[],yi=ln;yi{var Dt;!function(bt,gt,h,_t){"use strict";var Gi,Ot=["","webkit","Moz","MS","ms","o"],Pt=gt.createElement("div"),kn=Math.round,Yn=Math.abs,Fn=Date.now;function vn(Ie,ze,ut){return setTimeout(hn(Ie,ut),ze)}function un(Ie,ze,ut){return!!Array.isArray(Ie)&&(ln(Ie,ut[ze],ut),!0)}function ln(Ie,ze,ut){var Zt;if(Ie)if(Ie.forEach)Ie.forEach(ze,ut);else if(Ie.length!==_t)for(Zt=0;Zt\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",zo=bt.console&&(bt.console.warn||bt.console.log);return zo&&zo.call(bt.console,Zt,In),Ie.apply(this,arguments)}}Gi="function"!=typeof Object.assign?function(ze){if(ze===_t||null===ze)throw new TypeError("Cannot convert undefined or null to object");for(var ut=Object(ze),Zt=1;Zt-1}function qi(Ie){return Ie.trim().split(/\s+/g)}function Cn(Ie,ze,ut){if(Ie.indexOf&&!ut)return Ie.indexOf(ze);for(var Zt=0;Ztls[ze]}):Zt.sort()),Zt}function Ri(Ie,ze){for(var ut,Zt,yn=ze[0].toUpperCase()+ze.slice(1),In=0;In1&&!ut.firstMultiple?ut.firstMultiple=dr(ze):1===yn&&(ut.firstMultiple=!1);var In=ut.firstInput,zo=ut.firstMultiple,Un=zo?zo.center:In.center,Cs=ze.center=Hl(Zt);ze.timeStamp=Fn(),ze.deltaTime=ze.timeStamp-In.timeStamp,ze.angle=Bs(Un,Cs),ze.distance=nc(Un,Cs),function Ho(Ie,ze){var ut=ze.center,Zt=Ie.offsetDelta||{},yn=Ie.prevDelta||{},In=Ie.prevInput||{};(1===ze.eventType||4===In.eventType)&&(yn=Ie.prevDelta={x:In.deltaX||0,y:In.deltaY||0},Zt=Ie.offsetDelta={x:ut.x,y:ut.y}),ze.deltaX=yn.x+(ut.x-Zt.x),ze.deltaY=yn.y+(ut.y-Zt.y)}(ut,ze),ze.offsetDirection=zs(ze.deltaX,ze.deltaY);var ls=Fa(ze.deltaTime,ze.deltaX,ze.deltaY);ze.overallVelocityX=ls.x,ze.overallVelocityY=ls.y,ze.overallVelocity=Yn(ls.x)>Yn(ls.y)?ls.x:ls.y,ze.scale=zo?function ki(Ie,ze){return nc(ze[0],ze[1],ht)/nc(Ie[0],Ie[1],ht)}(zo.pointers,Zt):1,ze.rotation=zo?function Pc(Ie,ze){return Bs(ze[1],ze[0],ht)+Bs(Ie[1],Ie[0],ht)}(zo.pointers,Zt):0,ze.maxPointers=ut.prevInput?ze.pointers.length>ut.prevInput.maxPointers?ze.pointers.length:ut.prevInput.maxPointers:ze.pointers.length,function ai(Ie,ze){var yn,In,zo,Un,ut=Ie.lastInterval||ze,Zt=ze.timeStamp-ut.timeStamp;if(8!=ze.eventType&&(Zt>25||ut.velocity===_t)){var Cs=ze.deltaX-ut.deltaX,ls=ze.deltaY-ut.deltaY,ic=Fa(Zt,Cs,ls);In=ic.x,zo=ic.y,yn=Yn(ic.x)>Yn(ic.y)?ic.x:ic.y,Un=zs(Cs,ls),Ie.lastInterval=ze}else yn=ut.velocity,In=ut.velocityX,zo=ut.velocityY,Un=ut.direction;ze.velocity=yn,ze.velocityX=In,ze.velocityY=zo,ze.direction=Un}(ut,ze);var ic=Ie.element;Ti(ze.srcEvent.target,ic)&&(ic=ze.srcEvent.target),ze.target=ic}(Ie,ut),Ie.emit("hammer.input",ut),Ie.recognize(ut),Ie.session.prevInput=ut}function dr(Ie){for(var ze=[],ut=0;ut=Yn(ze)?Ie<0?2:4:ze<0?8:16}function nc(Ie,ze,ut){ut||(ut=et);var Zt=ze[ut[0]]-Ie[ut[0]],yn=ze[ut[1]]-Ie[ut[1]];return Math.sqrt(Zt*Zt+yn*yn)}function Bs(Ie,ze,ut){return ut||(ut=et),180*Math.atan2(ze[ut[1]]-Ie[ut[1]],ze[ut[0]]-Ie[ut[0]])/Math.PI}_n.prototype={handler:function(){},init:function(){this.evEl&&sn(this.element,this.evEl,this.domHandler),this.evTarget&&sn(this.target,this.evTarget,this.domHandler),this.evWin&&sn(pc(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&wn(this.element,this.evEl,this.domHandler),this.evTarget&&wn(this.target,this.evTarget,this.domHandler),this.evWin&&wn(pc(this.element),this.evWin,this.domHandler)}};var Lc={mousedown:1,mousemove:2,mouseup:4};function as(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,_n.apply(this,arguments)}oi(as,_n,{handler:function(ze){var ut=Lc[ze.type];1&ut&&0===ze.button&&(this.pressed=!0),2&ut&&1!==ze.which&&(ut=4),this.pressed&&(4&ut&&(this.pressed=!1),this.callback(this.manager,ut,{pointers:[ze],changedPointers:[ze],pointerType:Fs,srcEvent:ze}))}});var pd={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},sh={2:lr,3:"pen",4:Fs,5:"kinect"},md="pointerdown",Qh="pointermove pointerup pointercancel";function Fc(){this.evEl=md,this.evWin=Qh,_n.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}bt.MSPointerEvent&&!bt.PointerEvent&&(md="MSPointerDown",Qh="MSPointerMove MSPointerUp MSPointerCancel"),oi(Fc,_n,{handler:function(ze){var ut=this.store,Zt=!1,yn=ze.type.toLowerCase().replace("ms",""),In=pd[yn],zo=sh[ze.pointerType]||ze.pointerType,Un=zo==lr,Cs=Cn(ut,ze.pointerId,"pointerId");1&In&&(0===ze.button||Un)?Cs<0&&(ut.push(ze),Cs=ut.length-1):12&In&&(Zt=!0),!(Cs<0)&&(ut[Cs]=ze,this.callback(this.manager,In,{pointers:ut,changedPointers:[ze],pointerType:zo,srcEvent:ze}),Zt&&ut.splice(Cs,1))}});var om={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function lh(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,_n.apply(this,arguments)}function ch(Ie,ze){var ut=ci(Ie.touches),Zt=ci(Ie.changedTouches);return 12&ze&&(ut=Ui(ut.concat(Zt),"identifier",!0)),[ut,Zt]}oi(lh,_n,{handler:function(ze){var ut=om[ze.type];if(1===ut&&(this.started=!0),this.started){var Zt=ch.call(this,ze,ut);12&ut&&Zt[0].length-Zt[1].length==0&&(this.started=!1),this.callback(this.manager,ut,{pointers:Zt[0],changedPointers:Zt[1],pointerType:lr,srcEvent:ze})}}});var Jh={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function za(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},_n.apply(this,arguments)}function ft(Ie,ze){var ut=ci(Ie.touches),Zt=this.targetIds;if(3&ze&&1===ut.length)return Zt[ut[0].identifier]=!0,[ut,ut];var yn,In,zo=ci(Ie.changedTouches),Un=[],Cs=this.target;if(In=ut.filter(function(ls){return Ti(ls.target,Cs)}),1===ze)for(yn=0;yn-1&&Zt.splice(In,1)},2500)}}function qe(Ie){for(var ze=Ie.srcEvent.clientX,ut=Ie.srcEvent.clientY,Zt=0;Zt-1&&this.requireFail.splice(ze,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(Ie){return!!this.simultaneous[Ie.id]},emit:function(Ie){var ze=this,ut=this.state;function Zt(yn){ze.manager.emit(yn,Ie)}ut<8&&Zt(ze.options.event+Tr(ut)),Zt(ze.options.event),Ie.additionalEvent&&Zt(Ie.additionalEvent),ut>=8&&Zt(ze.options.event+Tr(ut))},tryEmit:function(Ie){if(this.canEmit())return this.emit(Ie);this.state=32},canEmit:function(){for(var Ie=0;Ieze.threshold&&yn&ze.direction},attrTest:function(Ie){return Wr.prototype.attrTest.call(this,Ie)&&(2&this.state||!(2&this.state)&&this.directionTest(Ie))},emit:function(Ie){this.pX=Ie.deltaX,this.pY=Ie.deltaY;var ze=ss(Ie.direction);ze&&(Ie.additionalEvent=this.options.event+ze),this._super.emit.call(this,Ie)}}),oi(Or,Wr,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[St]},attrTest:function(Ie){return this._super.attrTest.call(this,Ie)&&(Math.abs(Ie.scale-1)>this.options.threshold||2&this.state)},emit:function(Ie){1!==Ie.scale&&(Ie.additionalEvent=this.options.event+(Ie.scale<1?"in":"out")),this._super.emit.call(this,Ie)}}),oi(pf,Zo,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(Ie){var ze=this.options,ut=Ie.pointers.length===ze.pointers,Zt=Ie.distanceze.time;if(this._input=Ie,!Zt||!ut||12&Ie.eventType&&!yn)this.reset();else if(1&Ie.eventType)this.reset(),this._timer=vn(function(){this.state=8,this.tryEmit()},ze.time,this);else if(4&Ie.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(Ie){8===this.state&&(Ie&&4&Ie.eventType?this.manager.emit(this.options.event+"up",Ie):(this._input.timeStamp=Fn(),this.manager.emit(this.options.event,this._input)))}}),oi(rm,Wr,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[St]},attrTest:function(Ie){return this._super.attrTest.call(this,Ie)&&(Math.abs(Ie.rotation)>this.options.threshold||2&this.state)}}),oi(Jo,Wr,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Iu.prototype.getTouchAction.call(this)},attrTest:function(Ie){var ut,ze=this.options.direction;return 30&ze?ut=Ie.overallVelocity:6&ze?ut=Ie.overallVelocityX:24&ze&&(ut=Ie.overallVelocityY),this._super.attrTest.call(this,Ie)&&ze&Ie.offsetDirection&&Ie.distance>this.options.threshold&&Ie.maxPointers==this.options.pointers&&Yn(ut)>this.options.velocity&&4&Ie.eventType},emit:function(Ie){var ze=ss(Ie.offsetDirection);ze&&this.manager.emit(this.options.event+ze,Ie),this.manager.emit(this.options.event,Ie)}}),oi(Wa,Zo,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ot]},process:function(Ie){var ze=this.options,ut=Ie.pointers.length===ze.pointers,Zt=Ie.distance{"use strict";function Dt(t,i,e,n,o,r,u){try{var y=t[r](u),I=y.value}catch(V){return void e(V)}y.done?i(I):Promise.resolve(I).then(n,o)}function bt(t){return function(){var i=this,e=arguments;return new Promise(function(n,o){var r=t.apply(i,e);function u(I){Dt(r,n,o,u,y,"next",I)}function y(I){Dt(r,n,o,u,y,"throw",I)}u(void 0)})}}function gt(t,i){return Object.is(t,i)}let h=null,_t=!1,Ot=1;const Pt=Symbol("SIGNAL");function Be(t){const i=h;return h=t,i}const vn={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function un(t){if(_t)throw new Error("");if(null===h)return;h.consumerOnSignalRead(t);const i=h.nextProducerIndex++;qi(h),it.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}function $o(t){qi(t);for(let i=0;i0}function qi(t){t.producerNode??=[],t.producerIndexOfThis??=[],t.producerLastReadVersion??=[]}function Cn(t){t.liveConsumerNode??=[],t.liveConsumerIndexOfThis??=[]}function ci(t){return void 0!==t.producerNode}function Ui(t,i){const e=Object.create(pc);e.computation=t,void 0!==i&&(e.equal=i);const n=()=>{if(ui(e),un(e),e.value===$r)throw e.error;return e.value};return n[Pt]=e,n}const Ri=Symbol("UNSET"),mi=Symbol("COMPUTING"),$r=Symbol("ERRORED"),pc={...vn,value:Ri,dirty:!0,error:null,equal:gt,kind:"computed",producerMustRecompute:t=>t.value===Ri||t.value===mi,producerRecomputeValue(t){if(t.value===mi)throw new Error("Detected cycle in computations.");const i=t.value;t.value=mi;const e=hn(t);let n,o=!1;try{n=t.computation(),Be(null),o=i!==Ri&&i!==$r&&n!==$r&&t.equal(i,n)}catch(r){n=$r,t.error=r}finally{Ji(t,e)}o?t.value=i:(t.value=n,t.version++)}};let wi=function Vl(){throw new Error};function Oc(t){wi(t)}function Ns(t,i){Dn()||Oc(t),t.equal(t.value,i)||(t.value=i,function Wo(t){t.version++,function ln(){Ot++}(),Gi(t)}(t))}const yr={...vn,equal:gt,value:void 0,kind:"signal"};let Ue;function ue(){return Ue}function pe(t){const i=Ue;return Ue=t,i}const et=Symbol("NotFound");function an(t){return"function"==typeof t}function vo(t){const e=t(n=>{Error.call(n),n.stack=(new Error).stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Error;const fo=vo(t=>function(e){t(this),this.message=e?`${e.length} errors occurred during unsubscription:\n${e.map((n,o)=>`${o+1}) ${n.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=e});function Ho(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class ai{constructor(i){this.initialTeardown=i,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let i;if(!this.closed){this.closed=!0;const{_parentage:e}=this;if(e)if(this._parentage=null,Array.isArray(e))for(const r of e)r.remove(this);else e.remove(this);const{initialTeardown:n}=this;if(an(n))try{n()}catch(r){i=r instanceof fo?r.errors:[r]}const{_finalizers:o}=this;if(o){this._finalizers=null;for(const r of o)try{Fa(r)}catch(u){i=i??[],u instanceof fo?i=[...i,...u.errors]:i.push(u)}}if(i)throw new fo(i)}}add(i){var e;if(i&&i!==this)if(this.closed)Fa(i);else{if(i instanceof ai){if(i.closed||i._hasParent(this))return;i._addParent(this)}(this._finalizers=null!==(e=this._finalizers)&&void 0!==e?e:[]).push(i)}}_hasParent(i){const{_parentage:e}=this;return e===i||Array.isArray(e)&&e.includes(i)}_addParent(i){const{_parentage:e}=this;this._parentage=Array.isArray(e)?(e.push(i),e):e?[e,i]:i}_removeParent(i){const{_parentage:e}=this;e===i?this._parentage=null:Array.isArray(e)&&Ho(e,i)}remove(i){const{_finalizers:e}=this;e&&Ho(e,i),i instanceof ai&&i._removeParent(this)}}ai.EMPTY=(()=>{const t=new ai;return t.closed=!0,t})();const dr=ai.EMPTY;function Hl(t){return t instanceof ai||t&&"closed"in t&&an(t.remove)&&an(t.add)&&an(t.unsubscribe)}function Fa(t){an(t)?t():t.unsubscribe()}const zs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},nc={setTimeout(t,i,...e){const{delegate:n}=nc;return n?.setTimeout?n.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=nc;return(i?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Bs(t){nc.setTimeout(()=>{const{onUnhandledError:i}=zs;if(!i)throw t;i(t)})}function Pc(){}const ki=Vs("C",void 0,void 0);function Vs(t,i,e){return{kind:t,value:i,error:e}}let as=null;function pd(t){if(zs.useDeprecatedSynchronousErrorHandling){const i=!as;if(i&&(as={errorThrown:!1,error:null}),t(),i){const{errorThrown:e,error:n}=as;if(as=null,e)throw n}}else t()}class md extends ai{constructor(i){super(),this.isStopped=!1,i?(this.destination=i,Hl(i)&&i.add(this)):this.destination=Jh}static create(i,e,n){return new fd(i,e,n)}next(i){this.isStopped?ch(function im(t){return Vs("N",t,void 0)}(i),this):this._next(i)}error(i){this.isStopped?ch(function Lc(t){return Vs("E",void 0,t)}(i),this):(this.isStopped=!0,this._error(i))}complete(){this.isStopped?ch(ki,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(i){this.destination.next(i)}_error(i){try{this.destination.error(i)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Qh=Function.prototype.bind;function Fc(t,i){return Qh.call(t,i)}class om{constructor(i){this.partialObserver=i}next(i){const{partialObserver:e}=this;if(e.next)try{e.next(i)}catch(n){zr(n)}}error(i){const{partialObserver:e}=this;if(e.error)try{e.error(i)}catch(n){zr(n)}else zr(i)}complete(){const{partialObserver:i}=this;if(i.complete)try{i.complete()}catch(e){zr(e)}}}class fd extends md{constructor(i,e,n){let o;if(super(),an(i)||!i)o={next:i??void 0,error:e??void 0,complete:n??void 0};else{let r;this&&zs.useDeprecatedNextContext?(r=Object.create(i),r.unsubscribe=()=>this.unsubscribe(),o={next:i.next&&Fc(i.next,r),error:i.error&&Fc(i.error,r),complete:i.complete&&Fc(i.complete,r)}):o=i}this.destination=new om(o)}}function zr(t){zs.useDeprecatedSynchronousErrorHandling?function sh(t){zs.useDeprecatedSynchronousErrorHandling&&as&&(as.errorThrown=!0,as.error=t)}(t):Bs(t)}function ch(t,i){const{onStoppedNotification:e}=zs;e&&nc.setTimeout(()=>e(t,i))}const Jh={closed:!0,next:Pc,error:function lh(t){throw t},complete:Pc},Na="function"==typeof Symbol&&Symbol.observable||"@@observable";function za(t){return t}function re(t){return 0===t.length?za:1===t.length?t[0]:function(e){return t.reduce((n,o)=>o(n),e)}}let se=(()=>{class t{constructor(e){e&&(this._subscribe=e)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(e,n,o){const r=function Oe(t){return t&&t instanceof md||function ke(t){return t&&an(t.next)&&an(t.error)&&an(t.complete)}(t)&&Hl(t)}(e)?e:new fd(e,n,o);return pd(()=>{const{operator:u,source:y}=this;r.add(u?u.call(r,y):y?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(e){try{return this._subscribe(e)}catch(n){e.error(n)}}forEach(e,n){return new(n=_e(n))((o,r)=>{const u=new fd({next:y=>{try{e(y)}catch(I){r(I),u.unsubscribe()}},error:r,complete:o});this.subscribe(u)})}_subscribe(e){var n;return null===(n=this.source)||void 0===n?void 0:n.subscribe(e)}[Na](){return this}pipe(...e){return re(e)(this)}toPromise(e){return new(e=_e(e))((n,o)=>{let r;this.subscribe(u=>r=u,u=>o(u),()=>n(r))})}}return t.create=i=>new t(i),t})();function _e(t){var i;return null!==(i=t??zs.Promise)&&void 0!==i?i:Promise}const qe=vo(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let Ee=(()=>{class t extends se{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){const n=new We(this,this);return n.operator=e,n}_throwIfClosed(){if(this.closed)throw new qe}next(e){pd(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const n of this.currentObservers)n.next(e)}})}error(e){pd(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;const{observers:n}=this;for(;n.length;)n.shift().error(e)}})}complete(){pd(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){const{hasError:n,isStopped:o,observers:r}=this;return n||o?dr:(this.currentObservers=null,r.push(e),new ai(()=>{this.currentObservers=null,Ho(r,e)}))}_checkFinalizedStatuses(e){const{hasError:n,thrownError:o,isStopped:r}=this;n?e.error(o):r&&e.complete()}asObservable(){const e=new se;return e.source=this,e}}return t.create=(i,e)=>new We(i,e),t})();class We extends Ee{constructor(i,e){super(),this.destination=i,this.source=e}next(i){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,i)}error(i){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,i)}complete(){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.complete)||void 0===e||e.call(i)}_subscribe(i){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(i))&&void 0!==n?n:dr}}class it extends Ee{constructor(i){super(),this._value=i}get value(){return this.getValue()}_subscribe(i){const e=super._subscribe(i);return!e.closed&&i.next(this._value),e}getValue(){const{hasError:i,thrownError:e,_value:n}=this;if(i)throw e;return this._throwIfClosed(),n}next(i){super.next(this._value=i)}}function dt(t){return an(t?.lift)}function ot(t){return i=>{if(dt(i))return i.lift(function(e){try{return t(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function St(t,i,e,n,o){return new on(t,i,e,n,o)}class on extends md{constructor(i,e,n,o,r,u){super(i),this.onFinalize=r,this.shouldUnsubscribe=u,this._next=e?function(y){try{e(y)}catch(I){i.error(I)}}:super._next,this._error=o?function(y){try{o(y)}catch(I){i.error(I)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(y){i.error(y)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var i;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:e}=this;super.unsubscribe(),!e&&(null===(i=this.onFinalize)||void 0===i||i.call(this))}}}function kt(t,i){return ot((e,n)=>{let o=0;e.subscribe(St(n,r=>{n.next(t.call(i,r,o++))}))})}const ni="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss";class ct extends Error{code;constructor(i,e){super(function Mi(t,i){return`${function ii(t){return`NG0${Math.abs(t)}`}(t)}${i?": "+i:""}`}(i,e)),this.code=i}}const Ai=Symbol("InputSignalNode#UNSET"),Di={...yr,transformFn:void 0,applyValueToInputSignal(t,i){Ns(t,i)}};function Hi(t,i){const e=Object.create(Di);function n(){if(un(e),e.value===Ai)throw new ct(-950,null);return e.value}return e.value=t,e.transformFn=i?.transform,n[Pt]=e,n}function Go(t){return{toString:t}.toString()}const Zo="__parameters__";function Wr(t,i,e){return Go(()=>{const n=function Nc(t){return function(...e){if(t){const n=t(...e);for(const o in n)this[o]=n[o]}}}(i);function o(...r){if(this instanceof o)return n.apply(this,r),this;const u=new o(...r);return y.annotation=u,y;function y(I,V,q){const ee=I.hasOwnProperty(Zo)?I[Zo]:Object.defineProperty(I,Zo,{value:[]})[Zo];for(;ee.length<=q;)ee.push(null);return(ee[q]=ee[q]||[]).push(u),I}}return o.prototype.ngMetadataName=t,o.annotationCls=o,o})}const Or=globalThis;function Jo(t){for(let i in t)if(t[i]===Jo)return i;throw Error("Could not find renamed property on target object.")}function Wa(t,i){for(const e in i)i.hasOwnProperty(e)&&!t.hasOwnProperty(e)&&(t[e]=i[e])}function Yo(t){if("string"==typeof t)return t;if(Array.isArray(t))return`[${t.map(Yo).join(", ")}]`;if(null==t)return""+t;const i=t.overriddenName||t.name;if(i)return`${i}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return n>=0?e.slice(0,n):e}function mc(t,i){return t?i?`${t} ${i}`:t:i||""}const jl=Jo({__forward_ref__:Jo});function lo(t){return t.__forward_ref__=lo,t.toString=function(){return Yo(this())},t}function eo(t){return dh(t)?t():t}function dh(t){return"function"==typeof t&&t.hasOwnProperty(jl)&&t.__forward_ref__===lo}function Nt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function _i(t){return{providers:t.providers||[],imports:t.imports||[]}}function hh(t){return Br(t,ep)||Br(t,mf)}function Br(t,i){return t.hasOwnProperty(i)?t[i]:null}function Us(t){return t&&(t.hasOwnProperty(tp)||t.hasOwnProperty(ff))?t[tp]:null}const ep=Jo({\u0275prov:Jo}),tp=Jo({\u0275inj:Jo}),mf=Jo({ngInjectableDef:Jo}),ff=Jo({ngInjectorDef:Jo});class yt{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(i,e){this._desc=i,this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=Nt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function np(t){return t&&!!t.\u0275providers}const fl=Jo({\u0275cmp:Jo}),_f=Jo({\u0275dir:Jo}),gd=Jo({\u0275pipe:Jo}),w0=Jo({\u0275mod:Jo}),bd=Jo({\u0275fac:Jo}),Ts=Jo({__NG_ELEMENT_ID__:Jo}),V_=Jo({__NG_ENV_ID__:Jo});function _o(t){return"string"==typeof t?t:null==t?"":String(t)}function C0(t,i){throw new ct(-200,t)}function Bb(t,i){throw new ct(-201,!1)}var To=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}(To||{});let bf;function Jd(){return bf}function Ya(t){const i=bf;return bf=t,i}function S0(t,i,e){const n=hh(t);return n&&"root"==n.providedIn?void 0===n.value?n.value=n.factory():n.value:e&To.Optional?null:void 0!==i?i:void Bb()}const ph={},Vb="__NG_DI_FLAG__";class j_{injector;constructor(i){this.injector=i}retrieve(i,e){return this.injector.get(i,e.optional?et:ph,e)}}const eu="ngTempTokenPath",Jn=/\n/gm,pi="__source";function sm(t,i=To.Default){if(void 0===ue())throw new ct(-203,!1);if(null===ue())return S0(t,void 0,i);{const e=ue();let n;return n=e instanceof j_?e.injector:e,n.get(t,i&To.Optional?null:void 0,i)}}function xn(t,i=To.Default){return(Jd()||sm)(eo(t),i)}function Y(t,i=To.Default){return xn(t,tu(i))}function tu(t){return typeof t>"u"||"number"==typeof t?t:(t.optional&&8)|(t.host&&1)|(t.self&&2)|(t.skipSelf&&4)}function yf(t){const i=[];for(let e=0;eArray.isArray(e)?Vc(e,i):i(e))}function fh(t,i,e){i>=t.length?t.push(e):t.splice(i,0,e)}function lm(t,i){return i>=t.length-1?t.pop():t.splice(i,1)[0]}function rc(t,i,e){let n=ip(t,i);return n>=0?t[1|n]=e:(n=~n,function D0(t,i,e,n){let o=t.length;if(o==i)t.push(e,n);else if(1===o)t.push(n,t[0]),t[0]=e;else{for(o--,t.push(t[o-1],t[o]);o>i;)t[o]=t[o-2],o--;t[i]=e,t[i+1]=n}}(t,n,i,e)),n}function xf(t,i){const e=ip(t,i);if(e>=0)return t[1|e]}function ip(t,i){return function uw(t,i,e){let n=0,o=t.length>>e;for(;o!==n;){const r=n+(o-n>>1),u=t[r<i?o=r:n=r+1}return~(o<{e.push(u)};return Vc(i,u=>{const y=u;gh(y,r,[],n)&&(o||=[],o.push(y))}),void 0!==o&&op(o,r),e}function op(t,i){for(let e=0;e{i(r,n)})}}function gh(t,i,e,n){if(!(t=eo(t)))return!1;let o=null,r=Us(t);const u=!r&&co(t);if(r||u){if(u&&!u.standalone)return!1;o=t}else{const I=t.ngModule;if(r=Us(I),!r)return!1;o=I}const y=n.has(o);if(u){if(y)return!1;if(n.add(o),u.dependencies){const I="function"==typeof u.dependencies?u.dependencies():u.dependencies;for(const V of I)gh(V,i,e,n)}}else{if(!r)return!1;{if(null!=r.imports&&!y){let V;n.add(o);try{Vc(r.imports,q=>{gh(q,i,e,n)&&(V||=[],V.push(q))})}finally{}void 0!==V&&op(V,i)}if(!y){const V=ql(o)||(()=>new o);i({provide:o,useFactory:V,deps:qo},o),i({provide:wf,useValue:o,multi:!0},o),i({provide:Hc,useValue:()=>xn(o),multi:!0},o)}const I=r.providers;if(null!=I&&!y){const V=t;Mu(I,q=>{i(q,V)})}}}return o!==t&&void 0!==t.providers}function Mu(t,i){for(let e of t)np(e)&&(e=e.\u0275providers),Array.isArray(e)?Mu(e,i):i(e)}const rp=Jo({provide:String,useValue:Jo});function bh(t){return null!==t&&"object"==typeof t&&rp in t}function yd(t){return"function"==typeof t}const Au=new yt(""),to={},qb={};let yh;function Sf(){return void 0===yh&&(yh=new _h),yh}class us{}class ap extends us{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(i,e,n,o){super(),this.parent=e,this.source=n,this.scopes=o,cp(i,u=>this.processProvider(u)),this.records.set(jb,lp(void 0,this)),o.has("environment")&&this.records.set(us,lp(void 0,this));const r=this.records.get(Au);null!=r&&"string"==typeof r.value&&this.scopes.add(r.value),this.injectorDefTypes=new Set(this.get(wf,qo,To.Self))}retrieve(i,e){return this.get(i,e.optional?et:ph,e)}destroy(){sp(this),this._destroyed=!0;const i=Be(null);try{for(const n of this._ngOnDestroyHooks)n.ngOnDestroy();const e=this._onDestroyHooks;this._onDestroyHooks=[];for(const n of e)n()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Be(i)}}onDestroy(i){return sp(this),this._onDestroyHooks.push(i),()=>this.removeOnDestroy(i)}runInContext(i){sp(this);const e=pe(this),n=Ya(void 0);try{return i()}finally{pe(e),Ya(n)}}get(i,e=ph,n=To.Default){if(sp(this),i.hasOwnProperty(V_))return i[V_](this);n=tu(n);const r=pe(this),u=Ya(void 0);try{if(!(n&To.SkipSelf)){let I=this.records.get(i);if(void 0===I){const V=function Tf(t){return"function"==typeof t||"object"==typeof t&&t instanceof yt}(i)&&hh(i);I=V&&this.injectableDefInScope(V)?lp(rr(i),to):null,this.records.set(i,I)}if(null!=I)return this.hydrate(i,I,n)}return(n&To.Self?Sf():this.parent).get(i,e=n&To.Optional&&e===ph?null:e)}catch(y){if("NullInjectorError"===y.name){if((y[eu]=y[eu]||[]).unshift(Yo(i)),r)throw y;return function js(t,i,e,n){const o=t[eu];throw i[pi]&&o.unshift(i[pi]),t.message=function pn(t,i,e,n=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.slice(2):t;let o=Yo(i);if(Array.isArray(i))o=i.map(Yo).join(" -> ");else if("object"==typeof i){let r=[];for(let u in i)if(i.hasOwnProperty(u)){let y=i[u];r.push(u+":"+("string"==typeof y?JSON.stringify(y):Yo(y)))}o=`{${r.join(", ")}}`}return`${e}${n?"("+n+")":""}[${o}]: ${t.replace(Jn,"\n ")}`}("\n"+t.message,o,e,n),t.ngTokenPath=o,t[eu]=null,t}(y,i,"R3InjectorError",this.source)}throw y}finally{Ya(u),pe(r)}}resolveInjectorInitializers(){const i=Be(null),e=pe(this),n=Ya(void 0);try{const r=this.get(Hc,qo,To.Self);for(const u of r)u()}finally{pe(e),Ya(n),Be(i)}}toString(){const i=[],e=this.records;for(const n of e.keys())i.push(Yo(n));return`R3Injector[${i.join(", ")}]`}processProvider(i){let e=yd(i=eo(i))?i:eo(i&&i.provide);const n=function Zb(t){return bh(t)?lp(void 0,t.useValue):lp(Z_(t),to)}(i);if(!yd(i)&&!0===i.multi){let o=this.records.get(e);o||(o=lp(void 0,to,!0),o.factory=()=>yf(o.multi),this.records.set(e,o)),e=i,o.multi.push(i)}this.records.set(e,n)}hydrate(i,e,n){const o=Be(null);try{return e.value===qb?C0(Yo(i)):e.value===to&&(e.value=qb,e.value=e.factory(void 0,n)),"object"==typeof e.value&&e.value&&function hw(t){return null!==t&&"object"==typeof t&&"function"==typeof t.ngOnDestroy}(e.value)&&this._ngOnDestroyHooks.add(e.value),e.value}finally{Be(o)}}injectableDefInScope(i){if(!i.providedIn)return!1;const e=eo(i.providedIn);return"string"==typeof e?"any"===e||this.scopes.has(e):this.injectorDefTypes.has(e)}removeOnDestroy(i){const e=this._onDestroyHooks.indexOf(i);-1!==e&&this._onDestroyHooks.splice(e,1)}}function rr(t){const i=hh(t),e=null!==i?i.factory:ql(t);if(null!==e)return e;if(t instanceof yt)throw new ct(204,!1);if(t instanceof Function)return function Wb(t){if(t.length>0)throw new ct(204,!1);const e=function zb(t){return t&&(t[ep]||t[mf])||null}(t);return null!==e?()=>e.factory(t):()=>new t}(t);throw new ct(204,!1)}function Z_(t,i,e){let n;if(yd(t)){const o=eo(t);return ql(o)||rr(o)}if(bh(t))n=()=>eo(t.useValue);else if(function Cf(t){return!(!t||!t.useFactory)}(t))n=()=>t.useFactory(...yf(t.deps||[]));else if(function cm(t){return!(!t||!t.useExisting)}(t))n=(o,r)=>xn(eo(t.useExisting),void 0!==r&&r&To.Optional?To.Optional:void 0);else{const o=eo(t&&(t.useClass||t.provide));if(!function I0(t){return!!t.deps}(t))return ql(o)||rr(o);n=()=>new o(...yf(t.deps))}return n}function sp(t){if(t.destroyed)throw new ct(205,!1)}function lp(t,i,e=!1){return{factory:t,value:i,multi:e?[]:void 0}}function cp(t,i){for(const e of t)Array.isArray(e)?cp(e,i):e&&np(e)?cp(e.\u0275providers,i):i(e)}function fc(t,i){let e;t instanceof ap?(sp(t),e=t):e=new j_(t);const o=pe(e),r=Ya(void 0);try{return i()}finally{pe(o),Ya(r)}}function gl(){return void 0!==Jd()||null!=ue()}function vh(t){if(!gl())throw new ct(-203,!1)}function Zr(t){return Array.isArray(t)&&"object"==typeof t[1]}function Ka(t){return Array.isArray(t)&&!0===t[1]}function eg(t){return!!(4&t.flags)}function xd(t){return t.componentOffset>-1}function au(t){return!(1&~t.flags)}function yl(t){return!!t.template}function En(t){return!!(512&t[2])}function vl(t){return!(256&~t[2])}class og{previousValue;currentValue;firstChange;constructor(i,e,n){this.previousValue=i,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function pm(t,i,e,n){null!==i?i.applyValueToInputSignal(i,n):t[e]=n}const go=(()=>{const t=()=>ar;return t.ngInherit=!0,t})();function ar(t){return t.type.prototype.ngOnChanges&&(t.setInput=Mf),rg}function rg(){const t=ag(this),i=t?.current;if(i){const e=t.previous;if(e===Uc)t.previous=i;else for(let n in i)e[n]=i[n];t.current=null,this.ngOnChanges(i)}}function Mf(t,i,e,n,o){const r=this.declaredInputs[n],u=ag(t)||function kf(t,i){return t[Af]=i}(t,{previous:Uc,current:null}),y=u.current||(u.current={}),I=u.previous,V=I[r];y[r]=new og(V&&V.currentValue,e,I===Uc),pm(t,i,o,e)}const Af="__ngSimpleChanges__";function ag(t){return t[Af]||null}function jo(t){for(;Array.isArray(t);)t=t[0];return t}function lt(t,i){return jo(i[t])}function xl(t,i){return jo(i[t.index])}function Ou(t,i){return t.data[i]}function Th(t,i){return t[i]}function lg(t,i,e,n){e>=t.data.length&&(t.data[e]=null,t.blueprint[e]=null),i[e]=n}function wl(t,i){const e=i[t];return Zr(e)?e:e[0]}function ny(t){return!(128&~t[2])}function bc(t,i){return null==i?null:t[i]}function Rf(t){t[17]=0}function su(t){1024&t[2]||(t[2]|=1024,ny(t)&&Lu(t))}function _p(t){return!!(9216&t[2]||t[24]?.dirty)}function Pu(t){t[10].changeDetectionScheduler?.notify(8),64&t[2]&&(t[2]|=1024),_p(t)&&Lu(t)}function Lu(t){t[10].changeDetectionScheduler?.notify(0);let i=lu(t);for(;null!==i&&!(8192&i[2])&&(i[2]|=8192,ny(i));)i=lu(i)}function yc(t,i){if(vl(t))throw new ct(911,!1);null===t[21]&&(t[21]=[]),t[21].push(i)}function lu(t){const i=t[3];return Ka(i)?i[3]:i}function Ba(t){return t[7]??=[]}function iy(t){return t.cleanup??=[]}const si={lFrame:vm(null),bindingsEnabled:!0,skipHydrationRootTNode:null};let Cd=!1;function gp(){return si.bindingsEnabled}function Cl(){return null!==si.skipHydrationRootTNode}function Yt(){return si.lFrame.lView}function io(){return si.lFrame.tView}function fe(t){return si.lFrame.contextLView=t,t[8]}function ge(t){return si.lFrame.contextLView=null,t}function Lo(){let t=pg();for(;null!==t&&64===t.type;)t=t.parent;return t}function pg(){return si.lFrame.currentTNode}function Ir(t,i){const e=si.lFrame;e.currentTNode=t,e.isParent=i}function Lf(){return si.lFrame.isParent}function Ff(){si.lFrame.isParent=!1}function Nf(){return Cd}function Nu(t){const i=Cd;return Cd=t,i}function rl(){const t=si.lFrame;let i=t.bindingRootIndex;return-1===i&&(i=t.bindingRootIndex=t.tView.bindingStartIndex),i}function Sl(){return si.lFrame.bindingIndex++}function Dd(t){const i=si.lFrame,e=i.bindingIndex;return i.bindingIndex=i.bindingIndex+t,e}function ly(t,i){const e=si.lFrame;e.bindingIndex=e.bindingRootIndex=t,fg(i)}function fg(t){si.lFrame.currentDirectiveIndex=t}function gg(){return si.lFrame.currentQueryIndex}function Bf(t){si.lFrame.currentQueryIndex=t}function L0(t){const i=t[1];return 2===i.type?i.declTNode:1===i.type?t[5]:null}function ym(t,i,e){if(e&To.SkipSelf){let o=i,r=t;for(;!(o=o.parent,null!==o||e&To.Host||(o=L0(r),null===o||(r=r[14],10&o.type))););if(null===o)return!1;i=o,t=r}const n=si.lFrame=Yl();return n.currentTNode=i,n.lView=t,!0}function vp(t){const i=Yl(),e=t[1];si.lFrame=i,i.currentTNode=e.firstChild,i.lView=t,i.tView=e,i.contextLView=t,i.bindingIndex=e.bindingStartIndex,i.inI18n=!1}function Yl(){const t=si.lFrame,i=null===t?null:t.child;return null===i?vm(t):i}function vm(t){const i={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=i),i}function cy(){const t=si.lFrame;return si.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const F0=cy;function dy(){const t=cy();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function hs(){return si.lFrame.selectedIndex}function xp(t){si.lFrame.selectedIndex=t}function vr(){const t=si.lFrame;return Ou(t.tView,t.selectedIndex)}function Va(){si.lFrame.currentNamespace="svg"}function cu(){!function bg(){si.lFrame.currentNamespace=null}()}let xm=!0;function Er(){return xm}function Qa(t){xm=t}function wp(t,i){for(let e=i.directiveStart,n=i.directiveEnd;e=n)break}else i[I]<0&&(t[17]+=65536),(y>14>16&&(3&t[2])===i&&(t[2]+=16384,z0(y,r)):z0(y,r)}class Ed{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(i,e,n){this.factory=i,this.canSeeViewProviders=e,this.injectImpl=n}}function B0(t){return 3===t||4===t||6===t}function Hf(t){return 64===t.charCodeAt(0)}function Dp(t,i){if(null!==i&&0!==i.length)if(null===t||0===t.length)t=i.slice();else{let e=-1;for(let n=0;ni){u=r-1;break}}}for(;r>16}(t),n=i;for(;e>0;)n=n[14],e--;return n}let Sm=!0;function Tl(t){const i=Sm;return Sm=t,i}let Ep=0;const $c={};function kd(t,i){const e=U0(t,i);if(-1!==e)return e;const n=i[1];n.firstCreatePass&&(t.injectorIndex=i.length,hy(n.data,t),hy(i,null),hy(n.blueprint,null));const o=Mp(t,i),r=t.injectorIndex;if(Eh(o)){const u=Cm(o),y=du(o,i),I=y[1].data;for(let V=0;V<8;V++)i[r+V]=y[u+V]|I[u+V]}return i[r+8]=o,r}function hy(t,i){t.push(0,0,0,0,0,0,0,0,i)}function U0(t,i){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===i[t.injectorIndex+8]?-1:t.injectorIndex}function Mp(t,i){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let e=0,n=null,o=i;for(;null!==o;){if(n=H(o),null===n)return-1;if(e++,o=o[14],-1!==n.injectorIndex)return n.injectorIndex|e<<16}return-1}function Gc(t,i,e){!function Co(t,i,e){let n;"string"==typeof e?n=e.charCodeAt(0)||0:e.hasOwnProperty(Ts)&&(n=e[Ts]),null==n&&(n=e[Ts]=Ep++);const o=255&n;i.data[t+(o>>5)]|=1<=0?255&i:D:i}(e);if("function"==typeof r){if(!ym(i,t,n))return n&To.Host?sl(o,0,n):Xl(i,e,n,o);try{let u;if(u=r(n),null!=u||n&To.Optional)return u;Bb()}finally{F0()}}else if("number"==typeof r){let u=null,y=U0(t,i),I=-1,V=n&To.Host?i[15][5]:null;for((-1===y||n&To.SkipSelf)&&(I=-1===y?Mp(t,i):i[y+8],-1!==I&&c(n,!1)?(u=i[1],y=Cm(I),i=du(I,i)):y=-1);-1!==y;){const q=i[1];if(s(r,y,q.data)){const ee=Xr(y,i,e,u,n,V);if(ee!==$c)return ee}I=i[y+8],-1!==I&&c(n,i[1].data[y+8]===V)&&s(r,y,i)?(u=q,y=Cm(I),i=du(I,i)):y=-1}}return o}function Xr(t,i,e,n,o,r){const u=i[1],y=u.data[t+8],q=Tm(y,u,e,null==n?xd(y)&&Sm:n!=u&&!!(3&y.type),o&To.Host&&r===y);return null!==q?uu(i,u,q,y,o):$c}function Tm(t,i,e,n,o){const r=t.providerIndexes,u=i.data,y=1048575&r,I=t.directiveStart,q=r>>20,me=o?y+q:t.directiveEnd;for(let he=n?y:y+q;he=I&&Ce.type===e)return he}if(o){const he=u[I];if(he&&yl(he)&&he.type===e)return I}return null}function uu(t,i,e,n,o){let r=t[e];const u=i.data;if(r instanceof Ed){const y=r;y.resolving&&C0(function er(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():_o(t)}(u[e]));const I=Tl(y.canSeeViewProviders);y.resolving=!0;const q=y.injectImpl?Ya(y.injectImpl):null;ym(t,n,To.Default);try{r=t[e]=y.factory(void 0,o,u,t,n),i.firstCreatePass&&e>=n.directiveStart&&function wm(t,i,e){const{ngOnChanges:n,ngOnInit:o,ngDoCheck:r}=i.type.prototype;if(n){const u=ar(i);(e.preOrderHooks??=[]).push(t,u),(e.preOrderCheckHooks??=[]).push(t,u)}o&&(e.preOrderHooks??=[]).push(0-t,o),r&&((e.preOrderHooks??=[]).push(t,r),(e.preOrderCheckHooks??=[]).push(t,r))}(e,u[e],i)}finally{null!==q&&Ya(q),Tl(I),y.resolving=!1,F0()}}return r}function s(t,i,e){return!!(e[i+(t>>5)]&1<{const i=t.prototype.constructor,e=i[bd]||B(i),n=Object.prototype;let o=Object.getPrototypeOf(t.prototype).constructor;for(;o&&o!==n;){const r=o[bd]||B(o);if(r&&r!==e)return r;o=Object.getPrototypeOf(o)}return r=>new r})}function B(t){return dh(t)?()=>{const i=B(eo(t));return i&&i()}:ql(t)}function H(t){const i=t[1],e=i.type;return 2===e?i.declTNode:1===e?t[5]:null}function G(t){return function Rd(t,i){if("class"===i)return t.classes;if("style"===i)return t.styles;const e=t.attrs;if(e){const n=e.length;let o=0;for(;oxn(jb)});static __NG_ELEMENT_ID__=-1}class Mt{attributeName;constructor(i){this.attributeName=i}__NG_ELEMENT_ID__=()=>G(this.attributeName);toString(){return`HostAttributeToken ${this.attributeName}`}}new yt("").__NG_ELEMENT_ID__=t=>{const i=Lo();if(null===i)throw new ct(204,!1);if(2&i.type)return i.value;if(t&To.Optional)return null;throw new ct(204,!1)};const wt=!1;let Ut=(()=>class t{static __NG_ELEMENT_ID__=zt;static __NG_ENV_ID__=e=>e})();class tt extends Ut{_lView;constructor(i){super(),this._lView=i}onDestroy(i){const e=this._lView;return vl(e)?(i(),()=>{}):(yc(e,i),()=>function wd(t,i){if(null===t[21])return;const e=t[21].indexOf(i);-1!==e&&t[21].splice(e,1)}(e,i))}}function zt(){return new tt(Yt())}class xt{}const rn=new yt("",{providedIn:"root",factory:()=>!1}),Ft=new yt(""),Kt=new yt("");let en=(()=>{class t{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new it(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const e=this.taskId++;return this.pendingTasks.add(e),e}has(e){return this.pendingTasks.has(e)}remove(e){this.pendingTasks.delete(e),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>new t})}return t})();const Tt=class Rn extends Ee{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(i=!1){super(),this.__isAsync=i,gl()&&(this.destroyRef=Y(Ut,{optional:!0})??void 0,this.pendingTasks=Y(en,{optional:!0})??void 0)}emit(i){const e=Be(null);try{super.next(i)}finally{Be(e)}}subscribe(i,e,n){let o=i,r=e||(()=>null),u=n;if(i&&"object"==typeof i){const I=i;o=I.next?.bind(I),r=I.error?.bind(I),u=I.complete?.bind(I)}this.__isAsync&&(r=this.wrapInTimeout(r),o&&(o=this.wrapInTimeout(o)),u&&(u=this.wrapInTimeout(u)));const y=super.subscribe({next:o,error:r,complete:u});return i instanceof ai&&i.add(y),y}wrapInTimeout(i){return e=>{const n=this.pendingTasks?.add();setTimeout(()=>{try{i(e)}finally{void 0!==n&&this.pendingTasks?.remove(n)}})}}};function Wn(...t){}function Xn(t){let i,e;function n(){t=Wn;try{void 0!==e&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(e),void 0!==i&&clearTimeout(i)}catch{}}return i=setTimeout(()=>{t(),n()}),"function"==typeof requestAnimationFrame&&(e=requestAnimationFrame(()=>{t(),n()})),()=>n()}function vi(t){return queueMicrotask(()=>t()),()=>{t=Wn}}const Fo="isAngularZone",_r=Fo+"_ID";let ur=0;class tn{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Tt(!1);onMicrotaskEmpty=new Tt(!1);onStable=new Tt(!1);onError=new Tt(!1);constructor(i){const{enableLongStackTrace:e=!1,shouldCoalesceEventChangeDetection:n=!1,shouldCoalesceRunChangeDetection:o=!1,scheduleInRootZone:r=wt}=i;if(typeof Zone>"u")throw new ct(908,!1);Zone.assertZonePatched();const u=this;u._nesting=0,u._outer=u._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(u._inner=u._inner.fork(new Zone.TaskTrackingZoneSpec)),e&&Zone.longStackTraceZoneSpec&&(u._inner=u._inner.fork(Zone.longStackTraceZoneSpec)),u.shouldCoalesceEventChangeDetection=!o&&n,u.shouldCoalesceRunChangeDetection=o,u.callbackScheduled=!1,u.scheduleInRootZone=r,function Mo(t){const i=()=>{!function no(t){function i(){Xn(()=>{t.callbackScheduled=!1,Do(t),t.isCheckStableRunning=!0,$n(t),t.isCheckStableRunning=!1})}t.isCheckStableRunning||t.callbackScheduled||(t.callbackScheduled=!0,t.scheduleInRootZone?Zone.root.run(()=>{i()}):t._outer.run(()=>{i()}),Do(t))}(t)},e=ur++;t._inner=t._inner.fork({name:"angular",properties:{[Fo]:!0,[_r]:e,[_r+e]:!0},onInvokeTask:(n,o,r,u,y,I)=>{if(function Ta(t){return $s(t,"__ignore_ng_zone__")}(I))return n.invokeTask(r,u,y,I);try{return xr(t),n.invokeTask(r,u,y,I)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===u.type||t.shouldCoalesceRunChangeDetection)&&i(),Ua(t)}},onInvoke:(n,o,r,u,y,I,V)=>{try{return xr(t),n.invoke(r,u,y,I,V)}finally{t.shouldCoalesceRunChangeDetection&&!t.callbackScheduled&&!function vc(t){return $s(t,"__scheduler_tick__")}(I)&&i(),Ua(t)}},onHasTask:(n,o,r,u)=>{n.hasTask(r,u),o===r&&("microTask"==u.change?(t._hasPendingMicrotasks=u.microTask,Do(t),$n(t)):"macroTask"==u.change&&(t.hasPendingMacrotasks=u.macroTask))},onHandleError:(n,o,r,u)=>(n.handleError(r,u),t.runOutsideAngular(()=>t.onError.emit(u)),!1)})}(u)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get(Fo)}static assertInAngularZone(){if(!tn.isInAngularZone())throw new ct(909,!1)}static assertNotInAngularZone(){if(tn.isInAngularZone())throw new ct(909,!1)}run(i,e,n){return this._inner.run(i,e,n)}runTask(i,e,n,o){const r=this._inner,u=r.scheduleEventTask("NgZoneEvent: "+o,i,yo,Wn,Wn);try{return r.runTask(u,e,n)}finally{r.cancelTask(u)}}runGuarded(i,e,n){return this._inner.runGuarded(i,e,n)}runOutsideAngular(i){return this._outer.run(i)}}const yo={};function $n(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Do(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&!0===t.callbackScheduled)}function xr(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Ua(t){t._nesting--,$n(t)}class aa{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Tt;onMicrotaskEmpty=new Tt;onStable=new Tt;onError=new Tt;run(i,e,n){return i.apply(e,n)}runGuarded(i,e,n){return i.apply(e,n)}runOutsideAngular(i){return i()}runTask(i,e,n,o){return i.apply(e,n)}}function $s(t,i){return!(!Array.isArray(t)||1!==t.length)&&!0===t[0]?.data?.[i]}class bo{_console=console;handleError(i){this._console.error("ERROR",i)}}const Xo=new yt("",{providedIn:"root",factory:()=>{const t=Y(tn),i=Y(bo);return e=>t.runOutsideAngular(()=>i.handleError(e))}});function Ko(t,i){return Hi(t,i)}const qc=(Ko.required=function ll(t){return Hi(Ai,t)},Ko);function lc(){return fs(Lo(),Yt())}function fs(t,i){return new Pn(xl(t,i))}let Pn=(()=>class t{nativeElement;constructor(e){this.nativeElement=e}static __NG_ELEMENT_ID__=lc})();function xc(t){return t instanceof Pn?t.nativeElement:t}function Gs(t){return"function"==typeof t&&void 0!==t[Pt]}function Da(t,i){const e=function Ul(t,i){const e=Object.create(yr);e.value=t,void 0!==i&&(e.equal=i);const n=()=>(un(e),e.value);return n[Pt]=e,n}(t,i?.equal),n=e[Pt];return e.set=o=>Ns(n,o),e.update=o=>function Ze(t,i){Dn()||Oc(t),Ns(t,i(t.value))}(n,o),e.asReadonly=hu.bind(e),e}function hu(){const t=this[Pt];if(void 0===t.readonlyFn){const i=()=>this();i[Pt]=t,t.readonlyFn=i}return t.readonlyFn}function Ap(t){return Gs(t)&&"function"==typeof t.set}function vg(){return this._results[Symbol.iterator]()}class Od{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Ee}constructor(i=!1){this._emitDistinctChangesOnly=i}get(i){return this._results[i]}map(i){return this._results.map(i)}filter(i){return this._results.filter(i)}find(i){return this._results.find(i)}reduce(i,e){return this._results.reduce(i,e)}forEach(i){this._results.forEach(i)}some(i){return this._results.some(i)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(i,e){this.dirty=!1;const n=function cs(t){return t.flat(Number.POSITIVE_INFINITY)}(i);(this._changesDetected=!function Hb(t,i,e){if(t.length!==i.length)return!1;for(let n=0;nbA}),bA="ng",kw=new yt(""),xy=new yt("",{providedIn:"platform",factory:()=>"unknown"}),Kr=new yt(""),Rw=new yt("",{providedIn:"root",factory:()=>Bu().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null}),Lw=new yt("",{providedIn:"root",factory:()=>!1});var Iy=function(t){return t[t.CHANGE_DETECTION=0]="CHANGE_DETECTION",t[t.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",t}(Iy||{});const Eg=new yt(""),wD=new Set;function Zc(t){wD.has(t)||(wD.add(t),performance?.mark?.("mark_feature_usage",{detail:{feature:t}}))}let Ey=(()=>class t{view;node;constructor(e,n){this.view=e,this.node=n}static __NG_ELEMENT_ID__=km})();function km(){return new Ey(Yt(),Lo())}var kh=function(t){return t[t.EarlyRead=0]="EarlyRead",t[t.Write=1]="Write",t[t.MixedReadWrite=2]="MixedReadWrite",t[t.Read=3]="Read",t}(kh||{});let Gf=(()=>{class t{impl=null;execute(){this.impl?.execute()}static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>new t})}return t})();const My=[kh.EarlyRead,kh.Write,kh.MixedReadWrite,kh.Read];let Mg=(()=>{class t{ngZone=Y(tn);scheduler=Y(xt);errorHandler=Y(bo,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){Y(Eg,{optional:!0})}execute(){this.executing=!0;for(const n of My)for(const o of this.sequences)if(!o.erroredOrDestroyed&&o.hooks[n])try{o.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>(0,o.hooks[n])(o.pipelinedValue),o.snapshot))}catch(r){o.erroredOrDestroyed=!0,this.errorHandler?.handleError(r)}this.executing=!1;for(const n of this.sequences)n.afterRun(),n.once&&(this.sequences.delete(n),n.destroy());for(const n of this.deferredRegistrations)this.sequences.add(n);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear()}register(e){const{view:n}=e;void 0!==n?((n[25]??=[]).push(e),Lu(n),n[2]|=8192):this.executing?this.deferredRegistrations.add(e):this.addSequence(e)}addSequence(e){this.sequences.add(e),this.scheduler.notify(7)}unregister(e){this.executing&&this.sequences.has(e)?(e.erroredOrDestroyed=!0,e.pipelinedValue=void 0,e.once=!0):(this.sequences.delete(e),this.deferredRegistrations.delete(e))}maybeTrace(e,n){return n?n.run(Iy.AFTER_NEXT_RENDER,e):e()}static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>new t})}return t})();class zw{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(i,e,n,o,r,u=null){this.impl=i,this.hooks=e,this.view=n,this.once=o,this.snapshot=u,this.unregisterOnDestroy=r?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();const i=this.view?.[25];i&&(this.view[25]=i.filter(e=>e!==this))}}function Ag(t,i){!i?.injector&&vh();const e=i?.injector??Y(Ke);return Zc("NgAfterRender"),SD(t,e,i,!1)}function As(t,i){!i?.injector&&vh();const e=i?.injector??Y(Ke);return Zc("NgAfterNextRender"),SD(t,e,i,!0)}function SD(t,i,e,n){const o=i.get(Gf);o.impl??=i.get(Mg);const r=i.get(Eg,null,{optional:!0}),u=e?.phase??kh.MixedReadWrite,y=!0!==e?.manualCleanup?i.get(Ut):null,I=i.get(Ey,null,{optional:!0}),V=new zw(o.impl,function CD(t,i){if(t instanceof Function){const e=[void 0,void 0,void 0,void 0];return e[i]=t,e}return[t.earlyRead,t.write,t.mixedReadWrite,t.read]}(t,u),I?.view,n,y,r?.snapshot(null));return o.impl.register(V),V}function $y(t,i){const e=t.contentQueries;if(null!==e){const n=Be(null);try{for(let o=0;ot,createScript:t=>t,createScriptURL:t=>t})}catch{}return Op}()?.createHTML(t)||t}function sC(){if(void 0===Gg&&(Gg=null,Or.trustedTypes))try{Gg=Or.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t})}catch{}return Gg}function qg(t){return sC()?.createHTML(t)||t}function lC(t){return sC()?.createScriptURL(t)||t}class Nm{changingThisBreaksApplicationSecurity;constructor(i){this.changingThisBreaksApplicationSecurity=i}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${ni})`}}class d1 extends Nm{getTypeName(){return"HTML"}}class cC extends Nm{getTypeName(){return"Style"}}class LA extends Nm{getTypeName(){return"Script"}}class WD extends Nm{getTypeName(){return"URL"}}class Gy extends Nm{getTypeName(){return"ResourceURL"}}function Xc(t){return t instanceof Nm?t.changingThisBreaksApplicationSecurity:t}function Fh(t,i){const e=function zm(t){return t instanceof Nm&&t.getTypeName()||null}(t);if(null!=e&&e!==i){if("ResourceURL"===e&&"URL"===i)return!0;throw new Error(`Required a safe ${i}, got a ${e} (see ${ni})`)}return e===i}class NA{inertDocumentHelper;constructor(i){this.inertDocumentHelper=i}getInertBodyElement(i){i=""+i;try{const e=(new window.DOMParser).parseFromString($g(i),"text/html").body;return null===e?this.inertDocumentHelper.getInertBodyElement(i):(e.firstChild?.remove(),e)}catch{return null}}}class zA{defaultDoc;inertDocument;constructor(i){this.defaultDoc=i,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(i){const e=this.inertDocument.createElement("template");return e.innerHTML=$g(i),e}}const u1=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function h1(t){return(t=String(t)).match(u1)?t:"unsafe:"+t}function Nh(t){const i={};for(const e of t.split(","))i[e]=!0;return i}function Zg(...t){const i={};for(const e of t)for(const n in e)e.hasOwnProperty(n)&&(i[n]=!0);return i}const ZD=Nh("area,br,col,hr,img,wbr"),dC=Nh("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),YD=Nh("rp,rt"),uC=Zg(ZD,Zg(dC,Nh("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Zg(YD,Nh("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Zg(YD,dC)),hC=Nh("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Ky=Zg(hC,Nh("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Nh("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),p1=Nh("script,style,template");class UA{sanitizedSomething=!1;buf=[];sanitizeChildren(i){let e=i.firstChild,n=!0,o=[];for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)o.push(e),e=m1(e);else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let r=_C(e);if(r){e=r;break}e=o.pop()}return this.buf.join("")}startElement(i){const e=gC(i).toLowerCase();if(!uC.hasOwnProperty(e))return this.sanitizedSomething=!0,!p1.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=i.attributes;for(let o=0;o"),!0}endElement(i){const e=gC(i).toLowerCase();uC.hasOwnProperty(e)&&!ZD.hasOwnProperty(e)&&(this.buf.push(""))}chars(i){this.buf.push(f1(i))}}function _C(t){const i=t.nextSibling;if(i&&t!==i.previousSibling)throw bC(i);return i}function m1(t){const i=t.firstChild;if(i&&function fC(t,i){return(t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(t,i))throw bC(i);return i}function gC(t){const i=t.nodeName;return"string"==typeof i?i:"FORM"}function bC(t){return new Error(`Failed to sanitize html because the element is clobbered: ${t.outerHTML}`)}const yC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,XD=/([^\#-~ |!])/g;function f1(t){return t.replace(/&/g,"&").replace(yC,function(i){return"&#"+(1024*(i.charCodeAt(0)-55296)+(i.charCodeAt(1)-56320)+65536)+";"}).replace(XD,function(i){return"&#"+i.charCodeAt(0)+";"}).replace(//g,">")}let Qf;function vC(t,i){let e=null;try{Qf=Qf||function Xy(t){const i=new zA(t);return function Wg(){try{return!!(new window.DOMParser).parseFromString($g(""),"text/html")}catch{return!1}}()?new NA(i):i}(t);let n=i?String(i):"";e=Qf.getInertBodyElement(n);let o=5,r=n;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,n=r,r=e.innerHTML,e=Qf.getInertBodyElement(n)}while(n!==r);return $g((new UA).sanitizeChildren(_1(e)||e))}finally{if(e){const n=_1(e)||e;for(;n.firstChild;)n.firstChild.remove()}}}function _1(t){return"content"in t&&function KD(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var El=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}(El||{});function g1(t){const i=Yg();return i?qg(i.sanitize(El.HTML,t)||""):Fh(t,"HTML")?qg(Xc(t)):vC(Bu(),_o(t))}function Jf(t){const i=Yg();return i?i.sanitize(El.URL,t)||"":Fh(t,"URL")?Xc(t):h1(_o(t))}function b1(t){const i=Yg();if(i)return lC(i.sanitize(El.RESOURCE_URL,t)||"");if(Fh(t,"ResourceURL"))return lC(Xc(t));throw new ct(904,!1)}function Yg(){const t=Yt();return t&&t[10].sanitizer}const JD=/^>|^->||--!>|)/g;function Lp(t){return t.ownerDocument.defaultView}function IC(t){return t.ownerDocument}function mu(t){return t instanceof Function?t():t}function D1(t,i,e){let n=t.length;for(;;){const o=t.indexOf(i,e);if(-1===o)return o;if(0===o||t.charCodeAt(o-1)<=32){const r=i.length;if(o+r===n||t.charCodeAt(o+r)<=32)return o}e=o+1}}const I1="ng-template";function Kg(t,i,e,n){let o=0;if(n){for(;o-1){let r;for(;++or?"":o[q+1].toLowerCase(),2&n&&V!==ee){if(fu(n))return!1;u=!0}}}}else{if(!u&&!fu(n)&&!fu(I))return!1;if(u&&fu(I))continue;u=!1,n=I|1&n}}return fu(n)||u}function fu(t){return!(1&t)}function p2(t,i,e,n){if(null===i)return-1;let o=0;if(n||!e){let r=!1;for(;o-1)for(e++;e0?'="'+y+'"':"")+"]"}else 8&n?o+="."+u:4&n&&(o+=" "+u);else""!==o&&!fu(u)&&(i+=kC(r,o),o=""),n=u,r=r||!fu(n);e++}return""!==o&&(i+=kC(r,o)),i}const Ao={};function Qg(t,i){return t.createComment(function CC(t){return t.replace(JD,i=>i.replace(e2,"\u200b$1\u200b"))}(i))}function Fp(t,i,e){return t.createElement(i,e)}function $u(t,i,e,n,o){t.insertBefore(i,e,n,o)}function A1(t,i,e){t.appendChild(i,e)}function tv(t,i,e,n,o){null!==n?$u(t,i,e,n,o):A1(t,i,e)}function RC(t,i,e){const{mergedAttrs:n,classes:o,styles:r}=e;null!==n&&function gw(t,i,e){let n=0;for(;n26&&rv(t,i,26,!1),e(n,o)}finally{xp(r)}}function P1(t,i,e){(function Jg(t,i,e){const n=e.directiveStart,o=e.directiveEnd;xd(e)&&function ek(t,i,e){const n=xl(i,t),o=function f2(t){const i=t.tView;return null===i||i.incompleteFirstPass?t.tView=Bm(1,null,t.template,t.decls,t.vars,t.directiveDefs,t.pipeDefs,t.viewQuery,t.schemas,t.consts,t.id):i}(e),r=t[10].rendererFactory,u=PC(t,iv(t,o,null,OC(e),n,i,null,r.createRenderer(n,e),null,null,null));t[i.index]=u}(i,e,t.data[n+e.componentOffset]),t.firstCreatePass||kd(e,i);const r=e.initialInputs;for(let u=n;unull;function Kc(t,i,e,n,o,r,u,y){if(y||!z1(i,t,e,n,o)){if(3&i.type){const I=xl(i,e);n=function ik(t){return"class"===t?"className":"for"===t?"htmlFor":"formaction"===t?"formAction":"innerHtml"===t?"innerHTML":"readonly"===t?"readOnly":"tabindex"===t?"tabIndex":t}(n),o=null!=u?u(o,i.value||"",n):o,r.setProperty(I,n,o)}}else xd(i)&&function ok(t,i){const e=wl(i,t);16&e[2]||(e[2]|=64)}(e,i.index)}function rk(t,i){null!==t.hostBindings&&t.hostBindings(1,i)}function lv(t,i){const e=t.directiveRegistry;let n=null;if(e)for(let o=0;o=0?n[y]():n[-y].unsubscribe(),u+=2}else e[u].call(n[e[u+1]]);null!==n&&(i[7]=null);const o=i[21];if(null!==o){i[21]=null;for(let u=0;u{Lu(t.lView)},consumerOnSignalRead(){this.lView[24]=this}},hk={...vn,consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:t=>{let i=lu(t.lView);for(;i&&!j1(i[1]);)i=lu(i);i&&su(i)},consumerOnSignalRead(){this.lView[24]=this}};function j1(t){return 2!==t.type}function _u(t){if(null===t[23])return;let i=!0;for(;i;){let e=!1;for(const n of t[23])n.dirty&&(e=!0,null===n.zone||Zone.current===n.zone?n.run():n.zone.run(()=>n.run()));i=e&&!!(8192&t[2])}}function $1(t,i=!0,e=0){const o=t[10].rendererFactory;o.begin?.();try{!function qu(t,i){const e=Nf();try{Nu(!0),YC(t,i);let n=0;for(;_p(t);){if(100===n)throw new ct(103,!1);n++,YC(t,1)}}finally{Nu(e)}}(t,e)}catch(u){throw i&&function N1(t,i){const e=t[9],n=e?e.get(bo,null):null;n&&n.handleError(i)}(t,u),u}finally{o.end?.()}}function P2(t,i,e,n){if(vl(i))return;const o=i[2];vp(i);let y=!0,I=null,V=null;j1(t)?(V=function nb(t){return t[24]??function dv(t){const i=ga.pop()??Object.create(R2);return i.lView=t,i}(t)}(i),I=hn(V)):null===function kn(){return h}()?(y=!1,V=function uk(t){const i=t[24]??Object.create(hk);return i.lView=t,i}(i),I=hn(V)):i[24]&&(sn(i[24]),i[24]=null);try{Rf(i),function bm(t){return si.lFrame.bindingIndex=t}(t.bindingStartIndex),null!==e&&av(t,i,e,2,n);const q=!(3&~o);if(q){const he=t.preOrderCheckHooks;null!==he&&Vf(i,he,null)}else{const he=t.preOrderHooks;null!==he&&Uf(i,he,0,null),Cp(i,0)}if(function gu(t){for(let i=Tw(t);null!==i;i=by(i)){if(!(2&i[2]))continue;const e=i[9];for(let n=0;n0&&(e[o-1][4]=i),n0&&(t[e-1][4]=n[4]);const r=lm(t,10+i);!function zC(t,i){S2(t,i),i[0]=null,i[5]=null}(n[1],n);const u=r[18];null!==u&&u.detachView(r[1]),n[3]=null,n[4]=null,n[2]&=-129}return n}function s_(t,i){const e=t[9],n=i[3];(Zr(n)||i[15]!==n[3][15])&&(t[2]|=2),null===e?t[9]=[i]:e.push(i)}let ob=class{_lView;_cdRefInjectingView;notifyErrorHandler;_appRef=null;_attachedToViewContainer=!1;get rootNodes(){const i=this._lView,e=i[1];return tb(e,i,e.firstChild,[])}constructor(i,e,n=!0){this._lView=i,this._cdRefInjectingView=e,this.notifyErrorHandler=n}get context(){return this._lView[8]}set context(i){this._lView[8]=i}get destroyed(){return vl(this._lView)}destroy(){if(this._appRef)this._appRef.detachView(this);else if(this._attachedToViewContainer){const i=this._lView[3];if(Ka(i)){const e=i[8],n=e?e.indexOf(this):-1;n>-1&&(Bh(i,n),lm(e,n))}this._attachedToViewContainer=!1}Hm(this._lView[1],this._lView)}onDestroy(i){yc(this._lView,i)}markForCheck(){hv(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[2]&=-129}reattach(){Pu(this._lView),this._lView[2]|=128}detectChanges(){this._lView[2]|=1024,$1(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new ct(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;const i=En(this._lView),e=this._lView[16];null!==e&&!i&&BC(e,this._lView),S2(this._lView[1],this._lView)}attachToAppRef(i){if(this._attachedToViewContainer)throw new ct(902,!1);this._appRef=i;const e=En(this._lView),n=this._lView[16];null!==n&&!e&&s_(n,this._lView),Pu(this._lView)}},sa=(()=>class t{static __NG_ELEMENT_ID__=eS})();const pv=sa,F2=class extends pv{_declarationLView;_declarationTContainer;elementRef;constructor(i,e,n){super(),this._declarationLView=i,this._declarationTContainer=e,this.elementRef=n}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(i,e){return this.createEmbeddedViewImpl(i,e)}createEmbeddedViewImpl(i,e,n){const o=Vm(this._declarationLView,this._declarationTContainer,i,{embeddedViewInjector:e,dehydratedView:n});return new ob(o)}};function eS(){return q1(Lo(),Yt())}function q1(t,i){return 4&t.type?new F2(i,t,fs(t,i)):null}function d_(t,i,e,n,o){let r=t.data[i];if(null===r)r=function rS(t,i,e,n,o){const r=pg(),u=Lf(),I=t.data[i]=function aS(t,i,e,n,o,r){let u=i?i.injectorIndex:-1,y=0;return Cl()&&(y|=128),{type:e,index:n,insertBeforeIndex:null,injectorIndex:u,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:y,providerIndexes:0,value:o,attrs:r,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:i,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}(0,u?r:r&&r.parent,e,i,n,o);return function V2(t,i,e,n){null===t.firstChild&&(t.firstChild=i),null!==e&&(n?null==e.child&&null!==i.parent&&(e.child=i):null===e.next&&(e.next=i,i.prev=e))}(t,I,r,u),I}(t,i,e,n,o),function mg(){return si.lFrame.inI18n}()&&(r.flags|=32);else if(64&r.type){r.type=e,r.value=n,r.attrs=o;const u=function bp(){const t=si.lFrame,i=t.currentTNode;return t.isParent?i:i.parent}();r.injectorIndex=null===u?-1:u.injectorIndex}return Ir(r,!0),r}let h_=class{},ab=class{};class H2{resolveComponentFactory(i){throw Error(`No component factory found for ${Yo(i)}.`)}}let bv=class{static NULL=new H2};class Qc{}let Hr=(()=>class t{destroyNode=null;static __NG_ELEMENT_ID__=()=>function j2(){const t=Yt(),e=wl(Lo().index,t);return(Zr(e)?e:t)[11]}()})(),$2=(()=>{class t{static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>null})}return t})();const Sc={};class Ws{injector;parentInjector;constructor(i,e){this.injector=i,this.parentInjector=e}get(i,e,n){n=tu(n);const o=this.injector.get(i,Sc,n);return o!==Sc||e===Sc?o:this.parentInjector.get(i,e,n)}}function p_(t,i,e){let n=e?t.styles:null,o=e?t.classes:null,r=0;if(null!==i)for(let u=0;u0&&(e.directiveToIndex=new Map);for(let me=0;me0;){const e=t[--i];if("number"==typeof e&&e<0)return e}return 0})(u)!=y&&u.push(y),u.push(e,n,r)}}(t,i,n,ov(t,e,o.hostVars,Ao),o)}function x9(t,i,e){if(e){if(i.exportAs)for(let n=0;n{const[e,n,o]=t[i],r={propName:e,templateName:i,isSignal:!!(n&O1.SignalBased)};return o&&(r.transform=o),r})}(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=function S9(t){return Object.keys(t).map(i=>({propName:t[i],templateName:i}))}(this.componentDef.outputs),this.cachedOutputs}constructor(i,e){super(),this.componentDef=i,this.ngModule=e,this.componentType=i.type,this.selector=function QA(t){return t.map(KA).join(",")}(i.selectors),this.ngContentSelectors=i.ngContentSelectors??[],this.isBoundToModule=!!e}create(i,e,n,o){const r=Be(null);try{const u=this.componentDef,y=n?["ng-version","19.2.15"]:function JA(t){const i=[],e=[];let n=1,o=2;for(;n[this.componentDef],!0,0);me&&(RC(ee,me,je),Dl(me,he)),P1(I,he,je),aC(I,je,he),wF(I,je),void 0!==e&&function M9(t,i,e){const n=t.projection=[];for(let o=0;oclass t{static __NG_ELEMENT_ID__=A9})();function A9(){return DF(Lo(),Yt())}const k9=es,SF=class extends k9{_lContainer;_hostTNode;_hostLView;constructor(i,e,n){super(),this._lContainer=i,this._hostTNode=e,this._hostLView=n}get element(){return fs(this._hostTNode,this._hostLView)}get injector(){return new C(this._hostTNode,this._hostLView)}get parentInjector(){const i=Mp(this._hostTNode,this._hostLView);if(Eh(i)){const e=du(i,this._hostLView),n=Cm(i);return new C(e[1].data[n+8],e)}return new C(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(i){const e=TF(this._lContainer);return null!==e&&e[i]||null}get length(){return this._lContainer.length-10}createEmbeddedView(i,e,n){let o,r;"number"==typeof n?o=n:null!=n&&(o=n.index,r=n.injector);const y=i.createEmbeddedViewImpl(e||{},r,null);return this.insertImpl(y,o,Np(this._hostTNode,null)),y}createComponent(i,e,n,o,r){const u=i&&!function dp(t){return"function"==typeof t}(i);let y;if(u)y=e;else{const Ce=e||{};y=Ce.index,n=Ce.injector,o=Ce.projectableNodes,r=Ce.environmentInjector||Ce.ngModuleRef}const I=u?i:new hS(co(i)),V=n||this.parentInjector;if(!r&&null==I.ngModule){const je=(u?V:this.parentInjector).get(us,null);je&&(r=je)}co(I.componentType??{});const he=I.create(V,o,null,r);return this.insertImpl(he.hostView,y,Np(this._hostTNode,null)),he}insert(i,e){return this.insertImpl(i,e,!0)}insertImpl(i,e,n){const o=i._lView;if(function _w(t){return Ka(t[3])}(o)){const y=this.indexOf(i);if(-1!==y)this.detach(y);else{const I=o[3],V=new SF(I,I[5],I[3]);V.detach(V.indexOf(i))}}const r=this._adjustIndex(e),u=this._lContainer;return jm(u,o,r,n),i.attachToViewContainerRef(),fh(Sk(u),r,i),i}move(i,e){return this.insert(i,e)}indexOf(i){const e=TF(this._lContainer);return null!==e?e.indexOf(i):-1}remove(i){const e=this._adjustIndex(i,-1),n=Bh(this._lContainer,e);n&&(lm(Sk(this._lContainer),e),Hm(n[1],n))}detach(i){const e=this._adjustIndex(i,-1),n=Bh(this._lContainer,e);return n&&null!=lm(Sk(this._lContainer),e)?new ob(n):null}_adjustIndex(i,e=0){return i??this.length+e}};function TF(t){return t[8]}function Sk(t){return t[8]||(t[8]=[])}function DF(t,i){let e;const n=i[t.index];return Ka(n)?e=n:(e=KC(n,i,null,t),i[t.index]=e,PC(i,e)),IF(e,i,t,n),new SF(e,t,i)}let IF=function MF(t,i,e,n){if(t[7])return;let o;o=8&e.type?jo(n):function R9(t,i){const e=t[11],n=e.createComment(""),o=xl(i,t),r=e.parentNode(o);return $u(e,r,n,e.nextSibling(o),!1),n}(i,e),t[7]=o};class Dk{queryList;matches=null;constructor(i){this.queryList=i}clone(){return new Dk(this.queryList)}setDirty(){this.queryList.setDirty()}}class Ik{queries;constructor(i=[]){this.queries=i}createEmbeddedView(i){const e=i.queries;if(null!==e){const n=null!==i.contentQueries?i.contentQueries[0]:e.length,o=[];for(let r=0;ri.trim())}(i):i}}class Ek{queries;constructor(i=[]){this.queries=i}elementStart(i,e){for(let n=0;n0)n.push(u[y/2]);else{const V=r[y+1],q=i[-I];for(let ee=10;ee{n._dirtyCounter();const r=function H9(t,i){const e=t._lView,n=t._queryIndex;if(void 0===e||void 0===n||4&e[2])return i?void 0:qo;const o=kk(e,n),r=FF(e,n);return o.reset(r,xc),i?o.first:o._changesDetected||void 0===t._flatValue?t._flatValue=o.toArray():t._flatValue}(n,t);if(i&&void 0===r)throw new ct(-951,!1);return r});return n=o[Pt],n._dirtyCounter=Da(0),n._flatValue=void 0,o}function UF(t,i){return function NF(t){return Ok(!0,!1)}()}const $9=(UF.required=function j9(t,i){return function zF(t){return Ok(!0,!0)}()},UF);let m_=class{},ZF=class{};class Lk extends m_{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new CF(this);constructor(i,e,n,o=!0){super(),this.ngModuleType=i,this._parent=e;const r=ac(i);this._bootstrapComponents=mu(r.bootstrap),this._r3Injector=vt(i,e,[{provide:m_,useValue:this},{provide:bv,useValue:this.componentFactoryResolver},...n],Yo(i),new Set(["environment"])),o&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){const i=this._r3Injector;!i.destroyed&&i.destroy(),this.destroyCbs.forEach(e=>e()),this.destroyCbs=null}onDestroy(i){this.destroyCbs.push(i)}}class Fk extends ZF{moduleType;constructor(i){super(),this.moduleType=i}create(i){return new Lk(this.moduleType,i,[])}}class YF extends m_{injector;componentFactoryResolver=new CF(this);instance=null;constructor(i){super();const e=new ap([...i.providers,{provide:m_,useValue:this},{provide:bv,useValue:this.componentFactoryResolver}],i.parent||Sf(),i.debugName,new Set(["environment"]));this.injector=e,i.runEnvironmentInitializers&&e.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(i){this.injector.onDestroy(i)}}function q2(t,i,e=null){return new YF({providers:t,parent:i,debugName:e,runEnvironmentInitializers:!0}).injector}let t$=(()=>{class t{_injector;cachedInjectors=new Map;constructor(e){this._injector=e}getOrCreateStandaloneInjector(e){if(!e.standalone)return null;if(!this.cachedInjectors.has(e)){const n=Eu(0,e.type),o=n.length>0?q2([n],this._injector,`Standalone[${e.type.name}]`):null;this.cachedInjectors.set(e,o)}return this.cachedInjectors.get(e)}ngOnDestroy(){try{for(const e of this.cachedInjectors.values())null!==e&&e.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Nt({token:t,providedIn:"environment",factory:()=>new t(xn(us))})}return t})();function cn(t){return Go(()=>{const i=XF(t),e={...i,decls:t.decls,vars:t.vars,template:t.template,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,onPush:t.changeDetection===my.OnPush,directiveDefs:null,pipeDefs:null,dependencies:i.standalone&&t.dependencies||null,getStandaloneInjector:i.standalone?o=>o.get(t$).getOrCreateStandaloneInjector(e):null,getExternalStyles:null,signals:t.signals??!1,data:t.data||{},encapsulation:t.encapsulation||pu.Emulated,styles:t.styles||qo,_:null,schemas:t.schemas||null,tView:null,id:""};i.standalone&&Zc("NgStandalone"),KF(e);const n=t.dependencies;return e.directiveDefs=W2(n,!1),e.pipeDefs=W2(n,!0),e.id=function s$(t){let i=0;const n=[t.selectors,t.ngContentSelectors,t.hostVars,t.hostAttrs,"function"==typeof t.consts?"":t.consts,t.vars,t.decls,t.encapsulation,t.standalone,t.signals,t.exportAs,JSON.stringify(t.inputs),JSON.stringify(t.outputs),Object.getOwnPropertyNames(t.type.prototype),!!t.contentQueries,!!t.viewQuery];for(const r of n.join("|"))i=Math.imul(31,i)+r.charCodeAt(0)|0;return i+=2147483648,"c"+i}(e),e})}function n$(t){return co(t)||ds(t)}function i$(t){return null!==t}function Ni(t){return Go(()=>({type:t.type,bootstrap:t.bootstrap||qo,declarations:t.declarations||qo,imports:t.imports||qo,exports:t.exports||qo,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null}))}function o$(t,i){if(null==t)return Uc;const e={};for(const n in t)if(t.hasOwnProperty(n)){const o=t[n];let r,u,y,I;Array.isArray(o)?(y=o[0],r=o[1],u=o[2]??r,I=o[3]||null):(r=o,u=o,y=O1.None,I=null),e[r]=[n,y,I],i[r]=u}return e}function r$(t){if(null==t)return Uc;const i={};for(const e in t)t.hasOwnProperty(e)&&(i[t[e]]=e);return i}function Gt(t){return Go(()=>{const i=XF(t);return KF(i),i})}function zd(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,standalone:t.standalone??!0,onDestroy:t.type.prototype.ngOnDestroy||null}}function XF(t){const i={};return{type:t.type,providersResolver:null,factory:null,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:i,inputConfig:t.inputs||Uc,exportAs:t.exportAs||null,standalone:t.standalone??!0,signals:!0===t.signals,selectors:t.selectors||qo,viewQuery:t.viewQuery||null,features:t.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:o$(t.inputs,i),outputs:r$(t.outputs),debugInfo:null}}function KF(t){t.features?.forEach(i=>i(t))}function W2(t,i){if(!t)return null;const e=i?tl:n$;return()=>("function"==typeof t?t():t).map(n=>e(n)).filter(i$)}function qn(t){let i=function QF(t){return Object.getPrototypeOf(t.prototype).constructor}(t.type),e=!0;const n=[t];for(;i;){let o;if(yl(t))o=i.\u0275cmp||i.\u0275dir;else{if(i.\u0275cmp)throw new ct(903,!1);o=i.\u0275dir}if(o){if(e){n.push(o);const u=t;u.inputs=Nk(t.inputs),u.declaredInputs=Nk(t.declaredInputs),u.outputs=Nk(t.outputs);const y=o.hostBindings;y&&h$(t,y);const I=o.viewQuery,V=o.contentQueries;if(I&&d$(t,I),V&&u$(t,V),l$(t,o),Wa(t.outputs,o.outputs),yl(o)&&o.data.animation){const q=t.data;q.animation=(q.animation||[]).concat(o.data.animation)}}const r=o.features;if(r)for(let u=0;u=0;n--){const o=t[n];o.hostVars=i+=o.hostVars,o.hostAttrs=Dp(o.hostAttrs,e=Dp(e,o.hostAttrs))}}(n)}function l$(t,i){for(const e in i.inputs){if(!i.inputs.hasOwnProperty(e)||t.inputs.hasOwnProperty(e))continue;const n=i.inputs[e];void 0!==n&&(t.inputs[e]=n,t.declaredInputs[e]=i.declaredInputs[e])}}function Nk(t){return t===Uc?{}:t===qo?[]:t}function d$(t,i){const e=t.viewQuery;t.viewQuery=e?(n,o)=>{i(n,o),e(n,o)}:i}function u$(t,i){const e=t.contentQueries;t.contentQueries=e?(n,o,r)=>{i(n,o,r),e(n,o,r)}:i}function h$(t,i){const e=t.hostBindings;t.hostBindings=e?(n,o)=>{i(n,o),e(n,o)}:i}function JF(t){const i=e=>{const n=Array.isArray(t);null===e.hostDirectives?(e.findHostDirectiveDefs=eN,e.hostDirectives=n?t.map(zk):[t]):n?e.hostDirectives.unshift(...t.map(zk)):e.hostDirectives.unshift(t)};return i.ngInherit=!0,i}function eN(t,i,e){if(null!==t.hostDirectives)for(const n of t.hostDirectives)if("function"==typeof n){const o=n();for(const r of o)tN(zk(r),i,e)}else tN(n,i,e)}function tN(t,i,e){const n=ds(t.directive);(function _$(t,i){for(const e in i)i.hasOwnProperty(e)&&(t[i[e]]=t[e])})(n.declaredInputs,t.inputs),eN(n,i,e),e.set(n,t),i.push(n)}function zk(t){return"function"==typeof t?{directive:eo(t),inputs:Uc,outputs:Uc}:{directive:eo(t.directive),inputs:nN(t.inputs),outputs:nN(t.outputs)}}function nN(t){if(void 0===t||0===t.length)return Uc;const i={};for(let e=0;e{class t{log(e){console.log(e)}warn(e){console.warn(e)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})();const bN=new yt(""),J2=new yt("");let Zk,qk=(()=>{class t{_ngZone;registry;_isZoneStable=!0;_callbacks=[];_taskTrackingZone=null;_destroyRef;constructor(e,n,o){this._ngZone=e,this.registry=n,gl()&&(this._destroyRef=Y(Ut,{optional:!0})??void 0),Zk||(function bG(t){Zk=t}(o),o.addToWindow(n)),this._watchAngularEvents(),e.run(()=>{this._taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){const e=this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),n=this._ngZone.runOutsideAngular(()=>this._ngZone.onStable.subscribe({next:()=>{tn.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}}));this._destroyRef?.onDestroy(()=>{e.unsubscribe(),n.unsubscribe()})}isStable(){return this._isZoneStable&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let e=this._callbacks.pop();clearTimeout(e.timeoutId),e.doneCb()}});else{let e=this.getPendingTasks();this._callbacks=this._callbacks.filter(n=>!n.updateCb||!n.updateCb(e)||(clearTimeout(n.timeoutId),!1))}}getPendingTasks(){return this._taskTrackingZone?this._taskTrackingZone.macroTasks.map(e=>({source:e.source,creationLocation:e.creationLocation,data:e.data})):[]}addCallback(e,n,o){let r=-1;n&&n>0&&(r=setTimeout(()=>{this._callbacks=this._callbacks.filter(u=>u.timeoutId!==r),e()},n)),this._callbacks.push({doneCb:e,timeoutId:r,updateCb:o})}whenStable(e,n,o){if(o&&!this._taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(e,n,o),this._runCallbacksIfReady()}registerApplication(e){this.registry.registerApplication(e,this)}unregisterApplication(e){this.registry.unregisterApplication(e)}findProviders(e,n,o){return[]}static \u0275fac=function(n){return new(n||t)(xn(tn),xn(Wk),xn(J2))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),Wk=(()=>{class t{_applications=new Map;registerApplication(e,n){this._applications.set(e,n)}unregisterApplication(e){this._applications.delete(e)}unregisterAllApplications(){this._applications.clear()}getTestability(e){return this._applications.get(e)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(e,n=!0){return Zk?.findTestabilityInTree(this,e,n)??null}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})(),yN=(()=>{class t{static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>new yG})}return t})();class yG{queuedEffectCount=0;queues=new Map;schedule(i){this.enqueue(i)}remove(i){const n=this.queues.get(i.zone);n.has(i)&&(n.delete(i),this.queuedEffectCount--)}enqueue(i){const e=i.zone;this.queues.has(e)||this.queues.set(e,new Set);const n=this.queues.get(e);n.has(i)||(this.queuedEffectCount++,n.add(i))}flush(){for(;this.queuedEffectCount>0;)for(const[i,e]of this.queues)null===i?this.flushQueue(e):i.run(()=>this.flushQueue(e))}flushQueue(i){for(const e of i)i.delete(e),this.queuedEffectCount--,e.run()}}function gS(t){return!!t&&"function"==typeof t.then}function vN(t){return!!t&&"function"==typeof t.subscribe}const xN=new yt("");function wN(t){return Wl([{provide:xN,multi:!0,useValue:t}])}let CN=(()=>{class t{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((e,n)=>{this.resolve=e,this.reject=n});appInits=Y(xN,{optional:!0})??[];injector=Y(Ke);constructor(){}runInitializers(){if(this.initialized)return;const e=[];for(const o of this.appInits){const r=fc(this.injector,o);if(gS(r))e.push(r);else if(vN(r)){const u=new Promise((y,I)=>{r.subscribe({complete:y,error:I})});e.push(u)}}const n=()=>{this.done=!0,this.resolve()};Promise.all(e).then(()=>{n()}).catch(o=>{this.reject(o)}),0===e.length&&n(),this.initialized=!0}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const bS=new yt("");function TN(t,i){return Array.isArray(i)?i.reduce(TN,t):{...t,...i}}let Bd=(()=>{class t{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=Y(Xo);afterRenderManager=Y(Gf);zonelessEnabled=Y(rn);rootEffectScheduler=Y(yN);dirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new Ee;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=Y(en).hasPendingTasks.pipe(kt(e=>!e));constructor(){Y(Eg,{optional:!0})}whenStable(){let e;return new Promise(n=>{e=this.isStable.subscribe({next:o=>{o&&n()}})}).finally(()=>{e.unsubscribe()})}_injector=Y(us);_rendererFactory=null;get injector(){return this._injector}bootstrap(e,n){return this.bootstrapImpl(e,n)}bootstrapImpl(e,n,o=Ke.NULL){const r=e instanceof ab;if(!this._injector.get(CN).done)throw new ct(405,"");let y;y=r?e:this._injector.get(bv).resolveComponentFactory(e),this.componentTypes.push(y.componentType);const I=function vG(t){return t.isBoundToModule}(y)?void 0:this._injector.get(m_),q=y.create(o,[],n||y.selector,I),ee=q.location.nativeElement,me=q.injector.get(bN,null);return me?.registerApplication(ee),q.onDestroy(()=>{this.detachView(q.hostView),eI(this.components,q),me?.unregisterApplication(ee)}),this._loadComponent(q),q}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){null!==this.tracingSnapshot?this.tracingSnapshot.run(Iy.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new ct(101,!1);const e=Be(null);try{this._runningTick=!0,this.synchronize()}catch(n){this.internalErrorHandler(n)}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,Be(e),this.afterTick.next()}};synchronize(){null===this._rendererFactory&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Qc,null,{optional:!0}));let e=0;for(;0!==this.dirtyFlags&&e++<10;)this.synchronizeOnce()}synchronizeOnce(){if(16&this.dirtyFlags&&(this.dirtyFlags&=-17,this.rootEffectScheduler.flush()),7&this.dirtyFlags){const e=!!(1&this.dirtyFlags);this.dirtyFlags&=-8,this.dirtyFlags|=8;for(let{_lView:n,notifyErrorHandler:o}of this.allViews)wG(n,o,e,this.zonelessEnabled);if(this.dirtyFlags&=-5,this.syncDirtyFlagsWithViews(),23&this.dirtyFlags)return}else this._rendererFactory?.begin?.(),this._rendererFactory?.end?.();8&this.dirtyFlags&&(this.dirtyFlags&=-9,this.afterRenderManager.execute()),this.syncDirtyFlagsWithViews()}syncDirtyFlagsWithViews(){this.allViews.some(({_lView:e})=>_p(e))?this.dirtyFlags|=2:this.dirtyFlags&=-8}attachView(e){const n=e;this._views.push(n),n.attachToAppRef(this)}detachView(e){const n=e;eI(this._views,n),n.detachFromAppRef()}_loadComponent(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(bS,[]).forEach(o=>o(e))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(e=>e()),this._views.slice().forEach(e=>e.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(e){return this._destroyListeners.push(e),()=>eI(this._destroyListeners,e)}destroy(){if(this._destroyed)throw new ct(406,!1);const e=this._injector;e.destroy&&!e.destroyed&&e.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function eI(t,i){const e=t.indexOf(i);e>-1&&t.splice(e,1)}function wG(t,i,e,n){(e||_p(t))&&$1(t,i,e&&!n?0:1)}function zn(t,i,e,n){const o=Yt();return Zs(o,Sl(),i)&&(io(),Gu(vr(),o,t,i,e,n)),zn}function ex(t,i,e,n){return Zs(t,Sl(),e)?i+_o(e)+n:Ao}function tx(t,i,e,n,o,r){const y=xv(t,function Td(){return si.lFrame.bindingIndex}(),e,o);return Dd(2),y?i+_o(e)+n+_o(o)+r:Ao}function tI(t,i){return t<<17|i<<2}function Cv(t){return t>>17&32767}function Jk(t){return 2|t}function lx(t){return(131068&t)>>2}function eR(t,i){return-131069&t|i<<2}function tR(t){return 1|t}function jN(t,i,e,n){const o=t[e+1],r=null===i;let u=n?Cv(o):lx(o),y=!1;for(;0!==u&&(!1===y||r);){const V=t[u+1];lq(t[u],i)&&(y=!0,t[u+1]=n?tR(V):Jk(V)),u=n?Cv(V):lx(V)}y&&(t[e+1]=n?Jk(o):tR(o))}function lq(t,i){return null===t||null==i||(Array.isArray(t)?t[1]:t)===i||!(!Array.isArray(t)||"string"!=typeof i)&&ip(t,i)>=0}const Kl={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function $N(t){return t.substring(Kl.key,Kl.keyEnd)}function GN(t,i){const e=Kl.textEnd;return e===i?-1:(i=Kl.keyEnd=function hq(t,i,e){for(;i32;)i++;return i}(t,Kl.key=i,e),cx(t,i,e))}function cx(t,i,e){for(;i=0;e=GN(i,e))rc(t,$N(i),!0)}function Hp(t,i,e,n){const o=Yt(),r=io(),u=Dd(2);r.firstUpdatePass&&KN(r,t,u,n),i!==Ao&&Zs(o,u,i)&&JN(r,r.data[hs()],o,o[11],t,o[u+1]=function Cq(t,i){return null==t||""===t||("string"==typeof i?t+=i:"object"==typeof t&&(t=Yo(Xc(t)))),t}(i,e),n,u)}function jp(t,i,e,n){const o=io(),r=Dd(2);o.firstUpdatePass&&KN(o,null,r,n);const u=Yt();if(e!==Ao&&Zs(u,r,e)){const y=o.data[hs()];if(t4(y,n)&&!XN(o,r)){let I=n?y.classesWithoutHost:y.stylesWithoutHost;null!==I&&(e=mc(I,e||"")),nR(o,y,u,e,n)}else!function wq(t,i,e,n,o,r,u,y){o===Ao&&(o=qo);let I=0,V=0,q=0=t.expandoStartIndex}function KN(t,i,e,n){const o=t.data;if(null===o[e+1]){const r=o[hs()],u=XN(t,e);t4(r,n)&&null===i&&!u&&(i=!1),i=function _q(t,i,e,n){const o=function _g(t){const i=si.lFrame.currentDirectiveIndex;return-1===i?null:t[i]}(t);let r=n?i.residualClasses:i.residualStyles;if(null===o)0===(n?i.classBindings:i.styleBindings)&&(e=vS(e=iR(null,t,i,e,n),i.attrs,n),r=null);else{const u=i.directiveStylingLast;if(-1===u||t[u]!==o)if(e=iR(o,t,i,e,n),null===r){let I=function gq(t,i,e){const n=e?i.classBindings:i.styleBindings;if(0!==lx(n))return t[Cv(n)]}(t,i,n);void 0!==I&&Array.isArray(I)&&(I=iR(null,t,i,I[1],n),I=vS(I,i.attrs,n),function bq(t,i,e,n){t[Cv(e?i.classBindings:i.styleBindings)]=n}(t,i,n,I))}else r=function yq(t,i,e){let n;const o=i.directiveEnd;for(let r=1+i.directiveStylingLast;r0)&&(V=!0)):q=e,o)if(0!==I){const me=Cv(t[y+1]);t[n+1]=tI(me,y),0!==me&&(t[me+1]=eR(t[me+1],n)),t[y+1]=function oq(t,i){return 131071&t|i<<17}(t[y+1],n)}else t[n+1]=tI(y,0),0!==y&&(t[y+1]=eR(t[y+1],n)),y=n;else t[n+1]=tI(I,0),0===y?y=n:t[I+1]=eR(t[I+1],n),I=n;V&&(t[n+1]=Jk(t[n+1])),jN(t,q,n,!0),jN(t,q,n,!1),function sq(t,i,e,n,o){const r=o?t.residualClasses:t.residualStyles;null!=r&&"string"==typeof i&&ip(r,i)>=0&&(e[n+1]=tR(e[n+1]))}(i,q,t,n,r),u=tI(y,I),r?i.classBindings=u:i.styleBindings=u}(o,r,i,e,u,n)}}function iR(t,i,e,n,o){let r=null;const u=e.directiveEnd;let y=e.directiveStylingLast;for(-1===y?y=e.directiveStart:y++;y0;){const I=t[o],V=Array.isArray(I),q=V?I[1]:I,ee=null===q;let me=e[o+1];me===Ao&&(me=ee?qo:void 0);let he=ee?xf(me,n):q===n?me:void 0;if(V&&!nI(he)&&(he=xf(I,n)),nI(he)&&(y=he,u))return y;const Ce=t[o+1];o=u?Cv(Ce):lx(Ce)}if(null!==i){let I=r?i.residualClasses:i.residualStyles;null!=I&&(y=xf(I,n))}return y}function nI(t){return void 0!==t}function t4(t,i){return!!(t.flags&(i?8:16))}class Oq{destroy(i){}updateValue(i,e){}swap(i,e){const n=Math.min(i,e),o=Math.max(i,e),r=this.detach(o);if(o-n>1){const u=this.detach(n);this.attach(n,r),this.attach(o,u)}else this.attach(n,r)}move(i,e){this.attach(e,this.detach(i))}}function oR(t,i,e,n,o){return t===e&&Object.is(i,n)?1:Object.is(o(t,i),o(e,n))?-1:0}function rR(t,i,e,n){return!(void 0===i||!i.has(n)||(t.attach(e,i.get(n)),i.delete(n),0))}function i4(t,i,e,n,o){if(rR(t,i,n,e(n,o)))t.updateValue(n,o);else{const r=t.create(n,o);t.attach(n,r)}}function o4(t,i,e,n){const o=new Set;for(let r=i;r<=e;r++)o.add(n(r,t.at(r)));return o}class r4{kvMap=new Map;_vMap=void 0;has(i){return this.kvMap.has(i)}delete(i){if(!this.has(i))return!1;const e=this.kvMap.get(i);return void 0!==this._vMap&&this._vMap.has(e)?(this.kvMap.set(i,this._vMap.get(e)),this._vMap.delete(e)):this.kvMap.delete(i),!0}get(i){return this.kvMap.get(i)}set(i,e){if(this.kvMap.has(i)){let n=this.kvMap.get(i);void 0===this._vMap&&(this._vMap=new Map);const o=this._vMap;for(;o.has(n);)n=o.get(n);o.set(n,e)}else this.kvMap.set(i,e)}forEach(i){for(let[e,n]of this.kvMap)if(i(n,e),void 0!==this._vMap){const o=this._vMap;for(;o.has(n);)n=o.get(n),i(n,e)}}}function Xi(t,i){Zc("NgControlFlow");const e=Yt(),n=Sl(),o=e[n]!==Ao?e[n]:-1,r=-1!==o?oI(e,26+o):void 0;if(Zs(e,n,t)){const y=Be(null);try{if(void 0!==r&&Pd(r,0),-1!==t){const I=26+t,V=oI(e,I),q=aR(e[1],I),ee=null;jm(V,Vm(e,q,i,{dehydratedView:ee}),0,Np(q,ee))}}finally{Be(y)}}else if(void 0!==r){const y=ib(r,0);void 0!==y&&(y[8]=i)}}class Lq{lContainer;$implicit;$index;constructor(i,e,n){this.lContainer=i,this.$implicit=e,this.$index=n}get $count(){return this.lContainer.length-10}}function iI(t,i){return i}class Nq{hasEmptyBlock;trackByFn;liveCollection;constructor(i,e,n){this.hasEmptyBlock=i,this.trackByFn=e,this.liveCollection=n}}function Sv(t,i,e,n,o,r,u,y,I,V,q,ee,me){Zc("NgControlFlow");const he=Yt(),Ce=io(),je=void 0!==I,mt=Yt(),Lt=y?u.bind(mt[15][8]):u,At=new Nq(je,Lt);mt[26+t]=At,fS(he,Ce,t+1,i,e,n,o,bc(Ce.consts,r)),je&&fS(he,Ce,t+2,I,V,q,ee,bc(Ce.consts,me))}class zq extends Oq{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(i,e,n){super(),this.lContainer=i,this.hostLView=e,this.templateTNode=n}get length(){return this.lContainer.length-10}at(i){return this.getLView(i)[8].$implicit}attach(i,e){const n=e[6];this.needsIndexUpdate||=i!==this.length,jm(this.lContainer,e,i,Np(this.templateTNode,n))}detach(i){return this.needsIndexUpdate||=i!==this.length-1,function Bq(t,i){return Bh(t,i)}(this.lContainer,i)}create(i,e){const o=Vm(this.hostLView,this.templateTNode,new Lq(this.lContainer,e,i),{dehydratedView:null});return this.operationsCounter?.recordCreate(),o}destroy(i){Hm(i[1],i),this.operationsCounter?.recordDestroy()}updateValue(i,e){this.getLView(i)[8].$implicit=e}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let i=0;i{t.destroy(I)})}(I,t,r.trackByFn),I.updateIndexes(),r.hasEmptyBlock){const V=Sl(),q=0===I.length;if(Zs(n,V,q)){const ee=e+2,me=oI(n,ee);if(q){const he=aR(o,ee),Ce=null;jm(me,Vm(n,he,void 0,{dehydratedView:Ce}),0,Np(he,Ce))}else Pd(me,0)}}}finally{Be(i)}}function oI(t,i){return t[i]}function aR(t,i){return Ou(t,i)}function w(t,i,e,n){const o=Yt(),r=io(),u=26+t,y=o[11],I=r.firstCreatePass?xF(u,r,o,i,lv,gp(),e,n):r.data[u],V=a4(r,o,I,y,i,t);o[u]=V;const q=au(I);return Ir(I,!0),RC(y,V,I),!Bp(I)&&Er()&&U1(r,o,V,I),(0===function _m(){return si.lFrame.elementDepthCount}()||q)&&Dl(V,o),function Fu(){si.lFrame.elementDepthCount++}(),q&&(P1(r,o,I),aC(r,I,o)),null!==n&&FC(o,I),w}function x(){let t=Lo();Lf()?Ff():(t=t.parent,Ir(t,!1));const i=t;(function ol(t){return si.skipHydrationRootTNode===t})(i)&&function ry(){si.skipHydrationRootTNode=null}(),function ug(){si.lFrame.elementDepthCount--}();const e=io();return e.firstCreatePass&&wF(e,i),null!=i.classesWithoutHost&&function Ih(t){return!!(8&t.flags)}(i)&&nR(e,i,Yt(),i.classesWithoutHost,!0),null!=i.stylesWithoutHost&&function Sp(t){return!!(16&t.flags)}(i)&&nR(e,i,Yt(),i.stylesWithoutHost,!1),x}function Re(t,i,e,n){return w(t,i,e,n),x(),Re}let a4=(t,i,e,n,o,r)=>(Qa(!0),Fp(n,o,function Id(){return si.lFrame.currentNamespace}()));function at(t,i,e){const n=Yt(),o=io(),r=t+26,u=o.firstCreatePass?function jq(t,i,e,n,o){const r=i.consts,u=bc(r,n),y=d_(i,t,8,"ng-container",u);null!==u&&p_(y,u,!0);const I=bc(r,o);return gp()&&Ck(i,e,y,I,lv),y.mergedAttrs=Dp(y.mergedAttrs,y.attrs),null!==i.queries&&i.queries.elementStart(i,y),y}(r,o,n,i,e):o.data[r];Ir(u,!0);const y=s4(o,n,u,t);return n[r]=y,Er()&&U1(o,n,y,u),Dl(y,n),au(u)&&(P1(o,n,u),aC(o,u,n)),null!=e&&FC(n,u),at}function st(){let t=Lo();const i=io();return Lf()?Ff():(t=t.parent,Ir(t,!1)),i.firstCreatePass&&(wp(i,t),eg(t)&&i.queries.elementEnd(t)),st}function ed(t,i,e){return at(t,i,e),st(),ed}let s4=(t,i,e,n)=>(Qa(!0),Qg(i[11],""));function pt(){return Yt()}function cc(t,i,e){const n=Yt();return Zs(n,Sl(),i)&&Kc(io(),vr(),n,t,i,n[11],e,!0),cc}const Dv=void 0;var Wq=["en",[["a","p"],["AM","PM"],Dv],[["AM","PM"],Dv,Dv],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],Dv,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],Dv,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",Dv,"{1} 'at' {0}",Dv],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",function qq(t){const i=Math.floor(Math.abs(t)),e=t.toString().replace(/^[^.]*\.?/,"").length;return 1===i&&0===e?1:5}];let dx={};function Vd(t){const i=function Zq(t){return t.toLowerCase().replace(/_/g,"-")}(t);let e=d4(i);if(e)return e;const n=i.split("-")[0];if(e=d4(n),e)return e;if("en"===n)return Wq;throw new ct(701,!1)}function d4(t){return t in dx||(dx[t]=Or.ng&&Or.ng.common&&Or.ng.common.locales&&Or.ng.common.locales[t]),dx[t]}var Ha=function(t){return t[t.LocaleId=0]="LocaleId",t[t.DayPeriodsFormat=1]="DayPeriodsFormat",t[t.DayPeriodsStandalone=2]="DayPeriodsStandalone",t[t.DaysFormat=3]="DaysFormat",t[t.DaysStandalone=4]="DaysStandalone",t[t.MonthsFormat=5]="MonthsFormat",t[t.MonthsStandalone=6]="MonthsStandalone",t[t.Eras=7]="Eras",t[t.FirstDayOfWeek=8]="FirstDayOfWeek",t[t.WeekendRange=9]="WeekendRange",t[t.DateFormat=10]="DateFormat",t[t.TimeFormat=11]="TimeFormat",t[t.DateTimeFormat=12]="DateTimeFormat",t[t.NumberSymbols=13]="NumberSymbols",t[t.NumberFormats=14]="NumberFormats",t[t.CurrencyCode=15]="CurrencyCode",t[t.CurrencySymbol=16]="CurrencySymbol",t[t.CurrencyName=17]="CurrencyName",t[t.Currencies=18]="Currencies",t[t.Directionality=19]="Directionality",t[t.PluralCase=20]="PluralCase",t[t.ExtraData=21]="ExtraData",t}(Ha||{});const rI="en-US";let u4=rI;function M4(t,i,e){return function n(o){if(o===Function)return e;hv(xd(t)?wl(t.index,i):i,5);const u=i[8];let y=A4(i,u,e,o),I=n.__ngNextListenerFn__;for(;I;)y=A4(i,u,I,o)&&y,I=I.__ngNextListenerFn__;return y}}function A4(t,i,e,n){const o=Be(null);try{return!1!==e(n)}catch(r){return function FW(t,i){const e=t[9],n=e?e.get(bo,null):null;n&&n.handleError(i)}(t,r),!1}finally{Be(o)}}function k4(t,i,e,n,o,r){const y=i[1],q=i[e][y.data[e].outputs[n]],ee=y.firstCreatePass?iy(y):null,me=Ba(i),he=q.subscribe(r),Ce=me.length;me.push(r,he),ee&&ee.push(o,t.index,Ce,-(Ce+1))}function we(t,i,e,n){const o=Yt(),r=io(),u=Lo();return cR(r,o,o[11],u,t,i,n),we}function cR(t,i,e,n,o,r,u){const y=au(n),V=t.firstCreatePass?iy(t):null,q=Ba(i);let ee=!0;if(3&n.type||u){const me=xl(n,i),he=u?u(me):me,Ce=q.length,je=u?Lt=>u(jo(Lt[n.index])):n.index;let mt=null;if(!u&&y&&(mt=function NW(t,i,e,n){const o=t.cleanup;if(null!=o)for(let r=0;rI?y[I]:null}"string"==typeof u&&(r+=2)}return null}(t,i,o,n.index)),null!==mt)(mt.__ngLastListenerFn__||mt).__ngNextListenerFn__=r,mt.__ngLastListenerFn__=r,ee=!1;else{r=M4(n,i,r);const Lt=e.listen(he,o,r);q.push(r,Lt),V&&V.push(o,je,Ce,Ce+1)}}else r=M4(n,i,r);if(ee){const me=n.outputs?.[o],he=n.hostDirectiveOutputs?.[o];if(he&&he.length)for(let Ce=0;Ce0;)i=i[14],t--;return i}(t,si.lFrame.contextLView))[8]}(t)}function zW(t,i){let e=null;const n=function E1(t){const i=t.attrs;if(null!=i){const e=i.indexOf(5);if(!(1&e))return i[e+1]}return null}(t);for(let o=0;oe._dirtyCounter.update(n=>n+1))}(i,PF(t,e,n,o))}function Vi(t){return Th(function gm(){return si.lFrame.contextLView}(),26+t)}function M(t,i=""){const e=Yt(),n=io(),o=t+26,r=n.firstCreatePass?d_(n,o,1,i,null):n.data[o],u=K4(n,e,r,i,t);e[o]=u,Er()&&U1(n,e,u,r),Ir(r,!1)}let K4=(t,i,e,n,o)=>(Qa(!0),function i_(t,i){return t.createText(i)}(i[11],n));function Ct(t){return Jt("",t,""),Ct}function Jt(t,i,e){const n=Yt(),o=ex(n,t,i,e);return o!==Ao&&f_(n,hs(),o),Jt}function Ea(t,i,e,n,o){const r=Yt(),u=tx(r,t,i,e,n,o);return u!==Ao&&f_(r,hs(),u),Ea}function f_(t,i,e){const n=lt(i,t);!function M1(t,i,e){t.setValue(i,e)}(t[11],n,e)}function Kn(t,i,e){Ap(i)&&(i=i());const n=Yt();return Zs(n,Sl(),i)&&Kc(io(),vr(),n,t,i,n[11],e,!1),Kn}function ei(t,i){const e=Ap(t);return e&&t.set(i),e}function Qn(t,i){const e=Yt(),n=io(),o=Lo();return cR(n,e,e[11],o,t,i),Qn}const rz={};function dR(t){const i=io(),e=Yt(),n=t+26;return Ir(d_(i,n,128,null,null),!1),lg(i,e,n,rz),dR}function uR(t,i,e,n,o){if(t=eo(t),Array.isArray(t))for(let r=0;r>20;if(yd(t)||!t.multi){const he=new Ed(V,o,$e),Ce=pR(I,i,o?q:q+me,ee);-1===Ce?(Gc(kd(y,u),r,I),hR(r,t,i.length),i.push(I),y.directiveStart++,y.directiveEnd++,o&&(y.providerIndexes+=1048576),e.push(he),u.push(he)):(e[Ce]=he,u[Ce]=he)}else{const he=pR(I,i,q+me,ee),Ce=pR(I,i,q,q+me),mt=Ce>=0&&e[Ce];if(o&&!mt||!o&&!(he>=0&&e[he])){Gc(kd(y,u),r,I);const Lt=function oZ(t,i,e,n,o){const r=new Ed(t,e,$e);return r.multi=[],r.index=i,r.componentProviders=0,az(r,o,n&&!e),r}(o?iZ:nZ,e.length,o,n,V);!o&&mt&&(e[Ce].providerFactory=Lt),hR(r,t,i.length,0),i.push(I),y.directiveStart++,y.directiveEnd++,o&&(y.providerIndexes+=1048576),e.push(Lt),u.push(Lt)}else hR(r,t,he>-1?he:Ce,az(e[o?Ce:he],V,!o&&n));!o&&n&&mt&&e[Ce].componentProviders++}}}function hR(t,i,e,n){const o=yd(i),r=function dm(t){return!!t.useClass}(i);if(o||r){const I=(r?eo(i.useClass):i).prototype.ngOnDestroy;if(I){const V=t.destroyHooks||(t.destroyHooks=[]);if(!o&&i.multi){const q=V.indexOf(e);-1===q?V.push(e,[n,I]):V[q+1].push(n,I)}else V.push(e,I)}}}function az(t,i,e){return e&&t.componentProviders++,t.multi.push(i)-1}function pR(t,i,e,n){for(let o=e;o{e.providersResolver=(n,o)=>function tZ(t,i,e){const n=io();if(n.firstCreatePass){const o=yl(t);uR(e,n.data,n.blueprint,o,!0),uR(i,n.data,n.blueprint,o,!1)}}(n,o?o(t):t,i)}}function jn(t,i,e){const n=rl()+t,o=Yt();return o[n]===Ao?Gm(o,n,e?i.call(e):i()):function mS(t,i){return t[i]}(o,n)}function Ar(t,i,e,n){return lz(Yt(),rl(),t,i,e,n)}function ux(t,i,e,n,o){return cz(Yt(),rl(),t,i,e,n,o)}function IS(t,i){const e=t[i];return e===Ao?void 0:e}function lz(t,i,e,n,o,r){const u=i+e;return Zs(t,u,o)?Gm(t,u+1,r?n.call(r,o):n(o)):IS(t,u+1)}function cz(t,i,e,n,o,r,u){const y=i+e;return xv(t,y,o,r)?Gm(t,y+2,u?n.call(u,o,r):n(o,r)):IS(t,y+2)}function dz(t,i,e,n,o,r,u,y){const I=i+e;return function Y2(t,i,e,n,o){const r=xv(t,i,e,n);return Zs(t,i+2,o)||r}(t,I,o,r,u)?Gm(t,I+3,y?n.call(y,o,r,u):n(o,r,u)):IS(t,I+3)}function ti(t,i){const e=io();let n;const o=t+26;e.firstCreatePass?(n=function fZ(t,i){if(i)for(let e=i.length-1;e>=0;e--){const n=i[e];if(t===n.name)return n}}(i,e.pipeRegistry),e.data[o]=n,n.onDestroy&&(e.destroyHooks??=[]).push(o,n.onDestroy)):n=e.data[o];const r=n.factory||(n.factory=ql(n.type)),y=Ya($e);try{const I=Tl(!1),V=r();return Tl(I),lg(e,Yt(),o,V),V}finally{Ya(y)}}function Zm(t,i,e){const n=t+26,o=Yt(),r=Th(o,n);return ES(o,n)?lz(o,rl(),i,r.transform,e,r):r.transform(e)}function hi(t,i,e,n){const o=t+26,r=Yt(),u=Th(r,o);return ES(r,o)?cz(r,rl(),i,u.transform,e,n,u):u.transform(e,n)}function ES(t,i){return t[1].data[i].pure}function Ud(t,i){return q1(t,i)}class AS{full;major;minor;patch;constructor(i){this.full=i;const e=i.split(".");this.major=e[0],this.minor=e[1],this.patch=e.slice(2).join(".")}}const kz=new AS("19.2.15");class GZ{ngModuleFactory;componentFactories;constructor(i,e){this.ngModuleFactory=i,this.componentFactories=e}}let qZ=(()=>{class t{compileModuleSync(e){return new Fk(e)}compileModuleAsync(e){return Promise.resolve(this.compileModuleSync(e))}compileModuleAndAllComponentsSync(e){const n=this.compileModuleSync(e),r=mu(ac(e).declarations).reduce((u,y)=>{const I=co(y);return I&&u.push(new hS(I)),u},[]);return new GZ(n,r)}compileModuleAndAllComponentsAsync(e){return Promise.resolve(this.compileModuleAndAllComponentsSync(e))}clearCache(){}clearCacheFor(e){}getModuleId(e){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),YZ=(()=>{class t{zone=Y(tn);changeDetectionScheduler=Y(xt);applicationRef=Y(Bd);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function yR({ngZoneFactory:t,ignoreChangesOutsideZone:i,scheduleInRootZone:e}){return t??=()=>new tn({...vR(),scheduleInRootZone:e}),[{provide:tn,useFactory:t},{provide:Hc,multi:!0,useFactory:()=>{const n=Y(YZ,{optional:!0});return()=>n.initialize()}},{provide:Hc,multi:!0,useFactory:()=>{const n=Y(KZ);return()=>{n.initialize()}}},!0===i?{provide:Ft,useValue:!0}:[],{provide:Kt,useValue:e??wt}]}function vR(t){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:t?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:t?.runCoalescing??!1}}let KZ=(()=>{class t{subscription=new ai;initialized=!1;zone=Y(tn);pendingTasks=Y(en);initialize(){if(this.initialized)return;this.initialized=!0;let e=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(e=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{tn.assertNotInAngularZone(),queueMicrotask(()=>{null!==e&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(e),e=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{tn.assertInAngularZone(),e??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),kS=(()=>{class t{appRef=Y(Bd);taskService=Y(en);ngZone=Y(tn);zonelessEnabled=Y(rn);tracing=Y(Eg,{optional:!0});disableScheduling=Y(Ft,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new ai;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(_r):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(Y(Kt,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof aa||!this.zoneIsDefined)}notify(e){if(!this.zonelessEnabled&&5===e)return;let n=!1;switch(e){case 0:this.appRef.dirtyFlags|=2;break;case 3:case 2:case 4:case 5:case 1:this.appRef.dirtyFlags|=4;break;case 6:case 13:this.appRef.dirtyFlags|=2,n=!0;break;case 12:this.appRef.dirtyFlags|=16,n=!0;break;case 11:n=!0;break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(n))return;const o=this.useMicrotaskScheduler?vi:Xn;this.pendingRenderTaskId=this.taskService.add(),this.cancelScheduledCallback=this.scheduleInRootZone?Zone.root.run(()=>o(()=>this.tick())):this.ngZone.runOutsideAngular(()=>o(()=>this.tick()))}shouldScheduleTick(e){return!(this.disableScheduling&&!e||this.appRef.destroyed||null!==this.pendingRenderTaskId||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(_r+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(0===this.appRef.dirtyFlags)return void this.cleanup();!this.zonelessEnabled&&7&this.appRef.dirtyFlags&&(this.appRef.dirtyFlags|=1);const e=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(n){throw this.taskService.remove(e),n}finally{this.cleanup()}this.useMicrotaskScheduler=!0,vi(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(e)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,null!==this.pendingRenderTaskId){const e=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(e)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const __=new yt("",{providedIn:"root",factory:()=>Y(__,To.Optional|To.SkipSelf)||function QZ(){return typeof $localize<"u"&&$localize.locale||rI}()}),hI=new yt(""),oY=new yt("");function RS(t){return!t.moduleRef}let Nz=(()=>{class t{_injector;_modules=[];_destroyListeners=[];_destroyed=!1;constructor(e){this._injector=e}bootstrapModuleFactory(e,n){const o=n?.scheduleInRootZone,u=n?.ignoreChangesOutsideZone,y=[yR({ngZoneFactory:()=>function Mr(t="zone.js",i){return"noop"===t?new aa:"zone.js"===t?new tn(i):t}(n?.ngZone,{...vR({eventCoalescing:n?.ngZoneEventCoalescing,runCoalescing:n?.ngZoneRunCoalescing}),scheduleInRootZone:o}),ignoreChangesOutsideZone:u}),{provide:xt,useExisting:kS}],I=function e$(t,i,e){return new Lk(t,i,e,!1)}(e.moduleType,this.injector,y);return function Fz(t){const i=RS(t)?t.r3Injector:t.moduleRef.injector,e=i.get(tn);return e.run(()=>{RS(t)?t.r3Injector.resolveInjectorInitializers():t.moduleRef.resolveInjectorInitializers();const n=i.get(bo,null);let o;if(e.runOutsideAngular(()=>{o=e.onError.subscribe({next:r=>{n.handleError(r)}})}),RS(t)){const r=()=>i.destroy(),u=t.platformInjector.get(hI);u.add(r),i.onDestroy(()=>{o.unsubscribe(),u.delete(r)})}else{const r=()=>t.moduleRef.destroy(),u=t.platformInjector.get(hI);u.add(r),t.moduleRef.onDestroy(()=>{eI(t.allPlatformModules,t.moduleRef),o.unsubscribe(),u.delete(r)})}return function aY(t,i,e){try{const n=e();return gS(n)?n.catch(o=>{throw i.runOutsideAngular(()=>t.handleError(o)),o}):n}catch(n){throw i.runOutsideAngular(()=>t.handleError(n)),n}}(n,e,()=>{const r=i.get(CN);return r.runInitializers(),r.donePromise.then(()=>{if(function Qq(t){"string"==typeof t&&(u4=t.toLowerCase().replace(/_/g,"-"))}(i.get(__,rI)||rI),!i.get(oY,!0))return RS(t)?i.get(Bd):(t.allPlatformModules.push(t.moduleRef),t.moduleRef);if(RS(t)){const I=i.get(Bd);return void 0!==t.rootComponent&&I.bootstrap(t.rootComponent),I}return function rY(t,i){const e=t.injector.get(Bd);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(n=>e.bootstrap(n));else{if(!t.instance.ngDoBootstrap)throw new ct(-403,!1);t.instance.ngDoBootstrap(e)}i.push(t)}(t.moduleRef,t.allPlatformModules),t.moduleRef})})})}({moduleRef:I,allPlatformModules:this._modules,platformInjector:this.injector})}bootstrapModule(e,n=[]){const o=TN({},n);return function ZZ(t,i,e){const n=new Fk(e);return Promise.resolve(n)}(0,0,e).then(r=>this.bootstrapModuleFactory(r,o))}onDestroy(e){this._destroyListeners.push(e)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new ct(404,!1);this._modules.slice().forEach(n=>n.destroy()),this._destroyListeners.forEach(n=>n());const e=this._injector.get(hI,null);e&&(e.forEach(n=>n()),e.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static \u0275fac=function(n){return new(n||t)(xn(Ke))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"platform"})}return t})(),px=null;function zz(t,i,e=[]){const n=`Platform: ${i}`,o=new yt(n);return(r=[])=>{let u=pI();if(!u){const y=[...e,...r,{provide:o,useValue:!0}];u=t?.(y)??function sY(t){if(pI())throw new ct(400,!1);(function SN(){!function hr(t){wi=t}(()=>{throw new ct(600,!1)})})(),px=t;const i=t.get(Nz);return function Vz(t){const i=t.get(kw,null);fc(t,()=>{i?.forEach(e=>e())})}(t),i}(function Bz(t=[],i){return Ke.create({name:i,providers:[{provide:Au,useValue:"platform"},{provide:hI,useValue:new Set([()=>px=null])},...t]})}(y,n))}return function lY(){const i=pI();if(!i)throw new ct(401,!1);return i}()}}function pI(){return px?.get(Nz)??null}let So=(()=>class t{static __NG_ELEMENT_ID__=dY})();function dY(t){return function uY(t,i,e){if(xd(t)&&!e){const n=wl(t.index,i);return new ob(n,n)}return 175&t.type?new ob(i[15],i):null}(Lo(),Yt(),!(16&~t))}class Gz{constructor(){}supports(i){return Z2(i)}create(i){return new _Y(i)}}const fY=(t,i)=>i;class _Y{length=0;collection;_linkedRecords=null;_unlinkedRecords=null;_previousItHead=null;_itHead=null;_itTail=null;_additionsHead=null;_additionsTail=null;_movesHead=null;_movesTail=null;_removalsHead=null;_removalsTail=null;_identityChangesHead=null;_identityChangesTail=null;_trackByFn;constructor(i){this._trackByFn=i||fY}forEachItem(i){let e;for(e=this._itHead;null!==e;e=e._next)i(e)}forEachOperation(i){let e=this._itHead,n=this._removalsHead,o=0,r=null;for(;e||n;){const u=!n||e&&e.currentIndex{u=this._trackByFn(o,y),null!==e&&Object.is(e.trackById,u)?(n&&(e=this._verifyReinsertion(e,y,u,o)),Object.is(e.item,y)||this._addIdentityChange(e,y)):(e=this._mismatch(e,y,u,o),n=!0),e=e._next,o++}),this.length=o;return this._truncate(e),this.collection=i,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let i;for(i=this._previousItHead=this._itHead;null!==i;i=i._next)i._nextPrevious=i._next;for(i=this._additionsHead;null!==i;i=i._nextAdded)i.previousIndex=i.currentIndex;for(this._additionsHead=this._additionsTail=null,i=this._movesHead;null!==i;i=i._nextMoved)i.previousIndex=i.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(i,e,n,o){let r;return null===i?r=this._itTail:(r=i._prev,this._remove(i)),null!==(i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(i.item,e)||this._addIdentityChange(i,e),this._reinsertAfter(i,r,o)):null!==(i=null===this._linkedRecords?null:this._linkedRecords.get(n,o))?(Object.is(i.item,e)||this._addIdentityChange(i,e),this._moveAfter(i,r,o)):i=this._addAfter(new gY(e,n),r,o),i}_verifyReinsertion(i,e,n,o){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?i=this._reinsertAfter(r,i._prev,o):i.currentIndex!=o&&(i.currentIndex=o,this._addToMoves(i,o)),i}_truncate(i){for(;null!==i;){const e=i._next;this._addToRemovals(this._unlink(i)),i=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(i,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(i);const o=i._prevRemoved,r=i._nextRemoved;return null===o?this._removalsHead=r:o._nextRemoved=r,null===r?this._removalsTail=o:r._prevRemoved=o,this._insertAfter(i,e,n),this._addToMoves(i,n),i}_moveAfter(i,e,n){return this._unlink(i),this._insertAfter(i,e,n),this._addToMoves(i,n),i}_addAfter(i,e,n){return this._insertAfter(i,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=i:this._additionsTail._nextAdded=i,i}_insertAfter(i,e,n){const o=null===e?this._itHead:e._next;return i._next=o,i._prev=e,null===o?this._itTail=i:o._prev=i,null===e?this._itHead=i:e._next=i,null===this._linkedRecords&&(this._linkedRecords=new qz),this._linkedRecords.put(i),i.currentIndex=n,i}_remove(i){return this._addToRemovals(this._unlink(i))}_unlink(i){null!==this._linkedRecords&&this._linkedRecords.remove(i);const e=i._prev,n=i._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,i}_addToMoves(i,e){return i.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=i:this._movesTail._nextMoved=i),i}_addToRemovals(i){return null===this._unlinkedRecords&&(this._unlinkedRecords=new qz),this._unlinkedRecords.put(i),i.currentIndex=null,i._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=i,i._prevRemoved=null):(i._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=i),i}_addIdentityChange(i,e){return i.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=i:this._identityChangesTail._nextIdentityChange=i,i}}class gY{item;trackById;currentIndex=null;previousIndex=null;_nextPrevious=null;_prev=null;_next=null;_prevDup=null;_nextDup=null;_prevRemoved=null;_nextRemoved=null;_nextAdded=null;_nextMoved=null;_nextIdentityChange=null;constructor(i,e){this.item=i,this.trackById=e}}class bY{_head=null;_tail=null;add(i){null===this._head?(this._head=this._tail=i,i._nextDup=null,i._prevDup=null):(this._tail._nextDup=i,i._prevDup=this._tail,i._nextDup=null,this._tail=i)}get(i,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,i))return n;return null}remove(i){const e=i._prevDup,n=i._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class qz{map=new Map;put(i){const e=i.trackById;let n=this.map.get(e);n||(n=new bY,this.map.set(e,n)),n.add(i)}get(i,e){const o=this.map.get(i);return o?o.get(i,e):null}remove(i){const e=i.trackById;return this.map.get(e).remove(i)&&this.map.delete(e),i}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Wz(t,i,e){const n=t.previousIndex;if(null===n)return n;let o=0;return e&&n{if(e&&e.key===o)this._maybeAddToChanges(e,n),this._appendAfter=e,e=e._next;else{const r=this._getOrCreateRecordForKey(o,n);e=this._insertBeforeOrAppend(e,r)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let n=e;null!==n;n=n._nextRemoved)n===this._mapHead&&(this._mapHead=null),this._records.delete(n.key),n._nextRemoved=n._next,n.previousValue=n.currentValue,n.currentValue=null,n._prev=null,n._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(i,e){if(i){const n=i._prev;return e._next=i,e._prev=n,i._prev=e,n&&(n._next=e),i===this._mapHead&&(this._mapHead=e),this._appendAfter=i,i}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(i,e){if(this._records.has(i)){const o=this._records.get(i);this._maybeAddToChanges(o,e);const r=o._prev,u=o._next;return r&&(r._next=u),u&&(u._prev=r),o._next=null,o._prev=null,o}const n=new vY(i);return this._records.set(i,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let i;for(this._previousMapHead=this._mapHead,i=this._previousMapHead;null!==i;i=i._next)i._nextPrevious=i._next;for(i=this._changesHead;null!==i;i=i._nextChanged)i.previousValue=i.currentValue;for(i=this._additionsHead;null!=i;i=i._nextAdded)i.previousValue=i.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(i,e){Object.is(e,i.currentValue)||(i.previousValue=i.currentValue,i.currentValue=e,this._addToChanges(i))}_addToAdditions(i){null===this._additionsHead?this._additionsHead=this._additionsTail=i:(this._additionsTail._nextAdded=i,this._additionsTail=i)}_addToChanges(i){null===this._changesHead?this._changesHead=this._changesTail=i:(this._changesTail._nextChanged=i,this._changesTail=i)}_forEach(i,e){i instanceof Map?i.forEach(e):Object.keys(i).forEach(n=>e(i[n],n))}}class vY{key;previousValue=null;currentValue=null;_nextPrevious=null;_next=null;_prev=null;_nextAdded=null;_nextRemoved=null;_nextChanged=null;constructor(i){this.key=i}}function Yz(){return new db([new Gz])}let db=(()=>{class t{factories;static \u0275prov=Nt({token:t,providedIn:"root",factory:Yz});constructor(e){this.factories=e}static create(e,n){if(null!=n){const o=n.factories.slice();e=e.concat(o)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Yz()),deps:[[t,new _l,new oc]]}}find(e){const n=this.factories.find(o=>o.supports(e));if(null!=n)return n;throw new ct(901,!1)}}return t})();function Xz(){return new _I([new Zz])}let _I=(()=>{class t{static \u0275prov=Nt({token:t,providedIn:"root",factory:Xz});factories;constructor(e){this.factories=e}static create(e,n){if(n){const o=n.factories.slice();e=e.concat(o)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Xz()),deps:[[t,new _l,new oc]]}}find(e){const n=this.factories.find(o=>o.supports(e));if(n)return n;throw new ct(901,!1)}}return t})();const CY=zz(null,"core",[]);let SY=(()=>{class t{constructor(e){}static \u0275fac=function(n){return new(n||t)(xn(Bd))};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();function fn(t){return"boolean"==typeof t?t:null!=t&&"false"!==t}function Ql(t,i=NaN){return isNaN(parseFloat(t))||isNaN(Number(t))?i:Number(t)}function dl(t){return function Nr(t){const i=Be(null);try{return t()}finally{Be(i)}}(t)}function $p(t,i){return Ui(t,i?.equal)}class XY{[Pt];constructor(i){this[Pt]=i}destroy(){this[Pt].destroy()}}function xI(t,i){!i?.injector&&vh();const e=i?.injector??Y(Ke);let o,n=!0!==i?.manualCleanup?e.get(Ut):null;const r=e.get(Ey,null,{optional:!0}),u=e.get(xt);return null===r||i?.forceRoot?o=function eX(t,i,e){const n=Object.create(KY);return n.fn=t,n.scheduler=i,n.notifier=e,n.zone=typeof Zone<"u"?Zone.current:null,n.scheduler.schedule(n),n.notifier.notify(12),n}(t,e.get(yN),u):(o=function JY(t,i,e){const n=Object.create(QY);return n.view=t,n.zone=typeof Zone<"u"?Zone.current:null,n.notifier=i,n.fn=e,t[23]??=new Set,t[23].add(n),n.consumerMarkedDirty(n),n}(r.view,u,t),n instanceof tt&&n._lView===r.view&&(n=null)),o.injector=e,null!==n&&(o.onDestroyFn=n.onDestroy(()=>o.destroy())),new XY(o)}const d5={...vn,consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,hasRun:!1,cleanupFns:void 0,zone:null,kind:"effect",onDestroyFn:Wn,run(){if(this.dirty=!1,this.hasRun&&!$o(this))return;this.hasRun=!0;const t=n=>(this.cleanupFns??=[]).push(n),i=hn(this),e=Nu(!1);try{this.maybeCleanup(),this.fn(t)}finally{Nu(e),Ji(this,i)}},maybeCleanup(){if(this.cleanupFns?.length)try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[]}}},KY={...d5,consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){sn(this),this.onDestroyFn(),this.maybeCleanup(),this.scheduler.remove(this)}},QY={...d5,consumerMarkedDirty(){this.view[2]|=8192,Lu(this.view),this.notifier.notify(13)},destroy(){sn(this),this.onDestroyFn(),this.maybeCleanup(),this.view[23]?.delete(this)}};function f5(t,i){const e=co(t),n=i.elementInjector||Sf();return new hS(e).create(n,i.projectableNodes,i.hostElement,i.environmentInjector)}const Oo=new yt("");let _5=null;function ub(){return _5}class mX{}let ER=(()=>{class t{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(_X),providedIn:"platform"})}return t})();const fX=new yt("");let _X=(()=>{class t extends ER{_location;_history;_doc=Y(Oo);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ub().getBaseHref(this._doc)}onPopState(e){const n=ub().getGlobalEventTarget(this._doc,"window");return n.addEventListener("popstate",e,!1),()=>n.removeEventListener("popstate",e)}onHashChange(e){const n=ub().getGlobalEventTarget(this._doc,"window");return n.addEventListener("hashchange",e,!1),()=>n.removeEventListener("hashchange",e)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(e){this._location.pathname=e}pushState(e,n,o){this._history.pushState(e,n,o)}replaceState(e,n,o){this._history.replaceState(e,n,o)}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>new t,providedIn:"platform"})}return t})();function MR(t,i){return t?i?t.endsWith("/")?i.startsWith("/")?t+i.slice(1):t+i:i.startsWith("/")?t+i:`${t}/${i}`:t:i}function g5(t){const i=t.search(/#|\?|$/);return"/"===t[i-1]?t.slice(0,i-1)+t.slice(i):t}function g_(t){return t&&"?"!==t[0]?`?${t}`:t}let Mv=(()=>{class t{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(y5),providedIn:"root"})}return t})();const b5=new yt("");let y5=(()=>{class t extends Mv{_platformLocation;_baseHref;_removeListenerFns=[];constructor(e,n){super(),this._platformLocation=e,this._baseHref=n??this._platformLocation.getBaseHrefFromDOM()??Y(Oo).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return MR(this._baseHref,e)}path(e=!1){const n=this._platformLocation.pathname+g_(this._platformLocation.search),o=this._platformLocation.hash;return o&&e?`${n}${o}`:n}pushState(e,n,o,r){const u=this.prepareExternalUrl(o+g_(r));this._platformLocation.pushState(e,n,u)}replaceState(e,n,o,r){const u=this.prepareExternalUrl(o+g_(r));this._platformLocation.replaceState(e,n,u)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(n){return new(n||t)(xn(ER),xn(b5,8))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),mx=(()=>{class t{_subject=new Ee;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(e){this._locationStrategy=e;const n=this._locationStrategy.getBaseHref();this._basePath=function yX(t){if(new RegExp("^(https?:)?//").test(t)){const[,e]=t.split(/\/\/[^\/]+/);return e}return t}(g5(v5(n))),this._locationStrategy.onPopState(o=>{this._subject.next({url:this.path(!0),pop:!0,state:o.state,type:o.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,n=""){return this.path()==this.normalize(e+g_(n))}normalize(e){return t.stripTrailingSlash(function bX(t,i){if(!t||!i.startsWith(t))return i;const e=i.substring(t.length);return""===e||["/",";","?","#"].includes(e[0])?e:i}(this._basePath,v5(e)))}prepareExternalUrl(e){return e&&"/"!==e[0]&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,n="",o=null){this._locationStrategy.pushState(o,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g_(n)),o)}replaceState(e,n="",o=null){this._locationStrategy.replaceState(o,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+g_(n)),o)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription??=this.subscribe(n=>{this._notifyUrlChangeListeners(n.url,n.state)}),()=>{const n=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(n,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",n){this._urlChangeListeners.forEach(o=>o(e,n))}subscribe(e,n,o){return this._subject.subscribe({next:e,error:n??void 0,complete:o??void 0})}static normalizeQueryParams=g_;static joinWithSlash=MR;static stripTrailingSlash=g5;static \u0275fac=function(n){return new(n||t)(xn(Mv))};static \u0275prov=Nt({token:t,factory:()=>function gX(){return new mx(xn(Mv))}(),providedIn:"root"})}return t})();function v5(t){return t.replace(/\/index.html$/,"")}function x5(t,i){i=encodeURIComponent(i);for(const e of t.split(";")){const n=e.indexOf("="),[o,r]=-1==n?[e,""]:[e.slice(0,n),e.slice(n+1)];if(o.trim()===i)return decodeURIComponent(r)}return null}const w5="browser";function C5(t){return t===w5}function S5(t){return"server"===t}class T5{}let xX=(()=>{class t extends Mv{_platformLocation;_baseHref="";_removeListenerFns=[];constructor(e,n){super(),this._platformLocation=e,null!=n&&(this._baseHref=n)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}path(e=!1){const n=this._platformLocation.hash??"#";return n.length>0?n.substring(1):n}prepareExternalUrl(e){const n=MR(this._baseHref,e);return n.length>0?"#"+n:n}pushState(e,n,o,r){const u=this.prepareExternalUrl(o+g_(r))||this._platformLocation.pathname;this._platformLocation.pushState(e,n,u)}replaceState(e,n,o,r){const u=this.prepareExternalUrl(o+g_(r))||this._platformLocation.pathname;this._platformLocation.replaceState(e,n,u)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(n){return new(n||t)(xn(ER),xn(b5,8))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();var wI=function(t){return t[t.Decimal=0]="Decimal",t[t.Percent=1]="Percent",t[t.Currency=2]="Currency",t[t.Scientific=3]="Scientific",t}(wI||{}),jd=function(t){return t[t.Format=0]="Format",t[t.Standalone=1]="Standalone",t}(jd||{}),Ma=function(t){return t[t.Narrow=0]="Narrow",t[t.Abbreviated=1]="Abbreviated",t[t.Wide=2]="Wide",t[t.Short=3]="Short",t}(Ma||{}),Yu=function(t){return t[t.Short=0]="Short",t[t.Medium=1]="Medium",t[t.Long=2]="Long",t[t.Full=3]="Full",t}(Yu||{});function CI(t,i){return jh(Vd(t)[Ha.DateFormat],i)}function SI(t,i){return jh(Vd(t)[Ha.TimeFormat],i)}function TI(t,i){return jh(Vd(t)[Ha.DateTimeFormat],i)}function Hh(t,i){const e=Vd(t),n=e[Ha.NumberSymbols][i];if(typeof n>"u"){if(12===i)return e[Ha.NumberSymbols][0];if(13===i)return e[Ha.NumberSymbols][1]}return n}function I5(t){if(!t[Ha.ExtraData])throw new Error(`Missing extra locale data for the locale "${t[Ha.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function jh(t,i){for(let e=i;e>-1;e--)if(typeof t[e]<"u")return t[e];throw new Error("Locale data API: locale data undefined")}function kR(t){const[i,e]=t.split(":");return{hours:+i,minutes:+e}}const LX=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,DI={},FX=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;function NX(t,i,e,n){let o=function qX(t){if(A5(t))return t;if("number"==typeof t&&!isNaN(t))return new Date(t);if("string"==typeof t){if(t=t.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(t)){const[o,r=1,u=1]=t.split("-").map(y=>+y);return II(o,r-1,u)}const e=parseFloat(t);if(!isNaN(t-e))return new Date(e);let n;if(n=t.match(LX))return function WX(t){const i=new Date(0);let e=0,n=0;const o=t[8]?i.setUTCFullYear:i.setFullYear,r=t[8]?i.setUTCHours:i.setHours;t[9]&&(e=Number(t[9]+t[10]),n=Number(t[9]+t[11])),o.call(i,Number(t[1]),Number(t[2])-1,Number(t[3]));const u=Number(t[4]||0)-e,y=Number(t[5]||0)-n,I=Number(t[6]||0),V=Math.floor(1e3*parseFloat("0."+(t[7]||0)));return r.call(i,u,y,I,V),i}(n)}const i=new Date(t);if(!A5(i))throw new Error(`Unable to convert "${t}" into a date`);return i}(t);i=b_(e,i)||i;let y,u=[];for(;i;){if(y=FX.exec(i),!y){u.push(i);break}{u=u.concat(y.slice(1));const q=u.pop();if(!q)break;i=q}}let I=o.getTimezoneOffset();n&&(I=M5(n,I),o=function GX(t,i){const o=t.getTimezoneOffset();return function $X(t,i){return(t=new Date(t.getTime())).setMinutes(t.getMinutes()+i),t}(t,-1*(M5(i,o)-o))}(o,n));let V="";return u.forEach(q=>{const ee=function jX(t){if(OR[t])return OR[t];let i;switch(t){case"G":case"GG":case"GGG":i=ja(3,Ma.Abbreviated);break;case"GGGG":i=ja(3,Ma.Wide);break;case"GGGGG":i=ja(3,Ma.Narrow);break;case"y":i=Al(0,1,0,!1,!0);break;case"yy":i=Al(0,2,0,!0,!0);break;case"yyy":i=Al(0,3,0,!1,!0);break;case"yyyy":i=Al(0,4,0,!1,!0);break;case"Y":i=kI(1);break;case"YY":i=kI(2,!0);break;case"YYY":i=kI(3);break;case"YYYY":i=kI(4);break;case"M":case"L":i=Al(1,1,1);break;case"MM":case"LL":i=Al(1,2,1);break;case"MMM":i=ja(2,Ma.Abbreviated);break;case"MMMM":i=ja(2,Ma.Wide);break;case"MMMMM":i=ja(2,Ma.Narrow);break;case"LLL":i=ja(2,Ma.Abbreviated,jd.Standalone);break;case"LLLL":i=ja(2,Ma.Wide,jd.Standalone);break;case"LLLLL":i=ja(2,Ma.Narrow,jd.Standalone);break;case"w":i=RR(1);break;case"ww":i=RR(2);break;case"W":i=RR(1,!0);break;case"d":i=Al(2,1);break;case"dd":i=Al(2,2);break;case"c":case"cc":i=Al(7,1);break;case"ccc":i=ja(1,Ma.Abbreviated,jd.Standalone);break;case"cccc":i=ja(1,Ma.Wide,jd.Standalone);break;case"ccccc":i=ja(1,Ma.Narrow,jd.Standalone);break;case"cccccc":i=ja(1,Ma.Short,jd.Standalone);break;case"E":case"EE":case"EEE":i=ja(1,Ma.Abbreviated);break;case"EEEE":i=ja(1,Ma.Wide);break;case"EEEEE":i=ja(1,Ma.Narrow);break;case"EEEEEE":i=ja(1,Ma.Short);break;case"a":case"aa":case"aaa":i=ja(0,Ma.Abbreviated);break;case"aaaa":i=ja(0,Ma.Wide);break;case"aaaaa":i=ja(0,Ma.Narrow);break;case"b":case"bb":case"bbb":i=ja(0,Ma.Abbreviated,jd.Standalone,!0);break;case"bbbb":i=ja(0,Ma.Wide,jd.Standalone,!0);break;case"bbbbb":i=ja(0,Ma.Narrow,jd.Standalone,!0);break;case"B":case"BB":case"BBB":i=ja(0,Ma.Abbreviated,jd.Format,!0);break;case"BBBB":i=ja(0,Ma.Wide,jd.Format,!0);break;case"BBBBB":i=ja(0,Ma.Narrow,jd.Format,!0);break;case"h":i=Al(3,1,-12);break;case"hh":i=Al(3,2,-12);break;case"H":i=Al(3,1);break;case"HH":i=Al(3,2);break;case"m":i=Al(4,1);break;case"mm":i=Al(4,2);break;case"s":i=Al(5,1);break;case"ss":i=Al(5,2);break;case"S":i=Al(6,1);break;case"SS":i=Al(6,2);break;case"SSS":i=Al(6,3);break;case"Z":case"ZZ":case"ZZZ":i=MI(0);break;case"ZZZZZ":i=MI(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":i=MI(1);break;case"OOOO":case"ZZZZ":case"zzzz":i=MI(2);break;default:return null}return OR[t]=i,i}(q);V+=ee?ee(o,e,I):"''"===q?"'":q.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),V}function II(t,i,e){const n=new Date(0);return n.setFullYear(t,i,e),n.setHours(0,0,0),n}function b_(t,i){const e=function CX(t){return Vd(t)[Ha.LocaleId]}(t);if(DI[e]??={},DI[e][i])return DI[e][i];let n="";switch(i){case"shortDate":n=CI(t,Yu.Short);break;case"mediumDate":n=CI(t,Yu.Medium);break;case"longDate":n=CI(t,Yu.Long);break;case"fullDate":n=CI(t,Yu.Full);break;case"shortTime":n=SI(t,Yu.Short);break;case"mediumTime":n=SI(t,Yu.Medium);break;case"longTime":n=SI(t,Yu.Long);break;case"fullTime":n=SI(t,Yu.Full);break;case"short":const o=b_(t,"shortTime"),r=b_(t,"shortDate");n=EI(TI(t,Yu.Short),[o,r]);break;case"medium":const u=b_(t,"mediumTime"),y=b_(t,"mediumDate");n=EI(TI(t,Yu.Medium),[u,y]);break;case"long":const I=b_(t,"longTime"),V=b_(t,"longDate");n=EI(TI(t,Yu.Long),[I,V]);break;case"full":const q=b_(t,"fullTime"),ee=b_(t,"fullDate");n=EI(TI(t,Yu.Full),[q,ee])}return n&&(DI[e][i]=n),n}function EI(t,i){return i&&(t=t.replace(/\{([^}]+)}/g,function(e,n){return null!=i&&n in i?i[n]:e})),t}function Gp(t,i,e="-",n,o){let r="";(t<0||o&&t<=0)&&(o?t=1-t:(t=-t,r=e));let u=String(t);for(;u.length0||y>-e)&&(y+=e),3===t)0===y&&-12===e&&(y=12);else if(6===t)return function zX(t,i){return Gp(t,3).substring(0,i)}(y,i);const I=Hh(u,5);return Gp(y,i,I,n,o)}}function ja(t,i,e=jd.Format,n=!1){return function(o,r){return function VX(t,i,e,n,o,r){switch(e){case 2:return function DX(t,i,e){const n=Vd(t),r=jh([n[Ha.MonthsFormat],n[Ha.MonthsStandalone]],i);return jh(r,e)}(i,o,n)[t.getMonth()];case 1:return function TX(t,i,e){const n=Vd(t),r=jh([n[Ha.DaysFormat],n[Ha.DaysStandalone]],i);return jh(r,e)}(i,o,n)[t.getDay()];case 0:const u=t.getHours(),y=t.getMinutes();if(r){const V=function AX(t){const i=Vd(t);return I5(i),(i[Ha.ExtraData][2]||[]).map(n=>"string"==typeof n?kR(n):[kR(n[0]),kR(n[1])])}(i),q=function kX(t,i,e){const n=Vd(t);I5(n);const r=jh([n[Ha.ExtraData][0],n[Ha.ExtraData][1]],i)||[];return jh(r,e)||[]}(i,o,n),ee=V.findIndex(me=>{if(Array.isArray(me)){const[he,Ce]=me,je=u>=he.hours&&y>=he.minutes,mt=u0?Math.floor(o/60):Math.ceil(o/60);switch(t){case 0:return(o>=0?"+":"")+Gp(u,2,r)+Gp(Math.abs(o%60),2,r);case 1:return"GMT"+(o>=0?"+":"")+Gp(u,1,r);case 2:return"GMT"+(o>=0?"+":"")+Gp(u,2,r)+":"+Gp(Math.abs(o%60),2,r);case 3:return 0===n?"Z":(o>=0?"+":"")+Gp(u,2,r)+":"+Gp(Math.abs(o%60),2,r);default:throw new Error(`Unknown zone width "${t}"`)}}}const UX=0,AI=4;function E5(t){const i=t.getDay(),e=0===i?-3:AI-i;return II(t.getFullYear(),t.getMonth(),t.getDate()+e)}function RR(t,i=!1){return function(e,n){let o;if(i){const r=new Date(e.getFullYear(),e.getMonth(),1).getDay()-1,u=e.getDate();o=1+Math.floor((u+r)/7)}else{const r=E5(e),u=function HX(t){const i=II(t,UX,1).getDay();return II(t,0,1+(i<=AI?AI:AI+7)-i)}(r.getFullYear()),y=r.getTime()-u.getTime();o=1+Math.round(y/6048e5)}return Gp(o,t,Hh(n,5))}}function kI(t,i=!1){return function(e,n){return Gp(E5(e).getFullYear(),t,Hh(n,5),i)}}const OR={};function M5(t,i){t=t.replace(/:/g,"");const e=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(e)?i:e}function A5(t){return t instanceof Date&&!isNaN(t.valueOf())}const ZX=/^(\d+)?\.((\d+)(-(\d+))?)?$/;function NR(t){const i=parseInt(t);if(isNaN(i))throw new Error("Invalid integer literal when parsing "+t);return i}const BR=/\s+/,P5=[];let $d=(()=>{class t{_ngEl;_renderer;initialClasses=P5;rawClass;stateMap=new Map;constructor(e,n){this._ngEl=e,this._renderer=n}set klass(e){this.initialClasses=null!=e?e.trim().split(BR):P5}set ngClass(e){this.rawClass="string"==typeof e?e.trim().split(BR):e}ngDoCheck(){for(const n of this.initialClasses)this._updateState(n,!0);const e=this.rawClass;if(Array.isArray(e)||e instanceof Set)for(const n of e)this._updateState(n,!0);else if(null!=e)for(const n of Object.keys(e))this._updateState(n,!!e[n]);this._applyStateDiff()}_updateState(e,n){const o=this.stateMap.get(e);void 0!==o?(o.enabled!==n&&(o.changed=!0,o.enabled=n),o.touched=!0):this.stateMap.set(e,{enabled:n,changed:!0,touched:!0})}_applyStateDiff(){for(const e of this.stateMap){const n=e[0],o=e[1];o.changed?(this._toggleClass(n,o.enabled),o.changed=!1):o.touched||(o.enabled&&this._toggleClass(n,!1),this.stateMap.delete(n)),o.touched=!1}}_toggleClass(e,n){(e=e.trim()).length>0&&e.split(BR).forEach(o=>{n?this._renderer.addClass(this._ngEl.nativeElement,o):this._renderer.removeClass(this._ngEl.nativeElement,o)})}static \u0275fac=function(n){return new(n||t)($e(Pn),$e(Hr))};static \u0275dir=Gt({type:t,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return t})();class aK{$implicit;ngForOf;index;count;constructor(i,e,n,o){this.$implicit=i,this.ngForOf=e,this.index=n,this.count=o}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let kl=(()=>{class t{_viewContainer;_template;_differs;set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(e,n,o){this._viewContainer=e,this._template=n,this._differs=o}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const e=this._ngForOf;!this._differ&&e&&(this._differ=this._differs.find(e).create(this.ngForTrackBy))}if(this._differ){const e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){const n=this._viewContainer;e.forEachOperation((o,r,u)=>{if(null==o.previousIndex)n.createEmbeddedView(this._template,new aK(o.item,this._ngForOf,-1,-1),null===u?void 0:u);else if(null==u)n.remove(null===r?void 0:r);else if(null!==r){const y=n.get(r);n.move(y,u),F5(y,o)}});for(let o=0,r=n.length;o{F5(n.get(o.currentIndex),o)})}static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||t)($e(es),$e(sa),$e(db))};static \u0275dir=Gt({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return t})();function F5(t,i){t.context.$implicit=i.item}let ir=(()=>{class t{_viewContainer;_context=new sK;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(e,n){this._viewContainer=e,this._thenTemplateRef=n}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){N5(e),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){N5(e),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||t)($e(es),$e(sa))};static \u0275dir=Gt({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return t})();class sK{$implicit=null;ngIf=null}function N5(t,i){if(t&&!t.createEmbeddedView)throw new ct(2020,!1)}class VR{_viewContainerRef;_templateRef;_created=!1;constructor(i,e){this._viewContainerRef=i,this._templateRef=e}create(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)}destroy(){this._created=!1,this._viewContainerRef.clear()}enforceState(i){i&&!this._created?this.create():!i&&this._created&&this.destroy()}}let LS=(()=>{class t{_defaultViews=[];_defaultUsed=!1;_caseCount=0;_lastCaseCheckIndex=0;_lastCasesMatched=!1;_ngSwitch;set ngSwitch(e){this._ngSwitch=e,0===this._caseCount&&this._updateDefaultCases(!0)}_addCase(){return this._caseCount++}_addDefault(e){this._defaultViews.push(e)}_matchCase(e){const n=e===this._ngSwitch;return this._lastCasesMatched||=n,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),n}_updateDefaultCases(e){if(this._defaultViews.length>0&&e!==this._defaultUsed){this._defaultUsed=e;for(const n of this._defaultViews)n.enforceState(e)}}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","ngSwitch",""]],inputs:{ngSwitch:"ngSwitch"}})}return t})(),UR=(()=>{class t{ngSwitch;_view;ngSwitchCase;constructor(e,n,o){this.ngSwitch=o,o._addCase(),this._view=new VR(e,n)}ngDoCheck(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))}static \u0275fac=function(n){return new(n||t)($e(es),$e(sa),$e(LS,9))};static \u0275dir=Gt({type:t,selectors:[["","ngSwitchCase",""]],inputs:{ngSwitchCase:"ngSwitchCase"}})}return t})(),HR=(()=>{class t{constructor(e,n,o){o._addDefault(new VR(e,n))}static \u0275fac=function(n){return new(n||t)($e(es),$e(sa),$e(LS,9))};static \u0275dir=Gt({type:t,selectors:[["","ngSwitchDefault",""]]})}return t})(),Ym=(()=>{class t{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(e,n,o){this._ngEl=e,this._differs=n,this._renderer=o}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){const e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,n){const[o,r]=e.split("."),u=-1===o.indexOf("-")?void 0:zp.DashCase;null!=n?this._renderer.setStyle(this._ngEl.nativeElement,o,r?`${n}${r}`:n,u):this._renderer.removeStyle(this._ngEl.nativeElement,o,u)}_applyChanges(e){e.forEachRemovedItem(n=>this._setStyle(n.key,null)),e.forEachAddedItem(n=>this._setStyle(n.key,n.currentValue)),e.forEachChangedItem(n=>this._setStyle(n.key,n.currentValue))}static \u0275fac=function(n){return new(n||t)($e(Pn),$e(_I),$e(Hr))};static \u0275dir=Gt({type:t,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return t})(),jR=(()=>{class t{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;constructor(e){this._viewContainerRef=e}ngOnChanges(e){if(this._shouldRecreateView(e)){const n=this._viewContainerRef;if(this._viewRef&&n.remove(n.indexOf(this._viewRef)),!this.ngTemplateOutlet)return void(this._viewRef=null);const o=this._createContextForwardProxy();this._viewRef=n.createEmbeddedView(this.ngTemplateOutlet,o,{injector:this.ngTemplateOutletInjector??void 0})}}_shouldRecreateView(e){return!!e.ngTemplateOutlet||!!e.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(e,n,o)=>!!this.ngTemplateOutletContext&&Reflect.set(this.ngTemplateOutletContext,n,o),get:(e,n,o)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,n,o)}})}static \u0275fac=function(n){return new(n||t)($e(es))};static \u0275dir=Gt({type:t,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[go]})}return t})();function qp(t,i){return new ct(2100,!1)}class cK{createSubscription(i,e){return dl(()=>i.subscribe({next:e,error:n=>{throw n}}))}dispose(i){dl(()=>i.unsubscribe())}}class dK{createSubscription(i,e){return i.then(n=>e?.(n),n=>{throw n}),{unsubscribe:()=>{e=null}}}dispose(i){i.unsubscribe()}}const uK=new dK,hK=new cK;let $R=(()=>{class t{_ref;_latestValue=null;markForCheckOnValueUpdate=!0;_subscription=null;_obj=null;_strategy=null;constructor(e){this._ref=e}ngOnDestroy(){this._subscription&&this._dispose(),this._ref=null}transform(e){if(!this._obj){if(e)try{this.markForCheckOnValueUpdate=!1,this._subscribe(e)}finally{this.markForCheckOnValueUpdate=!0}return this._latestValue}return e!==this._obj?(this._dispose(),this.transform(e)):this._latestValue}_subscribe(e){this._obj=e,this._strategy=this._selectStrategy(e),this._subscription=this._strategy.createSubscription(e,n=>this._updateLatestValue(e,n))}_selectStrategy(e){if(gS(e))return uK;if(vN(e))return hK;throw qp()}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._subscription=null,this._obj=null}_updateLatestValue(e,n){e===this._obj&&(this._latestValue=n,this.markForCheckOnValueUpdate&&this._ref?.markForCheck())}static \u0275fac=function(n){return new(n||t)($e(So,16))};static \u0275pipe=zd({name:"async",type:t,pure:!1})}return t})();const bK=new yt(""),yK=new yt("");let Rl=(()=>{class t{locale;defaultTimezone;defaultOptions;constructor(e,n,o){this.locale=e,this.defaultTimezone=n,this.defaultOptions=o}transform(e,n,o,r){if(null==e||""===e||e!=e)return null;try{return NX(e,n??this.defaultOptions?.dateFormat??"mediumDate",r||this.locale,o??this.defaultOptions?.timezone??this.defaultTimezone??void 0)}catch(u){throw qp()}}static \u0275fac=function(n){return new(n||t)($e(__,16),$e(bK,24),$e(yK,24))};static \u0275pipe=zd({name:"date",type:t,pure:!0})}return t})(),B5=(()=>{class t{transform(e){return JSON.stringify(e,null,2)}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=zd({name:"json",type:t,pure:!1})}return t})(),OI=(()=>{class t{differs;constructor(e){this.differs=e}differ;keyValues=[];compareFn=V5;transform(e,n=V5){if(!e||!(e instanceof Map)&&"object"!=typeof e)return null;this.differ??=this.differs.find(e).create();const o=this.differ.diff(e),r=n!==this.compareFn;return o&&(this.keyValues=[],o.forEachItem(u=>{this.keyValues.push(function CK(t,i){return{key:t,value:i}}(u.key,u.currentValue))})),(o||r)&&(n&&this.keyValues.sort(n),this.compareFn=n),this.keyValues}static \u0275fac=function(n){return new(n||t)($e(_I,16))};static \u0275pipe=zd({name:"keyvalue",type:t,pure:!1})}return t})();function V5(t,i){const e=t.key,n=i.key;if(e===n)return 0;if(null==e)return 1;if(null==n)return-1;if("string"==typeof e&&"string"==typeof n)return e{class t{_locale;constructor(e){this._locale=e}transform(e,n,o){if(!function GR(t){return!(null==t||""===t||t!=t)}(e))return null;o||=this._locale;try{return function eK(t,i,e){return function LR(t,i,e,n,o,r,u=!1){let y="",I=!1;if(isFinite(t)){let V=function nK(t){let n,o,r,u,y,i=Math.abs(t)+"",e=0;for((o=i.indexOf("."))>-1&&(i=i.replace(".","")),(r=i.search(/e/i))>0?(o<0&&(o=r),o+=+i.slice(r+1),i=i.substring(0,r)):o<0&&(o=i.length),r=0;"0"===i.charAt(r);r++);if(r===(y=i.length))n=[0],o=1;else{for(y--;"0"===i.charAt(y);)y--;for(o-=r,n=[],u=0;r<=y;r++,u++)n[u]=Number(i.charAt(r))}return o>22&&(n=n.splice(0,21),e=o-1,o=1),{digits:n,exponent:e,integerLen:o}}(t);u&&(V=function tK(t){if(0===t.digits[0])return t;const i=t.digits.length-t.integerLen;return t.exponent?t.exponent+=2:(0===i?t.digits.push(0,0):1===i&&t.digits.push(0),t.integerLen+=2),t}(V));let q=i.minInt,ee=i.minFrac,me=i.maxFrac;if(r){const At=r.match(ZX);if(null===At)throw new Error(`${r} is not a valid digit info`);const Mn=At[1],di=At[3],Ei=At[5];null!=Mn&&(q=NR(Mn)),null!=di&&(ee=NR(di)),null!=Ei?me=NR(Ei):null!=di&&ee>me&&(me=ee)}!function iK(t,i,e){if(i>e)throw new Error(`The minimum number of digits after fraction (${i}) is higher than the maximum (${e}).`);let n=t.digits,o=n.length-t.integerLen;const r=Math.min(Math.max(i,o),e);let u=r+t.integerLen,y=n[u];if(u>0){n.splice(Math.max(t.integerLen,u));for(let ee=u;ee=5)if(u-1<0){for(let ee=0;ee>u;ee--)n.unshift(0),t.integerLen++;n.unshift(1),t.integerLen++}else n[u-1]++;for(;o=V?Ce.pop():I=!1),me>=10?1:0},0);q&&(n.unshift(q),t.integerLen++)}(V,ee,me);let he=V.digits,Ce=V.integerLen;const je=V.exponent;let mt=[];for(I=he.every(At=>!At);Ce0?mt=he.splice(Ce,he.length):(mt=he,he=[0]);const Lt=[];for(he.length>=i.lgSize&&Lt.unshift(he.splice(-i.lgSize,he.length).join(""));he.length>i.gSize;)Lt.unshift(he.splice(-i.gSize,he.length).join(""));he.length&&Lt.unshift(he.join("")),y=Lt.join(Hh(e,n)),mt.length&&(y+=Hh(e,o)+mt.join("")),je&&(y+=Hh(e,6)+"+"+je)}else y=Hh(e,9);return y=t<0&&!I?i.negPre+y+i.negSuf:i.posPre+y+i.posSuf,y}(t,function FR(t,i="-"){const e={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=t.split(";"),o=n[0],r=n[1],u=-1!==o.indexOf(".")?o.split("."):[o.substring(0,o.lastIndexOf("0")+1),o.substring(o.lastIndexOf("0")+1)],y=u[0],I=u[1]||"";e.posPre=y.substring(0,y.indexOf("#"));for(let q=0;q{class t{transform(e,n,o){if(null==e)return null;if("string"!=typeof e&&!Array.isArray(e))throw qp();return e.slice(n,o)}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=zd({name:"slice",type:t,pure:!1})}return t})(),j5=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();const WR=new yt("");let $5=(()=>{class t{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(o=>{o.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,o,r){return this._findPluginFor(n).addEventListener(e,n,o,r)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(r=>r.supports(e)),!n)throw new ct(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||t)(xn(WR),xn(tn))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();class G5{_doc;constructor(i){this._doc=i}manager}const PI="ng-app-id";function q5(t){for(const i of t)i.remove()}function W5(t,i){const e=i.createElement("style");return e.textContent=t,e}function ZR(t,i){const e=i.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",t),e}let Z5=(()=>{class t{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(e,n,o,r={}){this.doc=e,this.appId=n,this.nonce=o,this.isServer=S5(r),function DK(t,i,e,n){const o=t.head?.querySelectorAll(`style[${PI}="${i}"],link[${PI}="${i}"]`);if(o)for(const r of o)r.removeAttribute(PI),r instanceof HTMLLinkElement?n.set(r.href.slice(r.href.lastIndexOf("/")+1),{usage:0,elements:[r]}):r.textContent&&e.set(r.textContent,{usage:0,elements:[r]})}(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(const o of e)this.addUsage(o,this.inline,W5);n?.forEach(o=>this.addUsage(o,this.external,ZR))}removeStyles(e,n){for(const o of e)this.removeUsage(o,this.inline);n?.forEach(o=>this.removeUsage(o,this.external))}addUsage(e,n,o){const r=n.get(e);r?r.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(u=>this.addElement(u,o(e,this.doc)))})}removeUsage(e,n){const o=n.get(e);o&&(o.usage--,o.usage<=0&&(q5(o.elements),n.delete(e)))}ngOnDestroy(){for(const[,{elements:e}]of[...this.inline,...this.external])q5(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(const[n,{elements:o}]of this.inline)o.push(this.addElement(e,W5(n,this.doc)));for(const[n,{elements:o}]of this.external)o.push(this.addElement(e,ZR(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),this.isServer&&n.setAttribute(PI,this.appId),e.appendChild(n)}static \u0275fac=function(n){return new(n||t)(xn(Oo),xn(Vu),xn(Rw,8),xn(xy))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const YR={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},XR=/%COMP%/g,RK=new yt("",{providedIn:"root",factory:()=>!0});function X5(t,i){return i.map(e=>e.replace(XR,t))}let KR=(()=>{class t{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,o,r,u,y,I,V=null,q=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=o,this.removeStylesOnCompDestroy=r,this.doc=u,this.platformId=y,this.ngZone=I,this.nonce=V,this.tracingService=q,this.platformIsServer=S5(y),this.defaultRenderer=new QR(e,u,I,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===pu.ShadowDom&&(n={...n,encapsulation:pu.Emulated});const o=this.getOrCreateRenderer(e,n);return o instanceof Q5?o.applyToHost(e):o instanceof JR&&o.applyStyles(),o}getOrCreateRenderer(e,n){const o=this.rendererByCompId;let r=o.get(n.id);if(!r){const u=this.doc,y=this.ngZone,I=this.eventManager,V=this.sharedStylesHost,q=this.removeStylesOnCompDestroy,ee=this.platformIsServer,me=this.tracingService;switch(n.encapsulation){case pu.Emulated:r=new Q5(I,V,n,this.appId,q,u,y,ee,me);break;case pu.ShadowDom:return new FK(I,V,e,n,u,y,this.nonce,ee,me);default:r=new JR(I,V,n,q,u,y,ee,me)}o.set(n.id,r)}return r}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||t)(xn($5),xn(Z5),xn(Vu),xn(RK),xn(Oo),xn(xy),xn(tn),xn(Rw),xn(Eg,8))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();class QR{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(i,e,n,o,r){this.eventManager=i,this.doc=e,this.ngZone=n,this.platformIsServer=o,this.tracingService=r}destroy(){}destroyNode=null;createElement(i,e){return e?this.doc.createElementNS(YR[e]||e,i):this.doc.createElement(i)}createComment(i){return this.doc.createComment(i)}createText(i){return this.doc.createTextNode(i)}appendChild(i,e){(K5(i)?i.content:i).appendChild(e)}insertBefore(i,e,n){i&&(K5(i)?i.content:i).insertBefore(e,n)}removeChild(i,e){e.remove()}selectRootElement(i,e){let n="string"==typeof i?this.doc.querySelector(i):i;if(!n)throw new ct(-5104,!1);return e||(n.textContent=""),n}parentNode(i){return i.parentNode}nextSibling(i){return i.nextSibling}setAttribute(i,e,n,o){if(o){e=o+":"+e;const r=YR[o];r?i.setAttributeNS(r,e,n):i.setAttribute(e,n)}else i.setAttribute(e,n)}removeAttribute(i,e,n){if(n){const o=YR[n];o?i.removeAttributeNS(o,e):i.removeAttribute(`${n}:${e}`)}else i.removeAttribute(e)}addClass(i,e){i.classList.add(e)}removeClass(i,e){i.classList.remove(e)}setStyle(i,e,n,o){o&(zp.DashCase|zp.Important)?i.style.setProperty(e,n,o&zp.Important?"important":""):i.style[e]=n}removeStyle(i,e,n){n&zp.DashCase?i.style.removeProperty(e):i.style[e]=""}setProperty(i,e,n){null!=i&&(i[e]=n)}setValue(i,e){i.nodeValue=e}listen(i,e,n,o){if("string"==typeof i&&!(i=ub().getGlobalEventTarget(this.doc,i)))throw new ct(5102,!1);let r=this.decoratePreventDefault(n);return this.tracingService?.wrapEventListener&&(r=this.tracingService.wrapEventListener(i,e,r)),this.eventManager.addEventListener(i,e,r,o)}decoratePreventDefault(i){return e=>{if("__ngUnwrap__"===e)return i;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>i(e)):i(e))&&e.preventDefault()}}}function K5(t){return"TEMPLATE"===t.tagName&&void 0!==t.content}class FK extends QR{sharedStylesHost;hostEl;shadowRoot;constructor(i,e,n,o,r,u,y,I,V){super(i,r,u,I,V),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let q=o.styles;q=X5(o.id,q);for(const me of q){const he=document.createElement("style");y&&he.setAttribute("nonce",y),he.textContent=me,this.shadowRoot.appendChild(he)}const ee=o.getExternalStyles?.();if(ee)for(const me of ee){const he=ZR(me,r);y&&he.setAttribute("nonce",y),this.shadowRoot.appendChild(he)}}nodeOrShadowRoot(i){return i===this.hostEl?this.shadowRoot:i}appendChild(i,e){return super.appendChild(this.nodeOrShadowRoot(i),e)}insertBefore(i,e,n){return super.insertBefore(this.nodeOrShadowRoot(i),e,n)}removeChild(i,e){return super.removeChild(null,e)}parentNode(i){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(i)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class JR extends QR{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(i,e,n,o,r,u,y,I,V){super(i,r,u,y,I),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=o;let q=n.styles;this.styles=V?X5(V,q):q,this.styleUrls=n.getExternalStyles?.(V)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}}class Q5 extends JR{contentAttr;hostAttr;constructor(i,e,n,o,r,u,y,I,V){const q=o+"-"+n.id;super(i,e,n,r,u,y,I,V,q),this.contentAttr=function OK(t){return"_ngcontent-%COMP%".replace(XR,t)}(q),this.hostAttr=function PK(t){return"_nghost-%COMP%".replace(XR,t)}(q)}applyToHost(i){this.applyStyles(),this.setAttribute(i,this.hostAttr,"")}createElement(i,e){const n=super.createElement(i,e);return super.setAttribute(n,this.contentAttr,""),n}}class eO extends mX{supportsDOMEvents=!0;static makeCurrent(){!function pX(t){_5??=t}(new eO)}onAndCancel(i,e,n,o){return i.addEventListener(e,n,o),()=>{i.removeEventListener(e,n,o)}}dispatchEvent(i,e){i.dispatchEvent(e)}remove(i){i.remove()}createElement(i,e){return(e=e||this.getDefaultDocument()).createElement(i)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(i){return i.nodeType===Node.ELEMENT_NODE}isShadowRoot(i){return i instanceof DocumentFragment}getGlobalEventTarget(i,e){return"window"===e?window:"document"===e?i:"body"===e?i.body:null}getBaseHref(i){const e=function NK(){return FS=FS||document.head.querySelector("base"),FS?FS.getAttribute("href"):null}();return null==e?null:function zK(t){return new URL(t,document.baseURI).pathname}(e)}resetBaseElement(){FS=null}getUserAgent(){return window.navigator.userAgent}getCookie(i){return x5(document.cookie,i)}}let FS=null,VK=(()=>{class t{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),UK=(()=>{class t extends G5{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,o,r){return e.addEventListener(n,o,r),()=>this.removeEventListener(e,n,o,r)}removeEventListener(e,n,o,r){return e.removeEventListener(n,o,r)}static \u0275fac=function(n){return new(n||t)(xn(Oo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const J5=["alt","control","meta","shift"],HK={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},jK={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let $K=(()=>{class t extends G5{constructor(e){super(e)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,o,r){const u=t.parseEventName(n),y=t.eventCallback(u.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ub().onAndCancel(e,u.domEventName,y,r))}static parseEventName(e){const n=e.toLowerCase().split("."),o=n.shift();if(0===n.length||"keydown"!==o&&"keyup"!==o)return null;const r=t._normalizeKey(n.pop());let u="",y=n.indexOf("code");if(y>-1&&(n.splice(y,1),u="code."),J5.forEach(V=>{const q=n.indexOf(V);q>-1&&(n.splice(q,1),u+=V+".")}),u+=r,0!=n.length||0===r.length)return null;const I={};return I.domEventName=o,I.fullKey=u,I}static matchEventFullKeyCode(e,n){let o=HK[e.key]||e.key,r="";return n.indexOf("code.")>-1&&(o=e.code,r="code."),!(null==o||!o)&&(o=o.toLowerCase()," "===o?o="space":"."===o&&(o="dot"),J5.forEach(u=>{u!==o&&(0,jK[u])(e)&&(r+=u+".")}),r+=o,r===n)}static eventCallback(e,n,o){return r=>{t.matchEventFullKeyCode(r,e)&&o.runGuarded(()=>n(r))}}static _normalizeKey(e){return"esc"===e?"escape":e}static \u0275fac=function(n){return new(n||t)(xn(Oo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const ZK=zz(CY,"browser",[{provide:xy,useValue:w5},{provide:kw,useValue:function GK(){eO.makeCurrent()},multi:!0},{provide:Oo,useFactory:function WK(){return function Ah(t){vy=t}(document),document}}]),nB=[{provide:J2,useClass:class BK{addToWindow(i){Or.getAngularTestability=(n,o=!0)=>{const r=i.findTestabilityInTree(n,o);if(null==r)throw new ct(5103,!1);return r},Or.getAllAngularTestabilities=()=>i.getAllTestabilities(),Or.getAllAngularRootElements=()=>i.getAllRootElements(),Or.frameworkStabilizers||(Or.frameworkStabilizers=[]),Or.frameworkStabilizers.push(n=>{const o=Or.getAllAngularTestabilities();let r=o.length;const u=function(){r--,0==r&&n()};o.forEach(y=>{y.whenStable(u)})})}findTestabilityInTree(i,e,n){return null==e?null:i.getTestability(e)??(n?ub().isShadowRoot(e)?this.findTestabilityInTree(i,e.host,!0):this.findTestabilityInTree(i,e.parentElement,!0):null)}}},{provide:bN,useClass:qk,deps:[tn,Wk,J2]},{provide:qk,useClass:qk,deps:[tn,Wk,J2]}],iB=[{provide:Au,useValue:"root"},{provide:bo,useFactory:function qK(){return new bo}},{provide:WR,useClass:UK,multi:!0,deps:[Oo]},{provide:WR,useClass:$K,multi:!0,deps:[Oo]},KR,Z5,$5,{provide:Qc,useExisting:KR},{provide:T5,useClass:VK},[]];let oB=(()=>{class t{constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[...iB,...nB],imports:[j5,SY]})}return t})();function hb(t){return this instanceof hb?(this.v=t,this):new hb(t)}function lB(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t=function oO(t){var i="function"==typeof Symbol&&Symbol.iterator,e=i&&t[i],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(u){return new Promise(function(y,I){!function o(r,u,y,I){Promise.resolve(I).then(function(V){r({value:V,done:y})},u)}(y,I,(u=t[r](u)).done,u.value)})}}}qt(4511),"function"==typeof SuppressedError&&SuppressedError;const aO=t=>t&&"number"==typeof t.length&&"function"!=typeof t;function cB(t){return an(t?.then)}function dB(t){return an(t[Na])}function uB(t){return Symbol.asyncIterator&&an(t?.[Symbol.asyncIterator])}function hB(t){return new TypeError(`You provided ${null!==t&&"object"==typeof t?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const pB=function xQ(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function mB(t){return an(t?.[pB])}function fB(t){return function sB(t,i,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,n=e.apply(t,i||[]),r=[];return o=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),y("next"),y("throw"),y("return",function u(he){return function(Ce){return Promise.resolve(Ce).then(he,ee)}}),o[Symbol.asyncIterator]=function(){return this},o;function y(he,Ce){n[he]&&(o[he]=function(je){return new Promise(function(mt,Lt){r.push([he,je,mt,Lt])>1||I(he,je)})},Ce&&(o[he]=Ce(o[he])))}function I(he,Ce){try{!function V(he){he.value instanceof hb?Promise.resolve(he.value.v).then(q,ee):me(r[0][2],he)}(n[he](Ce))}catch(je){me(r[0][3],je)}}function q(he){I("next",he)}function ee(he){I("throw",he)}function me(he,Ce){he(Ce),r.shift(),r.length&&I(r[0][0],r[0][1])}}(this,arguments,function*(){const e=t.getReader();try{for(;;){const{value:n,done:o}=yield hb(e.read());if(o)return yield hb(void 0);yield yield hb(n)}}finally{e.releaseLock()}})}function _B(t){return an(t?.getReader)}function td(t){if(t instanceof se)return t;if(null!=t){if(dB(t))return function wQ(t){return new se(i=>{const e=t[Na]();if(an(e.subscribe))return e.subscribe(i);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(t);if(aO(t))return function CQ(t){return new se(i=>{for(let e=0;e{t.then(e=>{i.closed||(i.next(e),i.complete())},e=>i.error(e)).then(null,Bs)})}(t);if(uB(t))return gB(t);if(mB(t))return function TQ(t){return new se(i=>{for(const e of t)if(i.next(e),i.closed)return;i.complete()})}(t);if(_B(t))return function DQ(t){return gB(fB(t))}(t)}throw hB(t)}function gB(t){return new se(i=>{(function IQ(t,i){var e,n,o,r;return function rB(t,i,e,n){return new(e||(e=Promise))(function(r,u){function y(q){try{V(n.next(q))}catch(ee){u(ee)}}function I(q){try{V(n.throw(q))}catch(ee){u(ee)}}function V(q){q.done?r(q.value):function o(r){return r instanceof e?r:new e(function(u){u(r)})}(q.value).then(y,I)}V((n=n.apply(t,i||[])).next())})}(this,void 0,void 0,function*(){try{for(e=lB(t);!(n=yield e.next()).done;)if(i.next(n.value),i.closed)return}catch(u){o={error:u}}finally{try{n&&!n.done&&(r=e.return)&&(yield r.call(e))}finally{if(o)throw o.error}}i.complete()})})(t,i).catch(e=>i.error(e))})}function y_(t,i,e,n=0,o=!1){const r=i.schedule(function(){e(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(r),!o)return r}function dc(t,i,e=1/0){return an(i)?dc((n,o)=>kt((r,u)=>i(n,r,o,u))(td(t(n,o))),e):("number"==typeof i&&(e=i),ot((n,o)=>function EQ(t,i,e,n,o,r,u,y){const I=[];let V=0,q=0,ee=!1;const me=()=>{ee&&!I.length&&!V&&i.complete()},he=je=>V{r&&i.next(je),V++;let mt=!1;td(e(je,q++)).subscribe(St(i,Lt=>{o?.(Lt),r?he(Lt):i.next(Lt)},()=>{mt=!0},void 0,()=>{if(mt)try{for(V--;I.length&&VCe(Lt)):Ce(Lt)}me()}catch(Lt){i.error(Lt)}}))};return t.subscribe(St(i,he,()=>{ee=!0,me()})),()=>{y?.()}}(n,o,t,e)))}function _x(t,i){return an(i)?dc(t,i,1):dc(t,1)}function or(t,i){return ot((e,n)=>{let o=0;e.subscribe(St(n,r=>t.call(i,r,o++)&&n.next(r)))})}function $h(t){return ot((i,e)=>{try{i.subscribe(e)}finally{e.add(t)}})}function Xs(t,i){return ot((e,n)=>{let o=null,r=0,u=!1;const y=()=>u&&!o&&n.complete();e.subscribe(St(n,I=>{o?.unsubscribe();let V=0;const q=r++;td(t(I,q)).subscribe(o=St(n,ee=>n.next(i?i(I,ee,q,V++):ee),()=>{o=null,y()}))},()=>{u=!0,y()}))})}function bB(t){return t&&an(t.schedule)}function sO(t){return t[t.length-1]}function yB(t){return an(sO(t))?t.pop():void 0}function NS(t){return bB(sO(t))?t.pop():void 0}function vB(t,i=0){return ot((e,n)=>{e.subscribe(St(n,o=>y_(n,t,()=>n.next(o),i),()=>y_(n,t,()=>n.complete(),i),o=>y_(n,t,()=>n.error(o),i)))})}function xB(t,i=0){return ot((e,n)=>{n.add(t.schedule(()=>e.subscribe(n),i))})}function wB(t,i){if(!t)throw new Error("Iterable cannot be null");return new se(e=>{y_(e,i,()=>{const n=t[Symbol.asyncIterator]();y_(e,i,()=>{n.next().then(o=>{o.done?e.complete():e.next(o.value)})},0,!0)})})}function Ol(t,i){return i?function LQ(t,i){if(null!=t){if(dB(t))return function AQ(t,i){return td(t).pipe(xB(i),vB(i))}(t,i);if(aO(t))return function RQ(t,i){return new se(e=>{let n=0;return i.schedule(function(){n===t.length?e.complete():(e.next(t[n++]),e.closed||this.schedule())})})}(t,i);if(cB(t))return function kQ(t,i){return td(t).pipe(xB(i),vB(i))}(t,i);if(uB(t))return wB(t,i);if(mB(t))return function OQ(t,i){return new se(e=>{let n;return y_(e,i,()=>{n=t[pB](),y_(e,i,()=>{let o,r;try{({value:o,done:r}=n.next())}catch(u){return void e.error(u)}r?e.complete():e.next(o)},0,!0)}),()=>an(n?.return)&&n.return()})}(t,i);if(_B(t))return function PQ(t,i){return wB(fB(t),i)}(t,i)}throw hB(t)}(t,i):td(t)}function xi(...t){return Ol(t,NS(t))}class LI{}class FI{}class Wp{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(i){i?"string"==typeof i?this.lazyInit=()=>{this.headers=new Map,i.split("\n").forEach(e=>{const n=e.indexOf(":");if(n>0){const o=e.slice(0,n),r=e.slice(n+1).trim();this.addHeaderEntry(o,r)}})}:typeof Headers<"u"&&i instanceof Headers?(this.headers=new Map,i.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(i).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(i){return this.init(),this.headers.has(i.toLowerCase())}get(i){this.init();const e=this.headers.get(i.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(i){return this.init(),this.headers.get(i.toLowerCase())||null}append(i,e){return this.clone({name:i,value:e,op:"a"})}set(i,e){return this.clone({name:i,value:e,op:"s"})}delete(i,e){return this.clone({name:i,value:e,op:"d"})}maybeSetNormalizedName(i,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,i)}init(){this.lazyInit&&(this.lazyInit instanceof Wp?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(i=>this.applyUpdate(i)),this.lazyUpdate=null))}copyFrom(i){i.init(),Array.from(i.headers.keys()).forEach(e=>{this.headers.set(e,i.headers.get(e)),this.normalizedNames.set(e,i.normalizedNames.get(e))})}clone(i){const e=new Wp;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof Wp?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([i]),e}applyUpdate(i){const e=i.name.toLowerCase();switch(i.op){case"a":case"s":let n=i.value;if("string"==typeof n&&(n=[n]),0===n.length)return;this.maybeSetNormalizedName(i.name,e);const o=("a"===i.op?this.headers.get(e):void 0)||[];o.push(...n),this.headers.set(e,o);break;case"d":const r=i.value;if(r){let u=this.headers.get(e);if(!u)return;u=u.filter(y=>-1===r.indexOf(y)),0===u.length?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,u)}else this.headers.delete(e),this.normalizedNames.delete(e)}}addHeaderEntry(i,e){const n=i.toLowerCase();this.maybeSetNormalizedName(i,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(i,e){const n=(Array.isArray(e)?e:[e]).map(r=>r.toString()),o=i.toLowerCase();this.headers.set(o,n),this.maybeSetNormalizedName(i,o)}forEach(i){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>i(this.normalizedNames.get(e),this.headers.get(e)))}}class FQ{encodeKey(i){return CB(i)}encodeValue(i){return CB(i)}decodeKey(i){return decodeURIComponent(i)}decodeValue(i){return decodeURIComponent(i)}}const zQ=/%(\d[a-f0-9])/gi,BQ={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function CB(t){return encodeURIComponent(t).replace(zQ,(i,e)=>BQ[e]??i)}function NI(t){return`${t}`}class pb{map;encoder;updates=null;cloneFrom=null;constructor(i={}){if(this.encoder=i.encoder||new FQ,i.fromString){if(i.fromObject)throw new ct(2805,!1);this.map=function NQ(t,i){const e=new Map;return t.length>0&&t.replace(/^\?/,"").split("&").forEach(o=>{const r=o.indexOf("="),[u,y]=-1==r?[i.decodeKey(o),""]:[i.decodeKey(o.slice(0,r)),i.decodeValue(o.slice(r+1))],I=e.get(u)||[];I.push(y),e.set(u,I)}),e}(i.fromString,this.encoder)}else i.fromObject?(this.map=new Map,Object.keys(i.fromObject).forEach(e=>{const n=i.fromObject[e],o=Array.isArray(n)?n.map(NI):[NI(n)];this.map.set(e,o)})):this.map=null}has(i){return this.init(),this.map.has(i)}get(i){this.init();const e=this.map.get(i);return e?e[0]:null}getAll(i){return this.init(),this.map.get(i)||null}keys(){return this.init(),Array.from(this.map.keys())}append(i,e){return this.clone({param:i,value:e,op:"a"})}appendAll(i){const e=[];return Object.keys(i).forEach(n=>{const o=i[n];Array.isArray(o)?o.forEach(r=>{e.push({param:n,value:r,op:"a"})}):e.push({param:n,value:o,op:"a"})}),this.clone(e)}set(i,e){return this.clone({param:i,value:e,op:"s"})}delete(i,e){return this.clone({param:i,value:e,op:"d"})}toString(){return this.init(),this.keys().map(i=>{const e=this.encoder.encodeKey(i);return this.map.get(i).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(i=>""!==i).join("&")}clone(i){const e=new pb({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(i),e}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(i=>this.map.set(i,this.cloneFrom.map.get(i))),this.updates.forEach(i=>{switch(i.op){case"a":case"s":const e=("a"===i.op?this.map.get(i.param):void 0)||[];e.push(NI(i.value)),this.map.set(i.param,e);break;case"d":if(void 0===i.value){this.map.delete(i.param);break}{let n=this.map.get(i.param)||[];const o=n.indexOf(NI(i.value));-1!==o&&n.splice(o,1),n.length>0?this.map.set(i.param,n):this.map.delete(i.param)}}}),this.cloneFrom=this.updates=null)}}class VQ{map=new Map;set(i,e){return this.map.set(i,e),this}get(i){return this.map.has(i)||this.map.set(i,i.defaultValue()),this.map.get(i)}delete(i){return this.map.delete(i),this}has(i){return this.map.has(i)}keys(){return this.map.keys()}}function SB(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer}function TB(t){return typeof Blob<"u"&&t instanceof Blob}function DB(t){return typeof FormData<"u"&&t instanceof FormData}const zS="Content-Type",lO="X-Request-URL",IB="text/plain",EB="application/json",MB=`${EB}, ${IB}, */*`;class BS{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(i,e,n,o){let r;if(this.url=e,this.method=i.toUpperCase(),function UQ(t){switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||o?(this.body=void 0!==n?n:null,r=o):r=n,r&&(this.reportProgress=!!r.reportProgress,this.withCredentials=!!r.withCredentials,r.responseType&&(this.responseType=r.responseType),r.headers&&(this.headers=r.headers),r.context&&(this.context=r.context),r.params&&(this.params=r.params),this.transferCache=r.transferCache),this.headers??=new Wp,this.context??=new VQ,this.params){const u=this.params.toString();if(0===u.length)this.urlWithParams=e;else{const y=e.indexOf("?");this.urlWithParams=e+(-1===y?"?":yme.set(he,i.setHeaders[he]),V)),i.setParams&&(q=Object.keys(i.setParams).reduce((me,he)=>me.set(he,i.setParams[he]),q)),new BS(e,n,u,{params:q,headers:V,context:ee,reportProgress:I,responseType:o,withCredentials:y,transferCache:r})}}var mb=function(t){return t[t.Sent=0]="Sent",t[t.UploadProgress=1]="UploadProgress",t[t.ResponseHeader=2]="ResponseHeader",t[t.DownloadProgress=3]="DownloadProgress",t[t.Response=4]="Response",t[t.User=5]="User",t}(mb||{});class cO{headers;status;statusText;url;ok;type;constructor(i,e=200,n="OK"){this.headers=i.headers||new Wp,this.status=void 0!==i.status?i.status:e,this.statusText=i.statusText||n,this.url=i.url||null,this.ok=this.status>=200&&this.status<300}}class BI extends cO{constructor(i={}){super(i)}type=mb.ResponseHeader;clone(i={}){return new BI({headers:i.headers||this.headers,status:void 0!==i.status?i.status:this.status,statusText:i.statusText||this.statusText,url:i.url||this.url||void 0})}}class VS extends cO{body;constructor(i={}){super(i),this.body=void 0!==i.body?i.body:null}type=mb.Response;clone(i={}){return new VS({body:void 0!==i.body?i.body:this.body,headers:i.headers||this.headers,status:void 0!==i.status?i.status:this.status,statusText:i.statusText||this.statusText,url:i.url||this.url||void 0})}}class Av extends cO{name="HttpErrorResponse";message;error;ok=!1;constructor(i){super(i,0,"Unknown Error"),this.message=this.status>=200&&this.status<300?`Http failure during parsing for ${i.url||"(unknown url)"}`:`Http failure response for ${i.url||"(unknown url)"}: ${i.status} ${i.statusText}`,this.error=i.error||null}}function dO(t,i){return{body:i,headers:t.headers,context:t.context,observe:t.observe,params:t.params,reportProgress:t.reportProgress,responseType:t.responseType,withCredentials:t.withCredentials,transferCache:t.transferCache}}let Uo=(()=>{class t{handler;constructor(e){this.handler=e}request(e,n,o={}){let r;if(e instanceof BS)r=e;else{let I,V;I=o.headers instanceof Wp?o.headers:new Wp(o.headers),o.params&&(V=o.params instanceof pb?o.params:new pb({fromObject:o.params})),r=new BS(e,n,void 0!==o.body?o.body:null,{headers:I,context:o.context,params:V,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache})}const u=xi(r).pipe(_x(I=>this.handler.handle(I)));if(e instanceof BS||"events"===o.observe)return u;const y=u.pipe(or(I=>I instanceof VS));switch(o.observe||"body"){case"body":switch(r.responseType){case"arraybuffer":return y.pipe(kt(I=>{if(null!==I.body&&!(I.body instanceof ArrayBuffer))throw new ct(2806,!1);return I.body}));case"blob":return y.pipe(kt(I=>{if(null!==I.body&&!(I.body instanceof Blob))throw new ct(2807,!1);return I.body}));case"text":return y.pipe(kt(I=>{if(null!==I.body&&"string"!=typeof I.body)throw new ct(2808,!1);return I.body}));default:return y.pipe(kt(I=>I.body))}case"response":return y;default:throw new ct(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:(new pb).append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,o={}){return this.request("PATCH",e,dO(o,n))}post(e,n,o={}){return this.request("POST",e,dO(o,n))}put(e,n,o={}){return this.request("PUT",e,dO(o,n))}static \u0275fac=function(n){return new(n||t)(xn(LI))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const RB=new yt("");function OB(t,i){return i(t)}function ZQ(t,i){return(e,n)=>i.intercept(e,{handle:o=>t(o,n)})}const PB=new yt(""),US=new yt(""),XQ=new yt(""),LB=new yt("",{providedIn:"root",factory:()=>!0});function KQ(){let t=null;return(i,e)=>{null===t&&(t=(Y(PB,{optional:!0})??[]).reduceRight(ZQ,OB));const n=Y(en);if(Y(LB)){const r=n.add();return t(i,e).pipe($h(()=>n.remove(r)))}return t(i,e)}}let FB=(()=>{class t extends LI{backend;injector;chain=null;pendingTasks=Y(en);contributeToStability=Y(LB);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(null===this.chain){const n=Array.from(new Set([...this.injector.get(US),...this.injector.get(XQ,[])]));this.chain=n.reduceRight((o,r)=>function YQ(t,i,e){return(n,o)=>fc(e,()=>i(n,r=>t(r,o)))}(o,r,this.injector),OB)}if(this.contributeToStability){const n=this.pendingTasks.add();return this.chain(e,o=>this.backend.handle(o)).pipe($h(()=>this.pendingTasks.remove(n)))}return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||t)(xn(FI),xn(us))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const tJ=/^\)\]\}',?\n/,nJ=RegExp(`^${lO}:`,"m");let zB=(()=>{class t{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new ct(-2800,!1);const n=this.xhrFactory;return(n.\u0275loadImpl?Ol(n.\u0275loadImpl()):xi(null)).pipe(Xs(()=>new se(r=>{const u=n.build();if(u.open(e.method,e.urlWithParams),e.withCredentials&&(u.withCredentials=!0),e.headers.forEach((je,mt)=>u.setRequestHeader(je,mt.join(","))),e.headers.has("Accept")||u.setRequestHeader("Accept",MB),!e.headers.has(zS)){const je=e.detectContentTypeHeader();null!==je&&u.setRequestHeader(zS,je)}if(e.responseType){const je=e.responseType.toLowerCase();u.responseType="json"!==je?je:"text"}const y=e.serializeBody();let I=null;const V=()=>{if(null!==I)return I;const je=u.statusText||"OK",mt=new Wp(u.getAllResponseHeaders()),Lt=function iJ(t){return"responseURL"in t&&t.responseURL?t.responseURL:nJ.test(t.getAllResponseHeaders())?t.getResponseHeader(lO):null}(u)||e.url;return I=new BI({headers:mt,status:u.status,statusText:je,url:Lt}),I},q=()=>{let{headers:je,status:mt,statusText:Lt,url:At}=V(),Mn=null;204!==mt&&(Mn=typeof u.response>"u"?u.responseText:u.response),0===mt&&(mt=Mn?200:0);let di=mt>=200&&mt<300;if("json"===e.responseType&&"string"==typeof Mn){const Ei=Mn;Mn=Mn.replace(tJ,"");try{Mn=""!==Mn?JSON.parse(Mn):null}catch(ma){Mn=Ei,di&&(di=!1,Mn={error:ma,text:Mn})}}di?(r.next(new VS({body:Mn,headers:je,status:mt,statusText:Lt,url:At||void 0})),r.complete()):r.error(new Av({error:Mn,headers:je,status:mt,statusText:Lt,url:At||void 0}))},ee=je=>{const{url:mt}=V(),Lt=new Av({error:je,status:u.status||0,statusText:u.statusText||"Unknown Error",url:mt||void 0});r.error(Lt)};let me=!1;const he=je=>{me||(r.next(V()),me=!0);let mt={type:mb.DownloadProgress,loaded:je.loaded};je.lengthComputable&&(mt.total=je.total),"text"===e.responseType&&u.responseText&&(mt.partialText=u.responseText),r.next(mt)},Ce=je=>{let mt={type:mb.UploadProgress,loaded:je.loaded};je.lengthComputable&&(mt.total=je.total),r.next(mt)};return u.addEventListener("load",q),u.addEventListener("error",ee),u.addEventListener("timeout",ee),u.addEventListener("abort",ee),e.reportProgress&&(u.addEventListener("progress",he),null!==y&&u.upload&&u.upload.addEventListener("progress",Ce)),u.send(y),r.next({type:mb.Sent}),()=>{u.removeEventListener("error",ee),u.removeEventListener("abort",ee),u.removeEventListener("load",q),u.removeEventListener("timeout",ee),e.reportProgress&&(u.removeEventListener("progress",he),null!==y&&u.upload&&u.upload.removeEventListener("progress",Ce)),u.readyState!==u.DONE&&u.abort()}})))}static \u0275fac=function(n){return new(n||t)(xn(T5))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const pO=new yt(""),BB=new yt("",{providedIn:"root",factory:()=>"XSRF-TOKEN"}),VB=new yt("",{providedIn:"root",factory:()=>"X-XSRF-TOKEN"});class UB{}let aJ=(()=>{class t{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n){this.doc=e,this.cookieName=n}getToken(){const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=x5(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||t)(xn(Oo),xn(BB))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();function sJ(t,i){const e=t.url.toLowerCase();if(!Y(pO)||"GET"===t.method||"HEAD"===t.method||e.startsWith("http://")||e.startsWith("https://"))return i(t);const n=Y(UB).getToken(),o=Y(VB);return null!=n&&!t.headers.has(o)&&(t=t.clone({headers:t.headers.set(o,n)})),i(t)}var fb=function(t){return t[t.Interceptors=0]="Interceptors",t[t.LegacyInterceptors=1]="LegacyInterceptors",t[t.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",t[t.NoXsrfProtection=3]="NoXsrfProtection",t[t.JsonpSupport=4]="JsonpSupport",t[t.RequestsMadeViaParent=5]="RequestsMadeViaParent",t[t.Fetch=6]="Fetch",t}(fb||{});function lJ(...t){const i=[Uo,zB,FB,{provide:LI,useExisting:FB},{provide:FI,useFactory:()=>Y(RB,{optional:!0})??Y(zB)},{provide:US,useValue:sJ,multi:!0},{provide:pO,useValue:!0},{provide:UB,useClass:aJ}];for(const e of t)i.push(...e.\u0275providers);return Wl(i)}const HB=new yt("");function cJ(){return function kv(t,i){return{\u0275kind:t,\u0275providers:i}}(fb.LegacyInterceptors,[{provide:HB,useFactory:KQ},{provide:US,useExisting:HB,multi:!0}])}let dJ=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[lJ(cJ())]})}return t})();const{isArray:uJ}=Array,{getPrototypeOf:hJ,prototype:pJ,keys:mJ}=Object;function jB(t){if(1===t.length){const i=t[0];if(uJ(i))return{args:i,keys:null};if(function fJ(t){return t&&"object"==typeof t&&hJ(t)===pJ}(i)){const e=mJ(i);return{args:e.map(n=>i[n]),keys:e}}}return{args:t,keys:null}}const{isArray:_J}=Array;function mO(t){return kt(i=>function gJ(t,i){return _J(i)?t(...i):t(i)}(t,i))}function $B(t,i){return t.reduce((e,n,o)=>(e[n]=i[o],e),{})}function fO(...t){const i=yB(t),{args:e,keys:n}=jB(t),o=new se(r=>{const{length:u}=e;if(!u)return void r.complete();const y=new Array(u);let I=u,V=u;for(let q=0;q{ee||(ee=!0,V--),y[q]=me},()=>I--,void 0,()=>{(!I||!ee)&&(V||r.next(n?$B(n,y):y),r.complete())}))}});return i?o.pipe(mO(i)):o}let GB=(()=>{class t{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,n){this._renderer=e,this._elementRef=n}setProperty(e,n){this._renderer.setProperty(this._elementRef.nativeElement,e,n)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(n){return new(n||t)($e(Hr),$e(Pn))};static \u0275dir=Gt({type:t})}return t})(),Rv=(()=>{class t extends GB{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,features:[qn]})}return t})();const Pl=new yt(""),yJ={provide:Pl,useExisting:lo(()=>jr),multi:!0},xJ=new yt("");let jr=(()=>{class t extends GB{_compositionMode;_composing=!1;constructor(e,n,o){super(e,n),this._compositionMode=o,null==this._compositionMode&&(this._compositionMode=!function vJ(){const t=ub()?ub().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(e){this.setProperty("value",e??"")}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(n){return new(n||t)($e(Hr),$e(Pn),$e(xJ,8))};static \u0275dir=Gt({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(n,o){1&n&&we("input",function(u){return o._handleInput(u.target.value)})("blur",function(){return o.onTouched()})("compositionstart",function(){return o._compositionStart()})("compositionend",function(u){return o._compositionEnd(u.target.value)})},standalone:!1,features:[Bn([yJ]),qn]})}return t})();function _O(t){return null==t||0===gO(t)}function gO(t){return null==t?null:Array.isArray(t)||"string"==typeof t?t.length:t instanceof Set?t.size:null}const ba=new yt(""),_b=new yt(""),wJ=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class Ov{static min(i){return WB(i)}static max(i){return ZB(i)}static required(i){return YB(i)}static requiredTrue(i){return function XB(t){return!0===t.value?null:{required:!0}}(i)}static email(i){return KB(i)}static minLength(i){return function QB(t){return i=>{const e=i.value?.length??gO(i.value);return null===e||0===e?null:e{if(null==i.value||null==t)return null;const e=parseFloat(i.value);return!isNaN(e)&&e{if(null==i.value||null==t)return null;const e=parseFloat(i.value);return!isNaN(e)&&e>t?{max:{max:t,actual:i.value}}:null}}function YB(t){return _O(t.value)?{required:!0}:null}function KB(t){return _O(t.value)||wJ.test(t.value)?null:{email:!0}}function JB(t){return i=>{const e=i.value?.length??gO(i.value);return null!==e&&e>t?{maxlength:{requiredLength:t,actualLength:e}}:null}}function eV(t){if(!t)return VI;let i,e;return"string"==typeof t?(e="","^"!==t.charAt(0)&&(e+="^"),e+=t,"$"!==t.charAt(t.length-1)&&(e+="$"),i=new RegExp(e)):(e=t.toString(),i=t),n=>{if(_O(n.value))return null;const o=n.value;return i.test(o)?null:{pattern:{requiredPattern:e,actualValue:o}}}}function VI(t){return null}function tV(t){return null!=t}function nV(t){return gS(t)?Ol(t):t}function iV(t){let i={};return t.forEach(e=>{i=null!=e?{...i,...e}:i}),0===Object.keys(i).length?null:i}function oV(t,i){return i.map(e=>e(t))}function rV(t){return t.map(i=>function CJ(t){return!t.validate}(i)?i:e=>i.validate(e))}function aV(t){if(!t)return null;const i=t.filter(tV);return 0==i.length?null:function(e){return iV(oV(e,i))}}function bO(t){return null!=t?aV(rV(t)):null}function sV(t){if(!t)return null;const i=t.filter(tV);return 0==i.length?null:function(e){return fO(oV(e,i).map(nV)).pipe(kt(iV))}}function yO(t){return null!=t?sV(rV(t)):null}function lV(t,i){return null===t?[i]:Array.isArray(t)?[...t,i]:[t,i]}function cV(t){return t._rawValidators}function dV(t){return t._rawAsyncValidators}function vO(t){return t?Array.isArray(t)?t:[t]:[]}function UI(t,i){return Array.isArray(t)?t.includes(i):t===i}function uV(t,i){const e=vO(i);return vO(t).forEach(o=>{UI(e,o)||e.push(o)}),e}function hV(t,i){return vO(i).filter(e=>!UI(t,e))}class pV{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(i){this._rawValidators=i||[],this._composedValidatorFn=bO(this._rawValidators)}_setAsyncValidators(i){this._rawAsyncValidators=i||[],this._composedAsyncValidatorFn=yO(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(i){this._onDestroyCallbacks.push(i)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(i=>i()),this._onDestroyCallbacks=[]}reset(i=void 0){this.control&&this.control.reset(i)}hasError(i,e){return!!this.control&&this.control.hasError(i,e)}getError(i,e){return this.control?this.control.getError(i,e):null}}class nd extends pV{name;get formDirective(){return null}get path(){return null}}class Gh extends pV{_parent=null;name=null;valueAccessor=null}class mV{_cd;constructor(i){this._cd=i}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}}let wr=(()=>{class t extends mV{constructor(e){super(e)}static \u0275fac=function(n){return new(n||t)($e(Gh,2))};static \u0275dir=Gt({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(n,o){2&n&&Hn("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)},standalone:!1,features:[qn]})}return t})(),Aa=(()=>{class t extends mV{constructor(e){super(e)}static \u0275fac=function(n){return new(n||t)($e(nd,10))};static \u0275dir=Gt({type:t,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(n,o){2&n&&Hn("ng-untouched",o.isUntouched)("ng-touched",o.isTouched)("ng-pristine",o.isPristine)("ng-dirty",o.isDirty)("ng-valid",o.isValid)("ng-invalid",o.isInvalid)("ng-pending",o.isPending)("ng-submitted",o.isSubmitted)},standalone:!1,features:[qn]})}return t})();const HS="VALID",jI="INVALID",gx="PENDING",jS="DISABLED";class bx{}class _V extends bx{value;source;constructor(i,e){super(),this.value=i,this.source=e}}class CO extends bx{pristine;source;constructor(i,e){super(),this.pristine=i,this.source=e}}class SO extends bx{touched;source;constructor(i,e){super(),this.touched=i,this.source=e}}class $I extends bx{status;source;constructor(i,e){super(),this.status=i,this.source=e}}class gV extends bx{source;constructor(i){super(),this.source=i}}class bV extends bx{source;constructor(i){super(),this.source=i}}function TO(t){return(GI(t)?t.validators:t)||null}function DO(t,i){return(GI(i)?i.asyncValidators:t)||null}function GI(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class IO{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(i,e){this._assignValidators(i),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(i){this._rawValidators=this._composedValidatorFn=i}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(i){this._rawAsyncValidators=this._composedAsyncValidatorFn=i}get parent(){return this._parent}get status(){return dl(this.statusReactive)}set status(i){dl(()=>this.statusReactive.set(i))}_status=$p(()=>this.statusReactive());statusReactive=Da(void 0);get valid(){return this.status===HS}get invalid(){return this.status===jI}get pending(){return this.status==gx}get disabled(){return this.status===jS}get enabled(){return this.status!==jS}errors;get pristine(){return dl(this.pristineReactive)}set pristine(i){dl(()=>this.pristineReactive.set(i))}_pristine=$p(()=>this.pristineReactive());pristineReactive=Da(!0);get dirty(){return!this.pristine}get touched(){return dl(this.touchedReactive)}set touched(i){dl(()=>this.touchedReactive.set(i))}_touched=$p(()=>this.touchedReactive());touchedReactive=Da(!1);get untouched(){return!this.touched}_events=new Ee;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(i){this._assignValidators(i)}setAsyncValidators(i){this._assignAsyncValidators(i)}addValidators(i){this.setValidators(uV(i,this._rawValidators))}addAsyncValidators(i){this.setAsyncValidators(uV(i,this._rawAsyncValidators))}removeValidators(i){this.setValidators(hV(i,this._rawValidators))}removeAsyncValidators(i){this.setAsyncValidators(hV(i,this._rawAsyncValidators))}hasValidator(i){return UI(this._rawValidators,i)}hasAsyncValidator(i){return UI(this._rawAsyncValidators,i)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(i={}){const e=!1===this.touched;this.touched=!0;const n=i.sourceControl??this;this._parent&&!i.onlySelf&&this._parent.markAsTouched({...i,sourceControl:n}),e&&!1!==i.emitEvent&&this._events.next(new SO(!0,n))}markAllAsTouched(i={}){this.markAsTouched({onlySelf:!0,emitEvent:i.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(i))}markAsUntouched(i={}){const e=!0===this.touched;this.touched=!1,this._pendingTouched=!1;const n=i.sourceControl??this;this._forEachChild(o=>{o.markAsUntouched({onlySelf:!0,emitEvent:i.emitEvent,sourceControl:n})}),this._parent&&!i.onlySelf&&this._parent._updateTouched(i,n),e&&!1!==i.emitEvent&&this._events.next(new SO(!1,n))}markAsDirty(i={}){const e=!0===this.pristine;this.pristine=!1;const n=i.sourceControl??this;this._parent&&!i.onlySelf&&this._parent.markAsDirty({...i,sourceControl:n}),e&&!1!==i.emitEvent&&this._events.next(new CO(!1,n))}markAsPristine(i={}){const e=!1===this.pristine;this.pristine=!0,this._pendingDirty=!1;const n=i.sourceControl??this;this._forEachChild(o=>{o.markAsPristine({onlySelf:!0,emitEvent:i.emitEvent})}),this._parent&&!i.onlySelf&&this._parent._updatePristine(i,n),e&&!1!==i.emitEvent&&this._events.next(new CO(!0,n))}markAsPending(i={}){this.status=gx;const e=i.sourceControl??this;!1!==i.emitEvent&&(this._events.next(new $I(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!i.onlySelf&&this._parent.markAsPending({...i,sourceControl:e})}disable(i={}){const e=this._parentMarkedDirty(i.onlySelf);this.status=jS,this.errors=null,this._forEachChild(o=>{o.disable({...i,onlySelf:!0})}),this._updateValue();const n=i.sourceControl??this;!1!==i.emitEvent&&(this._events.next(new _V(this.value,n)),this._events.next(new $I(this.status,n)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors({...i,skipPristineCheck:e},this),this._onDisabledChange.forEach(o=>o(!0))}enable(i={}){const e=this._parentMarkedDirty(i.onlySelf);this.status=HS,this._forEachChild(n=>{n.enable({...i,onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:i.emitEvent}),this._updateAncestors({...i,skipPristineCheck:e},this),this._onDisabledChange.forEach(n=>n(!1))}_updateAncestors(i,e){this._parent&&!i.onlySelf&&(this._parent.updateValueAndValidity(i),i.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(i){this._parent=i}getRawValue(){return this.value}updateValueAndValidity(i={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){const n=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===HS||this.status===gx)&&this._runAsyncValidator(n,i.emitEvent)}const e=i.sourceControl??this;!1!==i.emitEvent&&(this._events.next(new _V(this.value,e)),this._events.next(new $I(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!i.onlySelf&&this._parent.updateValueAndValidity({...i,sourceControl:e})}_updateTreeValidity(i={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(i)),this.updateValueAndValidity({onlySelf:!0,emitEvent:i.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?jS:HS}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(i,e){if(this.asyncValidator){this.status=gx,this._hasOwnPendingAsyncValidator={emitEvent:!1!==e};const n=nV(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(o=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(o,{emitEvent:e,shouldHaveEmitted:i})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();const i=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,i}return!1}setErrors(i,e={}){this.errors=i,this._updateControlsErrors(!1!==e.emitEvent,this,e.shouldHaveEmitted)}get(i){let e=i;return null==e||(Array.isArray(e)||(e=e.split(".")),0===e.length)?null:e.reduce((n,o)=>n&&n._find(o),this)}getError(i,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[i]:null}hasError(i,e){return!!this.getError(i,e)}get root(){let i=this;for(;i._parent;)i=i._parent;return i}_updateControlsErrors(i,e,n){this.status=this._calculateStatus(),i&&this.statusChanges.emit(this.status),(i||n)&&this._events.next(new $I(this.status,e)),this._parent&&this._parent._updateControlsErrors(i,e,n)}_initObservables(){this.valueChanges=new Tt,this.statusChanges=new Tt}_calculateStatus(){return this._allControlsDisabled()?jS:this.errors?jI:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(gx)?gx:this._anyControlsHaveStatus(jI)?jI:HS}_anyControlsHaveStatus(i){return this._anyControls(e=>e.status===i)}_anyControlsDirty(){return this._anyControls(i=>i.dirty)}_anyControlsTouched(){return this._anyControls(i=>i.touched)}_updatePristine(i,e){const n=!this._anyControlsDirty(),o=this.pristine!==n;this.pristine=n,this._parent&&!i.onlySelf&&this._parent._updatePristine(i,e),o&&this._events.next(new CO(this.pristine,e))}_updateTouched(i={},e){this.touched=this._anyControlsTouched(),this._events.next(new SO(this.touched,e)),this._parent&&!i.onlySelf&&this._parent._updateTouched(i,e)}_onDisabledChange=[];_registerOnCollectionChange(i){this._onCollectionChange=i}_setUpdateStrategy(i){GI(i)&&null!=i.updateOn&&(this._updateOn=i.updateOn)}_parentMarkedDirty(i){return!i&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}_find(i){return null}_assignValidators(i){this._rawValidators=Array.isArray(i)?i.slice():i,this._composedValidatorFn=function AJ(t){return Array.isArray(t)?bO(t):t||null}(this._rawValidators)}_assignAsyncValidators(i){this._rawAsyncValidators=Array.isArray(i)?i.slice():i,this._composedAsyncValidatorFn=function kJ(t){return Array.isArray(t)?yO(t):t||null}(this._rawAsyncValidators)}}class EO extends IO{constructor(i,e,n){super(TO(e),DO(n,e)),this.controls=i,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(i,e){return this.controls[i]?this.controls[i]:(this.controls[i]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(i,e,n={}){this.registerControl(i,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(i,e={}){this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),delete this.controls[i],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(i,e,n={}){this.controls[i]&&this.controls[i]._registerOnCollectionChange(()=>{}),delete this.controls[i],e&&this.registerControl(i,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(i){return this.controls.hasOwnProperty(i)&&this.controls[i].enabled}setValue(i,e={}){(function vV(t,i,e){t._forEachChild((n,o)=>{if(void 0===e[o])throw new ct(1002,"")})})(this,0,i),Object.keys(i).forEach(n=>{(function yV(t,i,e){const n=t.controls;if(!(i?Object.keys(n):n).length)throw new ct(1e3,"");if(!n[e])throw new ct(1001,"")})(this,!0,n),this.controls[n].setValue(i[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(i,e={}){null!=i&&(Object.keys(i).forEach(n=>{const o=this.controls[n];o&&o.patchValue(i[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(i={},e={}){this._forEachChild((n,o)=>{n.reset(i?i[o]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(i,e,n)=>(i[n]=e.getRawValue(),i))}_syncPendingControls(){let i=this._reduceChildren(!1,(e,n)=>!!n._syncPendingControls()||e);return i&&this.updateValueAndValidity({onlySelf:!0}),i}_forEachChild(i){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&i(n,e)})}_setUpControls(){this._forEachChild(i=>{i.setParent(this),i._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(i){for(const[e,n]of Object.entries(this.controls))if(this.contains(e)&&i(n))return!0;return!1}_reduceValue(){return this._reduceChildren({},(e,n,o)=>((n.enabled||this.disabled)&&(e[o]=n.value),e))}_reduceChildren(i,e){let n=i;return this._forEachChild((o,r)=>{n=e(n,o,r)}),n}_allControlsDisabled(){for(const i of Object.keys(this.controls))if(this.controls[i].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(i){return this.controls.hasOwnProperty(i)?this.controls[i]:null}}const Pv=new yt("",{providedIn:"root",factory:()=>$S}),$S="always";function GS(t,i,e=$S){MO(t,i),i.valueAccessor.writeValue(t.value),(t.disabled||"always"===e)&&i.valueAccessor.setDisabledState?.(t.disabled),function PJ(t,i){i.valueAccessor.registerOnChange(e=>{t._pendingValue=e,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&xV(t,i)})}(t,i),function FJ(t,i){const e=(n,o)=>{i.valueAccessor.writeValue(n),o&&i.viewToModelUpdate(n)};t.registerOnChange(e),i._registerOnDestroy(()=>{t._unregisterOnChange(e)})}(t,i),function LJ(t,i){i.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&xV(t,i),"submit"!==t.updateOn&&t.markAsTouched()})}(t,i),function OJ(t,i){if(i.valueAccessor.setDisabledState){const e=n=>{i.valueAccessor.setDisabledState(n)};t.registerOnDisabledChange(e),i._registerOnDestroy(()=>{t._unregisterOnDisabledChange(e)})}}(t,i)}function WI(t,i,e=!0){const n=()=>{};i.valueAccessor&&(i.valueAccessor.registerOnChange(n),i.valueAccessor.registerOnTouched(n)),YI(t,i),t&&(i._invokeOnDestroyCallbacks(),t._registerOnCollectionChange(()=>{}))}function ZI(t,i){t.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(i)})}function MO(t,i){const e=cV(t);null!==i.validator?t.setValidators(lV(e,i.validator)):"function"==typeof e&&t.setValidators([e]);const n=dV(t);null!==i.asyncValidator?t.setAsyncValidators(lV(n,i.asyncValidator)):"function"==typeof n&&t.setAsyncValidators([n]);const o=()=>t.updateValueAndValidity();ZI(i._rawValidators,o),ZI(i._rawAsyncValidators,o)}function YI(t,i){let e=!1;if(null!==t){if(null!==i.validator){const o=cV(t);if(Array.isArray(o)&&o.length>0){const r=o.filter(u=>u!==i.validator);r.length!==o.length&&(e=!0,t.setValidators(r))}}if(null!==i.asyncValidator){const o=dV(t);if(Array.isArray(o)&&o.length>0){const r=o.filter(u=>u!==i.asyncValidator);r.length!==o.length&&(e=!0,t.setAsyncValidators(r))}}}const n=()=>{};return ZI(i._rawValidators,n),ZI(i._rawAsyncValidators,n),e}function xV(t,i){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),i.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function wV(t,i){MO(t,i)}function kO(t,i){if(!t.hasOwnProperty("model"))return!1;const e=t.model;return!!e.isFirstChange()||!Object.is(i,e.currentValue)}function CV(t,i){t._syncPendingControls(),i.forEach(e=>{const n=e.control;"submit"===n.updateOn&&n._pendingChange&&(e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1)})}function RO(t,i){if(!i)return null;let e,n,o;return Array.isArray(i),i.forEach(r=>{r.constructor===jr?e=r:function BJ(t){return Object.getPrototypeOf(t.constructor)===Rv}(r)?n=r:o=r}),o||n||e||null}const UJ={provide:nd,useExisting:lo(()=>Cr)},qS=Promise.resolve();let Cr=(()=>{class t extends nd{callSetDisabledState;get submitted(){return dl(this.submittedReactive)}_submitted=$p(()=>this.submittedReactive());submittedReactive=Da(!1);_directives=new Set;form;ngSubmit=new Tt;options;constructor(e,n,o){super(),this.callSetDisabledState=o,this.form=new EO({},bO(e),yO(n))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){qS.then(()=>{const n=this._findContainer(e.path);e.control=n.registerControl(e.name,e.control),GS(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){qS.then(()=>{const n=this._findContainer(e.path);n&&n.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){qS.then(()=>{const n=this._findContainer(e.path),o=new EO({});wV(o,e),n.registerControl(e.name,o),o.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){qS.then(()=>{const n=this._findContainer(e.path);n&&n.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,n){qS.then(()=>{this.form.get(e.path).setValue(n)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),CV(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new gV(this.control)),"dialog"===e?.target?.method}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1),this.form._events.next(new bV(this.form))}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(n){return new(n||t)($e(ba,10),$e(_b,10),$e(Pv,8))};static \u0275dir=Gt({type:t,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(n,o){1&n&&we("submit",function(u){return o.onSubmit(u)})("reset",function(){return o.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Bn([UJ]),qn]})}return t})();function SV(t,i){const e=t.indexOf(i);e>-1&&t.splice(e,1)}function TV(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}const po=class extends IO{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(i=null,e,n){super(TO(e),DO(n,e)),this._applyFormState(i),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),GI(e)&&(e.nonNullable||e.initialValueIsDefault)&&(this.defaultValue=TV(i)?i.value:i)}setValue(i,e={}){this.value=this._pendingValue=i,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(n=>n(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(i,e={}){this.setValue(i,e)}reset(i=this.defaultValue,e={}){this._applyFormState(i),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(i){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(i){this._onChange.push(i)}_unregisterOnChange(i){SV(this._onChange,i)}registerOnDisabledChange(i){this._onDisabledChange.push(i)}_unregisterOnDisabledChange(i){SV(this._onDisabledChange,i)}_forEachChild(i){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(i){TV(i)?(this.value=this._pendingValue=i.value,i.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=i}},qJ={provide:Gh,useExisting:lo(()=>ts)},DV=Promise.resolve();let ts=(()=>{class t extends Gh{_changeDetectorRef;callSetDisabledState;control=new po;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new Tt;constructor(e,n,o,r,u,y){super(),this._changeDetectorRef=u,this.callSetDisabledState=y,this._parent=e,this._setValidators(n),this._setAsyncValidators(o),this.valueAccessor=RO(0,r)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){const n=e.name.previousValue;this.formDirective.removeControl({name:n,path:this._getPath(n)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),kO(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){GS(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(e){DV.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){const n=e.isDisabled.currentValue,o=0!==n&&fn(n);DV.then(()=>{o&&!this.control.disabled?this.control.disable():!o&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?function qI(t,i){return[...i.path,t]}(e,this._parent):[e]}static \u0275fac=function(n){return new(n||t)($e(nd,9),$e(ba,10),$e(_b,10),$e(Pl,10),$e(So,8),$e(Pv,8))};static \u0275dir=Gt({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[Bn([qJ]),qn,go]})}return t})(),ka=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return t})();const WJ={provide:Pl,useExisting:lo(()=>yx),multi:!0};let yx=(()=>{class t extends Rv{writeValue(e){this.setProperty("value",e??"")}registerOnChange(e){this.onChange=n=>{e(""==n?null:parseFloat(n))}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(n,o){1&n&&we("input",function(u){return o.onChange(u.target.value)})("blur",function(){return o.onTouched()})},standalone:!1,features:[Bn([WJ]),qn]})}return t})();const OO=new yt(""),KJ={provide:Gh,useExisting:lo(()=>Xu)};let Xu=(()=>{class t extends Gh{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(e){}model;update=new Tt;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(e,n,o,r,u){super(),this._ngModelWarningConfig=r,this.callSetDisabledState=u,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=RO(0,o)}ngOnChanges(e){if(this._isControlChanged(e)){const n=e.form.previousValue;n&&WI(n,this,!1),GS(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}kO(e,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&WI(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_isControlChanged(e){return e.hasOwnProperty("form")}static \u0275fac=function(n){return new(n||t)($e(ba,10),$e(_b,10),$e(Pl,10),$e(OO,8),$e(Pv,8))};static \u0275dir=Gt({type:t,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[Bn([KJ]),qn,go]})}return t})();const QJ={provide:nd,useExisting:lo(()=>gb)};let gb=(()=>{class t extends nd{callSetDisabledState;get submitted(){return dl(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=$p(()=>this._submittedReactive());_submittedReactive=Da(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new Tt;constructor(e,n,o){super(),this.callSetDisabledState=o,this._setValidators(e),this._setAsyncValidators(n)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(YI(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const n=this.form.get(e.path);return GS(n,e,this.callSetDisabledState),n.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),n}getControl(e){return this.form.get(e.path)}removeControl(e){WI(e.control||null,e,!1),function VJ(t,i){const e=t.indexOf(i);e>-1&&t.splice(e,1)}(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,n){this.form.get(e.path).setValue(n)}onSubmit(e){return this._submittedReactive.set(!0),CV(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new gV(this.control)),"dialog"===e?.target?.method}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this._submittedReactive.set(!1),this.form._events.next(new bV(this.form))}_updateDomValue(){this.directives.forEach(e=>{const n=e.control,o=this.form.get(e.path);n!==o&&(WI(n||null,e),(t=>t instanceof po)(o)&&(GS(o,e,this.callSetDisabledState),e.control=o))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){const n=this.form.get(e.path);wV(n,e),n.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){const n=this.form.get(e.path);n&&function NJ(t,i){return YI(t,i)}(n,e)&&n.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){MO(this.form,this),this._oldForm&&YI(this._oldForm,this)}static \u0275fac=function(n){return new(n||t)($e(ba,10),$e(_b,10),$e(Pv,8))};static \u0275dir=Gt({type:t,selectors:[["","formGroup",""]],hostBindings:function(n,o){1&n&&we("submit",function(u){return o.onSubmit(u)})("reset",function(){return o.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[Bn([QJ]),qn,go]})}return t})();function PV(t){return"number"==typeof t?t:parseFloat(t)}let Lv=(()=>{class t{_validator=VI;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){const n=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(n),this._validator=this._enabled?this.createValidator(n):VI,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return null!=e}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,features:[go]})}return t})();const lee={provide:ba,useExisting:lo(()=>FO),multi:!0};let FO=(()=>{class t extends Lv{max;inputName="max";normalizeInput=e=>PV(e);createValidator=e=>ZB(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(n,o){2&n&&zn("max",o._enabled?o.max:null)},inputs:{max:"max"},standalone:!1,features:[Bn([lee]),qn]})}return t})();const cee={provide:ba,useExisting:lo(()=>vx),multi:!0};let vx=(()=>{class t extends Lv{min;inputName="min";normalizeInput=e=>PV(e);createValidator=e=>WB(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(n,o){2&n&&zn("min",o._enabled?o.min:null)},inputs:{min:"min"},standalone:!1,features:[Bn([cee]),qn]})}return t})();const dee={provide:ba,useExisting:lo(()=>Jl),multi:!0};let Jl=(()=>{class t extends Lv{required;inputName="required";normalizeInput=fn;createValidator=e=>YB;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(n,o){2&n&&zn("required",o._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[Bn([dee]),qn]})}return t})();const hee={provide:ba,useExisting:lo(()=>NO),multi:!0};let NO=(()=>{class t extends Lv{email;inputName="email";normalizeInput=fn;createValidator=e=>KB;enabled(e){return e}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","email","","formControlName",""],["","email","","formControl",""],["","email","","ngModel",""]],inputs:{email:"email"},standalone:!1,features:[Bn([hee]),qn]})}return t})();const mee={provide:ba,useExisting:lo(()=>eE),multi:!0};let eE=(()=>{class t extends Lv{maxlength;inputName="maxlength";normalizeInput=e=>function OV(t){return"number"==typeof t?t:parseInt(t,10)}(e);createValidator=e=>JB(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(n,o){2&n&&zn("maxlength",o._enabled?o.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[Bn([mee]),qn]})}return t})();const fee={provide:ba,useExisting:lo(()=>zO),multi:!0};let zO=(()=>{class t extends Lv{pattern;inputName="pattern";normalizeInput=e=>e;createValidator=e=>eV(e);static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","pattern","","formControlName",""],["","pattern","","formControl",""],["","pattern","","ngModel",""]],hostVars:1,hostBindings:function(n,o){2&n&&zn("pattern",o._enabled?o.pattern:null)},inputs:{pattern:"pattern"},standalone:!1,features:[Bn([fee]),qn]})}return t})(),FV=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})(),gee=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:Pv,useValue:e.callSetDisabledState??$S}]}}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[FV]})}return t})(),bee=(()=>{class t{static withConfig(e){return{ngModule:t,providers:[{provide:OO,useValue:e.warnOnNgModelWithFormControl??"always"},{provide:Pv,useValue:e.callSetDisabledState??$S}]}}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[FV]})}return t})();var Ro=function(t){return t[t.State=0]="State",t[t.Transition=1]="Transition",t[t.Sequence=2]="Sequence",t[t.Group=3]="Group",t[t.Animate=4]="Animate",t[t.Keyframes=5]="Keyframes",t[t.Style=6]="Style",t[t.Trigger=7]="Trigger",t[t.Reference=8]="Reference",t[t.AnimateChild=9]="AnimateChild",t[t.AnimateRef=10]="AnimateRef",t[t.Query=11]="Query",t[t.Stagger=12]="Stagger",t}(Ro||{});const v_="*";function BO(t,i){return{type:Ro.Trigger,name:t,definitions:i,options:{}}}function xx(t,i=null){return{type:Ro.Animate,styles:i,timings:t}}function VO(t,i=null){return{type:Ro.Group,steps:t,options:i}}function Tc(t){return{type:Ro.Style,styles:t,offset:null}}function UO(t,i,e=null){return{type:Ro.Transition,expr:t,animation:i,options:e}}function NV(t=null){return{type:Ro.AnimateChild,options:t}}class ZS{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(i=0,e=0){this.totalTime=i+e}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}onStart(i){this._originalOnStartFns.push(i),this._onStartFns.push(i)}onDone(i){this._originalOnDoneFns.push(i),this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(i=>i()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(i){this._position=this.totalTime?i*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(i){const e="start"==i?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}}class zV{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(i){this.players=i;let e=0,n=0,o=0;const r=this.players.length;0==r?queueMicrotask(()=>this._onFinish()):this.players.forEach(u=>{u.onDone(()=>{++e==r&&this._onFinish()}),u.onDestroy(()=>{++n==r&&this._onDestroy()}),u.onStart(()=>{++o==r&&this._onStart()})}),this.totalTime=this.players.reduce((u,y)=>Math.max(u,y.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}init(){this.players.forEach(i=>i.init())}onStart(i){this._onStartFns.push(i)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(i=>i()),this._onStartFns=[])}onDone(i){this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(i=>i.play())}pause(){this.players.forEach(i=>i.pause())}restart(){this.players.forEach(i=>i.restart())}finish(){this._onFinish(),this.players.forEach(i=>i.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(i=>i.destroy()),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}reset(){this.players.forEach(i=>i.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(i){const e=i*this.totalTime;this.players.forEach(n=>{const o=n.totalTime?Math.min(1,e/n.totalTime):1;n.setPosition(o)})}getPosition(){const i=this.players.reduce((e,n)=>null===e||n.totalTime>e.totalTime?n:e,null);return null!=i?i.getPosition():0}beforeDestroy(){this.players.forEach(i=>{i.beforeDestroy&&i.beforeDestroy()})}triggerCallback(i){const e="start"==i?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}}function BV(t){return new ct(3e3,!1)}function bb(t){switch(t.length){case 0:return new ZS;case 1:return t[0];default:return new zV(t)}}function VV(t,i,e=new Map,n=new Map){const o=[],r=[];let u=-1,y=null;if(i.forEach(I=>{const V=I.get("offset"),q=V==u,ee=q&&y||new Map;I.forEach((me,he)=>{let Ce=he,je=me;if("offset"!==he)switch(Ce=t.normalizePropertyName(Ce,o),je){case"!":je=e.get(he);break;case v_:je=n.get(he);break;default:je=t.normalizeStyleValue(he,Ce,je,o)}ee.set(Ce,je)}),q||r.push(ee),y=ee,u=V}),o.length)throw function Uee(){return new ct(3502,!1)}();return r}function jO(t,i,e,n){switch(i){case"start":t.onStart(()=>n(e&&$O(e,"start",t)));break;case"done":t.onDone(()=>n(e&&$O(e,"done",t)));break;case"destroy":t.onDestroy(()=>n(e&&$O(e,"destroy",t)))}}function $O(t,i,e){const r=GO(t.element,t.triggerName,t.fromState,t.toState,i||t.phaseName,e.totalTime??t.totalTime,!!e.disabled),u=t._data;return null!=u&&(r._data=u),r}function GO(t,i,e,n,o="",r=0,u){return{element:t,triggerName:i,fromState:e,toState:n,phaseName:o,totalTime:r,disabled:!!u}}function Ku(t,i,e){let n=t.get(i);return n||t.set(i,n=e),n}function UV(t){const i=t.indexOf(":");return[t.substring(1,i),t.slice(i+1)]}const Jee=typeof document>"u"?null:document.documentElement;function qO(t){const i=t.parentNode||t.host||null;return i===Jee?null:i}let Fv=null,HV=!1;function jV(t,i){for(;i;){if(i===t)return!0;i=qO(i)}return!1}function $V(t,i,e){if(e)return Array.from(t.querySelectorAll(i));const n=t.querySelector(i);return n?[n]:[]}const qV="ng-enter",WO="ng-leave",tE="ng-trigger",nE=".ng-trigger",WV="ng-animating",ZO=".ng-animating";function x_(t){if("number"==typeof t)return t;const i=t.match(/^(-?[\.\d]+)(m?s)/);return!i||i.length<2?0:YO(parseFloat(i[1]),i[2])}function YO(t,i){return"s"===i?1e3*t:t}function iE(t,i,e){return t.hasOwnProperty("duration")?t:function rte(t,i,e){let o,r=0,u="";if("string"==typeof t){const y=t.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===y)return i.push(BV()),{duration:0,delay:0,easing:""};o=YO(parseFloat(y[1]),y[2]);const I=y[3];null!=I&&(r=YO(parseFloat(I),y[4]));const V=y[5];V&&(u=V)}else o=t;if(!e){let y=!1,I=i.length;o<0&&(i.push(function xee(){return new ct(3100,!1)}()),y=!0),r<0&&(i.push(function wee(){return new ct(3101,!1)}()),y=!0),y&&i.splice(I,0,BV())}return{duration:o,delay:r,easing:u}}(t,i,e)}function Xm(t,i,e){i.forEach((n,o)=>{const r=KO(o);e&&!e.has(o)&&e.set(o,t.style[r]),t.style[r]=n})}function Nv(t,i){i.forEach((e,n)=>{const o=KO(n);t.style[o]=""})}function YS(t){return Array.isArray(t)?1==t.length?t[0]:function yee(t,i=null){return{type:Ro.Sequence,steps:t,options:i}}(t):t}const XO=new RegExp("{{\\s*(.+?)\\s*}}","g");function ZV(t){let i=[];if("string"==typeof t){let e;for(;e=XO.exec(t);)i.push(e[1]);XO.lastIndex=0}return i}function XS(t,i,e){const n=`${t}`,o=n.replace(XO,(r,u)=>{let y=i[u];return null==y&&(e.push(function See(){return new ct(3003,!1)}()),y=""),y.toString()});return o==n?t:o}const lte=/-+([a-z0-9])/g;function KO(t){return t.replace(lte,(...i)=>i[1].toUpperCase())}function Qu(t,i,e){switch(i.type){case Ro.Trigger:return t.visitTrigger(i,e);case Ro.State:return t.visitState(i,e);case Ro.Transition:return t.visitTransition(i,e);case Ro.Sequence:return t.visitSequence(i,e);case Ro.Group:return t.visitGroup(i,e);case Ro.Animate:return t.visitAnimate(i,e);case Ro.Keyframes:return t.visitKeyframes(i,e);case Ro.Style:return t.visitStyle(i,e);case Ro.Reference:return t.visitReference(i,e);case Ro.AnimateChild:return t.visitAnimateChild(i,e);case Ro.AnimateRef:return t.visitAnimateRef(i,e);case Ro.Query:return t.visitQuery(i,e);case Ro.Stagger:return t.visitStagger(i,e);default:throw function Tee(){return new ct(3004,!1)}()}}function QO(t,i){return window.getComputedStyle(t)[i]}let JO=(()=>{class t{validateStyleProperty(e){return function tte(t){Fv||(Fv=function nte(){return typeof document<"u"?document.body:null}()||{},HV=!!Fv.style&&"WebkitAppearance"in Fv.style);let i=!0;return Fv.style&&!function ete(t){return"ebkit"==t.substring(1,6)}(t)&&(i=t in Fv.style,!i&&HV&&(i="Webkit"+t.charAt(0).toUpperCase()+t.slice(1)in Fv.style)),i}(e)}containsElement(e,n){return jV(e,n)}getParentElement(e){return qO(e)}query(e,n,o){return $V(e,n,o)}computeStyle(e,n,o){return o||""}animate(e,n,o,r,u,y=[],I){return new ZS(o,r)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();class eP{static NOOP=new JO}class tP{}const hte=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 YV extends tP{normalizePropertyName(i,e){return KO(i)}normalizeStyleValue(i,e,n,o){let r="";const u=n.toString().trim();if(hte.has(e)&&0!==n&&"0"!==n)if("number"==typeof n)r="px";else{const y=n.match(/^[+-]?[\d\.]+([a-z]*)$/);y&&0==y[1].length&&o.push(function Dee(){return new ct(3005,!1)}())}return u+r}}const rE=new Set(["true","1"]),aE=new Set(["false","0"]);function XV(t,i){const e=rE.has(t)||aE.has(t),n=rE.has(i)||aE.has(i);return(o,r)=>{let u="*"==t||t==o,y="*"==i||i==r;return!u&&e&&"boolean"==typeof o&&(u=o?rE.has(t):aE.has(t)),!y&&n&&"boolean"==typeof r&&(y=r?rE.has(i):aE.has(i)),u&&y}}const _te=new RegExp("s*:selfs*,?","g");function iP(t,i,e,n){return new gte(t).build(i,e,n)}class gte{_driver;constructor(i){this._driver=i}build(i,e,n){const o=new vte(e);return this._resetContextStyleTimingState(o),Qu(this,YS(i),o)}_resetContextStyleTimingState(i){i.currentQuerySelector="",i.collectedStyles=new Map,i.collectedStyles.set("",new Map),i.currentTime=0}visitTrigger(i,e){let n=e.queryCount=0,o=e.depCount=0;const r=[],u=[];return"@"==i.name.charAt(0)&&e.errors.push(function Iee(){return new ct(3006,!1)}()),i.definitions.forEach(y=>{if(this._resetContextStyleTimingState(e),y.type==Ro.State){const I=y,V=I.name;V.toString().split(/\s*,\s*/).forEach(q=>{I.name=q,r.push(this.visitState(I,e))}),I.name=V}else if(y.type==Ro.Transition){const I=this.visitTransition(y,e);n+=I.queryCount,o+=I.depCount,u.push(I)}else e.errors.push(function Eee(){return new ct(3007,!1)}())}),{type:Ro.Trigger,name:i.name,states:r,transitions:u,queryCount:n,depCount:o,options:null}}visitState(i,e){const n=this.visitStyle(i.styles,e),o=i.options&&i.options.params||null;if(n.containsDynamicStyles){const r=new Set,u=o||{};n.styles.forEach(y=>{y instanceof Map&&y.forEach(I=>{ZV(I).forEach(V=>{u.hasOwnProperty(V)||r.add(V)})})}),r.size&&e.errors.push(function Mee(){return new ct(3008,!1)}(0,r.values()))}return{type:Ro.State,name:i.name,style:n,options:o?{params:o}:null}}visitTransition(i,e){e.queryCount=0,e.depCount=0;const n=Qu(this,YS(i.animation),e),o=function pte(t,i){const e=[];return"string"==typeof t?t.split(/\s*,\s*/).forEach(n=>function mte(t,i,e){if(":"==t[0]){const I=function fte(t,i){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,n)=>parseFloat(n)>parseFloat(e);case":decrement":return(e,n)=>parseFloat(n) *"}}(t,e);if("function"==typeof I)return void i.push(I);t=I}const n=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==n||n.length<4)return e.push(function zee(){return new ct(3015,!1)}()),i;const o=n[1],r=n[2],u=n[3];i.push(XV(o,u)),"<"==r[0]&&("*"!=o||"*"!=u)&&i.push(XV(u,o))}(n,e,i)):e.push(t),e}(i.expr,e.errors);return{type:Ro.Transition,matchers:o,animation:n,queryCount:e.queryCount,depCount:e.depCount,options:zv(i.options)}}visitSequence(i,e){return{type:Ro.Sequence,steps:i.steps.map(n=>Qu(this,n,e)),options:zv(i.options)}}visitGroup(i,e){const n=e.currentTime;let o=0;const r=i.steps.map(u=>{e.currentTime=n;const y=Qu(this,u,e);return o=Math.max(o,e.currentTime),y});return e.currentTime=o,{type:Ro.Group,steps:r,options:zv(i.options)}}visitAnimate(i,e){const n=function wte(t,i){if(t.hasOwnProperty("duration"))return t;if("number"==typeof t)return oP(iE(t,i).duration,0,"");const e=t;if(e.split(/\s+/).some(r=>"{"==r.charAt(0)&&"{"==r.charAt(1))){const r=oP(0,0,"");return r.dynamic=!0,r.strValue=e,r}const o=iE(e,i);return oP(o.duration,o.delay,o.easing)}(i.timings,e.errors);e.currentAnimateTimings=n;let o,r=i.styles?i.styles:Tc({});if(r.type==Ro.Keyframes)o=this.visitKeyframes(r,e);else{let u=i.styles,y=!1;if(!u){y=!0;const V={};n.easing&&(V.easing=n.easing),u=Tc(V)}e.currentTime+=n.duration+n.delay;const I=this.visitStyle(u,e);I.isEmptyStep=y,o=I}return e.currentAnimateTimings=null,{type:Ro.Animate,timings:n,style:o,options:null}}visitStyle(i,e){const n=this._makeStyleAst(i,e);return this._validateStyleAst(n,e),n}_makeStyleAst(i,e){const n=[],o=Array.isArray(i.styles)?i.styles:[i.styles];for(let y of o)"string"==typeof y?y===v_?n.push(y):e.errors.push(new ct(3002,!1)):n.push(new Map(Object.entries(y)));let r=!1,u=null;return n.forEach(y=>{if(y instanceof Map&&(y.has("easing")&&(u=y.get("easing"),y.delete("easing")),!r))for(let I of y.values())if(I.toString().indexOf("{{")>=0){r=!0;break}}),{type:Ro.Style,styles:n,easing:u,offset:i.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(i,e){const n=e.currentAnimateTimings;let o=e.currentTime,r=e.currentTime;n&&r>0&&(r-=n.duration+n.delay),i.styles.forEach(u=>{"string"!=typeof u&&u.forEach((y,I)=>{const V=e.collectedStyles.get(e.currentQuerySelector),q=V.get(I);let ee=!0;q&&(r!=o&&r>=q.startTime&&o<=q.endTime&&(e.errors.push(function kee(){return new ct(3010,!1)}()),ee=!1),r=q.startTime),ee&&V.set(I,{startTime:r,endTime:o}),e.options&&function ste(t,i,e){const n=i.params||{},o=ZV(t);o.length&&o.forEach(r=>{n.hasOwnProperty(r)||e.push(function Cee(){return new ct(3001,!1)}())})}(y,e.options,e.errors)})})}visitKeyframes(i,e){const n={type:Ro.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(function Ree(){return new ct(3011,!1)}()),n;let r=0;const u=[];let y=!1,I=!1,V=0;const q=i.steps.map(Lt=>{const At=this._makeStyleAst(Lt,e);let Mn=null!=At.offset?At.offset:function xte(t){if("string"==typeof t)return null;let i=null;if(Array.isArray(t))t.forEach(e=>{if(e instanceof Map&&e.has("offset")){const n=e;i=parseFloat(n.get("offset")),n.delete("offset")}});else if(t instanceof Map&&t.has("offset")){const e=t;i=parseFloat(e.get("offset")),e.delete("offset")}return i}(At.styles),di=0;return null!=Mn&&(r++,di=At.offset=Mn),I=I||di<0||di>1,y=y||di0&&r{const Mn=me>0?At==he?1:me*At:u[At],di=Mn*mt;e.currentTime=Ce+je.delay+di,je.duration=di,this._validateStyleAst(Lt,e),Lt.offset=Mn,n.styles.push(Lt)}),n}visitReference(i,e){return{type:Ro.Reference,animation:Qu(this,YS(i.animation),e),options:zv(i.options)}}visitAnimateChild(i,e){return e.depCount++,{type:Ro.AnimateChild,options:zv(i.options)}}visitAnimateRef(i,e){return{type:Ro.AnimateRef,animation:this.visitReference(i.animation,e),options:zv(i.options)}}visitQuery(i,e){const n=e.currentQuerySelector,o=i.options||{};e.queryCount++,e.currentQuery=i;const[r,u]=function bte(t){const i=!!t.split(/\s*,\s*/).find(e=>":self"==e);return i&&(t=t.replace(_te,"")),t=t.replace(/@\*/g,nE).replace(/@\w+/g,e=>nE+"-"+e.slice(1)).replace(/:animating/g,ZO),[t,i]}(i.selector);e.currentQuerySelector=n.length?n+" "+r:r,Ku(e.collectedStyles,e.currentQuerySelector,new Map);const y=Qu(this,YS(i.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:Ro.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:u,animation:y,originalSelector:i.selector,options:zv(i.options)}}visitStagger(i,e){e.currentQuery||e.errors.push(function Fee(){return new ct(3013,!1)}());const n="full"===i.timings?{duration:0,delay:0,easing:"full"}:iE(i.timings,e.errors,!0);return{type:Ro.Stagger,animation:Qu(this,YS(i.animation),e),timings:n,options:null}}}class vte{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(i){this.errors=i}}function zv(t){return t?(t={...t}).params&&(t.params=function yte(t){return t?{...t}:null}(t.params)):t={},t}function oP(t,i,e){return{duration:t,delay:i,easing:e}}function rP(t,i,e,n,o,r,u=null,y=!1){return{type:1,element:t,keyframes:i,preStyleProps:e,postStyleProps:n,duration:o,delay:r,totalTime:o+r,easing:u,subTimeline:y}}class sE{_map=new Map;get(i){return this._map.get(i)||[]}append(i,e){let n=this._map.get(i);n||this._map.set(i,n=[]),n.push(...e)}has(i){return this._map.has(i)}clear(){this._map.clear()}}const Tte=new RegExp(":enter","g"),Ite=new RegExp(":leave","g");function aP(t,i,e,n,o,r=new Map,u=new Map,y,I,V=[]){return(new Ete).buildKeyframes(t,i,e,n,o,r,u,y,I,V)}class Ete{buildKeyframes(i,e,n,o,r,u,y,I,V,q=[]){V=V||new sE;const ee=new sP(i,e,V,o,r,q,[]);ee.options=I;const me=I.delay?x_(I.delay):0;ee.currentTimeline.delayNextStep(me),ee.currentTimeline.setStyles([u],null,ee.errors,I),Qu(this,n,ee);const he=ee.timelines.filter(Ce=>Ce.containsAnimation());if(he.length&&y.size){let Ce;for(let je=he.length-1;je>=0;je--){const mt=he[je];if(mt.element===e){Ce=mt;break}}Ce&&!Ce.allowOnlyTimelineStyles()&&Ce.setStyles([y],null,ee.errors,I)}return he.length?he.map(Ce=>Ce.buildKeyframes()):[rP(e,[],[],[],0,me,"",!1)]}visitTrigger(i,e){}visitState(i,e){}visitTransition(i,e){}visitAnimateChild(i,e){const n=e.subInstructions.get(e.element);if(n){const o=e.createSubContext(i.options),r=e.currentTimeline.currentTime,u=this._visitSubInstructions(n,o,o.options);r!=u&&e.transformIntoNewTimeline(u)}e.previousNode=i}visitAnimateRef(i,e){const n=e.createSubContext(i.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([i.options,i.animation.options],e,n),this.visitReference(i.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=i}_applyAnimationRefDelays(i,e,n){for(const o of i){const r=o?.delay;if(r){const u="number"==typeof r?r:x_(XS(r,o?.params??{},e.errors));n.delayNextStep(u)}}}_visitSubInstructions(i,e,n){let r=e.currentTimeline.currentTime;const u=null!=n.duration?x_(n.duration):null,y=null!=n.delay?x_(n.delay):null;return 0!==u&&i.forEach(I=>{const V=e.appendInstructionToTimeline(I,u,y);r=Math.max(r,V.duration+V.delay)}),r}visitReference(i,e){e.updateOptions(i.options,!0),Qu(this,i.animation,e),e.previousNode=i}visitSequence(i,e){const n=e.subContextCount;let o=e;const r=i.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),null!=r.delay)){o.previousNode.type==Ro.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=lE);const u=x_(r.delay);o.delayNextStep(u)}i.steps.length&&(i.steps.forEach(u=>Qu(this,u,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>n&&o.transformIntoNewTimeline()),e.previousNode=i}visitGroup(i,e){const n=[];let o=e.currentTimeline.currentTime;const r=i.options&&i.options.delay?x_(i.options.delay):0;i.steps.forEach(u=>{const y=e.createSubContext(i.options);r&&y.delayNextStep(r),Qu(this,u,y),o=Math.max(o,y.currentTimeline.currentTime),n.push(y.currentTimeline)}),n.forEach(u=>e.currentTimeline.mergeTimelineCollectedStyles(u)),e.transformIntoNewTimeline(o),e.previousNode=i}_visitTiming(i,e){if(i.dynamic){const n=i.strValue;return iE(e.params?XS(n,e.params,e.errors):n,e.errors)}return{duration:i.duration,delay:i.delay,easing:i.easing}}visitAnimate(i,e){const n=e.currentAnimateTimings=this._visitTiming(i.timings,e),o=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),o.snapshotCurrentStyles());const r=i.style;r.type==Ro.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(n.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=i}visitStyle(i,e){const n=e.currentTimeline,o=e.currentAnimateTimings;!o&&n.hasCurrentStyleProperties()&&n.forwardFrame();const r=o&&o.easing||i.easing;i.isEmptyStep?n.applyEmptyStep(r):n.setStyles(i.styles,r,e.errors,e.options),e.previousNode=i}visitKeyframes(i,e){const n=e.currentAnimateTimings,o=e.currentTimeline.duration,r=n.duration,y=e.createSubContext().currentTimeline;y.easing=n.easing,i.styles.forEach(I=>{y.forwardTime((I.offset||0)*r),y.setStyles(I.styles,I.easing,e.errors,e.options),y.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(y),e.transformIntoNewTimeline(o+r),e.previousNode=i}visitQuery(i,e){const n=e.currentTimeline.currentTime,o=i.options||{},r=o.delay?x_(o.delay):0;r&&(e.previousNode.type===Ro.Style||0==n&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=lE);let u=n;const y=e.invokeQuery(i.selector,i.originalSelector,i.limit,i.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=y.length;let I=null;y.forEach((V,q)=>{e.currentQueryIndex=q;const ee=e.createSubContext(i.options,V);r&&ee.delayNextStep(r),V===e.element&&(I=ee.currentTimeline),Qu(this,i.animation,ee),ee.currentTimeline.applyStylesToKeyframe(),u=Math.max(u,ee.currentTimeline.currentTime)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(u),I&&(e.currentTimeline.mergeTimelineCollectedStyles(I),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=i}visitStagger(i,e){const n=e.parentContext,o=e.currentTimeline,r=i.timings,u=Math.abs(r.duration),y=u*(e.currentQueryTotal-1);let I=u*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":I=y-I;break;case"full":I=n.currentStaggerTime}const q=e.currentTimeline;I&&q.delayNextStep(I);const ee=q.currentTime;Qu(this,i.animation,e),e.previousNode=i,n.currentStaggerTime=o.currentTime-ee+(o.startTime-n.currentTimeline.startTime)}}const lE={};class sP{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=lE;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(i,e,n,o,r,u,y,I){this._driver=i,this.element=e,this.subInstructions=n,this._enterClassName=o,this._leaveClassName=r,this.errors=u,this.timelines=y,this.currentTimeline=I||new cE(this._driver,e,0),y.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(i,e){if(!i)return;const n=i;let o=this.options;null!=n.duration&&(o.duration=x_(n.duration)),null!=n.delay&&(o.delay=x_(n.delay));const r=n.params;if(r){let u=o.params;u||(u=this.options.params={}),Object.keys(r).forEach(y=>{(!e||!u.hasOwnProperty(y))&&(u[y]=XS(r[y],u,this.errors))})}}_copyOptions(){const i={};if(this.options){const e=this.options.params;if(e){const n=i.params={};Object.keys(e).forEach(o=>{n[o]=e[o]})}}return i}createSubContext(i=null,e,n){const o=e||this.element,r=new sP(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,n||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(i),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(i){return this.previousNode=lE,this.currentTimeline=this.currentTimeline.fork(this.element,i),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(i,e,n){const o={duration:e??i.duration,delay:this.currentTimeline.currentTime+(n??0)+i.delay,easing:""},r=new Mte(this._driver,i.element,i.keyframes,i.preStyleProps,i.postStyleProps,o,i.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(i){this.currentTimeline.forwardTime(this.currentTimeline.duration+i)}delayNextStep(i){i>0&&this.currentTimeline.delayNextStep(i)}invokeQuery(i,e,n,o,r,u){let y=[];if(o&&y.push(this.element),i.length>0){i=(i=i.replace(Tte,"."+this._enterClassName)).replace(Ite,"."+this._leaveClassName);let V=this._driver.query(this.element,i,1!=n);0!==n&&(V=n<0?V.slice(V.length+n,V.length):V.slice(0,n)),y.push(...V)}return!r&&0==y.length&&u.push(function Nee(){return new ct(3014,!1)}()),y}}class cE{_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(i,e,n,o){this._driver=i,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,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(i){const e=1===this._keyframes.size&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+i),e&&this.snapshotCurrentStyles()):this.startTime+=i}fork(i,e){return this.applyStylesToKeyframe(),new cE(this._driver,i,e||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(i){this.applyStylesToKeyframe(),this.duration=i,this._loadKeyframe()}_updateStyle(i,e){this._localTimelineStyles.set(i,e),this._globalTimelineStyles.set(i,e),this._styleSummary.set(i,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(i){i&&this._previousKeyframe.set("easing",i);for(let[e,n]of this._globalTimelineStyles)this._backFill.set(e,n||v_),this._currentKeyframe.set(e,v_);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(i,e,n,o){e&&this._previousKeyframe.set("easing",e);const r=o&&o.params||{},u=function Ate(t,i){const e=new Map;let n;return t.forEach(o=>{if("*"===o){n??=i.keys();for(let r of n)e.set(r,v_)}else for(let[r,u]of o)e.set(r,u)}),e}(i,this._globalTimelineStyles);for(let[y,I]of u){const V=XS(I,r,n);this._pendingStyles.set(y,V),this._localTimelineStyles.has(y)||this._backFill.set(y,this._globalTimelineStyles.get(y)??v_),this._updateStyle(y,V)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((i,e)=>{this._currentKeyframe.set(e,i)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((i,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,i)}))}snapshotCurrentStyles(){for(let[i,e]of this._localTimelineStyles)this._pendingStyles.set(i,e),this._updateStyle(i,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const i=[];for(let e in this._currentKeyframe)i.push(e);return i}mergeTimelineCollectedStyles(i){i._styleSummary.forEach((e,n)=>{const o=this._styleSummary.get(n);(!o||e.time>o.time)&&this._updateStyle(n,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();const i=new Set,e=new Set,n=1===this._keyframes.size&&0===this.duration;let o=[];this._keyframes.forEach((y,I)=>{const V=new Map([...this._backFill,...y]);V.forEach((q,ee)=>{"!"===q?i.add(ee):q===v_&&e.add(ee)}),n||V.set("offset",I/this.duration),o.push(V)});const r=[...i.values()],u=[...e.values()];if(n){const y=o[0],I=new Map(y);y.set("offset",0),I.set("offset",1),o=[y,I]}return rP(this.element,o,r,u,this.duration,this.startTime,this.easing,!1)}}class Mte extends cE{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(i,e,n,o,r,u,y=!1){super(i,e,u.delay),this.keyframes=n,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=y,this.timings={duration:u.duration,delay:u.delay,easing:u.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let i=this.keyframes,{delay:e,duration:n,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){const r=[],u=n+e,y=e/u,I=new Map(i[0]);I.set("offset",0),r.push(I);const V=new Map(i[0]);V.set("offset",JV(y)),r.push(V);const q=i.length-1;for(let ee=1;ee<=q;ee++){let me=new Map(i[ee]);const he=me.get("offset");me.set("offset",JV((e+he*n)/u)),r.push(me)}n=u,e=0,o="",i=r}return rP(this.element,i,this.preStyleProps,this.postStyleProps,n,e,o,!0)}}function JV(t,i=3){const e=Math.pow(10,i-1);return Math.round(t*e)/e}function e6(t,i,e,n,o,r,u,y,I,V,q,ee,me){return{type:0,element:t,triggerName:i,isRemovalTransition:o,fromState:e,fromStyles:r,toState:n,toStyles:u,timelines:y,queriedElements:I,preStyleProps:V,postStyleProps:q,totalTime:ee,errors:me}}const lP={};class t6{_triggerName;ast;_stateStyles;constructor(i,e,n){this._triggerName=i,this.ast=e,this._stateStyles=n}match(i,e,n,o){return function kte(t,i,e,n,o){return t.some(r=>r(i,e,n,o))}(this.ast.matchers,i,e,n,o)}buildStyles(i,e,n){let o=this._stateStyles.get("*");return void 0!==i&&(o=this._stateStyles.get(i?.toString())||o),o?o.buildStyles(e,n):new Map}build(i,e,n,o,r,u,y,I,V,q){const ee=[],me=this.ast.options&&this.ast.options.params||lP,Ce=this.buildStyles(n,y&&y.params||lP,ee),je=I&&I.params||lP,mt=this.buildStyles(o,je,ee),Lt=new Set,At=new Map,Mn=new Map,di="void"===o,Ei={params:n6(je,me),delay:this.ast.options?.delay},ma=q?[]:aP(i,e,this.ast.animation,r,u,Ce,mt,Ei,V,ee);let br=0;return ma.forEach(pl=>{br=Math.max(pl.duration+pl.delay,br)}),ee.length?e6(e,this._triggerName,n,o,di,Ce,mt,[],[],At,Mn,br,ee):(ma.forEach(pl=>{const nm=pl.element,cw=Ku(At,nm,new Set);pl.preStyleProps.forEach(v0=>cw.add(v0));const s9=Ku(Mn,nm,new Set);pl.postStyleProps.forEach(v0=>s9.add(v0)),nm!==e&&Lt.add(nm)}),e6(e,this._triggerName,n,o,di,Ce,mt,ma,[...Lt.values()],At,Mn,br))}}function n6(t,i){const e={...i};return Object.entries(t).forEach(([n,o])=>{null!=o&&(e[n]=o)}),e}class Rte{styles;defaultParams;normalizer;constructor(i,e,n){this.styles=i,this.defaultParams=e,this.normalizer=n}buildStyles(i,e){const n=new Map,o=n6(i,this.defaultParams);return this.styles.styles.forEach(r=>{"string"!=typeof r&&r.forEach((u,y)=>{u&&(u=XS(u,o,e));const I=this.normalizer.normalizePropertyName(y,e);u=this.normalizer.normalizeStyleValue(y,I,u,e),n.set(y,u)})}),n}}class Pte{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(i,e,n){this.name=i,this.ast=e,this._normalizer=n,e.states.forEach(o=>{this.states.set(o.name,new Rte(o.style,o.options&&o.options.params||{},n))}),i6(this.states,"true","1"),i6(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new t6(i,o,this.states))}),this.fallbackTransition=function Lte(t,i){return new t6(t,{type:Ro.Transition,animation:{type:Ro.Sequence,steps:[],options:null},matchers:[(u,y)=>!0],options:null,queryCount:0,depCount:0},i)}(i,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(i,e,n,o){return this.transitionFactories.find(u=>u.match(i,e,n,o))||null}matchStyles(i,e,n){return this.fallbackTransition.buildStyles(i,e,n)}}function i6(t,i,e){t.has(i)?t.has(e)||t.set(e,t.get(i)):t.has(e)&&t.set(i,t.get(e))}const Fte=new sE;class Nte{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(i,e,n){this.bodyNode=i,this._driver=e,this._normalizer=n}register(i,e){const n=[],r=iP(this._driver,e,n,[]);if(n.length)throw function Hee(){return new ct(3503,!1)}();this._animations.set(i,r)}_buildPlayer(i,e,n){const o=i.element,r=VV(this._normalizer,i.keyframes,e,n);return this._driver.animate(o,r,i.duration,i.delay,i.easing,[],!0)}create(i,e,n={}){const o=[],r=this._animations.get(i);let u;const y=new Map;if(r?(u=aP(this._driver,e,r,qV,WO,new Map,new Map,n,Fte,o),u.forEach(q=>{const ee=Ku(y,q.element,new Map);q.postStyleProps.forEach(me=>ee.set(me,null))})):(o.push(function jee(){return new ct(3300,!1)}()),u=[]),o.length)throw function $ee(){return new ct(3504,!1)}();y.forEach((q,ee)=>{q.forEach((me,he)=>{q.set(he,this._driver.computeStyle(ee,he,v_))})});const V=bb(u.map(q=>{const ee=y.get(q.element);return this._buildPlayer(q,new Map,ee)}));return this._playersById.set(i,V),V.onDestroy(()=>this.destroy(i)),this.players.push(V),V}destroy(i){const e=this._getPlayer(i);e.destroy(),this._playersById.delete(i);const n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(i){const e=this._playersById.get(i);if(!e)throw function Gee(){return new ct(3301,!1)}();return e}listen(i,e,n,o){const r=GO(e,"","","");return jO(this._getPlayer(i),n,r,o),()=>{}}command(i,e,n,o){if("register"==n)return void this.register(i,o[0]);if("create"==n)return void this.create(i,e,o[0]||{});const r=this._getPlayer(i);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(o[0]));break;case"destroy":this.destroy(i)}}}const o6="ng-animate-queued",cP="ng-animate-disabled",Hte=[],r6={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},jte={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Zp="__ng_removed";class dP{namespaceId;value;options;get params(){return this.options.params}constructor(i,e=""){this.namespaceId=e;const n=i&&i.hasOwnProperty("value");if(this.value=function Wte(t){return t??null}(n?i.value:i),n){const{value:r,...u}=i;this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(i){const e=i.params;if(e){const n=this.options.params;Object.keys(e).forEach(o=>{null==n[o]&&(n[o]=e[o])})}}}const KS="void",uP=new dP(KS);class $te{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(i,e,n){this.id=i,this.hostElement=e,this._engine=n,this._hostClassName="ng-tns-"+i,qh(e,this._hostClassName)}listen(i,e,n,o){if(!this._triggers.has(e))throw function qee(){return new ct(3302,!1)}();if(null==n||0==n.length)throw function Wee(){return new ct(3303,!1)}();if(!function Zte(t){return"start"==t||"done"==t}(n))throw function Zee(){return new ct(3400,!1)}();const r=Ku(this._elementListeners,i,[]),u={name:e,phase:n,callback:o};r.push(u);const y=Ku(this._engine.statesByElement,i,new Map);return y.has(e)||(qh(i,tE),qh(i,tE+"-"+e),y.set(e,uP)),()=>{this._engine.afterFlush(()=>{const I=r.indexOf(u);I>=0&&r.splice(I,1),this._triggers.has(e)||y.delete(e)})}}register(i,e){return!this._triggers.has(i)&&(this._triggers.set(i,e),!0)}_getTrigger(i){const e=this._triggers.get(i);if(!e)throw function Yee(){return new ct(3401,!1)}();return e}trigger(i,e,n,o=!0){const r=this._getTrigger(e),u=new hP(this.id,e,i);let y=this._engine.statesByElement.get(i);y||(qh(i,tE),qh(i,tE+"-"+e),this._engine.statesByElement.set(i,y=new Map));let I=y.get(e);const V=new dP(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&I&&V.absorbOptions(I.options),y.set(e,V),I||(I=uP),V.value!==KS&&I.value===V.value){if(!function Kte(t,i){const e=Object.keys(t),n=Object.keys(i);if(e.length!=n.length)return!1;for(let o=0;o{Nv(i,mt),Xm(i,Lt)})}return}const me=Ku(this._engine.playersByElement,i,[]);me.forEach(je=>{je.namespaceId==this.id&&je.triggerName==e&&je.queued&&je.destroy()});let he=r.matchTransition(I.value,V.value,i,V.params),Ce=!1;if(!he){if(!o)return;he=r.fallbackTransition,Ce=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:e,transition:he,fromState:I,toState:V,player:u,isFallbackTransition:Ce}),Ce||(qh(i,o6),u.onStart(()=>{wx(i,o6)})),u.onDone(()=>{let je=this.players.indexOf(u);je>=0&&this.players.splice(je,1);const mt=this._engine.playersByElement.get(i);if(mt){let Lt=mt.indexOf(u);Lt>=0&&mt.splice(Lt,1)}}),this.players.push(u),me.push(u),u}deregister(i){this._triggers.delete(i),this._engine.statesByElement.forEach(e=>e.delete(i)),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(o=>o.name!=i))})}clearElementCache(i){this._engine.statesByElement.delete(i),this._elementListeners.delete(i);const e=this._engine.playersByElement.get(i);e&&(e.forEach(n=>n.destroy()),this._engine.playersByElement.delete(i))}_signalRemovalForInnerTriggers(i,e){const n=this._engine.driver.query(i,nE,!0);n.forEach(o=>{if(o[Zp])return;const r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(u=>u.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(i,e,n,o){const r=this._engine.statesByElement.get(i),u=new Map;if(r){const y=[];if(r.forEach((I,V)=>{if(u.set(V,I.value),this._triggers.has(V)){const q=this.trigger(i,V,KS,o);q&&y.push(q)}}),y.length)return this._engine.markElementAsRemoved(this.id,i,!0,e,u),n&&bb(y).onDone(()=>this._engine.processLeaveNode(i)),!0}return!1}prepareLeaveAnimationListeners(i){const e=this._elementListeners.get(i),n=this._engine.statesByElement.get(i);if(e&&n){const o=new Set;e.forEach(r=>{const u=r.name;if(o.has(u))return;o.add(u);const I=this._triggers.get(u).fallbackTransition,V=n.get(u)||uP,q=new dP(KS),ee=new hP(this.id,u,i);this._engine.totalQueuedPlayers++,this._queue.push({element:i,triggerName:u,transition:I,fromState:V,toState:q,player:ee,isFallbackTransition:!0})})}}removeNode(i,e){const n=this._engine;if(i.childElementCount&&this._signalRemovalForInnerTriggers(i,e),this.triggerLeaveAnimation(i,e,!0))return;let o=!1;if(n.totalAnimations){const r=n.players.length?n.playersByQueriedElement.get(i):[];if(r&&r.length)o=!0;else{let u=i;for(;u=u.parentNode;)if(n.statesByElement.get(u)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(i),o)n.markElementAsRemoved(this.id,i,!1,e);else{const r=i[Zp];(!r||r===r6)&&(n.afterFlush(()=>this.clearElementCache(i)),n.destroyInnerAnimations(i),n._onRemovalComplete(i,e))}}insertNode(i,e){qh(i,this._hostClassName)}drainQueuedTransitions(i){const e=[];return this._queue.forEach(n=>{const o=n.player;if(o.destroyed)return;const r=n.element,u=this._elementListeners.get(r);u&&u.forEach(y=>{if(y.name==n.triggerName){const I=GO(r,n.triggerName,n.fromState.value,n.toState.value);I._data=i,jO(n.player,y.phase,I,y.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(n)}),this._queue=[],e.sort((n,o)=>{const r=n.transition.ast.depCount,u=o.transition.ast.depCount;return 0==r||0==u?r-u:this._engine.driver.containsElement(n.element,o.element)?1:-1})}destroy(i){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,i)}}class Gte{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=(i,e)=>{};_onRemovalComplete(i,e){this.onRemovalComplete(i,e)}constructor(i,e,n){this.bodyNode=i,this.driver=e,this._normalizer=n}get queuedPlayers(){const i=[];return this._namespaceList.forEach(e=>{e.players.forEach(n=>{n.queued&&i.push(n)})}),i}createNamespace(i,e){const n=new $te(i,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[i]=n}_balanceNamespaceList(i,e){const n=this._namespaceList,o=this.namespacesByHostElement;if(n.length-1>=0){let u=!1,y=this.driver.getParentElement(e);for(;y;){const I=o.get(y);if(I){const V=n.indexOf(I);n.splice(V+1,0,i),u=!0;break}y=this.driver.getParentElement(y)}u||n.unshift(i)}else n.push(i);return o.set(e,i),i}register(i,e){let n=this._namespaceLookup[i];return n||(n=this.createNamespace(i,e)),n}registerTrigger(i,e,n){let o=this._namespaceLookup[i];o&&o.register(e,n)&&this.totalAnimations++}destroy(i,e){i&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const n=this._fetchNamespace(i);this.namespacesByHostElement.delete(n.hostElement);const o=this._namespaceList.indexOf(n);o>=0&&this._namespaceList.splice(o,1),n.destroy(e),delete this._namespaceLookup[i]}))}_fetchNamespace(i){return this._namespaceLookup[i]}fetchNamespacesByElement(i){const e=new Set,n=this.statesByElement.get(i);if(n)for(let o of n.values())if(o.namespaceId){const r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}return e}trigger(i,e,n,o){if(dE(e)){const r=this._fetchNamespace(i);if(r)return r.trigger(e,n,o),!0}return!1}insertNode(i,e,n,o){if(!dE(e))return;const r=e[Zp];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;const u=this.collectedLeaveElements.indexOf(e);u>=0&&this.collectedLeaveElements.splice(u,1)}if(i){const u=this._fetchNamespace(i);u&&u.insertNode(e,n)}o&&this.collectEnterElement(e)}collectEnterElement(i){this.collectedEnterElements.push(i)}markElementAsDisabled(i,e){e?this.disabledNodes.has(i)||(this.disabledNodes.add(i),qh(i,cP)):this.disabledNodes.has(i)&&(this.disabledNodes.delete(i),wx(i,cP))}removeNode(i,e,n){if(dE(e)){const o=i?this._fetchNamespace(i):null;o?o.removeNode(e,n):this.markElementAsRemoved(i,e,!1,n);const r=this.namespacesByHostElement.get(e);r&&r.id!==i&&r.removeNode(e,n)}else this._onRemovalComplete(e,n)}markElementAsRemoved(i,e,n,o,r){this.collectedLeaveElements.push(e),e[Zp]={namespaceId:i,setForRemoval:o,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:r}}listen(i,e,n,o,r){return dE(e)?this._fetchNamespace(i).listen(e,n,o,r):()=>{}}_buildInstruction(i,e,n,o,r){return i.transition.build(this.driver,i.element,i.fromState.value,i.toState.value,n,o,i.fromState.options,i.toState.options,e,r)}destroyInnerAnimations(i){let e=this.driver.query(i,nE,!0);e.forEach(n=>this.destroyActiveAnimationsForElement(n)),0!=this.playersByQueriedElement.size&&(e=this.driver.query(i,ZO,!0),e.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(i){const e=this.playersByElement.get(i);e&&e.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(i){const e=this.playersByQueriedElement.get(i);e&&e.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(i=>{if(this.players.length)return bb(this.players).onDone(()=>i());i()})}processLeaveNode(i){const e=i[Zp];if(e&&e.setForRemoval){if(i[Zp]=r6,e.namespaceId){this.destroyInnerAnimations(i);const n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(i)}this._onRemovalComplete(i,e.setForRemoval)}i.classList?.contains(cP)&&this.markElementAsDisabled(i,!1),this.driver.query(i,".ng-animate-disabled",!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(i=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,o)=>this._balanceNamespaceList(n,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;nn()),this._flushFns=[],this._whenQuietFns.length){const n=this._whenQuietFns;this._whenQuietFns=[],e.length?bb(e).onDone(()=>{n.forEach(o=>o())}):n.forEach(o=>o())}}reportError(i){throw function Xee(){return new ct(3402,!1)}()}_flushAnimations(i,e){const n=new sE,o=[],r=new Map,u=[],y=new Map,I=new Map,V=new Map,q=new Set;this.disabledNodes.forEach(Fi=>{q.add(Fi);const mo=this.driver.query(Fi,".ng-animate-queued",!0);for(let Io=0;Io{const Io=qV+je++;Ce.set(mo,Io),Fi.forEach(Rr=>qh(Rr,Io))});const mt=[],Lt=new Set,At=new Set;for(let Fi=0;FiLt.add(Rr)):At.add(mo))}const Mn=new Map,di=l6(me,Array.from(Lt));di.forEach((Fi,mo)=>{const Io=WO+je++;Mn.set(mo,Io),Fi.forEach(Rr=>qh(Rr,Io))}),i.push(()=>{he.forEach((Fi,mo)=>{const Io=Ce.get(mo);Fi.forEach(Rr=>wx(Rr,Io))}),di.forEach((Fi,mo)=>{const Io=Mn.get(mo);Fi.forEach(Rr=>wx(Rr,Io))}),mt.forEach(Fi=>{this.processLeaveNode(Fi)})});const Ei=[],ma=[];for(let Fi=this._namespaceList.length-1;Fi>=0;Fi--)this._namespaceList[Fi].drainQueuedTransitions(e).forEach(Io=>{const Rr=Io.player,hc=Io.element;if(Ei.push(Rr),this.collectedEnterElements.length){const hd=hc[Zp];if(hd&&hd.setForMove){if(hd.previousTriggersValues&&hd.previousTriggersValues.has(Io.triggerName)){const x0=hd.previousTriggersValues.get(Io.triggerName),Kh=this.statesByElement.get(Io.element);if(Kh&&Kh.has(Io.triggerName)){const uA=Kh.get(Io.triggerName);uA.value=x0,Kh.set(Io.triggerName,uA)}}return void Rr.destroy()}}const hf=!ee||!this.driver.containsElement(ee,hc),ah=Mn.get(hc),Nb=Ce.get(hc),Ls=this._buildInstruction(Io,n,Nb,ah,hf);if(Ls.errors&&Ls.errors.length)return void ma.push(Ls);if(hf)return Rr.onStart(()=>Nv(hc,Ls.fromStyles)),Rr.onDestroy(()=>Xm(hc,Ls.toStyles)),void o.push(Rr);if(Io.isFallbackTransition)return Rr.onStart(()=>Nv(hc,Ls.fromStyles)),Rr.onDestroy(()=>Xm(hc,Ls.toStyles)),void o.push(Rr);const d9=[];Ls.timelines.forEach(hd=>{hd.stretchStartingKeyframe=!0,this.disabledNodes.has(hd.element)||d9.push(hd)}),Ls.timelines=d9,n.append(hc,Ls.timelines),u.push({instruction:Ls,player:Rr,element:hc}),Ls.queriedElements.forEach(hd=>Ku(y,hd,[]).push(Rr)),Ls.preStyleProps.forEach((hd,x0)=>{if(hd.size){let Kh=I.get(x0);Kh||I.set(x0,Kh=new Set),hd.forEach((uA,aF)=>Kh.add(aF))}}),Ls.postStyleProps.forEach((hd,x0)=>{let Kh=V.get(x0);Kh||V.set(x0,Kh=new Set),hd.forEach((uA,aF)=>Kh.add(aF))})});if(ma.length){const Fi=[];ma.forEach(mo=>{Fi.push(function Kee(){return new ct(3505,!1)}())}),Ei.forEach(mo=>mo.destroy()),this.reportError(Fi)}const br=new Map,pl=new Map;u.forEach(Fi=>{const mo=Fi.element;n.has(mo)&&(pl.set(mo,mo),this._beforeAnimationBuild(Fi.player.namespaceId,Fi.instruction,br))}),o.forEach(Fi=>{const mo=Fi.element;this._getPreviousPlayers(mo,!1,Fi.namespaceId,Fi.triggerName,null).forEach(Rr=>{Ku(br,mo,[]).push(Rr),Rr.destroy()})});const nm=mt.filter(Fi=>d6(Fi,I,V)),cw=new Map;s6(cw,this.driver,At,V,v_).forEach(Fi=>{d6(Fi,I,V)&&nm.push(Fi)});const v0=new Map;he.forEach((Fi,mo)=>{s6(v0,this.driver,new Set(Fi),I,"!")}),nm.forEach(Fi=>{const mo=cw.get(Fi),Io=v0.get(Fi);cw.set(Fi,new Map([...mo?.entries()??[],...Io?.entries()??[]]))});const rF=[],l9=[],c9={};u.forEach(Fi=>{const{element:mo,player:Io,instruction:Rr}=Fi;if(n.has(mo)){if(q.has(mo))return Io.onDestroy(()=>Xm(mo,Rr.toStyles)),Io.disabled=!0,Io.overrideTotalTime(Rr.totalTime),void o.push(Io);let hc=c9;if(pl.size>1){let ah=mo;const Nb=[];for(;ah=ah.parentNode;){const Ls=pl.get(ah);if(Ls){hc=Ls;break}Nb.push(ah)}Nb.forEach(Ls=>pl.set(Ls,hc))}const hf=this._buildAnimation(Io.namespaceId,Rr,br,r,v0,cw);if(Io.setRealPlayer(hf),hc===c9)rF.push(Io);else{const ah=this.playersByElement.get(hc);ah&&ah.length&&(Io.parentPlayer=bb(ah)),o.push(Io)}}else Nv(mo,Rr.fromStyles),Io.onDestroy(()=>Xm(mo,Rr.toStyles)),l9.push(Io),q.has(mo)&&o.push(Io)}),l9.forEach(Fi=>{const mo=r.get(Fi.element);if(mo&&mo.length){const Io=bb(mo);Fi.setRealPlayer(Io)}}),o.forEach(Fi=>{Fi.parentPlayer?Fi.syncPlayerEvents(Fi.parentPlayer):Fi.destroy()});for(let Fi=0;Fi!hf.destroyed);hc.length?Yte(this,mo,hc):this.processLeaveNode(mo)}return mt.length=0,rF.forEach(Fi=>{this.players.push(Fi),Fi.onDone(()=>{Fi.destroy();const mo=this.players.indexOf(Fi);this.players.splice(mo,1)}),Fi.play()}),rF}afterFlush(i){this._flushFns.push(i)}afterFlushAnimationsDone(i){this._whenQuietFns.push(i)}_getPreviousPlayers(i,e,n,o,r){let u=[];if(e){const y=this.playersByQueriedElement.get(i);y&&(u=y)}else{const y=this.playersByElement.get(i);if(y){const I=!r||r==KS;y.forEach(V=>{V.queued||!I&&V.triggerName!=o||u.push(V)})}}return(n||o)&&(u=u.filter(y=>!(n&&n!=y.namespaceId||o&&o!=y.triggerName))),u}_beforeAnimationBuild(i,e,n){const r=e.element,u=e.isRemovalTransition?void 0:i,y=e.isRemovalTransition?void 0:e.triggerName;for(const I of e.timelines){const V=I.element,q=V!==r,ee=Ku(n,V,[]);this._getPreviousPlayers(V,q,u,y,e.toState).forEach(he=>{const Ce=he.getRealPlayer();Ce.beforeDestroy&&Ce.beforeDestroy(),he.destroy(),ee.push(he)})}Nv(r,e.fromStyles)}_buildAnimation(i,e,n,o,r,u){const y=e.triggerName,I=e.element,V=[],q=new Set,ee=new Set,me=e.timelines.map(Ce=>{const je=Ce.element;q.add(je);const mt=je[Zp];if(mt&&mt.removedBeforeQueried)return new ZS(Ce.duration,Ce.delay);const Lt=je!==I,At=function Xte(t){const i=[];return c6(t,i),i}((n.get(je)||Hte).map(br=>br.getRealPlayer())).filter(br=>!!br.element&&br.element===je),Mn=r.get(je),di=u.get(je),Ei=VV(this._normalizer,Ce.keyframes,Mn,di),ma=this._buildPlayer(Ce,Ei,At);if(Ce.subTimeline&&o&&ee.add(je),Lt){const br=new hP(i,y,je);br.setRealPlayer(ma),V.push(br)}return ma});V.forEach(Ce=>{Ku(this.playersByQueriedElement,Ce.element,[]).push(Ce),Ce.onDone(()=>function qte(t,i,e){let n=t.get(i);if(n){if(n.length){const o=n.indexOf(e);n.splice(o,1)}0==n.length&&t.delete(i)}return n}(this.playersByQueriedElement,Ce.element,Ce))}),q.forEach(Ce=>qh(Ce,WV));const he=bb(me);return he.onDestroy(()=>{q.forEach(Ce=>wx(Ce,WV)),Xm(I,e.toStyles)}),ee.forEach(Ce=>{Ku(o,Ce,[]).push(he)}),he}_buildPlayer(i,e,n){return e.length>0?this.driver.animate(i.element,e,i.duration,i.delay,i.easing,n):new ZS(i.duration,i.delay)}}class hP{namespaceId;triggerName;element;_player=new ZS;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(i,e,n){this.namespaceId=i,this.triggerName=e,this.element=n}setRealPlayer(i){this._containsRealPlayer||(this._player=i,this._queuedCallbacks.forEach((e,n)=>{e.forEach(o=>jO(i,n,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(i.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(i){this.totalTime=i}syncPlayerEvents(i){const e=this._player;e.triggerCallback&&i.onStart(()=>e.triggerCallback("start")),i.onDone(()=>this.finish()),i.onDestroy(()=>this.destroy())}_queueEvent(i,e){Ku(this._queuedCallbacks,i,[]).push(e)}onDone(i){this.queued&&this._queueEvent("done",i),this._player.onDone(i)}onStart(i){this.queued&&this._queueEvent("start",i),this._player.onStart(i)}onDestroy(i){this.queued&&this._queueEvent("destroy",i),this._player.onDestroy(i)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(i){this.queued||this._player.setPosition(i)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(i){const e=this._player;e.triggerCallback&&e.triggerCallback(i)}}function dE(t){return t&&1===t.nodeType}function a6(t,i){const e=t.style.display;return t.style.display=i??"none",e}function s6(t,i,e,n,o){const r=[];e.forEach(I=>r.push(a6(I)));const u=[];n.forEach((I,V)=>{const q=new Map;I.forEach(ee=>{const me=i.computeStyle(V,ee,o);q.set(ee,me),(!me||0==me.length)&&(V[Zp]=jte,u.push(V))}),t.set(V,q)});let y=0;return e.forEach(I=>a6(I,r[y++])),u}function l6(t,i){const e=new Map;if(t.forEach(y=>e.set(y,[])),0==i.length)return e;const o=new Set(i),r=new Map;function u(y){if(!y)return 1;let I=r.get(y);if(I)return I;const V=y.parentNode;return I=e.has(V)?V:o.has(V)?1:u(V),r.set(y,I),I}return i.forEach(y=>{const I=u(y);1!==I&&e.get(I).push(y)}),e}function qh(t,i){t.classList?.add(i)}function wx(t,i){t.classList?.remove(i)}function Yte(t,i,e){bb(e).onDone(()=>t.processLeaveNode(i))}function c6(t,i){for(let e=0;eo.add(r)):i.set(t,n),e.delete(t),!0}class QS{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(i,e)=>{};constructor(i,e,n){this._driver=e,this._normalizer=n,this._transitionEngine=new Gte(i.body,e,n),this._timelineEngine=new Nte(i.body,e,n),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(i,e,n,o,r){const u=i+"-"+o;let y=this._triggerCache[u];if(!y){const I=[],q=iP(this._driver,r,I,[]);if(I.length)throw function Vee(){return new ct(3404,!1)}();y=function Ote(t,i,e){return new Pte(t,i,e)}(o,q,this._normalizer),this._triggerCache[u]=y}this._transitionEngine.registerTrigger(e,o,y)}register(i,e){this._transitionEngine.register(i,e)}destroy(i,e){this._transitionEngine.destroy(i,e)}onInsert(i,e,n,o){this._transitionEngine.insertNode(i,e,n,o)}onRemove(i,e,n){this._transitionEngine.removeNode(i,e,n)}disableAnimations(i,e){this._transitionEngine.markElementAsDisabled(i,e)}process(i,e,n,o){if("@"==n.charAt(0)){const[r,u]=UV(n);this._timelineEngine.command(r,e,u,o)}else this._transitionEngine.trigger(i,e,n,o)}listen(i,e,n,o,r){if("@"==n.charAt(0)){const[u,y]=UV(n);return this._timelineEngine.listen(u,e,y,r)}return this._transitionEngine.listen(i,e,n,o,r)}flush(i=-1){this._transitionEngine.flush(i)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(i){this._transitionEngine.afterFlushAnimationsDone(i)}}let Jte=(()=>{class t{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,n,o){this._element=e,this._startStyles=n,this._endStyles=o;let r=t.initialStylesByElement.get(e);r||t.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&Xm(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(Xm(this._element,this._initialStyles),this._endStyles&&(Xm(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(Nv(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Nv(this._element,this._endStyles),this._endStyles=null),Xm(this._element,this._initialStyles),this._state=3)}}return t})();function pP(t){let i=null;return t.forEach((e,n)=>{(function ene(t){return"display"===t||"position"===t})(n)&&(i=i||new Map,i.set(n,e))}),i}class u6{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(i,e,n,o){this.element=i,this.keyframes=e,this.options=n,this._specialStyles=o,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(i=>i()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const i=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,i,this.options),this._finalKeyframe=i.length?i[i.length-1]:new Map;const e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(i){const e=[];return i.forEach(n=>{e.push(Object.fromEntries(n))}),e}_triggerWebAnimation(i,e,n){return i.animate(this._convertKeyframesToObject(e),n)}onStart(i){this._originalOnStartFns.push(i),this._onStartFns.push(i)}onDone(i){this._originalOnDoneFns.push(i),this._onDoneFns.push(i)}onDestroy(i){this._onDestroyFns.push(i)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(i=>i()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(i=>i()),this._onDestroyFns=[])}setPosition(i){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=i*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const i=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,o)=>{"offset"!==o&&i.set(o,this._finished?n:QO(this.element,o))}),this.currentSnapshot=i}triggerCallback(i){const e="start"===i?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}}class h6{validateStyleProperty(i){return!0}validateAnimatableStyleProperty(i){return!0}containsElement(i,e){return jV(i,e)}getParentElement(i){return qO(i)}query(i,e,n){return $V(i,e,n)}computeStyle(i,e,n){return QO(i,e)}animate(i,e,n,o,r,u=[]){const I={duration:n,delay:o,fill:0==o?"both":"forwards"};r&&(I.easing=r);const V=new Map,q=u.filter(he=>he instanceof u6);(function cte(t,i){return 0===t||0===i})(n,o)&&q.forEach(he=>{he.currentSnapshot.forEach((Ce,je)=>V.set(je,Ce))});let ee=function ate(t){return t.length?t[0]instanceof Map?t:t.map(i=>new Map(Object.entries(i))):[]}(e).map(he=>new Map(he));ee=function dte(t,i,e){if(e.size&&i.length){let n=i[0],o=[];if(e.forEach((r,u)=>{n.has(u)||o.push(u),n.set(u,r)}),o.length)for(let r=1;ru.set(y,QO(t,y)))}}return i}(i,ee,V);const me=function Qte(t,i){let e=null,n=null;return Array.isArray(i)&&i.length?(e=pP(i[0]),i.length>1&&(n=pP(i[i.length-1]))):i instanceof Map&&(e=pP(i)),e||n?new Jte(t,e,n):null}(i,ee);return new u6(i,ee,I,me)}}const p6="@.disabled";class m6{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(i,e,n,o){this.namespaceId=i,this.delegate=e,this.engine=n,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(i){this.delegate.destroyNode?.(i)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(i,e){return this.delegate.createElement(i,e)}createComment(i){return this.delegate.createComment(i)}createText(i){return this.delegate.createText(i)}appendChild(i,e){this.delegate.appendChild(i,e),this.engine.onInsert(this.namespaceId,e,i,!1)}insertBefore(i,e,n,o=!0){this.delegate.insertBefore(i,e,n),this.engine.onInsert(this.namespaceId,e,i,o)}removeChild(i,e,n){this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(i,e){return this.delegate.selectRootElement(i,e)}parentNode(i){return this.delegate.parentNode(i)}nextSibling(i){return this.delegate.nextSibling(i)}setAttribute(i,e,n,o){this.delegate.setAttribute(i,e,n,o)}removeAttribute(i,e,n){this.delegate.removeAttribute(i,e,n)}addClass(i,e){this.delegate.addClass(i,e)}removeClass(i,e){this.delegate.removeClass(i,e)}setStyle(i,e,n,o){this.delegate.setStyle(i,e,n,o)}removeStyle(i,e,n){this.delegate.removeStyle(i,e,n)}setProperty(i,e,n){"@"==e.charAt(0)&&e==p6?this.disableAnimations(i,!!n):this.delegate.setProperty(i,e,n)}setValue(i,e){this.delegate.setValue(i,e)}listen(i,e,n,o){return this.delegate.listen(i,e,n,o)}disableAnimations(i,e){this.engine.disableAnimations(i,e)}}class tne extends m6{factory;constructor(i,e,n,o,r){super(e,n,o,r),this.factory=i,this.namespaceId=e}setProperty(i,e,n){"@"==e.charAt(0)?"."==e.charAt(1)&&e==p6?this.disableAnimations(i,n=void 0===n||!!n):this.engine.process(this.namespaceId,i,e.slice(1),n):this.delegate.setProperty(i,e,n)}listen(i,e,n,o){if("@"==e.charAt(0)){const r=function nne(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}(i);let u=e.slice(1),y="";return"@"!=u.charAt(0)&&([u,y]=function ine(t){const i=t.indexOf(".");return[t.substring(0,i),t.slice(i+1)]}(u)),this.engine.listen(this.namespaceId,r,u,y,I=>{this.factory.scheduleListenerCallback(I._data||-1,n,I)})}return this.delegate.listen(i,e,n,o)}}class one{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(i,e,n){this.delegate=i,this.engine=e,this._zone=n,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(i,e){const o=this.delegate.createRenderer(i,e);if(!i||!e?.data?.animation){const V=this._rendererCache;let q=V.get(o);return q||(q=new m6("",o,this.engine,()=>V.delete(o)),V.set(o,q)),q}const r=e.id,u=e.id+"-"+this._currentId;this._currentId++,this.engine.register(u,i);const y=V=>{Array.isArray(V)?V.forEach(y):this.engine.registerTrigger(r,u,i,V.name,V)};return e.data.animation.forEach(y),new tne(this,u,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(i,e,n){if(i>=0&&ie(n));const o=this._animationCallbacksBuffer;0==o.length&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{const[u,y]=r;u(y)}),this._animationCallbacksBuffer=[]})}),o.push([e,n])}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(i){this.engine.flush(),this.delegate.componentReplaced?.(i)}}const f6=[{provide:tP,useFactory:function ane(){return new YV}},{provide:QS,useClass:(()=>{class t extends QS{constructor(e,n,o){super(e,n,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||t)(xn(Oo),xn(eP),xn(tP))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})()},{provide:Qc,useFactory:function sne(t,i,e){return new one(t,i,e)},deps:[KR,QS,tn]}],_6=[{provide:eP,useClass:JO},{provide:Kr,useValue:"NoopAnimations"},...f6],mP=[{provide:eP,useFactory:()=>new h6},{provide:Kr,useFactory:()=>"BrowserAnimations"},...f6];let g6=(()=>{class t{static withConfig(e){return{ngModule:t,providers:e.disableAnimations?_6:mP}}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:mP,imports:[oB]})}return t})(),lne=(()=>{class t{static \u0275prov=Nt({token:t,providedIn:"root",factory:()=>new cne(Y(Oo),window)})}return t})();class cne{document;window;offset=()=>[0,0];constructor(i,e){this.document=i,this.window=e}setOffset(i){this.offset=Array.isArray(i)?()=>i:i}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(i){this.window.scrollTo(i[0],i[1])}scrollToAnchor(i){const e=function dne(t,i){const e=t.getElementById(i)||t.getElementsByName(i)[0];if(e)return e;if("function"==typeof t.createTreeWalker&&t.body&&"function"==typeof t.body.attachShadow){const n=t.createTreeWalker(t.body,NodeFilter.SHOW_ELEMENT);let o=n.currentNode;for(;o;){const r=o.shadowRoot;if(r){const u=r.getElementById(i)||r.querySelector(`[name="${i}"]`);if(u)return u}o=n.nextNode()}}return null}(this.document,i);e&&(this.scrollToElement(e),e.focus())}setHistoryScrollRestoration(i){this.window.history.scrollRestoration=i}scrollToElement(i){const e=i.getBoundingClientRect(),n=e.left+this.window.pageXOffset,o=e.top+this.window.pageYOffset,r=this.offset();this.window.scrollTo(n-r[0],o-r[1])}}function nT(t){return!!t&&(t instanceof se||an(t.lift)&&an(t.subscribe))}function Bv(...t){const i=NS(t),e=yB(t),{args:n,keys:o}=jB(t);if(0===n.length)return Ol([],i);const r=new se(function zne(t,i,e=za){return n=>{E6(i,()=>{const{length:o}=t,r=new Array(o);let u=o,y=o;for(let I=0;I{const V=Ol(t[I],i);let q=!1;V.subscribe(St(n,ee=>{r[I]=ee,q||(q=!0,y--),y||n.next(e(r.slice()))},()=>{--u||n.complete()}))},n)},n)}}(n,i,o?u=>$B(o,u):za));return e?r.pipe(mO(e)):r}function E6(t,i,e){t?y_(e,t,i):i()}const Cx=vo(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Sx(t=1/0){return dc(za,t)}function iT(...t){return function Bne(){return Sx(1)}()(Ol(t,NS(t)))}function Tx(t){return new se(i=>{td(t()).subscribe(i)})}function Dx(t,i){const e=an(t)?t:()=>t,n=o=>o.error(e());return new se(i?o=>i.schedule(n,0,o):n)}const Dc=new se(t=>t.complete());function bP(){return ot((t,i)=>{let e=null;t._refCount++;const n=St(i,void 0,void 0,void 0,()=>{if(!t||t._refCount<=0||0<--t._refCount)return void(e=null);const o=t._connection,r=e;e=null,o&&(!r||o===r)&&o.unsubscribe(),i.unsubscribe()});t.subscribe(n),n.closed||(e=t.connect())})}class yP extends se{constructor(i,e){super(),this.source=i,this.subjectFactory=e,this._subject=null,this._refCount=0,this._connection=null,dt(i)&&(this.lift=i.lift)}_subscribe(i){return this.getSubject().subscribe(i)}getSubject(){const i=this._subject;return(!i||i.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:i}=this;this._subject=this._connection=null,i?.unsubscribe()}connect(){let i=this._connection;if(!i){i=this._connection=new ai;const e=this.getSubject();i.add(this.source.subscribe(St(e,void 0,()=>{this._teardown(),e.complete()},n=>{this._teardown(),e.error(n)},()=>this._teardown()))),i.closed&&(this._connection=null,i=ai.EMPTY)}return i}refCount(){return bP()(this)}}function $a(t){return t<=0?()=>Dc:ot((i,e)=>{let n=0;i.subscribe(St(e,o=>{++n<=t&&(e.next(o),t<=n&&e.complete())}))})}function ua(...t){const i=NS(t);return ot((e,n)=>{(i?iT(t,e,i):iT(t,e)).subscribe(n)})}function fE(t){return ot((i,e)=>{let n=!1;i.subscribe(St(e,o=>{n=!0,e.next(o)},()=>{n||e.next(t),e.complete()}))})}function M6(t=Une){return ot((i,e)=>{let n=!1;i.subscribe(St(e,o=>{n=!0,e.next(o)},()=>n?e.complete():e.error(t())))})}function Une(){return new Cx}function Vv(t,i){const e=arguments.length>=2;return n=>n.pipe(t?or((o,r)=>t(o,r,n)):za,$a(1),e?fE(i):M6(()=>new Cx))}function ks(t,i,e){const n=an(t)||i||e?{next:t,error:i,complete:e}:t;return n?ot((o,r)=>{var u;null===(u=n.subscribe)||void 0===u||u.call(n);let y=!0;o.subscribe(St(r,I=>{var V;null===(V=n.next)||void 0===V||V.call(n,I),r.next(I)},()=>{var I;y=!1,null===(I=n.complete)||void 0===I||I.call(n),r.complete()},I=>{var V;y=!1,null===(V=n.error)||void 0===V||V.call(n,I),r.error(I)},()=>{var I,V;y&&(null===(I=n.unsubscribe)||void 0===I||I.call(n)),null===(V=n.finalize)||void 0===V||V.call(n)}))}):za}function Wh(t){return ot((i,e)=>{let r,n=null,o=!1;n=i.subscribe(St(e,void 0,void 0,u=>{r=td(t(u,Wh(t)(i))),n?(n.unsubscribe(),n=null,r.subscribe(e)):o=!0})),o&&(n.unsubscribe(),n=null,r.subscribe(e))})}function vP(t){return t<=0?()=>Dc:ot((i,e)=>{let n=[];i.subscribe(St(e,o=>{n.push(o),t{for(const o of n)e.next(o);e.complete()},void 0,()=>{n=null}))})}function ro(t){return ot((i,e)=>{td(t).subscribe(St(e,()=>e.complete(),Pc)),!e.closed&&i.subscribe(e)})}let Gne=(()=>{class t{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||t)(xn(Oo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),_E=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:function(n){let o=null;return o=n?new(n||t):xn(Yne),o},providedIn:"root"})}return t})(),Yne=(()=>{class t extends _E{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(null==n)return null;switch(e){case El.NONE:return n;case El.HTML:return Fh(n,"HTML")?Xc(n):vC(this._doc,String(n)).toString();case El.STYLE:return Fh(n,"Style")?Xc(n):n;case El.SCRIPT:if(Fh(n,"Script"))return Xc(n);throw new ct(5200,!1);case El.URL:return Fh(n,"URL")?Xc(n):h1(String(n));case El.RESOURCE_URL:if(Fh(n,"ResourceURL"))return Xc(n);throw new ct(5201,!1);default:throw new ct(5202,!1)}}bypassSecurityTrustHtml(e){return function FA(t){return new d1(t)}(e)}bypassSecurityTrustStyle(e){return function qy(t){return new cC(t)}(e)}bypassSecurityTrustScript(e){return function Wy(t){return new LA(t)}(e)}bypassSecurityTrustUrl(e){return function Zy(t){return new WD(t)}(e)}bypassSecurityTrustResourceUrl(e){return function Yy(t){return new Gy(t)}(e)}static \u0275fac=function(n){return new(n||t)(xn(Oo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const Qo="primary",rT=Symbol("RouteTitle");class Xne{params;constructor(i){this.params=i||{}}has(i){return Object.prototype.hasOwnProperty.call(this.params,i)}get(i){if(this.has(i)){const e=this.params[i];return Array.isArray(e)?e[0]:e}return null}getAll(i){if(this.has(i)){const e=this.params[i];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function Ix(t){return new Xne(t)}function Kne(t,i,e){const n=e.path.split("/");if(n.length>t.length||"full"===e.pathMatch&&(i.hasChildren()||n.lengthn[r]===o)}return t===i}function O6(t){return t.length>0?t[t.length-1]:null}function vb(t){return nT(t)?t:gS(t)?Ol(Promise.resolve(t)):xi(t)}const Jne={exact:function F6(t,i,e){if(!Hv(t.segments,i.segments)||!gE(t.segments,i.segments,e)||t.numberOfChildren!==i.numberOfChildren)return!1;for(const n in i.children)if(!t.children[n]||!F6(t.children[n],i.children[n],e))return!1;return!0},subset:N6},P6={exact:function eie(t,i){return Km(t,i)},subset:function tie(t,i){return Object.keys(i).length<=Object.keys(t).length&&Object.keys(i).every(e=>R6(t[e],i[e]))},ignored:()=>!0};function L6(t,i,e){return Jne[e.paths](t.root,i.root,e.matrixParams)&&P6[e.queryParams](t.queryParams,i.queryParams)&&!("exact"===e.fragment&&t.fragment!==i.fragment)}function N6(t,i,e){return z6(t,i,i.segments,e)}function z6(t,i,e,n){if(t.segments.length>e.length){const o=t.segments.slice(0,e.length);return!(!Hv(o,e)||i.hasChildren()||!gE(o,e,n))}if(t.segments.length===e.length){if(!Hv(t.segments,e)||!gE(t.segments,e,n))return!1;for(const o in i.children)if(!t.children[o]||!N6(t.children[o],i.children[o],n))return!1;return!0}{const o=e.slice(0,t.segments.length),r=e.slice(t.segments.length);return!!(Hv(t.segments,o)&&gE(t.segments,o,n)&&t.children[Qo])&&z6(t.children[Qo],i,r,n)}}function gE(t,i,e){return i.every((n,o)=>P6[e](t[o].parameters,n.parameters))}class Uv{root;queryParams;fragment;_queryParamMap;constructor(i=new ya([],{}),e={},n=null){this.root=i,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap??=Ix(this.queryParams),this._queryParamMap}toString(){return oie.serialize(this)}}class ya{segments;children;parent=null;constructor(i,e){this.segments=i,this.children=e,Object.values(e).forEach(n=>n.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return yE(this)}}class aT{path;parameters;_parameterMap;constructor(i,e){this.path=i,this.parameters=e}get parameterMap(){return this._parameterMap??=Ix(this.parameters),this._parameterMap}toString(){return U6(this)}}function Hv(t,i){return t.length===i.length&&t.every((e,n)=>e.path===i[n].path)}let sT=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>new bE,providedIn:"root"})}return t})();class bE{parse(i){const e=new fie(i);return new Uv(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(i){const e=`/${lT(i.root,!0)}`,n=function sie(t){const i=Object.entries(t).map(([e,n])=>Array.isArray(n)?n.map(o=>`${vE(e)}=${vE(o)}`).join("&"):`${vE(e)}=${vE(n)}`).filter(e=>e);return i.length?`?${i.join("&")}`:""}(i.queryParams);return`${e}${n}${"string"==typeof i.fragment?`#${function rie(t){return encodeURI(t)}(i.fragment)}`:""}`}}const oie=new bE;function yE(t){return t.segments.map(i=>U6(i)).join("/")}function lT(t,i){if(!t.hasChildren())return yE(t);if(i){const e=t.children[Qo]?lT(t.children[Qo],!1):"",n=[];return Object.entries(t.children).forEach(([o,r])=>{o!==Qo&&n.push(`${o}:${lT(r,!1)}`)}),n.length>0?`${e}(${n.join("//")})`:e}{const e=function iie(t,i){let e=[];return Object.entries(t.children).forEach(([n,o])=>{n===Qo&&(e=e.concat(i(o,n)))}),Object.entries(t.children).forEach(([n,o])=>{n!==Qo&&(e=e.concat(i(o,n)))}),e}(t,(n,o)=>o===Qo?[lT(t.children[Qo],!1)]:[`${o}:${lT(n,!1)}`]);return 1===Object.keys(t.children).length&&null!=t.children[Qo]?`${yE(t)}/${e[0]}`:`${yE(t)}/(${e.join("//")})`}}function B6(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function vE(t){return B6(t).replace(/%3B/gi,";")}function wP(t){return B6(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function xE(t){return decodeURIComponent(t)}function V6(t){return xE(t.replace(/\+/g,"%20"))}function U6(t){return`${wP(t.path)}${function aie(t){return Object.entries(t).map(([i,e])=>`;${wP(i)}=${wP(e)}`).join("")}(t.parameters)}`}const lie=/^[^\/()?;#]+/;function CP(t){const i=t.match(lie);return i?i[0]:""}const cie=/^[^\/()?;=#]+/,uie=/^[^=?&#]+/,pie=/^[^&#]+/;class fie{url;remaining;constructor(i){this.url=i,this.remaining=i}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new ya([],{}):new ya([],this.parseChildren())}parseQueryParams(){const i={};if(this.consumeOptional("?"))do{this.parseQueryParam(i)}while(this.consumeOptional("&"));return i}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const i=[];for(this.peekStartsWith("(")||i.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),i.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(i.length>0||Object.keys(e).length>0)&&(n[Qo]=new ya(i,e)),n}parseSegment(){const i=CP(this.remaining);if(""===i&&this.peekStartsWith(";"))throw new ct(4009,!1);return this.capture(i),new aT(xE(i),this.parseMatrixParams())}parseMatrixParams(){const i={};for(;this.consumeOptional(";");)this.parseParam(i);return i}parseParam(i){const e=function die(t){const i=t.match(cie);return i?i[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const o=CP(this.remaining);o&&(n=o,this.capture(n))}i[xE(e)]=xE(n)}parseQueryParam(i){const e=function hie(t){const i=t.match(uie);return i?i[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const u=function mie(t){const i=t.match(pie);return i?i[0]:""}(this.remaining);u&&(n=u,this.capture(n))}const o=V6(e),r=V6(n);if(i.hasOwnProperty(o)){let u=i[o];Array.isArray(u)||(u=[u],i[o]=u),u.push(r)}else i[o]=r}parseParens(i){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=CP(this.remaining),o=this.remaining[n.length];if("/"!==o&&")"!==o&&";"!==o)throw new ct(4010,!1);let r;n.indexOf(":")>-1?(r=n.slice(0,n.indexOf(":")),this.capture(r),this.capture(":")):i&&(r=Qo);const u=this.parseChildren();e[r]=1===Object.keys(u).length?u[Qo]:new ya([],u),this.consumeOptional("//")}return e}peekStartsWith(i){return this.remaining.startsWith(i)}consumeOptional(i){return!!this.peekStartsWith(i)&&(this.remaining=this.remaining.substring(i.length),!0)}capture(i){if(!this.consumeOptional(i))throw new ct(4011,!1)}}function H6(t){return t.segments.length>0?new ya([],{[Qo]:t}):t}function j6(t){const i={};for(const[n,o]of Object.entries(t.children)){const r=j6(o);if(n===Qo&&0===r.segments.length&&r.hasChildren())for(const[u,y]of Object.entries(r.children))i[u]=y;else(r.segments.length>0||r.hasChildren())&&(i[n]=r)}return function _ie(t){if(1===t.numberOfChildren&&t.children[Qo]){const i=t.children[Qo];return new ya(t.segments.concat(i.segments),i.children)}return t}(new ya(t.segments,i))}function jv(t){return t instanceof Uv}function $6(t){let i;const o=H6(function e(r){const u={};for(const I of r.children){const V=e(I);u[I.outlet]=V}const y=new ya(r.url,u);return r===t&&(i=y),y}(t.root));return i??o}function G6(t,i,e,n){let o=t;for(;o.parent;)o=o.parent;if(0===i.length)return SP(o,o,o,e,n);const r=function bie(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new W6(!0,0,t);let i=0,e=!1;const n=t.reduce((o,r,u)=>{if("object"==typeof r&&null!=r){if(r.outlets){const y={};return Object.entries(r.outlets).forEach(([I,V])=>{y[I]="string"==typeof V?V.split("/"):V}),[...o,{outlets:y}]}if(r.segmentPath)return[...o,r.segmentPath]}return"string"!=typeof r?[...o,r]:0===u?(r.split("/").forEach((y,I)=>{0==I&&"."===y||(0==I&&""===y?e=!0:".."===y?i++:""!=y&&o.push(y))}),o):[...o,r]},[]);return new W6(e,i,n)}(i);if(r.toRoot())return SP(o,o,new ya([],{}),e,n);const u=function yie(t,i,e){if(t.isAbsolute)return new CE(i,!0,0);if(!e)return new CE(i,!1,NaN);if(null===e.parent)return new CE(e,!0,0);const n=wE(t.commands[0])?0:1;return function vie(t,i,e){let n=t,o=i,r=e;for(;r>o;){if(r-=o,n=n.parent,!n)throw new ct(4005,!1);o=n.segments.length}return new CE(n,!1,o-r)}(e,e.segments.length-1+n,t.numberOfDoubleDots)}(r,o,t),y=u.processChildren?dT(u.segmentGroup,u.index,r.commands):Z6(u.segmentGroup,u.index,r.commands);return SP(o,u.segmentGroup,y,e,n)}function wE(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function cT(t){return"object"==typeof t&&null!=t&&t.outlets}function SP(t,i,e,n,o){let u,r={};n&&Object.entries(n).forEach(([I,V])=>{r[I]=Array.isArray(V)?V.map(q=>`${q}`):`${V}`}),u=t===i?e:q6(t,i,e);const y=H6(j6(u));return new Uv(y,r,o)}function q6(t,i,e){const n={};return Object.entries(t.children).forEach(([o,r])=>{n[o]=r===i?e:q6(r,i,e)}),new ya(t.segments,n)}class W6{isAbsolute;numberOfDoubleDots;commands;constructor(i,e,n){if(this.isAbsolute=i,this.numberOfDoubleDots=e,this.commands=n,i&&n.length>0&&wE(n[0]))throw new ct(4003,!1);const o=n.find(cT);if(o&&o!==O6(n))throw new ct(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class CE{segmentGroup;processChildren;index;constructor(i,e,n){this.segmentGroup=i,this.processChildren=e,this.index=n}}function Z6(t,i,e){if(t??=new ya([],{}),0===t.segments.length&&t.hasChildren())return dT(t,i,e);const n=function wie(t,i,e){let n=0,o=i;const r={match:!1,pathIndex:0,commandIndex:0};for(;o=e.length)return r;const u=t.segments[o],y=e[n];if(cT(y))break;const I=`${y}`,V=n0&&void 0===I)break;if(I&&V&&"object"==typeof V&&void 0===V.outlets){if(!X6(I,V,u))return r;n+=2}else{if(!X6(I,{},u))return r;n++}o++}return{match:!0,pathIndex:o,commandIndex:n}}(t,i,e),o=e.slice(n.commandIndex);if(n.match&&n.pathIndexr!==Qo)&&t.children[Qo]&&1===t.numberOfChildren&&0===t.children[Qo].segments.length){const r=dT(t.children[Qo],i,e);return new ya(t.segments,r.children)}return Object.entries(n).forEach(([r,u])=>{"string"==typeof u&&(u=[u]),null!==u&&(o[r]=Z6(t.children[r],i,u))}),Object.entries(t.children).forEach(([r,u])=>{void 0===n[r]&&(o[r]=u)}),new ya(t.segments,o)}}function TP(t,i,e){const n=t.segments.slice(0,i);let o=0;for(;o{"string"==typeof n&&(n=[n]),null!==n&&(i[e]=TP(new ya([],{}),0,n))}),i}function Y6(t){const i={};return Object.entries(t).forEach(([e,n])=>i[e]=`${n}`),i}function X6(t,i,e){return t==e.path&&Km(i,e.parameters)}const SE="imperative";var gr=function(t){return t[t.NavigationStart=0]="NavigationStart",t[t.NavigationEnd=1]="NavigationEnd",t[t.NavigationCancel=2]="NavigationCancel",t[t.NavigationError=3]="NavigationError",t[t.RoutesRecognized=4]="RoutesRecognized",t[t.ResolveStart=5]="ResolveStart",t[t.ResolveEnd=6]="ResolveEnd",t[t.GuardsCheckStart=7]="GuardsCheckStart",t[t.GuardsCheckEnd=8]="GuardsCheckEnd",t[t.RouteConfigLoadStart=9]="RouteConfigLoadStart",t[t.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",t[t.ChildActivationStart=11]="ChildActivationStart",t[t.ChildActivationEnd=12]="ChildActivationEnd",t[t.ActivationStart=13]="ActivationStart",t[t.ActivationEnd=14]="ActivationEnd",t[t.Scroll=15]="Scroll",t[t.NavigationSkipped=16]="NavigationSkipped",t}(gr||{});class Qm{id;url;constructor(i,e){this.id=i,this.url=e}}class TE extends Qm{type=gr.NavigationStart;navigationTrigger;restoredState;constructor(i,e,n="imperative",o=null){super(i,e),this.navigationTrigger=n,this.restoredState=o}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class w_ extends Qm{urlAfterRedirects;type=gr.NavigationEnd;constructor(i,e,n){super(i,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Ju=function(t){return t[t.Redirect=0]="Redirect",t[t.SupersededByNewNavigation=1]="SupersededByNewNavigation",t[t.NoDataFromResolver=2]="NoDataFromResolver",t[t.GuardRejected=3]="GuardRejected",t}(Ju||{}),DE=function(t){return t[t.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",t[t.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",t}(DE||{});class $v extends Qm{reason;code;type=gr.NavigationCancel;constructor(i,e,n,o){super(i,e),this.reason=n,this.code=o}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Ex extends Qm{reason;code;type=gr.NavigationSkipped;constructor(i,e,n,o){super(i,e),this.reason=n,this.code=o}}class DP extends Qm{error;target;type=gr.NavigationError;constructor(i,e,n,o){super(i,e),this.error=n,this.target=o}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class K6 extends Qm{urlAfterRedirects;state;type=gr.RoutesRecognized;constructor(i,e,n,o){super(i,e),this.urlAfterRedirects=n,this.state=o}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Sie extends Qm{urlAfterRedirects;state;type=gr.GuardsCheckStart;constructor(i,e,n,o){super(i,e),this.urlAfterRedirects=n,this.state=o}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Tie extends Qm{urlAfterRedirects;state;shouldActivate;type=gr.GuardsCheckEnd;constructor(i,e,n,o,r){super(i,e),this.urlAfterRedirects=n,this.state=o,this.shouldActivate=r}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Die extends Qm{urlAfterRedirects;state;type=gr.ResolveStart;constructor(i,e,n,o){super(i,e),this.urlAfterRedirects=n,this.state=o}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Iie extends Qm{urlAfterRedirects;state;type=gr.ResolveEnd;constructor(i,e,n,o){super(i,e),this.urlAfterRedirects=n,this.state=o}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Eie{route;type=gr.RouteConfigLoadStart;constructor(i){this.route=i}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class Mie{route;type=gr.RouteConfigLoadEnd;constructor(i){this.route=i}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Aie{snapshot;type=gr.ChildActivationStart;constructor(i){this.snapshot=i}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class kie{snapshot;type=gr.ChildActivationEnd;constructor(i){this.snapshot=i}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Rie{snapshot;type=gr.ActivationStart;constructor(i){this.snapshot=i}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Oie{snapshot;type=gr.ActivationEnd;constructor(i){this.snapshot=i}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Q6{routerEvent;position;anchor;type=gr.Scroll;constructor(i,e,n){this.routerEvent=i,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class IP{}class IE{url;navigationBehaviorOptions;constructor(i,e){this.url=i,this.navigationBehaviorOptions=e}}function Yp(t){return t.outlet||Qo}function uT(t){if(!t)return null;if(t.routeConfig?._injector)return t.routeConfig._injector;for(let i=t.parent;i;i=i.parent){const e=i.routeConfig;if(e?._loadedInjector)return e._loadedInjector;if(e?._injector)return e._injector}return null}class Bie{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return uT(this.route?.snapshot)??this.rootInjector}constructor(i){this.rootInjector=i,this.children=new hT(this.rootInjector)}}let hT=(()=>{class t{rootInjector;contexts=new Map;constructor(e){this.rootInjector=e}onChildOutletCreated(e,n){const o=this.getOrCreateContext(e);o.outlet=n,this.contexts.set(e,o)}onChildOutletDestroyed(e){const n=this.getContext(e);n&&(n.outlet=null,n.attachRef=null)}onOutletDeactivated(){const e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let n=this.getContext(e);return n||(n=new Bie(this.rootInjector),this.contexts.set(e,n)),n}getContext(e){return this.contexts.get(e)||null}static \u0275fac=function(n){return new(n||t)(xn(us))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();class J6{_root;constructor(i){this._root=i}get root(){return this._root.value}parent(i){const e=this.pathFromRoot(i);return e.length>1?e[e.length-2]:null}children(i){const e=EP(i,this._root);return e?e.children.map(n=>n.value):[]}firstChild(i){const e=EP(i,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(i){const e=MP(i,this._root);return e.length<2?[]:e[e.length-2].children.map(o=>o.value).filter(o=>o!==i)}pathFromRoot(i){return MP(i,this._root).map(e=>e.value)}}function EP(t,i){if(t===i.value)return i;for(const e of i.children){const n=EP(t,e);if(n)return n}return null}function MP(t,i){if(t===i.value)return[i];for(const e of i.children){const n=MP(t,e);if(n.length)return n.unshift(i),n}return[]}class Xp{value;children;constructor(i,e){this.value=i,this.children=e}toString(){return`TreeNode(${this.value})`}}function Mx(t){const i={};return t&&t.children.forEach(e=>i[e.value.outlet]=e),i}class eU extends J6{snapshot;constructor(i,e){super(i),this.snapshot=e,AP(this,i)}toString(){return this.snapshot.toString()}}function tU(t){const i=function Vie(t){const r=new ME([],{},{},"",{},Qo,t,null,{});return new nU("",new Xp(r,[]))}(t),e=new it([new aT("",{})]),n=new it({}),o=new it({}),r=new it({}),u=new it(""),y=new id(e,n,r,u,o,Qo,t,i.root);return y.snapshot=i.root,new eU(new Xp(y,[]),i)}class id{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(i,e,n,o,r,u,y,I){this.urlSubject=i,this.paramsSubject=e,this.queryParamsSubject=n,this.fragmentSubject=o,this.dataSubject=r,this.outlet=u,this.component=y,this._futureSnapshot=I,this.title=this.dataSubject?.pipe(kt(V=>V[rT]))??xi(void 0),this.url=i,this.params=e,this.queryParams=n,this.fragment=o,this.data=r}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(kt(i=>Ix(i))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(kt(i=>Ix(i))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function EE(t,i,e="emptyOnly"){let n;const{routeConfig:o}=t;return n=null===i||"always"!==e&&""!==o?.path&&(i.component||i.routeConfig?.loadComponent)?{params:{...t.params},data:{...t.data},resolve:{...t.data,...t._resolvedData??{}}}:{params:{...i.params,...t.params},data:{...i.data,...t.data},resolve:{...t.data,...i.data,...o?.data,...t._resolvedData}},o&&oU(o)&&(n.resolve[rT]=o.title),n}class ME{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[rT]}constructor(i,e,n,o,r,u,y,I,V){this.url=i,this.params=e,this.queryParams=n,this.fragment=o,this.data=r,this.outlet=u,this.component=y,this.routeConfig=I,this._resolve=V}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Ix(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Ix(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(n=>n.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class nU extends J6{url;constructor(i,e){super(e),this.url=i,AP(this,e)}toString(){return iU(this._root)}}function AP(t,i){i.value._routerState=t,i.children.forEach(e=>AP(t,e))}function iU(t){const i=t.children.length>0?` { ${t.children.map(iU).join(", ")} } `:"";return`${t.value}${i}`}function kP(t){if(t.snapshot){const i=t.snapshot,e=t._futureSnapshot;t.snapshot=e,Km(i.queryParams,e.queryParams)||t.queryParamsSubject.next(e.queryParams),i.fragment!==e.fragment&&t.fragmentSubject.next(e.fragment),Km(i.params,e.params)||t.paramsSubject.next(e.params),function Qne(t,i){if(t.length!==i.length)return!1;for(let e=0;eKm(e.parameters,i[n].parameters))}(t.url,i.url);return e&&!(!t.parent!=!i.parent)&&(!t.parent||RP(t.parent,i.parent))}function oU(t){return"string"==typeof t.title||null===t.title}const Uie=new yt("");let OP=(()=>{class t{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=Qo;activateEvents=new Tt;deactivateEvents=new Tt;attachEvents=new Tt;detachEvents=new Tt;routerOutletData=qc(void 0);parentContexts=Y(hT);location=Y(es);changeDetector=Y(So);inputBinder=Y(AE,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(e){if(e.name){const{firstChange:n,previousValue:o}=e.name;if(n)return;this.isTrackedInParentContexts(o)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(o)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(e){return this.parentContexts.getContext(e)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const e=this.parentContexts.getContext(this.name);e?.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new ct(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new ct(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new ct(4012,!1);this.location.detach();const e=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(e.instance),e}attach(e,n){this.activated=e,this._activatedRoute=n,this.location.insert(e.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(e.instance)}deactivate(){if(this.activated){const e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,n){if(this.isActivated)throw new ct(4013,!1);this._activatedRoute=e;const o=this.location,u=e.snapshot.component,y=this.parentContexts.getOrCreateContext(this.name).children,I=new Hie(e,y,o.injector,this.routerOutletData);this.activated=o.createComponent(u,{index:o.length,injector:I,environmentInjector:n}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[go]})}return t})();class Hie{route;childContexts;parent;outletData;constructor(i,e,n,o){this.route=i,this.childContexts=e,this.parent=n,this.outletData=o}get(i,e){return i===id?this.route:i===hT?this.childContexts:i===Uie?this.outletData:this.parent.get(i,e)}}const AE=new yt("");let rU=(()=>{class t{outletDataSubscriptions=new Map;bindActivatedRouteToOutletComponent(e){this.unsubscribeFromRouteData(e),this.subscribeToRouteData(e)}unsubscribeFromRouteData(e){this.outletDataSubscriptions.get(e)?.unsubscribe(),this.outletDataSubscriptions.delete(e)}subscribeToRouteData(e){const{activatedRoute:n}=e,o=Bv([n.queryParams,n.params,n.data]).pipe(Xs(([r,u,y],I)=>(y={...r,...u,...y},0===I?xi(y):Promise.resolve(y)))).subscribe(r=>{if(!e.isActivated||!e.activatedComponentRef||e.activatedRoute!==n||null===n.component)return void this.unsubscribeFromRouteData(e);const u=function hX(t){const i=co(t);if(!i)return null;const e=new hS(i);return{get selector(){return e.selector},get type(){return e.componentType},get inputs(){return e.inputs},get outputs(){return e.outputs},get ngContentSelectors(){return e.ngContentSelectors},get isStandalone(){return i.standalone},get isSignal(){return i.signals}}}(n.component);if(u)for(const{templateName:y}of u.inputs)e.activatedComponentRef.setInput(y,r[y]);else this.unsubscribeFromRouteData(e)});this.outletDataSubscriptions.set(e,o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),aU=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(n,o){1&n&&Re(0,"router-outlet")},dependencies:[OP],encapsulation:2})}return t})();function PP(t){const i=t.children&&t.children.map(PP),e=i?{...t,children:i}:{...t};return!e.component&&!e.loadComponent&&(i||e.loadChildren)&&e.outlet&&e.outlet!==Qo&&(e.component=aU),e}function pT(t,i,e){if(e&&t.shouldReuseRoute(i.value,e.value.snapshot)){const n=e.value;n._futureSnapshot=i.value;const o=function $ie(t,i,e){return i.children.map(n=>{for(const o of e.children)if(t.shouldReuseRoute(n.value,o.value.snapshot))return pT(t,n,o);return pT(t,n)})}(t,i,e);return new Xp(n,o)}{if(t.shouldAttach(i.value)){const r=t.retrieve(i.value);if(null!==r){const u=r.route;return u.value._futureSnapshot=i.value,u.children=i.children.map(y=>pT(t,y)),u}}const n=function Gie(t){return new id(new it(t.url),new it(t.params),new it(t.queryParams),new it(t.fragment),new it(t.data),t.outlet,t.component,t)}(i.value),o=i.children.map(r=>pT(t,r));return new Xp(n,o)}}class LP{redirectTo;navigationBehaviorOptions;constructor(i,e){this.redirectTo=i,this.navigationBehaviorOptions=e}}const sU="ngNavigationCancelingError";function kE(t,i){const{redirectTo:e,navigationBehaviorOptions:n}=jv(i)?{redirectTo:i,navigationBehaviorOptions:void 0}:i,o=lU(!1,Ju.Redirect);return o.url=e,o.navigationBehaviorOptions=n,o}function lU(t,i){const e=new Error(`NavigationCancelingError: ${t||""}`);return e[sU]=!0,e.cancellationCode=i,e}function cU(t){return!!t&&t[sU]}class Zie{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(i,e,n,o,r){this.routeReuseStrategy=i,this.futureState=e,this.currState=n,this.forwardEvent=o,this.inputBindingEnabled=r}activate(i){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,i),kP(this.futureState.root),this.activateChildRoutes(e,n,i)}deactivateChildRoutes(i,e,n){const o=Mx(e);i.children.forEach(r=>{const u=r.value.outlet;this.deactivateRoutes(r,o[u],n),delete o[u]}),Object.values(o).forEach(r=>{this.deactivateRouteAndItsChildren(r,n)})}deactivateRoutes(i,e,n){const o=i.value,r=e?e.value:null;if(o===r)if(o.component){const u=n.getContext(o.outlet);u&&this.deactivateChildRoutes(i,e,u.children)}else this.deactivateChildRoutes(i,e,n);else r&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(i,e){i.value.component&&this.routeReuseStrategy.shouldDetach(i.value.snapshot)?this.detachAndStoreRouteSubtree(i,e):this.deactivateRouteAndOutlet(i,e)}detachAndStoreRouteSubtree(i,e){const n=e.getContext(i.value.outlet),o=n&&i.value.component?n.children:e,r=Mx(i);for(const u of Object.values(r))this.deactivateRouteAndItsChildren(u,o);if(n&&n.outlet){const u=n.outlet.detach(),y=n.children.onOutletDeactivated();this.routeReuseStrategy.store(i.value.snapshot,{componentRef:u,route:i,contexts:y})}}deactivateRouteAndOutlet(i,e){const n=e.getContext(i.value.outlet),o=n&&i.value.component?n.children:e,r=Mx(i);for(const u of Object.values(r))this.deactivateRouteAndItsChildren(u,o);n&&(n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated()),n.attachRef=null,n.route=null)}activateChildRoutes(i,e,n){const o=Mx(e);i.children.forEach(r=>{this.activateRoutes(r,o[r.value.outlet],n),this.forwardEvent(new Oie(r.value.snapshot))}),i.children.length&&this.forwardEvent(new kie(i.value.snapshot))}activateRoutes(i,e,n){const o=i.value,r=e?e.value:null;if(kP(o),o===r)if(o.component){const u=n.getOrCreateContext(o.outlet);this.activateChildRoutes(i,e,u.children)}else this.activateChildRoutes(i,e,n);else if(o.component){const u=n.getOrCreateContext(o.outlet);if(this.routeReuseStrategy.shouldAttach(o.snapshot)){const y=this.routeReuseStrategy.retrieve(o.snapshot);this.routeReuseStrategy.store(o.snapshot,null),u.children.onOutletReAttached(y.contexts),u.attachRef=y.componentRef,u.route=y.route.value,u.outlet&&u.outlet.attach(y.componentRef,y.route.value),kP(y.route.value),this.activateChildRoutes(i,null,u.children)}else u.attachRef=null,u.route=o,u.outlet&&u.outlet.activateWith(o,u.injector),this.activateChildRoutes(i,null,u.children)}else this.activateChildRoutes(i,null,n)}}class dU{path;route;constructor(i){this.path=i,this.route=this.path[this.path.length-1]}}class RE{component;route;constructor(i,e){this.component=i,this.route=e}}function Yie(t,i,e){const n=t._root;return mT(n,i?i._root:null,e,[n.value])}function Ax(t,i){const e=Symbol(),n=i.get(t,e);return n===e?"function"!=typeof t||function Ss(t){return null!==hh(t)}(t)?i.get(t):t:n}function mT(t,i,e,n,o={canDeactivateChecks:[],canActivateChecks:[]}){const r=Mx(i);return t.children.forEach(u=>{(function Kie(t,i,e,n,o={canDeactivateChecks:[],canActivateChecks:[]}){const r=t.value,u=i?i.value:null,y=e?e.getContext(t.value.outlet):null;if(u&&r.routeConfig===u.routeConfig){const I=function Qie(t,i,e){if("function"==typeof e)return e(t,i);switch(e){case"pathParamsChange":return!Hv(t.url,i.url);case"pathParamsOrQueryParamsChange":return!Hv(t.url,i.url)||!Km(t.queryParams,i.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!RP(t,i)||!Km(t.queryParams,i.queryParams);default:return!RP(t,i)}}(u,r,r.routeConfig.runGuardsAndResolvers);I?o.canActivateChecks.push(new dU(n)):(r.data=u.data,r._resolvedData=u._resolvedData),mT(t,i,r.component?y?y.children:null:e,n,o),I&&y&&y.outlet&&y.outlet.isActivated&&o.canDeactivateChecks.push(new RE(y.outlet.component,u))}else u&&fT(i,y,o),o.canActivateChecks.push(new dU(n)),mT(t,null,r.component?y?y.children:null:e,n,o)})(u,r[u.value.outlet],e,n.concat([u.value]),o),delete r[u.value.outlet]}),Object.entries(r).forEach(([u,y])=>fT(y,e.getContext(u),o)),o}function fT(t,i,e){const n=Mx(t),o=t.value;Object.entries(n).forEach(([r,u])=>{fT(u,o.component?i?i.children.getContext(r):null:i,e)}),e.canDeactivateChecks.push(new RE(o.component&&i&&i.outlet&&i.outlet.isActivated?i.outlet.component:null,o))}function _T(t){return"function"==typeof t}function uU(t){return t instanceof Cx||"EmptyError"===t?.name}const OE=Symbol("INITIAL_VALUE");function kx(){return Xs(t=>Bv(t.map(i=>i.pipe($a(1),ua(OE)))).pipe(kt(i=>{for(const e of i)if(!0!==e){if(e===OE)return OE;if(!1===e||roe(e))return e}return!0}),or(i=>i!==OE),$a(1)))}function roe(t){return jv(t)||t instanceof LP}function hU(t){return function ft(...t){return re(t)}(ks(i=>{if("boolean"!=typeof i)throw kE(0,i)}),kt(i=>!0===i))}class FP{segmentGroup;constructor(i){this.segmentGroup=i||null}}class NP extends Error{urlTree;constructor(i){super(),this.urlTree=i}}function Rx(t){return Dx(new FP(t))}class boe{urlSerializer;urlTree;constructor(i,e){this.urlSerializer=i,this.urlTree=e}lineralizeSegments(i,e){let n=[],o=e.root;for(;;){if(n=n.concat(o.segments),0===o.numberOfChildren)return xi(n);if(o.numberOfChildren>1||!o.children[Qo])return Dx(new ct(4e3,!1));o=o.children[Qo]}}applyRedirectCommands(i,e,n,o,r){if("string"!=typeof e){const y=e,{queryParams:I,fragment:V,routeConfig:q,url:ee,outlet:me,params:he,data:Ce,title:je}=o,mt=fc(r,()=>y({params:he,data:Ce,queryParams:I,fragment:V,routeConfig:q,url:ee,outlet:me,title:je}));if(mt instanceof Uv)throw new NP(mt);e=mt}const u=this.applyRedirectCreateUrlTree(e,this.urlSerializer.parse(e),i,n);if("/"===e[0])throw new NP(u);return u}applyRedirectCreateUrlTree(i,e,n,o){const r=this.createSegmentGroup(i,e.root,n,o);return new Uv(r,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(i,e){const n={};return Object.entries(i).forEach(([o,r])=>{if("string"==typeof r&&":"===r[0]){const y=r.substring(1);n[o]=e[y]}else n[o]=r}),n}createSegmentGroup(i,e,n,o){const r=this.createSegments(i,e.segments,n,o);let u={};return Object.entries(e.children).forEach(([y,I])=>{u[y]=this.createSegmentGroup(i,I,n,o)}),new ya(r,u)}createSegments(i,e,n,o){return e.map(r=>":"===r.path[0]?this.findPosParam(i,r,o):this.findOrReturn(r,n))}findPosParam(i,e,n){const o=n[e.path.substring(1)];if(!o)throw new ct(4001,!1);return o}findOrReturn(i,e){let n=0;for(const o of e){if(o.path===i.path)return e.splice(n),o;n++}return i}}const zP={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function yoe(t,i,e,n,o){const r=pU(t,i,e);return r.matched?(n=function Pie(t,i){return t.providers&&!t._injector&&(t._injector=q2(t.providers,i,`Route: ${t.path}`)),t._injector??i}(i,n),function foe(t,i,e,n){const o=i.canMatch;return o&&0!==o.length?xi(o.map(u=>{const y=Ax(u,t);return vb(function ooe(t){return t&&_T(t.canMatch)}(y)?y.canMatch(i,e):fc(t,()=>y(i,e)))})).pipe(kx(),hU()):xi(!0)}(n,i,e).pipe(kt(u=>!0===u?r:{...zP}))):xi(r)}function pU(t,i,e){if("**"===i.path)return function voe(t){return{matched:!0,parameters:t.length>0?O6(t).parameters:{},consumedSegments:t,remainingSegments:[],positionalParamSegments:{}}}(e);if(""===i.path)return"full"===i.pathMatch&&(t.hasChildren()||e.length>0)?{...zP}:{matched:!0,consumedSegments:[],remainingSegments:e,parameters:{},positionalParamSegments:{}};const o=(i.matcher||Kne)(e,t,i);if(!o)return{...zP};const r={};Object.entries(o.posParams??{}).forEach(([y,I])=>{r[y]=I.path});const u=o.consumed.length>0?{...r,...o.consumed[o.consumed.length-1].parameters}:r;return{matched:!0,consumedSegments:o.consumed,remainingSegments:e.slice(o.consumed.length),parameters:u,positionalParamSegments:o.posParams??{}}}function mU(t,i,e,n){return e.length>0&&function Coe(t,i,e){return e.some(n=>PE(t,i,n)&&Yp(n)!==Qo)}(t,e,n)?{segmentGroup:new ya(i,woe(n,new ya(e,t.children))),slicedSegments:[]}:0===e.length&&function Soe(t,i,e){return e.some(n=>PE(t,i,n))}(t,e,n)?{segmentGroup:new ya(t.segments,xoe(t,e,n,t.children)),slicedSegments:e}:{segmentGroup:new ya(t.segments,t.children),slicedSegments:e}}function xoe(t,i,e,n){const o={};for(const r of e)if(PE(t,i,r)&&!n[Yp(r)]){const u=new ya([],{});o[Yp(r)]=u}return{...n,...o}}function woe(t,i){const e={};e[Qo]=i;for(const n of t)if(""===n.path&&Yp(n)!==Qo){const o=new ya([],{});e[Yp(n)]=o}return e}function PE(t,i,e){return(!(t.hasChildren()||i.length>0)||"full"!==e.pathMatch)&&""===e.path}class Doe{}class Moe{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(i,e,n,o,r,u,y){this.injector=i,this.configLoader=e,this.rootComponentType=n,this.config=o,this.urlTree=r,this.paramsInheritanceStrategy=u,this.urlSerializer=y,this.applyRedirects=new boe(this.urlSerializer,this.urlTree)}noMatchError(i){return new ct(4002,`'${i.segmentGroup}'`)}recognize(){const i=mU(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(i).pipe(kt(({children:e,rootSnapshot:n})=>{const o=new Xp(n,e),r=new nU("",o),u=function gie(t,i,e=null,n=null){return G6($6(t),i,e,n)}(n,[],this.urlTree.queryParams,this.urlTree.fragment);return u.queryParams=this.urlTree.queryParams,r.url=this.urlSerializer.serialize(u),{state:r,tree:u}}))}match(i){const e=new ME([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,Object.freeze({}),Qo,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,i,Qo,e).pipe(kt(n=>({children:n,rootSnapshot:e})),Wh(n=>{if(n instanceof NP)return this.urlTree=n.urlTree,this.match(n.urlTree.root);throw n instanceof FP?this.noMatchError(n):n}))}processSegmentGroup(i,e,n,o,r){return 0===n.segments.length&&n.hasChildren()?this.processChildren(i,e,n,r):this.processSegment(i,e,n,n.segments,o,!0,r).pipe(kt(u=>u instanceof Xp?[u]:[]))}processChildren(i,e,n,o){const r=[];for(const u of Object.keys(n.children))"primary"===u?r.unshift(u):r.push(u);return Ol(r).pipe(_x(u=>{const y=n.children[u],I=function zie(t,i){const e=t.filter(n=>Yp(n)===i);return e.push(...t.filter(n=>Yp(n)!==i)),e}(e,u);return this.processSegmentGroup(i,I,y,u,o)}),function jne(t,i){return ot(function Hne(t,i,e,n,o){return(r,u)=>{let y=e,I=i,V=0;r.subscribe(St(u,q=>{const ee=V++;I=y?t(I,q,ee):(y=!0,q),n&&u.next(I)},o&&(()=>{y&&u.next(I),u.complete()})))}}(t,i,arguments.length>=2,!0))}((u,y)=>(u.push(...y),u)),fE(null),function $ne(t,i){const e=arguments.length>=2;return n=>n.pipe(t?or((o,r)=>t(o,r,n)):za,vP(1),e?fE(i):M6(()=>new Cx))}(),dc(u=>{if(null===u)return Rx(n);const y=fU(u);return function Aoe(t){t.sort((i,e)=>i.value.outlet===Qo?-1:e.value.outlet===Qo?1:i.value.outlet.localeCompare(e.value.outlet))}(y),xi(y)}))}processSegment(i,e,n,o,r,u,y){return Ol(e).pipe(_x(I=>this.processSegmentAgainstRoute(I._injector??i,e,I,n,o,r,u,y).pipe(Wh(V=>{if(V instanceof FP)return xi(null);throw V}))),Vv(I=>!!I),Wh(I=>{if(uU(I))return function Toe(t,i,e){return 0===i.length&&!t.children[e]}(n,o,r)?xi(new Doe):Rx(n);throw I}))}processSegmentAgainstRoute(i,e,n,o,r,u,y,I){return Yp(n)===u||u!==Qo&&PE(o,r,n)?void 0===n.redirectTo?this.matchSegmentAgainstRoute(i,o,n,r,u,I):this.allowRedirects&&y?this.expandSegmentAgainstRouteUsingRedirect(i,o,e,n,r,u,I):Rx(o):Rx(o)}expandSegmentAgainstRouteUsingRedirect(i,e,n,o,r,u,y){const{matched:I,parameters:V,consumedSegments:q,positionalParamSegments:ee,remainingSegments:me}=pU(e,o,r);if(!I)return Rx(e);"string"==typeof o.redirectTo&&"/"===o.redirectTo[0]&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const he=new ME(r,V,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_U(o),Yp(o),o.component??o._loadedComponent??null,o,gU(o)),Ce=EE(he,y,this.paramsInheritanceStrategy);he.params=Object.freeze(Ce.params),he.data=Object.freeze(Ce.data);const je=this.applyRedirects.applyRedirectCommands(q,o.redirectTo,ee,he,i);return this.applyRedirects.lineralizeSegments(o,je).pipe(dc(mt=>this.processSegment(i,n,e,mt.concat(me),u,!1,y)))}matchSegmentAgainstRoute(i,e,n,o,r,u){const y=yoe(e,n,o,i);return"**"===n.path&&(e.children={}),y.pipe(Xs(I=>I.matched?this.getChildConfig(i=n._injector??i,n,o).pipe(Xs(({routes:V})=>{const q=n._loadedInjector??i,{parameters:ee,consumedSegments:me,remainingSegments:he}=I,Ce=new ME(me,ee,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,_U(n),Yp(n),n.component??n._loadedComponent??null,n,gU(n)),je=EE(Ce,u,this.paramsInheritanceStrategy);Ce.params=Object.freeze(je.params),Ce.data=Object.freeze(je.data);const{segmentGroup:mt,slicedSegments:Lt}=mU(e,me,he,V);if(0===Lt.length&&mt.hasChildren())return this.processChildren(q,V,mt,Ce).pipe(kt(Mn=>new Xp(Ce,Mn)));if(0===V.length&&0===Lt.length)return xi(new Xp(Ce,[]));const At=Yp(n)===r;return this.processSegment(q,V,mt,Lt,At?Qo:r,!0,Ce).pipe(kt(Mn=>new Xp(Ce,Mn instanceof Xp?[Mn]:[])))})):Rx(e)))}getChildConfig(i,e,n){return e.children?xi({routes:e.children,injector:i}):e.loadChildren?void 0!==e._loadedRoutes?xi({routes:e._loadedRoutes,injector:e._loadedInjector}):function moe(t,i,e,n){const o=i.canLoad;return void 0===o||0===o.length?xi(!0):xi(o.map(u=>{const y=Ax(u,t);return vb(function eoe(t){return t&&_T(t.canLoad)}(y)?y.canLoad(i,e):fc(t,()=>y(i,e)))})).pipe(kx(),hU())}(i,e,n).pipe(dc(o=>o?this.configLoader.loadChildren(i,e).pipe(ks(r=>{e._loadedRoutes=r.routes,e._loadedInjector=r.injector})):function goe(){return Dx(lU(!1,Ju.GuardRejected))}())):xi({routes:[],injector:i})}}function koe(t){const i=t.value.routeConfig;return i&&""===i.path}function fU(t){const i=[],e=new Set;for(const n of t){if(!koe(n)){i.push(n);continue}const o=i.find(r=>n.value.routeConfig===r.value.routeConfig);void 0!==o?(o.children.push(...n.children),e.add(o)):i.push(n)}for(const n of e){const o=fU(n.children);i.push(new Xp(n.value,o))}return i.filter(n=>!e.has(n))}function _U(t){return t.data||{}}function gU(t){return t.resolve||{}}function bU(t){const i=t.children.map(e=>bU(e)).flat();return[t,...i]}function BP(t){return Xs(i=>{const e=t(i);return e?Ol(e).pipe(kt(()=>i)):xi(i)})}let yU=(()=>{class t{buildTitle(e){let n,o=e.root;for(;void 0!==o;)n=this.getResolvedTitleForRoute(o)??n,o=o.children.find(r=>r.outlet===Qo);return n}getResolvedTitleForRoute(e){return e.data[rT]}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(Noe),providedIn:"root"})}return t})(),Noe=(()=>{class t extends yU{title;constructor(e){super(),this.title=e}updateTitle(e){const n=this.buildTitle(e);void 0!==n&&this.title.setTitle(n)}static \u0275fac=function(n){return new(n||t)(xn(Gne))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const gT=new yt("",{providedIn:"root",factory:()=>({})}),LE=new yt("");let VP=(()=>{class t{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=Y(qZ);loadComponent(e){if(this.componentLoaders.get(e))return this.componentLoaders.get(e);if(e._loadedComponent)return xi(e._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(e);const n=vb(e.loadComponent()).pipe(kt(vU),ks(r=>{this.onLoadEndListener&&this.onLoadEndListener(e),e._loadedComponent=r}),$h(()=>{this.componentLoaders.delete(e)})),o=new yP(n,()=>new Ee).pipe(bP());return this.componentLoaders.set(e,o),o}loadChildren(e,n){if(this.childrenLoaders.get(n))return this.childrenLoaders.get(n);if(n._loadedRoutes)return xi({routes:n._loadedRoutes,injector:n._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(n);const r=function zoe(t,i,e,n){return vb(t.loadChildren()).pipe(kt(vU),dc(o=>o instanceof ZF||Array.isArray(o)?xi(o):Ol(i.compileModuleAsync(o))),kt(o=>{n&&n(t);let r,u,y=!1;return Array.isArray(o)?(u=o,!0):(r=o.create(e).injector,u=r.get(LE,[],{optional:!0,self:!0}).flat()),{routes:u.map(PP),injector:r}}))}(n,this.compiler,e,this.onLoadEndListener).pipe($h(()=>{this.childrenLoaders.delete(n)})),u=new yP(r,()=>new Ee).pipe(bP());return this.childrenLoaders.set(n,u),u}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function vU(t){return function Boe(t){return t&&"object"==typeof t&&"default"in t}(t)?t.default:t}let UP=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(Voe),providedIn:"root"})}return t})(),Voe=(()=>{class t{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,n){return e}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const xU=new yt(""),wU=new yt("");function Uoe(t,i,e){const n=t.get(wU),o=t.get(Oo);return t.get(tn).runOutsideAngular(()=>{if(!o.startViewTransition||n.skipNextTransition)return n.skipNextTransition=!1,new Promise(V=>setTimeout(V));let r;const u=new Promise(V=>{r=V}),y=o.startViewTransition(()=>(r(),function Hoe(t){return new Promise(i=>{As({read:()=>setTimeout(i)},{injector:t})})}(t))),{onViewTransitionCreated:I}=n;return I&&fc(t,()=>I({transition:y,from:i,to:e})),u})}const CU=new yt("");let HP=(()=>{class t{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new Ee;transitionAbortSubject=new Ee;configLoader=Y(VP);environmentInjector=Y(us);destroyRef=Y(Ut);urlSerializer=Y(sT);rootContexts=Y(hT);location=Y(mx);inputBindingEnabled=null!==Y(AE,{optional:!0});titleStrategy=Y(yU);options=Y(gT,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=Y(UP);createViewTransition=Y(xU,{optional:!0});navigationErrorHandler=Y(CU,{optional:!0});navigationId=0;get hasRequestedNavigation(){return 0!==this.navigationId}transitions;afterPreactivation=()=>xi(void 0);rootComponentType=null;destroyed=!1;constructor(){this.configLoader.onLoadEndListener=o=>this.events.next(new Mie(o)),this.configLoader.onLoadStartListener=o=>this.events.next(new Eie(o)),this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(e){const n=++this.navigationId;this.transitions?.next({...e,extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,id:n})}setupNavigations(e){return this.transitions=new it(null),this.transitions.pipe(or(n=>null!==n),Xs(n=>{let o=!1,r=!1;return xi(n).pipe(Xs(u=>{if(this.navigationId>n.id)return this.cancelNavigationTransition(n,"",Ju.SupersededByNewNavigation),Dc;this.currentTransition=n,this.currentNavigation={id:u.id,initialUrl:u.rawUrl,extractedUrl:u.extractedUrl,targetBrowserUrl:"string"==typeof u.extras.browserUrl?this.urlSerializer.parse(u.extras.browserUrl):u.extras.browserUrl,trigger:u.source,extras:u.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const y=!e.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!y&&"reload"!==(u.extras.onSameUrlNavigation??e.onSameUrlNavigation))return this.events.next(new Ex(u.id,this.urlSerializer.serialize(u.rawUrl),"",DE.IgnoredSameUrlNavigation)),u.resolve(!1),Dc;if(this.urlHandlingStrategy.shouldProcessUrl(u.rawUrl))return xi(u).pipe(Xs(V=>(this.events.next(new TE(V.id,this.urlSerializer.serialize(V.extractedUrl),V.source,V.restoredState)),V.id!==this.navigationId?Dc:Promise.resolve(V))),function Roe(t,i,e,n,o,r){return dc(u=>function Ioe(t,i,e,n,o,r,u="emptyOnly"){return new Moe(t,i,e,n,o,u,r).recognize()}(t,i,e,n,u.extractedUrl,o,r).pipe(kt(({state:y,tree:I})=>({...u,targetSnapshot:y,urlAfterRedirects:I}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,e.config,this.urlSerializer,this.paramsInheritanceStrategy),ks(V=>{n.targetSnapshot=V.targetSnapshot,n.urlAfterRedirects=V.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:V.urlAfterRedirects};const q=new K6(V.id,this.urlSerializer.serialize(V.extractedUrl),this.urlSerializer.serialize(V.urlAfterRedirects),V.targetSnapshot);this.events.next(q)}));if(y&&this.urlHandlingStrategy.shouldProcessUrl(u.currentRawUrl)){const{id:V,extractedUrl:q,source:ee,restoredState:me,extras:he}=u,Ce=new TE(V,this.urlSerializer.serialize(q),ee,me);this.events.next(Ce);const je=tU(this.rootComponentType).snapshot;return this.currentTransition=n={...u,targetSnapshot:je,urlAfterRedirects:q,extras:{...he,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=q,xi(n)}return this.events.next(new Ex(u.id,this.urlSerializer.serialize(u.extractedUrl),"",DE.IgnoredByUrlHandlingStrategy)),u.resolve(!1),Dc}),ks(u=>{const y=new Sie(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(y)}),kt(u=>(this.currentTransition=n={...u,guards:Yie(u.targetSnapshot,u.currentSnapshot,this.rootContexts)},n)),function aoe(t,i){return dc(e=>{const{targetSnapshot:n,currentSnapshot:o,guards:{canActivateChecks:r,canDeactivateChecks:u}}=e;return 0===u.length&&0===r.length?xi({...e,guardsResult:!0}):function soe(t,i,e,n){return Ol(t).pipe(dc(o=>function poe(t,i,e,n,o){const r=i&&i.routeConfig?i.routeConfig.canDeactivate:null;return r&&0!==r.length?xi(r.map(y=>{const I=uT(i)??o,V=Ax(y,I);return vb(function ioe(t){return t&&_T(t.canDeactivate)}(V)?V.canDeactivate(t,i,e,n):fc(I,()=>V(t,i,e,n))).pipe(Vv())})).pipe(kx()):xi(!0)}(o.component,o.route,e,i,n)),Vv(o=>!0!==o,!0))}(u,n,o,t).pipe(dc(y=>y&&function Jie(t){return"boolean"==typeof t}(y)?function loe(t,i,e,n){return Ol(i).pipe(_x(o=>iT(function doe(t,i){return null!==t&&i&&i(new Aie(t)),xi(!0)}(o.route.parent,n),function coe(t,i){return null!==t&&i&&i(new Rie(t)),xi(!0)}(o.route,n),function hoe(t,i,e){const n=i[i.length-1],r=i.slice(0,i.length-1).reverse().map(u=>function Xie(t){const i=t.routeConfig?t.routeConfig.canActivateChild:null;return i&&0!==i.length?{node:t,guards:i}:null}(u)).filter(u=>null!==u).map(u=>Tx(()=>xi(u.guards.map(I=>{const V=uT(u.node)??e,q=Ax(I,V);return vb(function noe(t){return t&&_T(t.canActivateChild)}(q)?q.canActivateChild(n,t):fc(V,()=>q(n,t))).pipe(Vv())})).pipe(kx())));return xi(r).pipe(kx())}(t,o.path,e),function uoe(t,i,e){const n=i.routeConfig?i.routeConfig.canActivate:null;if(!n||0===n.length)return xi(!0);const o=n.map(r=>Tx(()=>{const u=uT(i)??e,y=Ax(r,u);return vb(function toe(t){return t&&_T(t.canActivate)}(y)?y.canActivate(i,t):fc(u,()=>y(i,t))).pipe(Vv())}));return xi(o).pipe(kx())}(t,o.route,e))),Vv(o=>!0!==o,!0))}(n,r,t,i):xi(y)),kt(y=>({...e,guardsResult:y})))})}(this.environmentInjector,u=>this.events.next(u)),ks(u=>{if(n.guardsResult=u.guardsResult,u.guardsResult&&"boolean"!=typeof u.guardsResult)throw kE(0,u.guardsResult);const y=new Tie(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot,!!u.guardsResult);this.events.next(y)}),or(u=>!!u.guardsResult||(this.cancelNavigationTransition(u,"",Ju.GuardRejected),!1)),BP(u=>{if(0!==u.guards.canActivateChecks.length)return xi(u).pipe(ks(y=>{const I=new Die(y.id,this.urlSerializer.serialize(y.extractedUrl),this.urlSerializer.serialize(y.urlAfterRedirects),y.targetSnapshot);this.events.next(I)}),Xs(y=>{let I=!1;return xi(y).pipe(function Ooe(t,i){return dc(e=>{const{targetSnapshot:n,guards:{canActivateChecks:o}}=e;if(!o.length)return xi(e);const r=new Set(o.map(I=>I.route)),u=new Set;for(const I of r)if(!u.has(I))for(const V of bU(I))u.add(V);let y=0;return Ol(u).pipe(_x(I=>r.has(I)?function Poe(t,i,e,n){const o=t.routeConfig,r=t._resolve;return void 0!==o?.title&&!oU(o)&&(r[rT]=o.title),function Loe(t,i,e,n){const o=xP(t);if(0===o.length)return xi({});const r={};return Ol(o).pipe(dc(u=>function Foe(t,i,e,n){const o=uT(i)??n,r=Ax(t,o);return vb(r.resolve?r.resolve(i,e):fc(o,()=>r(i,e)))}(t[u],i,e,n).pipe(Vv(),ks(y=>{if(y instanceof LP)throw kE(new bE,y);r[u]=y}))),vP(1),kt(()=>r),Wh(u=>uU(u)?Dc:Dx(u)))}(r,t,i,n).pipe(kt(u=>(t._resolvedData=u,t.data=EE(t,t.parent,e).resolve,null)))}(I,n,t,i):(I.data=EE(I,I.parent,t).resolve,xi(void 0))),ks(()=>y++),vP(1),dc(I=>y===u.size?xi(e):Dc))})}(this.paramsInheritanceStrategy,this.environmentInjector),ks({next:()=>I=!0,complete:()=>{I||this.cancelNavigationTransition(y,"",Ju.NoDataFromResolver)}}))}),ks(y=>{const I=new Iie(y.id,this.urlSerializer.serialize(y.extractedUrl),this.urlSerializer.serialize(y.urlAfterRedirects),y.targetSnapshot);this.events.next(I)}))}),BP(u=>{const y=I=>{const V=[];I.routeConfig?.loadComponent&&!I.routeConfig._loadedComponent&&V.push(this.configLoader.loadComponent(I.routeConfig).pipe(ks(q=>{I.component=q}),kt(()=>{})));for(const q of I.children)V.push(...y(q));return V};return Bv(y(u.targetSnapshot.root)).pipe(fE(null),$a(1))}),BP(()=>this.afterPreactivation()),Xs(()=>{const{currentSnapshot:u,targetSnapshot:y}=n,I=this.createViewTransition?.(this.environmentInjector,u.root,y.root);return I?Ol(I).pipe(kt(()=>n)):xi(n)}),kt(u=>{const y=function jie(t,i,e){const n=pT(t,i._root,e?e._root:void 0);return new eU(n,i)}(e.routeReuseStrategy,u.targetSnapshot,u.currentRouterState);return this.currentTransition=n={...u,targetRouterState:y},this.currentNavigation.targetRouterState=y,n}),ks(()=>{this.events.next(new IP)}),((t,i,e,n)=>kt(o=>(new Zie(i,o.targetRouterState,o.currentRouterState,e,n).activate(t),o)))(this.rootContexts,e.routeReuseStrategy,u=>this.events.next(u),this.inputBindingEnabled),$a(1),ks({next:u=>{o=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new w_(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects))),this.titleStrategy?.updateTitle(u.targetRouterState.snapshot),u.resolve(!0)},complete:()=>{o=!0}}),ro(this.transitionAbortSubject.pipe(ks(u=>{throw u}))),$h(()=>{!o&&!r&&this.cancelNavigationTransition(n,"",Ju.SupersededByNewNavigation),this.currentTransition?.id===n.id&&(this.currentNavigation=null,this.currentTransition=null)}),Wh(u=>{if(this.destroyed)return n.resolve(!1),Dc;if(r=!0,cU(u))this.events.next(new $v(n.id,this.urlSerializer.serialize(n.extractedUrl),u.message,u.cancellationCode)),function qie(t){return cU(t)&&jv(t.url)}(u)?this.events.next(new IE(u.url,u.navigationBehaviorOptions)):n.resolve(!1);else{const y=new DP(n.id,this.urlSerializer.serialize(n.extractedUrl),u,n.targetSnapshot??void 0);try{const I=fc(this.environmentInjector,()=>this.navigationErrorHandler?.(y));if(!(I instanceof LP))throw this.events.next(y),u;{const{message:V,cancellationCode:q}=kE(0,I);this.events.next(new $v(n.id,this.urlSerializer.serialize(n.extractedUrl),V,q)),this.events.next(new IE(I.redirectTo,I.navigationBehaviorOptions))}}catch(I){this.options.resolveNavigationPromiseOnError?n.resolve(!1):n.reject(I)}}return Dc}))}))}cancelNavigationTransition(e,n,o){const r=new $v(e.id,this.urlSerializer.serialize(e.extractedUrl),n,o);this.events.next(r),e.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){const e=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),n=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return e.toString()!==n?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function joe(t){return t!==SE}let $oe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(qoe),providedIn:"root"})}return t})();class Goe{shouldDetach(i){return!1}store(i,e){}shouldAttach(i){return!1}retrieve(i){return null}shouldReuseRoute(i,e){return i.routeConfig===e.routeConfig}}let qoe=(()=>{class t extends Goe{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),SU=(()=>{class t{urlSerializer=Y(sT);options=Y(gT,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=Y(mx);urlHandlingStrategy=Y(UP);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new Uv;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:e,initialUrl:n,targetBrowserUrl:o}){const r=void 0!==e?this.urlHandlingStrategy.merge(e,n):n,u=o??r;return u instanceof Uv?this.urlSerializer.serialize(u):u}commitTransition({targetRouterState:e,finalUrl:n,initialUrl:o}){n&&e?(this.currentUrlTree=n,this.rawUrlTree=this.urlHandlingStrategy.merge(n,o),this.routerState=e):this.rawUrlTree=o}routerState=tU(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:e}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e??this.rawUrlTree)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:()=>Y(Woe),providedIn:"root"})}return t})(),Woe=(()=>{class t extends SU{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(e){return this.location.subscribe(n=>{"popstate"===n.type&&setTimeout(()=>{e(n.url,n.state,"popstate")})})}handleRouterEvent(e,n){e instanceof TE?this.updateStateMemento():e instanceof Ex?this.commitTransition(n):e instanceof K6?"eager"===this.urlUpdateStrategy&&(n.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(n),n)):e instanceof IP?(this.commitTransition(n),"deferred"===this.urlUpdateStrategy&&!n.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(n),n)):e instanceof $v&&(e.code===Ju.GuardRejected||e.code===Ju.NoDataFromResolver)?this.restoreHistory(n):e instanceof DP?this.restoreHistory(n,!0):e instanceof w_&&(this.lastSuccessfulId=e.id,this.currentPageId=this.browserPageId)}setBrowserUrl(e,{extras:n,id:o}){const{replaceUrl:r,state:u}=n;if(this.location.isCurrentPathEqualTo(e)||r){const y=this.browserPageId,I={...u,...this.generateNgRouterState(o,y)};this.location.replaceState(e,"",I)}else{const y={...u,...this.generateNgRouterState(o,this.browserPageId+1)};this.location.go(e,"",y)}}restoreHistory(e,n=!1){if("computed"===this.canceledNavigationResolution){const r=this.currentPageId-this.browserPageId;0!==r?this.location.historyGo(r):this.getCurrentUrlTree()===e.finalUrl&&0===r&&(this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(n&&this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(e,n){return"computed"===this.canceledNavigationResolution?{navigationId:e,\u0275routerPageId:n}:{navigationId:e}}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function TU(t,i){t.events.pipe(or(e=>e instanceof w_||e instanceof $v||e instanceof DP||e instanceof Ex),kt(e=>e instanceof w_||e instanceof Ex?0:e instanceof $v&&(e.code===Ju.Redirect||e.code===Ju.SupersededByNewNavigation)?2:1),or(e=>2!==e),$a(1)).subscribe(()=>{i()})}const Zoe={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},Yoe={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let Ga=(()=>{class t{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=Y(Hk);stateManager=Y(SU);options=Y(gT,{optional:!0})||{};pendingTasks=Y(en);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=Y(HP);urlSerializer=Y(sT);location=Y(mx);urlHandlingStrategy=Y(UP);_events=new Ee;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=Y($oe);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=Y(LE,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!Y(AE,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:e=>{this.console.warn(e)}}),this.subscribeToNavigationEvents()}eventsSubscription=new ai;subscribeToNavigationEvents(){const e=this.navigationTransitions.events.subscribe(n=>{try{const o=this.navigationTransitions.currentTransition,r=this.navigationTransitions.currentNavigation;if(null!==o&&null!==r)if(this.stateManager.handleRouterEvent(n,r),n instanceof $v&&n.code!==Ju.Redirect&&n.code!==Ju.SupersededByNewNavigation)this.navigated=!0;else if(n instanceof w_)this.navigated=!0;else if(n instanceof IE){const u=n.navigationBehaviorOptions,y=this.urlHandlingStrategy.merge(n.url,o.currentRawUrl),I={browserUrl:o.extras.browserUrl,info:o.extras.info,skipLocationChange:o.extras.skipLocationChange,replaceUrl:o.extras.replaceUrl||"eager"===this.urlUpdateStrategy||joe(o.source),...u};this.scheduleNavigation(y,SE,null,I,{resolve:o.resolve,reject:o.reject,promise:o.promise})}(function Koe(t){return!(t instanceof IP||t instanceof IE)})(n)&&this._events.next(n)}catch(o){this.navigationTransitions.transitionAbortSubject.next(o)}});this.eventsSubscription.add(e)}resetRootComponentType(e){this.routerState.root.component=e,this.navigationTransitions.rootComponentType=e}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),SE,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((e,n,o)=>{this.navigateToSyncWithBrowser(e,o,n)})}navigateToSyncWithBrowser(e,n,o){const r={replaceUrl:!0},u=o?.navigationId?o:null;if(o){const I={...o};delete I.navigationId,delete I.\u0275routerPageId,0!==Object.keys(I).length&&(r.state=I)}const y=this.parseUrl(e);this.scheduleNavigation(y,n,u,r)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(e){this.config=e.map(PP),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(e,n={}){const{relativeTo:o,queryParams:r,fragment:u,queryParamsHandling:y,preserveFragment:I}=n,V=I?this.currentUrlTree.fragment:u;let ee,q=null;switch(y??this.options.defaultQueryParamsHandling){case"merge":q={...this.currentUrlTree.queryParams,...r};break;case"preserve":q=this.currentUrlTree.queryParams;break;default:q=r||null}null!==q&&(q=this.removeEmptyProps(q));try{ee=$6(o?o.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof e[0]||"/"!==e[0][0])&&(e=[]),ee=this.currentUrlTree.root}return G6(ee,e,q,V??null)}navigateByUrl(e,n={skipLocationChange:!1}){const o=jv(e)?e:this.parseUrl(e),r=this.urlHandlingStrategy.merge(o,this.rawUrlTree);return this.scheduleNavigation(r,SE,null,n)}navigate(e,n={skipLocationChange:!1}){return function Xoe(t){for(let i=0;i(null!=r&&(n[o]=r),n),{})}scheduleNavigation(e,n,o,r,u){if(this.disposed)return Promise.resolve(!1);let y,I,V;u?(y=u.resolve,I=u.reject,V=u.promise):V=new Promise((ee,me)=>{y=ee,I=me});const q=this.pendingTasks.add();return TU(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(q))}),this.navigationTransitions.handleNavigationRequest({source:n,restoredState:o,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:e,extras:r,resolve:y,reject:I,promise:V,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),V.catch(ee=>Promise.reject(ee))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),xb=(()=>{class t{router;route;tabIndexAttribute;renderer;el;locationStrategy;href=null;target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new Ee;constructor(e,n,o,r,u,y){this.router=e,this.route=n,this.tabIndexAttribute=o,this.renderer=r,this.el=u,this.locationStrategy=y;const I=u.nativeElement.tagName?.toLowerCase();this.isAnchorElement="a"===I||"area"===I,this.isAnchorElement?this.subscription=e.events.subscribe(V=>{V instanceof w_&&this.updateHref()}):this.setTabIndexIfNotOnNativeEl("0")}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(e){null!=this.tabIndexAttribute||this.isAnchorElement||this.applyAttributeValue("tabindex",e)}ngOnChanges(e){this.isAnchorElement&&this.updateHref(),this.onChanges.next(this)}routerLinkInput=null;set routerLink(e){null==e?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(this.routerLinkInput=jv(e)||Array.isArray(e)?e:[e],this.setTabIndexIfNotOnNativeEl("0"))}onClick(e,n,o,r,u){const y=this.urlTree;return!!(null===y||this.isAnchorElement&&(0!==e||n||o||r||u||"string"==typeof this.target&&"_self"!=this.target))||(this.router.navigateByUrl(y,{skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info}),!this.isAnchorElement)}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){const e=this.urlTree;this.href=null!==e&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(e)):null;const n=null===this.href?null:function wC(t,i,e){return function x1(t,i){return"src"===i&&("embed"===t||"frame"===t||"iframe"===t||"media"===t||"script"===t)||"href"===i&&("base"===t||"link"===t)?b1:Jf}(i,e)(t)}(this.href,this.el.nativeElement.tagName.toLowerCase(),"href");this.applyAttributeValue("href",n)}applyAttributeValue(e,n){const o=this.renderer,r=this.el.nativeElement;null!==n?o.setAttribute(r,e,n):o.removeAttribute(r,e)}get urlTree(){return null===this.routerLinkInput?null:jv(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:void 0!==this.relativeTo?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(n){return new(n||t)($e(Ga),$e(id),G("tabindex"),$e(Hr),$e(Pn),$e(Mv))};static \u0275dir=Gt({type:t,selectors:[["","routerLink",""]],hostVars:1,hostBindings:function(n,o){1&n&&we("click",function(u){return o.onClick(u.button,u.ctrlKey,u.shiftKey,u.altKey,u.metaKey)}),2&n&&zn("target",o.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",fn],skipLocationChange:[2,"skipLocationChange","skipLocationChange",fn],replaceUrl:[2,"replaceUrl","replaceUrl",fn],routerLink:"routerLink"},features:[go]})}return t})();class DU{}let ere=(()=>{class t{preload(e,n){return n().pipe(Wh(()=>xi(null)))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),tre=(()=>{class t{router;injector;preloadingStrategy;loader;subscription;constructor(e,n,o,r){this.router=e,this.injector=n,this.preloadingStrategy=o,this.loader=r}setUpPreloading(){this.subscription=this.router.events.pipe(or(e=>e instanceof w_),_x(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,n){const o=[];for(const r of n){r.providers&&!r._injector&&(r._injector=q2(r.providers,e,`Route: ${r.path}`));const u=r._injector??e,y=r._loadedInjector??u;(r.loadChildren&&!r._loadedRoutes&&void 0===r.canLoad||r.loadComponent&&!r._loadedComponent)&&o.push(this.preloadConfig(u,r)),(r.children||r._loadedRoutes)&&o.push(this.processRoutes(y,r.children??r._loadedRoutes))}return Ol(o).pipe(Sx())}preloadConfig(e,n){return this.preloadingStrategy.preload(n,()=>{let o;o=n.loadChildren&&void 0===n.canLoad?this.loader.loadChildren(e,n):xi(null);const r=o.pipe(dc(u=>null===u?xi(void 0):(n._loadedRoutes=u.routes,n._loadedInjector=u.injector,this.processRoutes(u.injector??e,u.routes))));return n.loadComponent&&!n._loadedComponent?Ol([r,this.loader.loadComponent(n)]).pipe(Sx()):r})}static \u0275fac=function(n){return new(n||t)(xn(Ga),xn(us),xn(DU),xn(VP))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const jP=new yt("");let IU=(()=>{class t{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource="imperative";restoredId=0;store={};constructor(e,n,o,r,u={}){this.urlSerializer=e,this.transitions=n,this.viewportScroller=o,this.zone=r,this.options=u,u.scrollPositionRestoration||="disabled",u.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof TE?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof w_?(this.lastId=e.id,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.urlAfterRedirects).fragment)):e instanceof Ex&&e.code===DE.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof Q6&&(e.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(e.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,n){this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.zone.run(()=>{this.transitions.events.next(new Q6(e,"popstate"===this.lastSource?this.store[this.restoredId]:null,n))})},0)})}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(n){Up()};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();function Jm(t,i){return{\u0275kind:t,\u0275providers:i}}function MU(){const t=Y(Ke);return i=>{const e=t.get(Bd);if(i!==e.components[0])return;const n=t.get(Ga),o=t.get(AU);1===t.get($P)&&n.initialNavigation(),t.get(kU,null,To.Optional)?.setUpPreloading(),t.get(jP,null,To.Optional)?.init(),n.resetRootComponentType(e.componentTypes[0]),o.closed||(o.next(),o.complete(),o.unsubscribe())}}const AU=new yt("",{factory:()=>new Ee}),$P=new yt("",{providedIn:"root",factory:()=>1}),kU=new yt("");function rre(t){return Jm(0,[{provide:kU,useExisting:tre},{provide:DU,useExisting:t}])}function sre(t){return Zc("NgRouterViewTransitions"),Jm(9,[{provide:xU,useValue:Uoe},{provide:wU,useValue:{skipNextTransition:!!t?.skipInitialTransition,...t}}])}const lre=[mx,{provide:sT,useClass:bE},Ga,hT,{provide:id,useFactory:function EU(t){return t.routerState.root},deps:[Ga]},VP,[]];let RU=(()=>{class t{constructor(){}static forRoot(e,n){return{ngModule:t,providers:[lre,[],{provide:LE,multi:!0,useValue:e},[],n?.errorHandler?{provide:CU,useValue:n.errorHandler}:[],{provide:gT,useValue:n||{}},n?.useHash?{provide:Mv,useClass:xX}:{provide:Mv,useClass:y5},{provide:jP,useFactory:()=>{const t=Y(lne),i=Y(tn),e=Y(gT),n=Y(HP),o=Y(sT);return e.scrollOffset&&t.setOffset(e.scrollOffset),new IU(o,n,t,i,e)}},n?.preloadingStrategy?rre(n.preloadingStrategy).\u0275providers:[],n?.initialNavigation?hre(n):[],n?.bindToComponentInputs?Jm(8,[rU,{provide:AE,useExisting:rU}]).\u0275providers:[],n?.enableViewTransitions?sre().\u0275providers:[],[{provide:OU,useFactory:MU},{provide:bS,multi:!0,useExisting:OU}]]}}static forChild(e){return{ngModule:t,providers:[{provide:LE,multi:!0,useValue:e}]}}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();function hre(t){return["disabled"===t.initialNavigation?Jm(3,[wN(()=>{Y(Ga).setUpLocationChangeListener()}),{provide:$P,useValue:2}]).\u0275providers:[],"enabledBlocking"===t.initialNavigation?Jm(2,[{provide:$P,useValue:0},wN(()=>{const i=Y(Ke);return i.get(fX,Promise.resolve()).then(()=>new Promise(n=>{const o=i.get(Ga),r=i.get(AU);TU(o,()=>{n(!0)}),i.get(HP).afterPreactivation=()=>(n(!0),r.closed?xi(void 0):r),o.initialNavigation()}))})]).\u0275providers:[]]}const OU=new yt("");class mre extends ai{constructor(i,e){super()}schedule(i,e=0){return this}}const FE={setInterval(t,i,...e){const{delegate:n}=FE;return n?.setInterval?n.setInterval(t,i,...e):setInterval(t,i,...e)},clearInterval(t){const{delegate:i}=FE;return(i?.clearInterval||clearInterval)(t)},delegate:void 0};class GP extends mre{constructor(i,e){super(i,e),this.scheduler=i,this.work=e,this.pending=!1}schedule(i,e=0){var n;if(this.closed)return this;this.state=i;const o=this.id,r=this.scheduler;return null!=o&&(this.id=this.recycleAsyncId(r,o,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(r,this.id,e),this}requestAsyncId(i,e,n=0){return FE.setInterval(i.flush.bind(i,this),n)}recycleAsyncId(i,e,n=0){if(null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&FE.clearInterval(e)}execute(i,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(i,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(i,e){let o,n=!1;try{this.work(i)}catch(r){n=!0,o=r||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){const{id:i,scheduler:e}=this,{actions:n}=e;this.work=this.state=this.scheduler=null,this.pending=!1,Ho(n,this),null!=i&&(this.id=this.recycleAsyncId(e,i,null)),this.delay=null,super.unsubscribe()}}}const qP={now:()=>(qP.delegate||Date).now(),delegate:void 0};class bT{constructor(i,e=bT.now){this.schedulerActionCtor=i,this.now=e}schedule(i,e=0,n){return new this.schedulerActionCtor(this,i).schedule(n,e)}}bT.now=qP.now;class WP extends bT{constructor(i,e=bT.now){super(i,e),this.actions=[],this._active=!1}flush(i){const{actions:e}=this;if(this._active)return void e.push(i);let n;this._active=!0;do{if(n=i.execute(i.state,i.delay))break}while(i=e.shift());if(this._active=!1,n){for(;i=e.shift();)i.unsubscribe();throw n}}}const yT=new WP(GP),fre=yT;function wb(t=0,i,e=fre){let n=-1;return null!=i&&(bB(i)?e=i:n=i),new se(o=>{let r=function _re(t){return t instanceof Date&&!isNaN(t)}(t)?+t-e.now():t;r<0&&(r=0);let u=0;return e.schedule(function(){o.closed||(o.next(u++),0<=n?this.schedule(void 0,n):o.complete())},r)})}function ZP(t,i){const e="object"==typeof i;return new Promise((n,o)=>{const r=new fd({next:u=>{n(u),r.unsubscribe()},error:o,complete:()=>{e?n(i.defaultValue):o(new Cx)}});t.subscribe(r)})}function NE(t={}){const{connector:i=()=>new Ee,resetOnError:e=!0,resetOnComplete:n=!0,resetOnRefCountZero:o=!0}=t;return r=>{let u,y,I,V=0,q=!1,ee=!1;const me=()=>{y?.unsubscribe(),y=void 0},he=()=>{me(),u=I=void 0,q=ee=!1},Ce=()=>{const je=u;he(),je?.unsubscribe()};return ot((je,mt)=>{V++,!ee&&!q&&me();const Lt=I=I??i();mt.add(()=>{V--,0===V&&!ee&&!q&&(y=YP(Ce,o))}),Lt.subscribe(mt),!u&&V>0&&(u=new fd({next:At=>Lt.next(At),error:At=>{ee=!0,me(),y=YP(he,e,At),Lt.error(At)},complete:()=>{q=!0,me(),y=YP(he,n),Lt.complete()}}),td(je).subscribe(u))})(r)}}function YP(t,i,...e){if(!0===i)return void t();if(!1===i)return;const n=new fd({next:()=>{n.unsubscribe(),t()}});return td(i(...e)).subscribe(n)}class XP extends Ee{constructor(i=1/0,e=1/0,n=qP){super(),this._bufferSize=i,this._windowTime=e,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=e===1/0,this._bufferSize=Math.max(1,i),this._windowTime=Math.max(1,e)}next(i){const{isStopped:e,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:r,_windowTime:u}=this;e||(n.push(i),!o&&n.push(r.now()+u)),this._trimBuffer(),super.next(i)}_subscribe(i){this._throwIfClosed(),this._trimBuffer();const e=this._innerSubscribe(i),{_infiniteTimeWindow:n,_buffer:o}=this,r=o.slice();for(let u=0;unew XP(n,i,e),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}class QP{_attachedHost;attach(i){return this._attachedHost=i,i.attach(this)}detach(){let i=this._attachedHost;null!=i&&(this._attachedHost=null,i.detach())}get isAttached(){return null!=this._attachedHost}setAttachedHost(i){this._attachedHost=i}}class Cb extends QP{component;viewContainerRef;injector;componentFactoryResolver;projectableNodes;constructor(i,e,n,o,r){super(),this.component=i,this.viewContainerRef=e,this.injector=n,this.projectableNodes=r}}class C_ extends QP{templateRef;viewContainerRef;context;injector;constructor(i,e,n,o){super(),this.templateRef=i,this.viewContainerRef=e,this.context=n,this.injector=o}get origin(){return this.templateRef.elementRef}attach(i,e=this.context){return this.context=e,super.attach(i)}detach(){return this.context=void 0,super.detach()}}class gre extends QP{element;constructor(i){super(),this.element=i instanceof Pn?i.nativeElement:i}}class zE{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(i){return i instanceof Cb?(this._attachedPortal=i,this.attachComponentPortal(i)):i instanceof C_?(this._attachedPortal=i,this.attachTemplatePortal(i)):this.attachDomPortal&&i instanceof gre?(this._attachedPortal=i,this.attachDomPortal(i)):void 0}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(i){this._disposeFn=i}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}}class bre extends zE{outletElement;_appRef;_defaultInjector;_document;constructor(i,e,n,o,r){super(),this.outletElement=i,this._appRef=n,this._defaultInjector=o,this._document=r}attachComponentPortal(i){let e;if(i.viewContainerRef){const n=i.injector||i.viewContainerRef.injector,o=n.get(m_,null,{optional:!0})||void 0;e=i.viewContainerRef.createComponent(i.component,{index:i.viewContainerRef.length,injector:n,ngModuleRef:o,projectableNodes:i.projectableNodes||void 0}),this.setDisposeFn(()=>e.destroy())}else{const n=this._appRef,o=i.injector||this._defaultInjector||Ke.NULL,r=o.get(us,n.injector);e=f5(i.component,{elementInjector:o,environmentInjector:r,projectableNodes:i.projectableNodes||void 0}),n.attachView(e.hostView),this.setDisposeFn(()=>{n.viewCount>0&&n.detachView(e.hostView),e.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(e)),this._attachedPortal=i,e}attachTemplatePortal(i){let e=i.viewContainerRef,n=e.createEmbeddedView(i.templateRef,i.context,{injector:i.injector});return n.rootNodes.forEach(o=>this.outletElement.appendChild(o)),n.detectChanges(),this.setDisposeFn(()=>{let o=e.indexOf(n);-1!==o&&e.remove(o)}),this._attachedPortal=i,n}attachDomPortal=i=>{const e=i.element,n=this._document.createComment("dom-portal");e.parentNode.insertBefore(n,e),this.outletElement.appendChild(e),this._attachedPortal=i,super.setDisposeFn(()=>{n.parentNode&&n.parentNode.replaceChild(e,n)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(i){return i.hostView.rootNodes[0]}}let JP,yre=(()=>{class t extends C_{constructor(){super(Y(sa),Y(es))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkPortal",""]],exportAs:["cdkPortal"],features:[qn]})}return t})(),ef=(()=>{class t extends zE{_moduleRef=Y(m_,{optional:!0});_document=Y(Oo);_viewContainerRef=Y(es);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}attached=new Tt;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);const n=null!=e.viewContainerRef?e.viewContainerRef:this._viewContainerRef,o=n.createComponent(e.component,{index:n.length,injector:e.injector||n.injector,projectableNodes:e.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return n!==this._viewContainerRef&&this._getRootNode().appendChild(o.hostView.rootNodes[0]),super.setDisposeFn(()=>o.destroy()),this._attachedPortal=e,this._attachedRef=o,this.attached.emit(o),o}attachTemplatePortal(e){e.setAttachedHost(this);const n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}attachDomPortal=e=>{const n=e.element,o=this._document.createComment("dom-portal");e.setAttachedHost(this),n.parentNode.insertBefore(o,n),this._getRootNode().appendChild(n),this._attachedPortal=e,super.setDisposeFn(()=>{o.parentNode&&o.parentNode.replaceChild(n,o)})};_getRootNode(){const e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[qn]})}return t})(),Gv=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();try{JP=typeof Intl<"u"&&Intl.v8BreakIterator}catch{JP=!1}let e3,ea=(()=>{class t{_platformId=Y(xy);isBrowser=this._platformId?C5(this._platformId):"object"==typeof document&&!!document;EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent);TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent);BLINK=this.isBrowser&&!(!window.chrome&&!JP)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT;WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT;IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window);FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent);ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT;SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT;constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Sb(){let t=typeof document<"u"&&document?document.activeElement:null;for(;t&&t.shadowRoot;){const i=t.shadowRoot.activeElement;if(i===t)break;t=i}return t}function Kp(t){return t.composedPath?t.composedPath()[0]:t.target}const BE=new WeakMap;let Rs=(()=>{class t{_appRef;_injector=Y(Ke);_environmentInjector=Y(us);load(e){const n=this._appRef=this._appRef||this._injector.get(Bd);let o=BE.get(n);o||(o={loaders:new Set,refs:[]},BE.set(n,o),n.onDestroy(()=>{BE.get(n)?.refs.forEach(r=>r.destroy()),BE.delete(n)})),o.loaders.has(e)||(o.loaders.add(e),o.refs.push(f5(e,{environmentInjector:this._environmentInjector})))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),qv=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(n,o){},styles:[".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}\n"],encapsulation:2,changeDetection:0})}return t})();function t3(t){return or((i,e)=>t<=e)}function Tb(t,i=yT){return ot((e,n)=>{let o=null,r=null,u=null;const y=()=>{if(o){o.unsubscribe(),o=null;const V=r;r=null,n.next(V)}};function I(){const V=u+t,q=i.now();if(q{r=V,u=i.now(),o||(o=i.schedule(I,t),n.add(o))},()=>{y(),n.complete()},void 0,()=>{r=o=null}))})}function VE(t){return Array.isArray(t)?t:[t]}const PU=new Set;let Wv,wre=(()=>{class t{_platform=Y(ea);_nonce=Y(Rw,{optional:!0});_matchMedia;constructor(){this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):Sre}matchMedia(e){return(this._platform.WEBKIT||this._platform.BLINK)&&function Cre(t,i){if(!PU.has(t))try{Wv||(Wv=document.createElement("style"),i&&Wv.setAttribute("nonce",i),Wv.setAttribute("type","text/css"),document.head.appendChild(Wv)),Wv.sheet&&(Wv.sheet.insertRule(`@media ${t} {body{ }}`,0),PU.add(t))}catch(e){console.error(e)}}(e,this._nonce),this._matchMedia(e)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Sre(t){return{matches:"all"===t||""===t,media:t,addListener:()=>{},removeListener:()=>{}}}let UE=(()=>{class t{_mediaMatcher=Y(wre);_zone=Y(tn);_queries=new Map;_destroySubject=new Ee;constructor(){}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return LU(VE(e)).some(o=>this._registerQuery(o).mql.matches)}observe(e){let r=Bv(LU(VE(e)).map(u=>this._registerQuery(u).observable));return r=iT(r.pipe($a(1)),r.pipe(t3(1),Tb(0))),r.pipe(kt(u=>{const y={matches:!1,breakpoints:{}};return u.forEach(({matches:I,query:V})=>{y.matches=y.matches||I,y.breakpoints[V]=I}),y}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);const n=this._mediaMatcher.matchMedia(e),r={observable:new se(u=>{const y=I=>this._zone.run(()=>u.next(I));return n.addListener(y),()=>{n.removeListener(y)}}).pipe(ua(n),kt(({matches:u})=>({query:e,matches:u})),ro(this._destroySubject)),mql:n};return this._queries.set(e,r),r}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function LU(t){return t.map(i=>i.split(",")).reduce((i,e)=>i.concat(e)).map(i=>i.trim())}function Db(t,i=0){return FU(t)?Number(t):2===arguments.length?i:0}function FU(t){return!isNaN(parseFloat(t))&&!isNaN(Number(t))}function S_(t){return t instanceof Pn?t.nativeElement:t}let NU=(()=>{class t{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Dre=(()=>{class t{_mutationObserverFactory=Y(NU);_observedElements=new Map;_ngZone=Y(tn);constructor(){}ngOnDestroy(){this._observedElements.forEach((e,n)=>this._cleanupObserver(n))}observe(e){const n=S_(e);return new se(o=>{const u=this._observeElement(n).pipe(kt(y=>y.filter(I=>!function Tre(t){if("characterData"===t.type&&t.target instanceof Comment)return!0;if("childList"===t.type){for(let i=0;i!!y.length)).subscribe(y=>{this._ngZone.run(()=>{o.next(y)})});return()=>{u.unsubscribe(),this._unobserveElement(n)}})}_observeElement(e){return this._ngZone.runOutsideAngular(()=>{if(this._observedElements.has(e))this._observedElements.get(e).count++;else{const n=new Ee,o=this._mutationObserverFactory.create(r=>n.next(r));o&&o.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:o,stream:n,count:1})}return this._observedElements.get(e).stream})}_unobserveElement(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}_cleanupObserver(e){if(this._observedElements.has(e)){const{observer:n,stream:o}=this._observedElements.get(e);n&&n.disconnect(),o.complete(),this._observedElements.delete(e)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),n3=(()=>{class t{_contentObserver=Y(Dre);_elementRef=Y(Pn);event=new Tt;get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._disabled?this._unsubscribe():this._subscribe()}_disabled=!1;get debounce(){return this._debounce}set debounce(e){this._debounce=Db(e),this._subscribe()}_debounce;_currentSubscription=null;constructor(){}ngAfterContentInit(){!this._currentSubscription&&!this.disabled&&this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const e=this._contentObserver.observe(this._elementRef);this._currentSubscription=(this.debounce?e.pipe(Tb(this.debounce)):e).subscribe(this.event)}_unsubscribe(){this._currentSubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkObserveContent",""]],inputs:{disabled:[2,"cdkObserveContentDisabled","disabled",fn],debounce:"debounce"},outputs:{event:"cdkObserveContent"},exportAs:["cdkObserveContent"]})}return t})(),i3=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[NU]})}return t})(),o3=(()=>{class t{_platform=Y(ea);constructor(){}isDisabled(e){return e.hasAttribute("disabled")}isVisible(e){return function Ere(t){return!!(t.offsetWidth||t.offsetHeight||"function"==typeof t.getClientRects&&t.getClientRects().length)}(e)&&"visible"===getComputedStyle(e).visibility}isTabbable(e){if(!this._platform.isBrowser)return!1;const n=function Ire(t){try{return t.frameElement}catch{return null}}(function Fre(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}(e));if(n&&(-1===BU(n)||!this.isVisible(n)))return!1;let o=e.nodeName.toLowerCase(),r=BU(e);return e.hasAttribute("contenteditable")?-1!==r:!("iframe"===o||"object"===o||this._platform.WEBKIT&&this._platform.IOS&&!function Pre(t){let i=t.nodeName.toLowerCase(),e="input"===i&&t.type;return"text"===e||"password"===e||"select"===i||"textarea"===i}(e))&&("audio"===o?!!e.hasAttribute("controls")&&-1!==r:"video"===o?-1!==r&&(null!==r||this._platform.FIREFOX||e.hasAttribute("controls")):e.tabIndex>=0)}isFocusable(e,n){return function Lre(t){return!function Are(t){return function Rre(t){return"input"==t.nodeName.toLowerCase()}(t)&&"hidden"==t.type}(t)&&(function Mre(t){let i=t.nodeName.toLowerCase();return"input"===i||"select"===i||"button"===i||"textarea"===i}(t)||function kre(t){return function Ore(t){return"a"==t.nodeName.toLowerCase()}(t)&&t.hasAttribute("href")}(t)||t.hasAttribute("contenteditable")||zU(t))}(e)&&!this.isDisabled(e)&&(n?.ignoreVisibility||this.isVisible(e))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function zU(t){if(!t.hasAttribute("tabindex")||void 0===t.tabIndex)return!1;let i=t.getAttribute("tabindex");return!(!i||isNaN(parseInt(i,10)))}function BU(t){if(!zU(t))return null;const i=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(i)?-1:i}class VU{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(i){this._enabled=i,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_enabled=!0;constructor(i,e,n,o,r=!1,u){this._element=i,this._checker=e,this._ngZone=n,this._document=o,this._injector=u,r||this.attachAnchors()}destroy(){const i=this._startAnchor,e=this._endAnchor;i&&(i.removeEventListener("focus",this.startAnchorListener),i.remove()),e&&(e.removeEventListener("focus",this.endAnchorListener),e.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return!!this._hasAttached||(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusInitialElement(i)))})}focusFirstTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusFirstTabbableElement(i)))})}focusLastTabbableElementWhenReady(i){return new Promise(e=>{this._executeOnStable(()=>e(this.focusLastTabbableElement(i)))})}_getRegionBoundary(i){const e=this._element.querySelectorAll(`[cdk-focus-region-${i}], [cdkFocusRegion${i}], [cdk-focus-${i}]`);return"start"==i?e.length?e[0]:this._getFirstTabbableElement(this._element):e.length?e[e.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(i){const e=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(e){if(!this._checker.isFocusable(e)){const n=this._getFirstTabbableElement(e);return n?.focus(i),!!n}return e.focus(i),!0}return this.focusFirstTabbableElement(i)}focusFirstTabbableElement(i){const e=this._getRegionBoundary("start");return e&&e.focus(i),!!e}focusLastTabbableElement(i){const e=this._getRegionBoundary("end");return e&&e.focus(i),!!e}hasAttached(){return this._hasAttached}_getFirstTabbableElement(i){if(this._checker.isFocusable(i)&&this._checker.isTabbable(i))return i;const e=i.children;for(let n=0;n=0;n--){const o=e[n].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(e[n]):null;if(o)return o}return null}_createAnchor(){const i=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,i),i.classList.add("cdk-visually-hidden"),i.classList.add("cdk-focus-trap-anchor"),i.setAttribute("aria-hidden","true"),i}_toggleAnchorTabIndex(i,e){i?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")}toggleAnchors(i){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(i,this._startAnchor),this._toggleAnchorTabIndex(i,this._endAnchor))}_executeOnStable(i){this._injector?As(i,{injector:this._injector}):setTimeout(i)}}let r3=(()=>{class t{_checker=Y(o3);_ngZone=Y(tn);_document=Y(Oo);_injector=Y(Ke);constructor(){Y(Rs).load(qv)}create(e,n=!1){return new VU(e,this._checker,this._ngZone,this._document,n,this._injector)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Nre=(()=>{class t{_elementRef=Y(Pn);_focusTrapFactory=Y(r3);focusTrap;_previouslyFocusedElement=null;get enabled(){return this.focusTrap?.enabled||!1}set enabled(e){this.focusTrap&&(this.focusTrap.enabled=e)}autoCapture;constructor(){Y(ea).isBrowser&&(this.focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement,!0))}ngOnDestroy(){this.focusTrap?.destroy(),this._previouslyFocusedElement&&(this._previouslyFocusedElement.focus(),this._previouslyFocusedElement=null)}ngAfterContentInit(){this.focusTrap?.attachAnchors(),this.autoCapture&&this._captureFocus()}ngDoCheck(){this.focusTrap&&!this.focusTrap.hasAttached()&&this.focusTrap.attachAnchors()}ngOnChanges(e){const n=e.autoCapture;n&&!n.firstChange&&this.autoCapture&&this.focusTrap?.hasAttached()&&this._captureFocus()}_captureFocus(){this._previouslyFocusedElement=Sb(),this.focusTrap?.focusInitialElementWhenReady()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkTrapFocus",""]],inputs:{enabled:[2,"cdkTrapFocus","enabled",fn],autoCapture:[2,"cdkTrapFocusAutoCapture","autoCapture",fn]},exportAs:["cdkTrapFocus"],features:[go]})}return t})();const zre=new yt("liveAnnouncerElement",{providedIn:"root",factory:function Bre(){return null}}),Vre=new yt("LIVE_ANNOUNCER_DEFAULT_OPTIONS");let Ure=0,UU=(()=>{class t{_ngZone=Y(tn);_defaultOptions=Y(Vre,{optional:!0});_liveElement;_document=Y(Oo);_previousTimeout;_currentPromise;_currentResolve;constructor(){const e=Y(zre,{optional:!0});this._liveElement=e||this._createLiveElement()}announce(e,...n){const o=this._defaultOptions;let r,u;return 1===n.length&&"number"==typeof n[0]?u=n[0]:[r,u]=n,this.clear(),clearTimeout(this._previousTimeout),r||(r=o&&o.politeness?o.politeness:"polite"),null==u&&o&&(u=o.duration),this._liveElement.setAttribute("aria-live",r),this._liveElement.id&&this._exposeAnnouncerToModals(this._liveElement.id),this._ngZone.runOutsideAngular(()=>(this._currentPromise||(this._currentPromise=new Promise(y=>this._currentResolve=y)),clearTimeout(this._previousTimeout),this._previousTimeout=setTimeout(()=>{this._liveElement.textContent=e,"number"==typeof u&&(this._previousTimeout=setTimeout(()=>this.clear(),u)),this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0},100),this._currentPromise))}clear(){this._liveElement&&(this._liveElement.textContent="")}ngOnDestroy(){clearTimeout(this._previousTimeout),this._liveElement?.remove(),this._liveElement=null,this._currentResolve?.(),this._currentPromise=this._currentResolve=void 0}_createLiveElement(){const e="cdk-live-announcer-element",n=this._document.getElementsByClassName(e),o=this._document.createElement("div");for(let r=0;r .cdk-overlay-container [aria-modal="true"]');for(let o=0;o{class t{_platform=Y(ea);_hasCheckedHighContrastMode;_document=Y(Oo);_breakpointSubscription;constructor(){this._breakpointSubscription=Y(UE).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return Zv.NONE;const e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);const n=this._document.defaultView||window,o=n&&n.getComputedStyle?n.getComputedStyle(e):null,r=(o&&o.backgroundColor||"").replace(/ /g,"");switch(e.remove(),r){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return Zv.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return Zv.BLACK_ON_WHITE}return Zv.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){const e=this._document.body.classList;e.remove(a3,HU,jU),this._hasCheckedHighContrastMode=!0;const n=this.getHighContrastMode();n===Zv.BLACK_ON_WHITE?e.add(a3,HU):n===Zv.WHITE_ON_BLACK&&e.add(a3,jU)}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),HE=(()=>{class t{constructor(){Y($U)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[i3]})}return t})();function ec(t,i,e,n,o){const r=parseInt(kz.major),u=parseInt(kz.minor);return r>19||19===r&&u>0||0===r&&0===u?t.listen(i,e,n,o):(i.addEventListener(e,n,o),()=>{i.removeEventListener(e,n,o)})}function GU(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function va(...t){const i=NS(t),e=function MQ(t,i){return"number"==typeof sO(t)?t.pop():i}(t,1/0),n=t;return n.length?1===n.length?td(n[0]):Sx(e)(Ol(n,i)):Dc}function Ll(t){return null==t?"":"string"==typeof t?t:`${t}px`}const vT={schedule(t){let i=requestAnimationFrame,e=cancelAnimationFrame;const{delegate:n}=vT;n&&(i=n.requestAnimationFrame,e=n.cancelAnimationFrame);const o=i(r=>{e=void 0,t(r)});return new ai(()=>e?.(o))},requestAnimationFrame(...t){const{delegate:i}=vT;return(i?.requestAnimationFrame||requestAnimationFrame)(...t)},cancelAnimationFrame(...t){const{delegate:i}=vT;return(i?.cancelAnimationFrame||cancelAnimationFrame)(...t)},delegate:void 0};new class $re extends WP{flush(i){let e;this._active=!0,i?e=i.id:(e=this._scheduled,this._scheduled=void 0);const{actions:n}=this;let o;i=i||n.shift();do{if(o=i.execute(i.state,i.delay))break}while((i=n[0])&&i.id===e&&n.shift());if(this._active=!1,o){for(;(i=n[0])&&i.id===e&&n.shift();)i.unsubscribe();throw o}}}(class jre extends GP{constructor(i,e){super(i,e),this.scheduler=i,this.work=e}requestAsyncId(i,e,n=0){return null!==n&&n>0?super.requestAsyncId(i,e,n):(i.actions.push(this),i._scheduled||(i._scheduled=vT.requestAnimationFrame(()=>i.flush(void 0))))}recycleAsyncId(i,e,n=0){var o;if(null!=n?n>0:this.delay>0)return super.recycleAsyncId(i,e,n);const{actions:r}=i;null!=e&&e===i._scheduled&&(null===(o=r[r.length-1])||void 0===o?void 0:o.id)!==e&&(vT.cancelAnimationFrame(e),i._scheduled=void 0)}});let s3,qre=1;const jE={};function qU(t){return t in jE&&(delete jE[t],!0)}const Wre={setImmediate(t){const i=qre++;return jE[i]=!0,s3||(s3=Promise.resolve()),s3.then(()=>qU(i)&&t()),i},clearImmediate(t){qU(t)}},{setImmediate:Zre,clearImmediate:Yre}=Wre,$E={setImmediate(...t){const{delegate:i}=$E;return(i?.setImmediate||Zre)(...t)},clearImmediate(t){const{delegate:i}=$E;return(i?.clearImmediate||Yre)(t)},delegate:void 0};new class Kre extends WP{flush(i){this._active=!0;const e=this._scheduled;this._scheduled=void 0;const{actions:n}=this;let o;i=i||n.shift();do{if(o=i.execute(i.state,i.delay))break}while((i=n[0])&&i.id===e&&n.shift());if(this._active=!1,o){for(;(i=n[0])&&i.id===e&&n.shift();)i.unsubscribe();throw o}}}(class Xre extends GP{constructor(i,e){super(i,e),this.scheduler=i,this.work=e}requestAsyncId(i,e,n=0){return null!==n&&n>0?super.requestAsyncId(i,e,n):(i.actions.push(this),i._scheduled||(i._scheduled=$E.setImmediate(i.flush.bind(i,void 0))))}recycleAsyncId(i,e,n=0){var o;if(null!=n?n>0:this.delay>0)return super.recycleAsyncId(i,e,n);const{actions:r}=i;null!=e&&(null===(o=r[r.length-1])||void 0===o?void 0:o.id)!==e&&($E.clearImmediate(e),i._scheduled===e&&(i._scheduled=void 0))}});function WU(t,i=yT){return function Jre(t){return ot((i,e)=>{let n=!1,o=null,r=null,u=!1;const y=()=>{if(r?.unsubscribe(),r=null,n){n=!1;const V=o;o=null,e.next(V)}u&&e.complete()},I=()=>{r=null,u&&e.complete()};i.subscribe(St(e,V=>{n=!0,o=V,r||td(t(V)).subscribe(r=St(e,y,I))},()=>{u=!0,(!n||!r||r.closed)&&e.complete()}))})}(()=>wb(t,i))}const eae=new yt("cdk-dir-doc",{providedIn:"root",factory:function tae(){return Y(Oo)}}),nae=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;let ul=(()=>{class t{value="ltr";change=new Tt;constructor(){const e=Y(eae,{optional:!0});e&&(this.value=function iae(t){const i=t?.toLowerCase()||"";return"auto"===i&&typeof navigator<"u"&&navigator?.language?nae.test(navigator.language)?"rtl":"ltr":"rtl"===i?"rtl":"ltr"}((e.body?e.body.dir:null)||(e.documentElement?e.documentElement.dir:null)||"ltr"))}ngOnDestroy(){this.change.complete()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var tf=function(t){return t[t.NORMAL=0]="NORMAL",t[t.NEGATED=1]="NEGATED",t[t.INVERTED=2]="INVERTED",t}(tf||{});let GE,Yv;function ZU(){if(null==Yv){if("object"!=typeof document||!document||"function"!=typeof Element||!Element)return Yv=!1,Yv;if("scrollBehavior"in document.documentElement.style)Yv=!0;else{const t=Element.prototype.scrollTo;Yv=!!t&&!/\{\s*\[native code\]\s*\}/.test(t.toString())}}return Yv}function xT(){if("object"!=typeof document||!document)return tf.NORMAL;if(null==GE){const t=document.createElement("div"),i=t.style;t.dir="rtl",i.width="1px",i.overflow="auto",i.visibility="hidden",i.pointerEvents="none",i.position="absolute";const e=document.createElement("div"),n=e.style;n.width="2px",n.height="1px",t.appendChild(e),document.body.appendChild(t),GE=tf.NORMAL,0===t.scrollLeft&&(t.scrollLeft=1,GE=0===t.scrollLeft?tf.NEGATED:tf.INVERTED),t.remove()}return GE}let wT=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})(),qE=(()=>{class t{_ngZone=Y(tn);_platform=Y(ea);_renderer=Y(Qc).createRenderer(null,null);_cleanupGlobalListener;constructor(){}_scrolled=new Ee;_scrolledCount=0;scrollContainers=new Map;register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){const n=this.scrollContainers.get(e);n&&(n.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=20){return this._platform.isBrowser?new se(n=>{this._cleanupGlobalListener||(this._cleanupGlobalListener=this._ngZone.runOutsideAngular(()=>this._renderer.listen("document","scroll",()=>this._scrolled.next())));const o=e>0?this._scrolled.pipe(WU(e)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||(this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0)}}):xi()}ngOnDestroy(){this._cleanupGlobalListener?.(),this._cleanupGlobalListener=void 0,this.scrollContainers.forEach((e,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(e,n){const o=this.getAncestorScrollContainers(e);return this.scrolled(n).pipe(or(r=>!r||o.indexOf(r)>-1))}getAncestorScrollContainers(e){const n=[];return this.scrollContainers.forEach((o,r)=>{this._scrollableContainsElement(r,e)&&n.push(r)}),n}_scrollableContainsElement(e,n){let o=S_(n),r=e.getElementRef().nativeElement;do{if(o==r)return!0}while(o=o.parentElement);return!1}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Xv=(()=>{class t{elementRef=Y(Pn);scrollDispatcher=Y(qE);ngZone=Y(tn);dir=Y(ul,{optional:!0});_scrollElement=this.elementRef.nativeElement;_destroyed=new Ee;_renderer=Y(Hr);_cleanupScroll;_elementScrolled=new Ee;constructor(){}ngOnInit(){this._cleanupScroll=this.ngZone.runOutsideAngular(()=>this._renderer.listen(this._scrollElement,"scroll",e=>this._elementScrolled.next(e))),this.scrollDispatcher.register(this)}ngOnDestroy(){this._cleanupScroll?.(),this._elementScrolled.complete(),this.scrollDispatcher.deregister(this),this._destroyed.next(),this._destroyed.complete()}elementScrolled(){return this._elementScrolled}getElementRef(){return this.elementRef}scrollTo(e){const n=this.elementRef.nativeElement,o=this.dir&&"rtl"==this.dir.value;null==e.left&&(e.left=o?e.end:e.start),null==e.right&&(e.right=o?e.start:e.end),null!=e.bottom&&(e.top=n.scrollHeight-n.clientHeight-e.bottom),o&&xT()!=tf.NORMAL?(null!=e.left&&(e.right=n.scrollWidth-n.clientWidth-e.left),xT()==tf.INVERTED?e.left=e.right:xT()==tf.NEGATED&&(e.left=e.right?-e.right:e.right)):null!=e.right&&(e.left=n.scrollWidth-n.clientWidth-e.right),this._applyScrollToOptions(e)}_applyScrollToOptions(e){const n=this.elementRef.nativeElement;ZU()?n.scrollTo(e):(null!=e.top&&(n.scrollTop=e.top),null!=e.left&&(n.scrollLeft=e.left))}measureScrollOffset(e){const n="left",o="right",r=this.elementRef.nativeElement;if("top"==e)return r.scrollTop;if("bottom"==e)return r.scrollHeight-r.clientHeight-r.scrollTop;const u=this.dir&&"rtl"==this.dir.value;return"start"==e?e=u?o:n:"end"==e&&(e=u?n:o),u&&xT()==tf.INVERTED?e==n?r.scrollWidth-r.clientWidth-r.scrollLeft:r.scrollLeft:u&&xT()==tf.NEGATED?e==n?r.scrollLeft+r.scrollWidth-r.clientWidth:-r.scrollLeft:e==n?r.scrollLeft:r.scrollWidth-r.clientWidth-r.scrollLeft}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdk-scrollable",""],["","cdkScrollable",""]]})}return t})(),Kv=(()=>{class t{_platform=Y(ea);_listeners;_viewportSize;_change=new Ee;_document=Y(Oo,{optional:!0});constructor(){const e=Y(tn),n=Y(Qc).createRenderer(null,null);e.runOutsideAngular(()=>{if(this._platform.isBrowser){const o=r=>this._change.next(r);this._listeners=[n.listen("window","resize",o),n.listen("window","orientationchange",o)]}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){this._listeners?.forEach(e=>e()),this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();const e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){const e=this.getViewportScrollPosition(),{width:n,height:o}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+o,right:e.left+n,height:o,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};const e=this._document,n=this._getWindow(),o=e.documentElement,r=o.getBoundingClientRect();return{top:-r.top||e.body.scrollTop||n.scrollY||o.scrollTop||0,left:-r.left||e.body.scrollLeft||n.scrollX||o.scrollLeft||0}}change(e=20){return e>0?this._change.pipe(WU(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){const e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),T_=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})(),l3=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[wT,T_,wT,T_]})}return t})();const c3={};let ta=(()=>{class t{_appId=Y(Vu);getId(e){return"ng"!==this._appId&&(e+=this._appId),c3.hasOwnProperty(e)||(c3[e]=0),`${e}${c3[e]++}`}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function ns(t,...i){return i.length?i.some(e=>t[e]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}const YU=ZU();class fae{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(i,e){this._viewportRuler=i,this._document=e}attach(){}enable(){if(this._canBeEnabled()){const i=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=i.style.left||"",this._previousHTMLStyles.top=i.style.top||"",i.style.left=Ll(-this._previousScrollPosition.left),i.style.top=Ll(-this._previousScrollPosition.top),i.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){const i=this._document.documentElement,n=i.style,o=this._document.body.style,r=n.scrollBehavior||"",u=o.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,i.classList.remove("cdk-global-scrollblock"),YU&&(n.scrollBehavior=o.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),YU&&(n.scrollBehavior=r,o.scrollBehavior=u)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;const e=this._document.documentElement,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}}class _ae{_scrollDispatcher;_ngZone;_viewportRuler;_config;_scrollSubscription=null;_overlayRef;_initialScrollPosition;constructor(i,e,n,o){this._scrollDispatcher=i,this._ngZone=e,this._viewportRuler=n,this._config=o}attach(i){this._overlayRef=i}enable(){if(this._scrollSubscription)return;const i=this._scrollDispatcher.scrolled(0).pipe(or(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=i.subscribe(()=>{const e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=i.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}_detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}class XU{enable(){}disable(){}attach(){}}function h3(t,i){return i.some(e=>t.bottome.bottom||t.righte.right)}function KU(t,i){return i.some(e=>t.tope.bottom||t.lefte.right)}class gae{_scrollDispatcher;_viewportRuler;_ngZone;_config;_scrollSubscription=null;_overlayRef;constructor(i,e,n,o){this._scrollDispatcher=i,this._viewportRuler=e,this._ngZone=n,this._config=o}attach(i){this._overlayRef=i}enable(){this._scrollSubscription||(this._scrollSubscription=this._scrollDispatcher.scrolled(this._config?this._config.scrollThrottle:0).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){const e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:o}=this._viewportRuler.getViewportSize();h3(e,[{width:n,height:o,bottom:o,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}}))}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}}let bae=(()=>{class t{_scrollDispatcher=Y(qE);_viewportRuler=Y(Kv);_ngZone=Y(tn);_document=Y(Oo);constructor(){}noop=()=>new XU;close=e=>new _ae(this._scrollDispatcher,this._ngZone,this._viewportRuler,e);block=()=>new fae(this._viewportRuler,this._document);reposition=e=>new gae(this._scrollDispatcher,this._viewportRuler,this._ngZone,e);static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();class Qv{positionStrategy;scrollStrategy=new XU;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(i){if(i){const e=Object.keys(i);for(const n of e)void 0!==i[n]&&(this[n]=i[n])}}}class yae{connectionPair;scrollableViewProperties;constructor(i,e){this.connectionPair=i,this.scrollableViewProperties=e}}let QU=(()=>{class t{_attachedOverlays=[];_document=Y(Oo);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){const n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),0===this._attachedOverlays.length&&this.detach()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),vae=(()=>{class t extends QU{_ngZone=Y(tn);_renderer=Y(Qc).createRenderer(null,null);_cleanupKeydown;add(e){super.add(e),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=e=>{const n=this._attachedOverlays;for(let o=n.length-1;o>-1;o--)if(n[o]._keydownEvents.observers.length>0){this._ngZone.run(()=>n[o]._keydownEvents.next(e));break}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),xae=(()=>{class t extends QU{_platform=Y(ea);_ngZone=Y(tn);_renderer=Y(Qc).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(e){if(super.add(e),!this._isAttached){const n=this._document.body,o={capture:!0};this._cleanups=this._ngZone.runOutsideAngular(()=>[ec(this._renderer,n,"pointerdown",this._pointerDownListener,o),ec(this._renderer,n,"click",this._clickListener,o),ec(this._renderer,n,"auxclick",this._clickListener,o),ec(this._renderer,n,"contextmenu",this._clickListener,o)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(e=>e()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=e=>{this._pointerDownEventTarget=Kp(e)};_clickListener=e=>{const n=Kp(e),o="click"===e.type&&this._pointerDownEventTarget?this._pointerDownEventTarget:n;this._pointerDownEventTarget=null;const r=this._attachedOverlays.slice();for(let u=r.length-1;u>-1;u--){const y=r[u];if(y._outsidePointerEvents.observers.length<1||!y.hasAttached())continue;if(JU(y.overlayElement,n)||JU(y.overlayElement,o))break;const I=y._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>I.next(e)):I.next(e)}};static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function JU(t,i){const e=typeof ShadowRoot<"u"&&ShadowRoot;let n=i;for(;n;){if(n===t)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}let e8=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(n,o){},styles:[".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}\n"],encapsulation:2,changeDetection:0})}return t})(),XE=(()=>{class t{_platform=Y(ea);_containerElement;_document=Y(Oo);_styleLoader=Y(Rs);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const e="cdk-overlay-container";if(this._platform.isBrowser||GU()){const o=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let r=0;r{const i=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(i,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),i.style.pointerEvents="none",i.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}}class p3{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new Ee;_attachments=new Ee;_detachments=new Ee;_positionStrategy;_scrollStrategy;_locationChanges=ai.EMPTY;_backdropRef=null;_previousHostParent;_keydownEvents=new Ee;_outsidePointerEvents=new Ee;_renders=new Ee;_afterRenderRef;_afterNextRenderRef;constructor(i,e,n,o,r,u,y,I,V,q=!1,ee,me){this._portalOutlet=i,this._host=e,this._pane=n,this._config=o,this._ngZone=r,this._keyboardDispatcher=u,this._document=y,this._location=I,this._outsideClickDispatcher=V,this._animationsDisabled=q,this._injector=ee,this._renderer=me,o.scrollStrategy&&(this._scrollStrategy=o.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=o.positionStrategy,this._afterRenderRef=dl(()=>Ag(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(i){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);const e=this._portalOutlet.attach(i);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=As(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),"function"==typeof e?.onDestroy&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();const i=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),i}dispose(){const i=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,i&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(i){i!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=i,this.hasAttached()&&(i.attach(this),this.updatePosition()))}updateSize(i){this._config={...this._config,...i},this._updateElementSize()}setDirection(i){this._config={...this._config,direction:i},this._updateElementDirection()}addPanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!0)}removePanelClass(i){this._pane&&this._toggleClasses(this._pane,i,!1)}getDirection(){const i=this._config.direction;return i?"string"==typeof i?i:i.value:"ltr"}updateScrollStrategy(i){i!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=i,this.hasAttached()&&(i.attach(this),i.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;const i=this._pane.style;i.width=Ll(this._config.width),i.height=Ll(this._config.height),i.minWidth=Ll(this._config.minWidth),i.minHeight=Ll(this._config.minHeight),i.maxWidth=Ll(this._config.maxWidth),i.maxHeight=Ll(this._config.maxHeight)}_togglePointerEvents(i){this._pane.style.pointerEvents=i?"":"none"}_attachBackdrop(){const i="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new wae(this._document,this._renderer,this._ngZone,e=>{this._backdropClick.next(e)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(i))}):this._backdropRef.element.classList.add(i)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(i,e,n){const o=VE(e||[]).filter(r=>!!r);o.length&&(n?i.classList.add(...o):i.classList.remove(...o))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{const i=this._renders.pipe(ro(va(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||0===this._pane.children.length)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),i.unsubscribe())})})}_disposeScrollStrategy(){const i=this._scrollStrategy;i?.disable(),i?.detach?.()}}const t8="cdk-overlay-connected-position-bounding-box",Cae=/([A-Za-z%]+)$/;class n8{_viewportRuler;_document;_platform;_overlayContainer;_overlayRef;_isInitialRender;_lastBoundingBoxSize={width:0,height:0};_isPushed=!1;_canPush=!0;_growAfterOpen=!1;_hasFlexibleDimensions=!0;_positionLocked=!1;_originRect;_overlayRect;_viewportRect;_containerRect;_viewportMargin=0;_scrollables=[];_preferredPositions=[];_origin;_pane;_isDisposed;_boundingBox;_lastPosition;_lastScrollVisibility;_positionChanges=new Ee;_resizeSubscription=ai.EMPTY;_offsetX=0;_offsetY=0;_transformOriginSelector;_appliedPanelClasses=[];_previousPushAmount;positionChanges=this._positionChanges;get positions(){return this._preferredPositions}constructor(i,e,n,o,r){this._viewportRuler=e,this._document=n,this._platform=o,this._overlayContainer=r,this.setOrigin(i)}attach(i){this._validatePositions(),i.hostElement.classList.add(t8),this._overlayRef=i,this._boundingBox=i.hostElement,this._pane=i.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition)return void this.reapplyLastPosition();this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const i=this._originRect,e=this._overlayRect,n=this._viewportRect,o=this._containerRect,r=[];let u;for(let y of this._preferredPositions){let I=this._getOriginPoint(i,o,y),V=this._getOverlayPoint(I,e,y),q=this._getOverlayFit(V,e,n,y);if(q.isCompletelyWithinViewport)return this._isPushed=!1,void this._applyPosition(y,I);this._canFitWithFlexibleDimensions(q,V,n)?r.push({position:y,origin:I,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(I,y)}):(!u||u.overlayFit.visibleAreaI&&(I=q,y=V)}return this._isPushed=!1,void this._applyPosition(y.position,y.origin)}if(this._canPush)return this._isPushed=!0,void this._applyPosition(u.position,u.originPoint);this._applyPosition(u.position,u.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Jv(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(t8),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;const i=this._lastPosition;if(i){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();const e=this._getOriginPoint(this._originRect,this._containerRect,i);this._applyPosition(i,e)}else this.apply()}withScrollableContainers(i){return this._scrollables=i,this}withPositions(i){return this._preferredPositions=i,-1===i.indexOf(this._lastPosition)&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(i){return this._viewportMargin=i,this}withFlexibleDimensions(i=!0){return this._hasFlexibleDimensions=i,this}withGrowAfterOpen(i=!0){return this._growAfterOpen=i,this}withPush(i=!0){return this._canPush=i,this}withLockedPosition(i=!0){return this._positionLocked=i,this}setOrigin(i){return this._origin=i,this}withDefaultOffsetX(i){return this._offsetX=i,this}withDefaultOffsetY(i){return this._offsetY=i,this}withTransformOriginOn(i){return this._transformOriginSelector=i,this}_getOriginPoint(i,e,n){let o,r;if("center"==n.originX)o=i.left+i.width/2;else{const u=this._isRtl()?i.right:i.left,y=this._isRtl()?i.left:i.right;o="start"==n.originX?u:y}return e.left<0&&(o-=e.left),r="center"==n.originY?i.top+i.height/2:"top"==n.originY?i.top:i.bottom,e.top<0&&(r-=e.top),{x:o,y:r}}_getOverlayPoint(i,e,n){let o,r;return o="center"==n.overlayX?-e.width/2:"start"===n.overlayX?this._isRtl()?-e.width:0:this._isRtl()?0:-e.width,r="center"==n.overlayY?-e.height/2:"top"==n.overlayY?0:-e.height,{x:i.x+o,y:i.y+r}}_getOverlayFit(i,e,n,o){const r=o8(e);let{x:u,y}=i,I=this._getOffset(o,"x"),V=this._getOffset(o,"y");I&&(u+=I),V&&(y+=V);let me=0-y,he=y+r.height-n.height,Ce=this._subtractOverflows(r.width,0-u,u+r.width-n.width),je=this._subtractOverflows(r.height,me,he),mt=Ce*je;return{visibleArea:mt,isCompletelyWithinViewport:r.width*r.height===mt,fitsInViewportVertically:je===r.height,fitsInViewportHorizontally:Ce==r.width}}_canFitWithFlexibleDimensions(i,e,n){if(this._hasFlexibleDimensions){const o=n.bottom-e.y,r=n.right-e.x,u=i8(this._overlayRef.getConfig().minHeight),y=i8(this._overlayRef.getConfig().minWidth);return(i.fitsInViewportVertically||null!=u&&u<=o)&&(i.fitsInViewportHorizontally||null!=y&&y<=r)}return!1}_pushOverlayOnScreen(i,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:i.x+this._previousPushAmount.x,y:i.y+this._previousPushAmount.y};const o=o8(e),r=this._viewportRect,u=Math.max(i.x+o.width-r.width,0),y=Math.max(i.y+o.height-r.height,0),I=Math.max(r.top-n.top-i.y,0),V=Math.max(r.left-n.left-i.x,0);let q=0,ee=0;return q=o.width<=r.width?V||-u:i.xCe&&!this._isInitialRender&&!this._growAfterOpen&&(u=i.y-Ce/2)}if("end"===e.overlayX&&!o||"start"===e.overlayX&&o)me=n.width-i.x+2*this._viewportMargin,q=i.x-this._viewportMargin;else if("start"===e.overlayX&&!o||"end"===e.overlayX&&o)ee=i.x,q=n.right-i.x;else{const he=Math.min(n.right-i.x+n.left,i.x),Ce=this._lastBoundingBoxSize.width;q=2*he,ee=i.x-he,q>Ce&&!this._isInitialRender&&!this._growAfterOpen&&(ee=i.x-Ce/2)}return{top:u,left:ee,bottom:y,right:me,width:q,height:r}}_setBoundingBoxStyles(i,e){const n=this._calculateBoundingBoxRect(i,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));const o={};if(this._hasExactPosition())o.top=o.left="0",o.bottom=o.right=o.maxHeight=o.maxWidth="",o.width=o.height="100%";else{const r=this._overlayRef.getConfig().maxHeight,u=this._overlayRef.getConfig().maxWidth;o.height=Ll(n.height),o.top=Ll(n.top),o.bottom=Ll(n.bottom),o.width=Ll(n.width),o.left=Ll(n.left),o.right=Ll(n.right),o.alignItems="center"===e.overlayX?"center":"end"===e.overlayX?"flex-end":"flex-start",o.justifyContent="center"===e.overlayY?"center":"bottom"===e.overlayY?"flex-end":"flex-start",r&&(o.maxHeight=Ll(r)),u&&(o.maxWidth=Ll(u))}this._lastBoundingBoxSize=n,Jv(this._boundingBox.style,o)}_resetBoundingBoxStyles(){Jv(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Jv(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(i,e){const n={},o=this._hasExactPosition(),r=this._hasFlexibleDimensions,u=this._overlayRef.getConfig();if(o){const q=this._viewportRuler.getViewportScrollPosition();Jv(n,this._getExactOverlayY(e,i,q)),Jv(n,this._getExactOverlayX(e,i,q))}else n.position="static";let y="",I=this._getOffset(e,"x"),V=this._getOffset(e,"y");I&&(y+=`translateX(${I}px) `),V&&(y+=`translateY(${V}px)`),n.transform=y.trim(),u.maxHeight&&(o?n.maxHeight=Ll(u.maxHeight):r&&(n.maxHeight="")),u.maxWidth&&(o?n.maxWidth=Ll(u.maxWidth):r&&(n.maxWidth="")),Jv(this._pane.style,n)}_getExactOverlayY(i,e,n){let o={top:"",bottom:""},r=this._getOverlayPoint(e,this._overlayRect,i);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),"bottom"===i.overlayY?o.bottom=this._document.documentElement.clientHeight-(r.y+this._overlayRect.height)+"px":o.top=Ll(r.y),o}_getExactOverlayX(i,e,n){let u,o={left:"",right:""},r=this._getOverlayPoint(e,this._overlayRect,i);return this._isPushed&&(r=this._pushOverlayOnScreen(r,this._overlayRect,n)),u=this._isRtl()?"end"===i.overlayX?"left":"right":"end"===i.overlayX?"right":"left","right"===u?o.right=this._document.documentElement.clientWidth-(r.x+this._overlayRect.width)+"px":o.left=Ll(r.x),o}_getScrollVisibility(){const i=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(o=>o.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:KU(i,n),isOriginOutsideView:h3(i,n),isOverlayClipped:KU(e,n),isOverlayOutsideView:h3(e,n)}}_subtractOverflows(i,...e){return e.reduce((n,o)=>n-Math.max(o,0),i)}_getNarrowedViewportRect(){const i=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+i-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:i-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return"rtl"===this._overlayRef.getDirection()}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(i,e){return"x"===e?null==i.offsetX?this._offsetX:i.offsetX:null==i.offsetY?this._offsetY:i.offsetY}_validatePositions(){}_addPanelClasses(i){this._pane&&VE(i).forEach(e=>{""!==e&&-1===this._appliedPanelClasses.indexOf(e)&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(i=>{this._pane.classList.remove(i)}),this._appliedPanelClasses=[])}_getOriginRect(){const i=this._origin;if(i instanceof Pn)return i.nativeElement.getBoundingClientRect();if(i instanceof Element)return i.getBoundingClientRect();const e=i.width||0,n=i.height||0;return{top:i.y,bottom:i.y+n,left:i.x,right:i.x+e,height:n,width:e}}}function Jv(t,i){for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);return t}function i8(t){if("number"!=typeof t&&null!=t){const[i,e]=t.split(Cae);return e&&"px"!==e?null:parseFloat(i)}return t||null}function o8(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}const r8="cdk-global-overlay-wrapper";class Tae{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(i){const e=i.getConfig();this._overlayRef=i,this._width&&!e.width&&i.updateSize({width:this._width}),this._height&&!e.height&&i.updateSize({height:this._height}),i.hostElement.classList.add(r8),this._isDisposed=!1}top(i=""){return this._bottomOffset="",this._topOffset=i,this._alignItems="flex-start",this}left(i=""){return this._xOffset=i,this._xPosition="left",this}bottom(i=""){return this._topOffset="",this._bottomOffset=i,this._alignItems="flex-end",this}right(i=""){return this._xOffset=i,this._xPosition="right",this}start(i=""){return this._xOffset=i,this._xPosition="start",this}end(i=""){return this._xOffset=i,this._xPosition="end",this}width(i=""){return this._overlayRef?this._overlayRef.updateSize({width:i}):this._width=i,this}height(i=""){return this._overlayRef?this._overlayRef.updateSize({height:i}):this._height=i,this}centerHorizontally(i=""){return this.left(i),this._xPosition="center",this}centerVertically(i=""){return this.top(i),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;const i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:o,height:r,maxWidth:u,maxHeight:y}=n,I=!("100%"!==o&&"100vw"!==o||u&&"100%"!==u&&"100vw"!==u),V=!("100%"!==r&&"100vh"!==r||y&&"100%"!==y&&"100vh"!==y),q=this._xPosition,ee=this._xOffset,me="rtl"===this._overlayRef.getConfig().direction;let he="",Ce="",je="";I?je="flex-start":"center"===q?(je="center",me?Ce=ee:he=ee):me?"left"===q||"end"===q?(je="flex-end",he=ee):("right"===q||"start"===q)&&(je="flex-start",Ce=ee):"left"===q||"start"===q?(je="flex-start",he=ee):("right"===q||"end"===q)&&(je="flex-end",Ce=ee),i.position=this._cssPosition,i.marginLeft=I?"0":he,i.marginTop=V?"0":this._topOffset,i.marginBottom=this._bottomOffset,i.marginRight=I?"0":Ce,e.justifyContent=je,e.alignItems=V?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;const i=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(r8),n.justifyContent=n.alignItems=i.marginTop=i.marginBottom=i.marginLeft=i.marginRight=i.position="",this._overlayRef=null,this._isDisposed=!0}}let Dae=(()=>{class t{_viewportRuler=Y(Kv);_document=Y(Oo);_platform=Y(ea);_overlayContainer=Y(XE);constructor(){}global(){return new Tae}flexibleConnectedTo(e){return new n8(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),is=(()=>{class t{scrollStrategies=Y(bae);_overlayContainer=Y(XE);_positionBuilder=Y(Dae);_keyboardDispatcher=Y(vae);_injector=Y(Ke);_ngZone=Y(tn);_document=Y(Oo);_directionality=Y(ul);_location=Y(mx);_outsideClickDispatcher=Y(xae);_animationsModuleType=Y(Kr,{optional:!0});_idGenerator=Y(ta);_renderer=Y(Qc).createRenderer(null,null);_appRef;_styleLoader=Y(Rs);constructor(){}create(e){this._styleLoader.load(e8);const n=this._createHostElement(),o=this._createPaneElement(n),r=this._createPortalOutlet(o),u=new Qv(e);return u.direction=u.direction||this._directionality.value,new p3(r,n,o,u,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,"NoopAnimations"===this._animationsModuleType,this._injector.get(us),this._renderer)}position(){return this._positionBuilder}_createPaneElement(e){const n=this._document.createElement("div");return n.id=this._idGenerator.getId("cdk-overlay-"),n.classList.add("cdk-overlay-pane"),e.appendChild(n),n}_createHostElement(){const e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}_createPortalOutlet(e){return this._appRef||(this._appRef=this._injector.get(Bd)),new bre(e,null,this._appRef,this._injector,this._document)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const Iae=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],a8=new yt("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition()}});let KE=(()=>{class t{elementRef=Y(Pn);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdk-overlay-origin",""],["","overlay-origin",""],["","cdkOverlayOrigin",""]],exportAs:["cdkOverlayOrigin"]})}return t})(),s8=(()=>{class t{_overlay=Y(is);_dir=Y(ul,{optional:!0});_overlayRef;_templatePortal;_backdropSubscription=ai.EMPTY;_attachSubscription=ai.EMPTY;_detachSubscription=ai.EMPTY;_positionSubscription=ai.EMPTY;_offsetX;_offsetY;_position;_scrollStrategyFactory=Y(a8);_disposeOnNavigation=!1;_ngZone=Y(tn);origin;positions;positionStrategy;get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e,this._position&&this._updatePositionStrategy(this._position)}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e,this._position&&this._updatePositionStrategy(this._position)}width;height;minWidth;minHeight;backdropClass;panelClass;viewportMargin=0;scrollStrategy;open=!1;disableClose=!1;transformOriginSelector;hasBackdrop=!1;lockPosition=!1;flexibleDimensions=!1;growAfterOpen=!1;push=!1;get disposeOnNavigation(){return this._disposeOnNavigation}set disposeOnNavigation(e){this._disposeOnNavigation=e}backdropClick=new Tt;positionChange=new Tt;attach=new Tt;detach=new Tt;overlayKeydown=new Tt;overlayOutsideClick=new Tt;constructor(){const e=Y(sa),n=Y(es);this._templatePortal=new C_(e,n),this.scrollStrategy=this._scrollStrategyFactory()}get overlayRef(){return this._overlayRef}get dir(){return this._dir?this._dir.value:"ltr"}ngOnDestroy(){this._attachSubscription.unsubscribe(),this._detachSubscription.unsubscribe(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this._overlayRef?.dispose()}ngOnChanges(e){this._position&&(this._updatePositionStrategy(this._position),this._overlayRef?.updateSize({width:this.width,minWidth:this.minWidth,height:this.height,minHeight:this.minHeight}),e.origin&&this.open&&this._position.apply()),e.open&&(this.open?this.attachOverlay():this.detachOverlay())}_createOverlay(){(!this.positions||!this.positions.length)&&(this.positions=Iae);const e=this._overlayRef=this._overlay.create(this._buildConfig());this._attachSubscription=e.attachments().subscribe(()=>this.attach.emit()),this._detachSubscription=e.detachments().subscribe(()=>this.detach.emit()),e.keydownEvents().subscribe(n=>{this.overlayKeydown.next(n),27===n.keyCode&&!this.disableClose&&!ns(n)&&(n.preventDefault(),this.detachOverlay())}),this._overlayRef.outsidePointerEvents().subscribe(n=>{const o=this._getOriginElement(),r=Kp(n);(!o||o!==r&&!o.contains(r))&&this.overlayOutsideClick.next(n)})}_buildConfig(){const e=this._position=this.positionStrategy||this._createPositionStrategy(),n=new Qv({direction:this._dir||"ltr",positionStrategy:e,scrollStrategy:this.scrollStrategy,hasBackdrop:this.hasBackdrop,disposeOnNavigation:this.disposeOnNavigation});return(this.width||0===this.width)&&(n.width=this.width),(this.height||0===this.height)&&(n.height=this.height),(this.minWidth||0===this.minWidth)&&(n.minWidth=this.minWidth),(this.minHeight||0===this.minHeight)&&(n.minHeight=this.minHeight),this.backdropClass&&(n.backdropClass=this.backdropClass),this.panelClass&&(n.panelClass=this.panelClass),n}_updatePositionStrategy(e){const n=this.positions.map(o=>({originX:o.originX,originY:o.originY,overlayX:o.overlayX,overlayY:o.overlayY,offsetX:o.offsetX||this.offsetX,offsetY:o.offsetY||this.offsetY,panelClass:o.panelClass||void 0}));return e.setOrigin(this._getOrigin()).withPositions(n).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector)}_createPositionStrategy(){const e=this._overlay.position().flexibleConnectedTo(this._getOrigin());return this._updatePositionStrategy(e),e}_getOrigin(){return this.origin instanceof KE?this.origin.elementRef:this.origin}_getOriginElement(){return this.origin instanceof KE?this.origin.elementRef.nativeElement:this.origin instanceof Pn?this.origin.nativeElement:typeof Element<"u"&&this.origin instanceof Element?this.origin:null}attachOverlay(){this._overlayRef?this._overlayRef.getConfig().hasBackdrop=this.hasBackdrop:this._createOverlay(),this._overlayRef.hasAttached()||this._overlayRef.attach(this._templatePortal),this.hasBackdrop?this._backdropSubscription=this._overlayRef.backdropClick().subscribe(e=>{this.backdropClick.emit(e)}):this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.positionChange.observers.length>0&&(this._positionSubscription=this._position.positionChanges.pipe(function Hre(t,i=!1){return ot((e,n)=>{let o=0;e.subscribe(St(n,r=>{const u=t(r,o++);(u||i)&&n.next(r),!u&&n.complete()}))})}(()=>this.positionChange.observers.length>0)).subscribe(e=>{this._ngZone.run(()=>this.positionChange.emit(e)),0===this.positionChange.observers.length&&this._positionSubscription.unsubscribe()})),this.open=!0}detachOverlay(){this._overlayRef?.detach(),this._backdropSubscription.unsubscribe(),this._positionSubscription.unsubscribe(),this.open=!1}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdk-connected-overlay",""],["","connected-overlay",""],["","cdkConnectedOverlay",""]],inputs:{origin:[0,"cdkConnectedOverlayOrigin","origin"],positions:[0,"cdkConnectedOverlayPositions","positions"],positionStrategy:[0,"cdkConnectedOverlayPositionStrategy","positionStrategy"],offsetX:[0,"cdkConnectedOverlayOffsetX","offsetX"],offsetY:[0,"cdkConnectedOverlayOffsetY","offsetY"],width:[0,"cdkConnectedOverlayWidth","width"],height:[0,"cdkConnectedOverlayHeight","height"],minWidth:[0,"cdkConnectedOverlayMinWidth","minWidth"],minHeight:[0,"cdkConnectedOverlayMinHeight","minHeight"],backdropClass:[0,"cdkConnectedOverlayBackdropClass","backdropClass"],panelClass:[0,"cdkConnectedOverlayPanelClass","panelClass"],viewportMargin:[0,"cdkConnectedOverlayViewportMargin","viewportMargin"],scrollStrategy:[0,"cdkConnectedOverlayScrollStrategy","scrollStrategy"],open:[0,"cdkConnectedOverlayOpen","open"],disableClose:[0,"cdkConnectedOverlayDisableClose","disableClose"],transformOriginSelector:[0,"cdkConnectedOverlayTransformOriginOn","transformOriginSelector"],hasBackdrop:[2,"cdkConnectedOverlayHasBackdrop","hasBackdrop",fn],lockPosition:[2,"cdkConnectedOverlayLockPosition","lockPosition",fn],flexibleDimensions:[2,"cdkConnectedOverlayFlexibleDimensions","flexibleDimensions",fn],growAfterOpen:[2,"cdkConnectedOverlayGrowAfterOpen","growAfterOpen",fn],push:[2,"cdkConnectedOverlayPush","push",fn],disposeOnNavigation:[2,"cdkConnectedOverlayDisposeOnNavigation","disposeOnNavigation",fn]},outputs:{backdropClick:"backdropClick",positionChange:"positionChange",attach:"attach",detach:"detach",overlayKeydown:"overlayKeydown",overlayOutsideClick:"overlayOutsideClick"},exportAs:["cdkConnectedOverlay"],features:[go]})}return t})();const Mae={provide:a8,deps:[is],useFactory:function Eae(t){return()=>t.scrollStrategies.reposition()}};let DT,Ib=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[is,Mae],imports:[wT,Gv,l3,l3]})}return t})();function TT(t,i=za){return t=t??Aae,ot((e,n)=>{let o,r=!0;e.subscribe(St(n,u=>{const y=i(u);(r||!t(o,y))&&(r=!1,o=y,n.next(u))}))})}function Aae(t,i){return t===i}function m3(t){return 0===t.buttons||0===t.detail}function f3(t){const i=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0];return!(!i||-1!==i.identifier||null!=i.radiusX&&1!==i.radiusX||null!=i.radiusY&&1!==i.radiusY)}function QE(t){return function kae(){if(null==DT&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>DT=!0}))}finally{DT=DT||!1}return DT}()?t:!!t.capture}const Rae=new yt("cdk-input-modality-detector-options"),Oae={ignoreKeys:[18,17,224,91,16]},_3={passive:!0,capture:!0};let Pae=(()=>{class t{_platform=Y(ea);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new it(null);_options;_lastTouchMs=0;_onKeydown=e=>{this._options?.ignoreKeys?.some(n=>n===e.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=Kp(e))};_onMousedown=e=>{Date.now()-this._lastTouchMs<650||(this._modality.next(m3(e)?"keyboard":"mouse"),this._mostRecentTarget=Kp(e))};_onTouchstart=e=>{f3(e)?this._modality.next("keyboard"):(this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Kp(e))};constructor(){const e=Y(tn),n=Y(Oo),o=Y(Rae,{optional:!0});if(this._options={...Oae,...o},this.modalityDetected=this._modality.pipe(t3(1)),this.modalityChanged=this.modalityDetected.pipe(TT()),this._platform.isBrowser){const r=Y(Qc).createRenderer(null,null);this._listenerCleanups=e.runOutsideAngular(()=>[ec(r,n,"keydown",this._onKeydown,_3),ec(r,n,"mousedown",this._onMousedown,_3),ec(r,n,"touchstart",this._onTouchstart,_3)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(e=>e())}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var JE=function(t){return t[t.IMMEDIATE=0]="IMMEDIATE",t[t.EVENTUAL=1]="EVENTUAL",t}(JE||{});const Lae=new yt("cdk-focus-monitor-default-options"),eM=QE({passive:!0,capture:!0});let eh=(()=>{class t{_ngZone=Y(tn);_platform=Y(ea);_inputModalityDetector=Y(Pae);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=Y(Oo,{optional:!0});_stopInputModalityDetector=new Ee;constructor(){const e=Y(Lae,{optional:!0});this._detectionMode=e?.detectionMode||JE.IMMEDIATE}_rootNodeFocusAndBlurListener=e=>{for(let o=Kp(e);o;o=o.parentElement)"focus"===e.type?this._onFocus(e,o):this._onBlur(e,o)};monitor(e,n=!1){const o=S_(e);if(!this._platform.isBrowser||1!==o.nodeType)return xi();const r=function xre(t){if(function vre(){if(null==e3){const t=typeof document<"u"?document.head:null;e3=!(!t||!t.createShadowRoot&&!t.attachShadow)}return e3}()){const i=t.getRootNode?t.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&i instanceof ShadowRoot)return i}return null}(o)||this._getDocument(),u=this._elementInfo.get(o);if(u)return n&&(u.checkChildren=!0),u.subject;const y={checkChildren:n,subject:new Ee,rootNode:r};return this._elementInfo.set(o,y),this._registerGlobalListeners(y),y.subject}stopMonitoring(e){const n=S_(e),o=this._elementInfo.get(n);o&&(o.subject.complete(),this._setClasses(n),this._elementInfo.delete(n),this._removeGlobalListeners(o))}focusVia(e,n,o){const r=S_(e);r===this._getDocument().activeElement?this._getClosestElementsInfo(r).forEach(([y,I])=>this._originChanged(y,n,I)):(this._setOrigin(n),"function"==typeof r.focus&&r.focus(o))}ngOnDestroy(){this._elementInfo.forEach((e,n)=>this.stopMonitoring(n))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return this._detectionMode===JE.EVENTUAL||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,n){e.classList.toggle("cdk-focused",!!n),e.classList.toggle("cdk-touch-focused","touch"===n),e.classList.toggle("cdk-keyboard-focused","keyboard"===n),e.classList.toggle("cdk-mouse-focused","mouse"===n),e.classList.toggle("cdk-program-focused","program"===n)}_setOrigin(e,n=!1){this._ngZone.runOutsideAngular(()=>{this._origin=e,this._originFromTouchInteraction="touch"===e&&n,this._detectionMode===JE.IMMEDIATE&&(clearTimeout(this._originTimeoutId),this._originTimeoutId=setTimeout(()=>this._origin=null,this._originFromTouchInteraction?650:1))})}_onFocus(e,n){const o=this._elementInfo.get(n),r=Kp(e);!o||!o.checkChildren&&n!==r||this._originChanged(n,this._getFocusOrigin(r),o)}_onBlur(e,n){const o=this._elementInfo.get(n);!o||o.checkChildren&&e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||(this._setClasses(n),this._emitOrigin(o,null))}_emitOrigin(e,n){e.subject.observers.length&&this._ngZone.run(()=>e.subject.next(n))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;const n=e.rootNode,o=this._rootNodeFocusListenerCount.get(n)||0;o||this._ngZone.runOutsideAngular(()=>{n.addEventListener("focus",this._rootNodeFocusAndBlurListener,eM),n.addEventListener("blur",this._rootNodeFocusAndBlurListener,eM)}),this._rootNodeFocusListenerCount.set(n,o+1),1==++this._monitoredElementCount&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(ro(this._stopInputModalityDetector)).subscribe(r=>{this._setOrigin(r,!0)}))}_removeGlobalListeners(e){const n=e.rootNode;if(this._rootNodeFocusListenerCount.has(n)){const o=this._rootNodeFocusListenerCount.get(n);o>1?this._rootNodeFocusListenerCount.set(n,o-1):(n.removeEventListener("focus",this._rootNodeFocusAndBlurListener,eM),n.removeEventListener("blur",this._rootNodeFocusAndBlurListener,eM),this._rootNodeFocusListenerCount.delete(n))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,n,o){this._setClasses(e,n),this._emitOrigin(o,n),this._lastFocusOrigin=n}_getClosestElementsInfo(e){const n=[];return this._elementInfo.forEach((o,r)=>{(r===e||o.checkChildren&&r.contains(e))&&n.push([r,o])}),n}_isLastInteractionFromInputLabel(e){const{_mostRecentTarget:n,mostRecentModality:o}=this._inputModalityDetector;if("mouse"!==o||!n||n===e||"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName||e.disabled)return!1;const r=e.labels;if(r)for(let u=0;u{class t{_elementRef=Y(Pn);_focusMonitor=Y(eh);_monitorSubscription;_focusOrigin=null;cdkFocusChange=new Tt;constructor(){}get focusOrigin(){return this._focusOrigin}ngAfterViewInit(){const e=this._elementRef.nativeElement;this._monitorSubscription=this._focusMonitor.monitor(e,1===e.nodeType&&e.hasAttribute("cdkMonitorSubtreeFocus")).subscribe(n=>{this._focusOrigin=n,this.cdkFocusChange.emit(n)})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._monitorSubscription&&this._monitorSubscription.unsubscribe()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkMonitorElementFocus",""],["","cdkMonitorSubtreeFocus",""]],outputs:{cdkFocusChange:"cdkFocusChange"},exportAs:["cdkMonitorFocus"]})}return t})();function Fae(t,i){}class IT{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;componentFactoryResolver;providers;container;templateContext}let c8=(()=>{class t extends zE{_elementRef=Y(Pn);_focusTrapFactory=Y(r3);_config;_interactivityChecker=Y(o3);_ngZone=Y(tn);_overlayRef=Y(p3);_focusMonitor=Y(eh);_renderer=Y(Hr);_changeDetectorRef=Y(So);_injector=Y(Ke);_platform=Y(ea);_document=Y(Oo,{optional:!0});_portalOutlet;_focusTrapped=new Ee;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=Y(IT,{optional:!0})||new IT,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){const n=this._ariaLabelledByQueue.indexOf(e);n>-1&&(this._ariaLabelledByQueue.splice(n,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._handleBackdropClicks(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();const n=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),n}attachTemplatePortal(e){this._portalOutlet.hasAttached();const n=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),n}attachDomPortal=e=>{this._portalOutlet.hasAttached();const n=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),n};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,n){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{const o=()=>{r(),u(),e.removeAttribute("tabindex")},r=this._renderer.listen(e,"blur",o),u=this._renderer.listen(e,"mousedown",o)})),e.focus(n)}_focusByCssSelector(e,n){let o=this._elementRef.nativeElement.querySelector(e);o&&this._forceFocus(o,n)}_trapFocus(e){this._isDestroyed||As(()=>{const n=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||n.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e)}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){const e=this._config.restoreFocus;let n=null;if("string"==typeof e?n=this._document.querySelector(e):"boolean"==typeof e?n=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(n=e),this._config.restoreFocus&&n&&"function"==typeof n.focus){const o=Sb(),r=this._elementRef.nativeElement;(!o||o===this._document.body||o===r||r.contains(o))&&(this._focusMonitor?(this._focusMonitor.focusVia(n,this._closeInteractionType),this._closeInteractionType=null):n.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus(e)}_containsFocus(){const e=this._elementRef.nativeElement,n=Sb();return e===n||e.contains(n)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=Sb()))}_handleBackdropClicks(){this._overlayRef.backdropClick().subscribe(()=>{this._config.disableClose&&this._recaptureFocus()})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["cdk-dialog-container"]],viewQuery:function(n,o){if(1&n&&mn(ef,7),2&n){let r;Bt(r=Vt())&&(o._portalOutlet=r.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(n,o){2&n&&zn("id",o._config.id||null)("role",o._config.role)("aria-modal",o._config.ariaModal)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null)},features:[qn],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(n,o){1&n&&te(0,Fae,0,0,"ng-template",0)},dependencies:[ef],styles:[".cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}\n"],encapsulation:2})}return t})();class tM{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new Ee;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(i,e){this.overlayRef=i,this.config=e,this.disableClose=e.disableClose,this.backdropClick=i.backdropClick(),this.keydownEvents=i.keydownEvents(),this.outsidePointerEvents=i.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(n=>{27===n.keyCode&&!this.disableClose&&!ns(n)&&(n.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{this.disableClose||this.close(void 0,{focusOrigin:"mouse"})}),this._detachSubscription=i.detachments().subscribe(()=>{!1!==e.closeOnOverlayDetachments&&this.close()})}close(i,e){if(this.containerInstance){const n=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),n.next(i),n.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(i="",e=""){return this.overlayRef.updateSize({width:i,height:e}),this}addPanelClass(i){return this.overlayRef.addPanelClass(i),this}removePanelClass(i){return this.overlayRef.removePanelClass(i),this}}const d8=new yt("DialogScrollStrategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.block()}}),Nae=new yt("DialogData"),zae=new yt("DefaultDialogConfig");let u8=(()=>{class t{_overlay=Y(is);_injector=Y(Ke);_defaultOptions=Y(zae,{optional:!0});_parentDialog=Y(t,{optional:!0,skipSelf:!0});_overlayContainer=Y(XE);_idGenerator=Y(ta);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new Ee;_afterOpenedAtThisLevel=new Ee;_ariaHiddenElements=new Map;_scrollStrategy=Y(d8);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=Tx(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ua(void 0)));constructor(){}open(e,n){(n={...this._defaultOptions||new IT,...n}).id=n.id||this._idGenerator.getId("cdk-dialog-"),n.id&&this.getDialogById(n.id);const r=this._getOverlayConfig(n),u=this._overlay.create(r),y=new tM(u,n),I=this._attachContainer(u,y,n);if(y.containerInstance=I,!this.openDialogs.length){const V=this._overlayContainer.getContainerElement();I._focusTrapped?I._focusTrapped.pipe($a(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(V)}):this._hideNonDialogContentFromAssistiveTechnology(V)}return this._attachDialogContent(e,y,I,n),this.openDialogs.push(y),y.closed.subscribe(()=>this._removeOpenDialog(y,!0)),this.afterOpened.next(y),y}closeAll(){b3(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){b3(this._openDialogsAtThisLevel,e=>{!1===e.config.closeOnDestroy&&this._removeOpenDialog(e,!1)}),b3(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){const n=new Qv({positionStrategy:e.positionStrategy||this._overlay.position().global().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation});return e.backdropClass&&(n.backdropClass=e.backdropClass),n}_attachContainer(e,n,o){const r=o.injector||o.viewContainerRef?.injector,u=[{provide:IT,useValue:o},{provide:tM,useValue:n},{provide:p3,useValue:e}];let y;o.container?"function"==typeof o.container?y=o.container:(y=o.container.type,u.push(...o.container.providers(o))):y=c8;const I=new Cb(y,o.viewContainerRef,Ke.create({parent:r||this._injector,providers:u}));return e.attach(I).instance}_attachDialogContent(e,n,o,r){if(e instanceof sa){const u=this._createInjector(r,n,o,void 0);let y={$implicit:r.data,dialogRef:n};r.templateContext&&(y={...y,..."function"==typeof r.templateContext?r.templateContext():r.templateContext}),o.attachTemplatePortal(new C_(e,null,y,u))}else{const u=this._createInjector(r,n,o,this._injector),y=o.attachComponentPortal(new Cb(e,r.viewContainerRef,u));n.componentRef=y,n.componentInstance=y.instance}}_createInjector(e,n,o,r){const u=e.injector||e.viewContainerRef?.injector,y=[{provide:Nae,useValue:e.data},{provide:tM,useValue:n}];return e.providers&&("function"==typeof e.providers?y.push(...e.providers(n,e,o)):y.push(...e.providers)),e.direction&&(!u||!u.get(ul,null,{optional:!0}))&&y.push({provide:ul,useValue:{value:e.direction,change:xi()}}),Ke.create({parent:u||r,providers:y})}_removeOpenDialog(e,n){const o=this.openDialogs.indexOf(e);o>-1&&(this.openDialogs.splice(o,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((r,u)=>{r?u.setAttribute("aria-hidden",r):u.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),n&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){const n=e.parentElement.children;for(let o=n.length-1;o>-1;o--){const r=n[o];r!==e&&"SCRIPT"!==r.nodeName&&"STYLE"!==r.nodeName&&!r.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(r,r.getAttribute("aria-hidden")),r.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){const e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function b3(t,i){let e=t.length;for(;e--;)i(t[e])}let Vae=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[u8],imports:[Ib,Gv,HE,Gv]})}return t})(),Ki=(()=>{class t{constructor(){Y($U)._applyBodyHighContrastModeCssClasses()}static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[wT,wT]})}return t})();function Uae(t,i){}class ha{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;componentFactoryResolver;enterAnimationDuration;exitAnimationDuration}const y3="mdc-dialog--open",h8="mdc-dialog--opening",p8="mdc-dialog--closing";let m8=(()=>{class t extends c8{_animationMode=Y(Kr,{optional:!0});_animationStateChanged=new Tt;_animationsEnabled="NoopAnimations"!==this._animationMode;_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?_8(this._config.enterAnimationDuration)??150:0;_exitAnimationDuration=this._animationsEnabled?_8(this._config.exitAnimationDuration)??75:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(f8,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(h8,y3)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(y3),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(y3),this._animationsEnabled?(this._hostElement.style.setProperty(f8,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(p8)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(h8,p8)}_waitForAnimationToComplete(e,n){null!==this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(n,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),null!==this._animationTimer&&clearTimeout(this._animationTimer)}attachComponentPortal(e){const n=super.attachComponentPortal(e);return n.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),n}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(n,o){2&n&&(cc("id",o._config.id),zn("aria-modal",o._config.ariaModal)("role",o._config.role)("aria-labelledby",o._config.ariaLabel?null:o._ariaLabelledByQueue[0])("aria-label",o._config.ariaLabel)("aria-describedby",o._config.ariaDescribedBy||null),Hn("_mat-animation-noopable",!o._animationsEnabled)("mat-mdc-dialog-container-with-actions",o._actionSectionCount>0))},features:[qn],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(n,o){1&n&&(w(0,"div",0)(1,"div",1),te(2,Uae,0,0,"ng-template",2),x()())},dependencies:[ef],styles:['.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mdc-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mdc-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mdc-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mdc-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mdc-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mdc-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mdc-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mdc-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mdc-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mdc-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mdc-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mdc-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mdc-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mdc-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}\n'],encapsulation:2})}return t})();const f8="--mat-dialog-transition-duration";function _8(t){return null==t?null:"number"==typeof t?t:t.endsWith("ms")?Db(t.substring(0,t.length-2)):t.endsWith("s")?1e3*Db(t.substring(0,t.length-1)):"0"===t?0:null}var nM=function(t){return t[t.OPEN=0]="OPEN",t[t.CLOSING=1]="CLOSING",t[t.CLOSED=2]="CLOSED",t}(nM||{});class xs{_ref;_containerInstance;componentInstance;componentRef;disableClose;id;_afterOpened=new Ee;_beforeClosed=new Ee;_result;_closeFallbackTimeout;_state=nM.OPEN;_closeInteractionType;constructor(i,e,n){this._ref=i,this._containerInstance=n,this.disableClose=e.disableClose,this.id=i.id,i.addPanelClass("mat-mdc-dialog-panel"),n._animationStateChanged.pipe(or(o=>"opened"===o.state),$a(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),n._animationStateChanged.pipe(or(o=>"closed"===o.state),$a(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),i.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),va(this.backdropClick(),this.keydownEvents().pipe(or(o=>27===o.keyCode&&!this.disableClose&&!ns(o)))).subscribe(o=>{this.disableClose||(o.preventDefault(),function g8(t,i,e){return t._closeInteractionType=i,t.close(e)}(this,"keydown"===o.type?"keyboard":"mouse"))})}close(i){this._result=i,this._containerInstance._animationStateChanged.pipe(or(e=>"closing"===e.state),$a(1)).subscribe(e=>{this._beforeClosed.next(i),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),e.totalTime+100)}),this._state=nM.CLOSING,this._containerInstance._startExitAnimation()}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(i){let e=this._ref.config.positionStrategy;return i&&(i.left||i.right)?i.left?e.left(i.left):e.right(i.right):e.centerHorizontally(),i&&(i.top||i.bottom)?i.top?e.top(i.top):e.bottom(i.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(i="",e=""){return this._ref.updateSize(i,e),this}addPanelClass(i){return this._ref.addPanelClass(i),this}removePanelClass(i){return this._ref.removePanelClass(i),this}getState(){return this._state}_finishDialogClose(){this._state=nM.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}}const Ks=new yt("MatMdcDialogData"),$ae=new yt("mat-mdc-dialog-default-options"),b8=new yt("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.block()}});let pa=(()=>{class t{_overlay=Y(is);_defaultOptions=Y($ae,{optional:!0});_scrollStrategy=Y(b8);_parentDialog=Y(t,{optional:!0,skipSelf:!0});_idGenerator=Y(ta);_dialog=Y(u8);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new Ee;_afterOpenedAtThisLevel=new Ee;dialogConfigClass=ha;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){const e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=Tx(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(ua(void 0)));constructor(){this._dialogRefConstructor=xs,this._dialogContainerType=m8,this._dialogDataToken=Ks}open(e,n){let o;(n={...this._defaultOptions||new ha,...n}).id=n.id||this._idGenerator.getId("mat-mdc-dialog-"),n.scrollStrategy=n.scrollStrategy||this._scrollStrategy();const r=this._dialog.open(e,{...n,positionStrategy:this._overlay.position().global().centerHorizontally().centerVertically(),disableClose:!0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:n},{provide:IT,useValue:n}]},templateContext:()=>({dialogRef:o}),providers:(u,y,I)=>(o=new this._dialogRefConstructor(u,n,I),o.updatePosition(n?.position),[{provide:this._dialogContainerType,useValue:I},{provide:this._dialogDataToken,useValue:y.data},{provide:this._dialogRefConstructor,useValue:o}])});return o.componentRef=r.componentRef,o.componentInstance=r.componentInstance,this.openDialogs.push(o),this.afterOpened.next(o),o.afterClosed().subscribe(()=>{const u=this.openDialogs.indexOf(o);u>-1&&(this.openDialogs.splice(u,1),this.openDialogs.length||this._getAfterAllClosed().next())}),o}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(n=>n.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let n=e.length;for(;n--;)e[n].close()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),y8=(()=>{class t{_dialogRef=Y(xs,{optional:!0});_elementRef=Y(Pn);_dialog=Y(pa);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=function v8(t,i){let e=t.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?i.find(n=>n.id===e.id):null}(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t})}return t})(),Eb=(()=>{class t extends y8{id=Y(ta).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(n,o){2&n&&cc("id",o.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[qn]})}return t})(),Os=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[JF([Xv])]})}return t})(),Fl=(()=>{class t extends y8{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(n,o){2&n&&Hn("mat-mdc-dialog-actions-align-start","start"===o.align)("mat-mdc-dialog-actions-align-center","center"===o.align)("mat-mdc-dialog-actions-align-end","end"===o.align)},inputs:{align:"align"},features:[qn]})}return t})();let Wae=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[pa],imports:[Vae,Ib,Gv,Ki,Ki]})}return t})();const li_backendURL="https://api."+location.hostname;class Zae{username;organization;password}class iM{mfa_available=!1;require_mfa=!1;has_totp=!1;org_requires_mfa=!1;has_password=!1;has_passkey=!1}const Yae=["addListener","removeListener"],Xae=["addEventListener","removeEventListener"],Kae=["on","off"];function oM(t,i,e,n){if(an(e)&&(n=e,e=void 0),n)return oM(t,i,e).pipe(mO(n));const[o,r]=function ese(t){return an(t.addEventListener)&&an(t.removeEventListener)}(t)?Xae.map(u=>y=>t[u](i,y,e)):function Qae(t){return an(t.addListener)&&an(t.removeListener)}(t)?Yae.map(x8(t,i)):function Jae(t){return an(t.on)&&an(t.off)}(t)?Kae.map(x8(t,i)):[];if(!o&&aO(t))return dc(u=>oM(u,i,e))(td(t));if(!o)throw new TypeError("Invalid event target");return new se(u=>{const y=(...I)=>u.next(1r(y)})}function x8(t,i){return e=>n=>t[e](i,n)}const xu=new yt("[WA_WINDOW]",{factory:()=>{const{defaultView:t}=Y(Oo);if(!t)throw new Error("Window is not available");return t}}),w8=(new yt("[WA_ANIMATION_FRAME]",{factory:()=>{const{requestAnimationFrame:t,cancelAnimationFrame:i}=Y(xu);return new se(n=>{let o=NaN;const r=u=>{n.next(u),o=t(r)};return o=t(r),()=>{i(o)}}).pipe(NE())}}),new yt("[WA_CACHES]",{factory:()=>Y(xu).caches}),new yt("[WA_CRYPTO]",{factory:()=>Y(xu).crypto}),new yt("[WA_CSS]",{factory:()=>Y(xu).CSS??{escape:t=>t,supports:()=>!1}}),new yt("[WA_HISTORY]",{factory:()=>Y(xu).history}),new yt("[WA_LOCAL_STORAGE]",{factory:()=>Y(xu).localStorage}),new yt("[WA_LOCATION]",{factory:()=>Y(xu).location}),new yt("[WA_NAVIGATOR]",{factory:()=>Y(xu).navigator})),C8=w8;new yt("[WA_MEDIA_DEVICES]",{factory:()=>Y(C8).mediaDevices}),new yt("[WA_NETWORK_INFORMATION]",{factory:()=>Y(w8).connection||null}),new yt("[WA_PAGE_VISIBILITY]",{factory:()=>{const t=Y(Oo);return oM(t,"visibilitychange").pipe(ua(0),kt(()=>"hidden"!==t.visibilityState),TT(),KP({refCount:!1,bufferSize:1}))}}),new yt("[WA_PERFORMANCE]",{factory:()=>Y(xu).performance}),new yt("[WA_SCREEN]",{factory:()=>Y(xu).screen}),new yt("[WA_SESSION_STORAGE]",{factory:()=>Y(xu).sessionStorage}),new yt("[WA_SPEECH_RECOGNITION]: [SPEECH_RECOGNITION]",{factory:()=>{const t=Y(xu);return t.speechRecognition||t.webkitSpeechRecognition||null}}),new yt("[WA_SPEECH_SYNTHESIS]",{factory:()=>Y(xu).speechSynthesis}),new yt("[WA_USER_AGENT]",{factory:()=>Y(C8).userAgent});let ET=(()=>{class t{windowRef;constructor(e){this.windowRef=e}saveUser(e){this.windowRef.sessionStorage.setItem("user",e)}getUser(){return this.windowRef.sessionStorage.getItem("user")}clearUser(){this.windowRef.sessionStorage.removeItem("user")}saveUserId(e){this.windowRef.sessionStorage.setItem("userID",e.toString())}getUserId(){return Number.parseInt(this.windowRef.sessionStorage.getItem("userID"))}clearUserId(){this.windowRef.sessionStorage.removeItem("userID")}saveUserDisplayName(e){this.windowRef.sessionStorage.setItem("userDisplayName",e)}getUserDisplayName(){return this.windowRef.sessionStorage.getItem("userDisplayName")}clearUserDisplayName(){this.windowRef.sessionStorage.removeItem("userDisplayName")}saveUserPriv(e){this.windowRef.sessionStorage.setItem("priv",e.toString())}getUserPriv(){return Number.parseInt(this.windowRef.sessionStorage.getItem("priv"))}clearUserPriv(){this.windowRef.sessionStorage.removeItem("priv")}saveMetMFARequirement(e){this.windowRef.sessionStorage.setItem("mfaReqMet",String(e).toLowerCase())}getMetMFARequirement(){return"true"===this.windowRef.sessionStorage.getItem("mfaReqMet")}clearMetMFARequirement(){this.windowRef.sessionStorage.removeItem("mfaReqMet")}saveNeedsMFA(e){this.windowRef.sessionStorage.setItem("needsMFA",String(e).toLowerCase())}getNeedsMFA(){return"true"===this.windowRef.sessionStorage.getItem("needsMFA")}clearNeedsMFA(){this.windowRef.sessionStorage.removeItem("needsMFA")}saveHasPasskey(e){this.windowRef.sessionStorage.setItem("hasPasskey",String(e).toLowerCase())}getHasPasskey(){return"true"===this.windowRef.sessionStorage.getItem("hasPasskey")}clearHasPasskey(){this.windowRef.sessionStorage.removeItem("hasPasskey")}saveHasTOTP(e){this.windowRef.sessionStorage.setItem("hasTOTP",String(e).toLowerCase())}getHasTOTP(){return"true"===this.windowRef.sessionStorage.getItem("hasTOTP")}clearHasTOTP(){this.windowRef.sessionStorage.removeItem("hasTOTP")}saveCanEmailMFA(e){this.windowRef.sessionStorage.setItem("canEmailMFA",String(e).toLowerCase())}getCanEmailMFA(){return"true"===this.windowRef.sessionStorage.getItem("canEmailMFA")}clearCanEmailMFA(){this.windowRef.sessionStorage.removeItem("canEmailMFA")}saveOrganization(e){this.windowRef.sessionStorage.setItem("organization",e)}getOrganization(){return this.windowRef.sessionStorage.getItem("organization")}clearOrganization(){this.windowRef.sessionStorage.removeItem("organization")}saveOrganizationID(e){this.windowRef.sessionStorage.setItem("organizationID",e.toString())}getOrganizationID(){return Number.parseInt(this.windowRef.sessionStorage.getItem("organizationID"))}clearOrganizationID(){this.windowRef.sessionStorage.removeItem("organizationID")}saveOrganizationDisplayName(e){this.windowRef.sessionStorage.setItem("organizationDisplayName",e)}getOrganizationDisplayName(){return this.windowRef.sessionStorage.getItem("organizationDisplayName")}clearOrganizationDisplayName(){this.windowRef.sessionStorage.removeItem("organizationDisplayName")}saveWatchTowerAccess(e){this.windowRef.sessionStorage.setItem("watchTowerAccess",e.toString())}getWatchTowerAccess(){let e=window.sessionStorage.getItem("watchTowerAccess");return null!=e&&JSON.parse(e.toLowerCase())}clearWatchTowerAccess(){this.windowRef.sessionStorage.removeItem("watchTowerAccess")}saveOrganizationHasNomadAir(e){this.windowRef.sessionStorage.setItem("organizationHasNomadAir",e.toString())}getOrganizationHasNomadAir(){let e=window.sessionStorage.getItem("organizationHasNomadAir");return null!=e&&JSON.parse(e.toLowerCase())}clearOrganizationHasNomadAir(){this.windowRef.sessionStorage.removeItem("organizationHasNomadAir")}saveOrganizationIsDistributor(e){this.windowRef.sessionStorage.setItem("organizationIsDistributor",e.toString())}getOrganizationIsDistributor(){let e=window.sessionStorage.getItem("organizationIsDistributor");return null!=e&&JSON.parse(e.toLowerCase())}clearOrganizationHasIsDistributor(){this.windowRef.sessionStorage.removeItem("organizationIsDistributor")}saveMapStyleURL(e){this.windowRef.sessionStorage.setItem("mapStyleURL",e)}getMapStyleURL(){return window.sessionStorage.getItem("mapStyleURL")}clearMapStyleURL(){this.windowRef.sessionStorage.removeItem("mapStyleURL")}saveMapAPIKey(e){this.windowRef.sessionStorage.setItem("mapAPIKey",e)}getMapAPIKey(){return this.windowRef.sessionStorage.getItem("mapAPIKey")}clearMapAPIKey(){this.windowRef.sessionStorage.removeItem("mapAPIKey")}clearAllUserInfo(){this.clearUser(),this.clearUserId(),this.clearUserDisplayName(),this.clearUserPriv(),this.clearOrganization(),this.clearOrganizationID(),this.clearOrganizationDisplayName(),this.clearWatchTowerAccess(),this.clearOrganizationHasNomadAir(),this.clearOrganizationHasIsDistributor(),this.clearMetMFARequirement(),this.clearNeedsMFA(),this.clearHasPasskey(),this.clearHasTOTP(),this.clearCanEmailMFA()}saveNewTabRoute(e){this.windowRef.sessionStorage.setItem("TargetRoute",e)}getNewTabRoute(){return this.windowRef.sessionStorage.getItem("TargetRoute")}clearNewTabRoute(){this.windowRef.sessionStorage.removeItem("TargetRoute")}static \u0275fac=function(n){return new(n||t)(xn(xu))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Nl=(()=>{class t{static PRIV_ACTIVATEONLY=-1;static PRIV_BASIC=0;static PRIV_ADMIN=1;static PRIV_ADMIN2=2;static PRIV_MASTER=3;tokenStorage=new ET(window);user;userID;userDisplayName;watchTowerAccess;organizationID;organization;organizationDisplayName;organizationIsDistributor;organizationHasNomadAir;metMFARequirement;needsMFA;hasPasskey;hasTotp;canEmailMFA;priv;nomadAirStatus={};droppedDevices=[];latest_nomadAirSchedule="";watchTowerExpirationTime="";error_msg;save(){this.tokenStorage.saveUser(this.user),this.tokenStorage.saveUserId(this.userID),this.tokenStorage.saveUserDisplayName(this.userDisplayName),this.tokenStorage.saveUserPriv(this.priv),this.tokenStorage.saveOrganization(this.organization),this.tokenStorage.saveOrganizationID(this.organizationID),this.tokenStorage.saveOrganizationDisplayName(this.organizationDisplayName),this.tokenStorage.saveWatchTowerAccess(this.watchTowerAccess),this.tokenStorage.saveOrganizationHasNomadAir(this.organizationHasNomadAir),this.tokenStorage.saveOrganizationIsDistributor(this.organizationIsDistributor),this.tokenStorage.saveMetMFARequirement(this.metMFARequirement),this.tokenStorage.saveNeedsMFA(this.needsMFA),this.tokenStorage.saveHasPasskey(this.hasPasskey),this.tokenStorage.saveHasTOTP(this.hasTotp),this.tokenStorage.saveCanEmailMFA(this.canEmailMFA)}load(){return this.user=this.tokenStorage.getUser(),this.userID=this.tokenStorage.getUserId(),this.userDisplayName=this.tokenStorage.getUserDisplayName(),this.priv=this.tokenStorage.getUserPriv(),this.organization=this.tokenStorage.getOrganization(),this.organizationID=this.tokenStorage.getOrganizationID(),this.organizationDisplayName=this.tokenStorage.getOrganizationDisplayName(),this.watchTowerAccess=this.tokenStorage.getWatchTowerAccess(),this.organizationHasNomadAir=this.tokenStorage.getOrganizationHasNomadAir(),this.organizationIsDistributor=this.tokenStorage.getOrganizationIsDistributor(),this.metMFARequirement=this.tokenStorage.getMetMFARequirement(),this.needsMFA=this.tokenStorage.getNeedsMFA(),this.hasPasskey=this.tokenStorage.getHasPasskey(),this.hasTotp=this.tokenStorage.getHasTOTP(),this.canEmailMFA=this.tokenStorage.getCanEmailMFA(),!!this.userDisplayName&&!!this.organizationDisplayName}delete(){this.tokenStorage.clearAllUserInfo()}isAdmin(){return this.priv>=t.PRIV_ADMIN}isAdmin2(){return this.priv>=t.PRIV_ADMIN2}isAdmin2Exact(){return this.priv==t.PRIV_ADMIN2}isMasterAdmin(){return this.priv>=t.PRIV_MASTER}isOrgAdmin(){return this.isMasterDBUser()?this.isMasterAdmin():this.isAdmin()}isMasterDBUser(){return"neurotronics.com"==this.organization}isDistributorAdmin(){return this.organizationIsDistributor&&this.isAdmin()}isDistributor(){return this.organizationIsDistributor}canAccessWatchTower(){return this.watchTowerAccess&&(this.organizationHasNomadAir||this.isMasterDBUser()||this.isDistributor())}loginRequiredMFA(){return this.needsMFA&&!this.metMFARequirement}getNomadAirSessionTimeRemaining(){let e="";if(""!=this.watchTowerExpirationTime){let n=new Date(this.watchTowerExpirationTime),o=new Date,u=(n.getTime()-o.getTime())/1e3,y=Math.floor(u/3600);y<0&&(y=0);let I=Math.floor(u/60)-60*y;I<0&&(I=0);let V=[];y>0&&V.push(y.toString()+" hours"),V.push(I.toString()+" minutes"),e=V.join(", ")}return e}}return t})();function nf(t){const i=new Uint8Array(t);let e="";for(const o of i)e+=String.fromCharCode(o);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rM(t){const i=t.replace(/-/g,"+").replace(/_/g,"/"),n=i.padEnd(i.length+(4-i.length%4)%4,"="),o=atob(n),r=new ArrayBuffer(o.length),u=new Uint8Array(r);for(let y=0;y"public-key"===o.type).length?new Ec({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Ec({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if("SecurityError"===t.name){const n=window.location.hostname;if(!T8(n))return new Ec({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t});if(e.rp.id!==n)return new Ec({message:`The RP ID "${e.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else if("TypeError"===t.name){if(e.user.id.byteLength<1||e.user.id.byteLength>64)return new Ec({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if("UnknownError"===t.name)return new Ec({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}({error:Ce,options:o})}if(!r)throw new Error("Registration was not completed");const{id:u,rawId:y,response:I,type:V}=r;let q,ee,me,he;if("function"==typeof I.getTransports&&(q=I.getTransports()),"function"==typeof I.getPublicKeyAlgorithm)try{ee=I.getPublicKeyAlgorithm()}catch(Ce){x3("getPublicKeyAlgorithm()",Ce)}if("function"==typeof I.getPublicKey)try{const Ce=I.getPublicKey();null!==Ce&&(me=nf(Ce))}catch(Ce){x3("getPublicKey()",Ce)}if("function"==typeof I.getAuthenticatorData)try{he=nf(I.getAuthenticatorData())}catch(Ce){x3("getAuthenticatorData()",Ce)}return{id:u,rawId:nf(y),response:{attestationObject:nf(I.attestationObject),clientDataJSON:nf(I.clientDataJSON),transports:q,publicKeyAlgorithm:ee,publicKey:me,authenticatorData:he},type:V,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:I8(r.authenticatorAttachment)}})).apply(this,arguments)}function x3(t,i){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.\n`,i)}function w3(){return(w3=bt(function*(t){const{optionsJSON:i,useBrowserAutofill:e=!1,verifyBrowserAutofillInput:n=!0}=t;if(!aM())throw new Error("WebAuthn is not supported in this browser");let o;0!==i.allowCredentials?.length&&(o=i.allowCredentials?.map(S8));const r={...i,challenge:rM(i.challenge),allowCredentials:o},u={};if(e){if(!(yield function rse(){if(!aM())return new Promise(i=>i(!1));const t=window.PublicKeyCredential;return void 0===t.isConditionalMediationAvailable?new Promise(i=>i(!1)):t.isConditionalMediationAvailable()}()))throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&n)throw Error('No with "webauthn" as the only or last value in its `autocomplete` attribute was detected');u.mediation="conditional",r.allowCredentials=[]}let y;u.publicKey=r,u.signal=D8.createNewAbortSignal();try{y=yield navigator.credentials.get(u)}catch(he){throw function ase({error:t,options:i}){const{publicKey:e}=i;if(!e)throw Error("options was missing required publicKey property");if("AbortError"===t.name){if(i.signal instanceof AbortSignal)return new Ec({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if("NotAllowedError"===t.name)return new Ec({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if("SecurityError"===t.name){const n=window.location.hostname;if(!T8(n))return new Ec({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t});if(e.rpId!==n)return new Ec({message:`The RP ID "${e.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else if("UnknownError"===t.name)return new Ec({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}({error:he,options:u})}if(!y)throw new Error("Authentication was not completed");const{id:I,rawId:V,response:q,type:ee}=y;let me;return q.userHandle&&(me=nf(q.userHandle)),{id:I,rawId:nf(V),response:{authenticatorData:nf(q.authenticatorData),clientDataJSON:nf(q.clientDataJSON),signature:nf(q.signature),userHandle:me},type:ee,clientExtensionResults:y.getClientExtensionResults(),authenticatorAttachment:I8(y.authenticatorAttachment)}})).apply(this,arguments)}const lse=["code"];let sM=(()=>{class t{submit=new Tt;codeInputs;code_text=Array(6).fill("");setFocus(){this.codeInputs.toArray()[0]?.nativeElement.focus()}onInput(e,n){1===e.target.value.length&&n0&&setTimeout(()=>{this.codeInputs.toArray()[n-1].nativeElement?.focus()},0);else if("Enter"===e.key){const o=this.getEnteredCode();this.codeInputs.toArray()[5].nativeElement==document.activeElement&&6==o.length&&this.submit.emit(!0)}}onPaste(e){e.preventDefault(),(e.clipboardData?.getData("text")||"").slice(0,6).split("").forEach((u,y)=>{y{document.addEventListener(e,this._delegateEventHandler,E8)})}removeHandler(i,e,n){const o=this._events.get(i);if(!o)return;const r=o.get(e);r&&(r.delete(n),0===r.size&&o.delete(e),0===o.size&&(this._events.delete(i),document.removeEventListener(i,this._delegateEventHandler,E8)))}_delegateEventHandler=i=>{const e=Kp(i);e&&this._events.get(i.type)?.forEach((n,o)=>{(o===e||o.contains(e))&&n.forEach(r=>r.handleEvent(i))})}}const lM={enterDuration:225,exitDuration:150},M8=QE({passive:!0,capture:!0}),A8=["mousedown","touchstart"],k8=["mouseup","mouseleave","touchend","touchcancel"];let pse=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["ng-component"]],hostAttrs:["mat-ripple-style-loader",""],decls:0,vars:0,template:function(n,o){},styles:[".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}\n"],encapsulation:2,changeDetection:0})}return t})();class Ox{_target;_ngZone;_platform;_containerElement;_triggerElement;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect;static _eventManager=new use;constructor(i,e,n,o,r){this._target=i,this._ngZone=e,this._platform=o,o.isBrowser&&(this._containerElement=S_(n)),r&&r.get(Rs).load(pse)}fadeInRipple(i,e,n={}){const o=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),r={...lM,...n.animation};n.centered&&(i=o.left+o.width/2,e=o.top+o.height/2);const u=n.radius||function mse(t,i,e){const n=Math.max(Math.abs(t-e.left),Math.abs(t-e.right)),o=Math.max(Math.abs(i-e.top),Math.abs(i-e.bottom));return Math.sqrt(n*n+o*o)}(i,e,o),y=i-o.left,I=e-o.top,V=r.enterDuration,q=document.createElement("div");q.classList.add("mat-ripple-element"),q.style.left=y-u+"px",q.style.top=I-u+"px",q.style.height=2*u+"px",q.style.width=2*u+"px",null!=n.color&&(q.style.backgroundColor=n.color),q.style.transitionDuration=`${V}ms`,this._containerElement.appendChild(q);const ee=window.getComputedStyle(q),he=ee.transitionDuration,Ce="none"===ee.transitionProperty||"0s"===he||"0s, 0s"===he||0===o.width&&0===o.height,je=new dse(this,q,n,Ce);q.style.transform="scale3d(1, 1, 1)",je.state=Yh.FADING_IN,n.persistent||(this._mostRecentTransientRipple=je);let mt=null;return!Ce&&(V||r.exitDuration)&&this._ngZone.runOutsideAngular(()=>{const Lt=()=>{mt&&(mt.fallbackTimer=null),clearTimeout(Mn),this._finishRippleTransition(je)},At=()=>this._destroyRipple(je),Mn=setTimeout(At,V+100);q.addEventListener("transitionend",Lt),q.addEventListener("transitioncancel",At),mt={onTransitionEnd:Lt,onTransitionCancel:At,fallbackTimer:Mn}}),this._activeRipples.set(je,mt),(Ce||!V)&&this._finishRippleTransition(je),je}fadeOutRipple(i){if(i.state===Yh.FADING_OUT||i.state===Yh.HIDDEN)return;const e=i.element,n={...lM,...i.config.animation};e.style.transitionDuration=`${n.exitDuration}ms`,e.style.opacity="0",i.state=Yh.FADING_OUT,(i._animationForciblyDisabledThroughCss||!n.exitDuration)&&this._finishRippleTransition(i)}fadeOutAll(){this._getActiveRipples().forEach(i=>i.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(i=>{i.config.persistent||i.fadeOut()})}setupTriggerEvents(i){const e=S_(i);!this._platform.isBrowser||!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,A8.forEach(n=>{Ox._eventManager.addHandler(this._ngZone,n,e,this)}))}handleEvent(i){"mousedown"===i.type?this._onMousedown(i):"touchstart"===i.type?this._onTouchStart(i):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{k8.forEach(e=>{this._triggerElement.addEventListener(e,this,M8)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(i){i.state===Yh.FADING_IN?this._startFadeOutTransition(i):i.state===Yh.FADING_OUT&&this._destroyRipple(i)}_startFadeOutTransition(i){const e=i===this._mostRecentTransientRipple,{persistent:n}=i.config;i.state=Yh.VISIBLE,!n&&(!e||!this._isPointerDown)&&i.fadeOut()}_destroyRipple(i){const e=this._activeRipples.get(i)??null;this._activeRipples.delete(i),this._activeRipples.size||(this._containerRect=null),i===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),i.state=Yh.HIDDEN,null!==e&&(i.element.removeEventListener("transitionend",e.onTransitionEnd),i.element.removeEventListener("transitioncancel",e.onTransitionCancel),null!==e.fallbackTimer&&clearTimeout(e.fallbackTimer)),i.element.remove()}_onMousedown(i){const e=m3(i),n=this._lastTouchStartEvent&&Date.now(){!i.config.persistent&&(i.state===Yh.VISIBLE||i.config.terminateOnPointerUp&&i.state===Yh.FADING_IN)&&i.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){const i=this._triggerElement;i&&(A8.forEach(e=>Ox._eventManager.removeHandler(e,i,this)),this._pointerUpEventsRegistered&&(k8.forEach(e=>i.removeEventListener(e,this,M8)),this._pointerUpEventsRegistered=!1))}}const cM=new yt("mat-ripple-global-options");let Mb=(()=>{class t{_elementRef=Y(Pn);_animationMode=Y(Kr,{optional:!0});color;unbounded;centered;radius=0;animation;get disabled(){return this._disabled}set disabled(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}_disabled=!1;get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}_trigger;_rippleRenderer;_globalOptions;_isInitialized=!1;constructor(){const e=Y(tn),n=Y(ea),o=Y(cM,{optional:!0}),r=Y(Ke);this._globalOptions=o||{},this._rippleRenderer=new Ox(this,e,this._elementRef,n,r)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:{...this._globalOptions.animation,..."NoopAnimations"===this._animationMode?{enterDuration:0,exitDuration:0}:{},...this.animation},terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(e,n=0,o){return"number"==typeof e?this._rippleRenderer.fadeInRipple(e,n,{...this.rippleConfig,...o}):this._rippleRenderer.fadeInRipple(0,0,{...this.rippleConfig,...e})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mat-ripple-unbounded",o.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"]})}return t})();const fse={capture:!0},_se=["focus","mousedown","mouseenter","touchstart"],C3="mat-ripple-loader-uninitialized",S3="mat-ripple-loader-class-name",R8="mat-ripple-loader-centered",dM="mat-ripple-loader-disabled";let O8=(()=>{class t{_document=Y(Oo);_animationMode=Y(Kr,{optional:!0});_globalRippleOptions=Y(cM,{optional:!0});_platform=Y(ea);_ngZone=Y(tn);_injector=Y(Ke);_eventCleanups;_hosts=new Map;constructor(){const e=Y(Qc).createRenderer(null,null);this._eventCleanups=this._ngZone.runOutsideAngular(()=>_se.map(n=>ec(e,this._document,n,this._onInteraction,fse)))}ngOnDestroy(){const e=this._hosts.keys();for(const n of e)this.destroyRipple(n);this._eventCleanups.forEach(n=>n())}configureRipple(e,n){e.setAttribute(C3,this._globalRippleOptions?.namespace??""),(n.className||!e.hasAttribute(S3))&&e.setAttribute(S3,n.className||""),n.centered&&e.setAttribute(R8,""),n.disabled&&e.setAttribute(dM,"")}setDisabled(e,n){const o=this._hosts.get(e);o?(o.target.rippleDisabled=n,!n&&!o.hasSetUpEvents&&(o.hasSetUpEvents=!0,o.renderer.setupTriggerEvents(e))):n?e.setAttribute(dM,""):e.removeAttribute(dM)}_onInteraction=e=>{const n=Kp(e);if(n instanceof HTMLElement){const o=n.closest(`[${C3}="${this._globalRippleOptions?.namespace??""}"]`);o&&this._createRipple(o)}};_createRipple(e){if(!this._document||this._hosts.has(e))return;e.querySelector(".mat-ripple")?.remove();const n=this._document.createElement("span");n.classList.add("mat-ripple",e.getAttribute(S3)),e.append(n);const o="NoopAnimations"===this._animationMode,r=this._globalRippleOptions,u=o?0:r?.animation?.enterDuration??lM.enterDuration,y=o?0:r?.animation?.exitDuration??lM.exitDuration,I={rippleDisabled:o||r?.disabled||e.hasAttribute(dM),rippleConfig:{centered:e.hasAttribute(R8),terminateOnPointerUp:r?.terminateOnPointerUp,animation:{enterDuration:u,exitDuration:y}}},V=new Ox(I,this._ngZone,n,this._platform,this._injector),q=!I.rippleDisabled;q&&V.setupTriggerEvents(e),this._hosts.set(e,{target:I,renderer:V,hasSetUpEvents:q}),e.removeAttribute(C3)}destroyRipple(e){const n=this._hosts.get(e);n&&(n.renderer._removeTriggerEvents(),this._hosts.delete(e))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),wu=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["structural-styles"]],decls:0,vars:0,template:function(n,o){},styles:['.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}\n'],encapsulation:2,changeDetection:0})}return t})();const P8=["mat-icon-button",""],L8=["*"],yse=new yt("MAT_BUTTON_CONFIG"),vse=[{attribute:"mat-button",mdcClasses:["mdc-button","mat-mdc-button"]},{attribute:"mat-flat-button",mdcClasses:["mdc-button","mdc-button--unelevated","mat-mdc-unelevated-button"]},{attribute:"mat-raised-button",mdcClasses:["mdc-button","mdc-button--raised","mat-mdc-raised-button"]},{attribute:"mat-stroked-button",mdcClasses:["mdc-button","mdc-button--outlined","mat-mdc-outlined-button"]},{attribute:"mat-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mat-mdc-fab"]},{attribute:"mat-mini-fab",mdcClasses:["mdc-fab","mat-mdc-fab-base","mdc-fab--mini","mat-mdc-mini-fab"]},{attribute:"mat-icon-button",mdcClasses:["mdc-icon-button","mat-mdc-icon-button"]}];let MT=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);_animationMode=Y(Kr,{optional:!0});_focusMonitor=Y(eh);_rippleLoader=Y(O8);_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=e,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;constructor(){Y(Rs).load(wu);const e=Y(yse,{optional:!0}),n=this._elementRef.nativeElement,o=n.classList;this.disabledInteractive=e?.disabledInteractive??!1,this.color=e?.color??null,this._rippleLoader?.configureRipple(n,{className:"mat-mdc-button-ripple"});for(const{attribute:r,mdcClasses:u}of vse)n.hasAttribute(r)&&o.add(...u)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(e="program",n){e?this._focusMonitor.focusVia(this._elementRef.nativeElement,e,n):this._elementRef.nativeElement.focus(n)}_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:!(!this.disabled||!this.disabledInteractive)||null}_getDisabledAttribute(){return!(this.disabledInteractive||!this.disabled)||null}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",fn],disabled:[2,"disabled","disabled",fn],ariaDisabled:[2,"aria-disabled","ariaDisabled",fn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]}})}return t})(),F8=(()=>{class t extends MT{_renderer=Y(Hr);_cleanupClick;tabIndex;ngOnInit(){this._ngZone.runOutsideAngular(()=>{this._cleanupClick=this._renderer.listen(this._elementRef.nativeElement,"click",this._haltDisabledEvents)})}ngOnDestroy(){super.ngOnDestroy(),this._cleanupClick?.()}_haltDisabledEvents=e=>{this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())};_getAriaDisabled(){return null!=this.ariaDisabled?this.ariaDisabled:this.disabled||null}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,inputs:{tabIndex:[2,"tabIndex","tabIndex",e=>null==e?void 0:Ql(e)]},features:[qn]})}return t})(),qa=(()=>{class t extends MT{constructor(){super(),this._rippleLoader.configureRipple(this._elementRef.nativeElement,{centered:!0})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["button","mat-icon-button",""]],hostVars:14,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[qn],attrs:P8,ngContentSelectors:L8,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(),Re(0,"span",0),On(1),Re(2,"span",1)(3,"span",2))},styles:['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 40px);height:var(--mdc-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 40px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size, 24px);color:var(--mdc-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display, block)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mdc-icon-button-icon-size, 24px);height:var(--mdc-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],encapsulation:2,changeDetection:0})}return t})(),T3=(()=>{class t extends F8{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["a","mat-icon-button",""]],hostVars:15,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0))},exportAs:["matButton","matAnchor"],features:[qn],attrs:P8,ngContentSelectors:L8,decls:4,vars:0,consts:[[1,"mat-mdc-button-persistent-ripple","mdc-icon-button__ripple"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(),Re(0,"span",0),On(1),Re(2,"span",1)(3,"span",2))},styles:['.mat-mdc-icon-button{-webkit-user-select:none;user-select:none;display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:rgba(0,0,0,0);fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;z-index:0;overflow:visible;border-radius:50%;flex-shrink:0;text-align:center;width:var(--mdc-icon-button-state-layer-size, 40px);height:var(--mdc-icon-button-state-layer-size, 40px);padding:calc(calc(var(--mdc-icon-button-state-layer-size, 40px) - var(--mdc-icon-button-icon-size, 24px)) / 2);font-size:var(--mdc-icon-button-icon-size, 24px);color:var(--mdc-icon-button-icon-color, var(--mat-sys-on-surface-variant));-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-icon-button .mat-mdc-button-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple,.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-icon-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-icon-button .mdc-button__label,.mat-mdc-icon-button .mat-icon{z-index:1;position:relative}.mat-mdc-icon-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-icon-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-icon-button .mat-ripple-element{background-color:var(--mat-icon-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface-variant) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-icon-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-icon-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-icon-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-icon-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-icon-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-icon-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-icon-button-touch-target-display, block)}.mat-mdc-icon-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-icon-button[disabled],.mat-mdc-icon-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-icon-button-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-icon-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-icon-button img,.mat-mdc-icon-button svg{width:var(--mdc-icon-button-icon-size, 24px);height:var(--mdc-icon-button-icon-size, 24px);vertical-align:baseline}.mat-mdc-icon-button .mat-mdc-button-persistent-ripple{border-radius:50%}.mat-mdc-icon-button[hidden]{display:none}.mat-mdc-icon-button.mat-unthemed:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-primary:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-accent:not(.mdc-ripple-upgraded):focus::before,.mat-mdc-icon-button.mat-warn:not(.mdc-ripple-upgraded):focus::before{background:rgba(0,0,0,0);opacity:1}\n',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],encapsulation:2,changeDetection:0})}return t})(),e0=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})();const N8=["mat-button",""],AT=[[["",8,"material-icons",3,"iconPositionEnd",""],["mat-icon",3,"iconPositionEnd",""],["","matButtonIcon","",3,"iconPositionEnd",""]],"*",[["","iconPositionEnd","",8,"material-icons"],["mat-icon","iconPositionEnd",""],["","matButtonIcon","","iconPositionEnd",""]]],kT=[".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])","*",".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"],z8=["mat-fab",""],Cse=["mat-mini-fab",""],B8='.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mdc-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mdc-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mdc-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display, block)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mdc-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mdc-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mdc-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;height:var(--mdc-extended-fab-container-height, 56px);border-radius:var(--mdc-extended-fab-container-shape, var(--mat-sys-corner-large));font-family:var(--mdc-extended-fab-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-extended-fab-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-extended-fab-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-extended-fab-label-text-tracking, var(--mat-sys-label-large-tracking));box-shadow:var(--mdc-extended-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n';let ws=(()=>{class t extends MT{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["button","mat-button",""],["button","mat-raised-button",""],["button","mat-flat-button",""],["button","mat-stroked-button",""]],hostVars:14,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[qn],attrs:N8,ngContentSelectors:kT,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(AT),Re(0,"span",0),On(1),w(2,"span",1),On(3,1),x(),On(4,2),Re(5,"span",2)(6,"span",3)),2&n&&Hn("mdc-button__ripple",!o._isFab)("mdc-fab__ripple",o._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}\n',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],encapsulation:2,changeDetection:0})}return t})(),Sse=(()=>{class t extends F8{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["a","mat-button",""],["a","mat-raised-button",""],["a","mat-flat-button",""],["a","mat-stroked-button",""]],hostVars:15,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0))},exportAs:["matButton","matAnchor"],features:[qn],attrs:N8,ngContentSelectors:kT,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(AT),Re(0,"span",0),On(1),w(2,"span",1),On(3,1),x(),On(4,2),Re(5,"span",2)(6,"span",3)),2&n&&Hn("mdc-button__ripple",!o._isFab)("mdc-fab__ripple",o._isFab)},styles:['.mat-mdc-button-base{text-decoration:none}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-text-button-horizontal-padding, 12px);height:var(--mdc-text-button-container-height, 40px);font-family:var(--mdc-text-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-text-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-text-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-text-button-label-text-transform);font-weight:var(--mdc-text-button-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mdc-text-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mdc-text-button-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-text-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-text-button-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-offset, -4px);margin-left:var(--mat-text-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-text-button-icon-spacing, 8px);margin-left:var(--mat-text-button-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-text-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-text-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-text-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-text-button-touch-target-display, block)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-filled-button-container-height, 40px);font-family:var(--mdc-filled-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-filled-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-filled-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-filled-button-label-text-transform);font-weight:var(--mdc-filled-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-filled-button-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-offset, -8px);margin-left:var(--mat-filled-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-filled-button-icon-spacing, 8px);margin-left:var(--mat-filled-button-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-filled-button-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-filled-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-filled-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-filled-button-touch-target-display, block)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mdc-filled-button-label-text-color, var(--mat-sys-on-primary));background-color:var(--mdc-filled-button-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mdc-filled-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-filled-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-filled-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mdc-protected-button-container-elevation-shadow, var(--mat-sys-level1));height:var(--mdc-protected-button-container-height, 40px);font-family:var(--mdc-protected-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-protected-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-protected-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-protected-button-label-text-transform);font-weight:var(--mdc-protected-button-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-protected-button-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-offset, -8px);margin-left:var(--mat-protected-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-protected-button-icon-spacing, 8px);margin-left:var(--mat-protected-button-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-protected-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-protected-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-protected-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-protected-button-touch-target-display, block)}.mat-mdc-raised-button:not(:disabled){color:var(--mdc-protected-button-label-text-color, var(--mat-sys-primary));background-color:var(--mdc-protected-button-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mdc-protected-button-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mdc-protected-button-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mdc-protected-button-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mdc-protected-button-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-protected-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mdc-protected-button-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mdc-protected-button-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mdc-outlined-button-container-height, 40px);font-family:var(--mdc-outlined-button-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-outlined-button-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mdc-outlined-button-label-text-transform);font-weight:var(--mdc-outlined-button-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mdc-outlined-button-container-shape, var(--mat-sys-corner-full));border-width:var(--mdc-outlined-button-outline-width, 1px);padding:0 var(--mat-outlined-button-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-offset, -8px);margin-left:var(--mat-outlined-button-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-outlined-button-icon-spacing, 8px);margin-left:var(--mat-outlined-button-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-outlined-button-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-outlined-button-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-outlined-button-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%);display:var(--mat-outlined-button-touch-target-display, block)}.mat-mdc-outlined-button:not(:disabled){color:var(--mdc-outlined-button-label-text-color, var(--mat-sys-primary));border-color:var(--mdc-outlined-button-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mdc-outlined-button-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mdc-outlined-button-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}\n',"@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}\n"],encapsulation:2,changeDetection:0})}return t})();const D3=new yt("mat-mdc-fab-default-options",{providedIn:"root",factory:V8});function V8(){return{color:"accent"}}const Px=V8();let Ab=(()=>{class t extends MT{_options=Y(D3,{optional:!0});_isFab=!0;extended;constructor(){super(),this._options=this._options||Px,this.color=this._options.color||Px.color}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["button","mat-fab",""]],hostVars:18,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0)("mdc-fab--extended",o.extended)("mat-mdc-extended-fab",o.extended))},inputs:{extended:[2,"extended","extended",fn]},exportAs:["matButton"],features:[qn],attrs:z8,ngContentSelectors:kT,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(AT),Re(0,"span",0),On(1),w(2,"span",1),On(3,1),x(),On(4,2),Re(5,"span",2)(6,"span",3)),2&n&&Hn("mdc-button__ripple",!o._isFab)("mdc-fab__ripple",o._isFab)},styles:['.mat-mdc-fab-base{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:56px;height:56px;padding:0;border:none;fill:currentColor;text-decoration:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;overflow:visible;transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1),opacity 15ms linear 30ms,transform 270ms 0ms cubic-bezier(0, 0, 0.2, 1);flex-shrink:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-fab-base .mat-mdc-button-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple,.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-fab-base .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-fab-base .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-fab-base .mdc-button__label,.mat-mdc-fab-base .mat-icon{z-index:1;position:relative}.mat-mdc-fab-base .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute}.mat-mdc-fab-base:focus>.mat-focus-indicator::before{content:""}.mat-mdc-fab-base._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-fab-base::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-fab-base[hidden]{display:none}.mat-mdc-fab-base::-moz-focus-inner{padding:0;border:0}.mat-mdc-fab-base:active,.mat-mdc-fab-base:focus{outline:none}.mat-mdc-fab-base:hover{cursor:pointer}.mat-mdc-fab-base>svg{width:100%}.mat-mdc-fab-base .mat-icon,.mat-mdc-fab-base .material-icons{transition:transform 180ms 90ms cubic-bezier(0, 0, 0.2, 1);fill:currentColor;will-change:transform}.mat-mdc-fab-base .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-fab-base[disabled],.mat-mdc-fab-base[disabled]:focus,.mat-mdc-fab-base.mat-mdc-button-disabled,.mat-mdc-fab-base.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-fab-base.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab{background-color:var(--mdc-fab-container-color, var(--mat-sys-primary-container));border-radius:var(--mdc-fab-container-shape, var(--mat-sys-corner-large));color:var(--mat-fab-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mdc-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:hover{box-shadow:var(--mdc-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-fab:focus{box-shadow:var(--mdc-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab:active,.mat-mdc-fab:focus:active{box-shadow:var(--mdc-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-fab[disabled],.mat-mdc-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-touch-target-display, block)}.mat-mdc-fab .mat-ripple-element{background-color:var(--mat-fab-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-disabled-state-layer-color)}.mat-mdc-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-mini-fab{width:40px;height:40px;background-color:var(--mdc-fab-small-container-color, var(--mat-sys-primary-container));border-radius:var(--mdc-fab-small-container-shape, var(--mat-sys-corner-medium));color:var(--mat-fab-small-foreground-color, var(--mat-sys-on-primary-container, inherit));box-shadow:var(--mdc-fab-small-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:hover{box-shadow:var(--mdc-fab-small-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-mini-fab:focus{box-shadow:var(--mdc-fab-small-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab:active,.mat-mdc-mini-fab:focus:active{box-shadow:var(--mdc-fab-small-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-mini-fab[disabled],.mat-mdc-mini-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-fab-small-disabled-state-foreground-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-fab-small-disabled-state-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-mini-fab .mat-mdc-button-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%);display:var(--mat-fab-small-touch-target-display)}.mat-mdc-mini-fab .mat-ripple-element{background-color:var(--mat-fab-small-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-mini-fab .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-state-layer-color, var(--mat-sys-on-primary-container))}.mat-mdc-mini-fab.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-fab-small-disabled-state-layer-color)}.mat-mdc-mini-fab:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-mini-fab.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-mini-fab.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-mini-fab:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-fab-small-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-extended-fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;border-radius:24px;padding-left:20px;padding-right:20px;width:auto;max-width:100%;line-height:normal;height:var(--mdc-extended-fab-container-height, 56px);border-radius:var(--mdc-extended-fab-container-shape, var(--mat-sys-corner-large));font-family:var(--mdc-extended-fab-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mdc-extended-fab-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-extended-fab-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-extended-fab-label-text-tracking, var(--mat-sys-label-large-tracking));box-shadow:var(--mdc-extended-fab-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:hover{box-shadow:var(--mdc-extended-fab-hover-container-elevation-shadow, var(--mat-sys-level4))}.mat-mdc-extended-fab:focus{box-shadow:var(--mdc-extended-fab-focus-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab:active,.mat-mdc-extended-fab:focus:active{box-shadow:var(--mdc-extended-fab-pressed-container-elevation-shadow, var(--mat-sys-level3))}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab.mat-mdc-button-disabled{cursor:default;pointer-events:none}.mat-mdc-extended-fab[disabled],.mat-mdc-extended-fab[disabled]:focus,.mat-mdc-extended-fab.mat-mdc-button-disabled,.mat-mdc-extended-fab.mat-mdc-button-disabled:focus{box-shadow:none}.mat-mdc-extended-fab.mat-mdc-button-disabled-interactive{pointer-events:auto}[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.mat-icon,[dir=rtl] .mat-mdc-extended-fab .mdc-button__label+.material-icons,.mat-mdc-extended-fab>.mat-icon,.mat-mdc-extended-fab>.material-icons{margin-left:-8px;margin-right:12px}.mat-mdc-extended-fab .mdc-button__label+.mat-icon,.mat-mdc-extended-fab .mdc-button__label+.material-icons,[dir=rtl] .mat-mdc-extended-fab>.mat-icon,[dir=rtl] .mat-mdc-extended-fab>.material-icons{margin-left:12px;margin-right:-8px}.mat-mdc-extended-fab .mat-mdc-button-touch-target{width:100%}\n'],encapsulation:2,changeDetection:0})}return t})(),D_=(()=>{class t extends MT{_options=Y(D3,{optional:!0});_isFab=!0;constructor(){super(),this._options=this._options||Px,this.color=this._options.color||Px.color}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["button","mat-mini-fab",""]],hostVars:14,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0))},exportAs:["matButton"],features:[qn],attrs:Cse,ngContentSelectors:kT,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(AT),Re(0,"span",0),On(1),w(2,"span",1),On(3,1),x(),On(4,2),Re(5,"span",2)(6,"span",3)),2&n&&Hn("mdc-button__ripple",!o._isFab)("mdc-fab__ripple",o._isFab)},styles:[B8],encapsulation:2,changeDetection:0})}return t})(),U8=(()=>{class t extends Sse{_options=Y(D3,{optional:!0});_isFab=!0;extended;constructor(){super(),this._options=this._options||Px,this.color=this._options.color||Px.color}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["a","mat-fab",""]],hostVars:19,hostBindings:function(n,o){2&n&&(zn("disabled",o._getDisabledAttribute())("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-disabled",o._getAriaDisabled()),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-button-disabled",o.disabled)("mat-mdc-button-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mat-unthemed",!o.color)("mat-mdc-button-base",!0)("mdc-fab--extended",o.extended)("mat-mdc-extended-fab",o.extended))},inputs:{extended:[2,"extended","extended",fn]},exportAs:["matButton","matAnchor"],features:[qn],attrs:z8,ngContentSelectors:kT,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,o){1&n&&(ho(AT),Re(0,"span",0),On(1),w(2,"span",1),On(3,1),x(),On(4,2),Re(5,"span",2)(6,"span",3)),2&n&&Hn("mdc-button__ripple",!o._isFab)("mdc-fab__ripple",o._isFab)},styles:[B8],encapsulation:2,changeDetection:0})}return t})(),uM=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,e0,Ki]})}return t})();function Tse(t,i){if(1&t){const e=pt();w(0,"div",1)(1,"button",2),we("click",function(){return fe(e),ge(X().action())}),M(2),x()()}if(2&t){const e=X();E(2),Jt(" ",e.data.action," ")}}const Dse=["label"];function Ise(t,i){}const Ese=Math.pow(2,31)-1;class E3{_overlayRef;instance;containerInstance;_afterDismissed=new Ee;_afterOpened=new Ee;_onAction=new Ee;_durationTimeoutId;_dismissedByAction=!1;constructor(i,e){this._overlayRef=e,this.containerInstance=i,i._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(i){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(i,Ese))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}}const H8=new yt("MatSnackBarData");class hM{politeness="assertive";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"}let j8=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return t})(),$8=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return t})(),G8=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return t})(),q8=(()=>{class t{snackBarRef=Y(E3);data=Y(H8);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["mat-button","","matSnackBarAction","",3,"click"]],template:function(n,o){1&n&&(w(0,"div",0),M(1),x(),te(2,Tse,3,1,"div",1)),2&n&&(E(),Jt(" ",o.data.message,"\n"),E(),Xi(o.hasAction?2:-1))},dependencies:[ws,j8,$8,G8],styles:[".mat-mdc-simple-snack-bar{display:flex}\n"],encapsulation:2,changeDetection:0})}return t})();const M3="_mat-snack-bar-enter",A3="_mat-snack-bar-exit";let W8=(()=>{class t extends zE{_ngZone=Y(tn);_elementRef=Y(Pn);_changeDetectorRef=Y(So);_platform=Y(ea);_rendersRef;_animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});snackBarConfig=Y(hM);_document=Y(Oo);_trackedModals=new Set;_enterFallback;_exitFallback;_renders=new Ee;_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new Ee;_onExit=new Ee;_onEnter=new Ee;_animationState="void";_live;_label;_role;_liveElementId=Y(ta).getId("mat-snack-bar-container-live-");constructor(){super();const e=this.snackBarConfig;this._live="assertive"!==e.politeness||e.announcementMessage?"off"===e.politeness?"off":"polite":"assertive",this._platform.FIREFOX&&("polite"===this._live&&(this._role="status"),"assertive"===this._live&&(this._role="alert")),this._rendersRef=Ag(()=>this._renders.next(),{manualCleanup:!0})}attachComponentPortal(e){this._assertNotAttached();const n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();const n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}attachDomPortal=e=>{this._assertNotAttached();const n=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),n};onAnimationEnd(e){e===A3?this._completeExit():e===M3&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?this._renders.pipe($a(1)).subscribe(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(M3)))}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(M3)},200)))}exit(){return this._destroyed?xi(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?this._renders.pipe($a(1)).subscribe(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(A3)))}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(A3),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit(),this._renders.complete(),this._rendersRef.destroy()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){const e=this._elementRef.nativeElement,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(u=>e.classList.add(u)):e.classList.add(n)),this._exposeToModals();const o=this._label.nativeElement,r="mdc-snackbar__label";o.classList.toggle(r,!o.querySelector(`.${r}`))}_exposeToModals(){const e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let o=0;o{const n=e.getAttribute("aria-owns");if(n){const o=n.replace(this._liveElementId,"").trim();o.length>0?e.setAttribute("aria-owns",o):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;const e=this._elementRef.nativeElement,n=e.querySelector("[aria-hidden]"),o=e.querySelector("[aria-live]");if(n&&o){let r=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&n.contains(document.activeElement)&&(r=document.activeElement),n.removeAttribute("aria-hidden"),o.appendChild(n),r?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,o){if(1&n&&(mn(ef,7),mn(Dse,7)),2&n){let r;Bt(r=Vt())&&(o._portalOutlet=r.first),Bt(r=Vt())&&(o._label=r.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(n,o){1&n&&we("animationend",function(u){return o.onAnimationEnd(u.animationName)})("animationcancel",function(u){return o.onAnimationEnd(u.animationName)}),2&n&&Hn("mat-snack-bar-container-enter","visible"===o._animationState)("mat-snack-bar-container-exit","hidden"===o._animationState)("mat-snack-bar-container-animations-enabled",!o._animationsDisabled)},features:[qn],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(n,o){1&n&&(w(0,"div",1)(1,"div",2,0)(3,"div",3),te(4,Ise,0,0,"ng-template",4),x(),Re(5,"div"),x()()),2&n&&(E(5),zn("aria-live",o._live)("role",o._role)("id",o._liveElementId))},dependencies:[ef],styles:["@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mdc-snackbar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-snackbar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mdc-snackbar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mdc-snackbar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mdc-snackbar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-snackbar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mdc-snackbar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-text-button-state-layer-color:currentColor;--mat-text-button-ripple-color:currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}\n"],encapsulation:2})}return t})();const Ase=new yt("mat-snack-bar-default-options",{providedIn:"root",factory:function Mse(){return new hM}});let pM,Mc=(()=>{class t{_overlay=Y(is);_live=Y(UU);_injector=Y(Ke);_breakpointObserver=Y(UE);_parentSnackBar=Y(t,{optional:!0,skipSelf:!0});_defaultConfig=Y(Ase);_snackBarRefAtThisLevel=null;simpleSnackBarComponent=q8;snackBarContainerComponent=W8;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){const e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",o){const r={...this._defaultConfig,...o};return r.data={message:e,action:n},r.announcementMessage===e&&(r.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,r)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,n){const r=Ke.create({parent:n&&n.viewContainerRef&&n.viewContainerRef.injector||this._injector,providers:[{provide:hM,useValue:n}]}),u=new Cb(this.snackBarContainerComponent,n.viewContainerRef,r),y=e.attach(u);return y.instance.snackBarConfig=n,y.instance}_attach(e,n){const o={...new hM,...this._defaultConfig,...n},r=this._createOverlay(o),u=this._attachSnackBarContainer(r,o),y=new E3(u,r);if(e instanceof sa){const I=new C_(e,null,{$implicit:o.data,snackBarRef:y});y.instance=u.attachTemplatePortal(I)}else{const I=this._createInjector(o,y),V=new Cb(e,void 0,I),q=u.attachComponentPortal(V);y.instance=q.instance}return this._breakpointObserver.observe("(max-width: 599.98px) and (orientation: portrait)").pipe(ro(r.detachments())).subscribe(I=>{r.overlayElement.classList.toggle(this.handsetCssClass,I.matches)}),o.announcementMessage&&u._onAnnounce.subscribe(()=>{this._live.announce(o.announcementMessage,o.politeness)}),this._animateSnackBar(y,o),this._openedSnackBarRef=y,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){const n=new Qv;n.direction=e.direction;let o=this._overlay.position().global();const r="rtl"===e.direction,u="left"===e.horizontalPosition||"start"===e.horizontalPosition&&!r||"end"===e.horizontalPosition&&r,y=!u&&"center"!==e.horizontalPosition;return u?o.left("0"):y?o.right("0"):o.centerHorizontally(),"top"===e.verticalPosition?o.top("0"):o.bottom("0"),n.positionStrategy=o,this._overlay.create(n)}_createInjector(e,n){return Ke.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:E3,useValue:n},{provide:H8,useValue:e.data}]})}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),kse=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[Mc],imports:[Ib,Gv,uM,Ki,q8,Ki]})}return t})();function RT(t){return function Rse(){if(void 0===pM&&(pM=null,typeof window<"u")){const t=window;void 0!==t.trustedTypes&&(pM=t.trustedTypes.createPolicy("angular#components",{createHTML:i=>i}))}return pM}()?.createHTML(t)||t}function Z8(t){return Error(`Unable to find icon with the name "${t}"`)}function Y8(t){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${t}".`)}function X8(t){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${t}".`)}class t0{url;svgText;options;svgElement;constructor(i,e,n){this.url=i,this.svgText=e,this.options=n}}let OT=(()=>{class t{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(e,n,o,r){this._httpClient=e,this._sanitizer=n,this._errorHandler=r,this._document=o}addSvgIcon(e,n,o){return this.addSvgIconInNamespace("",e,n,o)}addSvgIconLiteral(e,n,o){return this.addSvgIconLiteralInNamespace("",e,n,o)}addSvgIconInNamespace(e,n,o,r){return this._addSvgIconConfig(e,n,new t0(o,null,r))}addSvgIconResolver(e){return this._resolvers.push(e),this}addSvgIconLiteralInNamespace(e,n,o,r){const u=this._sanitizer.sanitize(El.HTML,o);if(!u)throw X8(o);const y=RT(u);return this._addSvgIconConfig(e,n,new t0("",y,r))}addSvgIconSet(e,n){return this.addSvgIconSetInNamespace("",e,n)}addSvgIconSetLiteral(e,n){return this.addSvgIconSetLiteralInNamespace("",e,n)}addSvgIconSetInNamespace(e,n,o){return this._addSvgIconSetConfig(e,new t0(n,null,o))}addSvgIconSetLiteralInNamespace(e,n,o){const r=this._sanitizer.sanitize(El.HTML,n);if(!r)throw X8(n);const u=RT(r);return this._addSvgIconSetConfig(e,new t0("",u,o))}registerFontClassAlias(e,n=e){return this._fontCssClassesByAlias.set(e,n),this}classNameForFontAlias(e){return this._fontCssClassesByAlias.get(e)||e}setDefaultFontSetClass(...e){return this._defaultFontSetClass=e,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(e){const n=this._sanitizer.sanitize(El.RESOURCE_URL,e);if(!n)throw Y8(e);const o=this._cachedIconsByUrl.get(n);return o?xi(mM(o)):this._loadSvgIconFromConfig(new t0(e,null)).pipe(ks(r=>this._cachedIconsByUrl.set(n,r)),kt(r=>mM(r)))}getNamedSvgIcon(e,n=""){const o=K8(n,e);let r=this._svgIconConfigs.get(o);if(r)return this._getSvgFromConfig(r);if(r=this._getIconConfigFromResolvers(n,e),r)return this._svgIconConfigs.set(o,r),this._getSvgFromConfig(r);const u=this._iconSetConfigs.get(n);return u?this._getSvgFromIconSetConfigs(e,u):Dx(Z8(o))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(e){return e.svgText?xi(mM(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(kt(n=>mM(n)))}_getSvgFromIconSetConfigs(e,n){const o=this._extractIconWithNameFromAnySet(e,n);return o?xi(o):fO(n.filter(u=>!u.svgText).map(u=>this._loadSvgIconSetFromConfig(u).pipe(Wh(y=>{const V=`Loading icon set URL: ${this._sanitizer.sanitize(El.RESOURCE_URL,u.url)} failed: ${y.message}`;return this._errorHandler.handleError(new Error(V)),xi(null)})))).pipe(kt(()=>{const u=this._extractIconWithNameFromAnySet(e,n);if(!u)throw Z8(e);return u}))}_extractIconWithNameFromAnySet(e,n){for(let o=n.length-1;o>=0;o--){const r=n[o];if(r.svgText&&r.svgText.toString().indexOf(e)>-1){const u=this._svgElementFromConfig(r),y=this._extractSvgIconFromSet(u,e,r.options);if(y)return y}}return null}_loadSvgIconFromConfig(e){return this._fetchIcon(e).pipe(ks(n=>e.svgText=n),kt(()=>this._svgElementFromConfig(e)))}_loadSvgIconSetFromConfig(e){return e.svgText?xi(null):this._fetchIcon(e).pipe(ks(n=>e.svgText=n))}_extractSvgIconFromSet(e,n,o){const r=e.querySelector(`[id="${n}"]`);if(!r)return null;const u=r.cloneNode(!0);if(u.removeAttribute("id"),"svg"===u.nodeName.toLowerCase())return this._setSvgAttributes(u,o);if("symbol"===u.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(u),o);const y=this._svgElementFromString(RT(""));return y.appendChild(u),this._setSvgAttributes(y,o)}_svgElementFromString(e){const n=this._document.createElement("DIV");n.innerHTML=e;const o=n.querySelector("svg");if(!o)throw Error(" tag not found");return o}_toSvgElement(e){const n=this._svgElementFromString(RT("")),o=e.attributes;for(let r=0;rRT(V)),$h(()=>this._inProgressUrlFetches.delete(u)),NE());return this._inProgressUrlFetches.set(u,I),I}_addSvgIconConfig(e,n,o){return this._svgIconConfigs.set(K8(e,n),o),this}_addSvgIconSetConfig(e,n){const o=this._iconSetConfigs.get(e);return o?o.push(n):this._iconSetConfigs.set(e,[n]),this}_svgElementFromConfig(e){if(!e.svgElement){const n=this._svgElementFromString(e.svgText);this._setSvgAttributes(n,e.options),e.svgElement=n}return e.svgElement}_getIconConfigFromResolvers(e,n){for(let o=0;oi?i.pathname+i.search:""}}}),Q8=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Vse=Q8.map(t=>`[${t}]`).join(", "),Use=/^url\(['"]?#(.*?)['"]?\)$/;let Sr=(()=>{class t{_elementRef=Y(Pn);_iconRegistry=Y(OT);_location=Y(zse);_errorHandler=Y(bo);_defaultColor;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;inline=!1;get svgIcon(){return this._svgIcon}set svgIcon(e){e!==this._svgIcon&&(e?this._updateSvgIcon(e):this._svgIcon&&this._clearSvgElement(),this._svgIcon=e)}_svgIcon;get fontSet(){return this._fontSet}set fontSet(e){const n=this._cleanupFontValue(e);n!==this._fontSet&&(this._fontSet=n,this._updateFontIconClasses())}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(e){const n=this._cleanupFontValue(e);n!==this._fontIcon&&(this._fontIcon=n,this._updateFontIconClasses())}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName;_svgNamespace;_previousPath;_elementsWithExternalReferences;_currentIconFetch=ai.EMPTY;constructor(){const e=Y(new Mt("aria-hidden"),{optional:!0}),n=Y(Nse,{optional:!0});n&&(n.color&&(this.color=this._defaultColor=n.color),n.fontSet&&(this.fontSet=n.fontSet)),e||this._elementRef.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(e){if(!e)return["",""];const n=e.split(":");switch(n.length){case 1:return["",n[0]];case 2:return n;default:throw Error(`Invalid icon name: "${e}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){const e=this._elementsWithExternalReferences;if(e&&e.size){const n=this._location.getPathname();n!==this._previousPath&&(this._previousPath=n,this._prependPathToReferences(n))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(e){this._clearSvgElement();const n=this._location.getPathname();this._previousPath=n,this._cacheChildrenWithExternalReferences(e),this._prependPathToReferences(n),this._elementRef.nativeElement.appendChild(e)}_clearSvgElement(){const e=this._elementRef.nativeElement;let n=e.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();n--;){const o=e.childNodes[n];(1!==o.nodeType||"svg"===o.nodeName.toLowerCase())&&o.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;const e=this._elementRef.nativeElement,n=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(o=>o.length>0);this._previousFontSetClass.forEach(o=>e.classList.remove(o)),n.forEach(o=>e.classList.add(o)),this._previousFontSetClass=n,this.fontIcon!==this._previousFontIconClass&&!n.includes("mat-ligature-font")&&(this._previousFontIconClass&&e.classList.remove(this._previousFontIconClass),this.fontIcon&&e.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(e){return"string"==typeof e?e.trim().split(" ")[0]:e}_prependPathToReferences(e){const n=this._elementsWithExternalReferences;n&&n.forEach((o,r)=>{o.forEach(u=>{r.setAttribute(u.name,`url('${e}#${u.value}')`)})})}_cacheChildrenWithExternalReferences(e){const n=e.querySelectorAll(Vse),o=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let r=0;r{const y=n[r],I=y.getAttribute(u),V=I?I.match(Use):null;if(V){let q=o.get(y);q||(q=[],o.set(y,q)),q.push({name:u,value:V[1]})}})}_updateSvgIcon(e){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),e){const[n,o]=this._splitIconName(e);n&&(this._svgNamespace=n),o&&(this._svgName=o),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(o,n).pipe($a(1)).subscribe(r=>this._setSvgElement(r),r=>{this._errorHandler.handleError(new Error(`Error retrieving icon ${n}:${o}! ${r.message}`))})}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(n,o){2&n&&(zn("data-mat-icon-type",o._usingFontIcon()?"font":"svg")("data-mat-icon-name",o._svgName||o.fontIcon)("data-mat-icon-namespace",o._svgNamespace||o.fontSet)("fontIcon",o._usingFontIcon()?o.fontIcon:null),bs(o.color?"mat-"+o.color:""),Hn("mat-icon-inline",o.inline)("mat-icon-no-color","primary"!==o.color&&"accent"!==o.color&&"warn"!==o.color))},inputs:{color:"color",inline:[2,"inline","inline",fn],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:Fse,decls:1,vars:0,template:function(n,o){1&n&&(ho(),On(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}\n"],encapsulation:2,changeDetection:0})}return t})(),Hse=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})();const jse=["canvas"];let $se=(()=>{class t{dialogRef;uri;http;snackBar;canvas;authenticatorCode;emailed_code=!1;constructor(e,n,o,r){this.dialogRef=e,this.uri=n,this.http=o,this.snackBar=r}ngOnInit(){this.generateQRCode()}generateQRCode(){this.uri&&(0,cse.mo)(this.canvas.nativeElement,this.uri,{width:256}).then(()=>{}).catch(e=>{this.snackBar.open("Error generating QR code: "+e.message,"Dismiss",{duration:5e3})})}onAuthCodeSubmit(e){e&&this.onClose()}onClose(){this.dialogRef.close(this.authenticatorCode.getEnteredCode())}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(Mc))};static \u0275cmp=cn({type:t,selectors:[["app-qr-code"]],viewQuery:function(n,o){if(1&n&&(mn(jse,7),mn(sM,5)),2&n){let r;Bt(r=Vt())&&(o.canvas=r.first),Bt(r=Vt())&&(o.authenticatorCode=r.first)}},standalone:!1,decls:25,vars:1,consts:[["canvas",""],["mat-dialog-title","",1,"title"],[1,"dialog-content"],[1,"qr-code-container"],[1,"description"],["target","_blank",3,"href"],[1,"auth-code"],[3,"submit"],["align","end"],["mat-fab","","extended","",3,"click"],["fontSet","material-symbols-outlined"]],template:function(n,o){if(1&n){const r=pt();w(0,"h2",1),M(1,"Register Authenticator App"),x(),w(2,"mat-dialog-content",2)(3,"div",3),Re(4,"canvas",null,0),x(),w(6,"div")(7,"p",4)(8,"span"),M(9,"Scan or "),w(10,"a",5),M(11,"open"),x(),M(12," the code in your preferred authenticator application. "),x(),w(13,"span"),M(14,"Once setup, enter your code below:"),x()()(),w(15,"div",6)(16,"app-auth-code-entry",7),we("submit",function(y){return fe(r),ge(o.onAuthCodeSubmit(y))}),x()(),w(17,"div")(18,"p",4),M(19," This will allow you to secure your login by requiring you to provide a one time password each time you login with a password. If your organization requires 2FA, this satisfies it. "),x()()(),w(20,"mat-dialog-actions",8)(21,"button",9),we("click",function(){return fe(r),ge(o.onClose())}),w(22,"mat-icon",10),M(23,"key"),x(),M(24," Submit "),x()()}2&n&&(E(10),N("href",o.uri,Jf))},dependencies:[Ab,Eb,Fl,Os,Sr,sM],styles:[".dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.title[_ngcontent-%COMP%]{text-align:center}.qr-code-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.description[_ngcontent-%COMP%]{font-size:small}"]})}return t})();const Gse=["mat-internal-form-field",""],qse=["*"];let k3=(()=>{class t{labelPosition;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mdc-form-field--align-end","before"===o.labelPosition)},inputs:{labelPosition:"labelPosition"},attrs:Gse,ngContentSelectors:qse,decls:1,vars:0,template:function(n,o){1&n&&(ho(),On(0))},styles:[".mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}\n"],encapsulation:2,changeDetection:0})}return t})();const Wse=["switch"],Zse=["*"];function Yse(t,i){1&t&&(w(0,"span",10),Va(),w(1,"svg",12),Re(2,"path",13),x(),w(3,"svg",14),Re(4,"path",15),x()())}const Xse=new yt("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),Kse={provide:Pl,useExisting:lo(()=>Gd),multi:!0};class J8{source;checked;constructor(i,e){this.source=i,this.checked=e}}let Gd=(()=>{class t{_elementRef=Y(Pn);_focusMonitor=Y(eh);_changeDetectorRef=Y(So);defaults=Y(Xse);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new J8(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new Tt;toggleChange=new Tt;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){Y(Rs).load(wu);const e=Y(new Mt("tabindex"),{optional:!0}),n=this.defaults,o=Y(Kr,{optional:!0});this.tabIndex=null==e?0:parseInt(e)||0,this.color=n.color||"accent",this._noopAnimations="NoopAnimations"===o,this.id=this._uniqueId=Y(ta).getId("mat-mdc-slide-toggle-"),this.hideIcon=n.hideIcon??!1,this.disabledInteractive=n.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{"keyboard"===e||"program"===e?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&!0!==e.value?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new J8(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(n,o){if(1&n&&mn(Wse,5),2&n){let r;Bt(r=Vt())&&(o._switchElement=r.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(n,o){2&n&&(cc("id",o.id),zn("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),bs(o.color?"mat-"+o.color:""),Hn("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",fn],color:"color",disabled:[2,"disabled","disabled",fn],disableRipple:[2,"disableRipple","disableRipple",fn],tabIndex:[2,"tabIndex","tabIndex",e=>null==e?0:Ql(e)],checked:[2,"checked","checked",fn],hideIcon:[2,"hideIcon","hideIcon",fn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[Bn([Kse,{provide:ba,useExisting:t,multi:!0}]),go],ngContentSelectors:Zse,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"div",1)(1,"button",2,0),we("click",function(){return fe(r),ge(o._handleClick())}),Re(3,"span",3),w(4,"span",4)(5,"span",5)(6,"span",6),Re(7,"span",7),x(),w(8,"span",8),Re(9,"span",9),x(),te(10,Yse,5,0,"span",10),x()()(),w(11,"label",11),we("click",function(y){return fe(r),ge(y.stopPropagation())}),On(12),x()()}if(2&n){const r=Vi(2);N("labelPosition",o.labelPosition),E(),Hn("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),N("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),zn("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),E(8),N("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),E(),Xi(o.hideIcon?-1:10),E(),N("for",o.buttonId),zn("id",o._labelId)}},dependencies:[Mb,k3],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}\n'],encapsulation:2,changeDetection:0})}return t})(),ele=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Gd,Ki,Ki]})}return t})();function tle(t,i){if(1&t&&(w(0,"div"),M(1),x()),2&t){const e=X();E(),Ct(e.confirmData.msg)}}function nle(t,i){1&t&&Re(0,"div",8),2&t&&N("innerHTML",X().confirmData.msg,g1)}function ile(t,i){if(1&t){const e=pt();w(0,"mat-slide-toggle",9),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.toggle_value,o)||(r.toggle_value=o),ge(o)}),M(1),x()}if(2&t){const e=X();Kn("ngModel",e.toggle_value),E(),Jt(" ",e.confirmData.toggle_label," ")}}function ole(t,i){if(1&t){const e=pt();w(0,"button",6),we("click",function(){return fe(e),ge(X().onNo())}),M(1,"No"),x()}}class rf{title="Confirmation Required";msg="Please confirm your action.";html=!1;yes_no=!0;include_toggle=!1;toggle_label="Toggle Option";constructor(i){Object.assign(this,i)}}let af=(()=>{class t{dialogRef;confirmData;confirmationDialogTitle="Confirmation Required";toggle_value=!1;constructor(e,n){this.dialogRef=e,this.confirmData=n,this.confirmationDialogTitle=n.title}ngOnInit(){}onYes(){this.dialogRef.close({confirmed:!0,toggle_value:this.toggle_value})}onNo(){this.dialogRef.close({confirmed:!1})}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks))};static \u0275cmp=cn({type:t,selectors:[["app-confirm-dialog"]],standalone:!1,decls:12,vars:6,consts:[[1,"container"],[1,"title"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"ngModel","ngModelChange",4,"ngIf"],["align","end"],["type","button","mat-stroked-button","",3,"click"],["type","button","mat-stroked-button","",3,"click",4,"ngIf"],[3,"innerHTML"],[3,"ngModelChange","ngModel"]],template:function(n,o){1&n&&(w(0,"mat-dialog-content",0)(1,"h3",1),M(2),x(),te(3,tle,2,1,"div",2)(4,nle,1,1,"div",3),Re(5,"br"),te(6,ile,2,2,"mat-slide-toggle",4),Re(7,"br"),x(),w(8,"mat-dialog-actions",5)(9,"button",6),we("click",function(){return o.onYes()}),M(10),x(),te(11,ole,2,0,"button",7),x()),2&n&&(E(2),Ct(o.confirmationDialogTitle),E(),N("ngIf",!o.confirmData.html),E(),N("ngIf",o.confirmData.html),E(2),N("ngIf",o.confirmData.include_toggle),E(4),Ct(o.confirmData.yes_no?"Yes":"Okay"),E(),N("ngIf",o.confirmData.yes_no))},dependencies:[ir,wr,ts,ws,Fl,Os,Gd],styles:[".container[_ngcontent-%COMP%]{text-align:center;width:100%;height:auto;overflow:hidden;max-height:none}"]})}return t})(),n0=(()=>{class t{errorMessageSubject=new it(null);errorMessage=this.errorMessageSubject.asObservable();constructor(){}report(e){this.errorMessageSubject.next(e)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Ps(t){return null!=t&&"false"!=`${t}`}class ale{_box;_destroyed=new Ee;_resizeSubject=new Ee;_resizeObserver;_elementObservables=new Map;constructor(i){this._box=i,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(e=>this._resizeSubject.next(e)))}observe(i){return this._elementObservables.has(i)||this._elementObservables.set(i,new se(e=>{const n=this._resizeSubject.subscribe(e);return this._resizeObserver?.observe(i,{box:this._box}),()=>{this._resizeObserver?.unobserve(i),n.unsubscribe(),this._elementObservables.delete(i)}}).pipe(or(e=>e.some(n=>n.target===i)),KP({bufferSize:1,refCount:!0}),ro(this._destroyed))),this._elementObservables.get(i)}destroy(){this._destroyed.next(),this._destroyed.complete(),this._resizeSubject.complete(),this._elementObservables.clear()}}let eH=(()=>{class t{_cleanupErrorListener;_observers=new Map;_ngZone=Y(tn);constructor(){}ngOnDestroy(){for(const[,e]of this._observers)e.destroy();this._observers.clear(),this._cleanupErrorListener?.()}observe(e,n){const o=n?.box||"content-box";return this._observers.has(o)||this._observers.set(o,new ale(o)),this._observers.get(o).observe(e)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const sle=["notch"],lle=["matFormFieldNotchedOutline",""],cle=["*"],dle=["textField"],ule=["iconPrefixContainer"],hle=["textPrefixContainer"],ple=["iconSuffixContainer"],mle=["textSuffixContainer"],fle=["*",[["mat-label"]],[["","matPrefix",""],["","matIconPrefix",""]],[["","matTextPrefix",""]],[["","matTextSuffix",""]],[["","matSuffix",""],["","matIconSuffix",""]],[["mat-error"],["","matError",""]],[["mat-hint",3,"align","end"]],[["mat-hint","align","end"]]],_le=["*","mat-label","[matPrefix], [matIconPrefix]","[matTextPrefix]","[matTextSuffix]","[matSuffix], [matIconSuffix]","mat-error, [matError]","mat-hint:not([align='end'])","mat-hint[align='end']"];function gle(t,i){1&t&&Re(0,"span",20)}function ble(t,i){if(1&t&&(w(0,"label",19),On(1,1),te(2,gle,1,0,"span",20),x()),2&t){const e=X(2);N("floating",e._shouldLabelFloat())("monitorResize",e._hasOutline())("id",e._labelId),zn("for",e._control.disableAutomaticLabeling?null:e._control.id),E(2),Xi(!e.hideRequiredMarker&&e._control.required?2:-1)}}function yle(t,i){1&t&&te(0,ble,3,5,"label",19),2&t&&Xi(X()._hasFloatingLabel()?0:-1)}function vle(t,i){1&t&&Re(0,"div",7)}function xle(t,i){}function wle(t,i){1&t&&te(0,xle,0,0,"ng-template",13),2&t&&(X(2),N("ngTemplateOutlet",Vi(1)))}function Cle(t,i){if(1&t&&(w(0,"div",9),te(1,wle,1,1,null,13),x()),2&t){const e=X();N("matFormFieldNotchedOutlineOpen",e._shouldLabelFloat()),E(),Xi(e._forceDisplayInfixLabel()?-1:1)}}function Sle(t,i){1&t&&(w(0,"div",10,2),On(2,2),x())}function Tle(t,i){1&t&&(w(0,"div",11,3),On(2,3),x())}function Dle(t,i){}function Ile(t,i){1&t&&te(0,Dle,0,0,"ng-template",13),2&t&&(X(),N("ngTemplateOutlet",Vi(1)))}function Ele(t,i){1&t&&(w(0,"div",14,4),On(2,4),x())}function Mle(t,i){1&t&&(w(0,"div",15,5),On(2,5),x())}function Ale(t,i){1&t&&Re(0,"div",16)}function kle(t,i){1&t&&On(0,6)}function Rle(t,i){if(1&t&&(w(0,"mat-hint",21),M(1),x()),2&t){const e=X(2);N("id",e._hintLabelId),E(),Ct(e.hintLabel)}}function Ole(t,i){1&t&&(te(0,Rle,2,2,"mat-hint",21),On(1,7),Re(2,"div",22),On(3,8)),2&t&&Xi(X().hintLabel?0:-1)}let Oa=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-label"]]})}return t})();const tH=new yt("MatError");let fM=(()=>{class t{id=Y(ta).getId("mat-mdc-error-");constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-error"],["","matError",""]],hostAttrs:[1,"mat-mdc-form-field-error","mat-mdc-form-field-bottom-align"],hostVars:1,hostBindings:function(n,o){2&n&&cc("id",o.id)},inputs:{id:"id"},features:[Bn([{provide:tH,useExisting:t}])]})}return t})(),nH=(()=>{class t{align="start";id=Y(ta).getId("mat-mdc-hint-");static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-hint"]],hostAttrs:[1,"mat-mdc-form-field-hint","mat-mdc-form-field-bottom-align"],hostVars:4,hostBindings:function(n,o){2&n&&(cc("id",o.id),zn("align",null),Hn("mat-mdc-form-field-hint-end","end"===o.align))},inputs:{align:"align",id:"id"}})}return t})();const iH=new yt("MatPrefix");let Ple=(()=>{class t{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matPrefix",""],["","matIconPrefix",""],["","matTextPrefix",""]],inputs:{_isTextSelector:[0,"matTextPrefix","_isTextSelector"]},features:[Bn([{provide:iH,useExisting:t}])]})}return t})();const oH=new yt("MatSuffix");let Qs=(()=>{class t{set _isTextSelector(e){this._isText=!0}_isText=!1;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matSuffix",""],["","matIconSuffix",""],["","matTextSuffix",""]],inputs:{_isTextSelector:[0,"matTextSuffix","_isTextSelector"]},features:[Bn([{provide:oH,useExisting:t}])]})}return t})();const rH=new yt("FloatingLabelParent");let aH=(()=>{class t{_elementRef=Y(Pn);get floating(){return this._floating}set floating(e){this._floating=e,this.monitorResize&&this._handleResize()}_floating=!1;get monitorResize(){return this._monitorResize}set monitorResize(e){this._monitorResize=e,this._monitorResize?this._subscribeToResize():this._resizeSubscription.unsubscribe()}_monitorResize=!1;_resizeObserver=Y(eH);_ngZone=Y(tn);_parent=Y(rH);_resizeSubscription=new ai;constructor(){}ngOnDestroy(){this._resizeSubscription.unsubscribe()}getWidth(){return function Lle(t){if(null!==t.offsetParent)return t.scrollWidth;const e=t.cloneNode(!0);e.style.setProperty("position","absolute"),e.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(e);const n=e.scrollWidth;return e.remove(),n}(this._elementRef.nativeElement)}get element(){return this._elementRef.nativeElement}_handleResize(){setTimeout(()=>this._parent._handleLabelResized())}_subscribeToResize(){this._resizeSubscription.unsubscribe(),this._ngZone.runOutsideAngular(()=>{this._resizeSubscription=this._resizeObserver.observe(this._elementRef.nativeElement,{box:"border-box"}).subscribe(()=>this._handleResize())})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["label","matFormFieldFloatingLabel",""]],hostAttrs:[1,"mdc-floating-label","mat-mdc-floating-label"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mdc-floating-label--float-above",o.floating)},inputs:{floating:"floating",monitorResize:"monitorResize"}})}return t})();const sH="mdc-line-ripple--active",_M="mdc-line-ripple--deactivating";let lH=(()=>{class t{_elementRef=Y(Pn);_cleanupTransitionEnd;constructor(){const e=Y(tn),n=Y(Hr);e.runOutsideAngular(()=>{this._cleanupTransitionEnd=n.listen(this._elementRef.nativeElement,"transitionend",this._handleTransitionEnd)})}activate(){const e=this._elementRef.nativeElement.classList;e.remove(_M),e.add(sH)}deactivate(){this._elementRef.nativeElement.classList.add(_M)}_handleTransitionEnd=e=>{const n=this._elementRef.nativeElement.classList,o=n.contains(_M);"opacity"===e.propertyName&&o&&n.remove(sH,_M)};ngOnDestroy(){this._cleanupTransitionEnd()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["div","matFormFieldLineRipple",""]],hostAttrs:[1,"mdc-line-ripple"]})}return t})(),cH=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);open=!1;_notch;constructor(){}ngAfterViewInit(){const e=this._elementRef.nativeElement.querySelector(".mdc-floating-label");e?(this._elementRef.nativeElement.classList.add("mdc-notched-outline--upgraded"),"function"==typeof requestAnimationFrame&&(e.style.transitionDuration="0s",this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>e.style.transitionDuration="")}))):this._elementRef.nativeElement.classList.add("mdc-notched-outline--no-label")}_setNotchWidth(e){this._notch.nativeElement.style.width=this.open&&e?`calc(${e}px * var(--mat-mdc-form-field-floating-label-scale, 0.75) + 9px)`:""}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["div","matFormFieldNotchedOutline",""]],viewQuery:function(n,o){if(1&n&&mn(sle,5),2&n){let r;Bt(r=Vt())&&(o._notch=r.first)}},hostAttrs:[1,"mdc-notched-outline"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mdc-notched-outline--notched",o.open)},inputs:{open:[0,"matFormFieldNotchedOutlineOpen","open"]},attrs:lle,ngContentSelectors:cle,decls:5,vars:0,consts:[["notch",""],[1,"mat-mdc-notch-piece","mdc-notched-outline__leading"],[1,"mat-mdc-notch-piece","mdc-notched-outline__notch"],[1,"mat-mdc-notch-piece","mdc-notched-outline__trailing"]],template:function(n,o){1&n&&(ho(),Re(0,"div",1),w(1,"div",2,0),On(3),x(),Re(4,"div",3))},encapsulation:2,changeDetection:0})}return t})(),PT=(()=>{class t{value;stateChanges;id;placeholder;ngControl;focused;empty;shouldLabelFloat;required;disabled;errorState;controlType;autofilled;userAriaDescribedBy;disableAutomaticLabeling;static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t})}return t})();const o0=new yt("MatFormField"),Fle=new yt("MAT_FORM_FIELD_DEFAULT_OPTIONS");let Lx,na=(()=>{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_dir=Y(ul);_platform=Y(ea);_idGenerator=Y(ta);_ngZone=Y(tn);_injector=Y(Ke);_defaults=Y(Fle,{optional:!0});_textField;_iconPrefixContainer;_textPrefixContainer;_iconSuffixContainer;_textSuffixContainer;_floatingLabel;_notchedOutline;_lineRipple;_formFieldControl;_prefixChildren;_suffixChildren;_errorChildren;_hintChildren;_labelChild=$9(Oa);get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Ps(e)}_hideRequiredMarker=!1;color="primary";get floatLabel(){return this._floatLabel||this._defaults?.floatLabel||"auto"}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e,this._changeDetectorRef.markForCheck())}_floatLabel;get appearance(){return this._appearance}set appearance(e){const n=this._appearance;this._appearance=e||this._defaults?.appearance||"fill","outline"===this._appearance&&this._appearance!==n&&(this._needsOutlineLabelOffsetUpdate=!0)}_appearance="fill";get subscriptSizing(){return this._subscriptSizing||this._defaults?.subscriptSizing||"fixed"}set subscriptSizing(e){this._subscriptSizing=e||this._defaults?.subscriptSizing||"fixed"}_subscriptSizing=null;get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}_hintLabel="";_hasIconPrefix=!1;_hasTextPrefix=!1;_hasIconSuffix=!1;_hasTextSuffix=!1;_labelId=this._idGenerator.getId("mat-mdc-form-field-label-");_hintLabelId=this._idGenerator.getId("mat-mdc-hint-");get _control(){return this._explicitFormFieldControl||this._formFieldControl}set _control(e){this._explicitFormFieldControl=e}_destroyed=new Ee;_isFocused=null;_explicitFormFieldControl;_needsOutlineLabelOffsetUpdate=!1;_previousControl=null;_previousControlValidatorFn=null;_stateChanges;_valueChanges;_describedByChanges;_animationsDisabled;constructor(){const e=this._defaults;e&&(e.appearance&&(this.appearance=e.appearance),this._hideRequiredMarker=!!e?.hideRequiredMarker,e.color&&(this.color=e.color)),this._animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0})}ngAfterViewInit(){this._updateFocusState(),this._animationsDisabled||this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-form-field-animations-enabled")},300)}),this._changeDetectorRef.detectChanges()}ngAfterContentInit(){this._assertFormFieldControl(),this._initializeSubscript(),this._initializePrefixAndSuffix(),this._initializeOutlineLabelOffsetSubscriptions()}ngAfterContentChecked(){this._assertFormFieldControl(),this._control!==this._previousControl&&(this._initializeControl(this._previousControl),this._control.ngControl&&this._control.ngControl.control&&(this._previousControlValidatorFn=this._control.ngControl.control.validator),this._previousControl=this._control),this._control.ngControl&&this._control.ngControl.control&&this._control.ngControl.control.validator!==this._previousControlValidatorFn&&this._changeDetectorRef.markForCheck()}ngOnDestroy(){this._stateChanges?.unsubscribe(),this._valueChanges?.unsubscribe(),this._describedByChanges?.unsubscribe(),this._destroyed.next(),this._destroyed.complete()}getLabelId=$p(()=>this._hasFloatingLabel()?this._labelId:null);getConnectedOverlayOrigin(){return this._textField||this._elementRef}_animateAndLockLabel(){this._hasFloatingLabel()&&(this.floatLabel="always")}_initializeControl(e){const n=this._control,o="mat-mdc-form-field-type-";e&&this._elementRef.nativeElement.classList.remove(o+e.controlType),n.controlType&&this._elementRef.nativeElement.classList.add(o+n.controlType),this._stateChanges?.unsubscribe(),this._stateChanges=n.stateChanges.subscribe(()=>{this._updateFocusState(),this._changeDetectorRef.markForCheck()}),this._describedByChanges?.unsubscribe(),this._describedByChanges=n.stateChanges.pipe(ua([void 0,void 0]),kt(()=>[n.errorState,n.userAriaDescribedBy]),function rle(){return ot((t,i)=>{let e,n=!1;t.subscribe(St(i,o=>{const r=e;e=o,n&&i.next([r,o]),n=!0}))})}(),or(([[r,u],[y,I]])=>r!==y||u!==I)).subscribe(()=>this._syncDescribedByIds()),this._valueChanges?.unsubscribe(),n.ngControl&&n.ngControl.valueChanges&&(this._valueChanges=n.ngControl.valueChanges.pipe(ro(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()))}_checkPrefixAndSuffixTypes(){this._hasIconPrefix=!!this._prefixChildren.find(e=>!e._isText),this._hasTextPrefix=!!this._prefixChildren.find(e=>e._isText),this._hasIconSuffix=!!this._suffixChildren.find(e=>!e._isText),this._hasTextSuffix=!!this._suffixChildren.find(e=>e._isText)}_initializePrefixAndSuffix(){this._checkPrefixAndSuffixTypes(),va(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._checkPrefixAndSuffixTypes(),this._changeDetectorRef.markForCheck()})}_initializeSubscript(){this._hintChildren.changes.subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._validateHints(),this._syncDescribedByIds()}_assertFormFieldControl(){}_updateFocusState(){this._control.focused&&!this._isFocused?(this._isFocused=!0,this._lineRipple?.activate()):!this._control.focused&&(this._isFocused||null===this._isFocused)&&(this._isFocused=!1,this._lineRipple?.deactivate()),this._textField?.nativeElement.classList.toggle("mdc-text-field--focused",this._control.focused)}_initializeOutlineLabelOffsetSubscriptions(){this._prefixChildren.changes.subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0),Ag(()=>{this._needsOutlineLabelOffsetUpdate&&(this._needsOutlineLabelOffsetUpdate=!1,this._updateOutlineLabelOffset())},{injector:this._injector}),this._dir.change.pipe(ro(this._destroyed)).subscribe(()=>this._needsOutlineLabelOffsetUpdate=!0)}_shouldAlwaysFloat(){return"always"===this.floatLabel}_hasOutline(){return"outline"===this.appearance}_forceDisplayInfixLabel(){return!this._platform.isBrowser&&this._prefixChildren.length&&!this._shouldLabelFloat()}_hasFloatingLabel=$p(()=>!!this._labelChild());_shouldLabelFloat(){return!!this._hasFloatingLabel()&&(this._control.shouldLabelFloat||this._shouldAlwaysFloat())}_shouldForward(e){const n=this._control?this._control.ngControl:null;return n&&n[e]}_getSubscriptMessageType(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_handleLabelResized(){this._refreshOutlineNotchWidth()}_refreshOutlineNotchWidth(){this._hasOutline()&&this._floatingLabel&&this._shouldLabelFloat()?this._notchedOutline?._setNotchWidth(this._floatingLabel.getWidth()):this._notchedOutline?._setNotchWidth(0)}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){}_syncDescribedByIds(){if(this._control){let e=[];if(this._control.userAriaDescribedBy&&"string"==typeof this._control.userAriaDescribedBy&&e.push(...this._control.userAriaDescribedBy.split(" ")),"hint"===this._getSubscriptMessageType()){const n=this._hintChildren?this._hintChildren.find(r=>"start"===r.align):null,o=this._hintChildren?this._hintChildren.find(r=>"end"===r.align):null;n?e.push(n.id):this._hintLabel&&e.push(this._hintLabelId),o&&e.push(o.id)}else this._errorChildren&&e.push(...this._errorChildren.map(n=>n.id));this._control.setDescribedByIds(e)}}_updateOutlineLabelOffset(){if(!this._hasOutline()||!this._floatingLabel)return;const e=this._floatingLabel.element;if(!this._iconPrefixContainer&&!this._textPrefixContainer)return void(e.style.transform="");if(!this._isAttachedToDom())return void(this._needsOutlineLabelOffsetUpdate=!0);const n=this._iconPrefixContainer?.nativeElement,o=this._textPrefixContainer?.nativeElement,r=this._iconSuffixContainer?.nativeElement,u=this._textSuffixContainer?.nativeElement,y=n?.getBoundingClientRect().width??0,I=o?.getBoundingClientRect().width??0,V=r?.getBoundingClientRect().width??0,q=u?.getBoundingClientRect().width??0;e.style.transform=`var(\n --mat-mdc-form-field-label-transform,\n translateY(-50%) translateX(calc(${"rtl"===this._dir.value?"-1":"1"} * (${y+I}px + var(--mat-mdc-form-field-label-offset-x, 0px))))\n )`,this._elementRef.nativeElement.style.setProperty("--mat-form-field-notch-max-width",`calc(100% - ${y+I+V+q}px)`)}_isAttachedToDom(){const e=this._elementRef.nativeElement;if(e.getRootNode){const n=e.getRootNode();return n&&n!==e}return document.documentElement.contains(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-form-field"]],contentQueries:function(n,o,r){if(1&n&&(V4(r,o._labelChild,Oa,5),oo(r,PT,5),oo(r,iH,5),oo(r,oH,5),oo(r,tH,5),oo(r,nH,5)),2&n){let u;(function U4(t=1){Bf(gg()+t)})(),Bt(u=Vt())&&(o._formFieldControl=u.first),Bt(u=Vt())&&(o._prefixChildren=u),Bt(u=Vt())&&(o._suffixChildren=u),Bt(u=Vt())&&(o._errorChildren=u),Bt(u=Vt())&&(o._hintChildren=u)}},viewQuery:function(n,o){if(1&n&&(mn(dle,5),mn(ule,5),mn(hle,5),mn(ple,5),mn(mle,5),mn(aH,5),mn(cH,5),mn(lH,5)),2&n){let r;Bt(r=Vt())&&(o._textField=r.first),Bt(r=Vt())&&(o._iconPrefixContainer=r.first),Bt(r=Vt())&&(o._textPrefixContainer=r.first),Bt(r=Vt())&&(o._iconSuffixContainer=r.first),Bt(r=Vt())&&(o._textSuffixContainer=r.first),Bt(r=Vt())&&(o._floatingLabel=r.first),Bt(r=Vt())&&(o._notchedOutline=r.first),Bt(r=Vt())&&(o._lineRipple=r.first)}},hostAttrs:[1,"mat-mdc-form-field"],hostVars:40,hostBindings:function(n,o){2&n&&Hn("mat-mdc-form-field-label-always-float",o._shouldAlwaysFloat())("mat-mdc-form-field-has-icon-prefix",o._hasIconPrefix)("mat-mdc-form-field-has-icon-suffix",o._hasIconSuffix)("mat-form-field-invalid",o._control.errorState)("mat-form-field-disabled",o._control.disabled)("mat-form-field-autofilled",o._control.autofilled)("mat-form-field-appearance-fill","fill"==o.appearance)("mat-form-field-appearance-outline","outline"==o.appearance)("mat-form-field-hide-placeholder",o._hasFloatingLabel()&&!o._shouldLabelFloat())("mat-focused",o._control.focused)("mat-primary","accent"!==o.color&&"warn"!==o.color)("mat-accent","accent"===o.color)("mat-warn","warn"===o.color)("ng-untouched",o._shouldForward("untouched"))("ng-touched",o._shouldForward("touched"))("ng-pristine",o._shouldForward("pristine"))("ng-dirty",o._shouldForward("dirty"))("ng-valid",o._shouldForward("valid"))("ng-invalid",o._shouldForward("invalid"))("ng-pending",o._shouldForward("pending"))},inputs:{hideRequiredMarker:"hideRequiredMarker",color:"color",floatLabel:"floatLabel",appearance:"appearance",subscriptSizing:"subscriptSizing",hintLabel:"hintLabel"},exportAs:["matFormField"],features:[Bn([{provide:o0,useExisting:t},{provide:rH,useExisting:t}])],ngContentSelectors:_le,decls:20,vars:25,consts:[["labelTemplate",""],["textField",""],["iconPrefixContainer",""],["textPrefixContainer",""],["textSuffixContainer",""],["iconSuffixContainer",""],[1,"mat-mdc-text-field-wrapper","mdc-text-field",3,"click"],[1,"mat-mdc-form-field-focus-overlay"],[1,"mat-mdc-form-field-flex"],["matFormFieldNotchedOutline","",3,"matFormFieldNotchedOutlineOpen"],[1,"mat-mdc-form-field-icon-prefix"],[1,"mat-mdc-form-field-text-prefix"],[1,"mat-mdc-form-field-infix"],[3,"ngTemplateOutlet"],[1,"mat-mdc-form-field-text-suffix"],[1,"mat-mdc-form-field-icon-suffix"],["matFormFieldLineRipple",""],[1,"mat-mdc-form-field-subscript-wrapper","mat-mdc-form-field-bottom-align"],["aria-atomic","true","aria-live","polite"],["matFormFieldFloatingLabel","",3,"floating","monitorResize","id"],["aria-hidden","true",1,"mat-mdc-form-field-required-marker","mdc-floating-label--required"],[3,"id"],[1,"mat-mdc-form-field-hint-spacer"]],template:function(n,o){if(1&n){const r=pt();ho(fle),te(0,yle,1,1,"ng-template",null,0,Ud),w(2,"div",6,1),we("click",function(y){return fe(r),ge(o._control.onContainerClick(y))}),te(4,vle,1,0,"div",7),w(5,"div",8),te(6,Cle,2,2,"div",9)(7,Sle,3,0,"div",10)(8,Tle,3,0,"div",11),w(9,"div",12),te(10,Ile,1,1,null,13),On(11),x(),te(12,Ele,3,0,"div",14)(13,Mle,3,0,"div",15),x(),te(14,Ale,1,0,"div",16),x(),w(15,"div",17),dR(16),w(17,"div",18),te(18,kle,1,0)(19,Ole,4,1),x()()}if(2&n){let r;E(2),Hn("mdc-text-field--filled",!o._hasOutline())("mdc-text-field--outlined",o._hasOutline())("mdc-text-field--no-label",!o._hasFloatingLabel())("mdc-text-field--disabled",o._control.disabled)("mdc-text-field--invalid",o._control.errorState),E(2),Xi(o._hasOutline()||o._control.disabled?-1:4),E(2),Xi(o._hasOutline()?6:-1),E(),Xi(o._hasIconPrefix?7:-1),E(),Xi(o._hasTextPrefix?8:-1),E(2),Xi(!o._hasOutline()||o._forceDisplayInfixLabel()?10:-1),E(2),Xi(o._hasTextSuffix?12:-1),E(),Xi(o._hasIconSuffix?13:-1),E(),Xi(o._hasOutline()?-1:14),E(),Hn("mat-mdc-form-field-subscript-dynamic-size","dynamic"===o.subscriptSizing);const u=o._getSubscriptMessageType();E(2),Hn("mat-mdc-form-field-error-wrapper","error"===u)("mat-mdc-form-field-hint-wrapper","hint"===u),E(),Xi("error"===(r=u)?18:"hint"===r?19:-1)}},dependencies:[aH,cH,jR,lH,nH],styles:['.mdc-text-field{display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-text-field__input{width:100%;min-width:0;border:none;border-radius:0;background:none;padding:0;-moz-appearance:none;-webkit-appearance:none;height:28px}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}.mdc-text-field__input::placeholder{opacity:0}.mdc-text-field__input::-moz-placeholder{opacity:0}.mdc-text-field__input::-webkit-input-placeholder{opacity:0}.mdc-text-field__input:-ms-input-placeholder{opacity:0}.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{opacity:1}.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{opacity:1}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-moz-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive::-webkit-input-placeholder{opacity:0}.mdc-text-field--disabled:not(.mdc-text-field--no-label) .mdc-text-field__input.mat-mdc-input-disabled-interactive:-ms-input-placeholder{opacity:0}.mdc-text-field--outlined .mdc-text-field__input,.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:rgba(0,0,0,0)}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-filled-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-filled-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-filled-text-field-error-caret-color)}.mdc-text-field--filled.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-filled-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input{color:var(--mdc-outlined-text-field-input-text-color, var(--mat-sys-on-surface));caret-color:var(--mdc-outlined-text-field-caret-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-moz-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input::-webkit-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:var(--mdc-outlined-text-field-input-text-placeholder-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__input{caret-color:var(--mdc-outlined-text-field-error-caret-color)}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-text-field__input{color:var(--mdc-outlined-text-field-disabled-input-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-text-field--disabled .mdc-text-field__input{background-color:Window}}.mdc-text-field--filled{height:56px;border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small));border-top-right-radius:var(--mdc-filled-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:var(--mdc-filled-text-field-container-color, var(--mat-sys-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled{background-color:var(--mdc-filled-text-field-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 4%, transparent))}.mdc-text-field--outlined{height:56px;overflow:visible;padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)));padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px)}[dir=rtl] .mdc-text-field--outlined{padding-right:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)) + 4px);padding-left:max(16px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}.mdc-floating-label{position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform}[dir=rtl] .mdc-floating-label{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:auto}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label{left:auto;right:4px}.mdc-text-field--filled .mdc-floating-label{left:16px;right:auto}[dir=rtl] .mdc-text-field--filled .mdc-floating-label{left:auto;right:16px}.mdc-text-field--disabled .mdc-floating-label{cursor:default}@media(forced-colors: active){.mdc-text-field--disabled .mdc-floating-label{z-index:1}}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-filled-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-filled-text-field-hover-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-filled-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-filled-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-filled-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-filled-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--filled .mdc-floating-label{font-family:var(--mdc-filled-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-filled-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-filled-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-filled-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-floating-label{color:var(--mdc-outlined-text-field-label-text-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-focus-label-text-color, var(--mat-sys-primary))}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined.mdc-text-field--disabled .mdc-floating-label{color:var(--mdc-outlined-text-field-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label{color:var(--mdc-outlined-text-field-error-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mdc-floating-label{color:var(--mdc-outlined-text-field-error-focus-label-text-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-floating-label{color:var(--mdc-outlined-text-field-error-hover-label-text-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined .mdc-floating-label{font-family:var(--mdc-outlined-text-field-label-text-font, var(--mat-sys-body-large-font));font-size:var(--mdc-outlined-text-field-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-outlined-text-field-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-outlined-text-field-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-floating-label--float-above{cursor:auto;transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1);font-size:.75rem}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:133.3333333333%}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:1px;margin-right:0;content:"*"}[dir=rtl] .mdc-floating-label--required:not(.mdc-floating-label--hide-required-marker)::after{margin-left:0;margin-right:1px}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline{text-align:right}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mat-mdc-notch-piece{box-sizing:border-box;height:100%;pointer-events:none;border-top:1px solid;border-bottom:1px solid}.mdc-text-field--focused .mat-mdc-notch-piece{border-width:2px}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-outline-color, var(--mat-sys-outline));border-width:var(--mdc-outlined-text-field-outline-width, 1px)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-hover-outline-color, var(--mat-sys-on-surface))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-focus-outline-color, var(--mat-sys-primary))}.mdc-text-field--outlined.mdc-text-field--disabled .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-notched-outline .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-hover-outline-color, var(--mat-sys-on-error-container))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid.mdc-text-field--focused .mat-mdc-notch-piece{border-color:var(--mdc-outlined-text-field-error-focus-outline-color, var(--mat-sys-error))}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline .mat-mdc-notch-piece{border-width:var(--mdc-outlined-text-field-focus-outline-width, 2px)}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))}[dir=rtl] .mdc-notched-outline__leading{border-left:none;border-right:1px solid;border-bottom-left-radius:0;border-top-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__trailing{flex-grow:1;border-left:none;border-right:1px solid;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-right-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}[dir=rtl] .mdc-notched-outline__trailing{border-left:1px solid;border-right:none;border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small));border-bottom-left-radius:var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small))}.mdc-notched-outline__notch{flex:0 0 auto;width:auto}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:min(var(--mat-form-field-notch-max-width, 100%),100% - max(12px,var(--mdc-outlined-text-field-container-shape, var(--mat-sys-corner-extra-small)))*2)}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none;--mat-form-field-notch-max-width: 100%}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{display:none}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{z-index:1;border-bottom-width:var(--mdc-filled-text-field-active-indicator-height, 1px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-active-indicator-color, var(--mat-sys-on-surface-variant))}.mdc-text-field--filled:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-hover-active-indicator-color, var(--mat-sys-on-surface))}.mdc-text-field--filled.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-disabled-active-indicator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-active-indicator-color, var(--mat-sys-error))}.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--invalid:not(.mdc-text-field--focused):hover .mdc-line-ripple::before{border-bottom-color:var(--mdc-filled-text-field-error-hover-active-indicator-color, var(--mat-sys-on-error-container))}.mdc-line-ripple::after{transform:scaleX(0);opacity:0;z-index:2}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-width:var(--mdc-filled-text-field-focus-active-indicator-height, 2px)}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-focus-active-indicator-color, var(--mat-sys-primary))}.mdc-text-field--filled.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:var(--mdc-filled-text-field-error-focus-active-indicator-color, var(--mat-sys-error))}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-text-field--disabled{pointer-events:none}.mat-mdc-form-field-textarea-control{vertical-align:middle;resize:vertical;box-sizing:border-box;height:auto;margin:0;padding:0;border:none;overflow:auto}.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font:inherit;letter-spacing:inherit;text-decoration:inherit;text-transform:inherit;border:none}.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;line-height:normal;pointer-events:all;will-change:auto}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{cursor:inherit}.mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input,.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:auto}.mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control.mdc-text-field__input[type=color]{height:23px}.mat-mdc-text-field-wrapper{height:auto;flex:auto;will-change:auto}.mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-left:0;--mat-mdc-form-field-label-offset-x: -16px}.mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-right:0}[dir=rtl] .mat-mdc-text-field-wrapper{padding-left:16px;padding-right:16px}[dir=rtl] .mat-mdc-form-field-has-icon-suffix .mat-mdc-text-field-wrapper{padding-left:0}[dir=rtl] .mat-mdc-form-field-has-icon-prefix .mat-mdc-text-field-wrapper{padding-right:0}.mat-form-field-disabled .mdc-text-field__input::placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-moz-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input::-webkit-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-disabled .mdc-text-field__input:-ms-input-placeholder{color:var(--mat-form-field-disabled-input-text-placeholder-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-label-always-float .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}.mat-mdc-text-field-wrapper .mat-mdc-form-field-infix .mat-mdc-floating-label{left:auto;right:auto}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input{display:inline-block}.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch{padding-top:0}.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:1px solid rgba(0,0,0,0)}[dir=rtl] .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none;border-right:1px solid rgba(0,0,0,0)}.mat-mdc-form-field-infix{min-height:var(--mat-form-field-container-height, 56px);padding-top:var(--mat-form-field-filled-with-label-container-padding-top, 24px);padding-bottom:var(--mat-form-field-filled-with-label-container-padding-bottom, 8px)}.mdc-text-field--outlined .mat-mdc-form-field-infix,.mdc-text-field--no-label .mat-mdc-form-field-infix{padding-top:var(--mat-form-field-container-vertical-padding, 16px);padding-bottom:var(--mat-form-field-container-vertical-padding, 16px)}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:calc(var(--mat-form-field-container-height, 56px)/2)}.mdc-text-field--filled .mat-mdc-floating-label{display:var(--mat-form-field-filled-label-display, block)}.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{--mat-mdc-form-field-label-transform: translateY(calc(calc(6.75px + var(--mat-form-field-container-height, 56px) / 2) * -1)) scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));transform:var(--mat-mdc-form-field-label-transform)}@keyframes _mat-form-field-subscript-animation{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.mat-mdc-form-field-subscript-wrapper{box-sizing:border-box;width:100%;position:relative}.mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-error-wrapper{position:absolute;top:0;left:0;right:0;padding:0 16px;opacity:1;transform:translateY(0);animation:_mat-form-field-subscript-animation 0ms cubic-bezier(0.55, 0, 0.55, 0.2)}.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field-subscript-dynamic-size .mat-mdc-form-field-error-wrapper{position:static}.mat-mdc-form-field-bottom-align::before{content:"";display:inline-block;height:16px}.mat-mdc-form-field-bottom-align.mat-mdc-form-field-subscript-dynamic-size::before{content:unset}.mat-mdc-form-field-hint-end{order:1}.mat-mdc-form-field-hint-wrapper{display:flex}.mat-mdc-form-field-hint-spacer{flex:1 0 1em}.mat-mdc-form-field-error{display:block;color:var(--mat-form-field-error-text-color, var(--mat-sys-error))}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align::before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-subscript-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-form-field-subscript-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-form-field-subscript-text-size, var(--mat-sys-body-small-size));letter-spacing:var(--mat-form-field-subscript-text-tracking, var(--mat-sys-body-small-tracking));font-weight:var(--mat-form-field-subscript-text-weight, var(--mat-sys-body-small-weight))}.mat-mdc-form-field-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;opacity:0;pointer-events:none;background-color:var(--mat-form-field-state-layer-color, var(--mat-sys-on-surface))}.mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-form-field.mat-focused .mat-mdc-form-field-focus-overlay{opacity:var(--mat-form-field-focus-state-layer-opacity, 0)}select.mat-mdc-form-field-input-control{-moz-appearance:none;-webkit-appearance:none;background-color:rgba(0,0,0,0);display:inline-flex;box-sizing:border-box}select.mat-mdc-form-field-input-control:not(:disabled){cursor:pointer}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option{color:var(--mat-form-field-select-option-text-color, var(--mat-sys-neutral10))}select.mat-mdc-form-field-input-control:not(.mat-mdc-native-select-inline) option:disabled{color:var(--mat-form-field-select-disabled-option-text-color, color-mix(in srgb, var(--mat-sys-neutral10) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{content:"";width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-top:5px solid;position:absolute;right:0;top:50%;margin-top:-2.5px;pointer-events:none;color:var(--mat-form-field-enabled-select-arrow-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-infix::after{right:auto;left:0}.mat-mdc-form-field-type-mat-native-select.mat-focused .mat-mdc-form-field-infix::after{color:var(--mat-form-field-focus-select-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field-type-mat-native-select.mat-form-field-disabled .mat-mdc-form-field-infix::after{color:var(--mat-form-field-disabled-select-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:15px}[dir=rtl] .mat-mdc-form-field-type-mat-native-select .mat-mdc-form-field-input-control{padding-right:0;padding-left:15px}@media(forced-colors: active){.mat-form-field-appearance-fill .mat-mdc-text-field-wrapper{outline:solid 1px}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-form-field-disabled .mat-mdc-text-field-wrapper{outline-color:GrayText}}@media(forced-colors: active){.mat-form-field-appearance-fill.mat-focused .mat-mdc-text-field-wrapper{outline:dashed 3px}}@media(forced-colors: active){.mat-mdc-form-field.mat-focused .mdc-notched-outline{border:dashed 3px}}.mat-mdc-form-field-input-control[type=date],.mat-mdc-form-field-input-control[type=datetime],.mat-mdc-form-field-input-control[type=datetime-local],.mat-mdc-form-field-input-control[type=month],.mat-mdc-form-field-input-control[type=week],.mat-mdc-form-field-input-control[type=time]{line-height:1}.mat-mdc-form-field-input-control::-webkit-datetime-edit{line-height:1;padding:0;margin-bottom:-2px}.mat-mdc-form-field{--mat-mdc-form-field-floating-label-scale: 0.75;display:inline-flex;flex-direction:column;min-width:0;text-align:left;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-form-field-container-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-form-field-container-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-form-field-container-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-form-field-container-text-tracking, var(--mat-sys-body-large-tracking));font-weight:var(--mat-form-field-container-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-floating-label--float-above{font-size:calc(var(--mat-form-field-outlined-label-text-populated-size)*var(--mat-mdc-form-field-floating-label-scale))}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:var(--mat-form-field-outlined-label-text-populated-size)}[dir=rtl] .mat-mdc-form-field{text-align:right}.mat-mdc-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-mdc-text-field-wrapper{width:100%;z-index:0}.mat-mdc-form-field-icon-prefix,.mat-mdc-form-field-icon-suffix{align-self:center;line-height:0;pointer-events:auto;position:relative;z-index:1}.mat-mdc-form-field-icon-prefix>.mat-icon,.mat-mdc-form-field-icon-suffix>.mat-icon{padding:0 12px;box-sizing:content-box}.mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-leading-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-prefix{color:var(--mat-form-field-disabled-leading-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-form-field-disabled .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-disabled-trailing-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-invalid .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-trailing-icon-color, var(--mat-sys-error))}.mat-form-field-invalid:not(.mat-focused):not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper:hover .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-hover-trailing-icon-color, var(--mat-sys-on-error-container))}.mat-form-field-invalid.mat-focused .mat-mdc-text-field-wrapper .mat-mdc-form-field-icon-suffix{color:var(--mat-form-field-error-focus-trailing-icon-color, var(--mat-sys-error))}.mat-mdc-form-field-icon-prefix,[dir=rtl] .mat-mdc-form-field-icon-suffix{padding:0 4px 0 0}.mat-mdc-form-field-icon-suffix,[dir=rtl] .mat-mdc-form-field-icon-prefix{padding:0 0 0 4px}.mat-mdc-form-field-subscript-wrapper .mat-icon,.mat-mdc-form-field label .mat-icon{width:1em;height:1em;font-size:inherit}.mat-mdc-form-field-infix{flex:auto;min-width:0;width:180px;position:relative;box-sizing:border-box}.mat-mdc-form-field-infix:has(textarea[cols]){width:auto}.mat-mdc-form-field .mdc-notched-outline__notch{margin-left:-1px;-webkit-clip-path:inset(-9em -999em -9em 1px);clip-path:inset(-9em -999em -9em 1px)}[dir=rtl] .mat-mdc-form-field .mdc-notched-outline__notch{margin-left:0;margin-right:-1px;-webkit-clip-path:inset(-9em 1px -9em -999em);clip-path:inset(-9em 1px -9em -999em)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-floating-label{transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input{transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-moz-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input::-webkit-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-moz-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-moz-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input::-webkit-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input::-webkit-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mat-mdc-form-field.mat-form-field-animations-enabled.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms}.mat-mdc-form-field.mat-form-field-animations-enabled .mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-hint-wrapper,.mat-mdc-form-field.mat-form-field-animations-enabled .mat-mdc-form-field-error-wrapper{animation-duration:300ms}.mdc-notched-outline .mdc-floating-label{max-width:calc(100% + 1px)}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(133.3333333333% + 1px)}\n'],encapsulation:2,changeDetection:0})}return t})();const hH=["color","button","checkbox","date","datetime-local","email","file","hidden","image","month","number","password","radio","range","reset","search","submit","tel","text","time","url","week"];function pH(){if(Lx)return Lx;if("object"!=typeof document||!document)return Lx=new Set(hH),Lx;let t=document.createElement("input");return Lx=new Set(hH.filter(i=>(t.setAttribute("type",i),t.type===i))),Lx}let Ble=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["ng-component"]],hostAttrs:["cdk-text-field-style-loader",""],decls:0,vars:0,template:function(n,o){},styles:["textarea.cdk-textarea-autosize{resize:none}textarea.cdk-textarea-autosize-measuring{padding:2px 0 !important;box-sizing:content-box !important;height:auto !important;overflow:hidden !important}textarea.cdk-textarea-autosize-measuring-firefox{padding:2px 0 !important;box-sizing:content-box !important;height:0 !important}@keyframes cdk-text-field-autofill-start{/*!*/}@keyframes cdk-text-field-autofill-end{/*!*/}.cdk-text-field-autofill-monitored:-webkit-autofill{animation:cdk-text-field-autofill-start 0s 1ms}.cdk-text-field-autofill-monitored:not(:-webkit-autofill){animation:cdk-text-field-autofill-end 0s 1ms}\n"],encapsulation:2,changeDetection:0})}return t})();const Vle={passive:!0};let Ule=(()=>{class t{_platform=Y(ea);_ngZone=Y(tn);_renderer=Y(Qc).createRenderer(null,null);_styleLoader=Y(Rs);_monitoredElements=new Map;constructor(){}monitor(e){if(!this._platform.isBrowser)return Dc;this._styleLoader.load(Ble);const n=S_(e),o=this._monitoredElements.get(n);if(o)return o.subject;const r=new Ee,u="cdk-text-field-autofilled",y=V=>{"cdk-text-field-autofill-start"!==V.animationName||n.classList.contains(u)?"cdk-text-field-autofill-end"===V.animationName&&n.classList.contains(u)&&(n.classList.remove(u),this._ngZone.run(()=>r.next({target:V.target,isAutofilled:!1}))):(n.classList.add(u),this._ngZone.run(()=>r.next({target:V.target,isAutofilled:!0})))},I=this._ngZone.runOutsideAngular(()=>(n.classList.add("cdk-text-field-autofill-monitored"),ec(this._renderer,n,"animationstart",y,Vle)));return this._monitoredElements.set(n,{subject:r,unlisten:I}),r}stopMonitoring(e){const n=S_(e),o=this._monitoredElements.get(n);o&&(o.unlisten(),o.subject.complete(),n.classList.remove("cdk-text-field-autofill-monitored"),n.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(n))}ngOnDestroy(){this._monitoredElements.forEach((e,n)=>this.stopMonitoring(n))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Hle=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();const mH=new yt("MAT_INPUT_VALUE_ACCESSOR");let LT=(()=>{class t{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();class gM{_defaultMatcher;ngControl;_parentFormGroup;_parentForm;_stateChanges;errorState=!1;matcher;constructor(i,e,n,o,r){this._defaultMatcher=i,this.ngControl=e,this._parentFormGroup=n,this._parentForm=o,this._stateChanges=r}updateErrorState(){const i=this.errorState,e=this._parentFormGroup||this._parentForm,n=this.matcher||this._defaultMatcher,o=this.ngControl?this.ngControl.control:null,r=n?.isErrorState(o,e)??!1;r!==i&&(this.errorState=r,this._stateChanges.next())}}let bM=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,i3,Ki]})}return t})();const jle=["button","checkbox","file","hidden","image","radio","range","reset","submit"],$le=new yt("MAT_INPUT_CONFIG");let xa=(()=>{class t{_elementRef=Y(Pn);_platform=Y(ea);ngControl=Y(Gh,{optional:!0,self:!0});_autofillMonitor=Y(Ule);_ngZone=Y(tn);_formField=Y(o0,{optional:!0});_renderer=Y(Hr);_uid=Y(ta).getId("mat-input-");_previousNativeValue;_inputValueAccessor;_signalBasedValueAccessor;_previousPlaceholder;_errorStateTracker;_config=Y($le,{optional:!0});_cleanupIosKeyup;_cleanupWebkitWheel;_formFieldDescribedBy;_isServer;_isNativeSelect;_isTextarea;_isInFormField;focused=!1;stateChanges=new Ee;controlType="mat-input";autofilled=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Ps(e),this.focused&&(this.focused=!1,this.stateChanges.next())}_disabled=!1;get id(){return this._id}set id(e){this._id=e||this._uid}_id;placeholder;name;get required(){return this._required??this.ngControl?.control?.hasValidator(Ov.required)??!1}set required(e){this._required=Ps(e)}_required;get type(){return this._type}set type(e){const n=this._type;this._type=e||"text",this._validateType(),!this._isTextarea&&pH().has(this._type)&&(this._elementRef.nativeElement.type=this._type),this._type!==n&&this._ensureWheelDefaultBehavior()}_type="text";get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}userAriaDescribedBy;get value(){return this._signalBasedValueAccessor?this._signalBasedValueAccessor.value():this._inputValueAccessor.value}set value(e){e!==this.value&&(this._signalBasedValueAccessor?this._signalBasedValueAccessor.value.set(e):this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Ps(e)}_readonly=!1;disabledInteractive;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}_neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>pH().has(e));constructor(){const e=Y(Cr,{optional:!0}),n=Y(gb,{optional:!0}),o=Y(LT),r=Y(mH,{optional:!0,self:!0}),u=this._elementRef.nativeElement,y=u.nodeName.toLowerCase();r?Gs(r.value)?this._signalBasedValueAccessor=r:this._inputValueAccessor=r:this._inputValueAccessor=u,this._previousNativeValue=this.value,this.id=this.id,this._platform.IOS&&this._ngZone.runOutsideAngular(()=>{this._cleanupIosKeyup=this._renderer.listen(u,"keyup",this._iOSKeyupListener)}),this._errorStateTracker=new gM(o,this.ngControl,n,e,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===y,this._isTextarea="textarea"===y,this._isInFormField=!!this._formField,this.disabledInteractive=this._config?.disabledInteractive||!1,this._isNativeSelect&&(this.controlType=u.multiple?"mat-native-select-multiple":"mat-native-select"),this._signalBasedValueAccessor&&xI(()=>{this._signalBasedValueAccessor.value(),this.stateChanges.next()})}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._cleanupIosKeyup?.(),this._cleanupWebkitWheel?.()}ngDoCheck(){this.ngControl&&(this.updateErrorState(),null!==this.ngControl.disabled&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){if(e!==this.focused){if(!this._isNativeSelect&&e&&this.disabled&&this.disabledInteractive){const n=this._elementRef.nativeElement;"number"===n.type?(n.type="text",n.setSelectionRange(0,0),n.type="number"):n.setSelectionRange(0,0)}this.focused=e,this.stateChanges.next()}}_onInput(){}_dirtyCheckNativeValue(){const e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){const e=this._getPlaceholder();if(e!==this._previousPlaceholder){const n=this._elementRef.nativeElement;this._previousPlaceholder=e,e?n.setAttribute("placeholder",e):n.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){jle.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const e=this._elementRef.nativeElement,n=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&n&&n.label)}return this.focused&&!this.disabled||!this.empty}setDescribedByIds(e){const n=this._elementRef.nativeElement,o=n.getAttribute("aria-describedby");let r;if(o){const u=this._formFieldDescribedBy||e;r=e.concat(o.split(" ").filter(y=>y&&!u.includes(y)))}else r=e;this._formFieldDescribedBy=e,r.length?n.setAttribute("aria-describedby",r.join(" ")):n.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){const e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}_iOSKeyupListener=e=>{const n=e.target;!n.value&&0===n.selectionStart&&0===n.selectionEnd&&(n.setSelectionRange(1,1),n.setSelectionRange(0,0))};_webkitBlinkWheelListener=()=>{};_ensureWheelDefaultBehavior(){this._cleanupWebkitWheel?.(),"number"===this._type&&(this._platform.BLINK||this._platform.WEBKIT)&&(this._cleanupWebkitWheel=this._renderer.listen(this._elementRef.nativeElement,"wheel",this._webkitBlinkWheelListener))}_getReadonlyAttribute(){return this._isNativeSelect?null:this.readonly||this.disabled&&this.disabledInteractive?"true":null}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:21,hostBindings:function(n,o){1&n&&we("focus",function(){return o._focusChanged(!0)})("blur",function(){return o._focusChanged(!1)})("input",function(){return o._onInput()}),2&n&&(cc("id",o.id)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),zn("name",o.name||null)("readonly",o._getReadonlyAttribute())("aria-disabled",o.disabled&&o.disabledInteractive?"true":null)("aria-invalid",o.empty&&o.required?null:o.errorState)("aria-required",o.required)("id",o.id),Hn("mat-input-server",o._isServer)("mat-mdc-form-field-textarea-control",o._isInFormField&&o._isTextarea)("mat-mdc-form-field-input-control",o._isInFormField)("mat-mdc-input-disabled-interactive",o.disabledInteractive)("mdc-text-field__input",o._isInFormField)("mat-mdc-native-select-inline",o._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly",disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]},exportAs:["matInput"],features:[Bn([{provide:PT,useExisting:t}]),go]})}return t})(),Gle=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,bM,bM,Hle,Ki]})}return t})(),R3=(()=>{class t{_listeners=[];notify(e,n){for(let o of this._listeners)o(e,n)}listen(e){return this._listeners.push(e),()=>{this._listeners=this._listeners.filter(n=>e!==n)}}ngOnDestroy(){this._listeners=[]}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const O3=new yt("CdkAccordion");let qle=(()=>{class t{_stateChanges=new Ee;_openCloseAllActions=new Ee;id=Y(ta).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",fn]},exportAs:["cdkAccordion"],features:[Bn([{provide:O3,useExisting:t}]),go]})}return t})(),Wle=(()=>{class t{accordion=Y(O3,{optional:!0,skipSelf:!0});_changeDetectorRef=Y(So);_expansionDispatcher=Y(R3);_openCloseAllSubscription=ai.EMPTY;closed=new Tt;opened=new Tt;destroyed=new Tt;expandedChange=new Tt;id=Y(ta).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){this._expanded!==e&&(this._expanded=e,this.expandedChange.emit(e),e?(this.opened.emit(),this._expansionDispatcher.notify(this.id,this.accordion?this.accordion.id:this.id)):this.closed.emit(),this._changeDetectorRef.markForCheck())}_expanded=!1;disabled=!1;_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,n)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===n&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",fn],disabled:[2,"disabled","disabled",fn]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[Bn([{provide:O3,useValue:void 0}])]})}return t})(),Zle=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({})}return t})();class fH{_letterKeyStream=new Ee;_items=[];_selectedItemIndex=-1;_pressedLetters=[];_skipPredicateFn;_selectedItem=new Ee;selectedItem=this._selectedItem;constructor(i,e){const n="number"==typeof e?.debounceInterval?e.debounceInterval:200;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(i),this._setupKeyHandler(n)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(i){this._selectedItemIndex=i}setItems(i){this._items=i}handleKey(i){const e=i.keyCode;i.key&&1===i.key.length?this._letterKeyStream.next(i.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(i){this._letterKeyStream.pipe(ks(e=>this._pressedLetters.push(e)),Tb(i),or(()=>this._pressedLetters.length>0),kt(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let n=1;ni.disabled;constructor(i,e){this._items=i,i instanceof Od?this._itemChangesSubscription=i.changes.subscribe(n=>this._itemsChanged(n.toArray())):Gs(i)&&(this._effectRef=xI(()=>this._itemsChanged(i()),{injector:e}))}tabOut=new Ee;change=new Ee;skipPredicate(i){return this._skipPredicateFn=i,this}withWrap(i=!0){return this._wrap=i,this}withVerticalOrientation(i=!0){return this._vertical=i,this}withHorizontalOrientation(i){return this._horizontal=i,this}withAllowedModifierKeys(i){return this._allowedModifierKeys=i,this}withTypeAhead(i=200){this._typeaheadSubscription.unsubscribe();const e=this._getItemsArray();return this._typeahead=new fH(e,{debounceInterval:"number"==typeof i?i:void 0,skipPredicate:n=>this._skipPredicateFn(n)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(n=>{this.setActiveItem(n)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(i=!0){return this._homeAndEnd=i,this}withPageUpDown(i=!0,e=10){return this._pageUpAndDown={enabled:i,delta:e},this}setActiveItem(i){const e=this._activeItem();this.updateActiveItem(i),this._activeItem()!==e&&this.change.next(this._activeItemIndex)}onKeydown(i){const e=i.keyCode,o=["altKey","ctrlKey","metaKey","shiftKey"].every(r=>!i[r]||this._allowedModifierKeys.indexOf(r)>-1);switch(e){case 9:return void this.tabOut.next();case 40:if(this._vertical&&o){this.setNextItemActive();break}return;case 38:if(this._vertical&&o){this.setPreviousItemActive();break}return;case 39:if(this._horizontal&&o){"rtl"===this._horizontal?this.setPreviousItemActive():this.setNextItemActive();break}return;case 37:if(this._horizontal&&o){"rtl"===this._horizontal?this.setNextItemActive():this.setPreviousItemActive();break}return;case 36:if(this._homeAndEnd&&o){this.setFirstItemActive();break}return;case 35:if(this._homeAndEnd&&o){this.setLastItemActive();break}return;case 33:if(this._pageUpAndDown.enabled&&o){const r=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(r>0?r:0,1);break}return;case 34:if(this._pageUpAndDown.enabled&&o){const r=this._activeItemIndex+this._pageUpAndDown.delta,u=this._getItemsArray().length;this._setActiveItemByIndex(r-1&&n!==this._activeItemIndex&&(this._activeItemIndex=n,this._typeahead?.setCurrentSelectedItemIndex(n))}}}class FT extends _H{_origin="program";setFocusOrigin(i){return this._origin=i,this}setActiveItem(i){super.setActiveItem(i),this.activeItem&&this.activeItem.focus(this._origin)}}const Xle=["body"],Kle=["bodyWrapper"],Qle=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Jle=["mat-expansion-panel-header","*","mat-action-row"];function ece(t,i){}const tce=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],nce=["mat-panel-title","mat-panel-description","*"];function ice(t,i){1&t&&(w(0,"span",1),Va(),w(1,"svg",2),Re(2,"path",3),x()())}const P3=new yt("MAT_ACCORDION"),gH=new yt("MAT_EXPANSION_PANEL");let L3=(()=>{class t{_template=Y(sa);_expansionPanel=Y(gH,{optional:!0});constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["ng-template","matExpansionPanelContent",""]]})}return t})();const bH=new yt("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS");let zl=(()=>{class t extends Wle{_viewContainerRef=Y(es);_animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});_document=Y(Oo);_ngZone=Y(tn);_elementRef=Y(Pn);_renderer=Y(Hr);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new Tt;afterCollapse=new Tt;_inputChanges=new Ee;accordion=Y(P3,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=Y(ta).getId("mat-expansion-panel-header-");constructor(){super();const e=Y(bH,{optional:!0});this._expansionDispatcher=Y(R3),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return!!this.accordion&&this.expanded&&"default"===this.accordion.displayMode}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(ua(null),or(()=>this.expanded&&!this._portal),$a(1)).subscribe(()=>{this._portal=new C_(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){const e=this._document.activeElement,n=this._body.nativeElement;return e===n||n.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:n})=>{e===this._bodyWrapper?.nativeElement&&"grid-template-rows"===n&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{const e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-expansion-panel"]],contentQueries:function(n,o,r){if(1&n&&oo(r,L3,5),2&n){let u;Bt(u=Vt())&&(o._lazyContent=u.first)}},viewQuery:function(n,o){if(1&n&&(mn(Xle,5),mn(Kle,5)),2&n){let r;Bt(r=Vt())&&(o._body=r.first),Bt(r=Vt())&&(o._bodyWrapper=r.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(n,o){2&n&&Hn("mat-expanded",o.expanded)("mat-expansion-panel-spacing",o._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",fn],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[Bn([{provide:P3,useValue:void 0},{provide:gH,useExisting:t}]),qn,go],ngContentSelectors:Jle,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(n,o){1&n&&(ho(Qle),On(0),w(1,"div",2,0)(3,"div",3,1)(5,"div",4),On(6,1),te(7,ece,0,0,"ng-template",5),x(),On(8,2),x()()),2&n&&(E(),zn("inert",o.expanded?null:""),E(2),N("id",o.id),zn("aria-labelledby",o._headerId),E(4),N("cdkPortalOutlet",o._portal))},dependencies:[ef],styles:[".mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}\n"],encapsulation:2,changeDetection:0})}return t})(),Bl=(()=>{class t{panel=Y(zl,{host:!0});_element=Y(Pn);_focusMonitor=Y(eh);_changeDetectorRef=Y(So);_parentChangeSubscription=ai.EMPTY;constructor(){Y(Rs).load(wu);const e=this.panel,n=Y(bH,{optional:!0}),o=Y(new Mt("tabindex"),{optional:!0}),r=e.accordion?e.accordion._stateChanges.pipe(or(u=>!(!u.hideToggle&&!u.togglePosition))):Dc;this.tabIndex=parseInt(o||"")||0,this._parentChangeSubscription=va(e.opened,e.closed,r,e._inputChanges.pipe(or(u=>!!(u.hideToggle||u.disabled||u.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(or(()=>e._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),n&&(this.expandedHeight=n.expandedHeight,this.collapsedHeight=n.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){const e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case 32:case 13:ns(e)||(e.preventDefault(),this._toggle());break;default:return void(this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e))}}focus(e,n){e?this._focusMonitor.focusVia(this._element,e,n):this._element.nativeElement.focus(n)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(n,o){1&n&&we("click",function(){return o._toggle()})("keydown",function(u){return o._keydown(u)}),2&n&&(zn("id",o.panel._headerId)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o._getPanelId())("aria-expanded",o._isExpanded())("aria-disabled",o.panel.disabled),Jc("height",o._getHeaderHeight()),Hn("mat-expanded",o._isExpanded())("mat-expansion-toggle-indicator-after","after"===o._getTogglePosition())("mat-expansion-toggle-indicator-before","before"===o._getTogglePosition()))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",e=>null==e?0:Ql(e)]},ngContentSelectors:nce,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(n,o){1&n&&(ho(tce),w(0,"span",0),On(1),On(2,1),On(3,2),x(),te(4,ice,3,0,"span",1)),2&n&&(Hn("mat-content-hide-toggle",!o._showToggle()),E(4),Xi(o._showToggle()?4:-1))},styles:['.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";display:inline-block;padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}\n'],encapsulation:2,changeDetection:0})}return t})(),yM=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]})}return t})(),od=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return t})(),th=(()=>{class t extends qle{_keyManager;_ownHeaders=new Od;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(ua(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(n=>n.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new FT(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(e){this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["mat-accordion"]],contentQueries:function(n,o,r){if(1&n&&oo(r,Bl,5),2&n){let u;Bt(u=Vt())&&(o._headers=u)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mat-accordion-multi",o.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",fn],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[Bn([{provide:P3,useExisting:t}]),qn]})}return t})(),oce=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Zle,Gv]})}return t})();function vM(t,i,e){const n=xM(t,i);e=e.trim(),!n.some(o=>o.trim()===e)&&(n.push(e),t.setAttribute(i,n.join(" ")))}function Fx(t,i,e){const n=xM(t,i);e=e.trim();const o=n.filter(r=>r!==e);o.length?t.setAttribute(i,o.join(" ")):t.removeAttribute(i)}function xM(t,i){return t.getAttribute(i)?.match(/\S+/g)??[]}const CH="cdk-describedby-message",wM="cdk-describedby-host";let F3=0,SH=(()=>{class t{_platform=Y(ea);_document=Y(Oo);_messageRegistry=new Map;_messagesContainer=null;_id=""+F3++;constructor(){Y(Rs).load(qv),this._id=Y(Vu)+"-"+F3++}describe(e,n,o){if(!this._canBeDescribed(e,n))return;const r=N3(n,o);"string"!=typeof n?(TH(n,this._id),this._messageRegistry.set(r,{messageElement:n,referenceCount:0})):this._messageRegistry.has(r)||this._createMessageElement(n,o),this._isElementDescribedByMessage(e,r)||this._addMessageReference(e,r)}removeDescription(e,n,o){if(!n||!this._isElementNode(e))return;const r=N3(n,o);if(this._isElementDescribedByMessage(e,r)&&this._removeMessageReference(e,r),"string"==typeof n){const u=this._messageRegistry.get(r);u&&0===u.referenceCount&&this._deleteMessageElement(r)}0===this._messagesContainer?.childNodes.length&&(this._messagesContainer.remove(),this._messagesContainer=null)}ngOnDestroy(){const e=this._document.querySelectorAll(`[${wM}="${this._id}"]`);for(let n=0;n0!=o.indexOf(CH));e.setAttribute("aria-describedby",n.join(" "))}_addMessageReference(e,n){const o=this._messageRegistry.get(n);vM(e,"aria-describedby",o.messageElement.id),e.setAttribute(wM,this._id),o.referenceCount++}_removeMessageReference(e,n){const o=this._messageRegistry.get(n);o.referenceCount--,Fx(e,"aria-describedby",o.messageElement.id),e.removeAttribute(wM)}_isElementDescribedByMessage(e,n){const o=xM(e,"aria-describedby"),r=this._messageRegistry.get(n),u=r&&r.messageElement.id;return!!u&&-1!=o.indexOf(u)}_canBeDescribed(e,n){if(!this._isElementNode(e))return!1;if(n&&"object"==typeof n)return!0;const o=null==n?"":`${n}`.trim(),r=e.getAttribute("aria-label");return!(!o||r&&r.trim()===o)}_isElementNode(e){return e.nodeType===this._document.ELEMENT_NODE}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function N3(t,i){return"string"==typeof t?`${i||""}/${t}`:t}function TH(t,i){t.id||(t.id=`${CH}-${i}-${F3++}`)}const lce=["tooltip"],IH=new yt("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition({scrollThrottle:20})}}),dce={provide:IH,deps:[is],useFactory:function cce(t){return()=>t.scrollStrategies.reposition({scrollThrottle:20})}},hce=new yt("mat-tooltip-default-options",{providedIn:"root",factory:function uce(){return{showDelay:0,hideDelay:0,touchendHideDelay:1500}}}),EH="tooltip-panel",MH=QE({passive:!0});let Pa=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);_platform=Y(ea);_ariaDescriber=Y(SH);_focusMonitor=Y(eh);_dir=Y(ul);_injector=Y(Ke);_viewContainerRef=Y(es);_defaultOptions=Y(hce,{optional:!0});_overlayRef;_tooltipInstance;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=gce;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=Ps(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){const n=Ps(e);this._disabled!==n&&(this._disabled=n,n?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=Db(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=Db(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){const n=this._message;this._message=null!=e?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(n)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new Ee;_isDestroyed=!1;constructor(){const e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=8}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(ro(this._destroyed)).subscribe(e=>{e?"keyboard"===e&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){const e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([n,o])=>{e.removeEventListener(n,o,MH)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,n){if(this.disabled||!this.message||this._isTooltipVisible())return void this._tooltipInstance?._cancelPendingAnimations();const o=this._createOverlay(n);this._detach(),this._portal=this._portal||new Cb(this._tooltipComponent,this._viewContainerRef);const r=this._tooltipInstance=o.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(ro(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(e)}hide(e=this.hideDelay){const n=this._tooltipInstance;n&&(n.isVisible()?n.hide(e):(n._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){const u=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&u._origin instanceof Pn)return this._overlayRef;this._detach()}const n=this._injector.get(qE).getAncestorScrollContainers(this._elementRef),o=this._injector.get(is),r=o.position().flexibleConnectedTo(this.positionAtOrigin&&e||this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(n);return r.positionChanges.pipe(ro(this._destroyed)).subscribe(u=>{this._updateCurrentPositionClass(u.connectionPair),this._tooltipInstance&&u.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=o.create({direction:this._dir,positionStrategy:r,panelClass:`${this._cssClassPrefix}-${EH}`,scrollStrategy:this._injector.get(IH)()}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(ro(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(ro(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(ro(this._destroyed)).subscribe(u=>{this._isTooltipVisible()&&27===u.keyCode&&!ns(u)&&(u.preventDefault(),u.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(ro(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){const n=e.getConfig().positionStrategy,o=this._getOrigin(),r=this._getOverlayPosition();n.withPositions([this._addOffset({...o.main,...r.main}),this._addOffset({...o.fallback,...r.fallback})])}_addOffset(e){const o=!this._dir||"ltr"==this._dir.value;return"top"===e.originY?e.offsetY=-8:"bottom"===e.originY?e.offsetY=8:"start"===e.originX?e.offsetX=o?-8:8:"end"===e.originX&&(e.offsetX=o?8:-8),e}_getOrigin(){const e=!this._dir||"ltr"==this._dir.value,n=this.position;let o;"above"==n||"below"==n?o={originX:"center",originY:"above"==n?"top":"bottom"}:"before"==n||"left"==n&&e||"right"==n&&!e?o={originX:"start",originY:"center"}:("after"==n||"right"==n&&e||"left"==n&&!e)&&(o={originX:"end",originY:"center"});const{x:r,y:u}=this._invertPosition(o.originX,o.originY);return{main:o,fallback:{originX:r,originY:u}}}_getOverlayPosition(){const e=!this._dir||"ltr"==this._dir.value,n=this.position;let o;"above"==n?o={overlayX:"center",overlayY:"bottom"}:"below"==n?o={overlayX:"center",overlayY:"top"}:"before"==n||"left"==n&&e||"right"==n&&!e?o={overlayX:"end",overlayY:"center"}:("after"==n||"right"==n&&e||"left"==n&&!e)&&(o={overlayX:"start",overlayY:"center"});const{x:r,y:u}=this._invertPosition(o.overlayX,o.overlayY);return{main:o,fallback:{overlayX:r,overlayY:u}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),As(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,n){return"above"===this.position||"below"===this.position?"top"===n?n="bottom":"bottom"===n&&(n="top"):"end"===e?e="start":"start"===e&&(e="end"),{x:e,y:n}}_updateCurrentPositionClass(e){const{overlayY:n,originX:o,originY:r}=e;let u;if(u="center"===n?this._dir&&"rtl"===this._dir.value?"end"===o?"left":"right":"start"===o?"left":"right":"bottom"===n&&"top"===r?"above":"below",u!==this._currentPosition){const y=this._overlayRef;if(y){const I=`${this._cssClassPrefix}-${EH}-`;y.removePanelClass(I+this._currentPosition),y.addPanelClass(I+u)}this._currentPosition=u}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._platformSupportsMouseEvents()?this._passiveListeners.push(["mouseenter",e=>{let n;this._setupPointerExitEventsIfNeeded(),void 0!==e.x&&void 0!==e.y&&(n=e),this.show(void 0,n)}]):"off"!==this.touchGestures&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{const n=e.targetTouches?.[0],o=n?{x:n.clientX,y:n.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,o)},this._defaultOptions?.touchLongPressShowDelay??500)}])),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;const e=[];if(this._platformSupportsMouseEvents())e.push(["mouseleave",n=>{const o=n.relatedTarget;(!o||!this._overlayRef?.overlayElement.contains(o))&&this.hide()}],["wheel",n=>this._wheelListener(n)]);else if("off"!==this.touchGestures){this._disableNativeGesturesIfNecessary();const n=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",n],["touchcancel",n])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([n,o])=>{this._elementRef.nativeElement.addEventListener(n,o,MH)})}_platformSupportsMouseEvents(){return!this._platform.IOS&&!this._platform.ANDROID}_wheelListener(e){if(this._isTooltipVisible()){const n=this._injector.get(Oo).elementFromPoint(e.clientX,e.clientY),o=this._elementRef.nativeElement;n!==o&&!o.contains(n)&&this.hide()}}_disableNativeGesturesIfNecessary(){const e=this.touchGestures;if("off"!==e){const n=this._elementRef.nativeElement,o=n.style;("on"===e||"INPUT"!==n.nodeName&&"TEXTAREA"!==n.nodeName)&&(o.userSelect=o.msUserSelect=o.webkitUserSelect=o.MozUserSelect="none"),("on"===e||!n.draggable)&&(o.webkitUserDrag="none"),o.touchAction="none",o.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||As({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mat-mdc-tooltip-disabled",o.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return t})(),gce=(()=>{class t{_changeDetectorRef=Y(So);_elementRef=Y(Pn);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled;_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new Ee;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){const e=Y(Kr,{optional:!0});this._animationsDisabled="NoopAnimations"===e}show(e){null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){const e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>24&&e.width>=200}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){null!=this._showTimeoutId&&clearTimeout(this._showTimeoutId),null!=this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){const n=this._tooltip.nativeElement,o=this._showAnimation,r=this._hideAnimation;if(n.classList.remove(e?r:o),n.classList.add(e?o:r),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&"function"==typeof getComputedStyle){const u=getComputedStyle(n);("0s"===u.getPropertyValue("animation-duration")||"none"===u.getPropertyValue("animation-name"))&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(n.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-tooltip-component"]],viewQuery:function(n,o){if(1&n&&mn(lce,7),2&n){let r;Bt(r=Vt())&&(o._tooltip=r.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(n,o){1&n&&we("mouseleave",function(u){return o._handleMouseLeave(u)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(n,o){if(1&n){const r=pt();w(0,"div",1,0),we("animationend",function(y){return fe(r),ge(o._handleAnimationEnd(y))}),w(2,"div",2),M(3),x()()}2&n&&(Hn("mdc-tooltip--multiline",o._isMultiline),N("ngClass",o.tooltipClass),E(3),Ct(o.message))},dependencies:[$d],styles:['.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mdc-plain-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mdc-plain-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mdc-plain-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mdc-plain-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mdc-plain-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mdc-plain-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mdc-plain-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mdc-plain-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}\n'],encapsulation:2,changeDetection:0})}return t})(),AH=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[dce],imports:[HE,Ib,Ki,Ki,T_]})}return t})();const bce=["*"],xce=[[["","mat-card-avatar",""],["","matCardAvatar",""]],[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],"*"],wce=["[mat-card-avatar], [matCardAvatar]","mat-card-title, mat-card-subtitle,\n [mat-card-title], [mat-card-subtitle],\n [matCardTitle], [matCardSubtitle]","*"],Cce=new yt("MAT_CARD_CONFIG");let r0=(()=>{class t{appearance;constructor(){const e=Y(Cce,{optional:!0});this.appearance=e?.appearance||"raised"}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:4,hostBindings:function(n,o){2&n&&Hn("mat-mdc-card-outlined","outlined"===o.appearance)("mdc-card--outlined","outlined"===o.appearance)},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:bce,decls:1,vars:0,template:function(n,o){1&n&&(ho(),On(0))},styles:['.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-color:var(--mdc-elevated-card-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mdc-elevated-card-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mdc-elevated-card-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mdc-outlined-card-container-color, var(--mat-sys-surface));border-radius:var(--mdc-outlined-card-container-shape, var(--mat-sys-corner-medium));border-width:var(--mdc-outlined-card-outline-width, 1px);border-color:var(--mdc-outlined-card-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mdc-outlined-card-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}\n'],encapsulation:2,changeDetection:0})}return t})(),Nx=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-card-title"],["","mat-card-title",""],["","matCardTitle",""]],hostAttrs:[1,"mat-mdc-card-title"]})}return t})(),zx=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-card-content"]],hostAttrs:[1,"mat-mdc-card-content"]})}return t})(),kH=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-card-subtitle"],["","mat-card-subtitle",""],["","matCardSubtitle",""]],hostAttrs:[1,"mat-mdc-card-subtitle"]})}return t})(),RH=(()=>{class t{align="start";static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-card-actions"]],hostAttrs:[1,"mat-mdc-card-actions","mdc-card__actions"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mat-mdc-card-actions-align-end","end"===o.align)},inputs:{align:"align"},exportAs:["matCardActions"]})}return t})(),a0=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-card-header"]],hostAttrs:[1,"mat-mdc-card-header"],ngContentSelectors:wce,decls:4,vars:0,consts:[[1,"mat-mdc-card-header-text"]],template:function(n,o){1&n&&(ho(xce),On(0),w(1,"div",0),On(2,1),x(),On(3,2))},encapsulation:2,changeDetection:0})}return t})(),Tce=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})(),NT=(()=>{class t{element;renderer;defaultElevation=2;raisedElevation=8;constructor(e,n){this.element=e,this.renderer=n,this.setElevation(this.defaultElevation)}ngOnChanges(e){this.setElevation(this.defaultElevation)}onMouseEnter(){this.setElevation(this.raisedElevation)}onMouseLeave(){this.setElevation(this.defaultElevation)}setElevation(e){const n="mat-elevation-z";Array.from(this.element.nativeElement.classList).filter(u=>u.startsWith(n)).forEach(u=>{this.renderer.removeClass(this.element.nativeElement,u)}),this.renderer.addClass(this.element.nativeElement,`${n}${e}`)}static \u0275fac=function(n){return new(n||t)($e(Pn),$e(Hr))};static \u0275dir=Gt({type:t,selectors:[["","appMaterialElevation",""]],hostBindings:function(n,o){1&n&&we("mouseenter",function(){return o.onMouseEnter()})("mouseleave",function(){return o.onMouseLeave()})},inputs:{defaultElevation:"defaultElevation",raisedElevation:"raisedElevation"},standalone:!1,features:[go]})}return t})();const Dce=["passkeyInput"];function Ice(t,i){if(1&t&&(w(0,"div")(1,"span",22),M(2,"Name: "),x(),w(3,"span",23),M(4),x()()),2&t){const e=X(2).$implicit,n=X(2);E(4),Ct(n.data.logging_in?"*****":e.friendly_name)}}function Ece(t,i){if(1&t&&(w(0,"div")(1,"span",22),M(2,"ID: "),x(),w(3,"span",23),M(4),x()()),2&t){const e=X(2).$implicit,n=X(2);E(4),Ct(n.data.logging_in?"*****":e.id)}}function Mce(t,i){if(1&t&&(w(0,"span"),te(1,Ice,5,1,"div",4)(2,Ece,5,1,"div",4),x()),2&t){const e=X().$implicit;E(),N("ngIf",e.friendly_name&&""!=e.friendly_name),E(),N("ngIf",!e.friendly_name||""==e.friendly_name)}}function Ace(t,i){if(1&t&&(w(0,"span")(1,"mat-form-field")(2,"mat-label"),M(3,"Name"),x(),Re(4,"input",24,0),x()()),2&t){const e=X().$implicit;E(4),N("name","passkey-input-"+e.id)("value",e.friendly_name)}}function kce(t,i){if(1&t){const e=pt();w(0,"span")(1,"button",25),we("click",function(){fe(e);const o=X().$implicit;return ge(X(2).onEditPasskey(o.id))}),w(2,"mat-icon",8),M(3,"edit"),x()(),w(4,"button",26),we("click",function(){fe(e);const o=X().$implicit;return ge(X(2).onDeletePasskey(o.id,o.friendly_name))}),w(5,"mat-icon",8),M(6,"delete"),x()()()}if(2&t){const e=X(3);E(),N("disabled",""!=e.editing_id||e.data.logging_in),E(3),N("disabled",""!=e.editing_id||e.data.logging_in)}}function Rce(t,i){if(1&t){const e=pt();w(0,"span")(1,"button",27),we("click",function(){fe(e);const o=X().$implicit;return ge(X(2).onSavePasskeyName(o.id))}),w(2,"mat-icon",8),M(3,"save"),x()(),w(4,"button",28),we("click",function(){return fe(e),ge(X(3).onCancelRenamePasskey())}),w(5,"mat-icon",8),M(6,"cancel"),x()()()}}function Oce(t,i){if(1&t&&(w(0,"div",16)(1,"div",17)(2,"mat-card",18),Re(3,"mat-card-header"),w(4,"mat-card-content",19)(5,"mat-icon",20),M(6,"passkey"),x(),w(7,"div",21),te(8,Mce,3,2,"span",4)(9,Ace,6,2,"span",4),w(10,"div")(11,"span",22),M(12,"Created:"),x(),M(13),ti(14,"date"),x(),w(15,"div")(16,"span",22),M(17,"Last Used:"),x(),M(18),ti(19,"date"),x()(),te(20,kce,7,2,"span",4)(21,Rce,7,0,"span",4),x()()(),Re(22,"div",5),x()),2&t){const e=i.$implicit,n=X(2);E(8),N("ngIf",n.editing_id!=e.id),E(),N("ngIf",n.editing_id==e.id),E(4),Jt(" ",hi(14,6,n.getDateFromString(e.created_at),"medium"),""),E(5),Jt(" ",e.last_used?hi(19,9,n.getDateFromString(e.last_used),"medium"):"None",""),E(2),N("ngIf",n.editing_id!=e.id),E(),N("ngIf",n.editing_id==e.id)}}function Pce(t,i){if(1&t&&(w(0,"mat-expansion-panel")(1,"mat-expansion-panel-header"),M(2,"View Passkeys"),x(),te(3,Oce,23,12,"div",15),x()),2&t){const e=X();E(3),N("ngForOf",e.passkeys)}}function Lce(t,i){if(1&t){const e=pt();w(0,"button",7),we("click",function(){return fe(e),ge(X().onSetupMFA())}),w(1,"mat-icon",8),M(2,"shield_person"),x(),M(3," Setup Authenticator "),x()}}function Fce(t,i){if(1&t){const e=pt();w(0,"button",29),we("click",function(){return fe(e),ge(X().onDeleteMFA())}),w(1,"mat-icon",8),M(2,"delete"),x(),M(3," Delete Authenticator "),x()}}function Nce(t,i){1&t&&(w(0,"div",30)(1,"mat-icon",8),M(2,"verified_user"),x(),w(3,"p"),M(4,"Authenticator registered"),x()())}function zce(t,i){1&t&&(w(0,"h6"),M(1,"MFA Requirement"),x())}function Bce(t,i){1&t&&(w(0,"p",3),M(1,"If required, you will need to setup MFA to login. If your organization allows, you may choose to have a one-time password sent to your email at the time of login."),x())}function Vce(t,i){if(1&t){const e=pt();w(0,"div",6)(1,"mat-form-field",31)(2,"mat-label"),M(3,"Require MFA"),x(),Re(4,"input",32),w(5,"mat-slide-toggle",33),we("change",function(o){return fe(e),ge(X().onToggleMFARequired(o))}),x()()()}if(2&t){const e=X();E(4),ys("value",e.getMFARequireDescriptor()),E(),N("checked",e.isMFARequired)("disabled",!e.canToggleRequireMFA())("matTooltip",e.hasMFAConfigured()?"Require multi-factor login for web (does not apply to license retrieval).":"Please setup either a passkey or authenticator before requiring MFA.")}}class z3{logging_in;user_info;auth_info}let B3=(()=>{class t{dialogRef;data;http;errorService;loginService;snackBar;dialog;passkeyInputs;passkeys=[];editing_id="";isMFARequired=!0;hasPasskey=!1;hasAuthenticator=!1;constructor(e,n,o,r,u,y,I){this.dialogRef=e,this.data=n,this.http=o,this.errorService=r,this.loginService=u,this.snackBar=y,this.dialog=I}ngOnInit(){this.data.logging_in?(this.hasPasskey=this.data.user_info.hasPasskey,this.hasAuthenticator=this.data.user_info.hasTotp):(this.isMFARequired=!(!this.data.auth_info.org_requires_mfa&&!this.data.auth_info.require_mfa),this.hasPasskey=this.data.auth_info.has_passkey,this.hasAuthenticator=this.data.auth_info.has_totp,this.getPasskeys())}getMFARequireDescriptor(){let e="Not required";return this.data.auth_info.org_requires_mfa?e="Required by "+this.data.user_info.organization:this.data.auth_info.require_mfa&&(e="Required"),e}hasMFAConfigured(){return this.hasPasskey||this.hasAuthenticator}canToggleRequireMFA(){return!(this.data.auth_info.org_requires_mfa||!this.data.auth_info.require_mfa&&!this.hasMFAConfigured())}onToggleMFARequired(e){if(!this.data.auth_info.org_requires_mfa)if(e.checked){e.source.checked=!1;let n=new rf;n.html=!1,n.title="Confirm MFA Required",n.msg="You will be logged out and required to log back in using MFA, would you like to continue?",n.yes_no=!0;let o=new ha;o.data=n,this.dialog.open(af,o).afterClosed().subscribe({next:r=>{r&&(r.confirmed?this.updateMFARequired(!0):this.isMFARequired=!1)}})}else this.updateMFARequired(!1)}updateMFARequired(e){this.data.auth_info.require_mfa=e,this.http.post(li_backendURL+"/user/"+this.data.user_info.userID,{name:this.data.user_info.user,friendly_name:this.data.user_info.userDisplayName,priv:this.data.user_info.priv,require_mfa:this.data.auth_info.require_mfa},{withCredentials:!0}).subscribe({next:()=>{this.isMFARequired=e,e&&this.loginService.logout(!0)},error:r=>{this.data.auth_info.require_mfa=!this.data.auth_info.require_mfa,this.isMFARequired=this.data.auth_info.require_mfa,this.snackBar.open("Error updating MFA requirement: "+r.message,"Dismiss",{duration:5e3})}})}onSetupMFA(){this.http.get(li_backendURL+"/user/totp",{withCredentials:!0}).subscribe({next:n=>{const o=new ha;o.data=n,o.autoFocus=!1,this.dialog.open($se,o).afterClosed().subscribe({next:r=>{null!=r&&6==r.length&&this.http.post(li_backendURL+"/login/totp",{code:r,email_code:!1,init:!0},{withCredentials:!0}).subscribe({next:()=>{this.data.auth_info.has_totp=!0,this.hasAuthenticator=!0,this.snackBar.open("Authenticator has been registered.","Dismiss",{duration:2e3})},error:I=>{this.data.auth_info.has_totp=!1,this.hasAuthenticator=!1,this.snackBar.open("Error validating authentication code: "+I.message,"Dismiss",{duration:5e3})}})},error:r=>{this.snackBar.open("Error getting authentication code: "+r.message,"Dismiss",{duration:5e3})}})},error:n=>{this.snackBar.open("Error setting up MFA: "+n.message,"Dismiss",{duration:5e3})}})}onDeleteMFA(){this.http.delete(li_backendURL+"/login/totp/remove",{withCredentials:!0}).subscribe({next:()=>{this.data.auth_info.has_totp=!1,this.hasAuthenticator=!1},error:n=>{this.snackBar.open("Error deleting TOTP: "+n.message,"Dismiss",{duration:5e3})}})}onGeneratePasskeyRegistrationOptions(){return this.http.post(li_backendURL+"/passkey/reg_options",{},{withCredentials:!0})}onVerifyPasskeyRegistration(e){return this.http.post(li_backendURL+"/passkey/register",{regJSON:e},{withCredentials:!0})}onSetupPasskey(){var n,e=this;this.onGeneratePasskeyRegistrationOptions().subscribe({next:(n=bt(function*(o){let r;try{r=yield function ose(t){return v3.apply(this,arguments)}({optionsJSON:o})}catch(u){let y="An error occurred while registering your Passkey";return u instanceof Error&&(y+=": "+u.message),void e.snackBar.open(y,"Dismiss",{duration:5e3})}var u;e.onVerifyPasskeyRegistration(r).subscribe({next:(u=bt(function*(){e.snackBar.open("Passkey has been registered.","Dismiss",{duration:2e3}),e.getPasskeys()}),function(){return u.apply(this,arguments)}),error:u=>{e.snackBar.open("Error registering Passkey: "+u.message,"Dismiss",{duration:5e3})}})}),function(r){return n.apply(this,arguments)}),error:n=>{this.snackBar.open("Error retrieving Passkey options: "+n.message,"Dismiss",{duration:5e3})}})}getDateFromString(e){return new Date(e)}getPasskeys(){this.passkeys=[],this.http.get(li_backendURL+"/passkeys",{withCredentials:!0}).subscribe({next:n=>{n&&"passkeys"in n&&(this.passkeys=n.passkeys,this.passkeys.length>0&&(this.data.auth_info.has_passkey=!0,this.hasPasskey=!0))},error:n=>{this.snackBar.open("Error getting passkeys: "+n.message,"Dismiss",{duration:5e3})}})}updatePasskey(e,n){this.http.post(li_backendURL+"/passkey/update",{id:e,friendly_name:n},{withCredentials:!0}).subscribe({next:()=>{this.getPasskeys()},error:u=>{this.snackBar.open("Error updating passkey: "+u.message,"Dismiss",{duration:5e3})}})}onEditPasskey(e){this.editing_id=e}onCancelRenamePasskey(){this.editing_id=""}onSavePasskeyName(e){const n="passkey-input-"+e.toString(),o=this.passkeyInputs.find(r=>r.nativeElement.getAttribute("name")===n);o&&(this.updatePasskey(e,o.nativeElement.value),this.editing_id="")}onDeletePasskey(e,n){this.http.post(li_backendURL+"/passkeys/remove",{id:e,friendly_name:n},{withCredentials:!0}).subscribe({next:()=>{this.getPasskeys()},error:u=>{this.snackBar.open("Error removing passkey: "+u.message,"Dismiss",{duration:5e3})}})}closeDialog(){this.data.auth_info.has_passkey=this.hasPasskey,this.data.auth_info.has_totp=this.hasAuthenticator,this.dialogRef.close(this.data.auth_info)}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(n0),$e(Po),$e(Mc),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-mfa-setup"]],viewQuery:function(n,o){if(1&n&&mn(Dce,5),2&n){let r;Bt(r=Vt())&&(o.passkeyInputs=r)}},standalone:!1,decls:30,vars:7,consts:[["passkeyInput",""],[1,"dialog-content"],[1,"title"],[1,"description"],[4,"ngIf"],[1,"spacer"],[1,"button-container"],["mat-fab","","extended","","type","button",1,"button-style",3,"click"],["fontSet","material-symbols-outlined"],["mat-fab","","extended","","type","button","class","button-style",3,"click",4,"ngIf"],["mat-fab","","extended","","type","button","class","button-style error-fab-button",3,"click",4,"ngIf"],["class","verified-message",4,"ngIf"],["class","description",4,"ngIf"],["class","button-container",4,"ngIf"],["mat-stroked-button","","type","button",3,"click"],["class","passkey-container",4,"ngFor","ngForOf"],[1,"passkey-container"],["appMaterialElevation","","defaultElevation","4","raisedElevation","8",1,"card-container"],[1,"passkey-card"],[1,"passkey-content"],["fontSet","material-symbols-outlined",1,"passkey-item"],[1,"passkey-item","passkey-info-container"],[1,"bold-text"],[1,"passkey-identifier"],["maxlength","100","matInput","",1,"passkey-input",3,"name","value"],["mat-icon-button","","matTooltip","Rename Passkey",1,"passkey-item",3,"click","disabled"],["mat-icon-button","","matTooltip","Delete Passkey",1,"passkey-item",3,"click","disabled"],["mat-icon-button","","matTooltip","Save Name",1,"passkey-item",3,"click"],["mat-icon-button","","matTooltip","Cancel Rename",1,"passkey-item",3,"click"],["mat-fab","","extended","","type","button",1,"button-style","error-fab-button",3,"click"],[1,"verified-message"],[1,"require-mfa-field","button-style"],["matInput","","readonly","",3,"value"],["matSuffix","","labelPosition","before","name","require_mfa",3,"change","checked","disabled","matTooltip"]],template:function(n,o){1&n&&(w(0,"mat-dialog-content",1)(1,"h5",2),M(2,"Multifactor Authentication"),x(),w(3,"h6"),M(4,"Passkeys"),x(),w(5,"p",3),M(6,"Passkeys are a secure, password-free way to log in to accounts. They use your device's built-in authentication to verify your identity, are safer than passwords and satisfy MFA requirements."),x(),te(7,Pce,4,1,"mat-expansion-panel",4),Re(8,"div",5),w(9,"div",6)(10,"button",7),we("click",function(){return o.onSetupPasskey()}),w(11,"mat-icon",8),M(12,"passkey"),x(),M(13," Setup Passkey "),x()(),Re(14,"div",5),w(15,"h6"),M(16,"Authenticator"),x(),w(17,"p",3),M(18,"Authenticator apps offer one-time passwords (OTPs), which are temporary codes used for extra security during login. This code gets entered along with your regular password."),x(),w(19,"div",6),te(20,Lce,4,0,"button",9)(21,Fce,4,0,"button",10)(22,Nce,5,0,"div",11),x(),Re(23,"div",5),te(24,zce,2,0,"h6",4)(25,Bce,2,0,"p",12)(26,Vce,6,4,"div",13),x(),w(27,"mat-dialog-actions")(28,"button",14),we("click",function(){return o.closeDialog()}),M(29,"Close"),x()()),2&n&&(E(7),N("ngIf",o.passkeys.length>0),E(13),N("ngIf",!o.hasAuthenticator),E(),N("ngIf",o.hasAuthenticator&&!o.data.logging_in),E(),N("ngIf",o.hasAuthenticator&&o.data.logging_in),E(2),N("ngIf",!o.data.logging_in),E(),N("ngIf",!o.data.logging_in),E(),N("ngIf",!o.data.logging_in))},dependencies:[kl,ir,na,Oa,Qs,xa,ws,qa,Ab,Fl,Os,zl,Bl,Gd,Sr,Pa,r0,zx,a0,NT,Rl],styles:[".dialog-content[_ngcontent-%COMP%]{display:block;width:100%;height:auto;overflow:auto}.description[_ngcontent-%COMP%]{font-size:smaller}.button-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}.button-style[_ngcontent-%COMP%]{width:100%}.verified-message[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;background-color:#98d4bb;width:100%;height:4em;padding-top:.5em;border-radius:4em}.verified-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{vertical-align:middle;font-size:1.5em;margin-right:.5em}.verified-message[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;display:flex;align-items:center}.passkey-identifier[_ngcontent-%COMP%]{word-break:break-all}.passkey-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.passkey-card[_ngcontent-%COMP%]{padding-bottom:.5em}.passkey-info-container[_ngcontent-%COMP%]{flex:1;min-width:0;font-size:small}.passkey-input[_ngcontent-%COMP%]{font-size:small}.change-card[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.change-card-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto;width:80%}.title[_ngcontent-%COMP%]{text-align:center;font-weight:700;color:#3f51b5}input[_ngcontent-%COMP%]{width:100%!important}.change-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto}.bold-text[_ngcontent-%COMP%]{font-weight:700}.require-mfa-field[_ngcontent-%COMP%]{margin:0;padding:0}.card-container[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:center;border-radius:1.2em!important;background-color:transparent!important}.passkey-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;padding:0;margin:0}.passkey-item[_ngcontent-%COMP%]{margin-left:.5em;margin-right:.5em}.spacer[_ngcontent-%COMP%]{height:.6em}"]})}return t})();const Uce=["input"],Hce=["formField"],jce=["*"];class OH{source;value;constructor(i,e){this.source=i,this.value=e}}const $ce={provide:Pl,useExisting:lo(()=>V3),multi:!0},PH=new yt("MatRadioGroup"),Gce=new yt("mat-radio-default-options",{providedIn:"root",factory:function qce(){return{color:"accent",disabledInteractive:!1}}});let V3=(()=>{class t{_changeDetector=Y(So);_value=null;_name=Y(ta).getId("mat-radio-group-");_selected=null;_isInitialized=!1;_labelPosition="after";_disabled=!1;_required=!1;_buttonChanges;_controlValueAccessorChangeFn=()=>{};onTouched=()=>{};change=new Tt;_radios;color;get name(){return this._name}set name(e){this._name=e,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markRadiosForCheck()}get required(){return this._required}set required(e){this._required=e,this._markRadiosForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markRadiosForCheck()}_disabledInteractive=!1;constructor(){}ngAfterContentInit(){this._isInitialized=!0,this._buttonChanges=this._radios.changes.subscribe(()=>{this.selected&&!this._radios.find(e=>e===this.selected)&&(this._selected=null)})}ngOnDestroy(){this._buttonChanges?.unsubscribe()}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(e=>{e.name=this.name,e._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(n=>{n.checked=this.value===n.value,n.checked&&(this._selected=n)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new OH(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(e=>e._markForCheck())}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetector.markForCheck()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-radio-group"]],contentQueries:function(n,o,r){if(1&n&&oo(r,CM,5),2&n){let u;Bt(u=Vt())&&(o._radios=u)}},hostAttrs:["role","radiogroup",1,"mat-mdc-radio-group"],inputs:{color:"color",name:"name",labelPosition:"labelPosition",value:"value",selected:"selected",disabled:[2,"disabled","disabled",fn],required:[2,"required","required",fn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]},outputs:{change:"change"},exportAs:["matRadioGroup"],features:[Bn([$ce,{provide:PH,useExisting:t}])]})}return t})(),CM=(()=>{class t{_elementRef=Y(Pn);_changeDetector=Y(So);_focusMonitor=Y(eh);_radioDispatcher=Y(R3);_defaultOptions=Y(Gce,{optional:!0});_ngZone=Y(tn);_renderer=Y(Hr);_uniqueId=Y(ta).getId("mat-radio-");_cleanupClick;id=this._uniqueId;name;ariaLabel;ariaLabelledby;ariaDescribedby;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,e&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!e&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),e&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(e){this._labelPosition=e}_labelPosition;get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(e){this._setDisabled(e)}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(e){e!==this._required&&this._changeDetector.markForCheck(),this._required=e}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._defaultOptions&&this._defaultOptions.color||"accent"}set color(e){this._color=e}_color;get disabledInteractive(){return this._disabledInteractive||null!==this.radioGroup&&this.radioGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new Tt;radioGroup;get inputId(){return`${this.id||this._uniqueId}-input`}_checked=!1;_disabled;_required;_value=null;_removeUniqueSelectionListener=()=>{};_previousTabIndex;_inputElement;_rippleTrigger;_noopAnimations;_injector=Y(Ke);constructor(){Y(Rs).load(wu);const e=Y(PH,{optional:!0}),n=Y(Kr,{optional:!0}),o=Y(new Mt("tabindex"),{optional:!0});this.radioGroup=e,this._noopAnimations="NoopAnimations"===n,this._disabledInteractive=this._defaultOptions?.disabledInteractive??!1,o&&(this.tabIndex=Ql(o,0))}focus(e,n){n?this._focusMonitor.focusVia(this._inputElement,n,e):this._inputElement.nativeElement.focus(e)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.checked&&(this.radioGroup.selected=this),this.name=this.radioGroup.name),this._removeUniqueSelectionListener=this._radioDispatcher.listen((e,n)=>{e!==this.id&&n===this.name&&(this.checked=!1)})}ngDoCheck(){this._updateTabIndex()}ngAfterViewInit(){this._updateTabIndex(),this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{!e&&this.radioGroup&&this.radioGroup._touch()}),this._ngZone.runOutsideAngular(()=>{this._cleanupClick=this._renderer.listen(this._inputElement.nativeElement,"click",this._onInputClick)})}ngOnDestroy(){this._cleanupClick?.(),this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new OH(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputInteraction(e){if(e.stopPropagation(),!this.checked&&!this.disabled){const n=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),n&&this.radioGroup._emitChangeEvent())}}_onTouchTargetClick(e){this._onInputInteraction(e),(!this.disabled||this.disabledInteractive)&&this._inputElement?.nativeElement.focus()}_setDisabled(e){this._disabled!==e&&(this._disabled=e,this._changeDetector.markForCheck())}_onInputClick=e=>{this.disabled&&this.disabledInteractive&&e.preventDefault()};_updateTabIndex(){const e=this.radioGroup;let n;if(n=e&&e.selected&&!this.disabled?e.selected===this?this.tabIndex:-1:this.tabIndex,n!==this._previousTabIndex){const o=this._inputElement?.nativeElement;o&&(o.setAttribute("tabindex",n+""),this._previousTabIndex=n,As(()=>{queueMicrotask(()=>{e&&e.selected&&e.selected!==this&&document.activeElement===o&&(e.selected?._inputElement.nativeElement.focus(),document.activeElement===o&&this._inputElement.nativeElement.blur())})},{injector:this._injector}))}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-radio-button"]],viewQuery:function(n,o){if(1&n&&(mn(Uce,5),mn(Hce,7,Pn)),2&n){let r;Bt(r=Vt())&&(o._inputElement=r.first),Bt(r=Vt())&&(o._rippleTrigger=r.first)}},hostAttrs:[1,"mat-mdc-radio-button"],hostVars:19,hostBindings:function(n,o){1&n&&we("focus",function(){return o._inputElement.nativeElement.focus()}),2&n&&(zn("id",o.id)("tabindex",null)("aria-label",null)("aria-labelledby",null)("aria-describedby",null),Hn("mat-primary","primary"===o.color)("mat-accent","accent"===o.color)("mat-warn","warn"===o.color)("mat-mdc-radio-checked",o.checked)("mat-mdc-radio-disabled",o.disabled)("mat-mdc-radio-disabled-interactive",o.disabledInteractive)("_mat-animation-noopable",o._noopAnimations))},inputs:{id:"id",name:"name",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],disableRipple:[2,"disableRipple","disableRipple",fn],tabIndex:[2,"tabIndex","tabIndex",e=>null==e?0:Ql(e)],checked:[2,"checked","checked",fn],value:"value",labelPosition:"labelPosition",disabled:[2,"disabled","disabled",fn],required:[2,"required","required",fn],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]},outputs:{change:"change"},exportAs:["matRadioButton"],ngContentSelectors:jce,decls:13,vars:17,consts:[["formField",""],["input",""],["mat-internal-form-field","",3,"labelPosition"],[1,"mdc-radio"],[1,"mat-mdc-radio-touch-target",3,"click"],["type","radio","aria-invalid","false",1,"mdc-radio__native-control",3,"change","id","checked","disabled","required"],[1,"mdc-radio__background"],[1,"mdc-radio__outer-circle"],[1,"mdc-radio__inner-circle"],["mat-ripple","",1,"mat-radio-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mat-ripple-element","mat-radio-persistent-ripple"],[1,"mdc-label",3,"for"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"div",2,0)(2,"div",3)(3,"div",4),we("click",function(y){return fe(r),ge(o._onTouchTargetClick(y))}),x(),w(4,"input",5,1),we("change",function(y){return fe(r),ge(o._onInputInteraction(y))}),x(),w(6,"div",6),Re(7,"div",7)(8,"div",8),x(),w(9,"div",9),Re(10,"div",10),x()(),w(11,"label",11),On(12),x()()}2&n&&(N("labelPosition",o.labelPosition),E(2),Hn("mdc-radio--disabled",o.disabled),E(2),N("id",o.inputId)("checked",o.checked)("disabled",o.disabled&&!o.disabledInteractive)("required",o.required),zn("name",o.name)("value",o.value)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),E(5),N("matRippleTrigger",o._rippleTrigger.nativeElement)("matRippleDisabled",o._isRippleDisabled())("matRippleCentered",!0),E(2),N("for",o.inputId))},dependencies:[Mb,k3],styles:['.mat-mdc-radio-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color;padding:calc((var(--mdc-radio-state-layer-size, 40px) - 20px)/2)}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:not([disabled])~.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:hover>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:active>.mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mat-mdc-radio-button .mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px);top:calc(-1*(var(--mdc-radio-state-layer-size, 40px) - 20px)/2);left:calc(-1*(var(--mdc-radio-state-layer-size, 40px) - 20px)/2)}.mat-mdc-radio-button .mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-radio-button .mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-radio-button .mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;top:0;right:0;left:0;cursor:inherit;z-index:1;width:var(--mdc-radio-state-layer-size, 40px);height:var(--mdc-radio-state-layer-size, 40px)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 90ms cubic-bezier(0, 0, 0.2, 1),transform 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__outer-circle{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__inner-circle{transition:transform 90ms cubic-bezier(0, 0, 0.2, 1),border-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 1),transform 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-radio-disabled-unselected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background{cursor:default}.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio__native-control:disabled+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio__native-control:enabled:checked+.mdc-radio__background>.mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio__native-control:enabled:focus:checked+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio__native-control:enabled:focus:checked+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color, var(--mat-sys-primary))}.mat-mdc-radio-button .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle{transform:scale(0.5);transition:transform 90ms cubic-bezier(0, 0, 0.2, 1),border-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled{pointer-events:auto}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:not(:checked)+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-radio-disabled-unselected-icon-opacity, 0.38)}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled:hover .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled:hover .mdc-radio__native-control:checked+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:checked:focus+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control:checked:focus+.mdc-radio__background>.mdc-radio__outer-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control+.mdc-radio__background>.mdc-radio__inner-circle,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__native-control+.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-radio-disabled-selected-icon-opacity, 0.38)}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element,.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color, var(--mat-sys-primary))}.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mat-ripple-element,.mat-mdc-radio-button.mat-mdc-radio-disabled-interactive .mdc-radio--disabled .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button .mat-internal-form-field{color:var(--mat-radio-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-radio-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-radio-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-radio-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-radio-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-radio-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple>.mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button .mdc-radio>.mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background>.mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mat-mdc-radio-button.cdk-focused .mat-focus-indicator::before{content:""}.mat-mdc-radio-disabled{cursor:default;pointer-events:none}.mat-mdc-radio-disabled.mat-mdc-radio-disabled-interactive{pointer-events:auto}.mat-mdc-radio-touch-target{position:absolute;top:50%;left:50%;height:48px;width:48px;transform:translate(-50%, -50%);display:var(--mat-radio-touch-target-display, block)}[dir=rtl] .mat-mdc-radio-touch-target{left:auto;right:50%;transform:translate(50%, -50%)}\n'],encapsulation:2,changeDetection:0})}return t})(),Wce=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,e0,CM,Ki]})}return t})();function Zce(t,i){if(1&t){const e=pt();w(0,"mat-radio-group",13),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.authenticationOption,o)||(r.authenticationOption=o),ge(o)}),we("change",function(o){return fe(e),ge(X().onChangeValidation(o))}),w(1,"mat-radio-button",14),M(2,"Authenticator App"),x(),w(3,"mat-radio-button",14),M(4,"Email"),x()()}if(2&t){const e=X();Kn("ngModel",e.authenticationOption),E(),N("value",e.OTPOption.AUTHENTICATOR_APP),E(2),N("value",e.OTPOption.EMAIL)}}function Yce(t,i){1&t&&(w(0,"p"),M(1,"Enter the authentication code from your app below, then select Submit."),x())}function Xce(t,i){if(1&t&&(w(0,"div"),te(1,Yce,2,0,"p",4),x()),2&t){const e=X();E(),N("ngIf",e.data.userInfo.hasTotp)}}function Kce(t,i){1&t&&(w(0,"div",15)(1,"p"),M(2,"Click the button below to send a one-time password to the email associated with your account. Once received, enter the code below and select Submit."),x()())}function Qce(t,i){if(1&t){const e=pt();w(0,"app-auth-code-entry",16),we("submit",function(o){return fe(e),ge(X().onAuthCodeSubmit(o))}),x()}}function Jce(t,i){if(1&t){const e=pt();w(0,"div",17)(1,"button",18),we("click",function(){return fe(e),ge(X().setupMFA())}),w(2,"mat-icon",12),M(3,"security"),x(),M(4," Setup MFA "),x()()}}function ede(t,i){if(1&t){const e=pt();w(0,"button",19),we("click",function(){return fe(e),ge(X().sendEmailOTP())}),w(1,"mat-icon",12),M(2,"Send"),x(),M(3," Send Email "),x()}2&t&&N("disabled",!X().enableEmailButton)}class tde{userInfo;allow_totp=!0}class LH{setup_passkey=!1;setup_totp=!1;emailed_otp=!1;otp=""}var Bx=function(t){return t[t.AUTHENTICATOR_APP=1]="AUTHENTICATOR_APP",t[t.EMAIL=2]="EMAIL",t}(Bx||{});let nde=(()=>{class t{dialogRef;data;http;snackBar;dialog;authenticatorCode;OTPOption=Bx;authenticationOption=Bx.AUTHENTICATOR_APP;emailSent=!1;enableEmailButton=!0;lastFocusElement=null;constructor(e,n,o,r,u){this.dialogRef=e,this.data=n,this.http=o,this.snackBar=r,this.dialog=u}ngOnInit(){this.data.allow_totp||(this.authenticationOption=Bx.EMAIL)}onDialogMouseDown(e){this.lastFocusElement=document.activeElement}onDialogClick(e){e.target.closest("input, button")||(this.lastFocusElement.closest("input, button")?this.lastFocusElement.focus():this.authenticatorCode.setFocus())}timedEmailButtonDisable(e){this.enableEmailButton=!1,setTimeout(()=>{this.enableEmailButton=!0},1e3*e)}setupMFA(){if(!this.data.allow_totp)return;let e=new z3;e.auth_info=new iM,e.logging_in=!0,e.user_info=this.data.userInfo;const n=new ha;n.data=e,this.dialog.open(B3,n).afterClosed().subscribe({next:o=>{if(o.has_totp||o.has_passkey){let r=new LH;r.setup_totp=o.has_totp,r.setup_passkey=o.has_passkey,r.emailed_otp=!1,r.otp="",this.dialogRef.close(r)}},error:o=>{this.snackBar.open("Unexpected error occurred while processing the dialog.","Dismiss",{duration:5e3})}})}sendEmailOTP(){this.http.get(li_backendURL+"/email/otp",{withCredentials:!0}).subscribe({next:()=>{this.emailSent=!0,this.timedEmailButtonDisable(30),this.authenticatorCode.setFocus()},error:n=>{this.snackBar.open("Error sending authentication email: "+n.message,"Dismiss",{duration:5e3})}})}onChangeValidation(e){e.value==Bx.AUTHENTICATOR_APP&&this.authenticatorCode.setFocus()}onAuthCodeSubmit(e){e&&this.onSubmit()}onSubmit(){let e=new LH;e.emailed_otp=this.authenticationOption==Bx.EMAIL,e.otp=this.authenticatorCode.getEnteredCode(),this.dialogRef.close(e)}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(Mc),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-auth-code-dialog"]],viewQuery:function(n,o){if(1&n&&mn(sM,5),2&n){let r;Bt(r=Vt())&&(o.authenticatorCode=r.first)}},hostBindings:function(n,o){1&n&&we("mousedown",function(u){return o.onDialogMouseDown(u)})("click",function(u){return o.onDialogClick(u)})},standalone:!1,decls:17,vars:9,consts:[[1,"dialog-content"],["mat-dialog-title","",1,"title"],["aria-label","Validation Options",3,"ngModel","ngModelChange","change",4,"ngIf"],[2,"line-height",".001em"],[4,"ngIf"],["class","email-button-container",4,"ngIf"],[3,"submit",4,"ngIf"],["class","dialog-content email-button-container",4,"ngIf"],[1,"dialog-content","email-button-container",3,"matTooltip"],["mat-fab","","extended","","type","button","class","email-button",3,"disabled","click",4,"ngIf"],["align","end"],["mat-fab","","extended","","type","submit",3,"click","disabled","matTooltip"],["fontSet","material-symbols-outlined"],["aria-label","Validation Options",3,"ngModelChange","change","ngModel"],[3,"value"],[1,"email-button-container"],[3,"submit"],[1,"dialog-content","email-button-container"],["mat-fab","","extended","","type","button",1,"email-button",3,"click"],["mat-fab","","extended","","type","button",1,"email-button",3,"click","disabled"]],template:function(n,o){1&n&&(w(0,"mat-dialog-content",0)(1,"h2",1),M(2,"Multifactor Authentication"),x(),te(3,Zce,5,3,"mat-radio-group",2),w(4,"p",3),M(5,"\xa0"),x(),te(6,Xce,2,1,"div",4)(7,Kce,3,0,"div",5)(8,Qce,1,0,"app-auth-code-entry",6)(9,Jce,5,0,"div",7),w(10,"div",8),te(11,ede,4,1,"button",9),x()(),w(12,"mat-dialog-actions",10)(13,"button",11),we("click",function(){return o.onSubmit()}),w(14,"mat-icon",12),M(15,"key"),x(),M(16," Verify "),x()()),2&n&&(E(3),N("ngIf",o.data.allow_totp&&o.data.userInfo.canEmailMFA),E(3),N("ngIf",o.authenticationOption==o.OTPOption.AUTHENTICATOR_APP),E(),N("ngIf",o.data.userInfo.canEmailMFA),E(),N("ngIf",o.authenticationOption==o.OTPOption.AUTHENTICATOR_APP&&o.data.userInfo.hasTotp||o.authenticationOption==o.OTPOption.EMAIL),E(),N("ngIf",!o.data.userInfo.hasTotp&&o.authenticationOption==o.OTPOption.AUTHENTICATOR_APP),E(),N("matTooltip",o.enableEmailButton?"":"Check your email for a one-time password and enter it below."),E(),N("ngIf",o.data.userInfo.canEmailMFA&&o.authenticationOption==o.OTPOption.EMAIL),E(2),N("disabled",o.authenticationOption==o.OTPOption.EMAIL&&!o.emailSent||o.authenticationOption==o.OTPOption.AUTHENTICATOR_APP&&!o.data.userInfo.hasTotp)("matTooltip",o.authenticationOption==o.OTPOption.AUTHENTICATOR_APP?o.data.userInfo.hasTotp?"":"You must setup MFA authenticator or passkey.":o.emailSent?"":"Send one-time password to email, then enter the code."))},dependencies:[ir,wr,ts,Ab,Eb,Fl,Os,Sr,Pa,V3,CM,sM],styles:[".dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.email-button-container[_ngcontent-%COMP%]{text-align:center}.email-button-container[_ngcontent-%COMP%]{width:100%}.email-button[_ngcontent-%COMP%]{width:70%;margin-bottom:.5em}"]})}return t})();var Cu=qt(1247),Su=6371008.8,FH={centimeters:100*Su,centimetres:100*Su,degrees:360/(2*Math.PI),feet:3.28084*Su,inches:39.37*Su,kilometers:Su/1e3,kilometres:Su/1e3,meters:Su,metres:Su,miles:Su/1609.344,millimeters:1e3*Su,millimetres:1e3*Su,nauticalmiles:Su/1852,radians:1,yards:1.0936*Su};function s0(t,i,e={}){const n={type:"Feature"};return(0===e.id||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=i||{},n.geometry=t,n}function I_(t,i,e={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!j3(t[0])||!j3(t[1]))throw new Error("coordinates must contain numbers");return s0({type:"Point",coordinates:t},i,e)}function SM(t,i,e={}){for(const o of t){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(let r=0;r=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function mde(t,i,e,n={}){const o=DM(t),r=E_(o[0]),u=E_(o[1]),y=E_(e),I=U3(i,n.units),V=Math.asin(Math.sin(u)*Math.cos(I)+Math.cos(u)*Math.sin(I)*Math.cos(y));return I_([H3(r+Math.atan2(Math.sin(y)*Math.sin(I)*Math.cos(u),Math.cos(I)-Math.sin(u)*Math.sin(V))),H3(V)],n.properties)}function UH(t,i,e={}){var n=DM(t),o=DM(i),r=E_(o[1]-n[1]),u=E_(o[0]-n[0]),y=E_(n[1]),I=E_(o[1]),V=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(y)*Math.cos(I);return BH(2*Math.atan2(Math.sqrt(V),Math.sqrt(1-V)),e.units)}function HH(t){const i={type:"Feature"};return Object.keys(t).forEach(e=>{switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=jH(t.properties),i.geometry=null==t.geometry?null:G3(t.geometry),i}function jH(t){const i={};return t&&Object.keys(t).forEach(e=>{const n=t[e];i[e]="object"==typeof n?null===n?null:Array.isArray(n)?n.map(o=>o):jH(n):n}),i}function G3(t){const i={type:t.type};return t.bbox&&(i.bbox=t.bbox),"GeometryCollection"===t.type?(i.geometries=t.geometries.map(e=>G3(e)),i):(i.coordinates=$H(t.coordinates),i)}function $H(t){const i=t;return"object"!=typeof i[0]?i.slice():i.map(e=>$H(e))}function IM(t,i,e,n){if(!function sde(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}(n=n||{}))throw new Error("options is invalid");var o=n.units,r=n.zTranslation,u=n.mutate;if(!t)throw new Error("geojson is required");if(null==i||isNaN(i))throw new Error("distance is required");if(r&&"number"!=typeof r&&isNaN(r))throw new Error("zTranslation is not a number");if(r=void 0!==r?r:0,0===i&&0===r)return t;if(null==e||isNaN(e))throw new Error("direction is required");return i<0&&(i=-i,e+=180),(!1===u||void 0===u)&&(t=function _de(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return HH(t);case"FeatureCollection":return function gde(t){const i={type:"FeatureCollection"};return Object.keys(t).forEach(e=>{switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(e=>HH(e)),i}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return G3(t);default:throw new Error("unknown GeoJSON type")}}(t)),l0(t,function(y){var I=function hde(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(function bde(t,i,e,n={}){const o=i<0;let r=function ade(t,i="kilometers",e="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return BH(U3(t,i),e)}(Math.abs(i),n.units,"meters");o&&(r=-Math.abs(r));const u=DM(t),y=function yde(t,i,e,n){const o=i/(n=void 0===n?Su:Number(n)),r=t[0]*Math.PI/180,u=E_(t[1]),y=E_(e),I=o*Math.cos(y);let V=u+I;Math.abs(V)>Math.PI/2&&(V=V>0?Math.PI-V:-Math.PI-V);const q=Math.log(Math.tan(V/2+Math.PI/4)/Math.tan(u/2+Math.PI/4)),ee=Math.abs(q)>1e-11?I/q:Math.cos(u);return[(180*(r+o*Math.sin(y)/ee)/Math.PI+540)%360-180,180*V/Math.PI]}(u,r,e);return y[0]+=y[0]-u[0]>180?-360:u[0]-y[0]>180?360:0,I_(y,n.properties)}(y,i,e,{units:o}));y[0]=I[0],y[1]=I[1],r&&3===y.length&&(y[2]+=r)}),t}function GH(t){return function xde(t,i={}){const e=Number(t[0]),n=Number(t[1]),o=Number(t[2]),r=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");const u=[e,n];return SM([[u,[o,n],[o,r],[e,r],u]],i.properties,{bbox:t,id:i.id})}(function vde(t,i={}){if(null!=t.bbox&&!0!==i.recompute)return t.bbox;const e=[1/0,1/0,-1/0,-1/0];return l0(t,n=>{e[0]>n[0]&&(e[0]=n[0]),e[1]>n[1]&&(e[1]=n[1]),e[2]{class t{platformId;rendererFactory;map;mapContainer;renderer;locationData;locationDict={};filteredSerials;demoHeatmap=!1;heatmapData;heatmapExpiration;heatmapWeightMax=10;fullMapCenterLng=0;fullMapCenterLat=0;fullMapBounds;fullMapBoundsWithPadding;centerBounds;centerLng=0;centerLat=0;device_focus;default_color="#17296F";use_device_color=!1;popup;constructor(e,n){this.platformId=e,this.rendererFactory=n,this.renderer=n.createRenderer(null,null),this.popup=new Cu.Popup({closeButton:!1,closeOnClick:!1}),this.mapContainer=this.renderer.createElement("div"),this.renderer.setStyle(this.mapContainer,"position","absolute"),this.renderer.setStyle(this.mapContainer,"top","0"),this.renderer.setStyle(this.mapContainer,"bottom","0"),this.renderer.setStyle(this.mapContainer,"width","100%"),this.renderer.setStyle(this.mapContainer,"height","100%")}createMap(e,n,o){if(C5(this.platformId)){var r=!1,u=!1,y=this.getMapOptions(this.mapContainer,e,n),I=Cu.accessToken;null==I?Cu.accessToken=e:I!=e&&(Cu.accessToken=e,r=!0),(!this.map||void 0===this.map)&&(u=!0),u&&this.createMapHelper(this.mapContainer,y),this.map.scrollZoom.enable(),this.map.touchZoomRotate.enable(),this.device_focus=o,r?(this.map.setStyle(n),this.map.once("style.load",()=>{this.initializeLayers(),this.updateLocationData(),this.initializeView(),this.updateFilters()})):u?this.map.once("load",()=>{this.map.resize(),this.initializeLayers(),this.updateLocationData(),this.initializeView(),this.updateFilters()}):(this.map.resize(),this.updateLocationData(),this.initializeView(),this.updateFilters())}}useDeviceColor(e){this.use_device_color=e}createMapHelper(e,n){this.map=new Cu.Map({container:e,...n})}getMapContainer(){return this.mapContainer}destroyMap(){null!=this.map&&(this.map.remove(),this.map=void 0),null!=this.locationData&&(this.locationData.length=0),null!=this.heatmapData&&(this.heatmapData.features.length=0),this.locationDict={},this.filteredSerials=[]}getMapOptions(e,n,o){return{container:e,style:o,minZoom:6,maxZoom:18,zoom:10,attributionControl:!0,renderWorldCopies:!0}}initializeLayers(){void 0!==this.map&&(this.map.addSource("location-data",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addSource("heatmap-data",{type:"geojson",data:{type:"FeatureCollection",features:[]},maxzoom:22,minzoom:0}),this.map.addLayer({id:"data-layer",type:"fill",source:"location-data",paint:{"fill-color":["get","color"],"fill-opacity":.35,"fill-outline-color":"black"}}),this.map.addSource("label-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:"data-label-layer",type:"symbol",source:"label-source",layout:{"text-field":["step",["zoom"],"",5,["get","title"]],"text-font":["Roboto Regular"],"text-anchor":"center","text-size":["interpolate",["linear"],["zoom"],14,18,20,22],"text-allow-overlap":!1,"text-ignore-placement":!1,visibility:"visible"},paint:{"text-color":["get","color"],"text-halo-color":"#fff","text-halo-width":2.5,"text-halo-blur":2}}),this.map.addLayer({id:"data-point-marker",type:"circle",source:"label-source",paint:{"circle-radius":["interpolate",["linear"],["zoom"],5,6,10,8,15,10],"circle-color":["get","color"],"circle-opacity":["interpolate",["linear"],["zoom"],5,1,10,.7,15,.3]}}),this.map.addLayer({id:"data-heatmap-layer",type:"heatmap",source:"heatmap-data",paint:{"heatmap-weight":Ux.getHeatMapWeight(this.heatmapWeightMax),"heatmap-intensity":Ux.getHeatMapIntensity(),"heatmap-color":Ux.getHeatMapColor(),"heatmap-radius":Ux.getHeatMapRadius(),"heatmap-opacity":Ux.getHeatMapOpacity()}}),this.map.moveLayer("data-point-marker"),this.map.moveLayer("data-label-layer"),this.map.moveLayer("data-heatmap-layer"),this.showHeatmap(!1),this.map.on("click","data-label-layer",e=>{this.zoomToDevice(e.features[0].properties.serial,!0)}),this.map.on("click","data-point-marker",e=>{this.zoomToDevice(e.features[0].properties.serial,!0)}),this.map.on("mouseenter","data-label-layer",e=>{this.configureMouseHoverEvent(e,!0)}),this.map.on("mouseleave","data-label-layer",e=>{this.configureMouseHoverEvent(e,!1)}),this.map.on("mouseenter","data-point-marker",e=>{this.configureMouseHoverEvent(e,!0)}),this.map.on("mouseleave","data-point-marker",e=>{this.configureMouseHoverEvent(e,!1)}))}showHeatmap(e){void 0!==this.map&&(this.map.setLayoutProperty("data-point-marker","visibility",e?"none":"visible"),this.map.setLayoutProperty("data-label-layer","visibility",e?"none":"visible"),this.map.setLayoutProperty("data-heatmap-layer","visibility",e?"visible":"none"))}configureMouseHoverEvent(e,n){if(n){this.map.getCanvas().style.cursor="pointer";const o=e.features?.[0];if(o&&"Point"===o.geometry.type){const u=Vx(o).geometry.coordinates,y=this.getPopupHtml(o.properties.serial,o.properties.title,o.properties.status,o.properties.status_color,o.properties.status_time);this.popup.setLngLat({lng:u[0],lat:u[1]}).setHTML(y).addTo(this.map)}}else this.map.getCanvas().style.cursor="",this.popup.remove()}getMinimalistTablePopupHtml(e,n,o,r,u){return` \n \n \n \n \n \n \n \n \n \n
Name: ${n}
Serial: ${e}
Status: ${o}
Time: ${u}
\n \n `}getCardPopupHtml(e,n,o,r,u){return` \n \n \n \n \n
\n
    \n
  • Name: ${n}
  • \n
  • Serial: ${e}
  • \n
  • Status: ${o}
  • \n
  • Time: ${u}
  • \n
\n
\n \n `}getHighlightTablePopupHtml(e,n,o,r,u){return` \n \n \n \n \n
\n \n \n \n \n \n
Name:${n}
Serial:${e}
Status:${o}
Last Active:${u}
\n
\n \n `}getBlockQuotePopupHtml(e,n,o,r,u){return` \n \n \n \n \n
\n
\n

Name: ${n}

\n

Serial: ${e}

\n

Status: ${o}

\n

Last Active: ${u}

\n
\n
\n \n `}getPopupHtml(e,n,o,r,u){let y="";return y=this.getBlockQuotePopupHtml(e,n,o,r,u),y}updateFilteredData(e){this.filteredSerials=[],e.forEach(n=>{this.filteredSerials.push(n.status_info.serialnumber)})}updateFilters(){this.map.setFilter("data-layer",["in",["get","serial"],["literal",this.filteredSerials]]),this.map.setFilter("data-label-layer",["in",["get","serial"],["literal",this.filteredSerials]]),this.map.setFilter("data-point-marker",["in",["get","serial"],["literal",this.filteredSerials]])}addLocationData(e){var n=!1;return this.locationDict.hasOwnProperty(e.serial)?this.hasLocationChanged(e,this.locationDict[e.serial])&&(this.locationDict[e.serial]=e,n=!0):(this.locationDict[e.serial]=e,n=!0),n}hasLocationChanged(e,n){var o=!1;return e.serial==n.serial&&((e.longitude!=n.longitude||e.latitude!=n.latitude||e.accuracy!=n.accuracy||e.available!=n.available)&&(o=!0),o)}updateLocationData(){if(void 0!==this.map){void 0===this.locationData&&(this.locationData=new Array);var e=!1;for(const he in this.locationDict){const Ce=this.locationDict[he];var n=this.locationData.findIndex(je=>je.properties.serial==Ce.serial);if(-1==n&&Ce.available){var o=this.getFeature(Ce);this.locationData.push(o),e=!0}else if(-1!=n)if(Ce.available){var u=Vx(this.locationData[n]).geometry.coordinates;(u[0]!=Ce.longitude||u[1]!=Ce.latitude)&&(this.locationData[n]=this.getFeature(Ce),e=!0)}else this.locationData.splice(n,1),e=!0}if(e){var V={type:"FeatureCollection",features:this.locationData};this.map.getSource("location-data").setData(V);var ee={type:"FeatureCollection",features:this.locationData.map(Ce=>{const je=Vx(Ce);return{...Ce,geometry:je.geometry}})};this.map.getSource("label-source").setData(ee)}}}isHeatMapExpired(e){return void 0===this.heatmapExpiration||void 0===this.heatmapData||0==this.heatmapData.features.length||this.demoHeatmap!=e||new Date>this.heatmapExpiration}setHeatMapData(e,n){this.demoHeatmap=n,this.heatmapData=e.geojson,this.heatmapWeightMax=e.weight_max;var o={type:"FeatureCollection",features:this.heatmapData.features},r=this.map.getSource("heatmap-data");void 0!==r&&(r.setData(o),void 0!==this.map.getLayer("data-heatmap-layer")&&(this.map.setPaintProperty("data-heatmap-layer","heatmap-weight",Ux.getHeatMapWeight(this.heatmapWeightMax)),this.heatmapExpiration=new Date((new Date).getTime()+432e5)))}getFeature(e){var n=this.use_device_color?e.status_color:this.default_color,I=function fde(t,i,e={}){const n=e.steps||64,o=e.properties?e.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},r=[];for(let u=0;u{Ei.geometry.coordinates.forEach(ma=>{ma.forEach(br=>{this.fullMapBounds.extend(br)})})});const I=this.fullMapBounds.getSouthWest(),V=this.fullMapBounds.getNorthEast(),q=I_([I.lng,I.lat]),ee=I_([V.lng,V.lat]),me=UH(q,ee,{units:"meters"}),Ce=Math.max(me,321869),je=Math.min(3e5,.5*Ce),mt=IM(q,je,225,{units:"meters"}),Lt=IM(ee,je,45,{units:"meters"}),At=new Cu.LngLat(...mt.geometry.coordinates),Mn=new Cu.LngLat(...Lt.geometry.coordinates);this.fullMapBoundsWithPadding=new Cu.LngLatBounds(At,Mn),this.map.setMaxBounds(this.fullMapBoundsWithPadding);const di=this.map.cameraForBounds(this.fullMapBoundsWithPadding,{padding:50})?.zoom;this.map.setMinZoom(di?Math.max(di,6):6),this.map.setMaxZoom(18)}calculateMapBoundsForHeatMap(){if(void 0===this.map)return;const e=this.heatmapData;if(void 0===e||0==e.features.length)return;const n=Vx(e),[o,r]=n.geometry.coordinates;this.fullMapCenterLng=o,this.fullMapCenterLat=r,this.fullMapBounds=new Cu.LngLatBounds,e.features.forEach(Lt=>{this.fullMapBounds.extend(Lt.geometry.coordinates)});const u=this.fullMapBounds.getSouthWest(),y=this.fullMapBounds.getNorthEast(),I=I_([u.lng,u.lat]),V=I_([y.lng,y.lat]),q=UH(I,V,{units:"meters"}),ee=Math.min(3e5,.5*q),me=IM(I,ee,225,{units:"meters"}),he=IM(V,ee,45,{units:"meters"}),Ce=new Cu.LngLat(...me.geometry.coordinates),je=new Cu.LngLat(...he.geometry.coordinates);this.fullMapBoundsWithPadding=new Cu.LngLatBounds(Ce,je),this.map.setMaxBounds(this.fullMapBoundsWithPadding);const mt=this.map.cameraForBounds(this.fullMapBoundsWithPadding,{padding:50})?.zoom;this.map.setMinZoom(mt?Math.max(mt,6):6),this.map.setMaxZoom(18)}initializeView(e=!1){e?this.initializeViewForHeatMap():this.initializeViewForLocations()}initializeViewForLocations(){if(void 0===this.map)return;const e=this.locationData;void 0===e||0==e.length||(this.calculateMapBounds(!1),null!=this.device_focus?this.zoomToDevice(this.device_focus):(this.centerLng=this.fullMapCenterLng,this.centerLat=this.fullMapCenterLat,this.centerBounds=this.fullMapBounds,this.resetView(null,this.centerBounds)))}initializeViewForHeatMap(){if(void 0===this.map)return;const e=this.heatmapData;void 0===e||0==e.features.length||(this.calculateMapBounds(!0),this.centerLng=this.fullMapCenterLng,this.centerLat=this.fullMapCenterLat,this.centerBounds=this.fullMapBounds,this.resetView(null,this.centerBounds))}zoomToDevice(e,n=!1){let o=null,r=null;if(null!=e&&this.locationDict.hasOwnProperty(e)){r=this.locationDict[e],o=this.getFeature(r);const y=Vx(GH(o)),[I,V]=y.geometry.coordinates;this.centerLng=I,this.centerLat=V;let q=new Cu.LngLatBounds;o.geometry.coordinates.forEach(ee=>{ee.forEach(me=>{q.extend(me)})}),null!=this.device_focus&&this.device_focus==e&&(this.centerBounds=q),this.resetView(e,q,n)}}getViewPadding(e){var n=null==e?50:300,u=Math.min(this.mapContainer.offsetWidth/3,this.mapContainer.offsetHeight/3);return Math.min(n,u)}resetView(e,n,o=!1){if(!this.map)return;const r=n??this.centerBounds;if(!r)return;const u=this.getViewPadding(e),y=this.map.cameraForBounds(r,{padding:u});if(!y||void 0===y.zoom||!y.center)return;const V=this.map.getContainer().clientHeight<300?5:3,q=Math.max(y.zoom,V);o?this.map.flyTo({center:y.center,zoom:q,bearing:0,pitch:0,duration:2e3,easing:ee=>ee*(2-ee)}):this.map.jumpTo({center:y.center,zoom:q,bearing:this.map.getBearing()})}centralizeMap(e,n){void 0!==this.map&&this.map.setCenter([e,n])}getBuiltInStyle(){return null}static \u0275fac=function(n){return new(n||t)(xn(xy),xn(Qc))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Hx=(()=>{class t{static idle_filter=1;static schedule_filter=2;static record_filter=4;static upload_filter=8;static flex_schedule_filter=16;static isFilterCodeValid(e){return!!(0==e||e&t.idle_filter||e&t.schedule_filter||e&t.record_filter||e&t.upload_filter||e&t.flex_schedule_filter)}}return t})(),tc=(()=>class t{static IDLE_COLOR="RGBA(154,174,187,1.0)";static SCHEDULE_COLOR="RGBA(237,152,43,1.0)";static SCHEDULE_FLEX_COLOR="RGBA(255,212,0,1.0)";static RECORD_COLOR="RGBA(109,219,156,1.0)";static UPLOAD_COLOR="RGBA(141,161,255,1.0)";static ERROR_RED_COLOR="RGBA(245,104,87,1.0)";static ERROR_YELLOW_COLOR="RGBA(247,227,130,1.0)"})();const c0="RGBA(0,0,0,1.0)";let WH=(()=>class t{static statusPollingMin=1;static millisecPerMin=6e4})();class Cde{constructor(){this.device_filter=0,this.serial_filter="",this.friendly_name_filter=""}isEmpty(i){return!i||0===i.trim().length}filtersApplied(){let i=0===this.device_filter,e=this.isEmpty(this.serial_filter),n=this.isEmpty(this.friendly_name_filter);return!i||!e||!n}device_filter;serial_filter;friendly_name_filter}class Sde{constructor(){this.serialnumber="",this.friendlyname="",this.study_id="",this.statustime="",this.schedule_time="",this.code=0,this.mode=0,this.gooddata=!1,this.starttype=0,this.wornonwrist=!1,this.duration_frames=0,this.valid_epochs=0,this.valid_epochs_target=0,this.night="",this.frame=0,this.spo2=0,this.pulse=0,this.spo2connected=!1,this.polyconnected=!1,this.beltconnected=!1,this.airflowconnected=!1,this.spo2disconnecttime=null,this.airflowdisconnecttime=null,this.beltdisconnecttime=null,this.sensordisconnecttime=null,this.has_location_info=!1,this.longitude=0,this.latitude=0,this.location_meters_accuracy=0}serialnumber;friendlyname;study_id;statustime;schedule_time;code;mode;gooddata;starttype;wornonwrist;duration_frames;valid_epochs;valid_epochs_target;night;frame;spo2;pulse;spo2connected;polyconnected;beltconnected;airflowconnected;spo2disconnecttime;airflowdisconnecttime;beltdisconnecttime;sensordisconnecttime;has_location_info;longitude;latitude;location_meters_accuracy}class Tde{constructor(){this.background_clr=tc.IDLE_COLOR,this.comm_err_icon="signal_cellular_connected_no_internet_4_bar",this.comm_err_icon_clr=c0,this.notify_err_icon="notification_important",this.notify_err_icon_clr=c0,this.reccomplete_final_icon="check_circle",this.reccomplete_final_icon_clr=c0,this.upload_fail_icon="cable",this.upload_fail_icon_clr=c0,this.upload_success_icon="cloud_done",this.upload_success_icon_clr=c0,this.good_data_icon="verified",this.good_data_fail_icon="cancel",this.good_data_pending_icon="pending",this.good_data_indeterminate="horizontal_rule",this.good_data_icon_clr=c0,this.mode_icon="update_disabled",this.mode_icon_clr=c0,this.good_data_icon_set=this.good_data_fail_icon,this.good_data_icon_tooltip_set=""}background_clr;comm_err_icon;comm_err_icon_clr;notify_err_icon;notify_err_icon_clr;reccomplete_final_icon;reccomplete_final_icon_clr;upload_fail_icon;upload_fail_icon_clr;upload_success_icon;upload_success_icon_clr;good_data_icon;good_data_fail_icon;good_data_pending_icon;good_data_indeterminate;good_data_icon_clr;mode_icon;mode_icon_clr;good_data_icon_set;good_data_icon_tooltip_set}class Dde{constructor(){this.place_holder=!1,this.pinned=!1,this.comm_error=!1,this.notify_error=!1,this.sensor_error=!1,this.sensor_error_urgent=!1,this.recording=!1,this.recorded=!1,this.uploading=!1,this.uploaded=!1,this.upload_failed=!1,this.final_status=!1,this.final_status_upload=!1,this.sufficient_data=!1,this.sched_hours=0,this.record_hours=0,this.record_pcnt=0,this.good_data_hours=0,this.good_data_pcnt=0,this.night="1",this.mode_text="",this.status_text="",this.start_type_text=""}place_holder;pinned;comm_error;notify_error;sensor_error;sensor_error_urgent;recording;recorded;uploading;uploaded;upload_failed;final_status;final_status_upload;sufficient_data;spo2_error_min;airflow_error_min;belt_error_min;sched_hours;record_hours;record_pcnt;good_data_hours;good_data_pcnt;night;mode_text;status_text;start_type_text}class W3{constructor(){this.status_info=new Sde,this.status_extra_info=new Dde,this.ui_info=new Tde}status_info;status_extra_info;ui_info}class Ide{serialnumber;friendlyname;scheduleUUID;starttype;wornonwrist;duration_frames;night;rec_frames;has_location}class kb{constructor(i,e,n,o,r,u,y,I){this.mode_text=i,this.is_recorded=e,this.is_recording=n,this.is_uploading=o,this.color=r,this.icon=u,this.icon_color=y,this.ack_error=I}mode_text;is_recorded;is_recording;is_uploading;color;icon;icon_color;ack_error}class Lr{constructor(i,e,n){this.status_text=i,this.notify_error=e,this.comm_error=n}status_text;notify_error;comm_error}class d0{constructor(i,e){this.starttype_text=i,this.is_smartstart=e}starttype_text;is_smartstart}const M_={0:new kb("Idle",!1,!1,!1,tc.IDLE_COLOR,"assignment_late","RGBA(220,160,60,0.75)",!1),1:new kb("Scheduled",!1,!1,!1,tc.SCHEDULE_COLOR,"event_available","RGBA(220,160,60,0.75)",!1),2:new kb("Recording",!1,!0,!1,tc.RECORD_COLOR,"radio_button_checked","RGBA(0,98,210,0.75)",!0),3:new kb("Uploading",!0,!1,!0,tc.UPLOAD_COLOR,"cloud_upload","RGBA(0,98,210,0.75)",!0),4:new kb("Finished",!0,!1,!1,tc.RECORD_COLOR,"check_circle","RGBA(0,98,210,0.75)",!0),99:new kb("Flex Scheduled",!1,!1,!1,tc.SCHEDULE_FLEX_COLOR,"calendar_add_on","RGBA(220,160,60,0.75)",!1),100:new kb("No Status",!1,!1,!1,tc.IDLE_COLOR,"update_disabled","RGBA(220,160,60,0.75)",!1),101:new kb("No Subscription",!1,!1,!1,tc.IDLE_COLOR,"report","RGBA(220,160,60,0.75)",!1)},ZH={1:new d0("SmartStart RIP",!0),2:new d0("SmartStart SpO2",!0),3:new d0("SmartStart RIP or SpO2",!0),4:new d0("SmartStart RIP and SpO2",!0),8:new d0("Button Press",!1),16:new d0("Immediate",!1),32:new d0("Timed Start",!1)},BT={1:new Lr("Recording Start",!1,!1),2:new Lr("Recording End",!1,!1),4:new Lr("Button Pressed",!1,!1),8:new Lr("SpO2 Probe Disconnect",!0,!1),16:new Lr("SpO2 Dropout",!0,!1),32:new Lr("RIP Belt Disconnect",!0,!1),64:new Lr("Poly Channel Lead-Off Detected",!0,!1),128:new Lr("Device Recording Error",!0,!1),256:new Lr("Study Start: 5 Minute Check-In",!1,!1),512:new Lr("Study Start: 15 Minute Check-In",!1,!1),1024:new Lr("Study Start: 30 Minute Check-In",!1,!1),2048:new Lr("Study Start: 1 Hour Check-In",!1,!1),4096:new Lr("30 Minute Interval Check-In",!1,!1),8192:new Lr("1 Hour Interval Check-In",!1,!1),16384:new Lr("2 Hour Interval Check-In",!1,!1),32768:new Lr("3 Hour Interval Check-In",!1,!1),65536:new Lr("4 Hour Interval Check-In",!1,!1),131072:new Lr("2 Hours Valid Signal Recorded",!1,!1),262144:new Lr("4 Hours Valid Signal Recorded",!1,!1),524288:new Lr("6 Hours Valid Signal Recorded",!1,!1),1048576:new Lr("8 Hours Valid Signal Recorded",!1,!1),2097152:new Lr("10 Hours Valid Signal Recorded",!1,!1),4194304:new Lr("SpO2 Probe Reconnect",!1,!1),8388608:new Lr("RIP Belt Reconnect",!1,!1),16777216:new Lr("Poly Channel Reconnect",!1,!1),33554432:new Lr("Upload Start",!1,!1),67108864:new Lr("Upload Failed",!1,!1),134217728:new Lr("Upload Complete",!1,!1),268435456:new Lr("Valid Study",!1,!1),536870912:new Lr("Invalid Study",!1,!1),1073741824:new Lr("Flex Night Added",!1,!1),2147483648:new Lr("Schedule Expired",!1,!0)},VT=134217728,jx=67108864,u0=33554432;function AM(t){let i=new Date,e=new Date(t),n=0;return n=i.getTime()-e.getTime(),Math.trunc(n/6e4)}function Rde(t){let i=new W3;i.status_info=t;let e=!1,n=!1,o=!1,r=!1,u=!1,y=!1,I=!1,V=!1,q=!1,ee="",me="",he="",Ce=!1;if(M_.hasOwnProperty(t.mode)||(i.status_info.mode=t.mode=0),4==t.mode&&(e=!0),t.code&VT&&(n=!0),(t.code&u0||t.code&VT||t.code&jx)&&(o=!0),V=M_[t.mode].ack_error,r=M_[t.mode].is_recording,u=M_[t.mode].is_recorded||e,y=M_[t.mode].is_uploading||o,I=n,i.status_extra_info.recorded=u,i.status_extra_info.recording=r,i.status_extra_info.uploading=y,i.status_extra_info.uploaded=I,y&&4!=t.mode&&3!=t.mode&&(t.mode=3),4==t.mode&&!y||3==t.mode&&I||4==t.mode&&I?(q=!0,i.status_extra_info.final_status=!0):(q=!1,i.status_extra_info.final_status=!1),q){let At="",Mn="",di="",Ei=!1;[Mn,At,di,Ei]=function kde(t){let i=t.ui_info.reccomplete_final_icon,e="Recording Complete",n=tc.RECORD_COLOR,o=!1;return t.status_info.code&VT?(i=t.ui_info.upload_success_icon,e="Upload Complete",n=tc.UPLOAD_COLOR,o=!0):t.status_info.code&jx&&(t.status_extra_info.upload_failed=!0,i=t.ui_info.upload_fail_icon,e="Upload Failed",n=tc.UPLOAD_COLOR,o=!0),[e,i,n,o]}(i),ee=At,me=Mn,he=di,Ce=Ei}let je=function Mde(t){let i=[];return t&VT?i=[jx,u0,2,1]:t&jx?i=[u0,2,1]:t&u0?i=[2,1]:2&t&&(i=[1]),i}(t.code);if(Object.keys(BT).forEach(At=>{Number(At)&t.code&&!je.includes(Number(At))&&(0==i.status_extra_info.status_text.length?i.status_extra_info.status_text=BT[At].status_text:(i.status_extra_info.status_text+=", ",i.status_extra_info.status_text+=BT[At].status_text),BT[At].notify_error&&(i.status_extra_info.notify_error=!0),BT[At].comm_error&&(i.status_extra_info.comm_error=!0))}),!q&&0!=t.mode&&100!=t.mode&&101!=t.mode){let At=new Date,Mn=new Date(t.statustime),di=0;di=At.getTime()-Mn.getTime();let Ei=function Ade(t,i){let e=36e5,n=2*e;switch(t){case 1:n=48*e;break;case 2:n=2*e;break;case 3:!(i&u0)&&!(i&jx)&&!(i&VT)&&(n=8*e),i&u0&&(n=4*e)}return n}(t.mode,t.code);di>=Ei&&(i.status_extra_info.comm_error=!0)}"NMDAIR-VIRTUAL-TEST"!=i.status_info.serialnumber&&(100==t.mode||101==t.mode)&&(i.status_info.has_location_info=!1);let mt=!0;if(0==t.mode||100==t.mode||101==t.mode?(mt=!1,i.status_extra_info.start_type_text="",i.status_extra_info.night=""):ZH.hasOwnProperty(t.starttype)&&(i.status_extra_info.start_type_text=ZH[t.starttype].starttype_text),mt&&(i.status_extra_info.night="1",0!=t.night.length)){let At=t.night.indexOf("/");if(-1!=At){let Mn=t.night.substring(0,At);""!=Mn&&(i.status_extra_info.night=Mn)}}if(q?(i.status_extra_info.final_status_upload=Ce,i.status_extra_info.mode_text=me,i.ui_info.mode_icon=ee,i.ui_info.background_clr=he):3==t.mode&&t.code&jx?(i.status_extra_info.upload_failed=!0,i.status_extra_info.mode_text=M_[t.mode].mode_text,i.ui_info.mode_icon=i.ui_info.upload_fail_icon):(i.status_extra_info.mode_text=M_[t.mode].mode_text,i.ui_info.mode_icon=M_[t.mode].icon),i.status_extra_info.sched_hours=t.duration_frames/3600,i.status_extra_info.record_hours=t.frame/3600,i.status_extra_info.record_pcnt=i.status_extra_info.record_hours/i.status_extra_info.sched_hours*100,i.status_extra_info.good_data_hours=t.valid_epochs/120,i.status_extra_info.good_data_pcnt=0,t.valid_epochs>0&&t.valid_epochs_target>0){let At=t.valid_epochs/t.valid_epochs_target*100;i.status_extra_info.good_data_pcnt=At>=100?100:At,100==i.status_extra_info.good_data_pcnt&&(i.status_extra_info.sufficient_data=!0)}r&&(!t.spo2connected||/*!statusDBInfo.polyconnected ||*/ !t.airflowconnected||!t.beltconnected&&!t.wornonwrist)&&(i.status_extra_info.notify_error=!0,i.status_extra_info.sensor_error=!0),V||(i.status_extra_info.notify_error=!1),r&&i.status_extra_info.sensor_error&&null!=t.sensordisconnecttime&&(AM(t.sensordisconnecttime)>=30&&(i.status_extra_info.sensor_error_urgent=!0),null!=t.spo2disconnecttime&&(i.status_extra_info.spo2_error_min=AM(t.spo2disconnecttime)),null!=t.airflowdisconnecttime&&(i.status_extra_info.airflow_error_min=AM(t.airflowdisconnecttime)),null!=t.beltdisconnecttime&&(i.status_extra_info.belt_error_min=AM(t.beltdisconnecttime))),q||(i.ui_info.background_clr=M_[t.mode].color);let Lt=function Ede(t){let i=(t.status_info.valid_epochs/120).toFixed(1)+" hours",e=t.ui_info.good_data_fail_icon,n="";if(t.status_extra_info.sufficient_data)e=t.ui_info.good_data_icon,n="Valid data target reached; Valid data recorded: "+i;else switch(t.status_info.mode){case 0:case 1:case 100:e="",n="Pending";break;case 101:e="",n="";break;case 3:case 4:e=t.ui_info.good_data_fail_icon,n="Valid data target not reached; Valid data recorded: "+i;break;case 2:e=t.ui_info.good_data_pending_icon,n="Recording in progress; Valid data recorded: "+i}return[e,n]}(i);return i.ui_info.good_data_icon_set=Lt[0],i.ui_info.good_data_icon_tooltip_set=Lt[1],i}const Ode=["mapContainer"];function Pde(t,i){if(1&t&&(w(0,"h6"),M(1),ti(2,"date"),x()),2&t){const e=X();E(),Ct(hi(2,1,e.commonFunctionHelper.getDateFromDateString(e.status_time),"medium"))}}function Lde(t,i){if(1&t){const e=pt();w(0,"mat-slide-toggle",11),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.showHeatMap,o)||(r.showHeatMap=o),ge(o)}),we("change",function(){return fe(e),ge(X().toggleHeatMap())}),w(1,"span",12),M(2,"Heat-Map"),x()()}2&t&&Kn("ngModel",X().showHeatMap)}let kM=(()=>{class t{dialogRef;data;loginService;renderer;http;route;snackBar;mapContainer;commonFunctionHelper=new Rb;mapService;mapStyleURL="";mapAPIKey="";demoMode=!1;device_info=null;device_name=null;device_serial=null;status_time=null;title="WatchTower Map";multi_view=!1;showHeatMap=!1;constructor(e,n,o,r,u,y,I){this.dialogRef=e,this.data=n,this.loginService=o,this.renderer=r,this.http=u,this.route=y,this.snackBar=I,this.device_info=n,this.mapService=this.loginService.mapService,this.mapStyleURL=this.loginService.getMapStyleURL(),this.mapAPIKey=this.loginService.getMapAPIKey()}ngOnInit(){const e=this.mapService.getMapContainer();this.renderer.appendChild(this.mapContainer.nativeElement,e),null!=this.device_info&&(this.device_name=this.device_info.status_info.friendlyname,this.device_serial=this.device_info.status_info.serialnumber,this.status_time=this.device_info.status_info.statustime,this.mapService.updateFilteredData([this.device_info])),this.demoMode=this.loginService.getNomadAirStatusDemoMode(),this.setTitle(),this.setupMap(),this.resetView()}ngAfterViewInit(){}ngOnDestroy(){this.hideHeatmap()}setupMap(){this.mapService.createMap(this.mapAPIKey,this.mapStyleURL,this.device_serial),this.mapService.map.on("error",e=>{e.error.message.includes("Unauthorized")&&this.refreshToken()})}showHeatmap(){if(this.mapService.isHeatMapExpired(this.demoMode)){const e=this.loginService.getOrg(this.route);let n=`${li_backendURL}/organizations/${e}/heatmap`;this.demoMode&&(n+="?demo=true"),this.http.get(n,{withCredentials:!0}).subscribe({next:o=>{this.mapService.setHeatMapData(o,this.demoMode),this.showHeatmapHelper()},error:o=>{this.snackBar.open(`Failed to get heatmap data: ${o.message}`,"Dismiss",{duration:5e3})}})}else this.showHeatmapHelper()}showHeatmapHelper(){this.mapService.showHeatmap(!0),this.mapService.initializeView(!0)}hideHeatmap(){this.mapService.showHeatmap(!1),this.mapService.initializeView(!1)}toggleHeatMap(){this.showHeatMap?this.showHeatmap():this.hideHeatmap()}resetView(){this.showHeatMap?this.showHeatmap():this.mapService.resetView(this.device_name,null,!0)}setTitle(){null!=this.device_name?(this.multi_view=!1,this.title=this.device_name):(this.multi_view=!0,this.title="WatchTower Map")}closeDialog(){this.mapService.showHeatmap(!1),this.dialogRef.close()}refreshToken(){this.http.get(li_backendURL+"/maps-api",{withCredentials:!0,observe:"response"}).subscribe(o=>{this.mapAPIKey=o.mapAPIKey,this.mapStyleURL=o.mapStyleURL,this.loginService.setMapAPIKey(this.mapAPIKey),this.loginService.setMapStyleURL(this.mapStyleURL),this.mapService.createMap(this.mapAPIKey,this.mapStyleURL,this.device_serial)})}static \u0275fac=function(n){return new(n||t)($e(tM),$e(Ks),$e(Po),$e(Hr),$e(Uo),$e(id),$e(Mc))};static \u0275cmp=cn({type:t,selectors:[["app-watchtower-map"]],viewQuery:function(n,o){if(1&n&&mn(Ode,7),2&n){let r;Bt(r=Vt())&&(o.mapContainer=r.first)}},standalone:!1,decls:19,vars:3,consts:[["mapContainer",""],["mat-dialog-title","",1,"title"],[1,"title-container"],["fontSet","material-symbols-outlined"],[4,"ngIf"],[1,"map-container"],[1,"dialog-actions"],[1,"button-div-left"],["labelPosition","before",3,"ngModel","ngModelChange","change",4,"ngIf"],[1,"button-div-right"],["mat-raised-button","","color","primary",3,"click"],["labelPosition","before",3,"ngModelChange","change","ngModel"],[1,"heat-map-label"]],template:function(n,o){if(1&n){const r=pt();w(0,"div",1)(1,"div",2)(2,"mat-icon",3),M(3,"map"),x(),w(4,"h4"),M(5),x()(),te(6,Pde,3,4,"h6",4),x(),w(7,"mat-dialog-content")(8,"div",5),Re(9,"div",null,0),x()(),w(11,"mat-dialog-actions",6)(12,"div",7),te(13,Lde,3,1,"mat-slide-toggle",8),x(),w(14,"div",9)(15,"button",10),we("click",function(){return fe(r),ge(o.resetView())}),M(16,"Reset View"),x(),w(17,"button",10),we("click",function(){return fe(r),ge(o.closeDialog())}),M(18,"Close"),x()()()}2&n&&(E(5),Ct(o.title),E(),N("ngIf",null!=o.status_time),E(7),N("ngIf",o.multi_view))},dependencies:[ir,wr,ts,ws,Eb,Fl,Os,Gd,Sr,Rl],styles:["body[_ngcontent-%COMP%]{margin:0;padding:0}mat-dialog-content[_ngcontent-%COMP%]{overflow-y:hidden;flex-grow:1;max-height:unset}.dialog-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.button-div-left[_ngcontent-%COMP%]{display:flex;align-items:center}.button-div-right[_ngcontent-%COMP%]{display:flex;gap:10px}.map-container[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;text-align:center;vertical-align:middle}.title-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.6em}.title[_ngcontent-%COMP%]{font-family:Roboto,Helvetica Neue,sans-serif;color:var(--mat-sys-primary);letter-spacing:.05em;font-weight:500}.heat-map-label[_ngcontent-%COMP%]{color:var(--mat-sys-primary);font-weight:500}"]})}return t})();class Rb{getCardStyle(i,e){let n={"background-color":i.ui_info.background_clr,cursor:"default"};if(100!=i.status_info.mode&&101!=i.status_info.mode&&(n.cursor="pointer"),i.status_extra_info.recording&&i.status_extra_info.sensor_error&&i.status_extra_info.sensor_error_urgent){let r="medium";n["border-style"]="solid",n["border-width"]=r,n["border-color"]=tc.ERROR_RED_COLOR}return n}getDateFromDateString(i){if(!i)return null;!(i=i.replace(/([+-]\d{2}:\d{2})Z$/,"$1")).endsWith("Z")&&!/[+-]\d{2}:\d{2}$/.test(i)&&(i+="Z");const e=new Date(i);return isNaN(e.getTime())?null:e}canShowNotifyErrorIcon(i){return!!i.status_extra_info.notify_error}hasSensorErrors(i){return!!i.status_extra_info.sensor_error}canShowCommunicationErrorIcon(i){return!(i.status_extra_info.uploaded||!i.status_extra_info.comm_error||i.status_extra_info.upload_failed)}canShowRecordCompleteIcon(i){return!(!i.status_extra_info.final_status||i.status_extra_info.uploaded||i.status_extra_info.comm_error)}canShowUploadCompleteIcon(i){return!(!i.status_extra_info.final_status||!i.status_extra_info.uploaded)}formatSSDI(i){let e=i.toFixed(1);return i>=10&&(e=i.toFixed(0)),e}viewAllDeviceMap(i,e,n,o){i.openCenterFull(e,kM,{height:o,width:n,data:null,autoFocus:!1})}viewSingleDeviceMap(i,e,n){i.openCenterFull(e,kM,{height:"50em",width:"50em",data:n,autoFocus:!1})}}const RM={LOGIN:li_backendURL+"/login",LOGIN_TOKEN:li_backendURL+"/login/token",LOGOUT:li_backendURL+"/logout",VALIDATE_OTP:li_backendURL+"/login/totp"};let UT=(()=>{class t{getToken(){return sessionStorage.getItem("token")}setToken(e){sessionStorage.setItem("token",e)}clearToken(){sessionStorage.removeItem("token")}isTokenPresent(){return!!this.getToken()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),YH=(()=>{class t{getDemoMode(){return JSON.parse(localStorage.getItem("NomadAirDemoMode")||"false")}setDemoMode(e){localStorage.setItem("NomadAirDemoMode",JSON.stringify(e))}getDemoCount(){return JSON.parse(localStorage.getItem("NomadAirDemoCount")||"50")}setDemoCount(e){localStorage.setItem("NomadAirDemoCount",JSON.stringify(e))}getLastRequest(){return localStorage.getItem("lastRequest")}setLastRequest(){localStorage.setItem("lastRequest",(new Date).toString())}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Nde=(()=>{class t{http;constructor(e){this.http=e}isSessionExpired(){const e=new Date,n=localStorage.getItem("lastRequest");if(!n)return!0;let o;try{if(o=new Date(n),isNaN(o.getTime()))throw new Error("Invalid date")}catch{return!0}return e.getTime()-o.getTime()>36e5}static \u0275fac=function(n){return new(n||t)(xn(Uo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),zde=(()=>{class t{sessionChecker;tokenService;injector;sessionSub=new ai;constructor(e,n,o){this.sessionChecker=e,this.tokenService=n,this.injector=o}get authService(){return this.injector.get(Po)}get errorService(){return this.injector.get(n0)}start(){this.sessionSub=wb(1e3,1e4).subscribe(()=>{const e=!this.tokenService.isTokenPresent(),n=this.sessionChecker.isSessionExpired();(e||n)&&(n&&this.errorService.report("Session expired."),this.authService.logout(!0))})}stop(){this.sessionSub.unsubscribe()}static \u0275fac=function(n){return new(n||t)(xn(Nde),xn(UT),xn(Ke))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const XH=li_backendURL+"/nomadairstatus";let KH=(()=>{class t{http;constructor(e){this.http=e}getAllStatus(e,n,o,r){let y=new se;if(null===n)return y;null==e&&(e="?");let I={};return I.orgname=e,I.latest_only=!1,I.all_status=!0,I.demo_mode=o,I.demo_min_count=r,this.http.post(XH,I,{withCredentials:!0}).pipe()}getStatus(e,n,o){let r={};return r.orgname=e,r.latest_only=o,n&&""!=n.trim()&&(r.serialnumber=n),this.http.post(XH,r,{withCredentials:!0}).pipe()}static \u0275fac=function(n){return new(n||t)(xn(Uo))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Bde=(()=>{class t{nomadService;tokenStorage;authStorage;mapService;datePipe;pollingSubscription=null;pollingTime=WH.statusPollingMin*WH.millisecPerMin;nomadAirInitializedSubject=new it(!1);watchTowerActive=!1;nomadAirInitialized$=this.nomadAirInitializedSubject.asObservable();deviceLocationsAvailable=!1;mapStyleURL="";mapAPIKey="";constructor(e,n,o,r,u){this.nomadService=e,this.tokenStorage=n,this.authStorage=o,this.mapService=r,this.datePipe=u}start(e,n){this.stop(),this.pollingSubscription=wb(0,this.pollingTime).pipe(or(()=>this.watchTowerActive),Xs(()=>{let o=this.authStorage.getDemoMode(),r=this.authStorage.getDemoCount(),u=this.allowDemoMode(e);return this.nomadService.getAllStatus(e.organization,n,o&&u,r)}),ks(o=>this.updateUserStatus(e,n,o)),kt(()=>{})).subscribe()}stop(){this.pollingSubscription&&(this.pollingSubscription.unsubscribe(),this.pollingSubscription=null),this.tokenStorage.clearMapAPIKey(),this.tokenStorage.clearMapStyleURL()}setWatchTowerActive(e){this.watchTowerActive=e}refreshNow(e,n){let o=this.authStorage.getDemoMode(),r=this.authStorage.getDemoCount(),u=this.allowDemoMode(e);return this.nomadService.getAllStatus(e.organization,n,o&&u,r).pipe(ks(y=>this.updateUserStatus(e,n,y)),kt(()=>{}))}allowDemoMode(e){return!!e&&(e.isDistributorAdmin()||e.isMasterDBUser())}updateDemoMode(e,n){let o=n;return this.allowDemoMode(e)||(o=!1),this.authStorage.setDemoMode(o),o}updateMapFilteredData(e){this.mapService.updateFilteredData(e)}getMapService(){return this.mapService}getLatestStatus(e){const n=[];let o=0,r=new Rb;for(const u in e.nomadAirStatus){const y=e.nomadAirStatus[u][0];n.push(y);const V={name:y.status_info.friendlyname?.trim()||y.status_info.serialnumber,serial:y.status_info.serialnumber,longitude:y.status_info.longitude,latitude:y.status_info.latitude,accuracy:y.status_info.location_meters_accuracy,available:y.status_info.has_location_info,status:y.status_extra_info.mode_text,status_color:y.ui_info.background_clr,status_time:this.datePipe.transform(r.getDateFromDateString(y.status_info.statustime),"MMM d, y, h:mm a")??"Unknown"};y.status_info.has_location_info&&o++,this.mapService.addLocationData(V)}for(const u in e.droppedDevices){const I={name:e.droppedDevices[u].trim()||e.droppedDevices[u],serial:e.droppedDevices[u],longitude:0,latitude:0,accuracy:0,available:!1,status:"?",status_color:"gray",status_time:"Unknown"};this.mapService.addLocationData(I)}return this.deviceLocationsAvailable=o>0,n}getStatusHistory(e,n){return e?.canAccessWatchTower()&&e.nomadAirStatus?.[n]?e.nomadAirStatus[n]:[]}resetInitializationFlag(){this.nomadAirInitializedSubject.next(!1)}updateUserStatus(e,n,o){if(!n)return;let r=!1;e.latest_nomadAirSchedule=o.latest_schedule,e.watchTowerExpirationTime=o.watchTowerExpirationTime,this.mapAPIKey=o.mapAPIKey,this.mapStyleURL=o.mapStyleURL,this.tokenStorage.saveMapAPIKey(o.mapAPIKey),this.tokenStorage.saveMapStyleURL(o.mapStyleURL);let u=new Set([]);e.droppedDevices=Object.keys(e.nomadAirStatus),e.nomadAirStatus={};for(const y in o.status)for(const I of o.status[y]){const V=Rde(I);e.nomadAirStatus[y]||(e.nomadAirStatus[y]=[]),e.nomadAirStatus[y].push(V),u.add(y),r=!0}e.droppedDevices=e.droppedDevices.filter(y=>!u.has(y)),e.organizationHasNomadAir=r,this.nomadAirInitializedSubject.next(!0)}static \u0275fac=function(n){return new(n||t)(xn(KH),xn(ET),xn(YH),xn(qH),xn(Rl))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const QH="3.0.10949.723";class JH{org="";user="";reset(){this.org="",this.user=""}}let Po=(()=>{class t{http;router;authTokenService;authStorageService;authSessionService;watchTowerService;dialog;snackBar;mapService;token;tokenStorage=new ET(window);userInfoSubject=new it(null);logOutInProgressSubject=new it(!1);loginURLParams=new JH;loginToken$=null;userInfo$=this.userInfoSubject.asObservable();navigatedOrg;nextURL=null;appServerVersion="";constructor(e,n,o,r,u,y,I,V,q){this.http=e,this.router=n,this.authTokenService=o,this.authStorageService=r,this.authSessionService=u,this.watchTowerService=y,this.dialog=I,this.snackBar=V,this.mapService=q,this.reInit(null)}reInit(e){this.token=this.authTokenService.getToken();const n=new Nl;n.load()?(this.userInfoSubject.next(n),this.loginURLParams.reset()):this.token=null,this.setNavigatedOrg(e||"neurotronics.com"),this.token&&(this.startWatchTower(),this.authSessionService.start())}logout(e=!0){this.dialog.closeAll(),this.authSessionService.stop(),this.watchTowerService.stop(),this.token&&(this.logOutInProgressSubject.next(!0),this.http.post(RM.LOGOUT,null,{withCredentials:!0,observe:"response"}).pipe($h(()=>this.afterLogout(e))).subscribe())}afterLogout(e){this.mapService.destroyMap(),this.token=null,this.authTokenService.clearToken(),this.nextURL=null,this.userInfoSubject.value?.delete(),this.userInfoSubject.next(null),e&&this.router.navigate(["/login"]),wb(2e3).subscribe(()=>this.logOutInProgressSubject.next(!1))}openMFASetupDialog(){var e=this;return bt(function*(){const n=new z3;n.auth_info=new iM,n.user_info=e.userInfoSubject.value,n.logging_in=!0;const o=new ha;o.data=n;const r=e.dialog.open(B3,o);try{return yield ZP(r.afterClosed())}catch{return e.snackBar.open("Unexpected error during MFA setup.","Dismiss",{duration:5e3}),null}})()}openAuthCodeDialog(e){var n=this;return bt(function*(){const o=n.dialog.open(nde,e);try{return yield ZP(o.afterClosed())}catch{return n.snackBar.open("Unexpected error during code entry.","Dismiss",{duration:5e3}),null}})()}validateOTP(e){var n=this;return bt(function*(){const o={code:e.otp,email_code:e.emailed_otp};try{return yield ZP(n.http.post(RM.VALIDATE_OTP,o,{withCredentials:!0,observe:"response"})),!0}catch(r){const u=r instanceof Av?r.message:String(r);return n.snackBar.open(`Error validating code: ${u}`,"Dismiss",{duration:5e3}),!1}})()}login(e){var n=this;return bt(function*(){n.logout(!1);const o=n.http.post(RM.LOGIN,e,{withCredentials:!0,observe:"response"}).pipe(NE());return o.subscribe(r=>n.handleLoginResponse(r)),o})()}loginToken(){this.loginToken$=null,this.logout(!1);const e=this.http.post(RM.LOGIN_TOKEN,null,{withCredentials:!0,observe:"response"}).pipe(ks(n=>this.handleLoginResponse(n)),Wh(n=>Dc),KP({bufferSize:1,refCount:!0}));return this.loginToken$=e,e}handleLoginResponse(e){var n=this;return bt(function*(){const o=Object.assign(new Nl,e.body);if(n.userInfoSubject.next(o),!o.user)return;n.setToken(e);const r=n.appServerVersion!==QH;o.save(),!(yield n.processMFA(o))&&n.navigatePostLogin(r)})()}setToken(e){this.token=e.headers.get("authorization"),this.authTokenService.setToken(this.token),this.appServerVersion=e.headers.get("ETag")}processMFA(e){var n=this;return bt(function*(){let o=!1;if(!e.loginRequiredMFA())return!1;if(!e.hasTotp&&!e.canEmailMFA){if(e.hasPasskey)return n.logout(!1),n.snackBar.open("Please login using your passkey.","Dismiss",{duration:2e3}),!0;const r=yield n.openMFASetupDialog();if(!r)return n.logout(!1),!0;if(r.has_passkey&&!r.has_totp)return n.logout(!1),n.snackBar.open("Please login using your passkey.","Dismiss",{duration:2e3}),!0;if(!r.has_passkey&&!r.has_totp)return n.logout(!1),n.snackBar.open("Your account requires MFA.","Dismiss",{duration:5e3}),!0;o=!0}if(!o){const r=new tde;r.userInfo=e,r.allow_totp=e.hasTotp;const u=new ha;u.data=r,u.autoFocus=!1;const y=yield n.openAuthCodeDialog(u);if(!y||y.setup_passkey)return n.logout(!1),n.snackBar.open("Please login using your passkey.","Dismiss",{duration:2e3}),!0;if(!y.setup_totp){if(!(yield n.validateOTP(y)))return n.logout(!1),!0;n.userInfoSubject.value.metMFARequirement=!0,n.userInfoSubject.value.save()}}return!1})()}navigatePostLogin(e){if(this.nextURL&&(this.nextURL=this.nextURL.split("?")[0]),this.userInfoSubject.value.priv===Nl.PRIV_ACTIVATEONLY)return void this.logout(!0);const n=this.userInfoSubject.value,o=n.canAccessWatchTower();n.priv===Nl.PRIV_BASIC&&o?this.router.navigate(["/watchtower"]).then(()=>e&&window.location.reload()):n.priv===Nl.PRIV_BASIC?this.router.navigate(["/authentication"]).then(()=>e&&window.location.reload()):this.nextURL?this.router.navigate([this.nextURL]).then(()=>e&&window.location.reload()):this.navigateToDefaultPage(e),this.startWatchTower(),this.authSessionService.start()}startWatchTower(){this.userInfoSubject.value?.canAccessWatchTower()&&this.watchTowerService.start(this.userInfoSubject.value,this.token)}refreshNomadAirStatusNow(){const e=this.userInfoSubject.value,n=this.token;return this.watchTowerService.resetInitializationFlag(),this.watchTowerService.refreshNow(e,n)}getLatestNomadAirStatus(){return this.watchTowerService.getLatestStatus(this.userInfoSubject.value)}getNomadAirStatusHistory(e){return this.watchTowerService.getStatusHistory(this.userInfoSubject.value,e)}getNomadAirStatusLatestSchedule(){const e=(this.userInfoSubject.value?.latest_nomadAirSchedule||"").trim();if(e){let o=(new Rb).getDateFromDateString(e);return isNaN(o.getTime())?null:o}return null}getLocationsAvailable(){return this.watchTowerService.deviceLocationsAvailable}navigateToDefaultPage(e=!1){let n="";this.isLoggedIn()?this.userInfoSubject.value.isAdmin()?(n="/licenses",this.userInfoSubject.value.isMasterDBUser()?n="/organizations":this.userInfoSubject.value.isDistributorAdmin()&&(n="/distorganizations")):n=this.userInfoSubject.value.canAccessWatchTower()?"/watchtower":"/authentication":n="/login",this.router.navigate([n]).then(()=>{e&&window.location.reload()})}isLoggedIn(){return!(!this.userInfoSubject||!this.userInfoSubject.value||!this.userInfoSubject.value.user||this.userInfoSubject.value.needsMFA&&!this.userInfoSubject.value.metMFARequirement)}isLoggingOut(){return this.logOutInProgressSubject.value}getLoginURLParams(){return this.loginURLParams}setLoginURLParams(e){this.loginURLParams.org=e.org,this.loginURLParams.user=e.user}getUserInfo(){return this.userInfoSubject.value}getTopURL(e){return li_backendURL+"/"+e}getURL(e,n){let o;return o=n&&n.snapshot.data.multi?n.snapshot.paramMap.get("org"):this.getUserInfo().organization,li_backendURL+"/organizations/"+o+"/"+e}isMultiRoute(e){return e&&e.snapshot.data.multi}getOrg(e){let n;return n=e&&e.snapshot.data.multi?e.snapshot.paramMap.get("org"):this.getUserInfo().organization,n}updateNavigatedOrg(e){let n;n=this.getOrg(e),Promise.resolve().then(()=>this.navigatedOrg=n)}setNavigatedOrg(e){Promise.resolve().then(()=>this.navigatedOrg=e)}getNavigatedOrg(){return this.navigatedOrg}getMapStyleURL(){return this.watchTowerService.mapStyleURL}setMapStyleURL(e){this.watchTowerService.mapStyleURL=e,this.tokenStorage.saveMapStyleURL(e)}setWatchTowerActive(e){this.watchTowerService.setWatchTowerActive(e)}getMapAPIKey(){return this.watchTowerService.mapAPIKey}setMapAPIKey(e){this.watchTowerService.mapAPIKey=e,this.tokenStorage.saveMapAPIKey(e)}setNomadAirStatusDemoMode(e){return this.watchTowerService.resetInitializationFlag(),this.watchTowerService.updateDemoMode(this.userInfoSubject.value,e),this.watchTowerService.refreshNow(this.userInfoSubject.value,this.token)}setNomadAirStatusDemoCount(e){return this.watchTowerService.resetInitializationFlag(),this.authStorageService.setDemoCount(e),this.watchTowerService.refreshNow(this.userInfoSubject.value,this.token)}getNomadAirStatusDemoMode(){return!!this.watchTowerService.allowDemoMode(this.userInfoSubject.value)&&this.authStorageService.getDemoMode()}getNomadAirStatusDemoCount(){return this.authStorageService.getDemoCount()}getWatchTowerStatusInitialized(){return this.watchTowerService.nomadAirInitialized$}static \u0275fac=function(n){return new(n||t)(xn(Uo),xn(Ga),xn(UT),xn(YH),xn(zde),xn(Bde),xn(pa),xn(Mc),xn(qH))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const ej=["*",[["mat-chip-avatar"],["","matChipAvatar",""]],[["mat-chip-trailing-icon"],["","matChipRemove",""],["","matChipTrailingIcon",""]]],tj=["*","mat-chip-avatar, [matChipAvatar]","mat-chip-trailing-icon,[matChipRemove],[matChipTrailingIcon]"];function Vde(t,i){1&t&&(w(0,"span",3),On(1,1),x())}function Ude(t,i){1&t&&(w(0,"span",6),On(1,2),x())}function Hde(t,i){1&t&&(w(0,"span",3),On(1,1),w(2,"span",8),Va(),w(3,"svg",9),Re(4,"path",10),x()()())}function jde(t,i){1&t&&(w(0,"span",6),On(1,2),x())}const Z3=["*"],OM=new yt("mat-chips-default-options",{providedIn:"root",factory:()=>({separatorKeyCodes:[13]})}),Y3=new yt("MatChipAvatar"),X3=new yt("MatChipTrailingIcon"),K3=new yt("MatChipRemove"),PM=new yt("MatChip");let $x=(()=>{class t{_elementRef=Y(Pn);_parentChip=Y(PM);isInteractive=!0;_isPrimary=!0;get disabled(){return this._disabled||this._parentChip?.disabled||!1}set disabled(e){this._disabled=e}_disabled=!1;tabIndex=-1;_allowFocusWhenDisabled=!1;_getDisabledAttribute(){return this.disabled&&!this._allowFocusWhenDisabled?"":null}_getTabindex(){return this.disabled&&!this._allowFocusWhenDisabled||!this.isInteractive?null:this.tabIndex.toString()}constructor(){Y(Rs).load(wu),"BUTTON"===this._elementRef.nativeElement.nodeName&&this._elementRef.nativeElement.setAttribute("type","button")}focus(){this._elementRef.nativeElement.focus()}_handleClick(e){!this.disabled&&this.isInteractive&&this._isPrimary&&(e.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}_handleKeydown(e){(13===e.keyCode||32===e.keyCode)&&!this.disabled&&this.isInteractive&&this._isPrimary&&!this._parentChip._isEditing&&(e.preventDefault(),this._parentChip._handlePrimaryActionInteraction())}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matChipAction",""]],hostAttrs:[1,"mdc-evolution-chip__action","mat-mdc-chip-action"],hostVars:9,hostBindings:function(n,o){1&n&&we("click",function(u){return o._handleClick(u)})("keydown",function(u){return o._handleKeydown(u)}),2&n&&(zn("tabindex",o._getTabindex())("disabled",o._getDisabledAttribute())("aria-disabled",o.disabled),Hn("mdc-evolution-chip__action--primary",o._isPrimary)("mdc-evolution-chip__action--presentational",!o.isInteractive)("mdc-evolution-chip__action--trailing",!o._isPrimary))},inputs:{isInteractive:"isInteractive",disabled:[2,"disabled","disabled",fn],tabIndex:[2,"tabIndex","tabIndex",e=>null==e?-1:Ql(e)],_allowFocusWhenDisabled:"_allowFocusWhenDisabled"}})}return t})(),k_=(()=>{class t{_changeDetectorRef=Y(So);_elementRef=Y(Pn);_ngZone=Y(tn);_focusMonitor=Y(eh);_globalRippleOptions=Y(cM,{optional:!0});_document=Y(Oo);_onFocus=new Ee;_onBlur=new Ee;_isBasicChip;role=null;_hasFocusInternal=!1;_pendingFocus;_actionChanges;_animationsDisabled;_allLeadingIcons;_allTrailingIcons;_allRemoveIcons;_hasFocus(){return this._hasFocusInternal}id=Y(ta).getId("mat-mdc-chip-");ariaLabel=null;ariaDescription=null;_ariaDescriptionId=`${this.id}-aria-description`;_chipListDisabled=!1;_textElement;get value(){return void 0!==this._value?this._value:this._textElement.textContent.trim()}set value(e){this._value=e}_value;color;removable=!0;highlighted=!1;disableRipple=!1;get disabled(){return this._disabled||this._chipListDisabled}set disabled(e){this._disabled=e}_disabled=!1;removed=new Tt;destroyed=new Tt;basicChipAttrName="mat-basic-chip";leadingIcon;trailingIcon;removeIcon;primaryAction;_rippleLoader=Y(O8);_injector=Y(Ke);constructor(){const e=Y(Rs);e.load(wu),e.load(qv);const n=Y(Kr,{optional:!0});this._animationsDisabled="NoopAnimations"===n,this._monitorFocus(),this._rippleLoader?.configureRipple(this._elementRef.nativeElement,{className:"mat-mdc-chip-ripple",disabled:this._isRippleDisabled()})}ngOnInit(){const e=this._elementRef.nativeElement;this._isBasicChip=e.hasAttribute(this.basicChipAttrName)||e.tagName.toLowerCase()===this.basicChipAttrName}ngAfterViewInit(){this._textElement=this._elementRef.nativeElement.querySelector(".mat-mdc-chip-action-label"),this._pendingFocus&&(this._pendingFocus=!1,this.focus())}ngAfterContentInit(){this._actionChanges=va(this._allLeadingIcons.changes,this._allTrailingIcons.changes,this._allRemoveIcons.changes).subscribe(()=>this._changeDetectorRef.markForCheck())}ngDoCheck(){this._rippleLoader.setDisabled(this._elementRef.nativeElement,this._isRippleDisabled())}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement),this._actionChanges?.unsubscribe(),this.destroyed.emit({chip:this}),this.destroyed.complete()}remove(){this.removable&&this.removed.emit({chip:this})}_isRippleDisabled(){return this.disabled||this.disableRipple||this._animationsDisabled||this._isBasicChip||!!this._globalRippleOptions?.disabled}_hasTrailingIcon(){return!(!this.trailingIcon&&!this.removeIcon)}_handleKeydown(e){(8===e.keyCode&&!e.repeat||46===e.keyCode)&&(e.preventDefault(),this.remove())}focus(){this.disabled||(this.primaryAction?this.primaryAction.focus():this._pendingFocus=!0)}_getSourceAction(e){return this._getActions().find(n=>{const o=n._elementRef.nativeElement;return o===e||o.contains(e)})}_getActions(){const e=[];return this.primaryAction&&e.push(this.primaryAction),this.removeIcon&&e.push(this.removeIcon),this.trailingIcon&&e.push(this.trailingIcon),e}_handlePrimaryActionInteraction(){}_monitorFocus(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{const n=null!==e;n!==this._hasFocusInternal&&(this._hasFocusInternal=n,n?this._onFocus.next({chip:this}):(this._changeDetectorRef.markForCheck(),setTimeout(()=>this._ngZone.run(()=>this._onBlur.next({chip:this})))))})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-basic-chip"],["","mat-basic-chip",""],["mat-chip"],["","mat-chip",""]],contentQueries:function(n,o,r){if(1&n&&(oo(r,Y3,5),oo(r,X3,5),oo(r,K3,5),oo(r,Y3,5),oo(r,X3,5),oo(r,K3,5)),2&n){let u;Bt(u=Vt())&&(o.leadingIcon=u.first),Bt(u=Vt())&&(o.trailingIcon=u.first),Bt(u=Vt())&&(o.removeIcon=u.first),Bt(u=Vt())&&(o._allLeadingIcons=u),Bt(u=Vt())&&(o._allTrailingIcons=u),Bt(u=Vt())&&(o._allRemoveIcons=u)}},viewQuery:function(n,o){if(1&n&&mn($x,5),2&n){let r;Bt(r=Vt())&&(o.primaryAction=r.first)}},hostAttrs:[1,"mat-mdc-chip"],hostVars:31,hostBindings:function(n,o){1&n&&we("keydown",function(u){return o._handleKeydown(u)}),2&n&&(cc("id",o.id),zn("role",o.role)("aria-label",o.ariaLabel),bs("mat-"+(o.color||"primary")),Hn("mdc-evolution-chip",!o._isBasicChip)("mdc-evolution-chip--disabled",o.disabled)("mdc-evolution-chip--with-trailing-action",o._hasTrailingIcon())("mdc-evolution-chip--with-primary-graphic",o.leadingIcon)("mdc-evolution-chip--with-primary-icon",o.leadingIcon)("mdc-evolution-chip--with-avatar",o.leadingIcon)("mat-mdc-chip-with-avatar",o.leadingIcon)("mat-mdc-chip-highlighted",o.highlighted)("mat-mdc-chip-disabled",o.disabled)("mat-mdc-basic-chip",o._isBasicChip)("mat-mdc-standard-chip",!o._isBasicChip)("mat-mdc-chip-with-trailing-icon",o._hasTrailingIcon())("_mat-animation-noopable",o._animationsDisabled))},inputs:{role:"role",id:"id",ariaLabel:[0,"aria-label","ariaLabel"],ariaDescription:[0,"aria-description","ariaDescription"],value:"value",color:"color",removable:[2,"removable","removable",fn],highlighted:[2,"highlighted","highlighted",fn],disableRipple:[2,"disableRipple","disableRipple",fn],disabled:[2,"disabled","disabled",fn]},outputs:{removed:"removed",destroyed:"destroyed"},exportAs:["matChip"],features:[Bn([{provide:PM,useExisting:t}])],ngContentSelectors:tj,decls:8,vars:3,consts:[[1,"mat-mdc-chip-focus-overlay"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary"],["matChipAction","",3,"isInteractive"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],[1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"]],template:function(n,o){1&n&&(ho(ej),Re(0,"span",0),w(1,"span",1)(2,"span",2),te(3,Vde,2,0,"span",3),w(4,"span",4),On(5),Re(6,"span",5),x()()(),te(7,Ude,2,0,"span",6)),2&n&&(E(2),N("isInteractive",!1),E(),Xi(o.leadingIcon?3:-1),E(4),Xi(o._hasTrailingIcon()?7:-1))},dependencies:[$x],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n'],encapsulation:2,changeDetection:0})}return t})(),oj=(()=>{class t extends k_{_defaultOptions=Y(OM,{optional:!0});chipListSelectable=!0;_chipListMultiple=!1;_chipListHideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get selectable(){return this._selectable&&this.chipListSelectable}set selectable(e){this._selectable=e,this._changeDetectorRef.markForCheck()}_selectable=!0;get selected(){return this._selected}set selected(e){this._setSelectedState(e,!1,!0)}_selected=!1;get ariaSelected(){return this.selectable?this.selected.toString():null}basicChipAttrName="mat-basic-chip-option";selectionChange=new Tt;ngOnInit(){super.ngOnInit(),this.role="presentation"}select(){this._setSelectedState(!0,!1,!0)}deselect(){this._setSelectedState(!1,!1,!0)}selectViaInteraction(){this._setSelectedState(!0,!0,!0)}toggleSelected(e=!1){return this._setSelectedState(!this.selected,e,!0),this.selected}_handlePrimaryActionInteraction(){this.disabled||(this.focus(),this.selectable&&this.toggleSelected(!0))}_hasLeadingGraphic(){return!!this.leadingIcon||!this._chipListHideSingleSelectionIndicator||this._chipListMultiple}_setSelectedState(e,n,o){e!==this.selected&&(this._selected=e,o&&this.selectionChange.emit({source:this,isUserInput:n,selected:this.selected}),this._changeDetectorRef.markForCheck())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-basic-chip-option"],["","mat-basic-chip-option",""],["mat-chip-option"],["","mat-chip-option",""]],hostAttrs:[1,"mat-mdc-chip","mat-mdc-chip-option"],hostVars:37,hostBindings:function(n,o){2&n&&(cc("id",o.id),zn("tabindex",null)("aria-label",null)("aria-description",null)("role",o.role),Hn("mdc-evolution-chip",!o._isBasicChip)("mdc-evolution-chip--filter",!o._isBasicChip)("mdc-evolution-chip--selectable",!o._isBasicChip)("mat-mdc-chip-selected",o.selected)("mat-mdc-chip-multiple",o._chipListMultiple)("mat-mdc-chip-disabled",o.disabled)("mat-mdc-chip-with-avatar",o.leadingIcon)("mdc-evolution-chip--disabled",o.disabled)("mdc-evolution-chip--selected",o.selected)("mdc-evolution-chip--selecting",!o._animationsDisabled)("mdc-evolution-chip--with-trailing-action",o._hasTrailingIcon())("mdc-evolution-chip--with-primary-icon",o.leadingIcon)("mdc-evolution-chip--with-primary-graphic",o._hasLeadingGraphic())("mdc-evolution-chip--with-avatar",o.leadingIcon)("mat-mdc-chip-highlighted",o.highlighted)("mat-mdc-chip-with-trailing-icon",o._hasTrailingIcon()))},inputs:{selectable:[2,"selectable","selectable",fn],selected:[2,"selected","selected",fn]},outputs:{selectionChange:"selectionChange"},features:[Bn([{provide:k_,useExisting:t},{provide:PM,useExisting:t}]),qn],ngContentSelectors:tj,decls:10,vars:8,consts:[[1,"mat-mdc-chip-focus-overlay"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--primary"],["matChipAction","","role","option",3,"_allowFocusWhenDisabled"],[1,"mdc-evolution-chip__graphic","mat-mdc-chip-graphic"],[1,"mdc-evolution-chip__text-label","mat-mdc-chip-action-label"],[1,"mat-mdc-chip-primary-focus-indicator","mat-focus-indicator"],[1,"mdc-evolution-chip__cell","mdc-evolution-chip__cell--trailing"],[1,"cdk-visually-hidden",3,"id"],[1,"mdc-evolution-chip__checkmark"],["viewBox","-2 -3 30 30","focusable","false","aria-hidden","true",1,"mdc-evolution-chip__checkmark-svg"],["fill","none","stroke","currentColor","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-evolution-chip__checkmark-path"]],template:function(n,o){1&n&&(ho(ej),Re(0,"span",0),w(1,"span",1)(2,"button",2),te(3,Hde,5,0,"span",3),w(4,"span",4),On(5),Re(6,"span",5),x()()(),te(7,jde,2,0,"span",6),w(8,"span",7),M(9),x()),2&n&&(E(2),N("_allowFocusWhenDisabled",!0),zn("aria-selected",o.ariaSelected)("aria-label",o.ariaLabel)("aria-describedby",o._ariaDescriptionId),E(),Xi(o._hasLeadingGraphic()?3:-1),E(4),Xi(o._hasTrailingIcon()?7:-1),E(),N("id",o._ariaDescriptionId),E(),Ct(o.ariaDescription))},dependencies:[$x],styles:['.mdc-evolution-chip,.mdc-evolution-chip__cell,.mdc-evolution-chip__action{display:inline-flex;align-items:center}.mdc-evolution-chip{position:relative;max-width:100%}.mdc-evolution-chip__cell,.mdc-evolution-chip__action{height:100%}.mdc-evolution-chip__cell--primary{flex-basis:100%;overflow-x:hidden}.mdc-evolution-chip__cell--trailing{flex:1 0 auto}.mdc-evolution-chip__action{align-items:center;background:none;border:none;box-sizing:content-box;cursor:pointer;display:inline-flex;justify-content:center;outline:none;padding:0;text-decoration:none;color:inherit}.mdc-evolution-chip__action--presentational{cursor:auto}.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{pointer-events:none}@media(forced-colors: active){.mdc-evolution-chip--disabled,.mdc-evolution-chip__action:disabled{forced-color-adjust:none}}.mdc-evolution-chip__action--primary{font:inherit;letter-spacing:inherit;white-space:inherit;overflow-x:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-outline-width, 1px);border-radius:var(--mdc-chip-container-shape-radius, 8px);box-sizing:border-box;content:"";height:100%;left:0;position:absolute;pointer-events:none;top:0;width:100%;z-index:1;border-style:solid}.mat-mdc-standard-chip .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-outline-color, var(--mat-sys-outline))}.mdc-evolution-chip__action--primary:not(.mdc-evolution-chip__action--presentational):not(.mdc-ripple-upgraded):focus::before{border-color:var(--mdc-chip-focus-outline-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--primary::before{border-color:var(--mdc-chip-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__action--primary::before{border-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-basic-chip .mdc-evolution-chip__action--primary{font:inherit}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:0;padding-right:12px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__action--primary{padding-left:12px;padding-right:0}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--primary{padding-left:0;padding-right:0}.mdc-evolution-chip__action--trailing{position:relative;overflow:visible}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-trailing-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__action--trailing{color:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing{padding-left:8px;padding-right:8px}.mdc-evolution-chip__text-label{-webkit-user-select:none;user-select:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mat-mdc-standard-chip .mdc-evolution-chip__text-label{font-family:var(--mdc-chip-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mdc-chip-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mdc-chip-label-text-size, var(--mat-sys-label-large-size));font-weight:var(--mdc-chip-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mdc-chip-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-label-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__text-label{color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label,.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__text-label{color:var(--mdc-chip-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-evolution-chip__graphic{align-items:center;display:inline-flex;justify-content:center;overflow:hidden;pointer-events:none;position:relative;flex:1 0 auto}.mat-mdc-standard-chip .mdc-evolution-chip__graphic{width:var(--mdc-chip-with-avatar-avatar-size, 24px);height:var(--mdc-chip-with-avatar-avatar-size, 24px);font-size:var(--mdc-chip-with-avatar-avatar-size, 24px)}.mdc-evolution-chip--selecting .mdc-evolution-chip__graphic{transition:width 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selectable:not(.mdc-evolution-chip--selected):not(.mdc-evolution-chip--with-primary-icon) .mdc-evolution-chip__graphic{width:0}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mat-mdc-standard-chip.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:6px;padding-right:6px}.mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:4px;padding-right:8px}[dir=rtl] .mdc-evolution-chip--with-avatar.mdc-evolution-chip--with-primary-graphic.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__graphic{padding-left:8px;padding-right:4px}.mdc-evolution-chip__checkmark{position:absolute;opacity:0;top:50%;left:50%;height:20px;width:20px}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__checkmark{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark{transition:transform 150ms 0ms cubic-bezier(0.4, 0, 0.2, 1);transform:translate(-75%, -50%)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{transform:translate(-50%, -50%);opacity:1}.mdc-evolution-chip__checkmark-svg{display:block}.mdc-evolution-chip__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385;stroke-dashoffset:29.7833385;stroke:currentColor}.mdc-evolution-chip--selecting .mdc-evolution-chip__checkmark-path{transition:stroke-dashoffset 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark-path{stroke-dashoffset:0}@media(forced-colors: active){.mdc-evolution-chip__checkmark-path{stroke:CanvasText !important}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--trailing{height:18px;width:18px;font-size:18px}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove{opacity:calc(var(--mat-chip-trailing-action-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing.mat-mdc-chip-remove:focus{opacity:calc(var(--mat-chip-trailing-action-focus-opacity, 1)*var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38))}.mat-mdc-standard-chip{border-radius:var(--mdc-chip-container-shape-radius, 8px);height:var(--mdc-chip-container-height, 32px)}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-container-color, transparent)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-elevated-disabled-container-color)}.mat-mdc-standard-chip.mdc-evolution-chip--selected:not(.mdc-evolution-chip--disabled){background-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled{background-color:var(--mdc-chip-flat-disabled-selected-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}@media(forced-colors: active){.mat-mdc-standard-chip{outline:solid 1px}}.mat-mdc-standard-chip .mdc-evolution-chip__icon--primary{border-radius:var(--mdc-chip-with-avatar-avatar-shape-radius, 24px);width:var(--mdc-chip-with-icon-icon-size, 18px);height:var(--mdc-chip-with-icon-icon-size, 18px);font-size:var(--mdc-chip-with-icon-icon-size, 18px)}.mdc-evolution-chip--selected .mdc-evolution-chip__icon--primary{opacity:0}.mat-mdc-standard-chip:not(.mdc-evolution-chip--disabled) .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-standard-chip.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--primary{color:var(--mdc-chip-with-icon-disabled-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-highlighted{--mdc-chip-with-icon-icon-color:var(--mdc-chip-with-icon-selected-icon-color, var(--mat-sys-on-secondary-container));--mdc-chip-elevated-container-color:var(--mdc-chip-elevated-selected-container-color, var(--mat-sys-secondary-container));--mdc-chip-label-text-color:var(--mdc-chip-selected-label-text-color, var(--mat-sys-on-secondary-container));--mdc-chip-outline-width:var(--mdc-chip-flat-selected-outline-width, 0)}.mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-selected .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-chip:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-hover-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-focus-overlay .mat-mdc-chip-selected:hover,.mat-mdc-chip-highlighted:hover .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-hover-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-focus-state-layer-color, var(--mat-sys-on-surface-variant));opacity:var(--mdc-chip-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected.cdk-focused .mat-mdc-chip-focus-overlay,.mat-mdc-chip-highlighted.cdk-focused .mat-mdc-chip-focus-overlay{background:var(--mdc-chip-selected-focus-state-layer-color, var(--mat-sys-on-secondary-container));opacity:var(--mdc-chip-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-evolution-chip--disabled:not(.mdc-evolution-chip--selected) .mat-mdc-chip-avatar{opacity:var(--mdc-chip-with-avatar-disabled-avatar-opacity, 0.38)}.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{opacity:var(--mdc-chip-with-trailing-icon-disabled-trailing-icon-opacity, 0.38)}.mdc-evolution-chip--disabled.mdc-evolution-chip--selected .mdc-evolution-chip__checkmark{opacity:var(--mdc-chip-with-icon-disabled-icon-opacity, 0.38)}.mat-mdc-standard-chip.mdc-evolution-chip--disabled{opacity:var(--mat-chip-disabled-container-opacity, 1)}.mat-mdc-standard-chip.mdc-evolution-chip--selected .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-trailing-icon-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip.mdc-evolution-chip--selected.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing,.mat-mdc-standard-chip.mat-mdc-chip-highlighted.mdc-evolution-chip--disabled .mdc-evolution-chip__icon--trailing{color:var(--mat-chip-selected-disabled-trailing-icon-color, var(--mat-sys-on-surface))}.mat-mdc-chip-remove{opacity:var(--mat-chip-trailing-action-opacity, 1)}.mat-mdc-chip-remove:focus{opacity:var(--mat-chip-trailing-action-focus-opacity, 1)}.mat-mdc-chip-remove::after{background-color:var(--mat-chip-trailing-action-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-chip-remove:hover::after{opacity:var(--mat-chip-trailing-action-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-chip-remove:focus::after{opacity:var(--mat-chip-trailing-action-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-chip-selected .mat-mdc-chip-remove::after,.mat-mdc-chip-highlighted .mat-mdc-chip-remove::after{background-color:var(--mat-chip-selected-trailing-action-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-mdc-standard-chip{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,.mat-mdc-standard-chip .mdc-evolution-chip__action--primary,.mat-mdc-standard-chip .mat-mdc-chip-action-label{overflow:visible}.mat-mdc-standard-chip .mat-mdc-chip-graphic,.mat-mdc-standard-chip .mat-mdc-chip-trailing-icon{box-sizing:content-box}.mat-mdc-standard-chip._mat-animation-noopable,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__graphic,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark,.mat-mdc-standard-chip._mat-animation-noopable .mdc-evolution-chip__checkmark-path{transition-duration:1ms;animation-duration:1ms}.mat-mdc-chip-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;opacity:0;border-radius:inherit;transition:opacity 150ms linear}._mat-animation-noopable .mat-mdc-chip-focus-overlay{transition:none}.mat-mdc-basic-chip .mat-mdc-chip-focus-overlay{display:none}.mat-mdc-chip .mat-ripple.mat-mdc-chip-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-chip-avatar{text-align:center;line-height:1;color:var(--mdc-chip-with-icon-icon-color, currentColor)}.mat-mdc-chip{position:relative;z-index:0}.mat-mdc-chip-action-label{text-align:left;z-index:1}[dir=rtl] .mat-mdc-chip-action-label{text-align:right}.mat-mdc-chip.mdc-evolution-chip--with-trailing-action .mat-mdc-chip-action-label{position:relative}.mat-mdc-chip-action-label .mat-mdc-chip-primary-focus-indicator{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.mat-mdc-chip-action-label .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-chip-remove::before{margin:calc(var(--mat-focus-indicator-border-width, 3px)*-1);left:8px;right:8px}.mat-mdc-chip-remove::after{content:"";display:block;opacity:0;position:absolute;top:-3px;bottom:-3px;left:5px;right:5px;border-radius:50%;box-sizing:border-box;padding:12px;margin:-12px;background-clip:content-box}.mat-mdc-chip-remove .mat-icon{width:18px;height:18px;font-size:18px;box-sizing:content-box}.mat-chip-edit-input{cursor:text;display:inline-block;color:inherit;outline:0}@media(forced-colors: active){.mat-mdc-chip-selected:not(.mat-mdc-chip-multiple){outline-width:3px}}.mat-mdc-chip-action:focus .mat-focus-indicator::before{content:""}.mdc-evolution-chip__icon,.mat-mdc-chip-remove .mat-icon{min-height:fit-content}\n'],encapsulation:2,changeDetection:0})}return t})(),FM=(()=>{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_dir=Y(ul,{optional:!0});_lastDestroyedFocusedChipIndex=null;_keyManager;_destroyed=new Ee;_defaultRole="presentation";get chipFocusChanges(){return this._getChipStream(e=>e._onFocus)}get chipDestroyedChanges(){return this._getChipStream(e=>e.destroyed)}get chipRemovedChanges(){return this._getChipStream(e=>e.removed)}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._syncChipsState()}_disabled=!1;get empty(){return!this._chips||0===this._chips.length}get role(){return this._explicitRole?this._explicitRole:this.empty?null:this._defaultRole}tabIndex=0;set role(e){this._explicitRole=e}_explicitRole=null;get focused(){return this._hasFocusedChip()}_chips;_chipActions=new Od;constructor(){}ngAfterViewInit(){this._setUpFocusManagement(),this._trackChipSetChanges(),this._trackDestroyedFocusedChip()}ngOnDestroy(){this._keyManager?.destroy(),this._chipActions.destroy(),this._destroyed.next(),this._destroyed.complete()}_hasFocusedChip(){return this._chips&&this._chips.some(e=>e._hasFocus())}_syncChipsState(){this._chips?.forEach(e=>{e._chipListDisabled=this._disabled,e._changeDetectorRef.markForCheck()})}focus(){}_handleKeydown(e){this._originatesFromChip(e)&&this._keyManager.onKeydown(e)}_isValidIndex(e){return e>=0&&ethis._elementRef.nativeElement.tabIndex=e))}_getChipStream(e){return this._chips.changes.pipe(ua(null),Xs(()=>va(...this._chips.map(e))))}_originatesFromChip(e){let n=e.target;for(;n&&n!==this._elementRef.nativeElement;){if(n.classList.contains("mat-mdc-chip"))return!0;n=n.parentElement}return!1}_setUpFocusManagement(){this._chips.changes.pipe(ua(this._chips)).subscribe(e=>{const n=[];e.forEach(o=>o._getActions().forEach(r=>n.push(r))),this._chipActions.reset(n),this._chipActions.notifyOnChanges()}),this._keyManager=new FT(this._chipActions).withVerticalOrientation().withHorizontalOrientation(this._dir?this._dir.value:"ltr").withHomeAndEnd().skipPredicate(e=>this._skipPredicate(e)),this.chipFocusChanges.pipe(ro(this._destroyed)).subscribe(({chip:e})=>{const n=e._getSourceAction(document.activeElement);n&&this._keyManager.updateActiveItem(n)}),this._dir?.change.pipe(ro(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e))}_skipPredicate(e){return!e.isInteractive||e.disabled}_trackChipSetChanges(){this._chips.changes.pipe(ua(null),ro(this._destroyed)).subscribe(()=>{this.disabled&&Promise.resolve().then(()=>this._syncChipsState()),this._redirectDestroyedChipFocus()})}_trackDestroyedFocusedChip(){this.chipDestroyedChanges.pipe(ro(this._destroyed)).subscribe(e=>{const o=this._chips.toArray().indexOf(e.chip);this._isValidIndex(o)&&e.chip._hasFocus()&&(this._lastDestroyedFocusedChipIndex=o)})}_redirectDestroyedChipFocus(){if(null!=this._lastDestroyedFocusedChipIndex){if(this._chips.length){const e=Math.min(this._lastDestroyedFocusedChipIndex,this._chips.length-1),n=this._chips.toArray()[e];n.disabled?1===this._chips.length?this.focus():this._keyManager.setPreviousItemActive():n.focus()}else this.focus();this._lastDestroyedFocusedChipIndex=null}}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-chip-set"]],contentQueries:function(n,o,r){if(1&n&&oo(r,k_,5),2&n){let u;Bt(u=Vt())&&(o._chips=u)}},hostAttrs:[1,"mat-mdc-chip-set","mdc-evolution-chip-set"],hostVars:1,hostBindings:function(n,o){1&n&&we("keydown",function(u){return o._handleKeydown(u)}),2&n&&zn("role",o.role)},inputs:{disabled:[2,"disabled","disabled",fn],role:"role",tabIndex:[2,"tabIndex","tabIndex",e=>null==e?0:Ql(e)]},ngContentSelectors:Z3,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(n,o){1&n&&(ho(),w(0,"div",0),On(1),x())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}\n"],encapsulation:2,changeDetection:0})}return t})();class nue{source;value;constructor(i,e){this.source=i,this.value=e}}const iue={provide:Pl,useExisting:lo(()=>Q3),multi:!0};let Q3=(()=>{class t extends FM{_onTouched=()=>{};_onChange=()=>{};_defaultRole="listbox";_defaultOptions=Y(OM,{optional:!0});get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._syncListboxProperties()}_multiple=!1;get selected(){const e=this._chips.toArray().filter(n=>n.selected);return this.multiple?e:e[0]}ariaOrientation="horizontal";get selectable(){return this._selectable}set selectable(e){this._selectable=e,this._syncListboxProperties()}_selectable=!0;compareWith=(e,n)=>e===n;required=!1;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncListboxProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get chipSelectionChanges(){return this._getChipStream(e=>e.selectionChange)}get chipBlurChanges(){return this._getChipStream(e=>e._onBlur)}get value(){return this._value}set value(e){this._chips&&this._chips.length&&this._setSelectionByValue(e,!1),this._value=e}_value;change=new Tt;_chips=void 0;ngAfterContentInit(){this._chips.changes.pipe(ua(null),ro(this._destroyed)).subscribe(()=>{void 0!==this.value&&Promise.resolve().then(()=>{this._setSelectionByValue(this.value,!1)}),this._syncListboxProperties()}),this.chipBlurChanges.pipe(ro(this._destroyed)).subscribe(()=>this._blur()),this.chipSelectionChanges.pipe(ro(this._destroyed)).subscribe(e=>{this.multiple||this._chips.forEach(n=>{n!==e.source&&n._setSelectedState(!1,!1,!1)}),e.isUserInput&&this._propagateChanges()})}focus(){if(this.disabled)return;const e=this._getFirstSelectedChip();e&&!e.disabled?e.focus():this._chips.length>0?this._keyManager.setFirstItemActive():this._elementRef.nativeElement.focus()}writeValue(e){this.value=null!=e?e:void 0}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_setSelectionByValue(e,n=!0){this._clearSelection(),Array.isArray(e)?e.forEach(o=>this._selectValue(o,n)):this._selectValue(e,n)}_blur(){this.disabled||setTimeout(()=>{this.focused||this._markAsTouched()})}_keydown(e){9===e.keyCode&&super._allowFocusEscape()}_markAsTouched(){this._onTouched(),this._changeDetectorRef.markForCheck()}_propagateChanges(){let e=null;e=Array.isArray(this.selected)?this.selected.map(n=>n.value):this.selected?this.selected.value:void 0,this._value=e,this.change.emit(new nue(this,e)),this._onChange(e),this._changeDetectorRef.markForCheck()}_clearSelection(e){this._chips.forEach(n=>{n!==e&&n.deselect()})}_selectValue(e,n){const o=this._chips.find(r=>null!=r.value&&this.compareWith(r.value,e));return o&&(n?o.selectViaInteraction():o.select()),o}_syncListboxProperties(){this._chips&&Promise.resolve().then(()=>{this._chips.forEach(e=>{e._chipListMultiple=this.multiple,e.chipListSelectable=this._selectable,e._chipListHideSingleSelectionIndicator=this.hideSingleSelectionIndicator,e._changeDetectorRef.markForCheck()})})}_getFirstSelectedChip(){return Array.isArray(this.selected)?this.selected.length?this.selected[0]:void 0:this.selected}_skipPredicate(e){return!e.isInteractive}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-chip-listbox"]],contentQueries:function(n,o,r){if(1&n&&oo(r,oj,5),2&n){let u;Bt(u=Vt())&&(o._chips=u)}},hostAttrs:[1,"mdc-evolution-chip-set","mat-mdc-chip-listbox"],hostVars:10,hostBindings:function(n,o){1&n&&we("focus",function(){return o.focus()})("blur",function(){return o._blur()})("keydown",function(u){return o._keydown(u)}),2&n&&(cc("tabIndex",o.disabled||o.empty?-1:o.tabIndex),zn("role",o.role)("aria-required",o.role?o.required:null)("aria-disabled",o.disabled.toString())("aria-multiselectable",o.multiple)("aria-orientation",o.ariaOrientation),Hn("mat-mdc-chip-list-disabled",o.disabled)("mat-mdc-chip-list-required",o.required))},inputs:{multiple:[2,"multiple","multiple",fn],ariaOrientation:[0,"aria-orientation","ariaOrientation"],selectable:[2,"selectable","selectable",fn],compareWith:"compareWith",required:[2,"required","required",fn],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",fn],value:"value"},outputs:{change:"change"},features:[Bn([iue]),qn],ngContentSelectors:Z3,decls:2,vars:0,consts:[["role","presentation",1,"mdc-evolution-chip-set__chips"]],template:function(n,o){1&n&&(ho(),w(0,"div",0),On(1),x())},styles:[".mat-mdc-chip-set{display:flex}.mat-mdc-chip-set:focus{outline:none}.mat-mdc-chip-set .mdc-evolution-chip-set__chips{min-width:100%;margin-left:-8px;margin-right:0}.mat-mdc-chip-set .mdc-evolution-chip{margin:4px 0 4px 8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip-set__chips{margin-left:0;margin-right:-8px}[dir=rtl] .mat-mdc-chip-set .mdc-evolution-chip{margin-left:0;margin-right:8px}.mdc-evolution-chip-set__chips{display:flex;flex-flow:wrap;min-width:0}.mat-mdc-chip-set-stacked{flex-direction:column;align-items:flex-start}.mat-mdc-chip-set-stacked .mat-mdc-chip{width:100%}.mat-mdc-chip-set-stacked .mdc-evolution-chip__graphic{flex-grow:0}.mat-mdc-chip-set-stacked .mdc-evolution-chip__action--primary{flex-basis:100%;justify-content:start}input.mat-mdc-chip-input{flex:1 0 150px;margin-left:8px}[dir=rtl] input.mat-mdc-chip-input{margin-left:0;margin-right:8px}\n"],encapsulation:2,changeDetection:0})}return t})(),rue=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[LT,{provide:OM,useValue:{separatorKeyCodes:[13]}}],imports:[Ki,e0,Ki]})}return t})();const aue=["nextButton"],sue=["passwordLoginButton"],lue=["passkeyLoginButton"],cue=["passwordInput"];function due(t,i){if(1&t){const e=pt();w(0,"mat-form-field",18)(1,"mat-label"),M(2,"Password"),x(),w(3,"input",19,0),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.data.password,o)||(r.data.password=o),ge(o)}),x(),w(5,"button",20),we("click",function(){return fe(e),ge(X().onToggleViewPassword())}),w(6,"mat-icon",21),M(7),x()()()}if(2&t){const e=X();E(3),Kn("ngModel",e.data.password),N("type",e.show_pass?"text":"password"),E(3),ys("matTooltip",e.show_pass?"Hide password":"Show password"),E(),Ct(e.show_pass?"visibility":"visibility_off")}}function uue(t,i){if(1&t){const e=pt();w(0,"button",22,1),we("click",function(){return fe(e),ge(X().loginPassword())}),w(2,"mat-icon",23),M(3,"password"),x(),M(4," Login with Password "),x()}2&t&&N("disabled",""==X().data.password)}function hue(t,i){if(1&t){const e=pt();w(0,"button",22,2),we("click",function(){return fe(e),ge(X().loginPasskey())}),w(2,"mat-icon",23),M(3,"passkey"),x(),M(4," Login with Passkey "),x()}2&t&&N("disabled",!X().hasBasicInfo())}function pue(t,i){if(1&t){const e=pt();w(0,"button",24),we("click",function(){return fe(e),ge(X().onForgotPassword())}),w(1,"mat-icon",23),M(2,"help"),x(),M(3," Forgot Password "),x()}}function mue(t,i){if(1&t){const e=pt();w(0,"button",22,3),we("click",function(){return fe(e),ge(X().getLoginOptions())}),M(2," Next "),x()}2&t&&N("disabled",!X().hasBasicCredentials())}function fue(t,i){if(1&t){const e=pt();w(0,"button",24),we("click",function(){return fe(e),ge(X().clearLoginOptions())}),M(1," Back "),x()}}function _ue(t,i){if(1&t&&(w(0,"div",25)(1,"p",26),M(2,"\xa0"),x(),w(3,"div",27)(4,"table",28),Re(5,"th"),w(6,"tr")(7,"td")(8,"mat-icon",29),M(9,"error"),x(),M(10),x()()()()()),2&t){const e=X();E(10),Jt(" ",e.errorMessage,"")}}let gue=(()=>{class t{loginService;router;route;http;snackBar;prepareRoute(e){return e?.activatedRouteData?.animation||""}nextButton;passwordLoginButton;passkeyLogin;passwordInput;onEnter(e){this.handleEnterKey()}show_pass=!1;inProgress=!1;hasErrorMessage=!1;data;subscription=null;errorMessage="";login_options;constructor(e,n,o,r,u){this.loginService=e,this.router=n,this.route=o,this.http=r,this.snackBar=u}ngOnInit(){this.data=new Zae,this.autoFill(),this.tokenLogin(),this.data.password="",this.login_options=[]}handleEnterKey(){let n=this.passwordLoginButton&&this.passwordLoginButton.nativeElement;this.nextButton&&this.nextButton.nativeElement?this.nextButton.nativeElement.click():n&&""!=this.data.password&&this.passwordLoginButton.nativeElement.click()}isValidString(e){return!(!e||0===e.trim().length)}getLoginOptions(){this.http.post(li_backendURL+"/user/auth",{organization:this.data.organization,username:this.data.username},{withCredentials:!0}).subscribe({next:o=>{this.login_options=o.methods,setTimeout(()=>{this.login_options.includes("password")&&this.passwordInput&&this.passwordInput.nativeElement&&(this.passwordInput.nativeElement.focus(),this.passwordInput.nativeElement.setSelectionRange(0,this.passwordInput.nativeElement.value.length))},300)},error:o=>{this.login_options=[],this.snackBar.open(o.message,"Dismiss",{duration:5e3})}})}clearLoginOptions(){this.hasErrorMessage=!1,this.login_options=[]}hasBasicCredentials(){return this.isValidString(this.data.organization)&&this.isValidString(this.data.username)}hasPasswordLogin(){return this.login_options.includes("password")}hasPasskeyLogin(){return this.login_options.includes("passkey")}hasLoginOptions(){return this.login_options.length>0}isValidParameter(e){return null!=e&&null!=e&&""!=e}autoFill(){let e=this.loginService.getLoginURLParams();this.isValidParameter(e.org)&&this.isValidParameter(e.user)?(this.data.organization=e.org,this.data.username=e.user,this.data.password=""):(this.data.username=window.localStorage.getItem("loginUsername"),this.data.organization=window.localStorage.getItem("loginOrganization"))}tokenLogin(){this.loginService.loginToken().subscribe({next:e=>{window.localStorage.setItem("loginUsername",this.data.username),window.localStorage.setItem("loginOrganization",this.data.organization)},complete:()=>{}})}hasBasicInfo(){return this.isValidString(this.data.organization)&&this.isValidString(this.data.username)}loginPassword(){this.onLogin()}loginPasskey(){var n,e=this;this.getPasskeyOptions().subscribe({next:(n=bt(function*(o){let r=yield function sse(t){return w3.apply(this,arguments)}({optionsJSON:o});const u=JSON.stringify(r);e.onLogin(!0,u)}),function(r){return n.apply(this,arguments)}),error:n=>{this.hasErrorMessage=!0,this.errorMessage="Failed to get passkey options: "+n.statusText}})}getPasskeyOptions(){return this.http.post(li_backendURL+"/passkey/options",{organization:this.data.organization,username:this.data.username},{withCredentials:!0})}onLogin(){var e=this;return bt(function*(n=!1,o=""){if(e.hasErrorMessage=!1,n){if(""==o)return e.hasErrorMessage=!0,e.errorMessage="Failed to retrieve passkey.",!1;e.hasErrorMessage=!1,e.data.passkey_response=o,e.data.password="using_passkey"}const r=yield e.loginService.login(e.data);return e.subscription=r.subscribe({next:u=>{u.body&&(null==u.body.user?(e.data.password="",e.hasErrorMessage=!0,e.errorMessage=u.body.error_msg):(window.localStorage.setItem("loginUsername",e.data.username),window.localStorage.setItem("loginOrganization",e.data.organization))),e.subscription.unsubscribe()},error:u=>{e.errorMessage="Login failed: "+u.statusText}}),!1}).apply(this,arguments)}onToggleViewPassword(){this.show_pass=!this.show_pass}onForgotPassword(){this.router.navigate(["/request_reset"],{state:{organization:this.data.organization,username:this.data.username}})}static \u0275fac=function(n){return new(n||t)($e(Po),$e(Ga),$e(id),$e(Uo),$e(Mc))};static \u0275cmp=cn({type:t,selectors:[["app-login"]],viewQuery:function(n,o){if(1&n&&(mn(aue,5,Pn),mn(sue,5,Pn),mn(lue,5,Pn),mn(cue,5,Pn)),2&n){let r;Bt(r=Vt())&&(o.nextButton=r.first),Bt(r=Vt())&&(o.passwordLoginButton=r.first),Bt(r=Vt())&&(o.passkeyLogin=r.first),Bt(r=Vt())&&(o.passwordInput=r.first)}},hostBindings:function(n,o){1&n&&we("keydown.enter",function(u){return o.onEnter(u)},0,IC)},standalone:!1,decls:25,vars:14,consts:[["passwordInput",""],["passwordLoginButton",""],["passkeyLoginButton",""],["nextButton",""],[1,"login-container"],[1,"login-card-container"],[1,"login-card"],[1,"title"],[1,"login-card-content"],["hideRequiredMarker","",3,"hidden"],["matInput","","required","","name","organization",3,"ngModelChange","ngModel"],["matInput","","required","","name","username",3,"ngModelChange","ngModel"],[1,"welcome-container",3,"hidden"],[1,"user-chip",3,"matTooltip"],["hideRequiredMarker","",4,"ngIf"],["mat-fab","","extended","","type","button",3,"disabled","click",4,"ngIf"],["mat-fab","","extended","","type","button",3,"click",4,"ngIf"],["class","error-container",4,"ngIf"],["hideRequiredMarker",""],["matInput","","name","password","autocomplete","current-password",3,"ngModelChange","ngModel","type"],["matSuffix","","mat-icon-button","","type","button","id","view-toggle",3,"click"],["fontSet","material-symbols-outlined","id","visibility-icon",3,"matTooltip"],["mat-fab","","extended","","type","button",3,"click","disabled"],["fontSet","material-symbols-outlined"],["mat-fab","","extended","","type","button",3,"click"],[1,"error-container"],[2,"line-height",".001em"],[1,"error-content"],["role","presentation"],["fontSet","material-symbols-outlined",1,"error-icon"]],template:function(n,o){1&n&&(w(0,"div",4)(1,"div",5)(2,"mat-card",6)(3,"mat-card-header")(4,"mat-card-title",7),M(5," Login to DrawBridge "),x()(),w(6,"mat-card-content",8)(7,"mat-form-field",9)(8,"mat-label"),M(9,"Organization"),x(),w(10,"input",10),Qn("ngModelChange",function(u){return ei(o.data.organization,u)||(o.data.organization=u),u}),x()(),w(11,"mat-form-field",9)(12,"mat-label"),M(13,"Username"),x(),w(14,"input",11),Qn("ngModelChange",function(u){return ei(o.data.username,u)||(o.data.username=u),u}),x()(),w(15,"div",12)(16,"mat-chip",13),M(17),x()(),te(18,due,8,4,"mat-form-field",14)(19,uue,5,1,"button",15)(20,hue,5,1,"button",15)(21,pue,4,0,"button",16)(22,mue,3,1,"button",15)(23,fue,2,0,"button",16)(24,_ue,11,1,"div",17),x()()()()),2&n&&(E(7),N("hidden",o.hasLoginOptions()),E(3),Kn("ngModel",o.data.organization),E(),N("hidden",o.hasLoginOptions()),E(3),Kn("ngModel",o.data.username),E(),N("hidden",!o.hasLoginOptions()),E(),N("matTooltip",o.data.username+"@"+o.data.organization),E(),Ct(o.data.username+"@"+o.data.organization),E(),N("ngIf",o.hasPasswordLogin()),E(),N("ngIf",o.hasPasswordLogin()),E(),N("ngIf",o.hasPasskeyLogin()),E(),N("ngIf",o.hasPasswordLogin()),E(),N("ngIf",!o.hasLoginOptions()),E(),N("ngIf",o.hasLoginOptions()),E(),N("ngIf",o.hasErrorMessage))},dependencies:[ir,jr,wr,Jl,ts,na,Oa,Qs,xa,qa,Ab,Sr,Pa,r0,zx,a0,Nx,k_],styles:["[_nghost-%COMP%]{--mdc-elevated-card-container-color: var(--mat-sys-primary-container)}[_nghost-%COMP%]{--mdc-filled-text-field-container-color: var(--mat-sys-primary-container)}.login-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:fixed;inset:0;background-color:var(--mat-sys-surface-dim)}.login-card-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}.login-card[_ngcontent-%COMP%]{min-width:375px;max-width:450px;width:80%}.title[_ngcontent-%COMP%]{font-weight:500}.login-card-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1em;padding:1em}.welcome-container[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:center;margin-bottom:1em}.user-chip[_ngcontent-%COMP%]{width:100%!important;display:inline-block!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important;box-sizing:border-box!important}.error-container[_ngcontent-%COMP%]{text-align:center}.error-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto;padding:12px;color:#d8000c;background-color:#ffd2d2;width:100%}.error-icon[_ngcontent-%COMP%]{position:relative;top:5px;margin-right:12px}"]})}return t})();var bue=qt(3838);let sf=(()=>{class t{loginService;router;constructor(e,n){this.loginService=e,this.router=n}canActivate(e,n){return!!this.loginService.isLoggedIn()||(this.redirect(n,!0),!1)}redirect(e,n){this.loginService.nextURL=n?e.url:null,this.loginService.navigateToDefaultPage()}inspectUrlParams(e){try{let n=e.queryParamMap.get("data");if(null!=n){let o=(t=>bue.hp.from(t,"base64").toString("binary"))(n),r=JSON.parse(o);this.loginService.setLoginURLParams(r)}}catch{let n=new JH;this.loginService.setLoginURLParams(n)}}static \u0275fac=function(n){return new(n||t)(xn(Po),xn(Ga))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();class sj{}function J3(t){return t&&"function"==typeof t.connect&&!(t instanceof yP)}var R_=function(t){return t[t.REPLACED=0]="REPLACED",t[t.INSERTED=1]="INSERTED",t[t.MOVED=2]="MOVED",t[t.REMOVED=3]="REMOVED",t}(R_||{});const HT=new yt("_ViewRepeater");class cj{applyChanges(i,e,n,o,r){i.forEachOperation((u,y,I)=>{let V,q;if(null==u.previousIndex){const ee=n(u,y,I);V=e.createEmbeddedView(ee.templateRef,ee.context,ee.index),q=R_.INSERTED}else null==I?(e.remove(y),q=R_.REMOVED):(V=e.get(y),e.move(V,I),q=R_.MOVED);r&&r({context:V?.context,operation:q,record:u})})}detach(){}}const vue=[[["caption"]],[["colgroup"],["col"]],"*"],xue=["caption","colgroup, col","*"];function wue(t,i){1&t&&On(0,2)}function Cue(t,i){1&t&&(w(0,"thead",0),ed(1,1),x(),w(2,"tbody",0),ed(3,2)(4,3),x(),w(5,"tfoot",0),ed(6,4),x())}function Sue(t,i){1&t&&ed(0,1)(1,2)(2,3)(3,4)}const lf=new yt("CDK_TABLE");let Gx=(()=>{class t{template=Y(sa);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkCellDef",""]]})}return t})(),qx=(()=>{class t{template=Y(sa);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkHeaderCellDef",""]]})}return t})(),NM=(()=>{class t{template=Y(sa);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkFooterCellDef",""]]})}return t})(),O_=(()=>{class t{_table=Y(lf,{optional:!0});_hasStickyChanged=!1;get name(){return this._name}set name(e){this._setNameInput(e)}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=!0)}_stickyEnd=!1;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;constructor(){}hasStickyChanged(){const e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`]}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName())}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkColumnDef",""]],contentQueries:function(n,o,r){if(1&n&&(oo(r,Gx,5),oo(r,qx,5),oo(r,NM,5)),2&n){let u;Bt(u=Vt())&&(o.cell=u.first),Bt(u=Vt())&&(o.headerCell=u.first),Bt(u=Vt())&&(o.footerCell=u.first)}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",fn],stickyEnd:[2,"stickyEnd","stickyEnd",fn]},features:[Bn([{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:t}])]})}return t})();class eL{constructor(i,e){e.nativeElement.classList.add(...i._columnCssClassName)}}let tL=(()=>{class t extends eL{constructor(){super(Y(O_),Y(Pn))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[qn]})}return t})(),nL=(()=>{class t extends eL{constructor(){const e=Y(O_),n=Y(Pn);super(e,n);const o=e._table?._getCellRole();o&&n.nativeElement.setAttribute("role",o)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[qn]})}return t})();class uj{tasks=[];endTasks=[]}const iL=new yt("_COALESCED_STYLE_SCHEDULER");let hj=(()=>{class t{_currentSchedule=null;_ngZone=Y(tn);constructor(){}schedule(e){this._createScheduleIfNeeded(),this._currentSchedule.tasks.push(e)}scheduleEnd(e){this._createScheduleIfNeeded(),this._currentSchedule.endTasks.push(e)}_createScheduleIfNeeded(){this._currentSchedule||(this._currentSchedule=new uj,this._ngZone.runOutsideAngular(()=>queueMicrotask(()=>{for(;this._currentSchedule.tasks.length||this._currentSchedule.endTasks.length;){const e=this._currentSchedule;this._currentSchedule=new uj;for(const n of e.tasks)n();for(const n of e.endTasks)n()}this._currentSchedule=null})))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),oL=(()=>{class t{template=Y(sa);_differs=Y(db);columns;_columnsDiffer;constructor(){}ngOnChanges(e){if(!this._columnsDiffer){const n=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(n).create(),this._columnsDiffer.diff(n)}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof jT?e.headerCell.template:this instanceof $T?e.footerCell.template:e.cell.template}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,features:[go]})}return t})(),jT=(()=>{class t extends oL{_table=Y(lf,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(Y(sa),Y(db))}ngOnChanges(e){super.ngOnChanges(e)}hasStickyChanged(){const e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",fn]},features:[qn,go]})}return t})(),$T=(()=>{class t extends oL{_table=Y(lf,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(Y(sa),Y(db))}ngOnChanges(e){super.ngOnChanges(e)}hasStickyChanged(){const e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",fn]},features:[qn,go]})}return t})(),zM=(()=>{class t extends oL{_table=Y(lf,{optional:!0});when;constructor(){super(Y(sa),Y(db))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[qn]})}return t})(),P_=(()=>{class t{_viewContainer=Y(es);cells;context;static mostRecentCellOutlet=null;constructor(){t.mostRecentCellOutlet=this}ngOnDestroy(){t.mostRecentCellOutlet===this&&(t.mostRecentCellOutlet=null)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","cdkCellOutlet",""]]})}return t})(),rL=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(n,o){1&n&&ed(0,0)},dependencies:[P_],encapsulation:2})}return t})(),sL=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(n,o){1&n&&ed(0,0)},dependencies:[P_],encapsulation:2})}return t})(),BM=(()=>{class t{templateRef=Y(sa);_contentClassName="cdk-no-data-row";constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["ng-template","cdkNoDataRow",""]]})}return t})();const pj=["top","bottom","left","right"];class Eue{_isNativeHtmlTable;_stickCellCss;direction;_coalescedStyleScheduler;_isBrowser;_needsPositionStickyOnElement;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(i=>this._updateCachedSizes(i)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=!1;constructor(i,e,n,o,r=!0,u=!0,y,I){this._isNativeHtmlTable=i,this._stickCellCss=e,this.direction=n,this._coalescedStyleScheduler=o,this._isBrowser=r,this._needsPositionStickyOnElement=u,this._positionListener=y,this._tableInjector=I,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`}}clearStickyPositioning(i,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(i);const n=[];for(const o of i)o.nodeType===o.ELEMENT_NODE&&n.push(o,...Array.from(o.children));this._afterNextRender({write:()=>{for(const o of n)this._removeStickyStyle(o,e)}})}updateStickyColumns(i,e,n,o=!0,r=!0){if(!i.length||!this._isBrowser||!e.some(mt=>mt)&&!n.some(mt=>mt))return this._positionListener?.stickyColumnsUpdated({sizes:[]}),void this._positionListener?.stickyEndColumnsUpdated({sizes:[]});const u=i[0],y=u.children.length,I="rtl"===this.direction,V=I?"right":"left",q=I?"left":"right",ee=e.lastIndexOf(!0),me=n.indexOf(!0);let he,Ce,je;r&&this._updateStickyColumnReplayQueue({rows:[...i],stickyStartStates:[...e],stickyEndStates:[...n]}),this._afterNextRender({earlyRead:()=>{he=this._getCellWidths(u,o),Ce=this._getStickyStartColumnPositions(he,e),je=this._getStickyEndColumnPositions(he,n)},write:()=>{for(const mt of i)for(let Lt=0;Lt!!mt)&&(this._positionListener.stickyColumnsUpdated({sizes:-1===ee?[]:he.slice(0,ee+1).map((mt,Lt)=>e[Lt]?mt:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:-1===me?[]:he.slice(me).map((mt,Lt)=>n[Lt+me]?mt:null).reverse()}))}})}stickRows(i,e,n){if(!this._isBrowser)return;const o="bottom"===n?i.slice().reverse():i,r="bottom"===n?e.slice().reverse():e,u=[],y=[],I=[];this._afterNextRender({earlyRead:()=>{for(let V=0,q=0;V{const V=r.lastIndexOf(!0);for(let q=0;q{const n=i.querySelector("tfoot");n&&(e.some(o=>!o)?this._removeStickyStyle(n,["bottom"]):this._addStickyStyle(n,"bottom",0,!1))}})}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=!0}_removeStickyStyle(i,e){if(i.classList.contains(this._stickCellCss)){for(const o of e)i.style[o]="",i.classList.remove(this._borderCellCss[o]);pj.some(o=>-1===e.indexOf(o)&&i.style[o])?i.style.zIndex=this._getCalculatedZIndex(i):(i.style.zIndex="",this._needsPositionStickyOnElement&&(i.style.position=""),i.classList.remove(this._stickCellCss))}}_addStickyStyle(i,e,n,o){i.classList.add(this._stickCellCss),o&&i.classList.add(this._borderCellCss[e]),i.style[e]=`${n}px`,i.style.zIndex=this._getCalculatedZIndex(i),this._needsPositionStickyOnElement&&(i.style.cssText+="position: -webkit-sticky; position: sticky; ")}_getCalculatedZIndex(i){const e={top:100,bottom:10,left:1,right:1};let n=0;for(const o of pj)i.style[o]&&(n+=e[o]);return n?`${n}`:""}_getCellWidths(i,e=!0){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;const n=[],o=i.children;for(let r=0;r0;r--)e[r]&&(n[r]=o,o+=i[r]);return n}_retrieveElementSize(i){const e=this._elemSizeCache.get(i);if(e)return e;const n=i.getBoundingClientRect(),o={width:n.width,height:n.height};return this._resizeObserver&&(this._elemSizeCache.set(i,o),this._resizeObserver.observe(i,{box:"border-box"})),o}_updateStickyColumnReplayQueue(i){this._removeFromStickyColumnReplayQueue(i.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(i)}_removeFromStickyColumnReplayQueue(i){const e=new Set(i);for(const n of this._updatedStickyColumnsParamsToReplay)n.rows=n.rows.filter(o=>!e.has(o));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(n=>!!n.rows.length)}_updateCachedSizes(i){let e=!1;for(const n of i){const o=n.borderBoxSize?.length?{width:n.borderBoxSize[0].inlineSize,height:n.borderBoxSize[0].blockSize}:{width:n.contentRect.width,height:n.contentRect.height};o.width!==this._elemSizeCache.get(n.target)?.width&&Mue(n.target)&&(e=!0),this._elemSizeCache.set(n.target,o)}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(const n of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(n.rows,n.stickyStartStates,n.stickyEndStates,!0,!1);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null}},0))}_afterNextRender(i){this._tableInjector?As(i,{injector:this._tableInjector}):this._coalescedStyleScheduler.schedule(()=>{i.earlyRead?.(),i.write()})}}function Mue(t){return["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(i=>t.classList.contains(i))}const lL=new yt("CDK_SPL");let cL=(()=>{class t{viewContainer=Y(es);elementRef=Y(Pn);constructor(){const e=Y(lf);e._rowOutlet=this,e._outletAssigned()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","rowOutlet",""]]})}return t})(),dL=(()=>{class t{viewContainer=Y(es);elementRef=Y(Pn);constructor(){const e=Y(lf);e._headerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","headerRowOutlet",""]]})}return t})(),uL=(()=>{class t{viewContainer=Y(es);elementRef=Y(Pn);constructor(){const e=Y(lf);e._footerRowOutlet=this,e._outletAssigned()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","footerRowOutlet",""]]})}return t})(),hL=(()=>{class t{viewContainer=Y(es);elementRef=Y(Pn);constructor(){const e=Y(lf);e._noDataRowOutlet=this,e._outletAssigned()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","noDataRowOutlet",""]]})}return t})(),VM=(()=>{class t{_differs=Y(db);_changeDetectorRef=Y(So);_elementRef=Y(Pn);_dir=Y(ul,{optional:!0});_platform=Y(ea);_viewRepeater=Y(HT);_coalescedStyleScheduler=Y(iL);_viewportRuler=Y(Kv);_stickyPositioningListener=Y(lL,{optional:!0,skipSelf:!0});_document=Y(Oo);_data;_onDestroy=new Ee;_renderRows;_renderChangeSubscription;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow;_headerRowDefChanged=!0;_footerRowDefChanged=!0;_stickyColumnStylesNeedReset=!0;_forceRecalculateCellWidths=!0;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=!0;_isServer;_isShowingNoDataRow=!1;_hasAllOutlets=!1;_hasInitialized=!1;_getCellRole(){if(void 0===this._cellRoleInternal){const e=this._elementRef.nativeElement.getAttribute("role");return"grid"===e||"treegrid"===e?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}_dataSource;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())}_multiTemplateDataRows=!1;get fixedLayout(){return this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0}_fixedLayout=!1;contentChanged=new Tt;viewChange=new it({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;_injector=Y(Ke);constructor(){Y(new Mt("role"),{optional:!0})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable="TABLE"===this._elementRef.nativeElement.nodeName,this._dataDiffer=this._differs.find([]).create((n,o)=>this.trackBy?this.trackBy(o.dataIndex,o.data):o)}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(ro(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=!0})}ngAfterContentInit(){this._hasInitialized=!0}ngAfterContentChecked(){this._canRender()&&this._render()}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear()}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._onDestroy.next(),this._onDestroy.complete(),J3(this.dataSource)&&this.dataSource.disconnect(this)}renderRows(){this._renderRows=this._getAllRenderRows();const e=this._dataDiffer.diff(this._renderRows);if(!e)return this._updateNoDataRow(),void this.contentChanged.next();const n=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,n,(o,r,u)=>this._getEmbeddedViewArgs(o.item,u),o=>o.item.data,o=>{o.operation===R_.INSERTED&&o.context&&this._renderCellTemplateForItem(o.record.item.rowDef,o.context)}),this._updateRowIndexContext(),e.forEachIdentityChange(o=>{n.get(o.currentIndex).context.$implicit=o.item.data}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles()}addColumnDef(e){this._customColumnDefs.add(e)}removeColumnDef(e){this._customColumnDefs.delete(e)}addRowDef(e){this._customRowDefs.add(e)}removeRowDef(e){this._customRowDefs.delete(e)}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=!0}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=!0}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=!0}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=!0}setNoDataRow(e){this._customNoDataRow=e}updateStickyHeaderRowStyles(){const e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){const o=mj(this._headerRowOutlet,"thead");o&&(o.style.display=e.length?"":"none")}const n=this._headerRowDefs.map(o=>o.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,n,"top"),this._headerRowDefs.forEach(o=>o.resetStickyChanged())}updateStickyFooterRowStyles(){const e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){const o=mj(this._footerRowOutlet,"tfoot");o&&(o.style.display=e.length?"":"none")}const n=this._footerRowDefs.map(o=>o.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,n,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,n),this._footerRowDefs.forEach(o=>o.resetStickyChanged())}updateStickyColumnStyles(){const e=this._getRenderedRows(this._headerRowOutlet),n=this._getRenderedRows(this._rowOutlet),o=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this._fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...n,...o],["left","right"]),this._stickyColumnStylesNeedReset=!1),e.forEach((r,u)=>{this._addStickyColumnStyles([r],this._headerRowDefs[u])}),this._rowDefs.forEach(r=>{const u=[];for(let y=0;y{this._addStickyColumnStyles([r],this._footerRowDefs[u])}),Array.from(this._columnDefsByName.values()).forEach(r=>r.resetStickyChanged())}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=!0,this._canRender()&&this._render())}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs();const n=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||n,this._forceRecalculateCellWidths=n,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()}_getAllRenderRows(){const e=[],n=this._cachedRenderRowsMap;if(this._cachedRenderRowsMap=new Map,!this._data)return e;for(let o=0;o{const y=o&&o.has(u)?o.get(u):[];if(y.length){const I=y.shift();return I.dataIndex=n,I}return{data:e,rowDef:u,dataIndex:n}})}_cacheColumnDefs(){this._columnDefsByName.clear(),UM(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(n=>{this._columnDefsByName.has(n.name),this._columnDefsByName.set(n.name,n)})}_cacheRowDefs(){this._headerRowDefs=UM(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=UM(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=UM(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);const e=this._rowDefs.filter(n=>!n.when);this._defaultRowDef=e[0]}_renderUpdatedColumns(){const e=(u,y)=>{const I=!!y.getColumnsDiff();return u||I},n=this._rowDefs.reduce(e,!1);n&&this._forceRenderDataRows();const o=this._headerRowDefs.reduce(e,!1);o&&this._forceRenderHeaderRows();const r=this._footerRowDefs.reduce(e,!1);return r&&this._forceRenderFooterRows(),n||o||r}_switchDataSource(e){this._data=[],J3(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e}_observeRenderChanges(){if(!this.dataSource)return;let e;J3(this.dataSource)?e=this.dataSource.connect(this):nT(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=xi(this.dataSource)),this._renderChangeSubscription=e.pipe(ro(this._onDestroy)).subscribe(n=>{this._data=n||[],this.renderRows()})}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,n)=>this._renderRow(this._headerRowOutlet,e,n)),this.updateStickyHeaderRowStyles()}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,n)=>this._renderRow(this._footerRowOutlet,e,n)),this.updateStickyFooterRowStyles()}_addStickyColumnStyles(e,n){const o=Array.from(n?.columns||[]).map(y=>this._columnDefsByName.get(y)),r=o.map(y=>y.sticky),u=o.map(y=>y.stickyEnd);this._stickyStyler.updateStickyColumns(e,r,u,!this._fixedLayout||this._forceRecalculateCellWidths)}_getRenderedRows(e){const n=[];for(let o=0;o!r.when||r.when(n,e));else{let r=this._rowDefs.find(u=>u.when&&u.when(n,e))||this._defaultRowDef;r&&o.push(r)}return o}_getEmbeddedViewArgs(e,n){return{templateRef:e.rowDef.template,context:{$implicit:e.data},index:n}}_renderRow(e,n,o,r={}){const u=e.viewContainer.createEmbeddedView(n.template,r,o);return this._renderCellTemplateForItem(n,r),u}_renderCellTemplateForItem(e,n){for(let o of this._getCellTemplates(e))P_.mostRecentCellOutlet&&P_.mostRecentCellOutlet._viewContainer.createEmbeddedView(o,n);this._changeDetectorRef.markForCheck()}_updateRowIndexContext(){const e=this._rowOutlet.viewContainer;for(let n=0,o=e.length;n{const o=this._columnDefsByName.get(n);return e.extractCellTemplate(o)}):[]}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()}_checkStickyStates(){const e=(n,o)=>n||o.hasStickyChanged();this._headerRowDefs.reduce(e,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,!1)&&(this._stickyColumnStylesNeedReset=!0,this.updateStickyColumnStyles())}_setupStickyStyler(){this._stickyStyler=new Eue(this._isNativeHtmlTable,this.stickyCssClass,this._dir?this._dir.value:"ltr",this._coalescedStyleScheduler,this._platform.isBrowser,this.needsPositionStickyOnElement,this._stickyPositioningListener,this._injector),(this._dir?this._dir.change:xi()).pipe(ro(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles()})}_getOwnDefs(e){return e.filter(n=>!n._table||n._table===this)}_updateNoDataRow(){const e=this._customNoDataRow||this._noDataRow;if(!e)return;const n=0===this._rowOutlet.viewContainer.length;if(n===this._isShowingNoDataRow)return;const o=this._noDataRowOutlet.viewContainer;if(n){const r=o.createEmbeddedView(e.templateRef),u=r.rootNodes[0];1===r.rootNodes.length&&u?.nodeType===this._document.ELEMENT_NODE&&(u.setAttribute("role","row"),u.classList.add(e._contentClassName))}else o.clear();this._isShowingNoDataRow=n,this._changeDetectorRef.markForCheck()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(n,o,r){if(1&n&&(oo(r,BM,5),oo(r,O_,5),oo(r,zM,5),oo(r,jT,5),oo(r,$T,5)),2&n){let u;Bt(u=Vt())&&(o._noDataRow=u.first),Bt(u=Vt())&&(o._contentColumnDefs=u),Bt(u=Vt())&&(o._contentRowDefs=u),Bt(u=Vt())&&(o._contentHeaderRowDefs=u),Bt(u=Vt())&&(o._contentFooterRowDefs=u)}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("cdk-table-fixed-layout",o.fixedLayout)},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",fn],fixedLayout:[2,"fixedLayout","fixedLayout",fn]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[Bn([{provide:lf,useExisting:t},{provide:HT,useClass:cj},{provide:iL,useClass:hj},{provide:lL,useValue:null}])],ngContentSelectors:xue,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(n,o){1&n&&(ho(vue),On(0),On(1,1),te(2,wue,1,0)(3,Cue,7,0)(4,Sue,4,0)),2&n&&(E(2),Xi(o._isServer?2:-1),E(),Xi(o._isNativeHtmlTable?3:4))},dependencies:[dL,cL,hL,uL],styles:[".cdk-table-fixed-layout{table-layout:fixed}\n"],encapsulation:2})}return t})();function UM(t,i){return t.concat(Array.from(i))}function mj(t,i){const e=i.toUpperCase();let n=t.viewContainer.element.nativeElement;for(;n;){const o=1===n.nodeType?n.nodeName:null;if(o===e)return n;if("TABLE"===o)break;n=n.parentNode}return null}let kue=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[l3]})}return t})();const Rue=[[["caption"]],[["colgroup"],["col"]],"*"],Oue=["caption","colgroup, col","*"];function Pue(t,i){1&t&&On(0,2)}function Lue(t,i){1&t&&(w(0,"thead",0),ed(1,1),x(),w(2,"tbody",2),ed(3,3)(4,4),x(),w(5,"tfoot",0),ed(6,5),x())}function Fue(t,i){1&t&&ed(0,1)(1,3)(2,4)(3,5)}let rd=(()=>{class t extends VM{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=!1;static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-mdc-table","mdc-data-table__table"],hostVars:2,hostBindings:function(n,o){2&n&&Hn("mdc-table-fixed-layout",o.fixedLayout)},exportAs:["matTable"],features:[Bn([{provide:VM,useExisting:t},{provide:lf,useExisting:t},{provide:iL,useClass:hj},{provide:HT,useClass:cj},{provide:lL,useValue:null}]),qn],ngContentSelectors:Oue,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(n,o){1&n&&(ho(Rue),On(0),On(1,1),te(2,Pue,1,0)(3,Lue,7,0)(4,Fue,4,0)),2&n&&(E(2),Xi(o._isServer?2:-1),E(),Xi(o._isNativeHtmlTable?3:4))},dependencies:[dL,cL,hL,uL],styles:[".mat-mdc-table-sticky{position:sticky !important}mat-table{display:block}mat-header-row{min-height:var(--mat-table-header-container-height, 56px)}mat-row{min-height:var(--mat-table-row-item-container-height, 52px)}mat-footer-row{min-height:var(--mat-table-footer-container-height, 52px)}mat-row,mat-header-row,mat-footer-row{display:flex;border-width:0;border-bottom-width:1px;border-style:solid;align-items:center;box-sizing:border-box}mat-cell:first-of-type,mat-header-cell:first-of-type,mat-footer-cell:first-of-type{padding-left:24px}[dir=rtl] mat-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:first-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:first-of-type:not(:only-of-type){padding-left:0;padding-right:24px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{padding-right:24px}[dir=rtl] mat-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-header-cell:last-of-type:not(:only-of-type),[dir=rtl] mat-footer-cell:last-of-type:not(:only-of-type){padding-right:0;padding-left:24px}mat-cell,mat-header-cell,mat-footer-cell{flex:1;display:flex;align-items:center;overflow:hidden;word-wrap:break-word;min-height:inherit}.mat-mdc-table{min-width:100%;border:0;border-spacing:0;table-layout:auto;white-space:normal;background-color:var(--mat-table-background-color, var(--mat-sys-surface))}.mdc-data-table__cell{box-sizing:border-box;overflow:hidden;text-align:left;text-overflow:ellipsis}[dir=rtl] .mdc-data-table__cell{text-align:right}.mdc-data-table__cell,.mdc-data-table__header-cell{padding:0 16px}.mat-mdc-header-row{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mat-table-header-container-height, 56px);color:var(--mat-table-header-headline-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-table-header-headline-font, var(--mat-sys-title-small-font, Roboto, sans-serif));line-height:var(--mat-table-header-headline-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-table-header-headline-size, var(--mat-sys-title-small-size, 14px));font-weight:var(--mat-table-header-headline-weight, var(--mat-sys-title-small-weight, 500))}.mat-mdc-row{height:var(--mat-table-row-item-container-height, 52px);color:var(--mat-table-row-item-label-text-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)))}.mat-mdc-row,.mdc-data-table__content{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(--mat-table-row-item-label-text-font, var(--mat-sys-body-medium-font, Roboto, sans-serif));line-height:var(--mat-table-row-item-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-table-row-item-label-text-size, var(--mat-sys-body-medium-size, 14px));font-weight:var(--mat-table-row-item-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-footer-row{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;height:var(--mat-table-footer-container-height, 52px);color:var(--mat-table-row-item-label-text-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-table-footer-supporting-text-font, var(--mat-sys-body-medium-font, Roboto, sans-serif));line-height:var(--mat-table-footer-supporting-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-table-footer-supporting-text-size, var(--mat-sys-body-medium-size, 14px));font-weight:var(--mat-table-footer-supporting-text-weight, var(--mat-sys-body-medium-weight));letter-spacing:var(--mat-table-footer-supporting-text-tracking, var(--mat-sys-body-medium-tracking))}.mat-mdc-header-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, 0.12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid;letter-spacing:var(--mat-table-header-headline-tracking, var(--mat-sys-title-small-tracking));font-weight:inherit;line-height:inherit;box-sizing:border-box;text-overflow:ellipsis;overflow:hidden;outline:none;text-align:left}[dir=rtl] .mat-mdc-header-cell{text-align:right}.mdc-data-table__row:last-child>.mat-mdc-header-cell{border-bottom:none}.mat-mdc-cell{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, 0.12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid;letter-spacing:var(--mat-table-row-item-label-text-tracking, var(--mat-sys-body-medium-tracking));line-height:inherit}.mdc-data-table__row:last-child>.mat-mdc-cell{border-bottom:none}.mat-mdc-footer-cell{letter-spacing:var(--mat-table-row-item-label-text-tracking, var(--mat-sys-body-medium-tracking))}mat-row.mat-mdc-row,mat-header-row.mat-mdc-header-row,mat-footer-row.mat-mdc-footer-row{border-bottom:none}.mat-mdc-table tbody,.mat-mdc-table tfoot,.mat-mdc-table thead,.mat-mdc-cell,.mat-mdc-footer-cell,.mat-mdc-header-row,.mat-mdc-row,.mat-mdc-footer-row,.mat-mdc-table .mat-mdc-header-cell{background:inherit}.mat-mdc-table mat-header-row.mat-mdc-header-row,.mat-mdc-table mat-row.mat-mdc-row,.mat-mdc-table mat-footer-row.mat-mdc-footer-cell{height:unset}mat-header-cell.mat-mdc-header-cell,mat-cell.mat-mdc-cell,mat-footer-cell.mat-mdc-footer-cell{align-self:stretch}\n"],encapsulation:2})}return t})(),ad=(()=>{class t extends Gx{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matCellDef",""]],features:[Bn([{provide:Gx,useExisting:t}]),qn]})}return t})(),sd=(()=>{class t extends qx{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matHeaderCellDef",""]],features:[Bn([{provide:qx,useExisting:t}]),qn]})}return t})(),Ac=(()=>{class t extends O_{get name(){return this._name}set name(e){this._setNameInput(e)}_updateColumnCssClassName(){super._updateColumnCssClassName(),this._columnCssClassName.push(`mat-column-${this.cssClassFriendlyName}`)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matColumnDef",""]],inputs:{name:[0,"matColumnDef","name"]},features:[Bn([{provide:O_,useExisting:t},{provide:"MAT_SORT_HEADER_COLUMN_DEF",useExisting:t}]),qn]})}return t})(),ld=(()=>{class t extends tL{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["mat-header-cell"],["th","mat-header-cell",""]],hostAttrs:["role","columnheader",1,"mat-mdc-header-cell","mdc-data-table__header-cell"],features:[qn]})}return t})(),cd=(()=>{class t extends nL{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["mat-cell"],["td","mat-cell",""]],hostAttrs:[1,"mat-mdc-cell","mdc-data-table__cell"],features:[qn]})}return t})(),qd=(()=>{class t extends jT{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matHeaderRowDef",""]],inputs:{columns:[0,"matHeaderRowDef","columns"],sticky:[2,"matHeaderRowDefSticky","sticky",fn]},features:[Bn([{provide:jT,useExisting:t}]),qn]})}return t})(),Wd=(()=>{class t extends zM{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matRowDef",""]],inputs:{columns:[0,"matRowDefColumns","columns"],when:[0,"matRowDefWhen","when"]},features:[Bn([{provide:zM,useExisting:t}]),qn]})}return t})(),Zd=(()=>{class t extends rL{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-header-row"],["tr","mat-header-row",""]],hostAttrs:["role","row",1,"mat-mdc-header-row","mdc-data-table__header-row"],exportAs:["matHeaderRow"],features:[Bn([{provide:rL,useExisting:t}]),qn],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(n,o){1&n&&ed(0,0)},dependencies:[P_],encapsulation:2})}return t})(),Yd=(()=>{class t extends sL{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-row"],["tr","mat-row",""]],hostAttrs:["role","row",1,"mat-mdc-row","mdc-data-table__row"],exportAs:["matRow"],features:[Bn([{provide:sL,useExisting:t}]),qn],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(n,o){1&n&&ed(0,0)},dependencies:[P_],encapsulation:2})}return t})(),$ue=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,kue,Ki]})}return t})();class Fr extends sj{_data;_renderData=new it([]);_filter=new it("");_internalPageChanges=new Ee;_renderChangesSubscription=null;filteredData;get data(){return this._data.value}set data(i){i=Array.isArray(i)?i:[],this._data.next(i),this._renderChangesSubscription||this._filterData(i)}get filter(){return this._filter.value}set filter(i){this._filter.next(i),this._renderChangesSubscription||this._filterData(this.data)}get sort(){return this._sort}set sort(i){this._sort=i,this._updateChangeSubscription()}_sort;get paginator(){return this._paginator}set paginator(i){this._paginator=i,this._updateChangeSubscription()}_paginator;sortingDataAccessor=(i,e)=>{const n=i[e];if(FU(n)){const o=Number(n);return o<9007199254740991?o:n}return n};sortData=(i,e)=>{const n=e.active,o=e.direction;return n&&""!=o?i.sort((r,u)=>{let y=this.sortingDataAccessor(r,n),I=this.sortingDataAccessor(u,n);const V=typeof y,q=typeof I;V!==q&&("number"===V&&(y+=""),"number"===q&&(I+=""));let ee=0;return null!=y&&null!=I?y>I?ee=1:y{const n=e.trim().toLowerCase();return Object.values(i).some(o=>`${o}`.toLowerCase().includes(n))};constructor(i=[]){super(),this._data=new it(i),this._updateChangeSubscription()}_updateChangeSubscription(){const i=this._sort?va(this._sort.sortChange,this._sort.initialized):xi(null),e=this._paginator?va(this._paginator.page,this._internalPageChanges,this._paginator.initialized):xi(null),o=Bv([this._data,this._filter]).pipe(kt(([y])=>this._filterData(y))),r=Bv([o,i]).pipe(kt(([y])=>this._orderData(y))),u=Bv([r,e]).pipe(kt(([y])=>this._pageData(y)));this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=u.subscribe(y=>this._renderData.next(y))}_filterData(i){return this.filteredData=null==this.filter||""===this.filter?i:i.filter(e=>this.filterPredicate(e,this.filter)),this.paginator&&this._updatePaginator(this.filteredData.length),this.filteredData}_orderData(i){return this.sort?this.sortData(i.slice(),this.sort):i}_pageData(i){if(!this.paginator)return i;const e=this.paginator.pageIndex*this.paginator.pageSize;return i.slice(e,e+this.paginator.pageSize)}_updatePaginator(i){Promise.resolve().then(()=>{const e=this.paginator;if(e&&(e.length=i,e.pageIndex>0)){const n=Math.ceil(e.length/e.pageSize)-1||0,o=Math.min(e.pageIndex,n);o!==e.pageIndex&&(e.pageIndex=o,this._internalPageChanges.next())}})}connect(){return this._renderChangesSubscription||this._updateChangeSubscription(),this._renderData}disconnect(){this._renderChangesSubscription?.unsubscribe(),this._renderChangesSubscription=null}}class _j extends _H{setActiveItem(i){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(i),this.activeItem&&this.activeItem.setActiveStyles()}}class GT{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new Ee;constructor(i=!1,e,n=!0,o){this._multiple=i,this._emitChanges=n,this.compareWith=o,e&&e.length&&(i?e.forEach(r=>this._markSelected(r)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...i){this._verifyValueAssignment(i),i.forEach(n=>this._markSelected(n));const e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...i){this._verifyValueAssignment(i),i.forEach(n=>this._unmarkSelected(n));const e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...i){this._verifyValueAssignment(i);const e=this.selected,n=new Set(i.map(r=>this._getConcreteValue(r)));i.forEach(r=>this._markSelected(r)),e.filter(r=>!n.has(this._getConcreteValue(r,n))).forEach(r=>this._unmarkSelected(r));const o=this._hasQueuedChanges();return this._emitChangeEvent(),o}toggle(i){return this.isSelected(i)?this.deselect(i):this.select(i)}clear(i=!0){this._unmarkAll();const e=this._hasQueuedChanges();return i&&this._emitChangeEvent(),e}isSelected(i){return this._selection.has(this._getConcreteValue(i))}isEmpty(){return 0===this._selection.size}hasValue(){return!this.isEmpty()}sort(i){this._multiple&&this.selected&&this._selected.sort(i)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(i){i=this._getConcreteValue(i),this.isSelected(i)||(this._multiple||this._unmarkAll(),this.isSelected(i)||this._selection.add(i),this._emitChanges&&this._selectedToEmit.push(i))}_unmarkSelected(i){i=this._getConcreteValue(i),this.isSelected(i)&&(this._selection.delete(i),this._emitChanges&&this._deselectedToEmit.push(i))}_unmarkAll(){this.isEmpty()||this._selection.forEach(i=>this._unmarkSelected(i))}_verifyValueAssignment(i){}_hasQueuedChanges(){return!(!this._deselectedToEmit.length&&!this._selectedToEmit.length)}_getConcreteValue(i,e){if(this.compareWith){e=e??this._selection;for(let n of e)if(this.compareWith(i,n))return n;return i}return i}}let gj=(()=>{class t{_animationMode=Y(Kr,{optional:!0});state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,o){2&n&&Hn("mat-pseudo-checkbox-indeterminate","indeterminate"===o.state)("mat-pseudo-checkbox-checked","checked"===o.state)("mat-pseudo-checkbox-disabled",o.disabled)("mat-pseudo-checkbox-minimal","minimal"===o.appearance)("mat-pseudo-checkbox-full","full"===o.appearance)("_mat-animation-noopable","NoopAnimations"===o._animationMode)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(n,o){},styles:['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}\n'],encapsulation:2,changeDetection:0})}return t})();const que=["text"],Wue=[[["mat-icon"]],"*"],Zue=["mat-icon","*"];function Yue(t,i){if(1&t&&Re(0,"mat-pseudo-checkbox",1),2&t){const e=X();N("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function Xue(t,i){1&t&&Re(0,"mat-pseudo-checkbox",3),2&t&&N("disabled",X().disabled)}function Kue(t,i){if(1&t&&(w(0,"span",4),M(1),x()),2&t){const e=X();E(),Jt("(",e.group.label,")")}}const pL=new yt("MAT_OPTION_PARENT_COMPONENT"),mL=new yt("MatOptgroup");class bj{source;isUserInput;constructor(i,e=!1){this.source=i,this.isUserInput=e}}let uc=(()=>{class t{_element=Y(Pn);_changeDetectorRef=Y(So);_parent=Y(pL,{optional:!0});group=Y(mL,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_disabled=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=Y(ta).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(e){this._disabled=e}get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!(!this._parent||!this._parent.hideSingleSelectionIndicator)}onSelectionChange=new Tt;_text;_stateChanges=new Ee;constructor(){const e=Y(Rs);e.load(wu),e.load(qv),this._signalDisableRipple=!!this._parent&&Gs(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,n){const o=this._getHostElement();"function"==typeof o.focus&&o.focus(n)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(13===e.keyCode||32===e.keyCode)&&!ns(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=!this.multiple||!this._selected,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){const e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new bj(this,e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-option"]],viewQuery:function(n,o){if(1&n&&mn(que,7),2&n){let r;Bt(r=Vt())&&(o._text=r.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,o){1&n&&we("click",function(){return o._selectViaInteraction()})("keydown",function(u){return o._handleKeydown(u)}),2&n&&(cc("id",o.id),zn("aria-selected",o.selected)("aria-disabled",o.disabled.toString()),Hn("mdc-list-item--selected",o.selected)("mat-mdc-option-multiple",o.multiple)("mat-mdc-option-active",o.active)("mdc-list-item--disabled",o.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",fn]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:Zue,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(n,o){1&n&&(ho(Wue),te(0,Yue,1,2,"mat-pseudo-checkbox",1),On(1),w(2,"span",2,0),On(4,1),x(),te(5,Xue,1,1,"mat-pseudo-checkbox",3)(6,Kue,2,1,"span",4),Re(7,"div",5)),2&n&&(Xi(o.multiple?0:-1),E(5),Xi(o.multiple||!o.selected||o.hideSingleSelectionIndicator?-1:5),E(),Xi(o.group&&o.group._inert?6:-1),E(),N("matRippleTrigger",o._getHostElement())("matRippleDisabled",o.disabled||o.disableRipple))},dependencies:[gj,Mb],styles:['.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}\n'],encapsulation:2,changeDetection:0})}return t})();function yj(t,i,e){if(e.length){let n=i.toArray(),o=e.toArray(),r=0;for(let u=0;ue+n?Math.max(0,t-n+i):e}let xj=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki]})}return t})(),HM=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[e0,Ki,xj]})}return t})();const Que=["trigger"],Jue=["panel"],ehe=[[["mat-select-trigger"]],"*"],the=["mat-select-trigger","*"];function nhe(t,i){if(1&t&&(w(0,"span",4),M(1),x()),2&t){const e=X();E(),Ct(e.placeholder)}}function ihe(t,i){1&t&&On(0)}function ohe(t,i){if(1&t&&(w(0,"span",11),M(1),x()),2&t){const e=X(2);E(),Ct(e.triggerValue)}}function rhe(t,i){if(1&t&&(w(0,"span",5),te(1,ihe,1,0)(2,ohe,2,1,"span",11),x()),2&t){const e=X();E(),Xi(e.customTrigger?1:2)}}function ahe(t,i){if(1&t){const e=pt();w(0,"div",12,1),we("keydown",function(o){return fe(e),ge(X()._handleKeydown(o))}),On(2,1),x()}if(2&t){const e=X();(function n4(t,i,e){jp(rc,Wm,ex(Yt(),t,i,e),!0)})("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme(),""),Hn("mat-select-panel-animations-enabled",!e._animationsDisabled),N("ngClass",e.panelClass),zn("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}const wj=new yt("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition()}}),lhe=new yt("MAT_SELECT_CONFIG"),che={provide:wj,deps:[is],useFactory:function she(t){return()=>t.scrollStrategies.reposition()}},dhe=new yt("MatSelectTrigger");class uhe{source;value;constructor(i,e){this.source=i,this.value=e}}let nh=(()=>{class t{_viewportRuler=Y(Kv);_changeDetectorRef=Y(So);_elementRef=Y(Pn);_dir=Y(ul,{optional:!0});_idGenerator=Y(ta);_renderer=Y(Hr);_parentFormField=Y(o0,{optional:!0});ngControl=Y(Gh,{self:!0,optional:!0});_liveAnnouncer=Y(UU);_defaultOptions=Y(lhe,{optional:!0});_animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});_initialized=new Ee;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){const n=this.options.toArray()[e];if(n){const o=this.panel.nativeElement,r=yj(e,this.options,this.optionGroups),u=n._getHostElement();o.scrollTop=0===e&&1===r?0:vj(u.offsetTop,u.offsetHeight,o.scrollTop,o.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new uhe(this,e)}_scrollStrategyFactory=Y(wj);_panelOpen=!1;_compareWith=(e,n)=>e===n;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new Ee;_errorStateTracker;stateChanges=new Ee;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;disableRipple=!1;tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Ov.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=Tx(()=>{const e=this.options;return e?e.changes.pipe(ua(e),Xs(()=>va(...e.map(n=>n.onSelectionChange)))):this._initialized.pipe(Xs(()=>this.optionSelectionChanges))});openedChange=new Tt;_openedStream=this.openedChange.pipe(or(e=>e),kt(()=>{}));_closedStream=this.openedChange.pipe(or(e=>!e),kt(()=>{}));selectionChange=new Tt;valueChange=new Tt;constructor(){const e=Y(LT),n=Y(Cr,{optional:!0}),o=Y(gb,{optional:!0}),r=Y(new Mt("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),null!=this._defaultOptions?.typeaheadDebounceInterval&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new gM(e,this.ngControl,o,n,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=null==r?0:parseInt(r)||0,this.id=this.id}ngOnInit(){this._selectionModel=new GT(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(ro(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(ro(this._destroy)).subscribe(e=>{e.added.forEach(n=>n.select()),e.removed.forEach(n=>n.deselect())}),this.options.changes.pipe(ua(null),ro(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){const e=this._getTriggerAriaLabelledby(),n=this.ngControl;if(e!==this._triggerAriaLabelledBy){const o=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?o.setAttribute("aria-labelledby",e):o.removeAttribute("aria-labelledby")}n&&(this._previousControl!==n.control&&(void 0!==this._previousControl&&null!==n.disabled&&n.disabled!==this.disabled&&(this.disabled=n.disabled),this._previousControl=n.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe($a(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){const e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;const n=`${this.id}-panel`;this._trackedModal&&Fx(this._trackedModal,"aria-owns",n),vM(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){this._trackedModal&&(Fx(this._trackedModal,"aria-owns",`${this.id}-panel`),this._trackedModal=null)}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel)return void this._detachOverlay();this._cleanupDetach?.(),this._cleanupDetach=()=>{n(),clearTimeout(o),this._cleanupDetach=void 0};const e=this.panel.nativeElement,n=this._renderer.listen(e,"animationend",r=>{"_mat-select-exit"===r.animationName&&(this._cleanupDetach?.(),this._detachOverlay())}),o=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){const e=this._selectionModel.selected.map(n=>n.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return!!this._dir&&"rtl"===this._dir.value}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){const n=e.keyCode,o=40===n||38===n||37===n||39===n,r=13===n||32===n,u=this._keyManager;if(!u.isTyping()&&r&&!ns(e)||(this.multiple||e.altKey)&&o)e.preventDefault(),this.open();else if(!this.multiple){const y=this.selected;u.onKeydown(e);const I=this.selected;I&&y!==I&&this._liveAnnouncer.announce(I.viewValue,1e4)}}_handleOpenKeydown(e){const n=this._keyManager,o=e.keyCode,r=40===o||38===o,u=n.isTyping();if(r&&e.altKey)e.preventDefault(),this.close();else if(u||13!==o&&32!==o||!n.activeItem||ns(e))if(!u&&this._multiple&&65===o&&e.ctrlKey){e.preventDefault();const y=this.options.some(I=>!I.disabled&&!I.selected);this.options.forEach(I=>{I.disabled||(y?I.select():I.deselect())})}else{const y=n.activeItemIndex;n.onKeydown(e),this._multiple&&r&&e.shiftKey&&n.activeItem&&n.activeItemIndex!==y&&n.activeItem._selectViaInteraction()}else e.preventDefault(),n.activeItem._selectViaInteraction()}_handleOverlayKeydown(e){27===e.keyCode&&!ns(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(n=>n.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(n=>this._selectOptionByValue(n)),this._sortValues();else{const n=this._selectOptionByValue(e);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){const n=this.options.find(o=>{if(this._selectionModel.isSelected(o))return!1;try{return(null!=o.value||this.canSelectNullableOptions)&&this._compareWith(o.value,e)}catch{return!1}});return n&&this._selectionModel.select(n),n}_assignValue(e){return!!(e!==this._value||this._multiple&&Array.isArray(e))&&(this.options&&this._setSelectionByValue(e),this._value=e,!0)}_skipPredicate=e=>!this.panelOpen&&e.disabled;_getOverlayWidth(e){return"auto"===this.panelWidth?(e instanceof KE?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:null===this.panelWidth?"":this.panelWidth}_syncParentProperties(){if(this.options)for(const e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new _j(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){const e=va(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(ro(e)).subscribe(n=>{this._onSelect(n.source,n.isUserInput),n.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),va(...this.options.map(n=>n._stateChanges)).pipe(ro(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,n){const o=this._selectionModel.isSelected(e);this.canSelectNullableOptions||null!=e.value||this._multiple?(o!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),n&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),n&&this.focus())):(e.deselect(),this._selectionModel.clear(),null!=this.value&&this._propagateChanges(e.value)),o!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){const e=this.options.toArray();this._selectionModel.sort((n,o)=>this.sortComparator?this.sortComparator(n,o,e):e.indexOf(n)-e.indexOf(o)),this.stateChanges.next()}}_propagateChanges(e){let n;n=this.multiple?this.selected.map(o=>o.value):this.selected?this.selected.value:e,this._value=n,this.valueChange.emit(n),this._onChange(n),this.selectionChange.emit(this._getChangeEvent(n)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let n=0;n0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;const e=this._parentFormField?.getLabelId()||null;return this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-select"]],contentQueries:function(n,o,r){if(1&n&&(oo(r,dhe,5),oo(r,uc,5),oo(r,mL,5)),2&n){let u;Bt(u=Vt())&&(o.customTrigger=u.first),Bt(u=Vt())&&(o.options=u),Bt(u=Vt())&&(o.optionGroups=u)}},viewQuery:function(n,o){if(1&n&&(mn(Que,5),mn(Jue,5),mn(s8,5)),2&n){let r;Bt(r=Vt())&&(o.trigger=r.first),Bt(r=Vt())&&(o.panel=r.first),Bt(r=Vt())&&(o._overlayDir=r.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(n,o){1&n&&we("keydown",function(u){return o._handleKeydown(u)})("focus",function(){return o._onFocus()})("blur",function(){return o._onBlur()}),2&n&&(zn("id",o.id)("tabindex",o.disabled?-1:o.tabIndex)("aria-controls",o.panelOpen?o.id+"-panel":null)("aria-expanded",o.panelOpen)("aria-label",o.ariaLabel||null)("aria-required",o.required.toString())("aria-disabled",o.disabled.toString())("aria-invalid",o.errorState)("aria-activedescendant",o._getAriaActiveDescendant()),Hn("mat-mdc-select-disabled",o.disabled)("mat-mdc-select-invalid",o.errorState)("mat-mdc-select-required",o.required)("mat-mdc-select-empty",o.empty)("mat-mdc-select-multiple",o.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",fn],disableRipple:[2,"disableRipple","disableRipple",fn],tabIndex:[2,"tabIndex","tabIndex",e=>null==e?0:Ql(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",fn],placeholder:"placeholder",required:[2,"required","required",fn],multiple:[2,"multiple","multiple",fn],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",fn],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",Ql],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",fn]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Bn([{provide:PT,useExisting:t},{provide:pL,useExisting:t}]),go],ngContentSelectors:the,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(n,o){if(1&n){const r=pt();ho(ehe),w(0,"div",2,0),we("click",function(){return fe(r),ge(o.open())}),w(3,"div",3),te(4,nhe,2,1,"span",4)(5,rhe,3,1,"span",5),x(),w(6,"div",6)(7,"div",7),Va(),w(8,"svg",8),Re(9,"path",9),x()()()(),te(10,ahe,3,10,"ng-template",10),we("detach",function(){return fe(r),ge(o.close())})("backdropClick",function(){return fe(r),ge(o.close())})("overlayKeydown",function(y){return fe(r),ge(o._handleOverlayKeydown(y))})}if(2&n){const r=Vi(1);E(3),zn("id",o._valueId),E(),Xi(o.empty?4:5),E(6),N("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",o._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",o._scrollStrategy)("cdkConnectedOverlayOrigin",o._preferredOverlayOrigin||r)("cdkConnectedOverlayPositions",o._positions)("cdkConnectedOverlayWidth",o._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[KE,s8,$d],styles:['@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}\n'],encapsulation:2,changeDetection:0})}return t})(),Cj=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[che],imports:[Ib,HM,Ki,T_,bM,HM,Ki]})}return t})();function hhe(t,i){if(1&t&&(w(0,"mat-option",17),M(1),x()),2&t){const e=i.$implicit;N("value",e),E(),Jt(" ",e," ")}}function phe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",14)(1,"mat-select",16,0),we("selectionChange",function(o){return fe(e),ge(X(2)._changePageSize(o.value))}),Sv(3,hhe,2,2,"mat-option",17,iI),x(),w(5,"div",18),we("click",function(){return fe(e),ge(Vi(2).open())}),x()()}if(2&t){const e=X(2);N("appearance",e._formFieldAppearance)("color",e.color),E(),N("value",e.pageSize)("disabled",e.disabled)("aria-labelledby",e._pageSizeLabelId)("panelClass",e.selectConfig.panelClass||"")("disableOptionCentering",e.selectConfig.disableOptionCentering),E(2),Tv(e._displayedPageSizeOptions)}}function mhe(t,i){if(1&t&&(w(0,"div",15),M(1),x()),2&t){const e=X(2);E(),Ct(e.pageSize)}}function fhe(t,i){if(1&t&&(w(0,"div",3)(1,"div",13),M(2),x(),te(3,phe,6,7,"mat-form-field",14)(4,mhe,2,1,"div",15),x()),2&t){const e=X();E(),zn("id",e._pageSizeLabelId),E(),Jt(" ",e._intl.itemsPerPageLabel," "),E(),Xi(e._displayedPageSizeOptions.length>1?3:-1),E(),Xi(e._displayedPageSizeOptions.length<=1?4:-1)}}function _he(t,i){if(1&t){const e=pt();w(0,"button",19),we("click",function(){fe(e);const o=X();return ge(o._buttonClicked(0,o._previousButtonsDisabled()))}),Va(),w(1,"svg",8),Re(2,"path",20),x()()}if(2&t){const e=X();N("matTooltip",e._intl.firstPageLabel)("matTooltipDisabled",e._previousButtonsDisabled())("disabled",e._previousButtonsDisabled())("tabindex",e._previousButtonsDisabled()?-1:null),zn("aria-label",e._intl.firstPageLabel)}}function ghe(t,i){if(1&t){const e=pt();w(0,"button",21),we("click",function(){fe(e);const o=X();return ge(o._buttonClicked(o.getNumberOfPages()-1,o._nextButtonsDisabled()))}),Va(),w(1,"svg",8),Re(2,"path",22),x()()}if(2&t){const e=X();N("matTooltip",e._intl.lastPageLabel)("matTooltipDisabled",e._nextButtonsDisabled())("disabled",e._nextButtonsDisabled())("tabindex",e._nextButtonsDisabled()?-1:null),zn("aria-label",e._intl.lastPageLabel)}}let Xd=(()=>{class t{changes=new Ee;itemsPerPageLabel="Items per page:";nextPageLabel="Next page";previousPageLabel="Previous page";firstPageLabel="First page";lastPageLabel="Last page";getRangeLabel=(e,n,o)=>{if(0==o||0==n)return`0 of ${o}`;const r=e*n;return`${r+1} \u2013 ${r<(o=Math.max(o,0))?Math.min(r+n,o):r+n} of ${o}`};static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const yhe={provide:Xd,deps:[[new oc,new _l,Xd]],useFactory:function bhe(t){return t||new Xd}},xhe=new yt("MAT_PAGINATOR_DEFAULT_OPTIONS");let kr=(()=>{class t{_intl=Y(Xd);_changeDetectorRef=Y(So);_formFieldAppearance;_pageSizeLabelId=Y(ta).getId("mat-paginator-page-size-label-");_intlChanges;_isInitialized=!1;_initializedStream=new XP(1);color;get pageIndex(){return this._pageIndex}set pageIndex(e){this._pageIndex=Math.max(e||0,0),this._changeDetectorRef.markForCheck()}_pageIndex=0;get length(){return this._length}set length(e){this._length=e||0,this._changeDetectorRef.markForCheck()}_length=0;get pageSize(){return this._pageSize}set pageSize(e){this._pageSize=Math.max(e||0,0),this._updateDisplayedPageSizeOptions()}_pageSize;get pageSizeOptions(){return this._pageSizeOptions}set pageSizeOptions(e){this._pageSizeOptions=(e||[]).map(n=>Ql(n,0)),this._updateDisplayedPageSizeOptions()}_pageSizeOptions=[];hidePageSize=!1;showFirstLastButtons=!1;selectConfig={};disabled=!1;page=new Tt;_displayedPageSizeOptions;initialized=this._initializedStream;constructor(){const e=this._intl,n=Y(xhe,{optional:!0});if(this._intlChanges=e.changes.subscribe(()=>this._changeDetectorRef.markForCheck()),n){const{pageSize:o,pageSizeOptions:r,hidePageSize:u,showFirstLastButtons:y}=n;null!=o&&(this._pageSize=o),null!=r&&(this._pageSizeOptions=r),null!=u&&(this.hidePageSize=u),null!=y&&(this.showFirstLastButtons=y)}this._formFieldAppearance=n?.formFieldAppearance||"outline"}ngOnInit(){this._isInitialized=!0,this._updateDisplayedPageSizeOptions(),this._initializedStream.next()}ngOnDestroy(){this._initializedStream.complete(),this._intlChanges.unsubscribe()}nextPage(){this.hasNextPage()&&this._navigate(this.pageIndex+1)}previousPage(){this.hasPreviousPage()&&this._navigate(this.pageIndex-1)}firstPage(){this.hasPreviousPage()&&this._navigate(0)}lastPage(){this.hasNextPage()&&this._navigate(this.getNumberOfPages()-1)}hasPreviousPage(){return this.pageIndex>=1&&0!=this.pageSize}hasNextPage(){const e=this.getNumberOfPages()-1;return this.pageIndexe-n),this._changeDetectorRef.markForCheck())}_emitPageEvent(e){this.page.emit({previousPageIndex:e,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})}_navigate(e){const n=this.pageIndex;e!==n&&(this.pageIndex=e,this._emitPageEvent(n))}_buttonClicked(e,n){n||this._navigate(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-paginator"]],hostAttrs:["role","group",1,"mat-mdc-paginator"],inputs:{color:"color",pageIndex:[2,"pageIndex","pageIndex",Ql],length:[2,"length","length",Ql],pageSize:[2,"pageSize","pageSize",Ql],pageSizeOptions:"pageSizeOptions",hidePageSize:[2,"hidePageSize","hidePageSize",fn],showFirstLastButtons:[2,"showFirstLastButtons","showFirstLastButtons",fn],selectConfig:"selectConfig",disabled:[2,"disabled","disabled",fn]},outputs:{page:"page"},exportAs:["matPaginator"],decls:14,vars:14,consts:[["selectRef",""],[1,"mat-mdc-paginator-outer-container"],[1,"mat-mdc-paginator-container"],[1,"mat-mdc-paginator-page-size"],[1,"mat-mdc-paginator-range-actions"],["aria-live","polite",1,"mat-mdc-paginator-range-label"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-previous",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true",1,"mat-mdc-paginator-icon"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-next",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"matTooltip","matTooltipDisabled","disabled","tabindex"],[1,"mat-mdc-paginator-page-size-label"],[1,"mat-mdc-paginator-page-size-select",3,"appearance","color"],[1,"mat-mdc-paginator-page-size-value"],["hideSingleSelectionIndicator","",3,"selectionChange","value","disabled","aria-labelledby","panelClass","disableOptionCentering"],[3,"value"],[1,"mat-mdc-paginator-touch-target",3,"click"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-first",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"],["mat-icon-button","","type","button","matTooltipPosition","above","disabledInteractive","",1,"mat-mdc-paginator-navigation-last",3,"click","matTooltip","matTooltipDisabled","disabled","tabindex"],["d","M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"]],template:function(n,o){1&n&&(w(0,"div",1)(1,"div",2),te(2,fhe,5,4,"div",3),w(3,"div",4)(4,"div",5),M(5),x(),te(6,_he,3,5,"button",6),w(7,"button",7),we("click",function(){return o._buttonClicked(o.pageIndex-1,o._previousButtonsDisabled())}),Va(),w(8,"svg",8),Re(9,"path",9),x()(),cu(),w(10,"button",10),we("click",function(){return o._buttonClicked(o.pageIndex+1,o._nextButtonsDisabled())}),Va(),w(11,"svg",8),Re(12,"path",11),x()(),te(13,ghe,3,5,"button",12),x()()()),2&n&&(E(2),Xi(o.hidePageSize?-1:2),E(3),Jt(" ",o._intl.getRangeLabel(o.pageIndex,o.pageSize,o.length)," "),E(),Xi(o.showFirstLastButtons?6:-1),E(),N("matTooltip",o._intl.previousPageLabel)("matTooltipDisabled",o._previousButtonsDisabled())("disabled",o._previousButtonsDisabled())("tabindex",o._previousButtonsDisabled()?-1:null),zn("aria-label",o._intl.previousPageLabel),E(3),N("matTooltip",o._intl.nextPageLabel)("matTooltipDisabled",o._nextButtonsDisabled())("disabled",o._nextButtonsDisabled())("tabindex",o._nextButtonsDisabled()?-1:null),zn("aria-label",o._intl.nextPageLabel),E(3),Xi(o.showFirstLastButtons?13:-1))},dependencies:[na,nh,uc,qa,Pa],styles:[".mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height:var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding:var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:84px}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:84px;height:48px;background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}\n"],encapsulation:2,changeDetection:0})}return t})(),whe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[yhe],imports:[uM,Cj,AH,kr]})}return t})();const fL=["*"];function Che(t,i){1&t&&On(0)}const She=["tabListContainer"],The=["tabList"],Dhe=["tabListInner"],Ihe=["nextPaginator"],Ehe=["previousPaginator"],Mhe=["content"];function Ahe(t,i){}const khe=["tabBodyWrapper"],Rhe=["tabHeader"];function Ohe(t,i){}function Phe(t,i){1&t&&te(0,Ohe,0,0,"ng-template",12),2&t&&N("cdkPortalOutlet",X().$implicit.templateLabel)}function Lhe(t,i){1&t&&M(0),2&t&&Ct(X().$implicit.textLabel)}function Fhe(t,i){if(1&t){const e=pt();w(0,"div",7,2),we("click",function(){const o=fe(e),r=o.$implicit,u=o.$index,y=X(),I=Vi(1);return ge(y._handleClick(r,I,u))})("cdkFocusChange",function(o){const r=fe(e).$index;return ge(X()._tabFocusChanged(o,r))}),Re(2,"span",8)(3,"div",9),w(4,"span",10)(5,"span",11),te(6,Phe,1,1,null,12)(7,Lhe,1,1),x()()()}if(2&t){const e=i.$implicit,n=i.$index,o=Vi(1),r=X();bs(e.labelClass),Hn("mdc-tab--active",r.selectedIndex===n),N("id",r._getTabLabelId(e,n))("disabled",e.disabled)("fitInkBarToContent",r.fitInkBarToContent),zn("tabIndex",r._getTabIndex(n))("aria-posinset",n+1)("aria-setsize",r._tabs.length)("aria-controls",r._getTabContentId(n))("aria-selected",r.selectedIndex===n)("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null),E(3),N("matRippleTrigger",o)("matRippleDisabled",e.disabled||r.disableRipple),E(3),Xi(e.templateLabel?6:7)}}function Nhe(t,i){1&t&&On(0)}function zhe(t,i){if(1&t){const e=pt();w(0,"mat-tab-body",13),we("_onCentered",function(){return fe(e),ge(X()._removeTabBodyWrapperHeight())})("_onCentering",function(o){return fe(e),ge(X()._setTabBodyWrapperHeight(o))})("_beforeCentering",function(o){return fe(e),ge(X()._bodyCentered(o))}),x()}if(2&t){const e=i.$implicit,n=i.$index,o=X();bs(e.bodyClass),N("id",o._getTabContentId(n))("content",e.content)("position",e.position)("animationDuration",o.animationDuration)("preserveContent",o.preserveContent),zn("tabindex",null!=o.contentTabIndex&&o.selectedIndex===n?o.contentTabIndex:null)("aria-labelledby",o._getTabLabelId(e,n))("aria-hidden",o.selectedIndex!==n)}}const Bhe=new yt("MatTabContent");let jM=(()=>{class t{template=Y(sa);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matTabContent",""]],features:[Bn([{provide:Bhe,useExisting:t}])]})}return t})();const Vhe=new yt("MatTabLabel"),Sj=new yt("MAT_TAB");let Tj=(()=>{class t extends yre{_closestTab=Y(Sj,{optional:!0});static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","mat-tab-label",""],["","matTabLabel",""]],features:[Bn([{provide:Vhe,useExisting:t}]),qn]})}return t})();const Dj=new yt("MAT_TAB_GROUP");let Ob=(()=>{class t{_viewContainerRef=Y(es);_closestTabGroup=Y(Dj,{optional:!0});disabled=!1;get templateLabel(){return this._templateLabel}set templateLabel(e){this._setTemplateLabelInput(e)}_templateLabel;_explicitContent=void 0;_implicitContent;textLabel="";ariaLabel;ariaLabelledby;labelClass;bodyClass;id=null;_contentPortal=null;get content(){return this._contentPortal}_stateChanges=new Ee;position=null;origin=null;isActive=!1;constructor(){Y(Rs).load(wu)}ngOnChanges(e){(e.hasOwnProperty("textLabel")||e.hasOwnProperty("disabled"))&&this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}ngOnInit(){this._contentPortal=new C_(this._explicitContent||this._implicitContent,this._viewContainerRef)}_setTemplateLabelInput(e){e&&e._closestTab===this&&(this._templateLabel=e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-tab"]],contentQueries:function(n,o,r){if(1&n&&(oo(r,Tj,5),oo(r,jM,7,sa)),2&n){let u;Bt(u=Vt())&&(o.templateLabel=u.first),Bt(u=Vt())&&(o._explicitContent=u.first)}},viewQuery:function(n,o){if(1&n&&mn(sa,7),2&n){let r;Bt(r=Vt())&&(o._implicitContent=r.first)}},hostAttrs:["hidden",""],hostVars:1,hostBindings:function(n,o){2&n&&zn("id",null)},inputs:{disabled:[2,"disabled","disabled",fn],textLabel:[0,"label","textLabel"],ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],labelClass:"labelClass",bodyClass:"bodyClass",id:"id"},exportAs:["matTab"],features:[Bn([{provide:Sj,useExisting:t}]),go],ngContentSelectors:fL,decls:1,vars:0,template:function(n,o){1&n&&(ho(),te(0,Che,1,0,"ng-template"))},encapsulation:2})}return t})();const _L="mdc-tab-indicator--active",Ij="mdc-tab-indicator--no-transition";class Uhe{_items;_currentItem;constructor(i){this._items=i}hide(){this._items.forEach(i=>i.deactivateInkBar()),this._currentItem=void 0}alignToElement(i){const e=this._items.find(o=>o.elementRef.nativeElement===i),n=this._currentItem;if(e!==n&&(n?.deactivateInkBar(),e)){const o=n?.elementRef.nativeElement.getBoundingClientRect?.();e.activateInkBar(o),this._currentItem=e}}}let Hhe=(()=>{class t{_elementRef=Y(Pn);_inkBarElement;_inkBarContentElement;_fitToContent=!1;get fitInkBarToContent(){return this._fitToContent}set fitInkBarToContent(e){this._fitToContent!==e&&(this._fitToContent=e,this._inkBarElement&&this._appendInkBarElement())}activateInkBar(e){const n=this._elementRef.nativeElement;if(!e||!n.getBoundingClientRect||!this._inkBarContentElement)return void n.classList.add(_L);const o=n.getBoundingClientRect(),r=e.width/o.width,u=e.left-o.left;n.classList.add(Ij),this._inkBarContentElement.style.setProperty("transform",`translateX(${u}px) scaleX(${r})`),n.getBoundingClientRect(),n.classList.remove(Ij),n.classList.add(_L),this._inkBarContentElement.style.setProperty("transform","")}deactivateInkBar(){this._elementRef.nativeElement.classList.remove(_L)}ngOnInit(){this._createInkBarElement()}ngOnDestroy(){this._inkBarElement?.remove(),this._inkBarElement=this._inkBarContentElement=null}_createInkBarElement(){const e=this._elementRef.nativeElement.ownerDocument||document,n=this._inkBarElement=e.createElement("span"),o=this._inkBarContentElement=e.createElement("span");n.className="mdc-tab-indicator",o.className="mdc-tab-indicator__content mdc-tab-indicator__content--underline",n.appendChild(this._inkBarContentElement),this._appendInkBarElement()}_appendInkBarElement(){(this._fitToContent?this._elementRef.nativeElement.querySelector(".mdc-tab__content"):this._elementRef.nativeElement).appendChild(this._inkBarElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{fitInkBarToContent:[2,"fitInkBarToContent","fitInkBarToContent",fn]}})}return t})(),Ej=(()=>{class t extends Hhe{elementRef=Y(Pn);disabled=!1;focus(){this.elementRef.nativeElement.focus()}getOffsetLeft(){return this.elementRef.nativeElement.offsetLeft}getOffsetWidth(){return this.elementRef.nativeElement.offsetWidth}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matTabLabelWrapper",""]],hostVars:3,hostBindings:function(n,o){2&n&&(zn("aria-disabled",!!o.disabled),Hn("mat-mdc-tab-disabled",o.disabled))},inputs:{disabled:[2,"disabled","disabled",fn]},features:[qn]})}return t})();const Mj={passive:!0};let qhe=(()=>{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_viewportRuler=Y(Kv);_dir=Y(ul,{optional:!0});_ngZone=Y(tn);_platform=Y(ea);_sharedResizeObserver=Y(eH);_injector=Y(Ke);_renderer=Y(Hr);_animationMode=Y(Kr,{optional:!0});_eventCleanups;_scrollDistance=0;_selectedIndexChanged=!1;_destroyed=new Ee;_showPaginationControls=!1;_disableScrollAfter=!0;_disableScrollBefore=!0;_tabLabelCount;_scrollDistanceChanged;_keyManager;_currentTextContent;_stopScrolling=new Ee;disablePagination=!1;get selectedIndex(){return this._selectedIndex}set selectedIndex(e){const n=isNaN(e)?0:e;this._selectedIndex!=n&&(this._selectedIndexChanged=!0,this._selectedIndex=n,this._keyManager&&this._keyManager.updateActiveItem(n))}_selectedIndex=0;selectFocusedIndex=new Tt;indexFocused=new Tt;constructor(){this._eventCleanups=this._ngZone.runOutsideAngular(()=>[this._renderer.listen(this._elementRef.nativeElement,"mouseleave",()=>this._stopInterval())])}ngAfterViewInit(){this._eventCleanups.push(ec(this._renderer,this._previousPaginator.nativeElement,"touchstart",()=>this._handlePaginatorPress("before"),Mj),ec(this._renderer,this._nextPaginator.nativeElement,"touchstart",()=>this._handlePaginatorPress("after"),Mj))}ngAfterContentInit(){const e=this._dir?this._dir.change:xi("ltr"),n=this._sharedResizeObserver.observe(this._elementRef.nativeElement).pipe(Tb(32),ro(this._destroyed)),o=this._viewportRuler.change(150).pipe(ro(this._destroyed)),r=()=>{this.updatePagination(),this._alignInkBarToSelectedTab()};this._keyManager=new FT(this._items).withHorizontalOrientation(this._getLayoutDirection()).withHomeAndEnd().withWrap().skipPredicate(()=>!1),this._keyManager.updateActiveItem(Math.max(this._selectedIndex,0)),As(r,{injector:this._injector}),va(e,o,n,this._items.changes,this._itemsResized()).pipe(ro(this._destroyed)).subscribe(()=>{this._ngZone.run(()=>{Promise.resolve().then(()=>{this._scrollDistance=Math.max(0,Math.min(this._getMaxScrollDistance(),this._scrollDistance)),r()})}),this._keyManager?.withHorizontalOrientation(this._getLayoutDirection())}),this._keyManager.change.subscribe(u=>{this.indexFocused.emit(u),this._setTabFocus(u)})}_itemsResized(){return"function"!=typeof ResizeObserver?Dc:this._items.changes.pipe(ua(this._items),Xs(e=>new se(n=>this._ngZone.runOutsideAngular(()=>{const o=new ResizeObserver(r=>n.next(r));return e.forEach(r=>o.observe(r.elementRef.nativeElement)),()=>{o.disconnect()}}))),t3(1),or(e=>e.some(n=>n.contentRect.width>0&&n.contentRect.height>0)))}ngAfterContentChecked(){this._tabLabelCount!=this._items.length&&(this.updatePagination(),this._tabLabelCount=this._items.length,this._changeDetectorRef.markForCheck()),this._selectedIndexChanged&&(this._scrollToLabel(this._selectedIndex),this._checkScrollingControls(),this._alignInkBarToSelectedTab(),this._selectedIndexChanged=!1,this._changeDetectorRef.markForCheck()),this._scrollDistanceChanged&&(this._updateTabScrollPosition(),this._scrollDistanceChanged=!1,this._changeDetectorRef.markForCheck())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._keyManager?.destroy(),this._destroyed.next(),this._destroyed.complete(),this._stopScrolling.complete()}_handleKeydown(e){if(!ns(e))switch(e.keyCode){case 13:case 32:if(this.focusIndex!==this.selectedIndex){const n=this._items.get(this.focusIndex);n&&!n.disabled&&(this.selectFocusedIndex.emit(this.focusIndex),this._itemSelected(e))}break;default:this._keyManager?.onKeydown(e)}}_onContentChanges(){const e=this._elementRef.nativeElement.textContent;e!==this._currentTextContent&&(this._currentTextContent=e||"",this._ngZone.run(()=>{this.updatePagination(),this._alignInkBarToSelectedTab(),this._changeDetectorRef.markForCheck()}))}updatePagination(){this._checkPaginationEnabled(),this._checkScrollingControls(),this._updateTabScrollPosition()}get focusIndex(){return this._keyManager?this._keyManager.activeItemIndex:0}set focusIndex(e){!this._isValidIndex(e)||this.focusIndex===e||!this._keyManager||this._keyManager.setActiveItem(e)}_isValidIndex(e){return!this._items||!!this._items.toArray()[e]}_setTabFocus(e){if(this._showPaginationControls&&this._scrollToLabel(e),this._items&&this._items.length){this._items.toArray()[e].focus();const n=this._tabListContainer.nativeElement;n.scrollLeft="ltr"==this._getLayoutDirection()?0:n.scrollWidth-n.offsetWidth}}_getLayoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_updateTabScrollPosition(){if(this.disablePagination)return;const e=this.scrollDistance,n="ltr"===this._getLayoutDirection()?-e:e;this._tabList.nativeElement.style.transform=`translateX(${Math.round(n)}px)`,(this._platform.TRIDENT||this._platform.EDGE)&&(this._tabListContainer.nativeElement.scrollLeft=0)}get scrollDistance(){return this._scrollDistance}set scrollDistance(e){this._scrollTo(e)}_scrollHeader(e){return this._scrollTo(this._scrollDistance+("before"==e?-1:1)*this._tabListContainer.nativeElement.offsetWidth/3)}_handlePaginatorClick(e){this._stopInterval(),this._scrollHeader(e)}_scrollToLabel(e){if(this.disablePagination)return;const n=this._items?this._items.toArray()[e]:null;if(!n)return;const o=this._tabListContainer.nativeElement.offsetWidth,{offsetLeft:r,offsetWidth:u}=n.elementRef.nativeElement;let y,I;"ltr"==this._getLayoutDirection()?(y=r,I=y+u):(I=this._tabListInner.nativeElement.offsetWidth-r,y=I-u);const V=this.scrollDistance,q=this.scrollDistance+o;yq&&(this.scrollDistance+=Math.min(I-q,y-V))}_checkPaginationEnabled(){if(this.disablePagination)this._showPaginationControls=!1;else{const o=this._tabListInner.nativeElement.scrollWidth-this._elementRef.nativeElement.offsetWidth>=5;o||(this.scrollDistance=0),o!==this._showPaginationControls&&(this._showPaginationControls=o,this._changeDetectorRef.markForCheck())}}_checkScrollingControls(){this.disablePagination?this._disableScrollAfter=this._disableScrollBefore=!0:(this._disableScrollBefore=0==this.scrollDistance,this._disableScrollAfter=this.scrollDistance==this._getMaxScrollDistance(),this._changeDetectorRef.markForCheck())}_getMaxScrollDistance(){return this._tabListInner.nativeElement.scrollWidth-this._tabListContainer.nativeElement.offsetWidth||0}_alignInkBarToSelectedTab(){const e=this._items&&this._items.length?this._items.toArray()[this.selectedIndex]:null,n=e?e.elementRef.nativeElement:null;n?this._inkBar.alignToElement(n):this._inkBar.hide()}_stopInterval(){this._stopScrolling.next()}_handlePaginatorPress(e,n){n&&null!=n.button&&0!==n.button||(this._stopInterval(),wb(650,100).pipe(ro(va(this._stopScrolling,this._destroyed))).subscribe(()=>{const{maxScrollDistance:o,distance:r}=this._scrollHeader(e);(0===r||r>=o)&&this._stopInterval()}))}_scrollTo(e){if(this.disablePagination)return{maxScrollDistance:0,distance:0};const n=this._getMaxScrollDistance();return this._scrollDistance=Math.max(0,Math.min(n,e)),this._scrollDistanceChanged=!0,this._checkScrollingControls(),{maxScrollDistance:n,distance:this._scrollDistance}}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{disablePagination:[2,"disablePagination","disablePagination",fn],selectedIndex:[2,"selectedIndex","selectedIndex",Ql]},outputs:{selectFocusedIndex:"selectFocusedIndex",indexFocused:"indexFocused"}})}return t})(),Whe=(()=>{class t extends qhe{_items;_tabListContainer;_tabList;_tabListInner;_nextPaginator;_previousPaginator;_inkBar;ariaLabel;ariaLabelledby;disableRipple=!1;ngAfterContentInit(){this._inkBar=new Uhe(this._items),super.ngAfterContentInit()}_itemSelected(e){e.preventDefault()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-tab-header"]],contentQueries:function(n,o,r){if(1&n&&oo(r,Ej,4),2&n){let u;Bt(u=Vt())&&(o._items=u)}},viewQuery:function(n,o){if(1&n&&(mn(She,7),mn(The,7),mn(Dhe,7),mn(Ihe,5),mn(Ehe,5)),2&n){let r;Bt(r=Vt())&&(o._tabListContainer=r.first),Bt(r=Vt())&&(o._tabList=r.first),Bt(r=Vt())&&(o._tabListInner=r.first),Bt(r=Vt())&&(o._nextPaginator=r.first),Bt(r=Vt())&&(o._previousPaginator=r.first)}},hostAttrs:[1,"mat-mdc-tab-header"],hostVars:4,hostBindings:function(n,o){2&n&&Hn("mat-mdc-tab-header-pagination-controls-enabled",o._showPaginationControls)("mat-mdc-tab-header-rtl","rtl"==o._getLayoutDirection())},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],disableRipple:[2,"disableRipple","disableRipple",fn]},features:[qn],ngContentSelectors:fL,decls:13,vars:10,consts:[["previousPaginator",""],["tabListContainer",""],["tabList",""],["tabListInner",""],["nextPaginator",""],["mat-ripple","",1,"mat-mdc-tab-header-pagination","mat-mdc-tab-header-pagination-before",3,"click","mousedown","touchend","matRippleDisabled"],[1,"mat-mdc-tab-header-pagination-chevron"],[1,"mat-mdc-tab-label-container",3,"keydown"],["role","tablist",1,"mat-mdc-tab-list",3,"cdkObserveContent"],[1,"mat-mdc-tab-labels"],["mat-ripple","",1,"mat-mdc-tab-header-pagination","mat-mdc-tab-header-pagination-after",3,"mousedown","click","touchend","matRippleDisabled"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"div",5,0),we("click",function(){return fe(r),ge(o._handlePaginatorClick("before"))})("mousedown",function(y){return fe(r),ge(o._handlePaginatorPress("before",y))})("touchend",function(){return fe(r),ge(o._stopInterval())}),Re(2,"div",6),x(),w(3,"div",7,1),we("keydown",function(y){return fe(r),ge(o._handleKeydown(y))}),w(5,"div",8,2),we("cdkObserveContent",function(){return fe(r),ge(o._onContentChanges())}),w(7,"div",9,3),On(9),x()()(),w(10,"div",10,4),we("mousedown",function(y){return fe(r),ge(o._handlePaginatorPress("after",y))})("click",function(){return fe(r),ge(o._handlePaginatorClick("after"))})("touchend",function(){return fe(r),ge(o._stopInterval())}),Re(12,"div",6),x()}2&n&&(Hn("mat-mdc-tab-header-pagination-disabled",o._disableScrollBefore),N("matRippleDisabled",o._disableScrollBefore||o.disableRipple),E(3),Hn("_mat-animation-noopable","NoopAnimations"===o._animationMode),E(2),zn("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby||null),E(5),Hn("mat-mdc-tab-header-pagination-disabled",o._disableScrollAfter),N("matRippleDisabled",o._disableScrollAfter||o.disableRipple))},dependencies:[Mb,n3],styles:[".mat-mdc-tab-header{display:flex;overflow:hidden;position:relative;flex-shrink:0}.mdc-tab-indicator .mdc-tab-indicator__content{transition-duration:var(--mat-tab-animation-duration, 250ms)}.mat-mdc-tab-header-pagination{-webkit-user-select:none;user-select:none;position:relative;display:none;justify-content:center;align-items:center;min-width:32px;cursor:pointer;z-index:2;-webkit-tap-highlight-color:rgba(0,0,0,0);touch-action:none;box-sizing:content-box;outline:0}.mat-mdc-tab-header-pagination::-moz-focus-inner{border:0}.mat-mdc-tab-header-pagination .mat-ripple-element{opacity:.12;background-color:var(--mat-tab-header-inactive-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-tab-header-pagination-controls-enabled .mat-mdc-tab-header-pagination{display:flex}.mat-mdc-tab-header-pagination-before,.mat-mdc-tab-header-rtl .mat-mdc-tab-header-pagination-after{padding-left:4px}.mat-mdc-tab-header-pagination-before .mat-mdc-tab-header-pagination-chevron,.mat-mdc-tab-header-rtl .mat-mdc-tab-header-pagination-after .mat-mdc-tab-header-pagination-chevron{transform:rotate(-135deg)}.mat-mdc-tab-header-rtl .mat-mdc-tab-header-pagination-before,.mat-mdc-tab-header-pagination-after{padding-right:4px}.mat-mdc-tab-header-rtl .mat-mdc-tab-header-pagination-before .mat-mdc-tab-header-pagination-chevron,.mat-mdc-tab-header-pagination-after .mat-mdc-tab-header-pagination-chevron{transform:rotate(45deg)}.mat-mdc-tab-header-pagination-chevron{border-style:solid;border-width:2px 2px 0 0;height:8px;width:8px;border-color:var(--mat-tab-header-pagination-icon-color, var(--mat-sys-on-surface))}.mat-mdc-tab-header-pagination-disabled{box-shadow:none;cursor:default;pointer-events:none}.mat-mdc-tab-header-pagination-disabled .mat-mdc-tab-header-pagination-chevron{opacity:.4}.mat-mdc-tab-list{flex-grow:1;position:relative;transition:transform 500ms cubic-bezier(0.35, 0, 0.25, 1)}._mat-animation-noopable .mat-mdc-tab-list{transition:none}.mat-mdc-tab-label-container{display:flex;flex-grow:1;overflow:hidden;z-index:1;border-bottom-style:solid;border-bottom-width:var(--mat-tab-header-divider-height, 1px);border-bottom-color:var(--mat-tab-header-divider-color, var(--mat-sys-surface-variant))}.mat-mdc-tab-group-inverted-header .mat-mdc-tab-label-container{border-bottom:none;border-top-style:solid;border-top-width:var(--mat-tab-header-divider-height, 1px);border-top-color:var(--mat-tab-header-divider-color, var(--mat-sys-surface-variant))}.mat-mdc-tab-labels{display:flex;flex:1 0 auto}[mat-align-tabs=center]>.mat-mdc-tab-header .mat-mdc-tab-labels{justify-content:center}[mat-align-tabs=end]>.mat-mdc-tab-header .mat-mdc-tab-labels{justify-content:flex-end}.cdk-drop-list .mat-mdc-tab-labels,.mat-mdc-tab-labels.cdk-drop-list{min-height:var(--mdc-secondary-navigation-tab-container-height, 48px)}.mat-mdc-tab::before{margin:5px}@media(forced-colors: active){.mat-mdc-tab[aria-disabled=true]{color:GrayText}}\n"],encapsulation:2})}return t})();const Zhe=new yt("MAT_TABS_CONFIG");let Aj=(()=>{class t extends ef{_host=Y($M);_centeringSub=ai.EMPTY;_leavingSub=ai.EMPTY;constructor(){super()}ngOnInit(){super.ngOnInit(),this._centeringSub=this._host._beforeCentering.pipe(ua(this._host._isCenterPosition())).subscribe(e=>{this._host._content&&e&&!this.hasAttached()&&this.attach(this._host._content)}),this._leavingSub=this._host._afterLeavingCenter.subscribe(()=>{this._host.preserveContent||this.detach()})}ngOnDestroy(){super.ngOnDestroy(),this._centeringSub.unsubscribe(),this._leavingSub.unsubscribe()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matTabBodyHost",""]],features:[qn]})}return t})(),$M=(()=>{class t{_elementRef=Y(Pn);_dir=Y(ul,{optional:!0});_ngZone=Y(tn);_injector=Y(Ke);_renderer=Y(Hr);_animationsModule=Y(Kr,{optional:!0});_eventCleanups;_initialized;_fallbackTimer;_positionIndex;_dirChangeSubscription=ai.EMPTY;_position;_previousPosition;_onCentering=new Tt;_beforeCentering=new Tt;_afterLeavingCenter=new Tt;_onCentered=new Tt(!0);_portalHost;_contentElement;_content;animationDuration="500ms";preserveContent=!1;set position(e){this._positionIndex=e,this._computePositionAnimationState()}constructor(){if(this._dir){const e=Y(So);this._dirChangeSubscription=this._dir.change.subscribe(n=>{this._computePositionAnimationState(n),e.markForCheck()})}}ngOnInit(){this._bindTransitionEvents(),"center"===this._position&&(this._setActiveClass(!0),As(()=>this._onCentering.emit(this._elementRef.nativeElement.clientHeight),{injector:this._injector})),this._initialized=!0}ngOnDestroy(){clearTimeout(this._fallbackTimer),this._eventCleanups?.forEach(e=>e()),this._dirChangeSubscription.unsubscribe()}_bindTransitionEvents(){this._ngZone.runOutsideAngular(()=>{const e=this._elementRef.nativeElement,n=o=>{o.target===this._contentElement?.nativeElement&&(this._elementRef.nativeElement.classList.remove("mat-tab-body-animating"),"transitionend"===o.type&&this._transitionDone())};this._eventCleanups=[this._renderer.listen(e,"transitionstart",o=>{o.target===this._contentElement?.nativeElement&&(this._elementRef.nativeElement.classList.add("mat-tab-body-animating"),this._transitionStarted())}),this._renderer.listen(e,"transitionend",n),this._renderer.listen(e,"transitioncancel",n)]})}_transitionStarted(){clearTimeout(this._fallbackTimer);const e="center"===this._position;this._beforeCentering.emit(e),e&&this._onCentering.emit(this._elementRef.nativeElement.clientHeight)}_transitionDone(){"center"===this._position?this._onCentered.emit():"center"===this._previousPosition&&this._afterLeavingCenter.emit()}_setActiveClass(e){this._elementRef.nativeElement.classList.toggle("mat-mdc-tab-body-active",e)}_getLayoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_isCenterPosition(){return 0===this._positionIndex}_computePositionAnimationState(e=this._getLayoutDirection()){this._previousPosition=this._position,this._position=this._positionIndex<0?"ltr"==e?"left":"right":this._positionIndex>0?"ltr"==e?"right":"left":"center",this._animationsDisabled()?this._simulateTransitionEvents():this._initialized&&("center"===this._position||"center"===this._previousPosition)&&(clearTimeout(this._fallbackTimer),this._fallbackTimer=this._ngZone.runOutsideAngular(()=>setTimeout(()=>this._simulateTransitionEvents(),100)))}_simulateTransitionEvents(){this._transitionStarted(),As(()=>this._transitionDone(),{injector:this._injector})}_animationsDisabled(){return"NoopAnimations"===this._animationsModule||"0ms"===this.animationDuration||"0s"===this.animationDuration}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-tab-body"]],viewQuery:function(n,o){if(1&n&&(mn(Aj,5),mn(Mhe,5)),2&n){let r;Bt(r=Vt())&&(o._portalHost=r.first),Bt(r=Vt())&&(o._contentElement=r.first)}},hostAttrs:[1,"mat-mdc-tab-body"],hostVars:1,hostBindings:function(n,o){2&n&&zn("inert","center"===o._position?null:"")},inputs:{_content:[0,"content","_content"],animationDuration:"animationDuration",preserveContent:"preserveContent",position:"position"},outputs:{_onCentering:"_onCentering",_beforeCentering:"_beforeCentering",_onCentered:"_onCentered"},decls:3,vars:6,consts:[["content",""],["cdkScrollable","",1,"mat-mdc-tab-body-content"],["matTabBodyHost",""]],template:function(n,o){1&n&&(w(0,"div",1,0),te(2,Ahe,0,0,"ng-template",2),x()),2&n&&Hn("mat-tab-body-content-left","left"===o._position)("mat-tab-body-content-right","right"===o._position)("mat-tab-body-content-can-animate","center"===o._position||"center"===o._previousPosition)},dependencies:[Aj,Xv],styles:[".mat-mdc-tab-body{top:0;left:0;right:0;bottom:0;position:absolute;display:block;overflow:hidden;outline:0;flex-basis:100%}.mat-mdc-tab-body.mat-mdc-tab-body-active{position:relative;overflow-x:hidden;overflow-y:auto;z-index:1;flex-grow:1}.mat-mdc-tab-group.mat-mdc-tab-group-dynamic-height .mat-mdc-tab-body.mat-mdc-tab-body-active{overflow-y:hidden}.mat-mdc-tab-body-content{height:100%;overflow:auto;transform:none;visibility:hidden}.mat-tab-body-animating>.mat-mdc-tab-body-content,.mat-mdc-tab-body-active>.mat-mdc-tab-body-content{visibility:visible}.mat-mdc-tab-group-dynamic-height .mat-mdc-tab-body-content{overflow:hidden}.mat-tab-body-content-can-animate{transition:transform var(--mat-tab-animation-duration) 1ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-mdc-tab-body-wrapper._mat-animation-noopable .mat-tab-body-content-can-animate{transition:none}.mat-tab-body-content-left{transform:translate3d(-100%, 0, 0)}.mat-tab-body-content-right{transform:translate3d(100%, 0, 0)}\n"],encapsulation:2})}return t})(),L_=(()=>{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_ngZone=Y(tn);_tabsSubscription=ai.EMPTY;_tabLabelSubscription=ai.EMPTY;_tabBodySubscription=ai.EMPTY;_diAnimationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});_allTabs;_tabBodies;_tabBodyWrapper;_tabHeader;_tabs=new Od;_indexToSelect=0;_lastFocusedTabIndex=null;_tabBodyWrapperHeight=0;color;get fitInkBarToContent(){return this._fitInkBarToContent}set fitInkBarToContent(e){this._fitInkBarToContent=e,this._changeDetectorRef.markForCheck()}_fitInkBarToContent=!1;stretchTabs=!0;alignTabs=null;dynamicHeight=!1;get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this._indexToSelect=isNaN(e)?null:e}_selectedIndex=null;headerPosition="above";get animationDuration(){return this._animationDuration}set animationDuration(e){const n=e+"";this._animationDuration=/^\d+$/.test(n)?e+"ms":n}_animationDuration;get contentTabIndex(){return this._contentTabIndex}set contentTabIndex(e){this._contentTabIndex=isNaN(e)?null:e}_contentTabIndex;disablePagination=!1;disableRipple=!1;preserveContent=!1;get backgroundColor(){return this._backgroundColor}set backgroundColor(e){const n=this._elementRef.nativeElement.classList;n.remove("mat-tabs-with-background",`mat-background-${this.backgroundColor}`),e&&n.add("mat-tabs-with-background",`mat-background-${e}`),this._backgroundColor=e}_backgroundColor;ariaLabel;ariaLabelledby;selectedIndexChange=new Tt;focusChange=new Tt;animationDone=new Tt;selectedTabChange=new Tt(!0);_groupId;_isServer=!Y(ea).isBrowser;constructor(){const e=Y(Zhe,{optional:!0});this._groupId=Y(ta).getId("mat-tab-group-"),this.animationDuration=e&&e.animationDuration?e.animationDuration:"500ms",this.disablePagination=!(!e||null==e.disablePagination)&&e.disablePagination,this.dynamicHeight=!(!e||null==e.dynamicHeight)&&e.dynamicHeight,null!=e?.contentTabIndex&&(this.contentTabIndex=e.contentTabIndex),this.preserveContent=!!e?.preserveContent,this.fitInkBarToContent=!(!e||null==e.fitInkBarToContent)&&e.fitInkBarToContent,this.stretchTabs=!e||null==e.stretchTabs||e.stretchTabs,this.alignTabs=e&&null!=e.alignTabs?e.alignTabs:null}ngAfterContentChecked(){const e=this._indexToSelect=this._clampTabIndex(this._indexToSelect);if(this._selectedIndex!=e){const n=null==this._selectedIndex;if(!n){this.selectedTabChange.emit(this._createChangeEvent(e));const o=this._tabBodyWrapper.nativeElement;o.style.minHeight=o.clientHeight+"px"}Promise.resolve().then(()=>{this._tabs.forEach((o,r)=>o.isActive=r===e),n||(this.selectedIndexChange.emit(e),this._tabBodyWrapper.nativeElement.style.minHeight="")})}this._tabs.forEach((n,o)=>{n.position=o-e,null!=this._selectedIndex&&0==n.position&&!n.origin&&(n.origin=e-this._selectedIndex)}),this._selectedIndex!==e&&(this._selectedIndex=e,this._lastFocusedTabIndex=null,this._changeDetectorRef.markForCheck())}ngAfterContentInit(){this._subscribeToAllTabChanges(),this._subscribeToTabLabels(),this._tabsSubscription=this._tabs.changes.subscribe(()=>{const e=this._clampTabIndex(this._indexToSelect);if(e===this._selectedIndex){const n=this._tabs.toArray();let o;for(let r=0;r{n[e].isActive=!0,this.selectedTabChange.emit(this._createChangeEvent(e))})}this._changeDetectorRef.markForCheck()})}ngAfterViewInit(){this._tabBodySubscription=this._tabBodies.changes.subscribe(()=>this._bodyCentered(!0))}_subscribeToAllTabChanges(){this._allTabs.changes.pipe(ua(this._allTabs)).subscribe(e=>{this._tabs.reset(e.filter(n=>n._closestTabGroup===this||!n._closestTabGroup)),this._tabs.notifyOnChanges()})}ngOnDestroy(){this._tabs.destroy(),this._tabsSubscription.unsubscribe(),this._tabLabelSubscription.unsubscribe(),this._tabBodySubscription.unsubscribe()}realignInkBar(){this._tabHeader&&this._tabHeader._alignInkBarToSelectedTab()}updatePagination(){this._tabHeader&&this._tabHeader.updatePagination()}focusTab(e){const n=this._tabHeader;n&&(n.focusIndex=e)}_focusChanged(e){this._lastFocusedTabIndex=e,this.focusChange.emit(this._createChangeEvent(e))}_createChangeEvent(e){const n=new Yhe;return n.index=e,this._tabs&&this._tabs.length&&(n.tab=this._tabs.toArray()[e]),n}_subscribeToTabLabels(){this._tabLabelSubscription&&this._tabLabelSubscription.unsubscribe(),this._tabLabelSubscription=va(...this._tabs.map(e=>e._stateChanges)).subscribe(()=>this._changeDetectorRef.markForCheck())}_clampTabIndex(e){return Math.min(this._tabs.length-1,Math.max(e||0,0))}_getTabLabelId(e,n){return e.id||`${this._groupId}-label-${n}`}_getTabContentId(e){return`${this._groupId}-content-${e}`}_setTabBodyWrapperHeight(e){if(!this.dynamicHeight||!this._tabBodyWrapperHeight)return void(this._tabBodyWrapperHeight=e);const n=this._tabBodyWrapper.nativeElement;n.style.height=this._tabBodyWrapperHeight+"px",this._tabBodyWrapper.nativeElement.offsetHeight&&(n.style.height=e+"px")}_removeTabBodyWrapperHeight(){const e=this._tabBodyWrapper.nativeElement;this._tabBodyWrapperHeight=e.clientHeight,e.style.height="",this._ngZone.run(()=>this.animationDone.emit())}_handleClick(e,n,o){n.focusIndex=o,e.disabled||(this.selectedIndex=o)}_getTabIndex(e){return e===(this._lastFocusedTabIndex??this.selectedIndex)?0:-1}_tabFocusChanged(e,n){e&&"mouse"!==e&&"touch"!==e&&(this._tabHeader.focusIndex=n)}_bodyCentered(e){e&&this._tabBodies?.forEach((n,o)=>n._setActiveClass(o===this._selectedIndex))}_animationsDisabled(){return this._diAnimationsDisabled||"0"===this.animationDuration||"0ms"===this.animationDuration}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-tab-group"]],contentQueries:function(n,o,r){if(1&n&&oo(r,Ob,5),2&n){let u;Bt(u=Vt())&&(o._allTabs=u)}},viewQuery:function(n,o){if(1&n&&(mn(khe,5),mn(Rhe,5),mn($M,5)),2&n){let r;Bt(r=Vt())&&(o._tabBodyWrapper=r.first),Bt(r=Vt())&&(o._tabHeader=r.first),Bt(r=Vt())&&(o._tabBodies=r)}},hostAttrs:[1,"mat-mdc-tab-group"],hostVars:11,hostBindings:function(n,o){2&n&&(zn("mat-align-tabs",o.alignTabs),bs("mat-"+(o.color||"primary")),Jc("--mat-tab-animation-duration",o.animationDuration),Hn("mat-mdc-tab-group-dynamic-height",o.dynamicHeight)("mat-mdc-tab-group-inverted-header","below"===o.headerPosition)("mat-mdc-tab-group-stretch-tabs",o.stretchTabs))},inputs:{color:"color",fitInkBarToContent:[2,"fitInkBarToContent","fitInkBarToContent",fn],stretchTabs:[2,"mat-stretch-tabs","stretchTabs",fn],alignTabs:[0,"mat-align-tabs","alignTabs"],dynamicHeight:[2,"dynamicHeight","dynamicHeight",fn],selectedIndex:[2,"selectedIndex","selectedIndex",Ql],headerPosition:"headerPosition",animationDuration:"animationDuration",contentTabIndex:[2,"contentTabIndex","contentTabIndex",Ql],disablePagination:[2,"disablePagination","disablePagination",fn],disableRipple:[2,"disableRipple","disableRipple",fn],preserveContent:[2,"preserveContent","preserveContent",fn],backgroundColor:"backgroundColor",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"]},outputs:{selectedIndexChange:"selectedIndexChange",focusChange:"focusChange",animationDone:"animationDone",selectedTabChange:"selectedTabChange"},exportAs:["matTabGroup"],features:[Bn([{provide:Dj,useExisting:t}])],ngContentSelectors:fL,decls:9,vars:8,consts:[["tabHeader",""],["tabBodyWrapper",""],["tabNode",""],[3,"indexFocused","selectFocusedIndex","selectedIndex","disableRipple","disablePagination","aria-label","aria-labelledby"],["role","tab","matTabLabelWrapper","","cdkMonitorElementFocus","",1,"mdc-tab","mat-mdc-tab","mat-focus-indicator",3,"id","mdc-tab--active","class","disabled","fitInkBarToContent"],[1,"mat-mdc-tab-body-wrapper"],["role","tabpanel",3,"id","class","content","position","animationDuration","preserveContent"],["role","tab","matTabLabelWrapper","","cdkMonitorElementFocus","",1,"mdc-tab","mat-mdc-tab","mat-focus-indicator",3,"click","cdkFocusChange","id","disabled","fitInkBarToContent"],[1,"mdc-tab__ripple"],["mat-ripple","",1,"mat-mdc-tab-ripple",3,"matRippleTrigger","matRippleDisabled"],[1,"mdc-tab__content"],[1,"mdc-tab__text-label"],[3,"cdkPortalOutlet"],["role","tabpanel",3,"_onCentered","_onCentering","_beforeCentering","id","content","position","animationDuration","preserveContent"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"mat-tab-header",3,0),we("indexFocused",function(y){return fe(r),ge(o._focusChanged(y))})("selectFocusedIndex",function(y){return fe(r),ge(o.selectedIndex=y)}),Sv(2,Fhe,8,17,"div",4,iI),x(),te(4,Nhe,1,0),w(5,"div",5,1),Sv(7,zhe,1,10,"mat-tab-body",6,iI),x()}2&n&&(N("selectedIndex",o.selectedIndex||0)("disableRipple",o.disableRipple)("disablePagination",o.disablePagination)("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby),E(2),Tv(o._tabs),E(2),Xi(o._isServer?4:-1),E(),Hn("_mat-animation-noopable",o._animationsDisabled()),E(2),Tv(o._tabs))},dependencies:[Whe,Ej,g3,Mb,ef,$M],styles:['.mdc-tab{min-width:90px;padding:0 24px;display:flex;flex:1 0 auto;justify-content:center;box-sizing:border-box;border:none;outline:none;text-align:center;white-space:nowrap;cursor:pointer;z-index:1}.mdc-tab__content{display:flex;align-items:center;justify-content:center;height:inherit;pointer-events:none}.mdc-tab__text-label{transition:150ms color linear;display:inline-block;line-height:1;z-index:2}.mdc-tab--active .mdc-tab__text-label{transition-delay:100ms}._mat-animation-noopable .mdc-tab__text-label{transition:none}.mdc-tab-indicator{display:flex;position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;pointer-events:none;z-index:1}.mdc-tab-indicator__content{transition:var(--mat-tab-animation-duration, 250ms) transform cubic-bezier(0.4, 0, 0.2, 1);transform-origin:left;opacity:0}.mdc-tab-indicator__content--underline{align-self:flex-end;box-sizing:border-box;width:100%;border-top-style:solid}.mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:1}._mat-animation-noopable .mdc-tab-indicator__content,.mdc-tab-indicator--no-transition .mdc-tab-indicator__content{transition:none}.mat-mdc-tab-ripple.mat-mdc-tab-ripple{position:absolute;top:0;left:0;bottom:0;right:0;pointer-events:none}.mat-mdc-tab{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none;background:none;height:var(--mdc-secondary-navigation-tab-container-height, 48px);font-family:var(--mat-tab-header-label-text-font, var(--mat-sys-title-small-font));font-size:var(--mat-tab-header-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-tab-header-label-text-tracking, var(--mat-sys-title-small-tracking));line-height:var(--mat-tab-header-label-text-line-height, var(--mat-sys-title-small-line-height));font-weight:var(--mat-tab-header-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-tab.mdc-tab{flex-grow:0}.mat-mdc-tab .mdc-tab-indicator__content--underline{border-color:var(--mdc-tab-indicator-active-indicator-color, var(--mat-sys-primary));border-top-width:var(--mdc-tab-indicator-active-indicator-height, 2px);border-radius:var(--mdc-tab-indicator-active-indicator-shape, 0)}.mat-mdc-tab:hover .mdc-tab__text-label{color:var(--mat-tab-header-inactive-hover-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-tab:focus .mdc-tab__text-label{color:var(--mat-tab-header-inactive-focus-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--mat-tab-header-active-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-tab.mdc-tab--active .mdc-tab__ripple::before,.mat-mdc-tab.mdc-tab--active .mat-ripple-element{background-color:var(--mat-tab-header-active-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-tab.mdc-tab--active:hover .mdc-tab__text-label{color:var(--mat-tab-header-active-hover-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-tab.mdc-tab--active:hover .mdc-tab-indicator__content--underline{border-color:var(--mat-tab-header-active-hover-indicator-color, var(--mat-sys-primary))}.mat-mdc-tab.mdc-tab--active:focus .mdc-tab__text-label{color:var(--mat-tab-header-active-focus-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-tab.mdc-tab--active:focus .mdc-tab-indicator__content--underline{border-color:var(--mat-tab-header-active-focus-indicator-color, var(--mat-sys-primary))}.mat-mdc-tab.mat-mdc-tab-disabled{opacity:.4;pointer-events:none}.mat-mdc-tab.mat-mdc-tab-disabled .mdc-tab__content{pointer-events:none}.mat-mdc-tab.mat-mdc-tab-disabled .mdc-tab__ripple::before,.mat-mdc-tab.mat-mdc-tab-disabled .mat-ripple-element{background-color:var(--mat-tab-header-disabled-ripple-color)}.mat-mdc-tab .mdc-tab__ripple::before{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;opacity:0;pointer-events:none;background-color:var(--mat-tab-header-inactive-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-tab .mdc-tab__text-label{color:var(--mat-tab-header-inactive-label-text-color, var(--mat-sys-on-surface));display:inline-flex;align-items:center}.mat-mdc-tab .mdc-tab__content{position:relative;pointer-events:auto}.mat-mdc-tab:hover .mdc-tab__ripple::before{opacity:.04}.mat-mdc-tab.cdk-program-focused .mdc-tab__ripple::before,.mat-mdc-tab.cdk-keyboard-focused .mdc-tab__ripple::before{opacity:.12}.mat-mdc-tab .mat-ripple-element{opacity:.12;background-color:var(--mat-tab-header-inactive-ripple-color, var(--mat-sys-on-surface))}.mat-mdc-tab-group.mat-mdc-tab-group-stretch-tabs>.mat-mdc-tab-header .mat-mdc-tab{flex-grow:1}.mat-mdc-tab-group{display:flex;flex-direction:column;max-width:100%}.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination{background-color:var(--mat-tab-header-with-background-background-color)}.mat-mdc-tab-group.mat-tabs-with-background.mat-primary>.mat-mdc-tab-header .mat-mdc-tab .mdc-tab__text-label{color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background.mat-primary>.mat-mdc-tab-header .mdc-tab-indicator__content--underline{border-color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background:not(.mat-primary)>.mat-mdc-tab-header .mat-mdc-tab:not(.mdc-tab--active) .mdc-tab__text-label{color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background:not(.mat-primary)>.mat-mdc-tab-header .mat-mdc-tab:not(.mdc-tab--active) .mdc-tab-indicator__content--underline{border-color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header .mat-mdc-tab-header-pagination-chevron,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header .mat-focus-indicator::before,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination .mat-mdc-tab-header-pagination-chevron,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination .mat-focus-indicator::before{border-color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header .mat-ripple-element,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header .mdc-tab__ripple::before,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination .mat-ripple-element,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination .mdc-tab__ripple::before{background-color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header .mat-mdc-tab-header-pagination-chevron,.mat-mdc-tab-group.mat-tabs-with-background>.mat-mdc-tab-header-pagination .mat-mdc-tab-header-pagination-chevron{color:var(--mat-tab-header-with-background-foreground-color)}.mat-mdc-tab-group.mat-mdc-tab-group-inverted-header{flex-direction:column-reverse}.mat-mdc-tab-group.mat-mdc-tab-group-inverted-header .mdc-tab-indicator__content--underline{align-self:flex-start}.mat-mdc-tab-body-wrapper{position:relative;overflow:hidden;display:flex;transition:height 500ms cubic-bezier(0.35, 0, 0.25, 1)}.mat-mdc-tab-body-wrapper._mat-animation-noopable{transition:none !important;animation:none !important}\n'],encapsulation:2})}return t})();class Yhe{index;tab}let Xhe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})(),Khe=(()=>{class t{loginService;dialogRef;data;http;constructor(e,n,o,r){this.loginService=e,this.dialogRef=n,this.data=o,this.http=r}ngOnInit(){}onSubmit(){let e={duration:3600*this.data.duration,application:this.data.application,category:this.data.category,sub_category:this.data.sub_category,version:this.data.version};this.http.post(this.loginService.getURL("ondemandlicense",this.data.route)+"/+status",e,{withCredentials:!0}).subscribe(()=>{this.dialogRef.close(this.data.duration)})}static \u0275fac=function(n){return new(n||t)($e(Po),$e(xs),$e(Ks),$e(Uo))};static \u0275cmp=cn({type:t,selectors:[["app-duration-edit"]],standalone:!1,decls:12,vars:2,consts:[["durationEditForm","ngForm"],[3,"ngSubmit"],[1,"dialog-content"],["hideRequiredMarker",""],["matInput","","required","","name","duration","placeholder","Time to expire (hours)","type","number","min","1","max","48",3,"ngModelChange","ngModel"],["align","center"],["mat-raised-button","","type","submit",3,"disabled"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content",2)(3,"h4"),M(4,"On-Demand License Duration"),x(),w(5,"mat-form-field",3)(6,"mat-label"),M(7,"Max: 48 Hours"),x(),w(8,"input",4),Qn("ngModelChange",function(y){return fe(r),ei(o.data.duration,y)||(o.data.duration=y),ge(y)}),x()()(),w(9,"mat-dialog-actions",5)(10,"button",6),M(11,"Apply"),x()()()}if(2&n){const r=Vi(1);E(8),Kn("ngModel",o.data.duration),E(2),N("disabled",!r.form.valid)}},dependencies:[ka,jr,yx,wr,Aa,Jl,vx,FO,ts,Cr,na,Oa,xa,ws,Fl,Os],styles:[".dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}"]})}return t})();const kj=["PS","PS-blunet","PS-ems","LVP"],Wx=new Map([["PS","Polysmith"],["PS-blunet","Polysmith BluNet"],["PS-ems","Polysmith EMS"],["LVP","LVP Pro"]]),Rj={All:["12.x","12","2"],PS:["12.x","12"],"PS-blunet":["12.x","12"],"PS-ems":["12.x"],LVP:["2"]},gL={standalone:"Standalone",ondemand:"On-Demand"},Oj={standalone:[{value:"acq",label:"Acquisition"},{value:"review",label:"Review"}],ondemand:[{value:"review",label:"Review"}]},Pj={standalone:[{value:"management_svr",label:"Management Server"}],ondemand:[{value:"management_svr",label:"Management Server"}]},bL={acq:[{value:"station_onebed",label:"One-bed Acquisition"},{value:"station_twobed",label:"Two-bed Acquisition"},{value:"station_online",label:"Online"}],review:[{value:"station_review_analysis",label:"Review + Analysis"},{value:"station_review",label:"Review"}],management_svr:[{value:"lvp_server",label:"LVP Server"}]},Qhe=[{name:"option_video",label:"Digital Video",type:"check"},{name:"site_advanced_dms",label:"DMS",type:"check"},{name:"site_hl7",label:"HL7",type:"check"},{name:"option_eeg_client",label:"EEG Client",type:"check"}],Jhe=[{name:"LVP Pro Clients",model:"lvp_clients",type:"numeric_input"},{name:"Acquisitions",model:"lvp_acq",type:"numeric_input"},{name:"LVP Pro Observers",model:"lvp_obs",type:"numeric_input"}],epe=["PS:12:standalone","PS:12.x:standalone","PS-blunet:12:standalone","PS-blunet:12.x:standalone","PS-ems:12.x:standalone"];class Xh{static GetCategoryList(i,e){return"LVP"==i?Pj[e]:Oj[e]}static GetLicenseTypeLabel(i){let e=i;return i in gL&&(e=gL[i]),e}static GetCategoryLabel(i,e,n){let o=n;return this.GetCategoryList(i,e).forEach(u=>{u.value==n&&(o=u.label)}),o}static GetSubCategoryLabel(i,e){let n=e;return i in bL&&bL[i].forEach(r=>{r.value==e&&(n=r.label)}),n}static ShowLicenseID(i){return["LVP"].includes(i,0)}static SoftwareVersionAllowsSubscription(i,e,n){return!epe.includes(i+":"+e+":"+n)}static GetDisplayVersionString(i,e){if(null==e||""==e||null==e)return"";let n=e,r=e.includes(".");if(["PS","PS-blunet","PS-ems"].includes(i)&&r){let u=e.toString().toLowerCase().split(".");u.length>1&&"12"==u[0]&&parseInt(u[1])>0&&(n=u[0]+".x")}return n}static GetBackendVersionString(i,e){let o=e;return["PS","PS-blunet","PS-ems"].includes(i)&&"12.x"==e&&(o="12.2"),o}static FilterMatchVersion(i,e){let n=""==e||"All"==e,o=!1;if(e.includes(".")){let u=i.includes("."),y=e.toLowerCase().split("."),I=i.toString().toLowerCase().split(".");y[0]==I[0]&&"x"==y[1]&&u&&(o=!0)}else o=i.toString().toLowerCase()==e.toLowerCase();return n||o}}class Lj{constructor(i){(i?["All"].concat(kj):kj).forEach(n=>{this[n]=(i?["All"]:[]).concat(Rj[n])})}}function yL(t){return kt(()=>t)}function Fj(t,i){return i?e=>iT(i.pipe($a(1),function tpe(){return ot((t,i)=>{t.subscribe(St(i,Pc))})}()),e.pipe(Fj(t))):dc((e,n)=>td(t(e,n)).pipe($a(1),yL(e)))}const ipe=["panel"],ope=["*"];function rpe(t,i){if(1&t&&(w(0,"div",1,0),On(2),x()),2&t){const e=i.id,n=X();bs(n._classList),Hn("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-autocomplete-panel-animations-enabled",!n._animationsDisabled)("mat-primary","primary"===n._color)("mat-accent","accent"===n._color)("mat-warn","warn"===n._color),N("id",n.id),zn("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(e))}}class ape{source;option;constructor(i,e){this.source=i,this.option=e}}const Nj=new yt("mat-autocomplete-default-options",{providedIn:"root",factory:function spe(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1}}});let vL=(()=>{class t{_changeDetectorRef=Y(So);_elementRef=Y(Pn);_defaults=Y(Nj);_animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});_activeOptionChanges=ai.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple;optionSelected=new Tt;opened=new Tt;closed=new Tt;optionActivated=new Tt;set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(const e of this.options)e._changeDetectorRef.markForCheck()}id=Y(ta).getId("mat-autocomplete-");inertGroups;constructor(){const e=Y(ea);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new _j(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){const n=new ape(this,e);this.optionSelected.emit(n)}_getPanelAriaLabelledby(e){return this.ariaLabel?null:this.ariaLabelledby?(e?e+" ":"")+this.ariaLabelledby:e}_skipPredicate(){return!1}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-autocomplete"]],contentQueries:function(n,o,r){if(1&n&&(oo(r,uc,5),oo(r,mL,5)),2&n){let u;Bt(u=Vt())&&(o.options=u),Bt(u=Vt())&&(o.optionGroups=u)}},viewQuery:function(n,o){if(1&n&&(mn(sa,7),mn(ipe,5)),2&n){let r;Bt(r=Vt())&&(o.template=r.first),Bt(r=Vt())&&(o.panel=r.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",fn],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",fn],requireSelection:[2,"requireSelection","requireSelection",fn],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",fn],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",fn]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[Bn([{provide:pL,useExisting:t}])],ngContentSelectors:ope,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,o){1&n&&(ho(),te(0,rpe,3,17,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}\n"],encapsulation:2,changeDetection:0})}return t})();const lpe={provide:Pl,useExisting:lo(()=>GM),multi:!0},zj=new yt("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition()}}),dpe={provide:zj,deps:[is],useFactory:function cpe(t){return()=>t.scrollStrategies.reposition()}};let GM=(()=>{class t{_environmentInjector=Y(us);_element=Y(Pn);_overlay=Y(is);_viewContainerRef=Y(es);_zone=Y(tn);_changeDetectorRef=Y(So);_dir=Y(ul,{optional:!0});_formField=Y(o0,{optional:!0,host:!0});_viewportRuler=Y(Kv);_scrollStrategy=Y(zj);_renderer=Y(Hr);_defaults=Y(Nj,{optional:!0});_overlayRef;_portal;_componentDestroyed=!1;_initialized=new Ee;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue;_valueOnAttach;_valueOnLastKeydown;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=ai.EMPTY;_breakpointObserver=Y(UE);_handsetLandscapeSubscription=ai.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption;_closeKeyEventStream=new Ee;_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Fx(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return va(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(or(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(or(()=>this._overlayAttached)):xi()).pipe(kt(e=>e instanceof bj?e:null))}optionSelections=Tx(()=>{const e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(ua(e),Xs(()=>va(...e.map(n=>n.onSelectionChange)))):this._initialized.pipe(Xs(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new se(e=>{const n=r=>{const u=Kp(r),y=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,I=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&u!==this._element.nativeElement&&!this._hasFocus()&&(!y||!y.contains(u))&&(!I||!I.contains(u))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(u)&&e.next(r)},o=[this._renderer.listen("document","click",n),this._renderer.listen("document","auxclick",n),this._renderer.listen("document","touchend",n)];return()=>{o.forEach(r=>r())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){const n=e.keyCode,o=ns(e);if(27===n&&!o&&e.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&13===n&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){const r=this.autocomplete._keyManager.activeItem,u=38===n||40===n;9===n||u&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(e):u&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(u||this.autocomplete._keyManager.activeItem!==r)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let n=e.target,o=n.value;if("number"===n.type&&(o=""==o?null:parseFloat(o)),this._previousValue!==o){if(this._previousValue=o,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(o),o){if(this.panelOpen&&!this.autocomplete.requireSelection){const r=this.autocomplete.options?.find(u=>u.selected);r&&o!==this._getDisplayValue(r.value)&&r.deselect(!1)}}else this._clearPreviousSelectedOption(null,!1);if(this._canOpen()&&this._hasFocus()){const r=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(r)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return Sb()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&"auto"===this._formField.floatLabel&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){const e=new se(o=>{As(()=>{o.next()},{injector:this._environmentInjector})}),n=this.autocomplete.options?.changes.pipe(ks(()=>this._positionStrategy.reapplyLastPosition()),function npe(t,i=yT){const e=wb(t,i);return Fj(()=>e)}(0))??xi();return va(e,n).pipe(Xs(()=>this._zone.run(()=>{const o=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),o!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),$a(1)).subscribe(o=>this._setValueAndClose(o))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){const n=this.autocomplete;return n&&n.displayWith?n.displayWith(e):e}_assignOptionValue(e){const n=this._getDisplayValue(e);null==e&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){const n=this.autocomplete,o=e?e.source:this._pendingAutoselectedOption;o?(this._clearPreviousSelectedOption(o),this._assignOptionValue(o.value),this._onChange(o.value),n._emitSelectEvent(o),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,n){this.autocomplete?.options?.forEach(o=>{o!==e&&o.selected&&o.deselect(n)})}_openPanelInternal(e=this._element.nativeElement.value){this._attachOverlay(e),this._floatLabel(),this._trackedModal&&vM(this._trackedModal,"aria-owns",this.autocomplete.id)}_attachOverlay(e){let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new C_(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe("(max-width: 959.98px) and (orientation: landscape)").subscribe(r=>{r.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());const o=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&o!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(27===e.keyCode&&!ns(e)||38===e.keyCode&&ns(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){const e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Qv({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){const e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){const n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],o=this._aboveClass,r=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:o},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:o}];let u;u="above"===this.position?r:"below"===this.position?n:[...n,...r],e.withPositions(u)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){const e=this.autocomplete;if(e.autoActiveFirstOption){let n=-1;for(let o=0;o .cdk-overlay-container [aria-modal="true"]');if(!e)return;const n=this.autocomplete.id;this._trackedModal&&Fx(this._trackedModal,"aria-owns",n),vM(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){this._trackedModal&&(Fx(this._trackedModal,"aria-owns",this.autocomplete.id),this._trackedModal=null)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,o){1&n&&we("focusin",function(){return o._handleFocus()})("blur",function(){return o._onTouched()})("input",function(u){return o._handleInput(u)})("keydown",function(u){return o._handleKeydown(u)})("click",function(){return o._handleClick()}),2&n&&zn("autocomplete",o.autocompleteAttribute)("role",o.autocompleteDisabled?null:"combobox")("aria-autocomplete",o.autocompleteDisabled?null:"list")("aria-activedescendant",o.panelOpen&&o.activeOption?o.activeOption.id:null)("aria-expanded",o.autocompleteDisabled?null:o.panelOpen.toString())("aria-controls",o.autocompleteDisabled||!o.panelOpen||null==o.autocomplete?null:o.autocomplete.id)("aria-haspopup",o.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",fn]},exportAs:["matAutocompleteTrigger"],features:[Bn([lpe]),go]})}return t})(),upe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[dpe],imports:[Ib,HM,Ki,T_,HM,Ki]})}return t})();function hpe(t,i){if(1&t&&(w(0,"p"),M(1),x()),2&t){const e=X();E(),Jt("For: ",e.organization_display,"")}}function ppe(t,i){if(1&t&&(w(0,"mat-option",17),M(1),x()),2&t){const e=i.$implicit;N("value",e.po),E(),Jt(" ",e.po," ")}}function mpe(t,i){if(1&t&&(w(0,"span"),te(1,ppe,2,2,"mat-option",16),ti(2,"async"),x()),2&t){const e=X();E(),N("ngForOf",Zm(2,1,e.filteredPurchaseOrders))}}function fpe(t,i){if(1&t&&(w(0,"mat-option",17),M(1),x()),2&t){const e=i.$implicit;N("value",e.name),E(),Ea(" ",e.friendly_name,"\xa0(",e.name,") ")}}function _pe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",8)(1,"input",18,3),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.organizationDisplayText,o)||(r.organizationDisplayText=o),ge(o)}),x(),w(3,"mat-autocomplete",19,4),te(6,fpe,2,3,"mat-option",16),ti(7,"async"),x()()}if(2&t){const e=Vi(5),n=X();E(),N("formControl",n.orgSelectFormControl)("matAutocomplete",e),Kn("ngModel",n.organizationDisplayText),N("disabled",n.isSelectConfig())("autofocus",!1),E(2),N("displayWith",n.orgAutoCompleteDisplay.bind(n)),E(3),N("ngForOf",Zm(7,7,n.filteredOrganizations))}}function gpe(t,i){1&t&&(w(0,"span",20),M(1,"Cannot select this PO Number."),x())}function bpe(t,i){1&t&&(w(0,"span",20),M(1,"Remove non-ascii characters."),x())}function ype(t,i){if(1&t&&(w(0,"span",20),M(1),x()),2&t){const e=X();E(),Ct(e.response_error_msg)}}const vpe=li_backendURL+"/organization";var cf=function(t){return t[t.PO_CONFIG_ADD=1]="PO_CONFIG_ADD",t[t.PO_CONFIG_SELECT=2]="PO_CONFIG_SELECT",t}(cf||{});class Zx{moving_from_po="";navigated_org="";config_type=cf.PO_CONFIG_ADD}let Yx=(()=>{class t{loginService;dialogRef;data;http;errorService;userInfo;PO="";navigated_org="";moving_from_po="";config_type=cf.PO_CONFIG_ADD;organizationDict={};organizations=new Array;organizationSelected=!1;organization_name="";organization_display="";orgSelectFormControl=new po;filteredOrganizations;purchaseOrderDict={};purchase_orders=new Array;purchase_orders_closed=new Array;purchase_order_open=!1;purchaseOrderSelectFormControl=new po;filteredPurchaseOrders;response_error_msg="";constructor(e,n,o,r,u){this.loginService=e,this.dialogRef=n,this.data=o,this.http=r,this.errorService=u,this.moving_from_po=o.moving_from_po,this.navigated_org=o.navigated_org,this.config_type=o.config_type}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.getOrganizations(),this.getOrganizationPurchaseOrders()}isSelectConfig(){return this.config_type==cf.PO_CONFIG_SELECT}getOrganizations(){this.http.get(vpe,{withCredentials:!0}).subscribe(e=>{this.organizations=e,this.organizations.forEach(n=>{this.organizationDict[n.name]=n}),this.filteredOrganizations=this.orgSelectFormControl.valueChanges.pipe(ua(""),kt(n=>this._filterOrgs(n||""))),""!=this.navigated_org&&(this.organization_name=this.navigated_org,this.organization_display=this.orgAutoCompleteDisplay(this.navigated_org),this.orgSelectFormControl.setValue(this.organization_name),this.organizationSelected=!0,this.orgSelectFormControl.markAsDirty())})}_filterOrgs(e){const n=e.toLowerCase();let o=[];return this.organizations.forEach(r=>{(r.name.toLowerCase().includes(n)||r.friendly_name.toLowerCase().includes(n))&&o.push(r)}),o}orgAutoCompleteDisplay(e){let n="";if(e){let o=this.organizationDict[e];n=o.friendly_name+" ("+o.name+")",this.organization_name=o.name,this.organizationSelected=!0}return n}orgDisplayMatchesSelection(){return!!this.organizationSelected&&this.orgSelectFormControl.value==this.organization_name}getOrganizationPurchaseOrders(){this.userInfo&&this.userInfo.isMasterDBUser()&&(this.purchase_orders.length=0,this.purchase_orders_closed.length=0,this.http.get(li_backendURL+"/organizations/"+this.navigated_org+"/purchase_orders",{withCredentials:!0}).subscribe(n=>{n.forEach(r=>{r.open?this.purchase_orders.push(r):this.purchase_orders_closed.push(r.po)});let o=this.purchase_orders.findIndex(r=>r.po==this.moving_from_po);-1!=o&&this.purchase_orders.splice(o,1),this.purchase_orders.forEach(r=>{this.purchaseOrderDict[r.po]=r}),this.filteredPurchaseOrders=this.purchaseOrderSelectFormControl.valueChanges.pipe(ua(""),kt(r=>this._filterPurchaseOrders(r||"")))}))}_filterPurchaseOrders(e){const n=e.toLowerCase();let o=[];return this.purchase_orders.forEach(r=>{r.po.toLowerCase().includes(n)&&o.push(r)}),o}sanitizePO(){this.PO=this.PO.trim()}isValidPO(){return RegExp("^[ -~]+$").test(this.PO)}canAddPO(){return this.sanitizePO(),this.isValidPO()&&!(this.PO in this.purchaseOrderDict)}canEditPO(){return this.sanitizePO(),this.isValidPO()&&this.PO in this.purchaseOrderDict&&!this.purchaseOrderDict[this.PO].open}isOpenPO(){return this.sanitizePO(),this.PO in this.purchaseOrderDict&&this.purchaseOrderDict[this.PO].open}isInvalidPO(){return this.sanitizePO(),""!=this.PO&&!this.isValidPO()}isRestricted(){return this.sanitizePO(),""!=this.PO&&(!(this.PO!=this.moving_from_po&&!this.purchase_orders_closed.find(n=>n===this.PO))||void 0)}allowSubmit(){return!(""==this.organization_name||this.isRestricted()||(!this.canAddPO()||this.canEditPO())&&(!this.isSelectConfig()||!this.isOpenPO()))}getSubmitToolTip(){let e="";return""==this.organization_name?e="Select a valid organization":this.isRestricted()?e="Select a new PO to move to.":this.isValidPO()?!this.isSelectConfig()&&this.PO in this.purchaseOrderDict?e="PO already exists.":this.isSelectConfig()&&!this.isOpenPO()&&(e="Cannot select a closed PO."):e="Invalid PO",e}getSubmitText(){let e="Add";return this.isSelectConfig()&&(this.isOpenPO()||this.isRestricted())&&(e="Select"),e}onChangePO(){this.clearSubmitError()}clearSubmitError(){this.response_error_msg=""}hasSubmitError(){return""!=this.response_error_msg}onCancel(){this.dialogRef.close(null)}onSubmit(){if(this.userInfo.isAdmin2()&&this.isValidPO())if(this.isOpenPO())this.dialogRef.close(this.PO);else{let e={};e.purchase_order=this.PO,e.org=this.organization_name,e.open=!0,e.add_only=!0,this.http.post(li_backendURL+"/purchase_orders",e,{withCredentials:!0,observe:"response"}).subscribe(o=>{o.body.success?this.dialogRef.close(this.PO):this.response_error_msg=o.error_msg})}}static \u0275fac=function(n){return new(n||t)($e(Po),$e(xs),$e(Ks),$e(Uo),$e(n0))};static \u0275cmp=cn({type:t,selectors:[["app-po-config"]],standalone:!1,decls:25,vars:13,consts:[["addEditPOForm","ngForm"],["purchaseOrderSearchDisplay",""],["purchaseOrderAutoComplete","","auto1","matAutocomplete"],["orgSearchDisplay",""],["orgAutoComplete","","auto2","matAutocomplete"],[3,"ngSubmit"],[2,"text-align","center"],[4,"ngIf"],[1,"full-width"],["type","text","placeholder","PO Number:","aria-label","Purchase Order","matInput","","autofocus","",3,"ngModelChange","input","formControl","matAutocomplete","ngModel","maxLength"],["class","full-width",4,"ngIf"],["class","error-msg",4,"ngIf"],["align","center"],[3,"matTooltip"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["mat-raised-button","","color","primary","type","button",3,"click"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["type","text","placeholder","Organization Select:","aria-label","Organization","matInput","",3,"ngModelChange","formControl","matAutocomplete","ngModel","disabled","autofocus"],[3,"displayWith"],[1,"error-msg"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",5,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content",6)(3,"h3"),M(4,"Purchase Order"),x(),te(5,hpe,2,1,"p",7),w(6,"div")(7,"mat-form-field",8)(8,"input",9,1),Qn("ngModelChange",function(y){return fe(r),ei(o.PO,y)||(o.PO=y),ge(y)}),we("input",function(){return fe(r),ge(o.onChangePO())}),x(),w(10,"mat-autocomplete",null,2),te(13,mpe,3,3,"span",7),x()(),te(14,_pe,8,9,"mat-form-field",10),x(),te(15,gpe,2,0,"span",11)(16,bpe,2,0,"span",11)(17,ype,2,1,"span",11),x(),w(18,"mat-dialog-actions",12)(19,"div",13)(20,"button",14),M(21),x(),M(22," \xa0 "),x(),w(23,"button",15),we("click",function(){return fe(r),ge(o.onCancel())}),M(24,"Cancel"),x()()()}if(2&n){const r=Vi(12);E(5),N("ngIf",o.isSelectConfig()),E(3),N("formControl",o.purchaseOrderSelectFormControl)("matAutocomplete",r),Kn("ngModel",o.PO),N("maxLength",40),E(5),N("ngIf",o.isSelectConfig()),E(),N("ngIf",!o.isSelectConfig()),E(),N("ngIf",o.isRestricted()),E(),N("ngIf",o.isInvalidPO()),E(),N("ngIf",o.hasSubmitError()),E(2),N("matTooltip",o.getSubmitToolTip()),E(),N("disabled",!o.allowSubmit()),E(),Ct(o.getSubmitText())}},dependencies:[kl,ir,ka,jr,wr,Aa,Xu,Cr,na,xa,ws,Fl,Os,uc,Pa,vL,GM,$R],styles:["mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}.full-width[_ngcontent-%COMP%]{width:100%}.bold[_ngcontent-%COMP%]{font-weight:700}.error-msg[_ngcontent-%COMP%]{color:red}.info-msg[_ngcontent-%COMP%]{color:purple}"]})}return t})();const xpe=["input"],wpe=["label"],Cpe=["*"],Spe=new yt("mat-checkbox-default-options",{providedIn:"root",factory:Bj});function Bj(){return{color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1}}var dd=function(t){return t[t.Init=0]="Init",t[t.Checked=1]="Checked",t[t.Unchecked=2]="Unchecked",t[t.Indeterminate=3]="Indeterminate",t}(dd||{});const Tpe={provide:Pl,useExisting:lo(()=>Pb),multi:!0};class Dpe{source;checked}const Vj=Bj();let Pb=(()=>{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_ngZone=Y(tn);_animationMode=Y(Kr,{optional:!0});_options=Y(Spe,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(e){const n=new Dpe;return n.source=this,n.checked=e,n}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required;labelPosition="after";name=null;change=new Tt;indeterminateChange=new Tt;value;disableRipple;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=dd.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){Y(Rs).load(wu);const e=Y(new Mt("tabindex"),{optional:!0});this._options=this._options||Vj,this.color=this._options.color||Vj.color,this.tabIndex=null==e?0:parseInt(e)||0,this.id=this._uniqueId=Y(ta).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(e){e.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this._indeterminate)}get checked(){return this._checked}set checked(e){e!=this.checked&&(this._checked=e,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(e){e!==this.disabled&&(this._disabled=e,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate}set indeterminate(e){const n=e!=this._indeterminate;this._indeterminate=e,n&&(this._transitionCheckState(this._indeterminate?dd.Indeterminate:this.checked?dd.Checked:dd.Unchecked),this.indeterminateChange.emit(this._indeterminate)),this._syncIndeterminate(this._indeterminate)}_indeterminate=!1;_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(e){this.checked=!!e}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}validate(e){return this.required&&!0!==e.value?{required:!0}:null}registerOnValidatorChange(e){this._validatorChangeFn=e}_transitionCheckState(e){let n=this._currentCheckState,o=this._getAnimationTargetElement();if(n!==e&&o&&(this._currentAnimationClass&&o.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(n,e),this._currentCheckState=e,this._currentAnimationClass.length>0)){o.classList.add(this._currentAnimationClass);const r=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{o.classList.remove(r)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){const e=this._options?.clickAction;this.disabled||"noop"===e?(this.disabled&&this.disabledInteractive||!this.disabled&&"noop"===e)&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate):(this.indeterminate&&"check"!==e&&Promise.resolve().then(()=>{this._indeterminate=!1,this.indeterminateChange.emit(this._indeterminate)}),this._checked=!this._checked,this._transitionCheckState(this._checked?dd.Checked:dd.Unchecked),this._emitChangeEvent())}_onInteractionEvent(e){e.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(e,n){if("NoopAnimations"===this._animationMode)return"";switch(e){case dd.Init:if(n===dd.Checked)return this._animationClasses.uncheckedToChecked;if(n==dd.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case dd.Unchecked:return n===dd.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case dd.Checked:return n===dd.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case dd.Indeterminate:return n===dd.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(e){const n=this._inputElement;n&&(n.nativeElement.indeterminate=e)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(e){e.target&&this._labelElement.nativeElement.contains(e.target)&&e.stopPropagation()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-checkbox"]],viewQuery:function(n,o){if(1&n&&(mn(xpe,5),mn(wpe,5)),2&n){let r;Bt(r=Vt())&&(o._inputElement=r.first),Bt(r=Vt())&&(o._labelElement=r.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(n,o){2&n&&(cc("id",o.id),zn("tabindex",null)("aria-label",null)("aria-labelledby",null),bs(o.color?"mat-"+o.color:"mat-accent"),Hn("_mat-animation-noopable","NoopAnimations"===o._animationMode)("mdc-checkbox--disabled",o.disabled)("mat-mdc-checkbox-disabled",o.disabled)("mat-mdc-checkbox-checked",o.checked)("mat-mdc-checkbox-disabled-interactive",o.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",fn],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",fn],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",fn],tabIndex:[2,"tabIndex","tabIndex",e=>null==e?void 0:Ql(e)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn],checked:[2,"checked","checked",fn],disabled:[2,"disabled","disabled",fn],indeterminate:[2,"indeterminate","indeterminate",fn]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[Bn([Tpe,{provide:ba,useExisting:t,multi:!0}]),go],ngContentSelectors:Cpe,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],[1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],[1,"mdc-checkbox__ripple"],[1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24","aria-hidden","true",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"div",3),we("click",function(y){return fe(r),ge(o._preventBubblingFromLabel(y))}),w(1,"div",4,0)(3,"div",5),we("click",function(){return fe(r),ge(o._onTouchTargetClick())}),x(),w(4,"input",6,1),we("blur",function(){return fe(r),ge(o._onBlur())})("click",function(){return fe(r),ge(o._onInputClick())})("change",function(y){return fe(r),ge(o._onInteractionEvent(y))}),x(),Re(6,"div",7),w(7,"div",8),Va(),w(8,"svg",9),Re(9,"path",10),x(),cu(),Re(10,"div",11),x(),Re(11,"div",12),x(),w(12,"label",13,2),On(14),x()()}if(2&n){const r=Vi(2);N("labelPosition",o.labelPosition),E(4),Hn("mdc-checkbox--selected",o.checked),N("checked",o.checked)("indeterminate",o.indeterminate)("disabled",o.disabled&&!o.disabledInteractive)("id",o.inputId)("required",o.required)("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex),zn("aria-label",o.ariaLabel||null)("aria-labelledby",o.ariaLabelledby)("aria-describedby",o.ariaDescribedby)("aria-checked",o.indeterminate?"mixed":null)("aria-controls",o.ariaControls)("aria-disabled",!(!o.disabled||!o.disabledInteractive)||null)("aria-expanded",o.ariaExpanded)("aria-owns",o.ariaOwns)("name",o.name)("value",o.value),E(7),N("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),E(),N("for",o.inputId)}},dependencies:[Mb,k3],styles:['.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mdc-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mdc-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mdc-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mdc-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mdc-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mdc-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mdc-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mdc-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover .mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mdc-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mdc-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mdc-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mdc-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mdc-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mdc-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mdc-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mdc-checkbox-state-layer-size, 40px);height:var(--mdc-checkbox-state-layer-size, 40px);top:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 40px))/2);right:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 40px))/2);left:calc((var(--mdc-checkbox-state-layer-size, 40px) - var(--mdc-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}@media(forced-colors: active){.mdc-checkbox--disabled{opacity:.5}}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mdc-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mdc-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mdc-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mdc-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mdc-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mdc-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mdc-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mdc-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mdc-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mdc-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mdc-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mdc-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mdc-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mdc-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mdc-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mdc-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mdc-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mdc-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mdc-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:48px;width:48px;transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus~.mat-focus-indicator::before{content:""}\n'],encapsulation:2,changeDetection:0})}return t})(),Mpe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Pb,Ki,Ki]})}return t})(),Tu=(()=>{class t{get vertical(){return this._vertical}set vertical(e){this._vertical=Ps(e)}_vertical=!1;get inset(){return this._inset}set inset(e){this._inset=Ps(e)}_inset=!1;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(n,o){2&n&&(zn("aria-orientation",o.vertical?"vertical":"horizontal"),Hn("mat-divider-vertical",o.vertical)("mat-divider-horizontal",!o.vertical)("mat-divider-inset",o.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(n,o){},styles:[".mat-divider{display:block;margin:0;border-top-style:solid;border-top-color:var(--mat-divider-color, var(--mat-sys-outline));border-top-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-vertical{border-top:0;border-right-style:solid;border-right-color:var(--mat-divider-color, var(--mat-sys-outline));border-right-width:var(--mat-divider-width, 1px)}.mat-divider.mat-divider-inset{margin-left:80px}[dir=rtl] .mat-divider.mat-divider-inset{margin-left:auto;margin-right:80px}\n"],encapsulation:2,changeDetection:0})}return t})(),Uj=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})();function Ape(t,i){if(1&t&&(w(0,"mat-option",23),M(1),x()),2&t){const e=i.$implicit;ys("value",e.key),E(),Ct(e.value)}}function kpe(t,i){if(1&t&&(w(0,"mat-option",23),M(1),x()),2&t){const e=i.$implicit;ys("value",e.key),E(),Ct(e.value)}}function Rpe(t,i){if(1&t&&(w(0,"span")(1,"mat-option",23),M(2),x()()),2&t){const e=i.$implicit;E(),N("value",e),E(),Ct(e)}}function Ope(t,i){if(1&t&&(w(0,"span")(1,"mat-option",23),M(2),x()()),2&t){const e=i.$implicit;E(),N("value",e.value),E(),Ct(e.label)}}function Ppe(t,i){if(1&t&&(w(0,"span"),te(1,Ope,3,2,"span",8),x()),2&t){const e=X();E(),N("ngForOf",e.ps_license_categories[e.license_type])}}function Lpe(t,i){if(1&t&&(w(0,"span")(1,"mat-option",23),M(2),x()()),2&t){const e=i.$implicit;E(),N("value",e.value),E(),Ct(e.label)}}function Fpe(t,i){if(1&t&&(w(0,"span"),te(1,Lpe,3,2,"span",8),x()),2&t){const e=X();E(),N("ngForOf",e.lvp_license_categories[e.license_type])}}function Npe(t,i){if(1&t&&(w(0,"span")(1,"mat-option",23),M(2),x()()),2&t){const e=i.$implicit;E(),N("value",e.value),E(),Ct(e.label)}}function zpe(t,i){if(1&t&&(w(0,"span"),te(1,Npe,3,2,"span",8),x()),2&t){const e=X();E(),N("ngForOf",e.category_stationtypes[e.category])}}function Bpe(t,i){if(1&t&&(w(0,"span")(1,"mat-option",23),M(2),x()()),2&t){const e=i.$implicit;E(),N("value",e.value),E(),Ct(e.label)}}function Vpe(t,i){if(1&t&&(w(0,"span"),te(1,Bpe,3,2,"span",8),x()),2&t){const e=X();E(),N("ngForOf",e.category_stationtypes.management_svr)}}function Upe(t,i){if(1&t&&(w(0,"div",24),M(1),x()),2&t){const e=X();E(),Jt("Cannot be less than activated (",e.activated,")")}}function Hpe(t,i){if(1&t){const e=pt();w(0,"div")(1,"mat-checkbox",25),we("ngModelChange",function(o){const r=fe(e).$implicit;return ge(X(2).onOptionChange(o,r))}),M(2),x()()}if(2&t){const e=i.$implicit,n=X(2);E(),N("ngModel",e.value)("name",e.name)("disabled",e.disabled||!n.isOptionConfigurable(e.name)),E(),Jt(" ",e.label," ")}}function jpe(t,i){if(1&t&&(w(0,"span"),te(1,Hpe,3,4,"div",8),x()),2&t){const e=X();E(),N("ngForOf",e.ps_options)}}function $pe(t,i){if(1&t){const e=pt();w(0,"div")(1,"mat-form-field",3)(2,"mat-label"),M(3),x(),w(4,"input",26),Qn("ngModelChange",function(o){const r=fe(e).$implicit,u=X(2);return ei(u[r.model],o)||(u[r.model]=o),ge(o)}),x()()()}if(2&t){const e=i.$implicit,n=X(2);E(3),Ct(e.name),E(),N("name",e.model),Kn("ngModel",n[e.model])}}function Gpe(t,i){if(1&t&&(w(0,"span"),te(1,$pe,5,3,"div",8),x()),2&t){const e=X();E(),N("ngForOf",e.lvp_options)}}const qpe=li_backendURL+"/option";class Wpe{data;activated;route}class qM{static required=new Set(["site_advanced_dms","option_video"]);static disallowed=new Set(["option_eeg_client"])}let Zpe=(()=>{class t{dialogRef;inputData;http;loginService;dialog;site_hl7=!0;optionMap=new Map;sub_category;license_type;limit;activated;originalData;lvp_clients=1;lvp_acq=1;lvp_obs=1;application;category;version;notes;local_license;local_computerid="";is_subscription;has_promo;po_number="";windowHeight=800;applications=new Map(Wx);license_types=gL;license_versions=Rj;ps_license_categories=Oj;lvp_license_categories=Pj;category_stationtypes=bL;ps_options=Qhe;lvp_options=Jhe;constructor(e,n,o,r,u){this.dialogRef=e,this.inputData=n,this.http=o,this.loginService=r,this.dialog=u;for(let y of this.ps_options)this.optionMap.set(y.name,y),y.value=!1;if(this.activated=n.activated,this.notes=null,this.local_license=!1,this.is_subscription=!1,this.originalData=n.data,this.originalData){this.application=this.originalData.application,this.onAppChange(this.application),this.license_type=this.originalData.license_type,this.version=Xh.GetDisplayVersionString(this.application,this.originalData.version),this.category=this.originalData.category,"standalone"!=this.license_type&&(this.activated=0),this.sub_category=this.originalData.sub_category,this.onStationChange(this.originalData.sub_category),this.notes=this.originalData.notes,this.is_subscription=this.originalData.is_subscription,this.originalData.local_license&&(this.local_license=this.originalData.local_license),this.local_computerid=this.originalData.local_computer_id;for(let y of this.originalData.options)if("string"==typeof y){let I=this.optionMap.get(y);I&&(I.value=!0)}else{let I=y;"limit"==I.name&&(this.limit=I.value),"lvp_clients"==I.name&&(this.lvp_clients=I.value),"lvp_acqs"==I.name&&(this.lvp_acq=I.value),"lvp_obs"==I.name&&(this.lvp_obs=I.value)}}else this.onAppChange("PS")}ngOnInit(){this.windowHeight=window.innerHeight}onResize(e){this.windowHeight=e.target.innerHeight}toggleOptionEnable(e){if("LVP"==this.application)return!1;let n=this.optionMap.get(e);n.disabled=!this.isOptionConfigurable(e),n.disabled&&(n.value=this.isOptionRequired(e))}allowLicenseTypeChange(){return!("acq"==this.category||this.local_license||"LVP"==this.application||null!=this.originalData)}allowApplicationChange(){return null==this.originalData&&!this.local_license}allowSubscription(e,n,o){return Xh.SoftwareVersionAllowsSubscription(e,n,o)}onAppChange(e){if(this.application=e,"LVP"!=e){for(let o of this.ps_options)this.toggleOptionEnable(o.name);this.onCategoryChange("PS"!=e&&"PS-ems"!=e?"review":this.category),this.onStationChange("PS"!=e&&"PS-ems"!=e?"station_review_analysis":this.sub_category)}else this.limit=1,this.category="management_svr",this.sub_category="lvp_server",this.onCategoryChange(this.category),this.onStationChange(this.sub_category);this.is_subscription&&!this.allowSubscription(this.application,this.version,this.license_type)&&(this.is_subscription=!1);let n=this.license_versions[this.application];1==n.length&&(this.version=n[0])}onVersionChange(e){this.is_subscription&&!this.allowSubscription(this.application,this.version,this.license_type)&&(this.is_subscription=!1)}onCategoryChange(e){this.category=e,("acq"==this.category||"LVP"==this.application)&&this.onLicenseTypeChange("standalone"),this.onStationChange("LVP"==this.application?"lvp_server":"review"==this.category?"station_review_analysis":"station_onebed")}onLicenseTypeChange(e){this.license_type=e,"ondemand"==this.license_type&&this.onCategoryChange("review"),this.is_subscription&&!this.allowSubscription(this.application,this.version,this.license_type)&&(this.is_subscription=!1)}onStationChange(e){this.sub_category=e,this.toggleOptionEnable("option_video")}onToggleIsSubscription(){this.is_subscription=!this.local_license&&!this.is_subscription}onToggleLocalServer(){this.local_license="standalone"!=this.license_type&&!this.is_subscription&&!this.local_license}onOptionChange(e,n){n.value=e,"site_hl7"==n.name&&e&&(this.optionMap.get("site_advanced_dms").value=!0),"site_advanced_dms"==n.name&&!e&&(this.optionMap.get("site_hl7").value=!1)}valuesAreValid(){return this.activated>0?this.limit>=this.activated:this.limit>=1}onSubmit(){let e=null;"LVP"!=this.application?e=this.ps_options.filter(q=>q.value).map(q=>q.name):(e=new Array,e.push({name:"lvp_clients",value:this.lvp_clients}),e.push({name:"lvp_acqs",value:this.lvp_acq}),e.push({name:"lvp_obs",value:this.lvp_obs})),e.push({name:"limit",value:this.limit});let n,o=null;this.originalData?(n=qpe+"/"+this.originalData.id,o=this.originalData.uuid):n=this.loginService.getURL("option",this.inputData.route),null!=this.notes&&""==this.notes.trim()&&(this.notes=null);let r=Xh.GetBackendVersionString(this.application,this.version);this.http.post(n,{uuid:o,application:this.application,version:r,category:this.category,sub_category:this.sub_category,license_type:this.license_type,options:e,local_license:this.local_license,notes:this.notes,is_subscription:this.is_subscription,purchase_order:this.po_number},{withCredentials:!0}).subscribe(V=>{this.originalData?(Object.assign(this.originalData,V),this.dialogRef.close(!0)):this.dialogRef.close(V)})}isReviewStation(){return"station_review"==this.sub_category||"station_review_analysis"==this.sub_category}isOptionConfigurable(e){return"PS-ems"==this.application?!(qM.required.has(e)||qM.disallowed.has(e)):"option_video"==e?"PS"==this.application&&!this.isReviewStation():"PS"==this.application}isOptionRequired(e){return"PS-ems"==this.application?qM.required.has(e):"PS"==this.application&&"option_video"!=e}isOptionDisallowed(e){return"PS-ems"==this.application?qM.disallowed.has(e):"PS"!=this.application}selectPurchaseOrder(){let e=new Zx;e.navigated_org=this.loginService.getOrg(this.inputData.route),e.config_type=cf.PO_CONFIG_SELECT;let n=new ha;n.minWidth=400,n.data=e,this.dialog.open(Yx,n).afterClosed().subscribe(u=>{null!=u&&(this.po_number=u)})}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(Po),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-options-edit"]],hostBindings:function(n,o){1&n&&we("resize",function(u){return o.onResize(u)},0,Lp)},standalone:!1,decls:75,vars:34,consts:[["optionEditForm","ngForm"],[3,"submit"],[1,"dialog-content"],["hideRequiredMarker",""],["required","","name","licensetype",3,"ngModelChange","ngModel","disabled"],[3,"value",4,"ngFor","ngForOf"],["required","","name","application",3,"ngModelChange","ngModel","disabled"],["required","","name","version",3,"ngModelChange","ngModel","disabled"],[4,"ngFor","ngForOf"],["required","","name","category",3,"ngModelChange","ngModel","disabled"],[4,"ngIf"],["required","","name","station",3,"ngModelChange","ngModel","disabled"],["required","","name","limit","min","0","type","number","matInput","",3,"ngModelChange","ngModel"],["class","margin-bottom-thin custom-error",4,"ngIf"],["required","","name","po_number","matInput","","readonly","",3,"ngModelChange","ngModel"],["mat-icon-button","","matSuffix","","aria-label","Select PO","type","button",3,"click"],["fontSet","material-symbols-outlined"],["name","notes","matInput","",3,"ngModelChange","ngModel"],["role","presentation"],["name","is_subscription",3,"ngModelChange","ngModel","checked","disabled"],["name","local_license",3,"ngModelChange","ngModel","checked","disabled"],["align","end"],["mat-raised-button","","color","primary","type","submit",1,"submit-btn",3,"disabled"],[3,"value"],[1,"margin-bottom-thin","custom-error"],[3,"ngModelChange","ngModel","name","disabled"],["required","","min","0","type","number","matInput","",3,"ngModelChange","name","ngModel"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("submit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content",2)(3,"mat-form-field",3)(4,"mat-label"),M(5,"License Type"),x(),w(6,"mat-select",4),we("ngModelChange",function(y){return fe(r),ge(o.onLicenseTypeChange(y))}),te(7,Ape,2,2,"mat-option",5),ti(8,"keyvalue"),x()(),w(9,"mat-form-field",3)(10,"mat-label"),M(11,"Application"),x(),w(12,"mat-select",6),Qn("ngModelChange",function(y){return fe(r),ei(o.application,y)||(o.application=y),ge(y)}),we("ngModelChange",function(y){return fe(r),ge(o.onAppChange(y))}),te(13,kpe,2,2,"mat-option",5),ti(14,"keyvalue"),x()(),w(15,"mat-form-field",3)(16,"mat-label"),M(17,"Version"),x(),w(18,"mat-select",7),Qn("ngModelChange",function(y){return fe(r),ei(o.version,y)||(o.version=y),ge(y)}),we("ngModelChange",function(y){return fe(r),ge(o.onVersionChange(y))}),te(19,Rpe,3,2,"span",8),x()(),w(20,"mat-form-field",3)(21,"mat-label"),M(22,"Category"),x(),w(23,"mat-select",9),we("ngModelChange",function(y){return fe(r),ge(o.onCategoryChange(y))}),te(24,Ppe,2,1,"span",10)(25,Fpe,2,1,"span",10),x()(),w(26,"mat-form-field",3)(27,"mat-label"),M(28,"Station type"),x(),w(29,"mat-select",11),we("ngModelChange",function(y){return fe(r),ge(o.onStationChange(y))}),te(30,zpe,2,1,"span",10)(31,Vpe,2,1,"span",10),x()(),w(32,"mat-form-field",3)(33,"mat-label"),M(34,"Limit"),x(),w(35,"input",12),Qn("ngModelChange",function(y){return fe(r),ei(o.limit,y)||(o.limit=y),ge(y)}),x(),te(36,Upe,2,1,"div",13),x(),w(37,"mat-form-field")(38,"mat-label"),M(39,"PO Number"),x(),w(40,"input",14),Qn("ngModelChange",function(y){return fe(r),ei(o.po_number,y)||(o.po_number=y),ge(y)}),x(),w(41,"button",15),we("click",function(){return fe(r),ge(o.selectPurchaseOrder())}),w(42,"mat-icon",16),M(43,"add"),x()()(),w(44,"mat-form-field")(45,"mat-label"),M(46,"Notes"),x(),w(47,"input",17),Qn("ngModelChange",function(y){return fe(r),ei(o.notes,y)||(o.notes=y),ge(y)}),x()(),w(48,"mat-accordion")(49,"mat-expansion-panel")(50,"mat-expansion-panel-header"),M(51,"Options"),x(),te(52,jpe,2,1,"span",10)(53,Gpe,2,1,"span",10),x()(),Re(54,"mat-divider"),w(55,"div")(56,"table",18),Re(57,"th"),w(58,"td")(59,"mat-slide-toggle",19),we("ngModelChange",function(){return fe(r),ge(o.onToggleIsSubscription())}),x()(),w(60,"td")(61,"mat-label"),M(62,"Subscription"),x()()()(),Re(63,"mat-divider"),w(64,"div")(65,"table",18),Re(66,"th"),w(67,"td")(68,"mat-slide-toggle",20),we("ngModelChange",function(){return fe(r),ge(o.onToggleLocalServer())}),x()(),w(69,"td")(70,"mat-label"),M(71,"Private Server"),x()()()()(),w(72,"mat-dialog-actions",21)(73,"button",22),M(74,"Save"),x()()()}if(2&n){const r=Vi(1);E(6),N("ngModel",o.license_type)("disabled",!o.allowLicenseTypeChange()),E(),N("ngForOf",Zm(8,30,o.license_types)),E(5),Kn("ngModel",o.application),N("disabled",!o.allowApplicationChange()),E(),N("ngForOf",Zm(14,32,o.applications)),E(5),Kn("ngModel",o.version),N("disabled",1==o.license_versions[o.application].length),E(),N("ngForOf",o.license_versions[o.application]),E(4),N("ngModel",o.category)("disabled","PS"!=o.application&&"PS-ems"!=o.application||"ondemand"==o.license_type),E(),N("ngIf","LVP"!=o.application),E(),N("ngIf","LVP"==o.application),E(4),N("ngModel",o.sub_category)("disabled","PS-blunet"==o.application||"LVP"==o.application||"PS-ems"==o.application&&"review"==o.category),E(),N("ngIf","LVP"!=o.application),E(),N("ngIf","LVP"==o.application),E(4),Kn("ngModel",o.limit),E(),N("ngIf",o.limit{class t{loginService;dialogRef;data;http;errorService;applications=new Map(Wx);ntAdmin;adminLite;code;generateNewCode=!1;retainNotes=!1;constructor(e,n,o,r,u){this.loginService=e,this.dialogRef=n,this.data=o,this.http=r,this.errorService=u}ngOnInit(){this.code="",this.ntAdmin=this.loginService.getUserInfo().priv>=Nl.PRIV_ADMIN2,this.adminLite=this.loginService.getUserInfo().priv==Nl.PRIV_ADMIN2}getApplicationName(){let e=this.data.application;return this.applications.has(this.data.application)&&(e=this.applications.get(this.data.application)),e}onCancel(){this.dialogRef.close(!1)}onSubmit(){let e=ome+this.data.id+"/+revoke",n={};!this.ntAdmin&&this.data.last_renewed&&(n.code=this.code),this.ntAdmin&&(n.regenActivation=this.generateNewCode,n.retainNotes=this.retainNotes),this.http.post(e,n,{withCredentials:!0}).subscribe(u=>{u.result?this.dialogRef.close(!0):this.errorService.report("The code was not accepted. Please verify the code and try again.")})}static \u0275fac=function(n){return new(n||t)($e(Po),$e(xs),$e(Ks),$e(Uo),$e(n0))};static \u0275cmp=cn({type:t,selectors:[["app-revoke"]],standalone:!1,decls:17,vars:7,consts:[["revokeEditForm","ngForm"],["message",""],[3,"ngSubmit"],[2,"text-align","center"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"button-div"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["mat-raised-button","","color","primary","type","button",3,"click"],["hideRequiredMarker",""],["matInput","","required","","name","code","placeholder","Code",3,"ngModelChange","ngModel"],["name","GenerateNewCode",3,"ngModelChange","ngModel"],["name","RetainNotes",3,"ngModelChange","ngModel"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",2,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content",3)(3,"h3"),M(4),x(),te(5,Ype,5,2,"div",4)(6,Qpe,2,2,"ng-template",null,1,Ud)(8,Jpe,1,0,"mat-divider",5)(9,ime,6,4,"div",5),Re(10,"mat-divider"),w(11,"div",6)(12,"button",7),M(13,"OK"),x(),M(14," \xa0 "),w(15,"button",8),we("click",function(){return fe(r),ge(o.onCancel())}),M(16,"Cancel"),x()()()()}if(2&n){const r=Vi(1),u=Vi(7);E(4),Ea("",o.data.computername," : ",o.data.activationcode,""),E(),N("ngIf",!o.ntAdmin&&o.data.last_renewed)("ngIfElse",u),E(3),N("ngIf",o.ntAdmin&&null==o.data.usb_serial),E(),N("ngIf",o.ntAdmin&&null==o.data.usb_serial),E(3),N("disabled",!o.ntAdmin&&o.data.last_renewed&&!r.form.valid)}},dependencies:[ir,ka,jr,wr,Aa,Jl,ts,Cr,na,xa,ws,Os,Pb,Tu],styles:["div.button-div[_ngcontent-%COMP%]{display:block;margin:auto;width:60%}mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}"]})}return t})();const Hj=new yt("MAT_DATE_LOCALE",{providedIn:"root",factory:function ame(){return Y(__)}}),Xx="Method not implemented";class kc{locale;_localeChanges=new Ee;localeChanges=this._localeChanges;setTime(i,e,n,o){throw new Error(Xx)}getHours(i){throw new Error(Xx)}getMinutes(i){throw new Error(Xx)}getSeconds(i){throw new Error(Xx)}parseTime(i,e){throw new Error(Xx)}addSeconds(i,e){throw new Error(Xx)}getValidDateOrNull(i){return this.isDateInstance(i)&&this.isValid(i)?i:null}deserialize(i){return null==i||this.isDateInstance(i)&&this.isValid(i)?i:this.invalid()}setLocale(i){this.locale=i,this._localeChanges.next()}compareDate(i,e){return this.getYear(i)-this.getYear(e)||this.getMonth(i)-this.getMonth(e)||this.getDate(i)-this.getDate(e)}compareTime(i,e){return this.getHours(i)-this.getHours(e)||this.getMinutes(i)-this.getMinutes(e)||this.getSeconds(i)-this.getSeconds(e)}sameDate(i,e){if(i&&e){let n=this.isValid(i),o=this.isValid(e);return n&&o?!this.compareDate(i,e):n==o}return i==e}sameTime(i,e){if(i&&e){const n=this.isValid(i),o=this.isValid(e);return n&&o?!this.compareTime(i,e):n==o}return i==e}clampDate(i,e,n){return e&&this.compareDate(i,e)<0?e:n&&this.compareDate(i,n)>0?n:i}}const Kx=new yt("mat-date-formats"),lme=["mat-calendar-body",""];function cme(t,i){return this._trackRow(i)}const jj=(t,i)=>i.id;function dme(t,i){if(1&t&&(w(0,"tr",0)(1,"td",3),M(2),x()()),2&t){const e=X();E(),Jc("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),zn("colspan",e.numCols),E(),Jt(" ",e.label," ")}}function ume(t,i){if(1&t&&(w(0,"td",3),M(1),x()),2&t){const e=X(2);Jc("padding-top",e._cellPadding)("padding-bottom",e._cellPadding),zn("colspan",e._firstRowOffset),E(),Jt(" ",e._firstRowOffset>=e.labelMinRequiredCells?e.label:""," ")}}function hme(t,i){if(1&t){const e=pt();w(0,"td",6)(1,"button",7),we("click",function(o){const r=fe(e).$implicit;return ge(X(2)._cellClicked(r,o))})("focus",function(o){const r=fe(e).$implicit;return ge(X(2)._emitActiveDateChange(r,o))}),w(2,"span",8),M(3),x(),Re(4,"span",9),x()()}if(2&t){const e=i.$implicit,n=i.$index,o=X().$index,r=X();Jc("width",r._cellWidth)("padding-top",r._cellPadding)("padding-bottom",r._cellPadding),zn("data-mat-row",o)("data-mat-col",n),E(),Hn("mat-calendar-body-disabled",!e.enabled)("mat-calendar-body-active",r._isActiveCell(o,n))("mat-calendar-body-range-start",r._isRangeStart(e.compareValue))("mat-calendar-body-range-end",r._isRangeEnd(e.compareValue))("mat-calendar-body-in-range",r._isInRange(e.compareValue))("mat-calendar-body-comparison-bridge-start",r._isComparisonBridgeStart(e.compareValue,o,n))("mat-calendar-body-comparison-bridge-end",r._isComparisonBridgeEnd(e.compareValue,o,n))("mat-calendar-body-comparison-start",r._isComparisonStart(e.compareValue))("mat-calendar-body-comparison-end",r._isComparisonEnd(e.compareValue))("mat-calendar-body-in-comparison-range",r._isInComparisonRange(e.compareValue))("mat-calendar-body-preview-start",r._isPreviewStart(e.compareValue))("mat-calendar-body-preview-end",r._isPreviewEnd(e.compareValue))("mat-calendar-body-in-preview",r._isInPreview(e.compareValue)),N("ngClass",e.cssClasses)("tabindex",r._isActiveCell(o,n)?0:-1),zn("aria-label",e.ariaLabel)("aria-disabled",!e.enabled||null)("aria-pressed",r._isSelected(e.compareValue))("aria-current",r.todayValue===e.compareValue?"date":null)("aria-describedby",r._getDescribedby(e.compareValue)),E(),Hn("mat-calendar-body-selected",r._isSelected(e.compareValue))("mat-calendar-body-comparison-identical",r._isComparisonIdentical(e.compareValue))("mat-calendar-body-today",r.todayValue===e.compareValue),E(),Jt(" ",e.displayValue," ")}}function pme(t,i){if(1&t&&(w(0,"tr",1),te(1,ume,2,6,"td",4),Sv(2,hme,5,48,"td",5,jj),x()),2&t){const e=i.$implicit,n=i.$index,o=X();E(),Xi(0===n&&o._firstRowOffset?1:-1),E(),Tv(e)}}function mme(t,i){if(1&t&&(w(0,"th",2)(1,"span",6),M(2),x(),w(3,"span",3),M(4),x()()),2&t){const e=i.$implicit;E(2),Ct(e.long),E(2),Ct(e.narrow)}}const fme=["*"];function _me(t,i){}function gme(t,i){if(1&t){const e=pt();w(0,"mat-month-view",4),Qn("activeDateChange",function(o){fe(e);const r=X();return ei(r.activeDate,o)||(r.activeDate=o),ge(o)}),we("_userSelection",function(o){return fe(e),ge(X()._dateSelected(o))})("dragStarted",function(o){return fe(e),ge(X()._dragStarted(o))})("dragEnded",function(o){return fe(e),ge(X()._dragEnded(o))}),x()}if(2&t){const e=X();Kn("activeDate",e.activeDate),N("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)("comparisonStart",e.comparisonStart)("comparisonEnd",e.comparisonEnd)("startDateAccessibleName",e.startDateAccessibleName)("endDateAccessibleName",e.endDateAccessibleName)("activeDrag",e._activeDrag)}}function bme(t,i){if(1&t){const e=pt();w(0,"mat-year-view",5),Qn("activeDateChange",function(o){fe(e);const r=X();return ei(r.activeDate,o)||(r.activeDate=o),ge(o)}),we("monthSelected",function(o){return fe(e),ge(X()._monthSelectedInYearView(o))})("selectedChange",function(o){return fe(e),ge(X()._goToDateInView(o,"month"))}),x()}if(2&t){const e=X();Kn("activeDate",e.activeDate),N("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function yme(t,i){if(1&t){const e=pt();w(0,"mat-multi-year-view",6),Qn("activeDateChange",function(o){fe(e);const r=X();return ei(r.activeDate,o)||(r.activeDate=o),ge(o)}),we("yearSelected",function(o){return fe(e),ge(X()._yearSelectedInMultiYearView(o))})("selectedChange",function(o){return fe(e),ge(X()._goToDateInView(o,"year"))}),x()}if(2&t){const e=X();Kn("activeDate",e.activeDate),N("selected",e.selected)("dateFilter",e.dateFilter)("maxDate",e.maxDate)("minDate",e.minDate)("dateClass",e.dateClass)}}function vme(t,i){}const xme=["button"],wme=[[["","matDatepickerToggleIcon",""]]],Cme=["[matDatepickerToggleIcon]"];function Sme(t,i){1&t&&(Va(),w(0,"svg",2),Re(1,"path",3),x())}const Tme=[[["input","matStartDate",""]],[["input","matEndDate",""]]],Dme=["input[matStartDate]","input[matEndDate]"];let Qx=(()=>{class t{changes=new Ee;calendarLabel="Calendar";openCalendarLabel="Open calendar";closeCalendarLabel="Close calendar";prevMonthLabel="Previous month";nextMonthLabel="Next month";prevYearLabel="Previous year";nextYearLabel="Next year";prevMultiYearLabel="Previous 24 years";nextMultiYearLabel="Next 24 years";switchToMonthViewLabel="Choose date";switchToMultiYearViewLabel="Choose month and year";startDateLabel="Start date";endDateLabel="End date";comparisonDateLabel="Comparison range";formatYearRange(e,n){return`${e} \u2013 ${n}`}formatYearRangeLabel(e,n){return`${e} to ${n}`}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Ime=0;class xL{value;displayValue;ariaLabel;enabled;cssClasses;compareValue;rawValue;id=Ime++;constructor(i,e,n,o,r={},u=i,y){this.value=i,this.displayValue=e,this.ariaLabel=n,this.enabled=o,this.cssClasses=r,this.compareValue=u,this.rawValue=y}}const Eme={passive:!1,capture:!0},WM={passive:!0,capture:!0},$j={passive:!0};let Jx=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);_platform=Y(ea);_intl=Y(Qx);_eventCleanups;_skipNextFocus;_focusActiveCellAfterViewChecked=!1;label;rows;todayValue;startValue;endValue;labelMinRequiredCells;numCols=7;activeCell=0;ngAfterViewChecked(){this._focusActiveCellAfterViewChecked&&(this._focusActiveCell(),this._focusActiveCellAfterViewChecked=!1)}isRange=!1;cellAspectRatio=1;comparisonStart;comparisonEnd;previewStart=null;previewEnd=null;startDateAccessibleName;endDateAccessibleName;selectedValueChange=new Tt;previewChange=new Tt;activeDateChange=new Tt;dragStarted=new Tt;dragEnded=new Tt;_firstRowOffset;_cellPadding;_cellWidth;_startDateLabelId;_endDateLabelId;_comparisonStartDateLabelId;_comparisonEndDateLabelId;_didDragSinceMouseDown=!1;_injector=Y(Ke);comparisonDateAccessibleName=this._intl.comparisonDateLabel;_trackRow=e=>e;constructor(){const e=Y(Hr),n=Y(ta);this._startDateLabelId=n.getId("mat-calendar-body-start-"),this._endDateLabelId=n.getId("mat-calendar-body-end-"),this._comparisonStartDateLabelId=n.getId("mat-calendar-body-comparison-start-"),this._comparisonEndDateLabelId=n.getId("mat-calendar-body-comparison-end-"),Y(Rs).load(wu),this._ngZone.runOutsideAngular(()=>{const o=this._elementRef.nativeElement,r=[ec(e,o,"touchmove",this._touchmoveHandler,Eme),ec(e,o,"mouseenter",this._enterHandler,WM),ec(e,o,"focus",this._enterHandler,WM),ec(e,o,"mouseleave",this._leaveHandler,WM),ec(e,o,"blur",this._leaveHandler,WM),ec(e,o,"mousedown",this._mousedownHandler,$j),ec(e,o,"touchstart",this._mousedownHandler,$j)];this._platform.isBrowser&&r.push(e.listen("window","mouseup",this._mouseupHandler),e.listen("window","touchend",this._touchendHandler)),this._eventCleanups=r})}_cellClicked(e,n){this._didDragSinceMouseDown||e.enabled&&this.selectedValueChange.emit({value:e.value,event:n})}_emitActiveDateChange(e,n){e.enabled&&this.activeDateChange.emit({value:e.value,event:n})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){const n=e.numCols,{rows:o,numCols:r}=this;(e.rows||n)&&(this._firstRowOffset=o&&o.length&&o[0].length?r-o[0].length:0),(e.cellAspectRatio||n||!this._cellPadding)&&(this._cellPadding=50*this.cellAspectRatio/r+"%"),(n||!this._cellWidth)&&(this._cellWidth=100/r+"%")}ngOnDestroy(){this._eventCleanups.forEach(e=>e())}_isActiveCell(e,n){let o=e*this.numCols+n;return e&&(o-=this._firstRowOffset),o==this.activeCell}_focusActiveCell(e=!0){As(()=>{setTimeout(()=>{const n=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");n&&(e||(this._skipNextFocus=!0),n.focus())})},{injector:this._injector})}_scheduleFocusActiveCellAfterViewChecked(){this._focusActiveCellAfterViewChecked=!0}_isRangeStart(e){return SL(e,this.startValue,this.endValue)}_isRangeEnd(e){return TL(e,this.startValue,this.endValue)}_isInRange(e){return DL(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return SL(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,n,o){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let r=this.rows[n][o-1];if(!r){const u=this.rows[n-1];r=u&&u[u.length-1]}return r&&!this._isRangeEnd(r.compareValue)}_isComparisonBridgeEnd(e,n,o){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let r=this.rows[n][o+1];if(!r){const u=this.rows[n+1];r=u&&u[0]}return r&&!this._isRangeStart(r.compareValue)}_isComparisonEnd(e){return TL(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return DL(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return SL(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return TL(e,this.previewStart,this.previewEnd)}_isInPreview(e){return DL(e,this.previewStart,this.previewEnd,this.isRange)}_getDescribedby(e){if(!this.isRange)return null;if(this.startValue===e&&this.endValue===e)return`${this._startDateLabelId} ${this._endDateLabelId}`;if(this.startValue===e)return this._startDateLabelId;if(this.endValue===e)return this._endDateLabelId;if(null!==this.comparisonStart&&null!==this.comparisonEnd){if(e===this.comparisonStart&&e===this.comparisonEnd)return`${this._comparisonStartDateLabelId} ${this._comparisonEndDateLabelId}`;if(e===this.comparisonStart)return this._comparisonStartDateLabelId;if(e===this.comparisonEnd)return this._comparisonEndDateLabelId}return null}_enterHandler=e=>{if(this._skipNextFocus&&"focus"===e.type)this._skipNextFocus=!1;else if(e.target&&this.isRange){const n=this._getCellFromElement(e.target);n&&this._ngZone.run(()=>this.previewChange.emit({value:n.enabled?n:null,event:e}))}};_touchmoveHandler=e=>{if(!this.isRange)return;const n=Gj(e),o=n?this._getCellFromElement(n):null;n!==e.target&&(this._didDragSinceMouseDown=!0),CL(e.target)&&e.preventDefault(),this._ngZone.run(()=>this.previewChange.emit({value:o?.enabled?o:null,event:e}))};_leaveHandler=e=>{null!==this.previewEnd&&this.isRange&&("blur"!==e.type&&(this._didDragSinceMouseDown=!0),e.target&&this._getCellFromElement(e.target)&&(!e.relatedTarget||!this._getCellFromElement(e.relatedTarget))&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:e})))};_mousedownHandler=e=>{if(!this.isRange)return;this._didDragSinceMouseDown=!1;const n=e.target&&this._getCellFromElement(e.target);!n||!this._isInRange(n.compareValue)||this._ngZone.run(()=>{this.dragStarted.emit({value:n.rawValue,event:e})})};_mouseupHandler=e=>{if(!this.isRange)return;const n=CL(e.target);n?n.closest(".mat-calendar-body")===this._elementRef.nativeElement&&this._ngZone.run(()=>{const o=this._getCellFromElement(n);this.dragEnded.emit({value:o?.rawValue??null,event:e})}):this._ngZone.run(()=>{this.dragEnded.emit({value:null,event:e})})};_touchendHandler=e=>{const n=Gj(e);n&&this._mouseupHandler({target:n})};_getCellFromElement(e){const n=CL(e);if(n){const o=n.getAttribute("data-mat-row"),r=n.getAttribute("data-mat-col");if(o&&r)return this.rows[parseInt(o)][parseInt(r)]}return null}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["","mat-calendar-body",""]],hostAttrs:[1,"mat-calendar-body"],inputs:{label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",previewStart:"previewStart",previewEnd:"previewEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange",activeDateChange:"activeDateChange",dragStarted:"dragStarted",dragEnded:"dragEnded"},exportAs:["matCalendarBody"],features:[go],attrs:lme,decls:11,vars:11,consts:[["aria-hidden","true"],["role","row"],[1,"mat-calendar-body-hidden-label",3,"id"],[1,"mat-calendar-body-label"],[1,"mat-calendar-body-label",3,"paddingTop","paddingBottom"],["role","gridcell",1,"mat-calendar-body-cell-container",3,"width","paddingTop","paddingBottom"],["role","gridcell",1,"mat-calendar-body-cell-container"],["type","button",1,"mat-calendar-body-cell",3,"click","focus","ngClass","tabindex"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],["aria-hidden","true",1,"mat-calendar-body-cell-preview"]],template:function(n,o){1&n&&(te(0,dme,3,6,"tr",0),Sv(1,pme,4,1,"tr",1,cme,!0),w(3,"span",2),M(4),x(),w(5,"span",2),M(6),x(),w(7,"span",2),M(8),x(),w(9,"span",2),M(10),x()),2&n&&(Xi(o._firstRowOffset.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){color:var(--mat-datepicker-calendar-date-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-calendar-body-disabled>.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-disabled-state-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-calendar-body-disabled{opacity:.5}}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px;color:var(--mat-datepicker-calendar-date-text-color, var(--mat-sys-on-surface));border-color:var(--mat-datepicker-calendar-date-outline-color, transparent)}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}@media(forced-colors: active){.mat-calendar-body-cell-content{border:none}}.cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical),.cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-focus-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(hover: hover){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-hover-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}}.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color, var(--mat-sys-primary));color:var(--mat-datepicker-calendar-date-selected-state-text-color, var(--mat-sys-on-primary))}.mat-calendar-body-disabled>.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-disabled-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-calendar-body-selected.mat-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mat-datepicker-calendar-date-today-selected-state-outline-color, var(--mat-sys-primary))}.mat-calendar-body-in-range::before{background:var(--mat-datepicker-calendar-date-in-range-state-background-color, var(--mat-sys-primary-container))}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color, var(--mat-sys-tertiary-container))}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color, var(--mat-sys-tertiary-container))}.mat-calendar-body-comparison-bridge-start::before,[dir=rtl] .mat-calendar-body-comparison-bridge-end::before{background:linear-gradient(to right, var(--mat-datepicker-calendar-date-in-range-state-background-color, var(--mat-sys-primary-container)) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color, var(--mat-sys-tertiary-container)) 50%)}.mat-calendar-body-comparison-bridge-end::before,[dir=rtl] .mat-calendar-body-comparison-bridge-start::before{background:linear-gradient(to left, var(--mat-datepicker-calendar-date-in-range-state-background-color, var(--mat-sys-primary-container)) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color, var(--mat-sys-tertiary-container)) 50%)}.mat-calendar-body-in-range>.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range.mat-calendar-body-in-range::after{background:var(--mat-datepicker-calendar-date-in-overlap-range-state-background-color, var(--mat-sys-secondary-container))}.mat-calendar-body-comparison-identical.mat-calendar-body-selected,.mat-calendar-body-in-comparison-range>.mat-calendar-body-selected{background:var(--mat-datepicker-calendar-date-in-overlap-range-selected-state-background-color, var(--mat-sys-secondary))}@media(forced-colors: active){.mat-datepicker-popup:not(:empty),.mat-calendar-body-cell:not(.mat-calendar-body-in-range) .mat-calendar-body-selected{outline:solid 1px}.mat-calendar-body-today{outline:dotted 1px}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-selected{background:none}.mat-calendar-body-in-range::before,.mat-calendar-body-comparison-bridge-start::before,.mat-calendar-body-comparison-bridge-end::before{border-top:solid 1px;border-bottom:solid 1px}.mat-calendar-body-range-start::before{border-left:solid 1px}[dir=rtl] .mat-calendar-body-range-start::before{border-left:0;border-right:solid 1px}.mat-calendar-body-range-end::before{border-right:solid 1px}[dir=rtl] .mat-calendar-body-range-end::before{border-right:0;border-left:solid 1px}.mat-calendar-body-in-comparison-range::before{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-comparison-start::before{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-comparison-start::before{border-left:0;border-right:dashed 1px}.mat-calendar-body-comparison-end::before{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-comparison-end::before{border-right:0;border-left:dashed 1px}}\n'],encapsulation:2,changeDetection:0})}return t})();function wL(t){return"TD"===t?.nodeName}function CL(t){let i;return wL(t)?i=t:wL(t.parentNode)?i=t.parentNode:wL(t.parentNode?.parentNode)&&(i=t.parentNode.parentNode),null!=i?.getAttribute("data-mat-row")?i:null}function SL(t,i,e){return null!==e&&i!==e&&t=i&&t===e}function DL(t,i,e,n){return n&&null!==i&&null!==e&&i!==e&&t>=i&&t<=e}function Gj(t){const i=t.changedTouches[0];return document.elementFromPoint(i.clientX,i.clientY)}class Rc{start;end;_disableStructuralEquivalency;constructor(i,e){this.start=i,this.end=e}}let Lb=(()=>{class t{selection;_adapter;_selectionChanged=new Ee;selectionChanged=this._selectionChanged;constructor(e,n){this.selection=e,this._adapter=n,this.selection=e}updateSelection(e,n){const o=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:n,oldValue:o})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}static \u0275fac=function(n){Up()};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),Mme=(()=>{class t extends Lb{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return null!=this.selection&&this._isValidDateInstance(this.selection)}isComplete(){return null!=this.selection}clone(){const e=new t(this._adapter);return e.updateSelection(this.selection,this),e}static \u0275fac=function(n){return new(n||t)(xn(kc))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})(),Ame=(()=>{class t extends Lb{constructor(e){super(new Rc(null,null),e)}add(e){let{start:n,end:o}=this.selection;null==n?n=e:null==o?o=e:(n=e,o=null),super.updateSelection(new Rc(n,o),this)}isValid(){const{start:e,end:n}=this.selection;return null==e&&null==n||(null!=e&&null!=n?this._isValidDateInstance(e)&&this._isValidDateInstance(n)&&this._adapter.compareDate(e,n)<=0:(null==e||this._isValidDateInstance(e))&&(null==n||this._isValidDateInstance(n)))}isComplete(){return null!=this.selection.start&&null!=this.selection.end}clone(){const e=new t(this._adapter);return e.updateSelection(this.selection,this),e}static \u0275fac=function(n){return new(n||t)(xn(kc))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const qj={provide:Lb,deps:[[new oc,new _l,Lb],kc],useFactory:function kme(t,i){return t||new Mme(i)}},Ome={provide:Lb,deps:[[new oc,new _l,Lb],kc],useFactory:function Rme(t,i){return t||new Ame(i)}},ZM=new yt("MAT_DATE_RANGE_SELECTION_STRATEGY");let Pme=(()=>{class t{_dateAdapter;constructor(e){this._dateAdapter=e}selectionFinished(e,n){let{start:o,end:r}=n;return null==o?o=e:null==r&&e&&this._dateAdapter.compareDate(e,o)>=0?r=e:(o=e,r=null),new Rc(o,r)}createPreview(e,n){let o=null,r=null;return n.start&&!n.end&&e&&(o=n.start,r=e),new Rc(o,r)}createDrag(e,n,o){let r=n.start,u=n.end;if(!r||!u)return null;const y=this._dateAdapter,I=0!==y.compareDate(r,u),V=y.getYear(o)-y.getYear(e),q=y.getMonth(o)-y.getMonth(e),ee=y.getDate(o)-y.getDate(e);return I&&y.sameDate(e,n.start)?(r=o,y.compareDate(o,u)>0&&(u=y.addCalendarYears(u,V),u=y.addCalendarMonths(u,q),u=y.addCalendarDays(u,ee))):I&&y.sameDate(e,n.end)?(u=o,y.compareDate(o,r)<0&&(r=y.addCalendarYears(r,V),r=y.addCalendarMonths(r,q),r=y.addCalendarDays(r,ee))):(r=y.addCalendarYears(r,V),r=y.addCalendarMonths(r,q),r=y.addCalendarDays(r,ee),u=y.addCalendarYears(u,V),u=y.addCalendarMonths(u,q),u=y.addCalendarDays(u,ee)),new Rc(r,u)}static \u0275fac=function(n){return new(n||t)(xn(kc))};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();const Fme={provide:ZM,deps:[[new oc,new _l,ZM],kc],useFactory:function Lme(t,i){return t||new Pme(i)}};let Nme=0,Wj=(()=>{class t{_changeDetectorRef=Y(So);_dateFormats=Y(Kx,{optional:!0});_dateAdapter=Y(kc,{optional:!0});_dir=Y(ul,{optional:!0});_rangeStrategy=Y(ZM,{optional:!0});_rerenderSubscription=ai.EMPTY;_selectionKeyPressed;get activeDate(){return this._activeDate}set activeDate(e){const n=this._activeDate,o=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(o,this.minDate,this.maxDate),this._hasSameMonthAndYear(n,this._activeDate)||this._init()}_activeDate;get selected(){return this._selected}set selected(e){this._selected=e instanceof Rc?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}_selected;get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_minDate;get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_maxDate;dateFilter;dateClass;comparisonStart;comparisonEnd;startDateAccessibleName;endDateAccessibleName;activeDrag=null;selectedChange=new Tt;_userSelection=new Tt;dragStarted=new Tt;dragEnded=new Tt;activeDateChange=new Tt;_matCalendarBody;_monthLabel;_weeks;_firstWeekOffset;_rangeStart;_rangeEnd;_comparisonRangeStart;_comparisonRangeEnd;_previewStart;_previewEnd;_isRange;_todayDate;_weekdays;constructor(){Y(Rs).load(qv),this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(ua(null)).subscribe(()=>this._init())}ngOnChanges(e){const n=e.comparisonStart||e.comparisonEnd;n&&!n.firstChange&&this._setRanges(this.selected),e.activeDrag&&!this.activeDrag&&this._clearPreview()}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){const n=e.value,o=this._getDateFromDayOfMonth(n);let r,u;this._selected instanceof Rc?(r=this._getDateInCurrentMonth(this._selected.start),u=this._getDateInCurrentMonth(this._selected.end)):r=u=this._getDateInCurrentMonth(this._selected),(r!==n||u!==n)&&this.selectedChange.emit(o),this._userSelection.emit({value:o,event:e.event}),this._clearPreview(),this._changeDetectorRef.markForCheck()}_updateActiveDate(e){const o=this._activeDate;this.activeDate=this._getDateFromDayOfMonth(e.value),this._dateAdapter.compareDate(o,this.activeDate)&&this.activeDateChange.emit(this._activeDate)}_handleCalendarBodyKeydown(e){const n=this._activeDate,o=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,o?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,o?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case 40:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case 36:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case 33:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case 34:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case 13:case 32:return this._selectionKeyPressed=!0,void(this._canSelect(this._activeDate)&&e.preventDefault());case 27:return void(null!=this._previewEnd&&!ns(e)&&(this._clearPreview(),this.activeDrag?this.dragEnded.emit({value:null,event:e}):(this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e})),e.preventDefault(),e.stopPropagation()));default:return}this._dateAdapter.compareDate(n,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(32===e.keyCode||13===e.keyCode)&&(this._selectionKeyPressed&&this._canSelect(this._activeDate)&&this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(7+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%7,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_previewChanged({event:e,value:n}){if(this._rangeStrategy){const o=n?n.rawValue:null,r=this._rangeStrategy.createPreview(o,this.selected,e);if(this._previewStart=this._getCellCompareValue(r.start),this._previewEnd=this._getCellCompareValue(r.end),this.activeDrag&&o){const u=this._rangeStrategy.createDrag?.(this.activeDrag.value,this.selected,o,e);u&&(this._previewStart=this._getCellCompareValue(u.start),this._previewEnd=this._getCellCompareValue(u.end))}this._changeDetectorRef.detectChanges()}}_dragEnded(e){if(this.activeDrag)if(e.value){const n=this._rangeStrategy?.createDrag?.(this.activeDrag.value,this.selected,e.value,e.event);this.dragEnded.emit({value:n??null,event:e.event})}else this.dragEnded.emit({value:null,event:e.event})}_getDateFromDayOfMonth(e){return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),e)}_initWeekdays(){const e=this._dateAdapter.getFirstDayOfWeek(),n=this._dateAdapter.getDayOfWeekNames("narrow");let r=this._dateAdapter.getDayOfWeekNames("long").map((u,y)=>({long:u,narrow:n[y],id:Nme++}));this._weekdays=r.slice(e).concat(r.slice(0,e))}_createWeekCells(){const e=this._dateAdapter.getNumDaysInMonth(this.activeDate),n=this._dateAdapter.getDateNames();this._weeks=[[]];for(let o=0,r=this._firstWeekOffset;o=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,n){return!(!e||!n||this._dateAdapter.getMonth(e)!=this._dateAdapter.getMonth(n)||this._dateAdapter.getYear(e)!=this._dateAdapter.getYear(n))}_getCellCompareValue(e){if(e){const n=this._dateAdapter.getYear(e),o=this._dateAdapter.getMonth(e),r=this._dateAdapter.getDate(e);return new Date(n,o,r).getTime()}return null}_isRtl(){return this._dir&&"rtl"===this._dir.value}_setRanges(e){e instanceof Rc?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}_canSelect(e){return!this.dateFilter||this.dateFilter(e)}_clearPreview(){this._previewStart=this._previewEnd=null}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-month-view"]],viewQuery:function(n,o){if(1&n&&mn(Jx,5),2&n){let r;Bt(r=Vt())&&(o._matCalendarBody=r.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName",activeDrag:"activeDrag"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",dragStarted:"dragStarted",dragEnded:"dragEnded",activeDateChange:"activeDateChange"},exportAs:["matMonthView"],features:[go],decls:8,vars:14,consts:[["role","grid",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["scope","col"],["aria-hidden","true"],["colspan","7",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"selectedValueChange","activeDateChange","previewChange","dragStarted","dragEnded","keyup","keydown","label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","startDateAccessibleName","endDateAccessibleName"],[1,"cdk-visually-hidden"]],template:function(n,o){1&n&&(w(0,"table",0)(1,"thead",1)(2,"tr"),Sv(3,mme,5,2,"th",2,jj),x(),w(5,"tr",3),Re(6,"th",4),x()(),w(7,"tbody",5),we("selectedValueChange",function(u){return o._dateSelected(u)})("activeDateChange",function(u){return o._updateActiveDate(u)})("previewChange",function(u){return o._previewChanged(u)})("dragStarted",function(u){return o.dragStarted.emit(u)})("dragEnded",function(u){return o._dragEnded(u)})("keyup",function(u){return o._handleCalendarBodyKeyup(u)})("keydown",function(u){return o._handleCalendarBodyKeydown(u)}),x()()),2&n&&(E(3),Tv(o._weekdays),E(4),N("label",o._monthLabel)("rows",o._weeks)("todayValue",o._todayDate)("startValue",o._rangeStart)("endValue",o._rangeEnd)("comparisonStart",o._comparisonRangeStart)("comparisonEnd",o._comparisonRangeEnd)("previewStart",o._previewStart)("previewEnd",o._previewEnd)("isRange",o._isRange)("labelMinRequiredCells",3)("activeCell",o._dateAdapter.getDate(o.activeDate)-1)("startDateAccessibleName",o.startDateAccessibleName)("endDateAccessibleName",o.endDateAccessibleName))},dependencies:[Jx],encapsulation:2,changeDetection:0})}return t})(),Zj=(()=>{class t{_changeDetectorRef=Y(So);_dateAdapter=Y(kc,{optional:!0});_dir=Y(ul,{optional:!0});_rerenderSubscription=ai.EMPTY;_selectionKeyPressed;get activeDate(){return this._activeDate}set activeDate(e){let n=this._activeDate;const o=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(o,this.minDate,this.maxDate),Yj(this._dateAdapter,n,this._activeDate,this.minDate,this.maxDate)||this._init()}_activeDate;get selected(){return this._selected}set selected(e){this._selected=e instanceof Rc?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}_selected;get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_minDate;get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_maxDate;dateFilter;dateClass;selectedChange=new Tt;yearSelected=new Tt;activeDateChange=new Tt;_matCalendarBody;_years;_todayYear;_selectedYear;constructor(){this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(ua(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());const n=this._dateAdapter.getYear(this._activeDate)-qT(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let o=0,r=[];o<24;o++)r.push(n+o),4==r.length&&(this._years.push(r.map(u=>this._createCellForYear(u))),r=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){const n=e.value,o=this._dateAdapter.createDate(n,0,1),r=this._getDateFromYear(n);this.yearSelected.emit(o),this.selectedChange.emit(r)}_updateActiveDate(e){const o=this._activeDate;this.activeDate=this._getDateFromYear(e.value),this._dateAdapter.compareDate(o,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const n=this._activeDate,o=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,o?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,o?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-4);break;case 40:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,4);break;case 36:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-qT(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,24-qT(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case 33:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-240:-24);break;case 34:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?240:24);break;case 13:case 32:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(n,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked(),e.preventDefault()}_handleCalendarBodyKeyup(e){(32===e.keyCode||13===e.keyCode)&&(this._selectionKeyPressed&&this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_getActiveCell(){return qT(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getDateFromYear(e){const n=this._dateAdapter.getMonth(this.activeDate),o=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,n,1));return this._dateAdapter.createDate(e,n,Math.min(this._dateAdapter.getDate(this.activeDate),o))}_createCellForYear(e){const n=this._dateAdapter.createDate(e,0,1),o=this._dateAdapter.getYearName(n),r=this.dateClass?this.dateClass(n,"multi-year"):void 0;return new xL(e,o,o,this._shouldEnableYear(e),r)}_shouldEnableYear(e){if(null==e||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e{class t{_changeDetectorRef=Y(So);_dateFormats=Y(Kx,{optional:!0});_dateAdapter=Y(kc,{optional:!0});_dir=Y(ul,{optional:!0});_rerenderSubscription=ai.EMPTY;_selectionKeyPressed;get activeDate(){return this._activeDate}set activeDate(e){let n=this._activeDate;const o=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(o,this.minDate,this.maxDate),this._dateAdapter.getYear(n)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}_activeDate;get selected(){return this._selected}set selected(e){this._selected=e instanceof Rc?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}_selected;get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_minDate;get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_maxDate;dateFilter;dateClass;selectedChange=new Tt;monthSelected=new Tt;activeDateChange=new Tt;_matCalendarBody;_months;_yearLabel;_todayMonth;_selectedMonth;constructor(){this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(ua(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){const n=e.value,o=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),n,1);this.monthSelected.emit(o);const r=this._getDateFromMonth(n);this.selectedChange.emit(r)}_updateActiveDate(e){const o=this._activeDate;this.activeDate=this._getDateFromMonth(e.value),this._dateAdapter.compareDate(o,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){const n=this._activeDate,o=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,o?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,o?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case 40:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case 36:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case 33:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case 34:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case 13:case 32:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(n,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(32===e.keyCode||13===e.keyCode)&&(this._selectionKeyPressed&&this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(n=>n.map(o=>this._createCellForMonth(o,e[o]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_getDateFromMonth(e){const n=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),o=this._dateAdapter.getNumDaysInMonth(n);return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),o))}_createCellForMonth(e,n){const o=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),r=this._dateAdapter.format(o,this._dateFormats.display.monthYearA11yLabel),u=this.dateClass?this.dateClass(o,"year"):void 0;return new xL(e,n.toLocaleUpperCase(),r,this._shouldEnableMonth(e),u)}_shouldEnableMonth(e){const n=this._dateAdapter.getYear(this.activeDate);if(null==e||this._isYearAndMonthAfterMaxDate(n,e)||this._isYearAndMonthBeforeMinDate(n,e))return!1;if(!this.dateFilter)return!0;for(let r=this._dateAdapter.createDate(n,e,1);this._dateAdapter.getMonth(r)==e;r=this._dateAdapter.addCalendarDays(r,1))if(this.dateFilter(r))return!0;return!1}_isYearAndMonthAfterMaxDate(e,n){if(this.maxDate){const o=this._dateAdapter.getYear(this.maxDate),r=this._dateAdapter.getMonth(this.maxDate);return e>o||e===o&&n>r}return!1}_isYearAndMonthBeforeMinDate(e,n){if(this.minDate){const o=this._dateAdapter.getYear(this.minDate),r=this._dateAdapter.getMonth(this.minDate);return e{class t{_intl=Y(Qx);calendar=Y(ML);_dateAdapter=Y(kc,{optional:!0});_dateFormats=Y(Kx,{optional:!0});constructor(){Y(Rs).load(qv);const e=Y(So);this.calendar.stateChanges.subscribe(()=>e.markForCheck())}get periodButtonText(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRange(...this._formatMinAndMaxYearLabels())}get periodButtonDescription(){return"month"==this.calendar.currentView?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():"year"==this.calendar.currentView?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRangeLabel(...this._formatMinAndMaxYearLabels())}get periodButtonLabel(){return"month"==this.calendar.currentView?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView="month"==this.calendar.currentView?"multi-year":"month"}previousClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?-1:-24)}nextClicked(){this.calendar.activeDate="month"==this.calendar.currentView?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,"year"==this.calendar.currentView?1:24)}previousEnabled(){return!this.calendar.minDate||!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate)}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(e,n){return"month"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(n)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(n):"year"==this.calendar.currentView?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(n):Yj(this._dateAdapter,e,n,this.calendar.minDate,this.calendar.maxDate)}_formatMinAndMaxYearLabels(){const n=this._dateAdapter.getYear(this.calendar.activeDate)-qT(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),o=n+24-1;return[this._dateAdapter.getYearName(this._dateAdapter.createDate(n,0,1)),this._dateAdapter.getYearName(this._dateAdapter.createDate(o,0,1))]}_periodButtonLabelId=Y(ta).getId("mat-calendar-period-label-");static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-calendar-header"]],exportAs:["matCalendarHeader"],ngContentSelectors:fme,decls:17,vars:11,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["aria-live","polite",1,"cdk-visually-hidden",3,"id"],["mat-button","","type","button",1,"mat-calendar-period-button",3,"click"],["aria-hidden","true"],["viewBox","0 0 10 5","focusable","false","aria-hidden","true",1,"mat-calendar-arrow"],["points","0,0 5,5 10,0"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"click","disabled"],["viewBox","0 0 24 24","focusable","false","aria-hidden","true"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"click","disabled"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"]],template:function(n,o){1&n&&(ho(),w(0,"div",0)(1,"div",1)(2,"span",2),M(3),x(),w(4,"button",3),we("click",function(){return o.currentPeriodClicked()}),w(5,"span",4),M(6),x(),Va(),w(7,"svg",5),Re(8,"polygon",6),x()(),cu(),Re(9,"div",7),On(10),w(11,"button",8),we("click",function(){return o.previousClicked()}),Va(),w(12,"svg",9),Re(13,"path",10),x()(),cu(),w(14,"button",11),we("click",function(){return o.nextClicked()}),Va(),w(15,"svg",9),Re(16,"path",12),x()()()()),2&n&&(E(2),N("id",o._periodButtonLabelId),E(),Ct(o.periodButtonDescription),E(),zn("aria-label",o.periodButtonLabel)("aria-describedby",o._periodButtonLabelId),E(2),Ct(o.periodButtonText),E(),Hn("mat-calendar-invert","month"!==o.calendar.currentView),E(4),N("disabled",!o.previousEnabled()),zn("aria-label",o.prevButtonLabel),E(3),N("disabled",!o.nextEnabled()),zn("aria-label",o.nextButtonLabel))},dependencies:[ws,qa],encapsulation:2,changeDetection:0})}return t})(),ML=(()=>{class t{_dateAdapter=Y(kc,{optional:!0});_dateFormats=Y(Kx,{optional:!0});_changeDetectorRef=Y(So);_elementRef=Y(Pn);headerComponent;_calendarHeaderPortal;_intlChanges;_moveFocusOnNextTick=!1;get startAt(){return this._startAt}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_startAt;startView="month";get selected(){return this._selected}set selected(e){this._selected=e instanceof Rc?e:this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_selected;get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_minDate;get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_maxDate;dateFilter;dateClass;comparisonStart;comparisonEnd;startDateAccessibleName;endDateAccessibleName;selectedChange=new Tt;yearSelected=new Tt;monthSelected=new Tt;viewChanged=new Tt(!0);_userSelection=new Tt;_userDragDrop=new Tt;monthView;yearView;multiYearView;get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}_clampedActiveDate;get currentView(){return this._currentView}set currentView(e){const n=this._currentView!==e?e:null;this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),n&&this.viewChanged.emit(n)}_currentView;_activeDrag=null;stateChanges=new Ee;constructor(){this._intlChanges=Y(Qx).changes.subscribe(()=>{this._changeDetectorRef.markForCheck(),this.stateChanges.next()})}ngAfterContentInit(){this._calendarHeaderPortal=new Cb(this.headerComponent||Qj),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(e){const n=e.minDate&&!this._dateAdapter.sameDate(e.minDate.previousValue,e.minDate.currentValue)?e.minDate:void 0,o=e.maxDate&&!this._dateAdapter.sameDate(e.maxDate.previousValue,e.maxDate.currentValue)?e.maxDate:void 0,r=n||o||e.dateFilter;if(r&&!r.firstChange){const u=this._getCurrentViewComponent();u&&(this._elementRef.nativeElement.contains(Sb())&&(this._moveFocusOnNextTick=!0),this._changeDetectorRef.detectChanges(),u._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){this._getCurrentViewComponent()._init()}_dateSelected(e){const n=e.value;(this.selected instanceof Rc||n&&!this._dateAdapter.sameDate(n,this.selected))&&this.selectedChange.emit(n),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,n){this.activeDate=e,this.currentView=n}_dragStarted(e){this._activeDrag=e}_dragEnded(e){this._activeDrag&&(e.value&&this._userDragDrop.emit(e),this._activeDrag=null)}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-calendar"]],viewQuery:function(n,o){if(1&n&&(mn(Wj,5),mn(Kj,5),mn(Zj,5)),2&n){let r;Bt(r=Vt())&&(o.monthView=r.first),Bt(r=Vt())&&(o.yearView=r.first),Bt(r=Vt())&&(o.multiYearView=r.first)}},hostAttrs:[1,"mat-calendar"],inputs:{headerComponent:"headerComponent",startAt:"startAt",startView:"startView",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection",_userDragDrop:"_userDragDrop"},exportAs:["matCalendar"],features:[Bn([qj]),go],decls:5,vars:2,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass"],[3,"activeDateChange","_userSelection","dragStarted","dragEnded","activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag"],[3,"activeDateChange","monthSelected","selectedChange","activeDate","selected","dateFilter","maxDate","minDate","dateClass"],[3,"activeDateChange","yearSelected","selectedChange","activeDate","selected","dateFilter","maxDate","minDate","dateClass"]],template:function(n,o){if(1&n&&(te(0,_me,0,0,"ng-template",0),w(1,"div",1),te(2,gme,1,11,"mat-month-view",2)(3,bme,1,6,"mat-year-view",3)(4,yme,1,6,"mat-multi-year-view",3),x()),2&n){let r;N("cdkPortalOutlet",o._calendarHeaderPortal),E(2),Xi("month"===(r=o.currentView)?2:"year"===r?3:"multi-year"===r?4:-1)}},dependencies:[ef,g3,Wj,Kj,Zj],styles:['.mat-calendar{display:block;line-height:normal;font-family:var(--mat-datepicker-calendar-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-datepicker-calendar-text-size, var(--mat-sys-body-medium-size))}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px;font-size:var(--mat-datepicker-calendar-period-button-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-datepicker-calendar-period-button-text-weight, var(--mat-sys-title-small-weight));--mdc-text-button-label-text-color:var(--mat-datepicker-calendar-period-button-text-color, var(--mat-sys-on-surface-variant))}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle;fill:var(--mat-datepicker-calendar-period-button-icon-color, var(--mat-sys-on-surface-variant))}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}@media(forced-colors: active){.mat-calendar-arrow{fill:CanvasText}}.mat-datepicker-content .mat-calendar-previous-button:not(.mat-mdc-button-disabled),.mat-datepicker-content .mat-calendar-next-button:not(.mat-mdc-button-disabled){color:var(--mat-datepicker-calendar-navigation-button-icon-color, var(--mat-sys-on-surface-variant))}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0;color:var(--mat-datepicker-calendar-header-text-color, var(--mat-sys-on-surface-variant));font-size:var(--mat-datepicker-calendar-header-text-size, var(--mat-sys-title-small-size));font-weight:var(--mat-datepicker-calendar-header-text-weight, var(--mat-sys-title-small-weight))}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px;background:var(--mat-datepicker-calendar-header-divider-color, transparent)}.mat-calendar-body-cell-content::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}.mat-calendar-body-cell:focus .mat-focus-indicator::before{content:""}\n'],encapsulation:2,changeDetection:0})}return t})();const Jj=new yt("mat-datepicker-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition()}}),Vme={provide:Jj,deps:[is],useFactory:function Bme(t){return()=>t.scrollStrategies.reposition()}};let e7=(()=>{class t{_elementRef=Y(Pn);_animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0});_changeDetectorRef=Y(So);_globalModel=Y(Lb);_dateAdapter=Y(kc);_ngZone=Y(tn);_rangeSelectionStrategy=Y(ZM,{optional:!0});_stateChanges;_model;_eventCleanups;_animationFallback;_calendar;color;datepicker;comparisonStart;comparisonEnd;startDateAccessibleName;endDateAccessibleName;_isAbove;_animationDone=new Ee;_isAnimating=!1;_closeButtonText;_closeButtonFocused;_actionsPortal=null;_dialogLabelId;constructor(){if(Y(Rs).load(qv),this._closeButtonText=Y(Qx).closeCalendarLabel,!this._animationsDisabled){const e=this._elementRef.nativeElement,n=Y(Hr);this._eventCleanups=this._ngZone.runOutsideAngular(()=>[n.listen(e,"animationstart",this._handleAnimationEvent),n.listen(e,"animationend",this._handleAnimationEvent),n.listen(e,"animationcancel",this._handleAnimationEvent)])}}ngAfterViewInit(){this._stateChanges=this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()}),this._calendar.focusActiveCell()}ngOnDestroy(){clearTimeout(this._animationFallback),this._eventCleanups?.forEach(e=>e()),this._stateChanges?.unsubscribe(),this._animationDone.complete()}_handleUserSelection(e){const n=this._model.selection,o=e.value,r=n instanceof Rc;if(r&&this._rangeSelectionStrategy){const u=this._rangeSelectionStrategy.selectionFinished(o,n,e.event);this._model.updateSelection(u,this)}else o&&(r||!this._dateAdapter.sameDate(o,n))&&this._model.add(o);(!this._model||this._model.isComplete())&&!this._actionsPortal&&this.datepicker.close()}_handleUserDragDrop(e){this._model.updateSelection(e.value,this)}_startExitAnimation(){this._elementRef.nativeElement.classList.add("mat-datepicker-content-exit"),this._animationsDisabled?this._animationDone.next():(clearTimeout(this._animationFallback),this._animationFallback=setTimeout(()=>{this._isAnimating||this._animationDone.next()},200))}_handleAnimationEvent=e=>{const n=this._elementRef.nativeElement;e.target!==n||!e.animationName.startsWith("_mat-datepicker-content")||(clearTimeout(this._animationFallback),this._isAnimating="animationstart"===e.type,n.classList.toggle("mat-datepicker-content-animating",this._isAnimating),this._isAnimating||this._animationDone.next())};_getSelected(){return this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}_assignActions(e,n){this._model=e?this._globalModel.clone():this._globalModel,this._actionsPortal=e,n&&this._changeDetectorRef.detectChanges()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-datepicker-content"]],viewQuery:function(n,o){if(1&n&&mn(ML,5),2&n){let r;Bt(r=Vt())&&(o._calendar=r.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:6,hostBindings:function(n,o){2&n&&(bs(o.color?"mat-"+o.color:""),Hn("mat-datepicker-content-touch",o.datepicker.touchUi)("mat-datepicker-content-animations-enabled",!o._animationsDisabled))},inputs:{color:"color"},exportAs:["matDatepickerContent"],decls:5,vars:26,consts:[["cdkTrapFocus","","role","dialog",1,"mat-datepicker-content-container"],[3,"yearSelected","monthSelected","viewChanged","_userSelection","_userDragDrop","id","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"focus","blur","click","color"]],template:function(n,o){if(1&n&&(w(0,"div",0)(1,"mat-calendar",1),we("yearSelected",function(u){return o.datepicker._selectYear(u)})("monthSelected",function(u){return o.datepicker._selectMonth(u)})("viewChanged",function(u){return o.datepicker._viewChanged(u)})("_userSelection",function(u){return o._handleUserSelection(u)})("_userDragDrop",function(u){return o._handleUserDragDrop(u)}),x(),te(2,vme,0,0,"ng-template",2),w(3,"button",3),we("focus",function(){return o._closeButtonFocused=!0})("blur",function(){return o._closeButtonFocused=!1})("click",function(){return o.datepicker.close()}),M(4),x()()),2&n){let r;Hn("mat-datepicker-content-container-with-custom-header",o.datepicker.calendarHeaderComponent)("mat-datepicker-content-container-with-actions",o._actionsPortal),zn("aria-modal",!0)("aria-labelledby",null!==(r=o._dialogLabelId)&&void 0!==r?r:void 0),E(),bs(o.datepicker.panelClass),N("id",o.datepicker.id)("startAt",o.datepicker.startAt)("startView",o.datepicker.startView)("minDate",o.datepicker._getMinDate())("maxDate",o.datepicker._getMaxDate())("dateFilter",o.datepicker._getDateFilter())("headerComponent",o.datepicker.calendarHeaderComponent)("selected",o._getSelected())("dateClass",o.datepicker.dateClass)("comparisonStart",o.comparisonStart)("comparisonEnd",o.comparisonEnd)("startDateAccessibleName",o.startDateAccessibleName)("endDateAccessibleName",o.endDateAccessibleName),E(),N("cdkPortalOutlet",o._actionsPortal),E(),Hn("cdk-visually-hidden",!o._closeButtonFocused),N("color",o.color||"primary"),E(),Ct(o._closeButtonText)}},dependencies:[Nre,ML,ef,ws],styles:["@keyframes _mat-datepicker-content-dropdown-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-datepicker-content-dialog-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-datepicker-content-exit{from{opacity:1}to{opacity:0}}.mat-datepicker-content{display:block;border-radius:4px;background-color:var(--mat-datepicker-calendar-container-background-color, var(--mat-sys-surface-container-high));color:var(--mat-datepicker-calendar-container-text-color, var(--mat-sys-on-surface));box-shadow:var(--mat-datepicker-calendar-container-elevation-shadow, 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));border-radius:var(--mat-datepicker-calendar-container-shape, var(--mat-sys-corner-large))}.mat-datepicker-content.mat-datepicker-content-animations-enabled{animation:_mat-datepicker-content-dropdown-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.mat-datepicker-content-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{display:block;max-height:80vh;box-shadow:var(--mat-datepicker-calendar-container-touch-elevation-shadow, 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));border-radius:var(--mat-datepicker-calendar-container-touch-shape, var(--mat-sys-corner-extra-large));position:relative;overflow:visible}.mat-datepicker-content-touch.mat-datepicker-content-animations-enabled{animation:_mat-datepicker-content-dialog-enter 150ms cubic-bezier(0, 0, 0.2, 1)}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}.mat-datepicker-content-exit.mat-datepicker-content-animations-enabled{animation:_mat-datepicker-content-exit 100ms linear}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}\n"],encapsulation:2,changeDetection:0})}return t})(),YM=(()=>{class t{_overlay=Y(is);_viewContainerRef=Y(es);_dateAdapter=Y(kc,{optional:!0});_dir=Y(ul,{optional:!0});_model=Y(Lb);_scrollStrategy=Y(Jj);_inputStateChanges=ai.EMPTY;_document=Y(Oo);calendarHeaderComponent;get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}_startAt;startView="month";get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}_color;touchUi=!1;get disabled(){return void 0===this._disabled&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(e){e!==this._disabled&&(this._disabled=e,this.stateChanges.next(void 0))}_disabled;xPosition="start";yPosition="below";restoreFocus=!0;yearSelected=new Tt;monthSelected=new Tt;viewChanged=new Tt(!0);dateClass;openedStream=new Tt;closedStream=new Tt;get panelClass(){return this._panelClass}set panelClass(e){this._panelClass=function sme(t,i=/\s+/){const e=[];if(null!=t){const n=Array.isArray(t)?t:`${t}`.split(i);for(const o of n){const r=`${o}`.trim();r&&e.push(r)}}return e}(e)}_panelClass;get opened(){return this._opened}set opened(e){e?this.open():this.close()}_opened=!1;id=Y(ta).getId("mat-datepicker-");_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}_overlayRef;_componentRef;_focusedElementBeforeOpen=null;_backdropHarnessClass=`${this.id}-backdrop`;_actionsPortal;datepickerInput;stateChanges=new Ee;_injector=Y(Ke);_changeDetectorRef=Y(So);constructor(){this._model.selectionChanged.subscribe(()=>{this._changeDetectorRef.markForCheck()})}ngOnChanges(e){const n=e.xPosition||e.yPosition;if(n&&!n.firstChange&&this._overlayRef){const o=this._overlayRef.getConfig().positionStrategy;o instanceof n8&&(this._setConnectedPositions(o),this.opened&&this._overlayRef.updatePosition())}this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyOverlay(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_viewChanged(e){this.viewChanged.emit(e)}registerInput(e){return this._inputStateChanges.unsubscribe(),this.datepickerInput=e,this._inputStateChanges=e.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(e){this._actionsPortal=e,this._componentRef?.instance._assignActions(e,!0)}removeActions(e){e===this._actionsPortal&&(this._actionsPortal=null,this._componentRef?.instance._assignActions(null,!0))}open(){this._opened||this.disabled||this._componentRef?.instance._isAnimating||(this._focusedElementBeforeOpen=Sb(),this._openOverlay(),this._opened=!0,this.openedStream.emit())}close(){if(!this._opened||this._componentRef?.instance._isAnimating)return;const e=this.restoreFocus&&this._focusedElementBeforeOpen&&"function"==typeof this._focusedElementBeforeOpen.focus,n=()=>{this._opened&&(this._opened=!1,this.closedStream.emit())};if(this._componentRef){const{instance:o,location:r}=this._componentRef;o._animationDone.pipe($a(1)).subscribe(()=>{const u=this._document.activeElement;e&&(!u||u===this._document.activeElement||r.nativeElement.contains(u))&&this._focusedElementBeforeOpen.focus(),this._focusedElementBeforeOpen=null,this._destroyOverlay()}),o._startExitAnimation()}e?setTimeout(n):n()}_applyPendingSelection(){this._componentRef?.instance?._applyPendingSelection()}_forwardContentValues(e){e.datepicker=this,e.color=this.color,e._dialogLabelId=this.datepickerInput.getOverlayLabelId(),e._assignActions(this._actionsPortal,!1)}_openOverlay(){this._destroyOverlay();const e=this.touchUi,n=new Cb(e7,this._viewContainerRef),o=this._overlayRef=this._overlay.create(new Qv({positionStrategy:e?this._getDialogStrategy():this._getDropdownStrategy(),hasBackdrop:!0,backdropClass:[e?"cdk-overlay-dark-backdrop":"mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir||"ltr",scrollStrategy:e?this._overlay.scrollStrategies.block():this._scrollStrategy(),panelClass:"mat-datepicker-"+(e?"dialog":"popup")}));this._getCloseStream(o).subscribe(r=>{r&&r.preventDefault(),this.close()}),o.keydownEvents().subscribe(r=>{const u=r.keyCode;(38===u||40===u||37===u||39===u||33===u||34===u)&&r.preventDefault()}),this._componentRef=o.attach(n),this._forwardContentValues(this._componentRef.instance),e||As(()=>{o.updatePosition()},{injector:this._injector})}_destroyOverlay(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=this._componentRef=null)}_getDialogStrategy(){return this._overlay.position().global().centerHorizontally().centerVertically()}_getDropdownStrategy(){const e=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition();return this._setConnectedPositions(e)}_setConnectedPositions(e){const n="end"===this.xPosition?"end":"start",o="start"===n?"end":"start",r="above"===this.yPosition?"bottom":"top",u="top"===r?"bottom":"top";return e.withPositions([{originX:n,originY:u,overlayX:n,overlayY:r},{originX:n,originY:r,overlayX:n,overlayY:u},{originX:o,originY:u,overlayX:o,overlayY:r},{originX:o,originY:r,overlayX:o,overlayY:u}])}_getCloseStream(e){const n=["ctrlKey","shiftKey","metaKey"];return va(e.backdropClick(),e.detachments(),e.keydownEvents().pipe(or(o=>27===o.keyCode&&!ns(o)||this.datepickerInput&&ns(o,"altKey")&&38===o.keyCode&&n.every(r=>!ns(o,r)))))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{calendarHeaderComponent:"calendarHeaderComponent",startAt:"startAt",startView:"startView",color:"color",touchUi:[2,"touchUi","touchUi",fn],disabled:[2,"disabled","disabled",fn],xPosition:"xPosition",yPosition:"yPosition",restoreFocus:[2,"restoreFocus","restoreFocus",fn],dateClass:"dateClass",panelClass:"panelClass",opened:[2,"opened","opened",fn]},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[go]})}return t})(),XM=(()=>{class t extends YM{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-datepicker"]],exportAs:["matDatepicker"],features:[Bn([qj,{provide:YM,useExisting:t}]),qn],decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})();class KM{target;targetElement;value;constructor(i,e){this.target=i,this.targetElement=e,this.value=this.target.value}}let t7=(()=>{class t{_elementRef=Y(Pn);_dateAdapter=Y(kc,{optional:!0});_dateFormats=Y(Kx,{optional:!0});_isInitialized;get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}_model;get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){const n=e,o=this._elementRef.nativeElement;this._disabled!==n&&(this._disabled=n,this.stateChanges.next(void 0)),n&&this._isInitialized&&o.blur&&o.blur()}_disabled;dateChange=new Tt;dateInput=new Tt;stateChanges=new Ee;_onTouched=()=>{};_validatorOnChange=()=>{};_cvaOnChange=()=>{};_valueChangesSubscription=ai.EMPTY;_localeSubscription=ai.EMPTY;_pendingValue;_parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}};_filterValidator=e=>{const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value));return!n||this._matchesFilter(n)?null:{matDatepickerFilter:!0}};_minValidator=e=>{const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),o=this._getMinDate();return!o||!n||this._dateAdapter.compareDate(o,n)<=0?null:{matDatepickerMin:{min:o,actual:n}}};_maxValidator=e=>{const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),o=this._getMaxDate();return!o||!n||this._dateAdapter.compareDate(o,n)>=0?null:{matDatepickerMax:{max:o,actual:n}}};_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(n=>{if(this._shouldHandleChangeEvent(n)){const o=this._getValueFromModel(n.selection);this._lastValueValid=this._isValidValue(o),this._cvaOnChange(o),this._onTouched(),this._formatValue(o),this.dateInput.emit(new KM(this,this._elementRef.nativeElement)),this.dateChange.emit(new KM(this,this._elementRef.nativeElement))}})}_lastValueValid=!1;constructor(){this._localeSubscription=this._dateAdapter.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){n7(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){ns(e,"altKey")&&40===e.keyCode&&["ctrlKey","shiftKey","metaKey"].every(r=>!ns(e,r))&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){const n=this._lastValueValid;let o=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(o),o=this._dateAdapter.getValidDateOrNull(o);const r=!this._dateAdapter.sameDate(o,this.value);!o||r?this._cvaOnChange(o):(e&&!this.value&&this._cvaOnChange(o),n!==this._lastValueValid&&this._validatorOnChange()),r&&(this._assignValue(o),this.dateInput.emit(new KM(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new KM(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=null!=e?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){const n=this._getDateFilter();return!n||n(e)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{value:"value",disabled:[2,"disabled","disabled",fn]},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[go]})}return t})();function n7(t,i){const e=Object.keys(t);for(let n of e){const{previousValue:o,currentValue:r}=t[n];if(!i.isDateInstance(o)||!i.isDateInstance(r))return!0;if(!i.sameDate(o,r))return!0}return!1}const Ume={provide:Pl,useExisting:lo(()=>ew),multi:!0},Hme={provide:ba,useExisting:lo(()=>ew),multi:!0};let ew=(()=>{class t extends t7{_formField=Y(o0,{optional:!0});_closedSubscription=ai.EMPTY;_openedSubscription=ai.EMPTY;set matDatepicker(e){e&&(this._datepicker=e,this._ariaOwns.set(e.opened?e.id:null),this._closedSubscription=e.closedStream.subscribe(()=>{this._onTouched(),this._ariaOwns.set(null)}),this._openedSubscription=e.openedStream.subscribe(()=>{this._ariaOwns.set(e.id)}),this._registerModel(e.registerInput(this)))}_datepicker;_ariaOwns=Da(null);get min(){return this._min}set min(e){const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._min)||(this._min=n,this._validatorOnChange())}_min;get max(){return this._max}set max(e){const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._max)||(this._max=n,this._validatorOnChange())}_max;get dateFilter(){return this._dateFilter}set dateFilter(e){const n=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==n&&this._validatorOnChange()}_dateFilter;_validator;constructor(){super(),this._validator=Ov.compose(super._getValidators())}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():this._elementRef.nativeElement.getAttribute("aria-labelledby")}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe(),this._openedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["input","matDatepicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(n,o){1&n&&we("input",function(u){return o._onInput(u.target.value)})("change",function(){return o._onChange()})("blur",function(){return o._onBlur()})("keydown",function(u){return o._onKeydown(u)}),2&n&&(cc("disabled",o.disabled),zn("aria-haspopup",o._datepicker?"dialog":null)("aria-owns",o._ariaOwns())("min",o.min?o._dateAdapter.toIso8601(o.min):null)("max",o.max?o._dateAdapter.toIso8601(o.max):null)("data-mat-calendar",o._datepicker?o._datepicker.id:null))},inputs:{matDatepicker:"matDatepicker",min:"min",max:"max",dateFilter:[0,"matDatepickerFilter","dateFilter"]},exportAs:["matDatepickerInput"],features:[Bn([Ume,Hme,{provide:mH,useExisting:t}]),qn]})}return t})(),jme=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matDatepickerToggleIcon",""]]})}return t})(),tw=(()=>{class t{_intl=Y(Qx);_changeDetectorRef=Y(So);_stateChanges=ai.EMPTY;datepicker;tabIndex;ariaLabel;get disabled(){return void 0===this._disabled&&this.datepicker?this.datepicker.disabled:!!this._disabled}set disabled(e){this._disabled=e}_disabled;disableRipple;_customIcon;_button;constructor(){const e=Y(new Mt("tabindex"),{optional:!0}),n=Number(e);this.tabIndex=n||0===n?n:null}ngOnChanges(e){e.datepicker&&this._watchStateChanges()}ngOnDestroy(){this._stateChanges.unsubscribe()}ngAfterContentInit(){this._watchStateChanges()}_open(e){this.datepicker&&!this.disabled&&(this.datepicker.open(),e.stopPropagation())}_watchStateChanges(){const e=this.datepicker?this.datepicker.stateChanges:xi(),n=this.datepicker&&this.datepicker.datepickerInput?this.datepicker.datepickerInput.stateChanges:xi(),o=this.datepicker?va(this.datepicker.openedStream,this.datepicker.closedStream):xi();this._stateChanges.unsubscribe(),this._stateChanges=va(this._intl.changes,e,n,o).subscribe(()=>this._changeDetectorRef.markForCheck())}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-datepicker-toggle"]],contentQueries:function(n,o,r){if(1&n&&oo(r,jme,5),2&n){let u;Bt(u=Vt())&&(o._customIcon=u.first)}},viewQuery:function(n,o){if(1&n&&mn(xme,5),2&n){let r;Bt(r=Vt())&&(o._button=r.first)}},hostAttrs:[1,"mat-datepicker-toggle"],hostVars:8,hostBindings:function(n,o){1&n&&we("click",function(u){return o._open(u)}),2&n&&(zn("tabindex",null)("data-mat-calendar",o.datepicker?o.datepicker.id:null),Hn("mat-datepicker-toggle-active",o.datepicker&&o.datepicker.opened)("mat-accent",o.datepicker&&"accent"===o.datepicker.color)("mat-warn",o.datepicker&&"warn"===o.datepicker.color))},inputs:{datepicker:[0,"for","datepicker"],tabIndex:"tabIndex",ariaLabel:[0,"aria-label","ariaLabel"],disabled:[2,"disabled","disabled",fn],disableRipple:"disableRipple"},exportAs:["matDatepickerToggle"],features:[go],ngContentSelectors:Cme,decls:4,vars:7,consts:[["button",""],["mat-icon-button","","type","button",3,"disabled","disableRipple"],["viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false","aria-hidden","true",1,"mat-datepicker-toggle-default-icon"],["d","M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"]],template:function(n,o){1&n&&(ho(wme),w(0,"button",1,0),te(2,Sme,2,0,":svg:svg",2),On(3),x()),2&n&&(N("disabled",o.disabled)("disableRipple",o.disableRipple),zn("aria-haspopup",o.datepicker?"dialog":null)("aria-label",o.ariaLabel||o._intl.openCalendarLabel)("tabindex",o.disabled?-1:o.tabIndex)("aria-expanded",o.datepicker?o.datepicker.opened:null),E(2),Xi(o._customIcon?-1:2))},dependencies:[qa],styles:[".mat-datepicker-toggle{pointer-events:auto;color:var(--mat-datepicker-toggle-icon-color, var(--mat-sys-on-surface-variant))}.mat-datepicker-toggle-active{color:var(--mat-datepicker-toggle-active-state-icon-color, var(--mat-sys-on-surface-variant))}@media(forced-colors: active){.mat-datepicker-toggle-default-icon{color:CanvasText}}\n"],encapsulation:2,changeDetection:0})}return t})(),i7=(()=>{class t{_changeDetectorRef=Y(So);_elementRef=Y(Pn);_dateAdapter=Y(kc,{optional:!0});_formField=Y(o0,{optional:!0});_closedSubscription=ai.EMPTY;_openedSubscription=ai.EMPTY;_startInput;_endInput;get value(){return this._model?this._model.selection:null}id=Y(ta).getId("mat-date-range-input-");focused=!1;get shouldLabelFloat(){return this.focused||!this.empty}controlType="mat-date-range-input";get placeholder(){const e=this._startInput?._getPlaceholder()||"",n=this._endInput?._getPlaceholder()||"";return e||n?`${e} ${this.separator} ${n}`:""}get rangePicker(){return this._rangePicker}set rangePicker(e){e&&(this._model=e.registerInput(this),this._rangePicker=e,this._closedSubscription.unsubscribe(),this._openedSubscription.unsubscribe(),this._ariaOwns.set(this.rangePicker.opened?e.id:null),this._closedSubscription=e.closedStream.subscribe(()=>{this._startInput?._onTouched(),this._endInput?._onTouched(),this._ariaOwns.set(null)}),this._openedSubscription=e.openedStream.subscribe(()=>{this._ariaOwns.set(e.id)}),this._registerModel(this._model))}_rangePicker;_ariaOwns=Da(null);get required(){return this._required??(this._isTargetRequired(this)||this._isTargetRequired(this._startInput)||this._isTargetRequired(this._endInput))??!1}set required(e){this._required=e}_required;get dateFilter(){return this._dateFilter}set dateFilter(e){const n=this._startInput,o=this._endInput,r=n&&n._matchesFilter(n.value),u=o&&o._matchesFilter(n.value);this._dateFilter=e,n&&n._matchesFilter(n.value)!==r&&n._validatorOnChange(),o&&o._matchesFilter(o.value)!==u&&o._validatorOnChange()}_dateFilter;get min(){return this._min}set min(e){const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._min)||(this._min=n,this._revalidate())}_min;get max(){return this._max}set max(e){const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(n,this._max)||(this._max=n,this._revalidate())}_max;get disabled(){return this._startInput&&this._endInput?this._startInput.disabled&&this._endInput.disabled:this._groupDisabled}set disabled(e){e!==this._groupDisabled&&(this._groupDisabled=e,this.stateChanges.next(void 0))}_groupDisabled=!1;get errorState(){return!(!this._startInput||!this._endInput)&&(this._startInput.errorState||this._endInput.errorState)}get empty(){const e=!!this._startInput&&this._startInput.isEmpty(),n=!!this._endInput&&this._endInput.isEmpty();return e&&n}_ariaDescribedBy=null;_model;separator="\u2013";comparisonStart=null;comparisonEnd=null;ngControl;stateChanges=new Ee;disableAutomaticLabeling=!0;constructor(){this._formField?._elementRef.nativeElement.classList.contains("mat-mdc-form-field")&&this._elementRef.nativeElement.classList.add("mat-mdc-input-element","mat-mdc-form-field-input-control","mdc-text-field__input"),this.ngControl=Y(nd,{optional:!0,self:!0})}setDescribedByIds(e){this._ariaDescribedBy=e.length?e.join(" "):null}onContainerClick(){!this.focused&&!this.disabled&&(this._model&&this._model.selection.start?this._endInput.focus():this._startInput.focus())}ngAfterContentInit(){this._model&&this._registerModel(this._model),va(this._startInput.stateChanges,this._endInput.stateChanges).subscribe(()=>{this.stateChanges.next(void 0)})}ngOnChanges(e){n7(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._closedSubscription.unsubscribe(),this._openedSubscription.unsubscribe(),this.stateChanges.complete()}getStartValue(){return this.value?this.value.start:null}getThemePalette(){return this._formField?this._formField.color:void 0}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():null}_getInputMirrorValue(e){const n="start"===e?this._startInput:this._endInput;return n?n.getMirrorValue():""}_shouldHidePlaceholders(){return!!this._startInput&&!this._startInput.isEmpty()}_handleChildValueChange(){this.stateChanges.next(void 0),this._changeDetectorRef.markForCheck()}_openDatepicker(){this._rangePicker&&this._rangePicker.open()}_shouldHideSeparator(){return(!this._formField||this._formField.getLabelId()&&!this._formField._shouldLabelFloat())&&this.empty}_getAriaLabelledby(){const e=this._formField;return e&&e._hasFloatingLabel()?e._labelId:null}_getStartDateAccessibleName(){return this._startInput._getAccessibleName()}_getEndDateAccessibleName(){return this._endInput._getAccessibleName()}_updateFocus(e){this.focused=null!==e,this.stateChanges.next()}_revalidate(){this._startInput&&this._startInput._validatorOnChange(),this._endInput&&this._endInput._validatorOnChange()}_registerModel(e){this._startInput&&this._startInput._registerModel(e),this._endInput&&this._endInput._registerModel(e)}_isTargetRequired(e){return e?.ngControl?.control?.hasValidator(Ov.required)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-date-range-input"]],hostAttrs:["role","group",1,"mat-date-range-input"],hostVars:8,hostBindings:function(n,o){2&n&&(zn("id",o.id)("aria-labelledby",o._getAriaLabelledby())("aria-describedby",o._ariaDescribedBy)("data-mat-calendar",o.rangePicker?o.rangePicker.id:null),Hn("mat-date-range-input-hide-placeholders",o._shouldHidePlaceholders())("mat-date-range-input-required",o.required))},inputs:{rangePicker:"rangePicker",required:[2,"required","required",fn],dateFilter:"dateFilter",min:"min",max:"max",disabled:[2,"disabled","disabled",fn],separator:"separator",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},exportAs:["matDateRangeInput"],features:[Bn([{provide:PT,useExisting:t}]),go],ngContentSelectors:Dme,decls:11,vars:5,consts:[["cdkMonitorSubtreeFocus","",1,"mat-date-range-input-container",3,"cdkFocusChange"],[1,"mat-date-range-input-wrapper"],["aria-hidden","true",1,"mat-date-range-input-mirror"],[1,"mat-date-range-input-separator"],[1,"mat-date-range-input-wrapper","mat-date-range-input-end-wrapper"]],template:function(n,o){1&n&&(ho(Tme),w(0,"div",0),we("cdkFocusChange",function(u){return o._updateFocus(u)}),w(1,"div",1),On(2),w(3,"span",2),M(4),x()(),w(5,"span",3),M(6),x(),w(7,"div",4),On(8,1),w(9,"span",2),M(10),x()()()),2&n&&(E(4),Ct(o._getInputMirrorValue("start")),E(),Hn("mat-date-range-input-separator-hidden",o._shouldHideSeparator()),E(),Ct(o.separator),E(4),Ct(o._getInputMirrorValue("end")))},dependencies:[g3],styles:[".mat-date-range-input{display:block;width:100%}.mat-date-range-input-container{display:flex;align-items:center}.mat-date-range-input-separator{transition:opacity 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);margin:0 4px;color:var(--mat-datepicker-range-input-separator-color, var(--mat-sys-on-surface))}.mat-form-field-disabled .mat-date-range-input-separator{color:var(--mat-datepicker-range-input-disabled-state-separator-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}._mat-animation-noopable .mat-date-range-input-separator{transition:none}.mat-date-range-input-separator-hidden{-webkit-user-select:none;user-select:none;opacity:0;transition:none}.mat-date-range-input-wrapper{position:relative;overflow:hidden;max-width:calc(50% - 4px)}.mat-date-range-input-end-wrapper{flex-grow:1}.mat-date-range-input-inner{position:absolute;top:0;left:0;font:inherit;background:rgba(0,0,0,0);color:currentColor;border:none;outline:none;padding:0;margin:0;vertical-align:bottom;text-align:inherit;-webkit-appearance:none;width:100%;height:100%}.mat-date-range-input-inner:-moz-ui-invalid{box-shadow:none}.mat-date-range-input-inner::placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-moz-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-webkit-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner:-ms-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner[disabled]{color:var(--mat-datepicker-range-input-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}@media(forced-colors: active){.mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{opacity:0}}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}@media(forced-colors: active){.mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{opacity:0}}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}@media(forced-colors: active){.mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{opacity:0}}.mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}@media(forced-colors: active){.mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{opacity:0}}._mat-animation-noopable .mat-date-range-input-inner::placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-moz-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-webkit-input-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner:-ms-input-placeholder{transition:none}.mat-date-range-input-mirror{-webkit-user-select:none;user-select:none;visibility:hidden;white-space:nowrap;display:inline-block;min-width:2px}.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{width:200px}\n"],encapsulation:2,changeDetection:0})}return t})();function $me(t){return AL(t,!0)}function o7(t){return t.nodeType===Node.ELEMENT_NODE}function AL(t,i){if(o7(t)&&i){const n=(t.getAttribute?.("aria-labelledby")?.split(/\s+/g)||[]).reduce((o,r)=>{const u=document.getElementById(r);return u&&o.push(u),o},[]);if(n.length)return n.map(o=>AL(o,!1)).join(" ")}if(o7(t)){const e=t.getAttribute("aria-label")?.trim();if(e)return e}if(function Gme(t){return"INPUT"===t.nodeName}(t)||function qme(t){return"TEXTAREA"===t.nodeName}(t)){if(t.labels?.length)return Array.from(t.labels).map(o=>AL(o,!1)).join(" ");const e=t.getAttribute("placeholder")?.trim();if(e)return e;const n=t.getAttribute("title")?.trim();if(n)return n}return(t.textContent||"").replace(/\s+/g," ").trim()}let r7=(()=>{class t extends t7{_rangeInput=Y(i7);_elementRef=Y(Pn);_defaultErrorStateMatcher=Y(LT);_injector=Y(Ke);_parentForm=Y(Cr,{optional:!0});_parentFormGroup=Y(gb,{optional:!0});ngControl;_dir=Y(ul,{optional:!0});_errorStateTracker;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(){super(),this._errorStateTracker=new gM(this._defaultErrorStateMatcher,null,this._parentFormGroup,this._parentForm,this.stateChanges)}ngOnInit(){const e=this._injector.get(Gh,null,{optional:!0,self:!0});e&&(this.ngControl=e,this._errorStateTracker.ngControl=e)}ngAfterContentInit(){this._register()}ngDoCheck(){this.ngControl&&this.updateErrorState()}isEmpty(){return 0===this._elementRef.nativeElement.value.length}_getPlaceholder(){return this._elementRef.nativeElement.placeholder}focus(){this._elementRef.nativeElement.focus()}getMirrorValue(){const e=this._elementRef.nativeElement,n=e.value;return n.length>0?n:e.placeholder}updateErrorState(){this._errorStateTracker.updateErrorState()}_onInput(e){super._onInput(e),this._rangeInput._handleChildValueChange()}_openPopup(){this._rangeInput._openDatepicker()}_getMinDate(){return this._rangeInput.min}_getMaxDate(){return this._rangeInput.max}_getDateFilter(){return this._rangeInput.dateFilter}_parentDisabled(){return this._rangeInput._groupDisabled}_shouldHandleChangeEvent({source:e}){return e!==this._rangeInput._startInput&&e!==this._rangeInput._endInput}_assignValueProgrammatically(e){super._assignValueProgrammatically(e),(this===this._rangeInput._startInput?this._rangeInput._endInput:this._rangeInput._startInput)?._validatorOnChange()}_formatValue(e){super._formatValue(e),this._rangeInput._handleChildValueChange()}_getAccessibleName(){return $me(this._elementRef.nativeElement)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,inputs:{errorStateMatcher:"errorStateMatcher"},features:[qn]})}return t})(),Wme=(()=>{class t extends r7{_startValidator=e=>{const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),o=this._model?this._model.selection.end:null;return!n||!o||this._dateAdapter.compareDate(n,o)<=0?null:{matStartDateInvalid:{end:o,actual:n}}};_validator=Ov.compose([...super._getValidators(),this._startValidator]);_register(){this._rangeInput._startInput=this}_getValueFromModel(e){return e.start}_shouldHandleChangeEvent(e){return!(!super._shouldHandleChangeEvent(e)||(e.oldValue?.start?e.selection.start&&!this._dateAdapter.compareDate(e.oldValue.start,e.selection.start):!e.selection.start))}_assignValueToModel(e){if(this._model){const n=new Rc(e,this._model.selection.end);this._model.updateSelection(n,this),this._rangeInput._handleChildValueChange()}}_onKeydown(e){const n=this._rangeInput._endInput,o=this._elementRef.nativeElement,r="rtl"!==this._dir?.value;(39===e.keyCode&&r||37===e.keyCode&&!r)&&o.selectionStart===o.value.length&&o.selectionEnd===o.value.length?(e.preventDefault(),n._elementRef.nativeElement.setSelectionRange(0,0),n.focus()):super._onKeydown(e)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["input","matStartDate",""]],hostAttrs:["type","text",1,"mat-start-date","mat-date-range-input-inner"],hostVars:5,hostBindings:function(n,o){1&n&&we("input",function(u){return o._onInput(u.target.value)})("change",function(){return o._onChange()})("keydown",function(u){return o._onKeydown(u)})("blur",function(){return o._onBlur()}),2&n&&(cc("disabled",o.disabled),zn("aria-haspopup",o._rangeInput.rangePicker?"dialog":null)("aria-owns",o._rangeInput._ariaOwns?o._rangeInput._ariaOwns():(null==o._rangeInput.rangePicker?null:o._rangeInput.rangePicker.opened)&&o._rangeInput.rangePicker.id||null)("min",o._getMinDate()?o._dateAdapter.toIso8601(o._getMinDate()):null)("max",o._getMaxDate()?o._dateAdapter.toIso8601(o._getMaxDate()):null))},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[Bn([{provide:Pl,useExisting:t,multi:!0},{provide:ba,useExisting:t,multi:!0}]),qn]})}return t})(),Zme=(()=>{class t extends r7{_endValidator=e=>{const n=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e.value)),o=this._model?this._model.selection.start:null;return!n||!o||this._dateAdapter.compareDate(n,o)>=0?null:{matEndDateInvalid:{start:o,actual:n}}};_register(){this._rangeInput._endInput=this}_validator=Ov.compose([...super._getValidators(),this._endValidator]);_getValueFromModel(e){return e.end}_shouldHandleChangeEvent(e){return!(!super._shouldHandleChangeEvent(e)||(e.oldValue?.end?e.selection.end&&!this._dateAdapter.compareDate(e.oldValue.end,e.selection.end):!e.selection.end))}_assignValueToModel(e){if(this._model){const n=new Rc(this._model.selection.start,e);this._model.updateSelection(n,this)}}_moveCaretToEndOfStartInput(){const e=this._rangeInput._startInput._elementRef.nativeElement,n=e.value;n.length>0&&e.setSelectionRange(n.length,n.length),e.focus()}_onKeydown(e){const n=this._elementRef.nativeElement,o="rtl"!==this._dir?.value;8!==e.keyCode||n.value?(37===e.keyCode&&o||39===e.keyCode&&!o)&&0===n.selectionStart&&0===n.selectionEnd?(e.preventDefault(),this._moveCaretToEndOfStartInput()):super._onKeydown(e):this._moveCaretToEndOfStartInput()}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["input","matEndDate",""]],hostAttrs:["type","text",1,"mat-end-date","mat-date-range-input-inner"],hostVars:5,hostBindings:function(n,o){1&n&&we("input",function(u){return o._onInput(u.target.value)})("change",function(){return o._onChange()})("keydown",function(u){return o._onKeydown(u)})("blur",function(){return o._onBlur()}),2&n&&(cc("disabled",o.disabled),zn("aria-haspopup",o._rangeInput.rangePicker?"dialog":null)("aria-owns",o._rangeInput._ariaOwns?o._rangeInput._ariaOwns():(null==o._rangeInput.rangePicker?null:o._rangeInput.rangePicker.opened)&&o._rangeInput.rangePicker.id||null)("min",o._getMinDate()?o._dateAdapter.toIso8601(o._getMinDate()):null)("max",o._getMaxDate()?o._dateAdapter.toIso8601(o._getMaxDate()):null))},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[Bn([{provide:Pl,useExisting:t,multi:!0},{provide:ba,useExisting:t,multi:!0}]),qn]})}return t})(),Yme=(()=>{class t extends YM{_forwardContentValues(e){super._forwardContentValues(e);const n=this.datepickerInput;n&&(e.comparisonStart=n.comparisonStart,e.comparisonEnd=n.comparisonEnd,e.startDateAccessibleName=n._getStartDateAccessibleName(),e.endDateAccessibleName=n._getEndDateAccessibleName())}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-date-range-picker"]],exportAs:["matDateRangePicker"],features:[Bn([Ome,Fme,{provide:YM,useExisting:t}]),qn],decls:0,vars:0,template:function(n,o){},encapsulation:2,changeDetection:0})}return t})(),Xme=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[Qx,Vme],imports:[uM,Ib,HE,Gv,Ki,e7,tw,Qj,T_]})}return t})();function Kme(t,i){if(1&t){const e=pt();w(0,"mat-checkbox",11),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.isUSBKey,o)||(r.isUSBKey=o),ge(o)}),M(1," USB Key "),x()}if(2&t){const e=X();Kn("ngModel",e.isUSBKey),N("disabled",e.wasAdded||e.isEditingLicense||e.is_subscription||"LVP"==e.application)}}function Qme(t,i){if(1&t){const e=pt();at(0),w(1,"mat-form-field",12)(2,"mat-label"),M(3,"USB Serial"),x(),w(4,"input",13),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.usbSerialKey,o)||(r.usbSerialKey=o),ge(o)}),x()(),Re(5,"br"),w(6,"mat-form-field",12)(7,"mat-label"),M(8,"USB Computer ID"),x(),w(9,"input",14),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.usbComputerID,o)||(r.usbComputerID=o),ge(o)}),x()(),Re(10,"br"),w(11,"mat-form-field",12)(12,"mat-label"),M(13,"USB Purchase Date"),x(),w(14,"input",15),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.usbPurchasDate,o)||(r.usbPurchasDate=o),ge(o)}),x(),Re(15,"mat-datepicker-toggle",16)(16,"mat-datepicker",null,1),x(),st()}if(2&t){const e=Vi(17),n=X();E(4),N("required",n.isUSBKey),Kn("ngModel",n.usbSerialKey),E(5),N("required",n.isUSBKey),Kn("ngModel",n.usbComputerID),E(5),N("required",n.isUSBKey)("matDatepicker",e),Kn("ngModel",n.usbPurchasDate),E(),N("for",e)}}function Jme(t,i){if(1&t){const e=pt();at(0),w(1,"mat-form-field",6)(2,"mat-label"),M(3,"Activation Code:"),x(),w(4,"input",17),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.activationCode,o)||(r.activationCode=o),ge(o)}),x()(),st()}if(2&t){const e=X();E(4),Kn("ngModel",e.activationCode),N("disabled",!0)}}function efe(t,i){if(1&t){const e=pt();at(0),w(1,"mat-form-field",6)(2,"mat-label"),M(3,"License Key:"),x(),w(4,"textarea",18),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.usbRegistrationCode,o)||(r.usbRegistrationCode=o),ge(o)}),x()(),st()}if(2&t){const e=X();E(4),Kn("ngModel",e.usbRegistrationCode),N("disabled",!0)}}let a7=(()=>{class t{dialogRef;inputData;loginService;http;datepipe;activationCode="";usbSerialKey="";usbComputerID="";usbRegistrationCode="";application="";category="";sub_category="";version="";is_subscription=!1;usbPurchasDate;notes="";isUSBKey=!1;wasAdded=!1;userInfo=null;isEditingLicense=!1;licenseID=null;licenseSetUUID=null;route;constructor(e,n,o,r,u){this.dialogRef=e,this.inputData=n,this.loginService=o,this.http=r,this.datepipe=u}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.route=this.inputData.route,this.application=this.inputData.app,this.category=this.inputData.category,this.sub_category=this.inputData.sub_category,this.version=this.inputData.version,this.is_subscription=this.inputData.is_subscription,this.licenseSetUUID=this.inputData.set_uuid,this.licenseID=this.inputData.id,null!=this.licenseID&&this.licenseID>=0?(this.isEditingLicense=!0,this.notes=this.inputData.notes,this.usbSerialKey=this.inputData.usbserial,null!=this.usbSerialKey?(this.isUSBKey=!0,this.usbComputerID=this.inputData.usbcomputerid,this.usbPurchasDate=this.inputData.usbpurchasedate,this.usbRegistrationCode=this.inputData.activationcode):this.activationCode=this.inputData.activationcode):this.licenseID=null}onSubmit(){let e="-";("LVP"==this.application||this.is_subscription)&&(this.isUSBKey=!1),this.isUSBKey?e=this.datepipe.transform(this.usbPurchasDate,"yyyy-MM-dd"):(this.usbSerialKey="-",this.usbComputerID="-",this.usbRegistrationCode="-");let n=this.loginService.getURL("standalonelicense",this.route),o={application:this.application,category:this.category,sub_category:this.sub_category,version:this.version,usbserial:this.usbSerialKey,usbcomputerid:this.usbComputerID,usbpurchased:e,set_uuid:this.licenseSetUUID};null!=this.notes&&""==this.notes.trim()&&(this.notes=null),o.notes=this.notes,this.isEditingLicense&&(o.id=this.licenseID),this.http.post(n,o,{withCredentials:!0}).subscribe(r=>{this.activationCode=r,this.wasAdded=!0,(this.isUSBKey||this.isEditingLicense)&&(this.usbRegistrationCode=r)})}onClose(){this.dialogRef.close()}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Po),$e(Uo),$e(Rl))};static \u0275cmp=cn({type:t,selectors:[["app-showactivationcode"]],standalone:!1,decls:22,vars:7,consts:[["ShowActivationCodeForm","ngForm"],["picker",""],[3,"ngSubmit"],["mat-dialog-title",""],["name","USBToggle",3,"ngModel","disabled","ngModelChange",4,"ngIf"],[4,"ngIf"],["appearance","fill",1,"input"],["matInput","","name","notes",3,"ngModelChange","ngModel"],["align","center"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["mat-raised-button","","color","primary","type","button",3,"click"],["name","USBToggle",3,"ngModelChange","ngModel","disabled"],["hideRequiredMarker","","appearance","fill",1,"input"],["matInput","","name","USBSerial",3,"ngModelChange","required","ngModel"],["matInput","","name","USBComputerID",2,"text-transform","uppercase",3,"ngModelChange","required","ngModel"],["matInput","","name","USBPurchaseDate",3,"ngModelChange","required","matDatepicker","ngModel"],["matSuffix","",3,"for"],["matInput","","name","activationcode","readonly","",2,"text-align","center",3,"ngModelChange","ngModel","disabled"],["matInput","","name","USBRegistrationCode","readonly","",3,"ngModelChange","ngModel","disabled"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",2,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"title",3),M(3," License Activation "),x(),w(4,"mat-dialog-content")(5,"div"),te(6,Kme,2,2,"mat-checkbox",4),Re(7,"br"),te(8,Qme,18,8,"ng-container",5),Re(9,"br"),w(10,"mat-form-field",6)(11,"mat-label"),M(12,"Notes:"),x(),w(13,"input",7),Qn("ngModelChange",function(y){return fe(r),ei(o.notes,y)||(o.notes=y),ge(y)}),x()(),Re(14,"br"),te(15,Jme,5,2,"ng-container",5)(16,efe,5,2,"ng-container",5),x()(),w(17,"mat-dialog-actions",8)(18,"button",9),M(19),x(),w(20,"button",10),we("click",function(){return fe(r),ge(o.onClose())}),M(21,"Close"),x()()()}if(2&n){const r=Vi(1);E(6),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()),E(2),N("ngIf",o.isUSBKey&&o.userInfo&&o.userInfo.isMasterDBUser()),E(5),Kn("ngModel",o.notes),E(2),N("ngIf",!o.isUSBKey),E(),N("ngIf",o.isUSBKey),E(2),N("disabled",o.wasAdded||!r.form.valid),E(),Ct(1==o.isEditingLicense?"Save":"Add")}},dependencies:[ir,ka,jr,wr,Aa,Jl,ts,Cr,na,Oa,Qs,xa,ws,Eb,Fl,Os,Pb,XM,ew,tw],styles:[".input[_ngcontent-%COMP%]{width:100%}mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}textarea[_ngcontent-%COMP%]{resize:none}"]})}return t})(),tfe=(()=>{class t{dialogRef;inputData;loginService;http;datepipe;computer_id="";license_key="";wasClaimed=!1;userInfo=null;isEditingLicense=!1;licenseID=null;route;constructor(e,n,o,r,u){this.dialogRef=e,this.inputData=n,this.loginService=o,this.http=r,this.datepipe=u}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.route=this.inputData.route,this.licenseID=this.inputData.id,null!=this.inputData.computer_id&&""!=this.inputData.computer_id&&(this.computer_id=this.inputData.computer_id,null!=this.inputData.license_key&&""!=this.inputData.license_key&&(this.license_key=this.inputData.license_key),this.wasClaimed=!0)}onSubmit(){if(""!=this.computer_id){let e=this.loginService.getURL("ondemandlicense",this.route)+"/+claim_private";this.http.post(e,{id:this.licenseID,computer_id:this.computer_id},{withCredentials:!0}).subscribe(o=>{this.license_key=o,this.wasClaimed=!0})}}onClose(){this.dialogRef.close()}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Po),$e(Uo),$e(Rl))};static \u0275cmp=cn({type:t,selectors:[["app-claimprivateserver"]],standalone:!1,decls:19,vars:6,consts:[["ClaimPrivateServerForm","ngForm"],[3,"ngSubmit"],["appearance","fill"],["matInput","","name","computer_id",2,"text-transform","uppercase",3,"ngModelChange","required","ngModel"],["matInput","","name","license_key","readonly","",3,"ngModelChange","ngModel","disabled"],["align","center"],["mat-raised-button","","color","primary","type","submit",2,"display","inline-block",3,"disabled"],["mat-raised-button","","color","primary","type","button",2,"display","inline-block","margin-left","1em",3,"click"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content")(3,"div")(4,"mat-form-field",2)(5,"mat-label"),M(6,"Computer ID:"),x(),w(7,"input",3),Qn("ngModelChange",function(y){return fe(r),ei(o.computer_id,y)||(o.computer_id=y),ge(y)}),x()(),Re(8,"br"),at(9),w(10,"mat-form-field",2)(11,"mat-label"),M(12,"License Key:"),x(),w(13,"textarea",4),Qn("ngModelChange",function(y){return fe(r),ei(o.license_key,y)||(o.license_key=y),ge(y)}),x()(),st(),x()(),w(14,"mat-dialog-actions",5)(15,"button",6),M(16),x(),w(17,"button",7),we("click",function(){return fe(r),ge(o.onClose())}),M(18,"Close"),x()()()}if(2&n){const r=Vi(1);E(7),N("required",!0),Kn("ngModel",o.computer_id),E(6),Kn("ngModel",o.license_key),N("disabled",!0),E(2),N("disabled",!r.form.valid),E(),Ct(o.wasClaimed?"Save":"Claim")}},dependencies:[ka,jr,wr,Aa,Jl,ts,Cr,na,Oa,xa,ws,Fl,Os],styles:["mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}textarea[_ngcontent-%COMP%]{resize:none}"]})}return t})();class nfe{uuid;application;version;category;sub_category;license_type;parent_options;options;optionlist;purchase_orders;local_license;local_computer_id;local_license_key;limit;promo_limit;notes;is_subscription;sub_start;sub_end;last_sub_start;last_sub_end;is_sub_expired;is_sub_expiring;is_sub_delayed}var h0=function(t){return t[t.MONTH_COUNT_CHANGE=0]="MONTH_COUNT_CHANGE",t[t.DATE_CHANGE=1]="DATE_CHANGE",t}(h0||{});class nw{start;end;constructor(){this.start=new Date,this.end=new Date}getSubscriptionLengthInDays(){let i=Math.abs(this.end.getTime()-this.start.getTime());return Math.ceil(i/864e5)}getSubscriptionLengthInMonths(){let i=0;return i=this.end.getMonth()-this.start.getMonth()+12*(this.end.getFullYear()-this.start.getFullYear()),i}getDaysRemaining(){let i=new Date,e=0;if(this.start<=i){let n=this.end.getTime()-i.getTime();e=Math.max(Math.ceil(n/864e5),0)}else e=this.getSubscriptionLengthInDays();return e}}class QM{subscription;change_amount;change_type;constructor(){this.subscription=new nw,this.change_amount=0,this.change_type=h0.DATE_CHANGE}}class JM{constructor(){}addMonthsToDate(i,e){let n=new Date(i),o=n.getDate();return n.setMonth(n.getMonth()+ +e),n.getDate()!=o&&n.setDate(0),n}updateSubscriptionDetails(i){let e=new nw;return e.start=i.subscription.start,e.end=i.subscription.end,i.subscription.start>i.subscription.end&&(e.end=i.subscription.start),i.change_type==h0.MONTH_COUNT_CHANGE&&(i.change_amount<0&&(i.change_amount=0),e.end=this.addMonthsToDate(i.subscription.start,i.change_amount)),e}}const ife=()=>({standalone:!0});function ofe(t,i){1&t&&(w(0,"span")(1,"p",22),M(2," Select the start and end dates for the subscription."),Re(3,"br"),M(4," The times for the selected dates will be set to:"),Re(5,"br"),w(6,"span",23),M(7,"Subscription Start time: 12:00 am, Subscription End time: 11:59 pm."),x(),Re(8,"br"),M(9," License requests outside of the subscription dates will be rejected by the server. "),x()())}function rfe(t,i){1&t&&(w(0,"span")(1,"p",22),M(2,"If you would like to extend the existing subscription,"),Re(3,"br"),M(4," select extend and then select a new end date for the subscription."),Re(5,"br"),M(6," This will retain the existing subscription but will change the end date. "),x(),w(7,"p",22),M(8," If not, select renew and then select new start and end dates for the subscription."),Re(9,"br"),M(10," This will end the current subscription entry and create a new one. "),x(),w(11,"p",22),M(12," The times for the selected dates will be set to:"),Re(13,"br"),w(14,"span",23),M(15,"Subscription Start time: 12:00 am, Subscription End time: 11:59 pm."),x(),Re(16,"br"),M(17," License requests outside of the subscription dates will be rejected by the server. "),x()())}function afe(t,i){if(1&t){const e=pt();w(0,"mat-radio-group",24),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.updateOption,o)||(r.updateOption=o),ge(o)}),w(1,"mat-radio-button",25),M(2,"Renew \xa0 \xa0 \xa0"),x(),w(3,"mat-radio-button",26),M(4,"Extend"),x()()}if(2&t){const e=X();Kn("ngModel",e.updateOption),N("ngModelOptions",jn(3,ife))("disabled",e.initialSubscription)}}function sfe(t,i){1&t&&Re(0,"mat-divider")}function lfe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X();E(),Jt(" ",e.subscriptionDays.toString()," ")}}function cfe(t,i){1&t&&(w(0,"span"),M(1," - "),x())}function dfe(t,i){if(1&t&&(w(0,"span",9),M(1," ("),w(2,"span",10),M(3),x(),M(4," remaining) "),x()),2&t){const e=X();E(3),Ct(e.subscriptionDaysLeft)}}const ufe=li_backendURL+"/license_subs";class hfe{data;route}let pfe=(()=>{class t{dialogRef;inputData;http;loginService;dialog;licenseOptionSet=new nfe;subscriptionStart=new Date;subscriptionEnd=new Date;initialSubscription=!0;updateOption="renew";windowHeight=800;subscriptionDays=30;subscriptionDaysLeft=30;subscriptionMonths=0;po_number="";constructor(e,n,o,r,u){this.dialogRef=e,this.inputData=n,this.http=o,this.loginService=r,this.dialog=u,this.licenseOptionSet=n.data,null!=this.licenseOptionSet.sub_start&&""!=this.licenseOptionSet.sub_start&&(this.subscriptionStart=new Date(this.licenseOptionSet.sub_start+"Z"),this.initialSubscription=!1),null!=this.licenseOptionSet.sub_end&&""!=this.licenseOptionSet.sub_end?(this.subscriptionEnd=new Date(this.licenseOptionSet.sub_end+"Z"),this.initialSubscription=!1):this.subscriptionEnd.setDate(this.subscriptionEnd.getDate()+30)}ngOnInit(){this.windowHeight=window.innerHeight,this.updateSubscriptionDetailsByDate()}onResize(e){this.windowHeight=e.target.innerHeight}selectPurchaseOrder(){let e=new Zx;e.navigated_org=this.loginService.getOrg(this.inputData.route),e.config_type=cf.PO_CONFIG_SELECT;let n=new ha;n.minWidth=400,n.data=e,this.dialog.open(Yx,n).afterClosed().subscribe(u=>{null!=u&&(this.po_number=u)})}canUpdateSubscription(){return!(""==this.po_number||this.subscriptionStart>=this.subscriptionEnd)}updateSubscriptionDetailsByMonth(){let e=new nw;e.start=this.subscriptionStart,e.end=this.subscriptionEnd;let n=new QM;n.subscription=e,n.change_type=h0.MONTH_COUNT_CHANGE,n.change_amount=this.subscriptionMonths;let r=(new JM).updateSubscriptionDetails(n);this.subscriptionStart=r.start,this.subscriptionEnd=r.end,this.subscriptionDays=r.getSubscriptionLengthInDays(),this.subscriptionDaysLeft=r.getDaysRemaining()}updateSubscriptionDetailsByDate(){let e=new nw;e.start=this.subscriptionStart,e.end=this.subscriptionEnd;let n=new QM;n.subscription=e,n.change_type=h0.DATE_CHANGE;let r=(new JM).updateSubscriptionDetails(n);this.subscriptionStart=r.start,this.subscriptionEnd=r.end,this.subscriptionDays=r.getSubscriptionLengthInDays(),this.subscriptionMonths=r.getSubscriptionLengthInMonths(),this.subscriptionDaysLeft=r.getDaysRemaining()}onSubmit(){let e=this.subscriptionStart;this.subscriptionStart=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);let n=this.subscriptionEnd;this.subscriptionEnd=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);let o={option_set_id:this.licenseOptionSet.id,is_subscription:!0,sub_start:this.subscriptionStart.toISOString(),sub_end:this.subscriptionEnd.toISOString(),extend_sub:"extend"===this.updateOption,purchase_order:this.po_number};this.http.post(ufe,o,{withCredentials:!0}).subscribe(r=>{this.dialogRef.close(!0)})}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(Po),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-subscription-edit"]],hostBindings:function(n,o){1&n&&we("resize",function(u){return o.onResize(u)},0,Lp)},standalone:!1,decls:54,vars:17,consts:[["subscriptionEditForm","ngForm"],["picker1",""],["picker2",""],[3,"submit"],["mat-dialog-title","",1,"title"],[4,"ngIf"],[1,"controls-container"],["aria-label","Select update option:",3,"ngModel","ngModelOptions","disabled","ngModelChange",4,"ngIf"],["fontSet","material-symbols-outlined",1,"padded-icon"],[1,"bold-text"],[1,"bold-color-blue"],["class","bold-text",4,"ngIf"],["hideRequiredMarker","","appearance","fill"],["matInput","","name","SubscriptionStart",3,"ngModelChange","matDatepicker","ngModel","disabled"],["matSuffix","",3,"for"],["matInput","","type","number","min","0","name","SubscriptionMonths",3,"ngModelChange","ngModel"],["matInput","","name","SubscriptionEnd",3,"ngModelChange","matDatepicker","ngModel"],["required","","name","po_number","matInput","","readonly","",3,"ngModelChange","ngModel"],["matSuffix","","mat-icon-button","","aria-label","Select PO","type","button",3,"click"],["fontSet","material-symbols-outlined"],["align","end"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"descript"],[1,"color-blue"],["aria-label","Select update option:",3,"ngModelChange","ngModel","ngModelOptions","disabled"],["value","renew"],["value","extend"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",3,0),we("submit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content")(3,"h4",4),M(4," Software License Subscription "),x(),Re(5,"mat-divider"),w(6,"small"),te(7,ofe,10,0,"span",5)(8,rfe,18,0,"span",5),x(),Re(9,"mat-divider"),w(10,"div",6),te(11,afe,5,4,"mat-radio-group",7)(12,sfe,1,0,"mat-divider",5),w(13,"div")(14,"small")(15,"mat-icon",8),M(16,"date_range"),x(),w(17,"span",9),M(18," Subscription Length: "),x(),w(19,"span",10),te(20,lfe,2,1,"span",5)(21,cfe,2,0,"span",5),x(),w(22,"span",9),M(23," Days "),x(),te(24,dfe,5,1,"span",11),x()(),Re(25,"mat-divider"),w(26,"mat-form-field",12)(27,"mat-label"),M(28,"Subscription Start:"),x(),w(29,"input",13),Qn("ngModelChange",function(y){return fe(r),ei(o.subscriptionStart,y)||(o.subscriptionStart=y),ge(y)}),we("ngModelChange",function(){return fe(r),ge(o.updateSubscriptionDetailsByDate())}),x(),Re(30,"mat-datepicker-toggle",14)(31,"mat-datepicker",null,1),x(),w(33,"mat-form-field",12)(34,"mat-label"),M(35,"Months in Subscription"),x(),w(36,"input",15),Qn("ngModelChange",function(y){return fe(r),ei(o.subscriptionMonths,y)||(o.subscriptionMonths=y),ge(y)}),we("ngModelChange",function(){return fe(r),ge(o.updateSubscriptionDetailsByMonth())}),x()(),w(37,"mat-form-field",12)(38,"mat-label"),M(39,"Subscription End:"),x(),w(40,"input",16),Qn("ngModelChange",function(y){return fe(r),ei(o.subscriptionEnd,y)||(o.subscriptionEnd=y),ge(y)}),we("ngModelChange",function(){return fe(r),ge(o.updateSubscriptionDetailsByDate())}),x(),Re(41,"mat-datepicker-toggle",14)(42,"mat-datepicker",null,2),x(),w(44,"mat-form-field")(45,"mat-label"),M(46,"PO Number"),x(),w(47,"input",17),Qn("ngModelChange",function(y){return fe(r),ei(o.po_number,y)||(o.po_number=y),ge(y)}),x(),w(48,"button",18),we("click",function(){return fe(r),ge(o.selectPurchaseOrder())}),w(49,"mat-icon",19),M(50,"add"),x()()()()(),w(51,"mat-dialog-actions",20)(52,"button",21),M(53,"Save"),x()()()}if(2&n){const r=Vi(32),u=Vi(43);E(7),N("ngIf",o.initialSubscription),E(),N("ngIf",!o.initialSubscription),E(3),N("ngIf",!o.initialSubscription),E(),N("ngIf",!o.initialSubscription),E(8),N("ngIf",o.subscriptionEnd>=o.subscriptionStart),E(),N("ngIf",o.subscriptionEnd=o.subscriptionStart),E(5),N("matDatepicker",r),Kn("ngModel",o.subscriptionStart),N("disabled","extend"==o.updateOption),E(),N("for",r),E(6),Kn("ngModel",o.subscriptionMonths),E(4),N("matDatepicker",u),Kn("ngModel",o.subscriptionEnd),E(),N("for",u),E(6),Kn("ngModel",o.po_number),E(5),N("disabled",!o.canUpdateSubscription())}},dependencies:[ir,ka,jr,yx,wr,Aa,Jl,vx,ts,Cr,na,Oa,Qs,xa,ws,qa,Eb,Fl,Os,Tu,XM,ew,tw,Sr,V3,CM],styles:[".title[_ngcontent-%COMP%]{text-align:center}mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}textarea[_ngcontent-%COMP%]{resize:none}.descript[_ngcontent-%COMP%]{white-space:pre-line}.controls-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;text-align:center;padding:0;margin:0}.bold-text[_ngcontent-%COMP%]{font-weight:700;vertical-align:top}.bold-color-blue[_ngcontent-%COMP%]{color:#00f;font-weight:700;vertical-align:top}.color-blue[_ngcontent-%COMP%]{color:#00f}.padded-icon[_ngcontent-%COMP%]{margin-left:.5em;margin-right:.2em}"]})}return t})();class s7{org_name;org_friendly_name;device_list;imei_list;iccid_list;update_command;sub_start;sub_end;org_lock=!1}class df{id;uuid;distributor_id;distributor_name;name;friendly_name;enabled;is_distributor;customer_id;has_cloudarchiving;notify_user_id;test;require_mfa;allow_email_mfa}const mfe=["orgAutoComplete"],p0=()=>({standalone:!0});function ffe(t,i){1&t&&(w(0,"span"),M(1," Assign Devices "),x())}function _fe(t,i){1&t&&(w(0,"span"),M(1," Subscribe Devices "),x())}function gfe(t,i){1&t&&(w(0,"span"),M(1," Unsubscribe Devices "),x())}function bfe(t,i){1&t&&(w(0,"span"),M(1," Delete Devices "),x())}function yfe(t,i){1&t&&(w(0,"span"),M(1," Notify of Expiring/Expired Subscriptions "),x())}function vfe(t,i){if(1&t&&(w(0,"span")(1,"h6"),M(2),x()()),2&t){const e=X();E(2),Jt("Current Organization: ",e.currentOrganizationLabel,"")}}function xfe(t,i){1&t&&(w(0,"span")(1,"p"),M(2,"Selected devices will be assigned to the chosen organization."),x(),w(3,"p"),M(4,"Assigned devices without an active subscription can be re-assigned or have their assignment removed."),x(),w(5,"p"),M(6,"Re-assigning or removing an assignment will remove any past inactive subscriptions."),x()())}function wfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"p"),M(2,"Selected devices will have their subscription end date set to the chosen date."),x(),w(3,"p"),M(4,"Note: If updating an existing subscription, the new expiration must be greater than the existing one."),x(),w(5,"p"),M(6,"If you would like to shorten a subscription, end the current one and begin a new one."),x(),w(7,"div",11)(8,"button",10),we("click",function(){return fe(e),ge(X().onDynamicDownloadCSV())}),M(9,"Download Device List CSV"),x()()()}}function Cfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"p"),M(2,"Selected devices will have their existing subscriptions ended."),x(),w(3,"p"),M(4,"You must make sure that the cell plan associated with the device is also cancelled."),x(),w(5,"div",11)(6,"button",10),we("click",function(){return fe(e),ge(X().onDynamicDownloadCSV())}),M(7,"Download Device List CSV"),x()()()}}function Sfe(t,i){1&t&&(w(0,"span")(1,"p"),M(2,"Selected devices will be removed from the database. This option is only available for unassigned and unsubscribed devices."),x(),w(3,"p"),M(4,"If there are any past inactive subscriptions, they will also be removed."),x(),w(5,"p"),M(6,"You must check the confirmation boxes in order to continue."),x()())}function Tfe(t,i){1&t&&(w(0,"p"),M(1,"If "),w(2,"strong"),M(3,"'All'"),x(),M(4," is selected, every organization with expiring subscriptions within the selected days will be emailed (primary contact) with details of the expirations."),x())}function Dfe(t,i){if(1&t&&(w(0,"span")(1,"p"),M(2,"Selected organization(s) will be notified of any license or device subscriptions that are expiring within the specified number of days or have already expired."),x(),te(3,Tfe,5,0,"p",7),w(4,"p")(5,"strong"),M(6,"Neurotronics.com"),x(),M(7," will also receive an email with a CSV containing a list of all organizations with expiring / expired "),w(8,"b"),M(9,"device"),x(),M(10," subscriptions."),x()()),2&t){const e=X();E(3),N("ngIf",!e.lockOrganizationSelect)}}function Ife(t,i){1&t&&(w(0,"div",18),M(1,"Select Organization"),x())}function Efe(t,i){if(1&t&&(w(0,"mat-option",23),M(1),x()),2&t){const e=i.$implicit;N("value",e.name),E(),Ea(" ",e.friendly_name,"\xa0(",e.name,") ")}}function Mfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"input",19,1),Qn("ngModelChange",function(o){fe(e);const r=X(2);return ei(r.organizationDisplayText,o)||(r.organizationDisplayText=o),ge(o)}),we("ngModelOptions",function(){return fe(e),ge(X(2).standalone=!0)}),x(),w(3,"mat-autocomplete",20,2)(6,"mat-option",21),M(7,"NONE"),x(),te(8,Efe,2,3,"mat-option",22),ti(9,"async"),x()()}if(2&t){const e=Vi(5),n=X(2);E(),N("formControl",n.orgSelectFormControl)("matAutocomplete",e),Kn("ngModel",n.organizationDisplayText),N("disabled",n.lockOrganizationSelect),E(2),N("displayWith",n.orgAutoCompleteDisplay.bind(n)),E(5),N("ngForOf",Zm(9,6,n.filteredOrganizations))}}function Afe(t,i){if(1&t){const e=pt();w(0,"span")(1,"div",11),te(2,Ife,2,0,"div",12),w(3,"mat-label",13),M(4,"Organization Search:"),x(),w(5,"mat-form-field",14),te(6,Mfe,10,8,"span",7),x(),w(7,"mat-form-field")(8,"mat-label"),M(9,"PO Number"),x(),w(10,"input",15),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.po_number,o)||(r.po_number=o),ge(o)}),x(),w(11,"button",16),we("click",function(){return fe(e),ge(X().selectPurchaseOrder())}),w(12,"mat-icon",17),M(13,"add"),x()()()()()}if(2&t){const e=X();E(2),N("ngIf",!e.canSelectPurchaseOrder()),E(4),N("ngIf",!e.lockOrganizationSelect),E(4),Kn("ngModel",e.po_number),E(),N("disabled",!e.canSelectPurchaseOrder())}}function kfe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2);E(),Jt(" ",e.subscriptionDays.toString()," ")}}function Rfe(t,i){1&t&&(w(0,"span"),M(1," - "),x())}function Ofe(t,i){if(1&t&&(w(0,"span",25),M(1," ("),w(2,"span",26),M(3),x(),M(4," remaining) "),x()),2&t){const e=X(2);E(3),Ct(e.subscriptionDaysLeft)}}function Pfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"div",11)(2,"small")(3,"mat-icon",24),M(4,"date_range"),x(),w(5,"span",25),M(6," Subscription Length: "),x(),w(7,"span",26),te(8,kfe,2,1,"span",7)(9,Rfe,2,0,"span",7),x(),w(10,"span",25),M(11," Days "),x(),te(12,Ofe,5,1,"span",27),x(),Re(13,"mat-divider"),w(14,"mat-form-field",28)(15,"mat-label"),M(16,"Subscription Start Date:"),x(),w(17,"input",29),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.subscriptionStartDate,o)||(r.subscriptionStartDate=o),ge(o)}),we("ngModelChange",function(){return fe(e),ge(X().updateSubscriptionDetailsByDate())}),x(),Re(18,"mat-datepicker-toggle",30)(19,"mat-datepicker",null,3),x(),w(21,"mat-form-field",28)(22,"mat-label"),M(23,"Months in Subscription"),x(),w(24,"input",31),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.subscriptionMonths,o)||(r.subscriptionMonths=o),ge(o)}),we("ngModelChange",function(){return fe(e),ge(X().updateSubscriptionDetailsByMonth())}),x()(),w(25,"mat-form-field",28)(26,"mat-label"),M(27,"Subscription End Date:"),x(),w(28,"input",32),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.subscriptionEndDate,o)||(r.subscriptionEndDate=o),ge(o)}),we("ngModelChange",function(){return fe(e),ge(X().updateSubscriptionDetailsByDate())}),x(),Re(29,"mat-datepicker-toggle",30)(30,"mat-datepicker",null,4),x(),w(32,"mat-form-field")(33,"mat-label"),M(34,"PO Number"),x(),w(35,"input",15),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.po_number,o)||(r.po_number=o),ge(o)}),x(),w(36,"button",33),we("click",function(){return fe(e),ge(X().selectPurchaseOrder())}),w(37,"mat-icon",17),M(38,"add"),x()()()()()}if(2&t){const e=Vi(20),n=Vi(31),o=X();E(8),N("ngIf",o.subscriptionEndDate>=o.subscriptionStartDate),E(),N("ngIf",o.subscriptionEndDate=o.subscriptionStartDate),E(5),N("matDatepicker",e),Kn("ngModel",o.subscriptionStartDate),E(),N("for",e),E(6),Kn("ngModel",o.subscriptionMonths),E(4),N("matDatepicker",n),Kn("ngModel",o.subscriptionEndDate),E(),N("for",n),E(6),Kn("ngModel",o.po_number)}}function Lfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"div",11),Re(2,"mat-divider"),w(3,"div")(4,"mat-label",34),M(5,"End Subscription Confirmation:"),x(),M(6,"\xa0 "),w(7,"mat-checkbox",35),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.endSubscriptionConfirm,o)||(r.endSubscriptionConfirm=o),ge(o)}),x(),w(8,"mat-checkbox",35),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.endSubscriptionCellPlanEndedConfirm,o)||(r.endSubscriptionCellPlanEndedConfirm=o),ge(o)}),x()(),w(9,"mat-form-field")(10,"mat-label"),M(11,"PO Number"),x(),w(12,"input",15),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.po_number,o)||(r.po_number=o),ge(o)}),x(),w(13,"button",33),we("click",function(){return fe(e),ge(X().selectPurchaseOrder())}),w(14,"mat-icon",17),M(15,"add"),x()()()()()}if(2&t){const e=X();E(7),Kn("ngModel",e.endSubscriptionConfirm),N("ngModelOptions",jn(5,p0)),E(),Kn("ngModel",e.endSubscriptionCellPlanEndedConfirm),N("ngModelOptions",jn(6,p0)),E(4),Kn("ngModel",e.po_number)}}function Ffe(t,i){if(1&t){const e=pt();w(0,"span")(1,"mat-checkbox",36),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.deleteDeviceConfirm1,o)||(r.deleteDeviceConfirm1=o),ge(o)}),M(2," Delete Device Confirmation: "),x(),M(3," \xa0 "),w(4,"mat-checkbox",35),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.deleteDeviceConfirm2,o)||(r.deleteDeviceConfirm2=o),ge(o)}),x(),M(5," \xa0 "),w(6,"mat-checkbox",35),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.deleteDeviceConfirm3,o)||(r.deleteDeviceConfirm3=o),ge(o)}),x(),w(7,"div"),M(8,"\xa0"),x()()}if(2&t){const e=X();E(),Kn("ngModel",e.deleteDeviceConfirm1),N("ngModelOptions",jn(6,p0)),E(3),Kn("ngModel",e.deleteDeviceConfirm2),N("ngModelOptions",jn(7,p0)),E(2),Kn("ngModel",e.deleteDeviceConfirm3),N("ngModelOptions",jn(8,p0))}}function Nfe(t,i){if(1&t&&(w(0,"span"),Re(1,"input",38,1),x()),2&t){const e=X(2);E(),N("formControl",e.orgSelectFormControl)("readonly",!0)}}function zfe(t,i){if(1&t&&(w(0,"mat-option",23),M(1),x()),2&t){const e=i.$implicit;N("value",e.name),E(),Ea(" ",e.friendly_name,"\xa0(",e.name,") ")}}function Bfe(t,i){if(1&t&&(w(0,"span"),Re(1,"input",39,1),w(3,"mat-autocomplete",20,2)(6,"mat-option",21),M(7,"ALL"),x(),te(8,zfe,2,3,"mat-option",22),ti(9,"async"),x()()),2&t){const e=Vi(5),n=X(2);E(),N("formControl",n.orgSelectFormControl)("matAutocomplete",e),E(2),N("displayWith",n.orgAutoCompleteDisplay.bind(n)),E(5),N("ngForOf",Zm(9,4,n.filteredOrganizations))}}function Vfe(t,i){if(1&t){const e=pt();w(0,"span")(1,"div",11)(2,"mat-label",13),M(3,"Notify Organization(s) Search:"),x(),w(4,"mat-form-field",14),te(5,Nfe,3,2,"span",7)(6,Bfe,10,6,"span",7),x(),w(7,"mat-form-field")(8,"mat-label",34),M(9,"Expiration Day Buffer:"),x(),w(10,"input",37),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.subscriptionCheckDayBuffer,o)||(r.subscriptionCheckDayBuffer=o),ge(o)}),x()(),w(11,"div")(12,"mat-checkbox",36),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.sendNotificationConfirm,o)||(r.sendNotificationConfirm=o),ge(o)}),M(13," Email Notification Confirmation: "),x()()()()}if(2&t){const e=X();E(5),N("ngIf",e.lockOrganizationSelect),E(),N("ngIf",!e.lockOrganizationSelect),E(4),Kn("ngModel",e.subscriptionCheckDayBuffer),N("ngModelOptions",jn(6,p0)),E(2),Kn("ngModel",e.sendNotificationConfirm),N("ngModelOptions",jn(7,p0))}}function Ufe(t,i){if(1&t&&(w(0,"span")(1,"mat-label",34),M(2,"Selected Devices:"),x(),w(3,"p")(4,"small"),M(5),x()()()),2&t){const e=X();E(5),Ct(e.data.device_list)}}const Hfe=li_backendURL+"/update_devices",jfe=li_backendURL+"/organization";var os=function(t){return t[t.UNKNOWN_COMMAND=0]="UNKNOWN_COMMAND",t[t.ASSIGN_DEVICES=1]="ASSIGN_DEVICES",t[t.SUBSCRIBE_DEVICES=2]="SUBSCRIBE_DEVICES",t[t.UNSUBSCRIBE_DEVICES=3]="UNSUBSCRIBE_DEVICES",t[t.DELETE_DEVICES=4]="DELETE_DEVICES",t[t.SEND_EXPIRING_NOTIFICATION=5]="SEND_EXPIRING_NOTIFICATION",t}(os||{});let l7=(()=>{class t{dialogRef;data;http;datepipe;dialog;orgAutoComplete;setting={element:{dynamicDownload:null}};organizationDict={};organizations=new Array;organizationSelected=!1;dialogUpdateCommandType=os.UNKNOWN_COMMAND;currentOrganizationLabel="Unassigned";organization_name="";subscriptionStartDate=new Date;subscriptionEndDate=new Date;endSubscriptionConfirm=!1;endSubscriptionCellPlanEndedConfirm=!1;lockOrganizationSelect=!1;subscriptionDays=365;subscriptionMonths=0;subscriptionDaysLeft=365;deleteDeviceConfirm1=!1;deleteDeviceConfirm2=!1;deleteDeviceConfirm3=!1;sendNotificationConfirm=!1;subscriptionCheckDayBuffer=30;orgSelectFormControl=new po;filteredOrganizations;po_number="";constructor(e,n,o,r,u){this.dialogRef=e,this.data=n,this.http=o,this.datepipe=r,this.dialog=u,"assign"==n.update_command?this.dialogUpdateCommandType=os.ASSIGN_DEVICES:"subscribe"==n.update_command?this.dialogUpdateCommandType=os.SUBSCRIBE_DEVICES:"unsubscribe"==n.update_command?this.dialogUpdateCommandType=os.UNSUBSCRIBE_DEVICES:"delete"==n.update_command?this.dialogUpdateCommandType=os.DELETE_DEVICES:"expire_notify"==n.update_command?this.dialogUpdateCommandType=os.SEND_EXPIRING_NOTIFICATION:this.onCloseDialog(),this.organization_name=n.org_name,"none"==n.org_name.toLowerCase()?(this.organization_name="-1",this.currentOrganizationLabel="Unassigned",this.lockOrganizationSelect=!1):(this.lockOrganizationSelect=n.org_lock,this.currentOrganizationLabel=n.org_friendly_name+" ("+n.org_name+")"),null!=n.sub_start&&"null"!=n.sub_start&&null!=n.sub_end&&"null"!=n.sub_end?(this.subscriptionStartDate=new Date(n.sub_start+"Z"),this.subscriptionEndDate=new Date(n.sub_end+"Z")):(this.subscriptionStartDate=new Date,this.subscriptionEndDate.setDate(this.subscriptionStartDate.getDate()+364)),this.updateSubscriptionDetailsByDate()}isAssigning(){return this.dialogUpdateCommandType==os.ASSIGN_DEVICES}isSubscribing(){return this.dialogUpdateCommandType==os.SUBSCRIBE_DEVICES}isUnSubscribing(){return this.dialogUpdateCommandType==os.UNSUBSCRIBE_DEVICES}isDeleting(){return this.dialogUpdateCommandType==os.DELETE_DEVICES}isNotifying(){return this.dialogUpdateCommandType==os.SEND_EXPIRING_NOTIFICATION}updateSubscriptionDetailsByMonth(){let e=new nw;e.start=this.subscriptionStartDate,e.end=this.subscriptionEndDate;let n=new QM;n.subscription=e,n.change_type=h0.MONTH_COUNT_CHANGE,n.change_amount=this.subscriptionMonths;let r=(new JM).updateSubscriptionDetails(n);this.subscriptionStartDate=r.start,this.subscriptionEndDate=r.end,this.subscriptionDays=r.getSubscriptionLengthInDays(),this.subscriptionDaysLeft=r.getDaysRemaining()}updateSubscriptionDetailsByDate(){let e=new nw;e.start=this.subscriptionStartDate,e.end=this.subscriptionEndDate;let n=new QM;n.subscription=e,n.change_type=h0.DATE_CHANGE;let r=(new JM).updateSubscriptionDetails(n);this.subscriptionStartDate=r.start,this.subscriptionEndDate=r.end,this.subscriptionDays=r.getSubscriptionLengthInDays(),this.subscriptionMonths=r.getSubscriptionLengthInMonths(),this.subscriptionDaysLeft=r.getDaysRemaining()}ngOnInit(){(this.dialogUpdateCommandType==os.ASSIGN_DEVICES||this.dialogUpdateCommandType==os.SEND_EXPIRING_NOTIFICATION)&&this.http.get(jfe,{withCredentials:!0}).subscribe(e=>{let n=new df;if(n.id=-1,n.name="-1",n.friendly_name="NONE",this.organizations.push(n),this.organizations=this.organizations.concat(e),this.organizations.forEach(o=>{this.organizationDict[o.name]=o}),this.filteredOrganizations=this.orgSelectFormControl.valueChanges.pipe(ua(""),kt(o=>this._filterOrgs(o||""))),this.lockOrganizationSelect){let o=this.orgAutoCompleteDisplay(this.organization_name);this.orgSelectFormControl.setValue(o),this.organizationSelected=!0,this.orgSelectFormControl.markAsDirty()}})}_filterOrgs(e){const n=e.toLowerCase();let o=[];return this.organizations.forEach(r=>{(r.name.toLowerCase().includes(n)||r.friendly_name.toLowerCase().includes(n))&&o.push(r)}),o}orgAutoCompleteDisplay(e){let n="";if(e){if("-1"==e)n=this.dialogUpdateCommandType==os.ASSIGN_DEVICES?"NONE":"ALL",this.organization_name="-1";else{let o=this.organizationDict[e];n=o.friendly_name+" ("+o.name+")",this.organization_name=o.name}this.organizationSelected=!0}return n}orgDisplayMatchesSelection(){return this.lockOrganizationSelect?""!=this.organization_name.trim()&&"-1"!=this.organization_name:!!this.organizationSelected&&this.orgSelectFormControl.value==this.organization_name}canSelectPurchaseOrder(){let n=!0;return n=["","none","-1"].includes("-1"==this.organization_name?this.data.org_name.trim().toLowerCase():this.organization_name.trim().toLowerCase()),!n&&this.orgDisplayMatchesSelection()}selectPurchaseOrder(){let e=new Zx;e.navigated_org=this.organization_name,"-1"==this.organization_name&&(e.navigated_org=this.data.org_name),e.config_type=cf.PO_CONFIG_SELECT;let n=new ha;n.minWidth=400,n.data=e,this.dialog.open(Yx,n).afterClosed().subscribe(u=>{null!=u&&(this.po_number=u)})}canSubmit(){let e=""==this.po_number;if(this.dialogUpdateCommandType==os.ASSIGN_DEVICES&&(""==this.organization_name.trim()||!this.orgDisplayMatchesSelection()||e))return!1;if(this.dialogUpdateCommandType==os.SUBSCRIBE_DEVICES){if(this.subscriptionStartDate.setHours(0,0,0,0),this.subscriptionEndDate.setHours(0,0,0,0),e||this.subscriptionEndDate<=this.subscriptionStartDate)return!1}else{if(this.dialogUpdateCommandType==os.UNSUBSCRIBE_DEVICES&&(!this.endSubscriptionConfirm||!this.endSubscriptionCellPlanEndedConfirm||e))return!1;if(!(this.dialogUpdateCommandType!=os.DELETE_DEVICES||this.deleteDeviceConfirm1&&this.deleteDeviceConfirm2&&this.deleteDeviceConfirm3))return!1;if(!(this.dialogUpdateCommandType!=os.SEND_EXPIRING_NOTIFICATION||this.sendNotificationConfirm&&this.orgDisplayMatchesSelection()))return!1}return!0}sendNotify(){let e=this.subscriptionCheckDayBuffer;e<0&&(e=30);let n=li_backendURL+"/expiring_subs",o={topic:"all"};o.day_buffer=e,"-1"!=this.organization_name&&(o.target_org=this.organization_name),this.http.post(n,o,{withCredentials:!0}).subscribe(r=>{this.onCloseDialog()})}getUTCDate(e){let n=e.toUTCString();return new Date(n)}onSubmit(){let e={org_name:this.organization_name,serial_list:this.data.device_list,update_command:this.data.update_command};if(this.dialogUpdateCommandType==os.ASSIGN_DEVICES&&(e.purchase_order=this.po_number,"-1"==this.organization_name&&(e.org_name=this.data.org_name,e.unassign=!0)),this.dialogUpdateCommandType==os.SUBSCRIBE_DEVICES){let o=this.subscriptionStartDate,r=this.subscriptionEndDate;this.subscriptionStartDate=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0),this.subscriptionEndDate=new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0),e.start=this.getUTCDate(this.subscriptionStartDate).toISOString(),e.expire=this.getUTCDate(this.subscriptionEndDate).toISOString(),e.purchase_order=this.po_number}this.dialogUpdateCommandType==os.UNSUBSCRIBE_DEVICES&&(e.purchase_order=this.po_number),this.dialogUpdateCommandType!=os.SEND_EXPIRING_NOTIFICATION?this.http.post(Hfe,e,{withCredentials:!0}).subscribe(o=>{if(1==o.result){if(this.dialogUpdateCommandType==os.SUBSCRIBE_DEVICES&&1==o.extra_info){let r="The organization has an existing license set that does not currently support the promotion for this subscription, the license will need to be manually updated.",u=new rf;u.msg=r,u.html=!0,u.yes_no=!1,u.title="Notice";const y=new ha;y.autoFocus=!1,y.data=u,this.dialog.open(af,y)}this.onCloseDialog()}}):this.sendNotify()}onCloseDialog(){this.dialogRef.close(!1)}onGetCSVData(){let e=this.data.device_list.split(","),n=this.data.imei_list.split(","),o=this.data.iccid_list.split(","),r="Serial Number,IMEI,ICCID\n";for(let u=0;u{class t{changes=new Ee;firstPageLabel="First page";itemsPerPageLabel="Items per page:";lastPageLabel="Last page";nextPageLabel="Next page";previousPageLabel="Previous page";getRangeLabel(e,n,o){return 0===o?"Page 1 of 1":`Page ${e+1} of ${Math.ceil(o/n)}`}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac})}return t})();class eA{action;subject;changes;who;when}class $fe{id;audit_id_prefix;audit_id;changes=new Array}class Gfe{serial;audit_id_prefix;audit_id;changes=new Array}class qfe{parent;type;audit_id_prefix;audit_id;changes=new Array}class Wfe{license_changes=new Array;device_changes=new Array;subscription_changes=new Array;modification_changes=new Array;parse_details(i){let e=JSON.parse(i);e.license.forEach(y=>{let I=new $fe;I.id=y.id,I.audit_id_prefix=y.audit_id_prefix,I.audit_id=y.audit_id,y.changes.forEach(q=>{let ee=new eA;ee.action=q.action,ee.subject=q.subject,ee.changes=q.changes,ee.who=q.who,ee.when=q.when,I.changes.push(ee)}),this.license_changes.push(I)}),e.device.forEach(y=>{let I=new Gfe;I.serial=y.serial,I.audit_id_prefix=y.audit_id_prefix,I.audit_id=y.audit_id,y.changes.forEach(q=>{let ee=new eA;ee.action=q.action,ee.subject=q.subject,ee.changes=q.changes,ee.who=q.who,ee.when=q.when,I.changes.push(ee)}),this.device_changes.push(I)}),e.subscription.forEach(y=>{let I=new qfe;I.parent=y.parent,I.type=y.type,I.audit_id_prefix=y.audit_id_prefix,I.audit_id=y.audit_id,y.changes.forEach(q=>{let ee=new eA;ee.action=q.action,ee.subject=q.subject,ee.changes=q.changes,ee.who=q.who,ee.when=q.when,I.changes.push(ee)}),this.subscription_changes.push(I)}),e.modifications.forEach(y=>{let I=new eA;I.action=y.action,I.subject=y.subject,I.changes=y.changes,I.who=y.who,I.when=y.when,this.modification_changes.push(I)})}}function Zfe(t,i){1&t&&Re(0,"div",2)}const Yfe=new yt("MAT_PROGRESS_BAR_DEFAULT_OPTIONS");let m0=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);_changeDetectorRef=Y(So);_renderer=Y(Hr);_cleanupTransitionEnd;_animationMode=Y(Kr,{optional:!0});constructor(){const e=Y(Yfe,{optional:!0});this._isNoopAnimation="NoopAnimations"===this._animationMode,e&&(e.color&&(this.color=this._defaultColor=e.color),this.mode=e.mode||this.mode)}_isNoopAnimation=!1;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";get value(){return this._value}set value(e){this._value=c7(e||0),this._changeDetectorRef.markForCheck()}_value=0;get bufferValue(){return this._bufferValue||0}set bufferValue(e){this._bufferValue=c7(e||0),this._changeDetectorRef.markForCheck()}_bufferValue=0;animationEnd=new Tt;get mode(){return this._mode}set mode(e){this._mode=e,this._changeDetectorRef.markForCheck()}_mode="determinate";ngAfterViewInit(){this._ngZone.runOutsideAngular(()=>{this._cleanupTransitionEnd=this._renderer.listen(this._elementRef.nativeElement,"transitionend",this._transitionendHandler)})}ngOnDestroy(){this._cleanupTransitionEnd?.()}_getPrimaryBarTransform(){return`scaleX(${this._isIndeterminate()?1:this.value/100})`}_getBufferBarFlexBasis(){return`${"buffer"===this.mode?this.bufferValue:100}%`}_isIndeterminate(){return"indeterminate"===this.mode||"query"===this.mode}_transitionendHandler=e=>{0===this.animationEnd.observers.length||!e.target||!e.target.classList.contains("mdc-linear-progress__primary-bar")||("determinate"===this.mode||"buffer"===this.mode)&&this._ngZone.run(()=>this.animationEnd.next({value:this.value}))};static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-progress-bar"]],hostAttrs:["role","progressbar","aria-valuemin","0","aria-valuemax","100","tabindex","-1",1,"mat-mdc-progress-bar","mdc-linear-progress"],hostVars:10,hostBindings:function(n,o){2&n&&(zn("aria-valuenow",o._isIndeterminate()?null:o.value)("mode",o.mode),bs("mat-"+o.color),Hn("_mat-animation-noopable",o._isNoopAnimation)("mdc-linear-progress--animation-ready",!o._isNoopAnimation)("mdc-linear-progress--indeterminate",o._isIndeterminate()))},inputs:{color:"color",value:[2,"value","value",Ql],bufferValue:[2,"bufferValue","bufferValue",Ql],mode:"mode"},outputs:{animationEnd:"animationEnd"},exportAs:["matProgressBar"],decls:7,vars:5,consts:[["aria-hidden","true",1,"mdc-linear-progress__buffer"],[1,"mdc-linear-progress__buffer-bar"],[1,"mdc-linear-progress__buffer-dots"],["aria-hidden","true",1,"mdc-linear-progress__bar","mdc-linear-progress__primary-bar"],[1,"mdc-linear-progress__bar-inner"],["aria-hidden","true",1,"mdc-linear-progress__bar","mdc-linear-progress__secondary-bar"]],template:function(n,o){1&n&&(w(0,"div",0),Re(1,"div",1),te(2,Zfe,1,0,"div",2),x(),w(3,"div",3),Re(4,"span",4),x(),w(5,"div",5),Re(6,"span",4),x()),2&n&&(E(),Jc("flex-basis",o._getBufferBarFlexBasis()),E(),Xi("buffer"===o.mode?2:-1),E(),Jc("transform",o._getPrimaryBarTransform()))},styles:[".mat-mdc-progress-bar{display:block;text-align:start}.mat-mdc-progress-bar[mode=query]{transform:scaleX(-1)}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-dots,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__secondary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__bar-inner.mdc-linear-progress__bar-inner{animation:none}.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__primary-bar,.mat-mdc-progress-bar._mat-animation-noopable .mdc-linear-progress__buffer-bar{transition:transform 1ms}.mdc-linear-progress{position:relative;width:100%;transform:translateZ(0);outline:1px solid rgba(0,0,0,0);overflow-x:hidden;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);height:max(var(--mdc-linear-progress-track-height, 4px),var(--mdc-linear-progress-active-indicator-height, 4px))}@media(forced-colors: active){.mdc-linear-progress{outline-color:CanvasText}}.mdc-linear-progress__bar{position:absolute;top:0;bottom:0;margin:auto 0;width:100%;animation:none;transform-origin:top left;transition:transform 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);height:var(--mdc-linear-progress-active-indicator-height, 4px)}.mdc-linear-progress--indeterminate .mdc-linear-progress__bar{transition:none}[dir=rtl] .mdc-linear-progress__bar{right:0;transform-origin:center right}.mdc-linear-progress__bar-inner{display:inline-block;position:absolute;width:100%;animation:none;border-top-style:solid;border-color:var(--mdc-linear-progress-active-indicator-color, var(--mat-sys-primary));border-top-width:var(--mdc-linear-progress-active-indicator-height, 4px)}.mdc-linear-progress__buffer{display:flex;position:absolute;top:0;bottom:0;margin:auto 0;width:100%;overflow:hidden;height:var(--mdc-linear-progress-track-height, 4px);border-radius:var(--mdc-linear-progress-track-shape, var(--mat-sys-corner-none))}.mdc-linear-progress__buffer-dots{-webkit-mask-image:url(\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' enable-background='new 0 0 5 2' xml:space='preserve' viewBox='0 0 5 2' preserveAspectRatio='xMinYMin slice'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/svg%3E\");background-repeat:repeat-x;flex:auto;transform:rotate(180deg);animation:mdc-linear-progress-buffering 250ms infinite linear;background-color:var(--mdc-linear-progress-track-color, var(--mat-sys-surface-variant))}@media(forced-colors: active){.mdc-linear-progress__buffer-dots{background-color:ButtonBorder}}[dir=rtl] .mdc-linear-progress__buffer-dots{animation:mdc-linear-progress-buffering-reverse 250ms infinite linear;transform:rotate(0)}.mdc-linear-progress__buffer-bar{flex:0 1 100%;transition:flex-basis 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1);background-color:var(--mdc-linear-progress-track-color, var(--mat-sys-surface-variant))}.mdc-linear-progress__primary-bar{transform:scaleX(0)}.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{left:-145.166611%}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation:mdc-linear-progress-primary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-primary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--animation-ready .mdc-linear-progress__primary-bar{animation-name:mdc-linear-progress-primary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--indeterminate .mdc-linear-progress__primary-bar{right:-145.166611%;left:auto}.mdc-linear-progress__secondary-bar{display:none}.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{left:-54.888891%;display:block}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation:mdc-linear-progress-secondary-indeterminate-translate 2s infinite linear}.mdc-linear-progress--indeterminate.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar>.mdc-linear-progress__bar-inner{animation:mdc-linear-progress-secondary-indeterminate-scale 2s infinite linear}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--animation-ready .mdc-linear-progress__secondary-bar{animation-name:mdc-linear-progress-secondary-indeterminate-translate-reverse}[dir=rtl] .mdc-linear-progress.mdc-linear-progress--indeterminate .mdc-linear-progress__secondary-bar{right:-54.888891%;left:auto}@keyframes mdc-linear-progress-buffering{from{transform:rotate(180deg) translateX(calc(var(--mdc-linear-progress-track-height, 4px) * -2.5))}}@keyframes mdc-linear-progress-primary-indeterminate-translate{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(83.67142%)}100%{transform:translateX(200.611057%)}}@keyframes mdc-linear-progress-primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(84.386165%)}100%{transform:translateX(160.277782%)}}@keyframes mdc-linear-progress-secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes mdc-linear-progress-primary-indeterminate-translate-reverse{0%{transform:translateX(0)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(-83.67142%)}100%{transform:translateX(-200.611057%)}}@keyframes mdc-linear-progress-secondary-indeterminate-translate-reverse{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(-37.651913%)}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(-84.386165%)}100%{transform:translateX(-160.277782%)}}@keyframes mdc-linear-progress-buffering-reverse{from{transform:translateX(-10px)}}\n"],encapsulation:2,changeDetection:0})}return t})();function c7(t,i=0,e=100){return Math.max(i,Math.min(e,t))}let Kfe=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki]})}return t})();function Qfe(t,i){1&t&&(w(0,"span"),M(1,"(Editing)"),x())}function Jfe(t,i){1&t&&(w(0,"mat-chip",13)(1,"span",4),M(2,"Open"),x()())}function e_e(t,i){1&t&&(w(0,"mat-chip",14)(1,"span",4),M(2,"Closed"),x()())}function t_e(t,i){1&t&&(w(0,"p",1),M(1,"If changes are assigned to the wrong PO, they can be moved to the correct one here. Select the changes to be moved:"),x())}function n_e(t,i){1&t&&Re(0,"mat-divider")}function i_e(t,i){if(1&t){const e=pt();w(0,"div",15)(1,"div",16)(2,"mat-form-field")(3,"mat-label"),M(4,"Move from PO Number"),x(),w(5,"input",17),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.po_number,o)||(r.po_number=o),ge(o)}),x()()(),w(6,"div",18)(7,"mat-form-field")(8,"mat-label"),M(9,"Move to PO Number"),x(),w(10,"input",19),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.po_number_move_to,o)||(r.po_number_move_to=o),ge(o)}),x(),w(11,"button",20),we("click",function(){return fe(e),ge(X().selectPurchaseOrderToMoveTo())}),w(12,"mat-icon"),M(13,"add"),x()()()()()}if(2&t){const e=X();E(5),Kn("ngModel",e.po_number),E(5),Kn("ngModel",e.po_number_move_to)}}function o_e(t,i){1&t&&Re(0,"mat-divider")}function r_e(t,i){1&t&&(w(0,"div")(1,"div",21)(2,"span",22),M(3," Loading details... "),x(),Re(4,"mat-progress-bar",23),x()())}function a_e(t,i){1&t&&(w(0,"div",24)(1,"h5",25),M(2,"There are no changes available for this purchase order."),x()())}function s_e(t,i){1&t&&(w(0,"div",24)(1,"h5",25),M(2,"There are no moveable changes available for this purchase order."),x()())}function l_e(t,i){if(1&t){const e=pt();w(0,"mat-checkbox",43),we("change",function(o){fe(e);const r=X().$implicit;return ge(X(2).onCheckChange(o,r))})("click",function(o){return fe(e),ge(X(3).onClickChange(o))}),M(1,"License Set Changes"),x()}}function c_e(t,i){1&t&&(w(0,"span"),M(1,"License Set Changes"),x())}function d_e(t,i){if(1&t&&(w(0,"mat-panel-description",44),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Jt(" ",n.getChangeID(e)," ")}}function u_e(t,i){1&t&&(w(0,"th",45),M(1,"Changes"),x())}function h_e(t,i){if(1&t&&(w(0,"td",46),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.changes)}}function p_e(t,i){1&t&&(w(0,"th",45),M(1,"Subject"),x())}function m_e(t,i){if(1&t&&(w(0,"td",47)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.subject)}}function f_e(t,i){1&t&&(w(0,"th",45),M(1,"Performed By"),x())}function __e(t,i){if(1&t&&(w(0,"td",49)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.who)}}function g_e(t,i){1&t&&(w(0,"th",45),M(1,"Date"),x())}function b_e(t,i){if(1&t&&(w(0,"td",50)(1,"p",51),M(2),ti(3,"date"),x()()),2&t){const e=i.$implicit;E(2),Ct(hi(3,1,e.when+"Z","short"))}}function y_e(t,i){1&t&&Re(0,"tr",52)}function v_e(t,i){1&t&&Re(0,"tr",53)}function x_e(t,i){if(1&t&&(w(0,"span")(1,"mat-expansion-panel",24)(2,"mat-expansion-panel-header",27)(3,"mat-panel-title"),te(4,l_e,2,0,"mat-checkbox",28)(5,c_e,2,0,"span",2),x(),te(6,d_e,2,1,"mat-panel-description",29),x(),w(7,"div",30)(8,"table",31),at(9,32),te(10,u_e,2,0,"th",33)(11,h_e,2,1,"td",34),st(),at(12,35),te(13,p_e,2,0,"th",33)(14,m_e,3,1,"td",36),st(),at(15,37),te(16,f_e,2,0,"th",33)(17,__e,3,1,"td",38),st(),at(18,39),te(19,g_e,2,0,"th",33)(20,b_e,4,4,"td",40),st(),te(21,y_e,1,0,"tr",41)(22,v_e,1,0,"tr",42),x()()()()),2&t){const e=i.$implicit,n=X(2);E(4),N("ngIf",n.inEditMode()),E(),N("ngIf",!n.inEditMode()),E(),N("ngIf",n.hasModifications()||n.inEditMode()),E(2),N("dataSource",e.changes),E(13),N("matHeaderRowDef",n.audit_change_columns),E(),N("matRowDefColumns",n.audit_change_columns)}}function w_e(t,i){if(1&t&&(w(0,"div",24),te(1,x_e,23,6,"span",26),x()),2&t){const e=X();E(),N("ngForOf",e.po_changes.license_changes)}}function C_e(t,i){if(1&t){const e=pt();w(0,"mat-checkbox",43),we("change",function(o){fe(e);const r=X().$implicit;return ge(X(2).onCheckChange(o,r))})("click",function(o){return fe(e),ge(X(3).onClickChange(o))}),M(1),x()}if(2&t){const e=X().$implicit;E(),Jt("Device Changes (",e.serial,")")}}function S_e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Jt("Device Changes (",e.serial,")")}}function T_e(t,i){if(1&t&&(w(0,"mat-panel-description",44),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Jt(" ",n.getChangeID(e)," ")}}function D_e(t,i){1&t&&(w(0,"th",45),M(1,"Changes"),x())}function I_e(t,i){if(1&t&&(w(0,"td",46),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.changes)}}function E_e(t,i){1&t&&(w(0,"th",45),M(1,"Subject"),x())}function M_e(t,i){if(1&t&&(w(0,"td",47)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.subject)}}function A_e(t,i){1&t&&(w(0,"th",45),M(1,"Performed By"),x())}function k_e(t,i){if(1&t&&(w(0,"td",49)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.who)}}function R_e(t,i){1&t&&(w(0,"th",45),M(1,"Date"),x())}function O_e(t,i){if(1&t&&(w(0,"td",50)(1,"p",51),M(2),ti(3,"date"),x()()),2&t){const e=i.$implicit;E(2),Ct(hi(3,1,e.when+"Z","short"))}}function P_e(t,i){1&t&&Re(0,"tr",52)}function L_e(t,i){1&t&&Re(0,"tr",53)}function F_e(t,i){if(1&t&&(w(0,"mat-accordion",24)(1,"mat-expansion-panel",24)(2,"mat-expansion-panel-header",27)(3,"mat-panel-title"),te(4,C_e,2,1,"mat-checkbox",28)(5,S_e,2,1,"span",2),x(),te(6,T_e,2,1,"mat-panel-description",29),x(),w(7,"div",30)(8,"table",31),at(9,32),te(10,D_e,2,0,"th",33)(11,I_e,2,1,"td",34),st(),at(12,35),te(13,E_e,2,0,"th",33)(14,M_e,3,1,"td",36),st(),at(15,37),te(16,A_e,2,0,"th",33)(17,k_e,3,1,"td",38),st(),at(18,39),te(19,R_e,2,0,"th",33)(20,O_e,4,4,"td",40),st(),te(21,P_e,1,0,"tr",41)(22,L_e,1,0,"tr",42),x()()()()),2&t){const e=i.$implicit,n=X(2);E(4),N("ngIf",n.inEditMode()),E(),N("ngIf",!n.inEditMode()),E(),N("ngIf",n.hasModifications()||n.inEditMode()),E(2),N("dataSource",e.changes),E(13),N("matHeaderRowDef",n.audit_change_columns),E(),N("matRowDefColumns",n.audit_change_columns)}}function N_e(t,i){if(1&t&&(w(0,"div",24),te(1,F_e,23,6,"mat-accordion",54),x()),2&t){const e=X();E(),N("ngForOf",e.po_changes.device_changes)}}function z_e(t,i){if(1&t){const e=pt();w(0,"mat-checkbox",43),we("change",function(o){fe(e);const r=X().$implicit;return ge(X(2).onCheckChange(o,r))})("click",function(o){return fe(e),ge(X(3).onClickChange(o))}),M(1),x()}if(2&t){const e=X().$implicit;E(),Jt("Subscription Changes (",e.type,")")}}function B_e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Jt("Subscription Changes (",e.type,")")}}function V_e(t,i){if(1&t&&(w(0,"mat-panel-description",44),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Jt(" ",n.getChangeID(e)," ")}}function U_e(t,i){1&t&&(w(0,"th",45),M(1,"Changes"),x())}function H_e(t,i){if(1&t&&(w(0,"td",46),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.changes)}}function j_e(t,i){1&t&&(w(0,"th",45),M(1,"Subject"),x())}function $_e(t,i){if(1&t&&(w(0,"td",47)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.subject)}}function G_e(t,i){1&t&&(w(0,"th",45),M(1,"Performed By"),x())}function q_e(t,i){if(1&t&&(w(0,"td",49)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.who)}}function W_e(t,i){1&t&&(w(0,"th",45),M(1,"Date"),x())}function Z_e(t,i){if(1&t&&(w(0,"td",50)(1,"p",51),M(2),ti(3,"date"),x()()),2&t){const e=i.$implicit;E(2),Ct(hi(3,1,e.when+"Z","short"))}}function Y_e(t,i){1&t&&Re(0,"tr",52)}function X_e(t,i){1&t&&Re(0,"tr",53)}function K_e(t,i){if(1&t&&(w(0,"mat-accordion",24)(1,"mat-expansion-panel",24)(2,"mat-expansion-panel-header",27)(3,"mat-panel-title"),te(4,z_e,2,1,"mat-checkbox",28)(5,B_e,2,1,"span",2),x(),te(6,V_e,2,1,"mat-panel-description",29),x(),w(7,"div",30)(8,"table",31),at(9,32),te(10,U_e,2,0,"th",33)(11,H_e,2,1,"td",34),st(),at(12,35),te(13,j_e,2,0,"th",33)(14,$_e,3,1,"td",36),st(),at(15,37),te(16,G_e,2,0,"th",33)(17,q_e,3,1,"td",38),st(),at(18,39),te(19,W_e,2,0,"th",33)(20,Z_e,4,4,"td",40),st(),te(21,Y_e,1,0,"tr",41)(22,X_e,1,0,"tr",42),x()()()()),2&t){const e=i.$implicit,n=X(2);E(4),N("ngIf",n.inEditMode()),E(),N("ngIf",!n.inEditMode()),E(),N("ngIf",n.hasModifications()||n.inEditMode()),E(2),N("dataSource",e.changes),E(13),N("matHeaderRowDef",n.audit_change_columns),E(),N("matRowDefColumns",n.audit_change_columns)}}function Q_e(t,i){if(1&t&&(w(0,"div",24),te(1,K_e,23,6,"mat-accordion",54),x()),2&t){const e=X();E(),N("ngForOf",e.po_changes.subscription_changes)}}function J_e(t,i){1&t&&(w(0,"th",45),M(1,"Changes"),x())}function ege(t,i){if(1&t&&(w(0,"td",46),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.changes)}}function tge(t,i){1&t&&(w(0,"th",45),M(1,"Subject"),x())}function nge(t,i){if(1&t&&(w(0,"td",47)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.subject)}}function ige(t,i){1&t&&(w(0,"th",45),M(1,"Performed By"),x())}function oge(t,i){if(1&t&&(w(0,"td",49)(1,"p",48),M(2),x()()),2&t){const e=i.$implicit;E(2),Ct(e.who)}}function rge(t,i){1&t&&(w(0,"th",45),M(1,"Date"),x())}function age(t,i){if(1&t&&(w(0,"td",50)(1,"p",51),M(2),ti(3,"date"),x()()),2&t){const e=i.$implicit;E(2),Ct(hi(3,1,e.when+"Z","short"))}}function sge(t,i){1&t&&Re(0,"tr",52)}function lge(t,i){1&t&&Re(0,"tr",53)}function cge(t,i){if(1&t&&(w(0,"div",24)(1,"mat-accordion",24)(2,"mat-expansion-panel",55)(3,"mat-expansion-panel-header",56)(4,"mat-panel-title"),M(5," Purchase Order Modifications "),x()(),w(6,"div",30)(7,"table",57),at(8,32),te(9,J_e,2,0,"th",33)(10,ege,2,1,"td",34),st(),at(11,35),te(12,tge,2,0,"th",33)(13,nge,3,1,"td",36),st(),at(14,37),te(15,ige,2,0,"th",33)(16,oge,3,1,"td",38),st(),at(17,39),te(18,rge,2,0,"th",33)(19,age,4,4,"td",40),st(),te(20,sge,1,0,"tr",41)(21,lge,1,0,"tr",42),x()()()()()),2&t){const e=X();E(7),N("dataSource",e.po_changes.modification_changes),E(13),N("matHeaderRowDef",e.audit_change_columns),E(),N("matRowDefColumns",e.audit_change_columns)}}function dge(t,i){if(1&t){const e=pt();w(0,"button",58),we("click",function(){return fe(e),ge(X().onMoveChanges())}),M(1,"Move"),x()}2&t&&N("disabled",!X().canMoveChanges())}var WT=function(t){return t[t.PO_DETAIL_VIEW=1]="PO_DETAIL_VIEW",t[t.PO_DETAIL_EDIT=2]="PO_DETAIL_EDIT",t}(WT||{});class ZT{po_id;po_number="";org_name="";mode=WT.PO_DETAIL_VIEW}let YT=(()=>{class t{loginService;dialogRef;data;http;dialog;userInfo;po_id;po_open=!1;po_number="";po_number_move_to="";org_name="";mode=WT.PO_DETAIL_VIEW;po_changes=new Wfe;details_loaded=!0;audit_change_columns=["changes","subject","who","when"];audit_moves=new Array;constructor(e,n,o,r,u){this.loginService=e,this.dialogRef=n,this.data=o,this.http=r,this.dialog=u,this.po_id=o.po_id,this.po_number=o.po_number,this.org_name=o.org_name,this.mode=o.mode}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.getPurchaseOrderDetails()}inEditMode(){return this.mode==WT.PO_DETAIL_EDIT}getPurchaseOrderDetails(){this.userInfo&&this.userInfo.isMasterDBUser()?(this.details_loaded=!1,this.http.get(li_backendURL+"/purchase_order/"+this.po_id,{withCredentials:!0}).subscribe(n=>{this.po_open=n.open,this.po_number=n.po,this.po_changes.parse_details(n.details),this.details_loaded=!0})):this.details_loaded=!0}hasNoChanges(){return this.details_loaded&&0==this.po_changes.license_changes.length&&0==this.po_changes.device_changes.length&&0==this.po_changes.subscription_changes.length&&0==this.po_changes.modification_changes.length}hasNoMoveableChanges(){return this.details_loaded&&0==this.po_changes.license_changes.length&&0==this.po_changes.device_changes.length&&0==this.po_changes.subscription_changes.length}hasLicenseChanges(){return this.po_changes.license_changes.length>0}hasDeviceChanges(){return this.po_changes.device_changes.length>0}hasOrphanSubscriptionChanges(){return this.po_changes.subscription_changes.length>0}hasModifications(){return this.po_changes.modification_changes.length>0}onCheckChange(e,n){let o=e.checked,r=this.getChangeID(n),u=this.audit_moves.includes(r);if(o&&!u)this.audit_moves.push(r);else if(!o&&u){let y=this.audit_moves.indexOf(r);-1!=y&&this.audit_moves.splice(y,1)}}onClickChange(e){e.stopPropagation()}getChangeID(e){return e.audit_id_prefix+e.audit_id.toString()}selectPurchaseOrderToMoveTo(){let e=new Zx;e.moving_from_po=this.po_number,e.navigated_org=this.org_name,e.config_type=cf.PO_CONFIG_SELECT;let n=new ha;n.minWidth=400,n.data=e,this.dialog.open(Yx,n).afterClosed().subscribe(u=>{null!=u&&(this.po_number_move_to=u)})}canMoveChanges(){return this.userInfo.isMasterAdmin()&&this.audit_moves.length>0&&this.po_number!=this.po_number_move_to&&""!=this.po_number_move_to}onMoveChanges(){if(!this.userInfo.isMasterAdmin())return;let e={};e.org_name=this.org_name,e.from_po=this.po_number,e.to_po=this.po_number_move_to,e.audits=this.audit_moves,this.http.post(li_backendURL+"/purchase_order_move",e,{withCredentials:!0}).subscribe(()=>{this.onClose()})}onClose(){this.dialogRef.close()}static \u0275fac=function(n){return new(n||t)($e(Po),$e(xs),$e(Ks),$e(Uo),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-po-detail"]],standalone:!1,decls:32,vars:17,consts:[["PODetailsForm","ngForm"],[1,"center-item"],[4,"ngIf"],[1,"primary-chip"],[1,"chip-text"],["class","open-chip",4,"ngIf"],["class","closed-chip",4,"ngIf"],["class","center-item",4,"ngIf"],["class","flex-container",4,"ngIf"],["class","change-item",4,"ngIf"],[1,"button-div","center-item"],["mat-raised-button","","color","primary","type","button","class","move-btn",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","primary","type","button",3,"click"],[1,"open-chip"],[1,"closed-chip"],[1,"flex-container"],[1,"left-item"],["name","po_number_from","matInput","","readonly","",3,"ngModelChange","ngModel"],[1,"right-item"],["required","","name","po_number_to","matInput","","readonly","",3,"ngModelChange","ngModel"],["mat-icon-button","","matSuffix","","aria-label","Select PO","type","button",3,"click"],[1,"progress-content"],[1,"progress-text"],["mode","indeterminate",1,"loading-progress"],[1,"change-item"],[1,"no-changes","center-item"],[4,"ngFor","ngForOf"],[1,"right-aligned-header"],[3,"change","click",4,"ngIf"],["class","change-id",4,"ngIf"],[1,"custom-table-responsive"],["mat-table","",2,"width","100%",3,"dataSource"],["matColumnDef","changes"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Changes",4,"matCellDef"],["matColumnDef","subject"],["mat-cell","","data-label","Subject",4,"matCellDef"],["matColumnDef","who"],["mat-cell","","data-label","Performed By",4,"matCellDef"],["matColumnDef","when"],["mat-cell","","data-label","Date",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["class","hover-row","mat-row","",4,"matRowDef","matRowDefColumns"],[3,"change","click"],[1,"change-id"],["mat-header-cell",""],["mat-cell","","data-label","Changes"],["mat-cell","","data-label","Subject"],[1,"block-text"],["mat-cell","","data-label","Performed By"],["mat-cell","","data-label","Date"],[1,"no-break"],["mat-header-row",""],["mat-row","",1,"hover-row"],["class","change-item",4,"ngFor","ngForOf"],[1,"change-item","po-change-bg"],[1,"po-change-bg"],["mat-table","",1,"po-change-bg",2,"width","100%",3,"dataSource"],["mat-raised-button","","color","primary","type","button",1,"move-btn",3,"click","disabled"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",null,0)(2,"mat-dialog-content")(3,"h3",1),M(4,"Purchase Order "),te(5,Qfe,2,0,"span",2),x(),w(6,"mat-chip-set")(7,"mat-chip",3)(8,"span",4),M(9),x()(),w(10,"mat-chip",3)(11,"span",4),M(12),x()(),te(13,Jfe,3,0,"mat-chip",5)(14,e_e,3,0,"mat-chip",6),x(),Re(15,"mat-divider"),te(16,t_e,2,0,"p",7)(17,n_e,1,0,"mat-divider",2)(18,i_e,14,2,"div",8)(19,o_e,1,0,"mat-divider",2)(20,r_e,5,0,"div",2)(21,a_e,3,0,"div",9)(22,s_e,3,0,"div",9)(23,w_e,2,1,"div",9)(24,N_e,2,1,"div",9)(25,Q_e,2,1,"div",9)(26,cge,22,3,"div",9),Re(27,"mat-divider"),w(28,"div",10),te(29,dge,2,1,"button",11),w(30,"button",12),we("click",function(){return fe(r),ge(o.onClose())}),M(31,"Close"),x()()()()}2&n&&(E(5),N("ngIf",o.inEditMode()),E(4),Jt("PO Number: ",o.po_number,""),E(3),Ct(o.org_name),E(),N("ngIf",o.po_open),E(),N("ngIf",!o.po_open),E(2),N("ngIf",o.inEditMode()),E(),N("ngIf",o.inEditMode()),E(),N("ngIf",o.inEditMode()),E(),N("ngIf",o.inEditMode()),E(),N("ngIf",!o.details_loaded&&!o.inEditMode()),E(),N("ngIf",o.hasNoChanges()),E(),N("ngIf",o.inEditMode()&&o.hasNoMoveableChanges()),E(),N("ngIf",o.hasLicenseChanges()),E(),N("ngIf",o.hasDeviceChanges()),E(),N("ngIf",o.hasOrphanSubscriptionChanges()),E(),N("ngIf",o.hasModifications()&&!o.inEditMode()),E(3),N("ngIf",o.inEditMode()))},dependencies:[kl,ir,ka,jr,wr,Aa,Jl,ts,Cr,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,ws,qa,Os,Pb,th,zl,Bl,od,yM,Tu,Sr,m0,k_,FM,Rl],styles:[".change-id[_ngcontent-%COMP%]{color:#3f51bf;font-weight:700}.change-select[_ngcontent-%COMP%]{margin-right:.5em;text-align:center;vertical-align:middle}.flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em}.left-item[_ngcontent-%COMP%], .right-item[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto}.move-btn[_ngcontent-%COMP%]{margin-right:1em}.po-change-bg[_ngcontent-%COMP%]{background-color:#fffade!important}.center-item[_ngcontent-%COMP%]{text-align:center}.no-changes[_ngcontent-%COMP%]{padding-top:2em;padding-bottom:2em}div.button-div[_ngcontent-%COMP%]{display:block;margin:auto;width:100%}mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}.full-width[_ngcontent-%COMP%]{width:100%}.bold[_ngcontent-%COMP%]{font-weight:700}.error-msg[_ngcontent-%COMP%]{color:red}.info-msg[_ngcontent-%COMP%]{color:purple}.chip-text[_ngcontent-%COMP%]{color:#fff!important}.primary-chip[_ngcontent-%COMP%]{background-color:#3f51bf!important}.open-chip[_ngcontent-%COMP%]{background-color:#05a985!important}.closed-chip[_ngcontent-%COMP%]{background-color:#eb5d63!important}.change-item[_ngcontent-%COMP%]{margin-bottom:.5em;padding-bottom:.5em}.block-text[_ngcontent-%COMP%]{word-wrap:break-word}.no-break[_ngcontent-%COMP%]{white-space:nowrap}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em} .mat-tab-header{position:sticky!important;top:0!important;width:100%!important;z-index:1000!important}@media screen and (min-width: 900px){ .mat-tab-label{font-size:small}}@media screen and (max-width: 900px){ .mat-tab-label{font-size:x-small}}"]})}return t})();class uge{element=null}class $i{onDynamicDownloadByHtmlTag(i,e){i.element||(i.element=document.createElement("a"));let o=new Blob([e.text],{type:"."+e.type+", "+e.type+"/text"});const r=i.element;r.setAttribute("href",window.URL.createObjectURL(o)),r.setAttribute("download",e.fileName+"."+e.type);var u=new MouseEvent("click");r.dispatchEvent(u)}static LoadLocalStorageSetting(i,e=""){let n=localStorage.getItem(i);return(null==n||""==n)&&(n=e),n}static SaveLocalStorageSetting(i,e){localStorage.setItem(i,e)}static IsDarkMode(){return"true"===this.LoadLocalStorageSetting("drbrDarkTheme","false")}static GetThemeClass(){let i="light-theme";return this.IsDarkMode()&&(i="dark-theme"),i}static GetUnusedThemeClass(){let i="dark-theme";return this.IsDarkMode()&&(i="light-theme"),i}}let hge=(()=>{class t{http;login;constructor(e,n){this.http=e,this.login=n}getOptionSets(e){return this.login.userInfo$.pipe(or(n=>n.isMasterDBUser()),$a(1),Xs(()=>this.http.get(this.login.getURL("option",e),{withCredentials:!0})))}getStandaloneStatus(e){return this.http.get(this.login.getURL("standalonelicense",e)+"/+status",{withCredentials:!0})}getStandaloneActive(e){return this.http.get(this.login.getURL("standalonelicense",e),{withCredentials:!0})}getOnDemandStatus(e){return this.http.get(this.login.getURL("ondemandlicense",e)+"/+status",{withCredentials:!0})}getOnDemandPrivate(e){return this.http.get(this.login.getURL("ondemandlicense",e)+"/+private_status",{withCredentials:!0})}getOnDemandActive(e){return this.http.get(this.login.getURL("ondemandlicense",e),{withCredentials:!0})}static \u0275fac=function(n){return new(n||t)(xn(Uo),xn(Po))};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const pge=["mat-sort-header",""],mge=["*"];function fge(t,i){1&t&&(w(0,"div",2),Va(),w(1,"svg",3),Re(2,"path",4),x()())}const d7=new yt("MAT_SORT_DEFAULT_OPTIONS");let Js=(()=>{class t{_defaultOptions;_initializedStream=new XP(1);sortables=new Map;_stateChanges=new Ee;active;start="asc";get direction(){return this._direction}set direction(e){this._direction=e}_direction="";disableClear;disabled=!1;sortChange=new Tt;initialized=this._initializedStream;constructor(e){this._defaultOptions=e}register(e){this.sortables.set(e.id,e)}deregister(e){this.sortables.delete(e.id)}sort(e){this.active!=e.id?(this.active=e.id,this.direction=e.start?e.start:this.start):this.direction=this.getNextSortDirection(e),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(e){if(!e)return"";let o=function _ge(t,i){let e=["asc","desc"];return"desc"==t&&e.reverse(),i||e.push(""),e}(e.start||this.start,e?.disableClear??this.disableClear??!!this._defaultOptions?.disableClear),r=o.indexOf(this.direction)+1;return r>=o.length&&(r=0),o[r]}ngOnInit(){this._initializedStream.next()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete(),this._initializedStream.complete()}static \u0275fac=function(n){return new(n||t)($e(d7,8))};static \u0275dir=Gt({type:t,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{active:[0,"matSortActive","active"],start:[0,"matSortStart","start"],direction:[0,"matSortDirection","direction"],disableClear:[2,"matSortDisableClear","disableClear",fn],disabled:[2,"matSortDisabled","disabled",fn]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[go]})}return t})(),tA=(()=>{class t{changes=new Ee;static \u0275fac=function(n){return new(n||t)};static \u0275prov=Nt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();const bge={provide:tA,deps:[[new oc,new _l,tA]],useFactory:function gge(t){return t||new tA}};let oh=(()=>{class t{_intl=Y(tA);_sort=Y(Js,{optional:!0});_columnDef=Y("MAT_SORT_HEADER_COLUMN_DEF",{optional:!0});_changeDetectorRef=Y(So);_focusMonitor=Y(eh);_elementRef=Y(Pn);_ariaDescriber=Y(SH,{optional:!0});_renderChanges;_animationModule=Y(Kr,{optional:!0});_recentlyCleared=Da(null);_sortButton;id;arrowPosition="after";start;disabled=!1;get sortActionDescription(){return this._sortActionDescription}set sortActionDescription(e){this._updateSortActionDescription(e)}_sortActionDescription="Sort";disableClear;constructor(){Y(Rs).load(wu);const e=Y(d7,{optional:!0});e?.arrowPosition&&(this.arrowPosition=e?.arrowPosition)}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._sort.register(this),this._renderChanges=va(this._sort._stateChanges,this._sort.sortChange).subscribe(()=>this._changeDetectorRef.markForCheck()),this._sortButton=this._elementRef.nativeElement.querySelector(".mat-sort-header-container"),this._updateSortActionDescription(this._sortActionDescription)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(()=>this._recentlyCleared.set(null))}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._renderChanges?.unsubscribe(),this._sortButton&&this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription)}_toggleOnInteraction(){if(!this._isDisabled()){const e=this._isSorted(),n=this._sort.direction;this._sort.sort(this),this._recentlyCleared.set(e&&!this._isSorted()?n:null)}}_handleKeydown(e){(32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&("asc"===this._sort.direction||"desc"===this._sort.direction)}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?"asc"==this._sort.direction?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}_updateSortActionDescription(e){this._sortButton&&(this._ariaDescriber?.removeDescription(this._sortButton,this._sortActionDescription),this._ariaDescriber?.describe(this._sortButton,e)),this._sortActionDescription=e}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(n,o){1&n&&we("click",function(){return o._toggleOnInteraction()})("keydown",function(u){return o._handleKeydown(u)})("mouseleave",function(){return o._recentlyCleared.set(null)}),2&n&&(zn("aria-sort",o._getAriaSortAttribute()),Hn("mat-sort-header-disabled",o._isDisabled()))},inputs:{id:[0,"mat-sort-header","id"],arrowPosition:"arrowPosition",start:"start",disabled:[2,"disabled","disabled",fn],sortActionDescription:"sortActionDescription",disableClear:[2,"disableClear","disableClear",fn]},exportAs:["matSortHeader"],attrs:pge,ngContentSelectors:mge,decls:4,vars:17,consts:[[1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],[1,"mat-sort-header-arrow"],["viewBox","0 -960 960 960","focusable","false","aria-hidden","true"],["d","M440-240v-368L296-464l-56-56 240-240 240 240-56 56-144-144v368h-80Z"]],template:function(n,o){1&n&&(ho(),w(0,"div",0)(1,"div",1),On(2),x(),te(3,fge,3,0,"div",2),x()),2&n&&(Hn("mat-sort-header-sorted",o._isSorted())("mat-sort-header-position-before","before"===o.arrowPosition)("mat-sort-header-descending","desc"===o._sort.direction)("mat-sort-header-ascending","asc"===o._sort.direction)("mat-sort-header-recently-cleared-ascending","asc"===o._recentlyCleared())("mat-sort-header-recently-cleared-descending","desc"===o._recentlyCleared())("mat-sort-header-animations-disabled","NoopAnimations"===o._animationModule),zn("tabindex",o._isDisabled()?null:0)("role",o._isDisabled()?null:"button"),E(3),Xi(o._renderArrow()?3:-1))},styles:[".mat-sort-header{cursor:pointer}.mat-sort-header-disabled{cursor:default}.mat-sort-header-container{display:flex;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-container::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-sort-header-content{display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}@keyframes _mat-sort-header-recently-cleared-ascending{from{transform:translateY(0);opacity:1}to{transform:translateY(-25%);opacity:0}}@keyframes _mat-sort-header-recently-cleared-descending{from{transform:translateY(0) rotate(180deg);opacity:1}to{transform:translateY(25%) rotate(180deg);opacity:0}}.mat-sort-header-arrow{height:12px;width:12px;position:relative;transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1),opacity 225ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0;overflow:visible;color:var(--mat-sort-arrow-color, var(--mat-sys-on-surface))}.mat-sort-header.cdk-keyboard-focused .mat-sort-header-arrow,.mat-sort-header.cdk-program-focused .mat-sort-header-arrow,.mat-sort-header:hover .mat-sort-header-arrow{opacity:.54}.mat-sort-header .mat-sort-header-sorted .mat-sort-header-arrow{opacity:1}.mat-sort-header-descending .mat-sort-header-arrow{transform:rotate(180deg)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transform:translateY(-25%)}.mat-sort-header-recently-cleared-ascending .mat-sort-header-arrow{transition:none;animation:_mat-sort-header-recently-cleared-ascending 225ms cubic-bezier(0.4, 0, 0.2, 1) forwards}.mat-sort-header-recently-cleared-descending .mat-sort-header-arrow{transition:none;animation:_mat-sort-header-recently-cleared-descending 225ms cubic-bezier(0.4, 0, 0.2, 1) forwards}.mat-sort-header-animations-disabled .mat-sort-header-arrow{transition-duration:0ms;animation-duration:0ms}.mat-sort-header-arrow svg{width:24px;height:24px;fill:currentColor;position:absolute;top:50%;left:50%;margin:-12px 0 0 -12px;transform:translateZ(0)}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}\n"],encapsulation:2,changeDetection:0})}return t})(),yge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[bge],imports:[Ki]})}return t})();const kL=["*"],RL='.mdc-list{margin:0;padding:8px 0;list-style-type:none}.mdc-list:focus{outline:none}.mdc-list-item{display:flex;position:relative;justify-content:flex-start;overflow:hidden;padding:0;align-items:stretch;cursor:pointer;padding-left:16px;padding-right:16px;background-color:var(--mdc-list-list-item-container-color, transparent);border-radius:var(--mdc-list-list-item-container-shape, var(--mat-sys-corner-none))}.mdc-list-item.mdc-list-item--selected{background-color:var(--mdc-list-list-item-selected-container-color)}.mdc-list-item:focus{outline:0}.mdc-list-item.mdc-list-item--disabled{cursor:auto}.mdc-list-item.mdc-list-item--with-one-line{height:var(--mdc-list-list-item-one-line-container-height, 48px)}.mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__end{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-two-lines{height:var(--mdc-list-list-item-two-line-container-height, 64px)}.mdc-list-item.mdc-list-item--with-two-lines .mdc-list-item__start{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--with-two-lines .mdc-list-item__end{align-self:center;margin-top:0}.mdc-list-item.mdc-list-item--with-three-lines{height:var(--mdc-list-list-item-three-line-container-height, 88px)}.mdc-list-item.mdc-list-item--with-three-lines .mdc-list-item__start{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--with-three-lines .mdc-list-item__end{align-self:flex-start;margin-top:16px}.mdc-list-item.mdc-list-item--selected::before,.mdc-list-item.mdc-list-item--selected:focus::before,.mdc-list-item:not(.mdc-list-item--selected):focus::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;content:"";pointer-events:none}a.mdc-list-item{color:inherit;text-decoration:none}.mdc-list-item__start{fill:currentColor;flex-shrink:0;pointer-events:none}.mdc-list-item--with-leading-icon .mdc-list-item__start{color:var(--mdc-list-list-item-leading-icon-color, var(--mat-sys-on-surface-variant));width:var(--mdc-list-list-item-leading-icon-size, 24px);height:var(--mdc-list-list-item-leading-icon-size, 24px);margin-left:16px;margin-right:32px}[dir=rtl] .mdc-list-item--with-leading-icon .mdc-list-item__start{margin-left:32px;margin-right:16px}.mdc-list-item--with-leading-icon:hover .mdc-list-item__start{color:var(--mdc-list-list-item-hover-leading-icon-color)}.mdc-list-item--with-leading-avatar .mdc-list-item__start{width:var(--mdc-list-list-item-leading-avatar-size, 40px);height:var(--mdc-list-list-item-leading-avatar-size, 40px);margin-left:16px;margin-right:16px;border-radius:50%}.mdc-list-item--with-leading-avatar .mdc-list-item__start,[dir=rtl] .mdc-list-item--with-leading-avatar .mdc-list-item__start{margin-left:16px;margin-right:16px;border-radius:50%}.mdc-list-item__end{flex-shrink:0;pointer-events:none}.mdc-list-item--with-trailing-meta .mdc-list-item__end{font-family:var(--mdc-list-list-item-trailing-supporting-text-font, var(--mat-sys-label-small-font));line-height:var(--mdc-list-list-item-trailing-supporting-text-line-height, var(--mat-sys-label-small-line-height));font-size:var(--mdc-list-list-item-trailing-supporting-text-size, var(--mat-sys-label-small-size));font-weight:var(--mdc-list-list-item-trailing-supporting-text-weight, var(--mat-sys-label-small-weight));letter-spacing:var(--mdc-list-list-item-trailing-supporting-text-tracking, var(--mat-sys-label-small-tracking))}.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-trailing-icon-color, var(--mat-sys-on-surface-variant));width:var(--mdc-list-list-item-trailing-icon-size, 24px);height:var(--mdc-list-list-item-trailing-icon-size, 24px)}.mdc-list-item--with-trailing-icon:hover .mdc-list-item__end{color:var(--mdc-list-list-item-hover-trailing-icon-color)}.mdc-list-item.mdc-list-item--with-trailing-meta .mdc-list-item__end{color:var(--mdc-list-list-item-trailing-supporting-text-color, var(--mat-sys-on-surface-variant))}.mdc-list-item--selected.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-selected-trailing-icon-color, var(--mat-sys-primary))}.mdc-list-item__content{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;align-self:center;flex:1;pointer-events:none}.mdc-list-item--with-two-lines .mdc-list-item__content,.mdc-list-item--with-three-lines .mdc-list-item__content{align-self:stretch}.mdc-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:var(--mdc-list-list-item-label-text-color, var(--mat-sys-on-surface));font-family:var(--mdc-list-list-item-label-text-font, var(--mat-sys-body-large-font));line-height:var(--mdc-list-list-item-label-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mdc-list-list-item-label-text-size, var(--mat-sys-body-large-size));font-weight:var(--mdc-list-list-item-label-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mdc-list-list-item-label-text-tracking, var(--mat-sys-body-large-tracking))}.mdc-list-item:hover .mdc-list-item__primary-text{color:var(--mdc-list-list-item-hover-label-text-color, var(--mat-sys-on-surface))}.mdc-list-item:focus .mdc-list-item__primary-text{color:var(--mdc-list-list-item-focus-label-text-color, var(--mat-sys-on-surface))}.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-three-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-three-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-three-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-list-item__secondary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;color:var(--mdc-list-list-item-supporting-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mdc-list-list-item-supporting-text-font, var(--mat-sys-body-medium-font));line-height:var(--mdc-list-list-item-supporting-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mdc-list-list-item-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mdc-list-list-item-supporting-text-weight, var(--mat-sys-body-medium-weight));letter-spacing:var(--mdc-list-list-item-supporting-text-tracking, var(--mat-sys-body-medium-tracking))}.mdc-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-list-item--with-three-lines .mdc-list-item__secondary-text{white-space:normal;line-height:20px}.mdc-list-item--with-overline .mdc-list-item__secondary-text{white-space:nowrap;line-height:auto}.mdc-list-item--with-leading-radio.mdc-list-item,.mdc-list-item--with-leading-checkbox.mdc-list-item,.mdc-list-item--with-leading-icon.mdc-list-item,.mdc-list-item--with-leading-avatar.mdc-list-item{padding-left:0;padding-right:16px}[dir=rtl] .mdc-list-item--with-leading-radio.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-checkbox.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-icon.mdc-list-item,[dir=rtl] .mdc-list-item--with-leading-avatar.mdc-list-item{padding-left:16px;padding-right:0}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text{display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines .mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end{display:block;margin-top:0;line-height:normal}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before,.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines.mdc-list-item--with-trailing-meta .mdc-list-item__end::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-list-item--with-trailing-icon.mdc-list-item,[dir=rtl] .mdc-list-item--with-trailing-icon.mdc-list-item{padding-left:0;padding-right:0}.mdc-list-item--with-trailing-icon .mdc-list-item__end{margin-left:16px;margin-right:16px}.mdc-list-item--with-trailing-meta.mdc-list-item{padding-left:16px;padding-right:0}[dir=rtl] .mdc-list-item--with-trailing-meta.mdc-list-item{padding-left:0;padding-right:16px}.mdc-list-item--with-trailing-meta .mdc-list-item__end{-webkit-user-select:none;user-select:none;margin-left:28px;margin-right:16px}[dir=rtl] .mdc-list-item--with-trailing-meta .mdc-list-item__end{margin-left:16px;margin-right:28px}.mdc-list-item--with-trailing-meta.mdc-list-item--with-three-lines .mdc-list-item__end,.mdc-list-item--with-trailing-meta.mdc-list-item--with-two-lines .mdc-list-item__end{display:block;line-height:normal;align-self:flex-start;margin-top:0}.mdc-list-item--with-trailing-meta.mdc-list-item--with-three-lines .mdc-list-item__end::before,.mdc-list-item--with-trailing-meta.mdc-list-item--with-two-lines .mdc-list-item__end::before{display:inline-block;width:0;height:28px;content:"";vertical-align:0}.mdc-list-item--with-leading-radio .mdc-list-item__start,.mdc-list-item--with-leading-checkbox .mdc-list-item__start{margin-left:8px;margin-right:24px}[dir=rtl] .mdc-list-item--with-leading-radio .mdc-list-item__start,[dir=rtl] .mdc-list-item--with-leading-checkbox .mdc-list-item__start{margin-left:24px;margin-right:8px}.mdc-list-item--with-leading-radio.mdc-list-item--with-two-lines .mdc-list-item__start,.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines .mdc-list-item__start{align-self:flex-start;margin-top:8px}.mdc-list-item--with-trailing-radio.mdc-list-item,.mdc-list-item--with-trailing-checkbox.mdc-list-item{padding-left:16px;padding-right:0}[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item{padding-left:0;padding-right:16px}.mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-icon,.mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-avatar,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-icon,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-avatar{padding-left:0}[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-icon,[dir=rtl] .mdc-list-item--with-trailing-radio.mdc-list-item--with-leading-avatar,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-icon,[dir=rtl] .mdc-list-item--with-trailing-checkbox.mdc-list-item--with-leading-avatar{padding-right:0}.mdc-list-item--with-trailing-radio .mdc-list-item__end,.mdc-list-item--with-trailing-checkbox .mdc-list-item__end{margin-left:24px;margin-right:8px}[dir=rtl] .mdc-list-item--with-trailing-radio .mdc-list-item__end,[dir=rtl] .mdc-list-item--with-trailing-checkbox .mdc-list-item__end{margin-left:8px;margin-right:24px}.mdc-list-item--with-trailing-radio.mdc-list-item--with-three-lines .mdc-list-item__end,.mdc-list-item--with-trailing-checkbox.mdc-list-item--with-three-lines .mdc-list-item__end{align-self:flex-start;margin-top:8px}.mdc-list-group__subheader{margin:.75rem 16px}.mdc-list-item--disabled .mdc-list-item__start,.mdc-list-item--disabled .mdc-list-item__content,.mdc-list-item--disabled .mdc-list-item__end{opacity:1}.mdc-list-item--disabled .mdc-list-item__primary-text,.mdc-list-item--disabled .mdc-list-item__secondary-text{opacity:var(--mdc-list-list-item-disabled-label-text-opacity, 0.3)}.mdc-list-item--disabled.mdc-list-item--with-leading-icon .mdc-list-item__start{color:var(--mdc-list-list-item-disabled-leading-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-list-list-item-disabled-leading-icon-opacity, 0.38)}.mdc-list-item--disabled.mdc-list-item--with-trailing-icon .mdc-list-item__end{color:var(--mdc-list-list-item-disabled-trailing-icon-color, var(--mat-sys-on-surface));opacity:var(--mdc-list-list-item-disabled-trailing-icon-opacity, 0.38)}.mat-mdc-list-item.mat-mdc-list-item-both-leading-and-trailing,[dir=rtl] .mat-mdc-list-item.mat-mdc-list-item-both-leading-and-trailing{padding-left:0;padding-right:0}.mdc-list-item.mdc-list-item--disabled .mdc-list-item__primary-text{color:var(--mdc-list-list-item-disabled-label-text-color, var(--mat-sys-on-surface))}.mdc-list-item:hover::before{background-color:var(--mdc-list-list-item-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-list-list-item-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-list-item.mdc-list-item--disabled::before{background-color:var(--mdc-list-list-item-disabled-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-list-list-item-disabled-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-list-item:focus::before{background-color:var(--mdc-list-list-item-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-list-list-item-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-list-item--disabled .mdc-radio,.mdc-list-item--disabled .mdc-checkbox{opacity:var(--mdc-list-list-item-disabled-label-text-opacity, 0.3)}.mdc-list-item--with-leading-avatar .mat-mdc-list-item-avatar{border-radius:var(--mdc-list-list-item-leading-avatar-shape, var(--mat-sys-corner-full));background-color:var(--mdc-list-list-item-leading-avatar-color, var(--mat-sys-primary-container))}.mat-mdc-list-item-icon{font-size:var(--mdc-list-list-item-leading-icon-size, 24px)}@media(forced-colors: active){a.mdc-list-item--activated::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}a.mdc-list-item--activated [dir=rtl]::after{right:auto;left:16px}}.mat-mdc-list-base{display:block}.mat-mdc-list-base .mdc-list-item__start,.mat-mdc-list-base .mdc-list-item__end,.mat-mdc-list-base .mdc-list-item__content{pointer-events:auto}.mat-mdc-list-item,.mat-mdc-list-option{width:100%;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-list-item:not(.mat-mdc-list-item-interactive),.mat-mdc-list-option:not(.mat-mdc-list-item-interactive){cursor:default}.mat-mdc-list-item .mat-divider-inset,.mat-mdc-list-option .mat-divider-inset{position:absolute;left:0;right:0;bottom:0}.mat-mdc-list-item .mat-mdc-list-item-avatar~.mat-divider-inset,.mat-mdc-list-option .mat-mdc-list-item-avatar~.mat-divider-inset{margin-left:72px}[dir=rtl] .mat-mdc-list-item .mat-mdc-list-item-avatar~.mat-divider-inset,[dir=rtl] .mat-mdc-list-option .mat-mdc-list-item-avatar~.mat-divider-inset{margin-right:72px}.mat-mdc-list-item-interactive::before{top:0;left:0;right:0;bottom:0;position:absolute;content:"";opacity:0;pointer-events:none;border-radius:inherit}.mat-mdc-list-item>.mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-list-item:focus>.mat-focus-indicator::before{content:""}.mat-mdc-list-item.mdc-list-item--with-three-lines .mat-mdc-list-item-line.mdc-list-item__secondary-text{white-space:nowrap;line-height:normal}.mat-mdc-list-item.mdc-list-item--with-three-lines .mat-mdc-list-item-unscoped-content.mdc-list-item__secondary-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}mat-action-list button{background:none;color:inherit;border:none;font:inherit;outline:inherit;-webkit-tap-highlight-color:rgba(0,0,0,0);text-align:start}mat-action-list button::-moz-focus-inner{border:0}.mdc-list-item--with-leading-icon .mdc-list-item__start{margin-inline-start:var(--mat-list-list-item-leading-icon-start-space, 16px);margin-inline-end:var(--mat-list-list-item-leading-icon-end-space, 16px)}.mat-mdc-nav-list .mat-mdc-list-item{border-radius:var(--mat-list-active-indicator-shape, var(--mat-sys-corner-full));--mat-focus-indicator-border-radius:var(--mat-list-active-indicator-shape, var(--mat-sys-corner-full))}.mat-mdc-nav-list .mat-mdc-list-item.mdc-list-item--activated{background-color:var(--mat-list-active-indicator-color, var(--mat-sys-secondary-container))}\n',u7=["unscopedContent"],vge=["text"],xge=[[["","matListItemAvatar",""],["","matListItemIcon",""]],[["","matListItemTitle",""]],[["","matListItemLine",""]],"*",[["","matListItemMeta",""]],[["mat-divider"]]],wge=["[matListItemAvatar],[matListItemIcon]","[matListItemTitle]","[matListItemLine]","*","[matListItemMeta]","mat-divider"],h7=new yt("ListOption");let OL=(()=>{class t{_elementRef=Y(Pn);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matListItemTitle",""]],hostAttrs:[1,"mat-mdc-list-item-title","mdc-list-item__primary-text"]})}return t})(),p7=(()=>{class t{_elementRef=Y(Pn);constructor(){}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matListItemLine",""]],hostAttrs:[1,"mat-mdc-list-item-line","mdc-list-item__secondary-text"]})}return t})(),Vge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","matListItemMeta",""]],hostAttrs:[1,"mat-mdc-list-item-meta","mdc-list-item__end"]})}return t})(),m7=(()=>{class t{_listOption=Y(h7,{optional:!0});constructor(){}_isAlignedAtStart(){return!this._listOption||"after"===this._listOption?._getTogglePosition()}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,hostVars:4,hostBindings:function(n,o){2&n&&Hn("mdc-list-item__start",o._isAlignedAtStart())("mdc-list-item__end",!o._isAlignedAtStart())}})}return t})(),Uge=(()=>{class t extends m7{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matListItemAvatar",""]],hostAttrs:[1,"mat-mdc-list-item-avatar"],features:[qn]})}return t})(),PL=(()=>{class t extends m7{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275dir=Gt({type:t,selectors:[["","matListItemIcon",""]],hostAttrs:[1,"mat-mdc-list-item-icon"],features:[qn]})}return t})();const Hge=new yt("MAT_LIST_CONFIG");let f0=(()=>{class t{_isNonInteractive=!0;get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=Ps(e)}_disableRipple=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=Ps(e)}_disabled=!1;_defaultOptions=Y(Hge,{optional:!0});static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,hostVars:1,hostBindings:function(n,o){2&n&&zn("aria-disabled",o.disabled)},inputs:{disableRipple:"disableRipple",disabled:"disabled"}})}return t})(),LL=(()=>{class t{_elementRef=Y(Pn);_ngZone=Y(tn);_listBase=Y(f0,{optional:!0});_platform=Y(ea);_hostElement;_isButtonElement;_noopAnimations;_avatars;_icons;set lines(e){this._explicitLines=Db(e,null),this._updateItemLines(!1)}_explicitLines=null;get disableRipple(){return this.disabled||this._disableRipple||this._noopAnimations||!!this._listBase?.disableRipple}set disableRipple(e){this._disableRipple=Ps(e)}_disableRipple=!1;get disabled(){return this._disabled||!!this._listBase?.disabled}set disabled(e){this._disabled=Ps(e)}_disabled=!1;_subscriptions=new ai;_rippleRenderer=null;_hasUnscopedTextContent=!1;rippleConfig;get rippleDisabled(){return this.disableRipple||!!this.rippleConfig.disabled}constructor(){Y(Rs).load(wu);const e=Y(cM,{optional:!0}),n=Y(Kr,{optional:!0});this.rippleConfig=e||{},this._hostElement=this._elementRef.nativeElement,this._isButtonElement="button"===this._hostElement.nodeName.toLowerCase(),this._noopAnimations="NoopAnimations"===n,this._listBase&&!this._listBase._isNonInteractive&&this._initInteractiveListItem(),this._isButtonElement&&!this._hostElement.hasAttribute("type")&&this._hostElement.setAttribute("type","button")}ngAfterViewInit(){this._monitorProjectedLinesAndTitle(),this._updateItemLines(!0)}ngOnDestroy(){this._subscriptions.unsubscribe(),null!==this._rippleRenderer&&this._rippleRenderer._removeTriggerEvents()}_hasIconOrAvatar(){return!(!this._avatars.length&&!this._icons.length)}_initInteractiveListItem(){this._hostElement.classList.add("mat-mdc-list-item-interactive"),this._rippleRenderer=new Ox(this,this._ngZone,this._hostElement,this._platform,Y(Ke)),this._rippleRenderer.setupTriggerEvents(this._hostElement)}_monitorProjectedLinesAndTitle(){this._ngZone.runOutsideAngular(()=>{this._subscriptions.add(va(this._lines.changes,this._titles.changes).subscribe(()=>this._updateItemLines(!1)))})}_updateItemLines(e){if(!this._lines||!this._titles||!this._unscopedContent)return;e&&this._checkDomForUnscopedTextContent();const n=this._explicitLines??this._inferLinesFromContent(),o=this._unscopedContent.nativeElement;if(this._hostElement.classList.toggle("mat-mdc-list-item-single-line",n<=1),this._hostElement.classList.toggle("mdc-list-item--with-one-line",n<=1),this._hostElement.classList.toggle("mdc-list-item--with-two-lines",2===n),this._hostElement.classList.toggle("mdc-list-item--with-three-lines",3===n),this._hasUnscopedTextContent){const r=0===this._titles.length&&1===n;o.classList.toggle("mdc-list-item__primary-text",r),o.classList.toggle("mdc-list-item__secondary-text",!r)}else o.classList.remove("mdc-list-item__primary-text"),o.classList.remove("mdc-list-item__secondary-text")}_inferLinesFromContent(){let e=this._titles.length+this._lines.length;return this._hasUnscopedTextContent&&(e+=1),e}_checkDomForUnscopedTextContent(){this._hasUnscopedTextContent=Array.from(this._unscopedContent.nativeElement.childNodes).filter(e=>e.nodeType!==e.COMMENT_NODE).some(e=>!(!e.textContent||!e.textContent.trim()))}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,contentQueries:function(n,o,r){if(1&n&&(oo(r,Uge,4),oo(r,PL,4)),2&n){let u;Bt(u=Vt())&&(o._avatars=u),Bt(u=Vt())&&(o._icons=u)}},hostVars:4,hostBindings:function(n,o){2&n&&(zn("aria-disabled",o.disabled)("disabled",o._isButtonElement&&o.disabled||null),Hn("mdc-list-item--disabled",o.disabled))},inputs:{lines:"lines",disableRipple:"disableRipple",disabled:"disabled"}})}return t})(),XT=(()=>{class t extends f0{static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-list"]],hostAttrs:[1,"mat-mdc-list","mat-mdc-list-base","mdc-list"],exportAs:["matList"],features:[Bn([{provide:f0,useExisting:t}]),qn],ngContentSelectors:kL,decls:1,vars:0,template:function(n,o){1&n&&(ho(),On(0))},styles:[RL],encapsulation:2,changeDetection:0})}return t})(),KT=(()=>{class t extends LL{_lines;_titles;_meta;_unscopedContent;_itemText;get activated(){return this._activated}set activated(e){this._activated=Ps(e)}_activated=!1;_getAriaCurrent(){return"A"===this._hostElement.nodeName&&this._activated?"page":null}_hasBothLeadingAndTrailing(){return 0!==this._meta.length&&(0!==this._avatars.length||0!==this._icons.length)}static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-list-item"],["a","mat-list-item",""],["button","mat-list-item",""]],contentQueries:function(n,o,r){if(1&n&&(oo(r,p7,5),oo(r,OL,5),oo(r,Vge,5)),2&n){let u;Bt(u=Vt())&&(o._lines=u),Bt(u=Vt())&&(o._titles=u),Bt(u=Vt())&&(o._meta=u)}},viewQuery:function(n,o){if(1&n&&(mn(u7,5),mn(vge,5)),2&n){let r;Bt(r=Vt())&&(o._unscopedContent=r.first),Bt(r=Vt())&&(o._itemText=r.first)}},hostAttrs:[1,"mat-mdc-list-item","mdc-list-item"],hostVars:13,hostBindings:function(n,o){2&n&&(zn("aria-current",o._getAriaCurrent()),Hn("mdc-list-item--activated",o.activated)("mdc-list-item--with-leading-avatar",0!==o._avatars.length)("mdc-list-item--with-leading-icon",0!==o._icons.length)("mdc-list-item--with-trailing-meta",0!==o._meta.length)("mat-mdc-list-item-both-leading-and-trailing",o._hasBothLeadingAndTrailing())("_mat-animation-noopable",o._noopAnimations))},inputs:{activated:"activated"},exportAs:["matListItem"],features:[qn],ngContentSelectors:wge,decls:10,vars:0,consts:[["unscopedContent",""],[1,"mdc-list-item__content"],[1,"mat-mdc-list-item-unscoped-content",3,"cdkObserveContent"],[1,"mat-focus-indicator"]],template:function(n,o){if(1&n){const r=pt();ho(xge),On(0),w(1,"span",1),On(2,1),On(3,2),w(4,"span",2,0),we("cdkObserveContent",function(){return fe(r),ge(o._updateItemLines(!0))}),On(6,3),x()(),On(7,4),On(8,5),Re(9,"div",3)}},dependencies:[n3],encapsulation:2,changeDetection:0})}return t})(),$ge=(()=>{class t extends f0{_isNonInteractive=!1;static \u0275fac=(()=>{let e;return function(o){return(e||(e=O(t)))(o||t)}})();static \u0275cmp=cn({type:t,selectors:[["mat-nav-list"]],hostAttrs:["role","navigation",1,"mat-mdc-nav-list","mat-mdc-list-base","mdc-list"],exportAs:["matNavList"],features:[Bn([{provide:f0,useExisting:t}]),qn],ngContentSelectors:kL,decls:1,vars:0,template:function(n,o){1&n&&(ho(),On(0))},styles:[RL],encapsulation:2,changeDetection:0})}return t})(),Zge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[i3,Ki,e0,xj,Uj]})}return t})();const Yge=["*",[["mat-toolbar-row"]]],Xge=["*","mat-toolbar-row"];let Kge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-toolbar-row"]],hostAttrs:[1,"mat-toolbar-row"],exportAs:["matToolbarRow"]})}return t})(),_0=(()=>{class t{_elementRef=Y(Pn);_platform=Y(ea);_document=Y(Oo);color;_toolbarRows;constructor(){}ngAfterViewInit(){this._platform.isBrowser&&(this._checkToolbarMixedModes(),this._toolbarRows.changes.subscribe(()=>this._checkToolbarMixedModes()))}_checkToolbarMixedModes(){}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-toolbar"]],contentQueries:function(n,o,r){if(1&n&&oo(r,Kge,5),2&n){let u;Bt(u=Vt())&&(o._toolbarRows=u)}},hostAttrs:[1,"mat-toolbar"],hostVars:6,hostBindings:function(n,o){2&n&&(bs(o.color?"mat-"+o.color:""),Hn("mat-toolbar-multiple-rows",o._toolbarRows.length>0)("mat-toolbar-single-row",0===o._toolbarRows.length))},inputs:{color:"color"},exportAs:["matToolbar"],ngContentSelectors:Xge,decls:2,vars:0,template:function(n,o){1&n&&(ho(Yge),On(0),On(1,1))},styles:[".mat-toolbar{background:var(--mat-toolbar-container-background-color, var(--mat-sys-surface));color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font, var(--mat-sys-title-large-font));font-size:var(--mat-toolbar-title-text-size, var(--mat-sys-title-large-size));line-height:var(--mat-toolbar-title-text-line-height, var(--mat-sys-title-large-line-height));font-weight:var(--mat-toolbar-title-text-weight, var(--mat-sys-title-large-weight));letter-spacing:var(--mat-toolbar-title-text-tracking, var(--mat-sys-title-large-tracking));margin:0}@media(forced-colors: active){.mat-toolbar{outline:solid 1px}}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface));--mdc-outlined-button-label-text-color:var(--mat-toolbar-container-text-color, var(--mat-sys-on-surface))}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height, 56px)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height, 64px)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height, 56px)}}\n"],encapsulation:2,changeDetection:0})}return t})(),Qge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,Ki]})}return t})();const Jge=["mat-menu-item",""],ebe=[[["mat-icon"],["","matMenuItemIcon",""]],"*"],tbe=["mat-icon, [matMenuItemIcon]","*"];function nbe(t,i){1&t&&(Va(),w(0,"svg",2),Re(1,"polygon",3),x())}const ibe=["*"];function obe(t,i){if(1&t){const e=pt();w(0,"div",0),we("click",function(){return fe(e),ge(X().closed.emit("click"))})("animationstart",function(o){return fe(e),ge(X()._onAnimationStart(o.animationName))})("animationend",function(o){return fe(e),ge(X()._onAnimationDone(o.animationName))})("animationcancel",function(o){return fe(e),ge(X()._onAnimationDone(o.animationName))}),w(1,"div",1),On(2),x()()}if(2&t){const e=X();bs(e._classList),Hn("mat-menu-panel-animations-disabled",e._animationsDisabled)("mat-menu-panel-exit-animation","void"===e._panelAnimationState)("mat-menu-panel-animating",e._isAnimating),N("id",e.panelId),zn("aria-label",e.ariaLabel||null)("aria-labelledby",e.ariaLabelledby||null)("aria-describedby",e.ariaDescribedby||null)}}const FL=new yt("MAT_MENU_PANEL");let iw=(()=>{class t{_elementRef=Y(Pn);_document=Y(Oo);_focusMonitor=Y(eh);_parentMenu=Y(FL,{optional:!0});_changeDetectorRef=Y(So);role="menuitem";disabled=!1;disableRipple=!1;_hovered=new Ee;_focused=new Ee;_highlighted=!1;_triggersSubmenu=!1;constructor(){Y(Rs).load(wu),this._parentMenu?.addItem?.(this)}focus(e,n){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,n):this._getHostElement().focus(n),this._focused.next(this)}ngAfterViewInit(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)}ngOnDestroy(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._elementRef.nativeElement}_checkDisabled(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}_handleMouseEnter(){this._hovered.next(this)}getLabel(){const e=this._elementRef.nativeElement.cloneNode(!0),n=e.querySelectorAll("mat-icon, .material-icons");for(let o=0;o{class t{_elementRef=Y(Pn);_changeDetectorRef=Y(So);_injector=Y(Ke);_keyManager;_xPosition;_yPosition;_firstItemFocusRef;_exitFallbackTimeout;_animationsDisabled;_allItems;_directDescendantItems=new Od;_classList={};_panelAnimationState="void";_animationDone=new Ee;_isAnimating=!1;parentMenu;direction;overlayPanelClass;backdropClass;ariaLabel;ariaLabelledby;ariaDescribedby;get xPosition(){return this._xPosition}set xPosition(e){this._xPosition=e,this.setPositionClasses()}get yPosition(){return this._yPosition}set yPosition(e){this._yPosition=e,this.setPositionClasses()}templateRef;items;lazyContent;overlapTrigger;hasBackdrop;set panelClass(e){const n=this._previousPanelClass,o={...this._classList};n&&n.length&&n.split(" ").forEach(r=>{o[r]=!1}),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach(r=>{o[r]=!0}),this._elementRef.nativeElement.className=""),this._classList=o}_previousPanelClass;get classList(){return this.panelClass}set classList(e){this.panelClass=e}closed=new Tt;close=this.closed;panelId=Y(ta).getId("mat-menu-panel-");constructor(){const e=Y(abe);this.overlayPanelClass=e.overlayPanelClass||"",this._xPosition=e.xPosition,this._yPosition=e.yPosition,this.backdropClass=e.backdropClass,this.overlapTrigger=e.overlapTrigger,this.hasBackdrop=e.hasBackdrop,this._animationsDisabled="NoopAnimations"===Y(Kr,{optional:!0})}ngOnInit(){this.setPositionClasses()}ngAfterContentInit(){this._updateDirectDescendants(),this._keyManager=new FT(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._keyManager.tabOut.subscribe(()=>this.closed.emit("tab")),this._directDescendantItems.changes.pipe(ua(this._directDescendantItems),Xs(e=>va(...e.map(n=>n._focused)))).subscribe(e=>this._keyManager.updateActiveItem(e)),this._directDescendantItems.changes.subscribe(e=>{const n=this._keyManager;if("enter"===this._panelAnimationState&&n.activeItem?._hasFocus()){const o=e.toArray(),r=Math.max(0,Math.min(o.length-1,n.activeItemIndex||0));o[r]&&!o[r].disabled?n.setActiveItem(r):n.setNextItemActive()}})}ngOnDestroy(){this._keyManager?.destroy(),this._directDescendantItems.destroy(),this.closed.complete(),this._firstItemFocusRef?.destroy(),clearTimeout(this._exitFallbackTimeout)}_hovered(){return this._directDescendantItems.changes.pipe(ua(this._directDescendantItems),Xs(n=>va(...n.map(o=>o._hovered))))}addItem(e){}removeItem(e){}_handleKeydown(e){const n=e.keyCode,o=this._keyManager;switch(n){case 27:ns(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case 37:this.parentMenu&&"ltr"===this.direction&&this.closed.emit("keydown");break;case 39:this.parentMenu&&"rtl"===this.direction&&this.closed.emit("keydown");break;default:return(38===n||40===n)&&o.setFocusOrigin("keyboard"),void o.onKeydown(e)}}focusFirstItem(e="program"){this._firstItemFocusRef?.destroy(),this._firstItemFocusRef=As(()=>{const n=this._resolvePanel();if(!n||!n.contains(document.activeElement)){const o=this._keyManager;o.setFocusOrigin(e).setFirstItemActive(),!o.activeItem&&n&&n.focus()}},{injector:this._injector})}resetActiveItem(){this._keyManager.setActiveItem(-1)}setElevation(e){}setPositionClasses(e=this.xPosition,n=this.yPosition){this._classList={...this._classList,"mat-menu-before":"before"===e,"mat-menu-after":"after"===e,"mat-menu-above":"above"===n,"mat-menu-below":"below"===n},this._changeDetectorRef.markForCheck()}_onAnimationDone(e){const n=e===nA;(n||e===NL)&&(n&&(clearTimeout(this._exitFallbackTimeout),this._exitFallbackTimeout=void 0),this._animationDone.next(n?"void":"enter"),this._isAnimating=!1)}_onAnimationStart(e){(e===NL||e===nA)&&(this._isAnimating=!0)}_setIsOpen(e){if(this._panelAnimationState=e?"enter":"void",e){if(0===this._keyManager.activeItemIndex){const n=this._resolvePanel();n&&(n.scrollTop=0)}}else this._animationsDisabled||(this._exitFallbackTimeout=setTimeout(()=>this._onAnimationDone(nA),200));this._animationsDisabled&&setTimeout(()=>{this._onAnimationDone(e?NL:nA)}),this._changeDetectorRef.markForCheck()}_updateDirectDescendants(){this._allItems.changes.pipe(ua(this._allItems)).subscribe(e=>{this._directDescendantItems.reset(e.filter(n=>n._parentMenu===this)),this._directDescendantItems.notifyOnChanges()})}_resolvePanel(){let e=null;return this._directDescendantItems.length&&(e=this._directDescendantItems.first._getHostElement().closest('[role="menu"]')),e}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-menu"]],contentQueries:function(n,o,r){if(1&n&&(oo(r,rbe,5),oo(r,iw,5),oo(r,iw,4)),2&n){let u;Bt(u=Vt())&&(o.lazyContent=u.first),Bt(u=Vt())&&(o._allItems=u),Bt(u=Vt())&&(o.items=u)}},viewQuery:function(n,o){if(1&n&&mn(sa,5),2&n){let r;Bt(r=Vt())&&(o.templateRef=r.first)}},hostVars:3,hostBindings:function(n,o){2&n&&zn("aria-label",null)("aria-labelledby",null)("aria-describedby",null)},inputs:{backdropClass:"backdropClass",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],xPosition:"xPosition",yPosition:"yPosition",overlapTrigger:[2,"overlapTrigger","overlapTrigger",fn],hasBackdrop:[2,"hasBackdrop","hasBackdrop",e=>null==e?null:fn(e)],panelClass:[0,"class","panelClass"],classList:"classList"},outputs:{closed:"closed",close:"close"},exportAs:["matMenu"],features:[Bn([{provide:FL,useExisting:t}])],ngContentSelectors:ibe,decls:1,vars:0,consts:[["tabindex","-1","role","menu",1,"mat-mdc-menu-panel",3,"click","animationstart","animationend","animationcancel","id"],[1,"mat-mdc-menu-content"]],template:function(n,o){1&n&&(ho(),te(0,obe,3,12,"ng-template"))},styles:['mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n'],encapsulation:2,changeDetection:0})}return t})();const _7=new yt("mat-menu-scroll-strategy",{providedIn:"root",factory:()=>{const t=Y(is);return()=>t.scrollStrategies.reposition()}}),cbe={provide:_7,deps:[is],useFactory:function lbe(t){return()=>t.scrollStrategies.reposition()}},dbe={passive:!0},QT=new WeakMap;let zL=(()=>{class t{_overlay=Y(is);_element=Y(Pn);_viewContainerRef=Y(es);_menuItemInstance=Y(iw,{optional:!0,self:!0});_dir=Y(ul,{optional:!0});_focusMonitor=Y(eh);_ngZone=Y(tn);_scrollStrategy=Y(_7);_changeDetectorRef=Y(So);_cleanupTouchstart;_portal;_overlayRef=null;_menuOpen=!1;_closingActionsSubscription=ai.EMPTY;_hoverSubscription=ai.EMPTY;_menuCloseSubscription=ai.EMPTY;_pendingRemoval;_parentMaterialMenu;_parentInnerPadding;_openedBy=void 0;get _deprecatedMatMenuTriggerFor(){return this.menu}set _deprecatedMatMenuTriggerFor(e){this.menu=e}get menu(){return this._menu}set menu(e){e!==this._menu&&(this._menu=e,this._menuCloseSubscription.unsubscribe(),e&&(this._menuCloseSubscription=e.close.subscribe(n=>{this._destroyMenu(n),("click"===n||"tab"===n)&&this._parentMaterialMenu&&this._parentMaterialMenu.closed.emit(n)})),this._menuItemInstance?._setTriggersSubmenu(this.triggersSubmenu()))}_menu;menuData;restoreFocus=!0;menuOpened=new Tt;onMenuOpen=this.menuOpened;menuClosed=new Tt;onMenuClose=this.menuClosed;constructor(){const e=Y(FL,{optional:!0}),n=Y(Hr);this._parentMaterialMenu=e instanceof g0?e:void 0,this._cleanupTouchstart=ec(n,this._element.nativeElement,"touchstart",o=>{f3(o)||(this._openedBy="touch")},dbe)}ngAfterContentInit(){this._handleHover()}ngOnDestroy(){this.menu&&this._ownsMenu(this.menu)&&QT.delete(this.menu),this._cleanupTouchstart(),this._pendingRemoval?.unsubscribe(),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe(),this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null)}get menuOpen(){return this._menuOpen}get dir(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}triggersSubmenu(){return!!(this._menuItemInstance&&this._parentMaterialMenu&&this.menu)}toggleMenu(){return this._menuOpen?this.closeMenu():this.openMenu()}openMenu(){const e=this.menu;if(this._menuOpen||!e)return;this._pendingRemoval?.unsubscribe();const n=QT.get(e);QT.set(e,this),n&&n!==this&&n.closeMenu();const o=this._createOverlay(e),r=o.getConfig(),u=r.positionStrategy;this._setPosition(e,u),r.hasBackdrop=null==e.hasBackdrop?!this.triggersSubmenu():e.hasBackdrop,o.hasAttached()||(o.attach(this._getPortal(e)),e.lazyContent?.attach(this.menuData)),this._closingActionsSubscription=this._menuClosingActions().subscribe(()=>this.closeMenu()),e.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,e.direction=this.dir,e.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0),e instanceof g0&&(e._setIsOpen(!0),e._directDescendantItems.changes.pipe(ro(e.close)).subscribe(()=>{u.withLockedPosition(!1).reapplyLastPosition(),u.withLockedPosition(!0)}))}closeMenu(){this.menu?.close.emit()}focus(e,n){this._focusMonitor&&e?this._focusMonitor.focusVia(this._element,e,n):this._element.nativeElement.focus(n)}updatePosition(){this._overlayRef?.updatePosition()}_destroyMenu(e){const n=this._overlayRef,o=this._menu;!n||!this.menuOpen||(this._closingActionsSubscription.unsubscribe(),this._pendingRemoval?.unsubscribe(),o instanceof g0&&this._ownsMenu(o)?(this._pendingRemoval=o._animationDone.pipe($a(1)).subscribe(()=>{n.detach(),o.lazyContent?.detach()}),o._setIsOpen(!1)):(n.detach(),o?.lazyContent?.detach()),o&&this._ownsMenu(o)&&QT.delete(o),this.restoreFocus&&("keydown"===e||!this._openedBy||!this.triggersSubmenu())&&this.focus(this._openedBy),this._openedBy=void 0,this._setIsMenuOpen(!1))}_setIsMenuOpen(e){e!==this._menuOpen&&(this._menuOpen=e,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&this._menuItemInstance._setHighlighted(e),this._changeDetectorRef.markForCheck())}_createOverlay(e){if(!this._overlayRef){const n=this._getOverlayConfig(e);this._subscribeToPositions(e,n.positionStrategy),this._overlayRef=this._overlay.create(n),this._overlayRef.keydownEvents().subscribe(o=>{this.menu instanceof g0&&this.menu._handleKeydown(o)})}return this._overlayRef}_getOverlayConfig(e){return new Qv({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:e.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:e.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir||"ltr"})}_subscribeToPositions(e,n){e.setPositionClasses&&n.positionChanges.subscribe(o=>{this._ngZone.run(()=>{e.setPositionClasses("start"===o.connectionPair.overlayX?"after":"before","top"===o.connectionPair.overlayY?"below":"above")})})}_setPosition(e,n){let[o,r]="before"===e.xPosition?["end","start"]:["start","end"],[u,y]="above"===e.yPosition?["bottom","top"]:["top","bottom"],[I,V]=[u,y],[q,ee]=[o,r],me=0;if(this.triggersSubmenu()){if(ee=o="before"===e.xPosition?"start":"end",r=q="end"===o?"start":"end",this._parentMaterialMenu){if(null==this._parentInnerPadding){const he=this._parentMaterialMenu.items.first;this._parentInnerPadding=he?he._getHostElement().offsetTop:0}me="bottom"===u?this._parentInnerPadding:-this._parentInnerPadding}}else e.overlapTrigger||(I="top"===u?"bottom":"top",V="top"===y?"bottom":"top");n.withPositions([{originX:o,originY:I,overlayX:q,overlayY:u,offsetY:me},{originX:r,originY:I,overlayX:ee,overlayY:u,offsetY:me},{originX:o,originY:V,overlayX:q,overlayY:y,offsetY:-me},{originX:r,originY:V,overlayX:ee,overlayY:y,offsetY:-me}])}_menuClosingActions(){const e=this._overlayRef.backdropClick(),n=this._overlayRef.detachments();return va(e,this._parentMaterialMenu?this._parentMaterialMenu.closed:xi(),this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(or(u=>this._menuOpen&&u!==this._menuItemInstance)):xi(),n)}_handleMousedown(e){m3(e)||(this._openedBy=0===e.button?"mouse":void 0,this.triggersSubmenu()&&e.preventDefault())}_handleKeydown(e){const n=e.keyCode;(13===n||32===n)&&(this._openedBy="keyboard"),this.triggersSubmenu()&&(39===n&&"ltr"===this.dir||37===n&&"rtl"===this.dir)&&(this._openedBy="keyboard",this.openMenu())}_handleClick(e){this.triggersSubmenu()?(e.stopPropagation(),this.openMenu()):this.toggleMenu()}_handleHover(){this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().subscribe(e=>{e===this._menuItemInstance&&!e.disabled&&(this._openedBy="mouse",this.openMenu())}))}_getPortal(e){return(!this._portal||this._portal.templateRef!==e.templateRef)&&(this._portal=new C_(e.templateRef,this._viewContainerRef)),this._portal}_ownsMenu(e){return QT.get(e)===this}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","mat-menu-trigger-for",""],["","matMenuTriggerFor",""]],hostAttrs:[1,"mat-mdc-menu-trigger"],hostVars:3,hostBindings:function(n,o){1&n&&we("click",function(u){return o._handleClick(u)})("mousedown",function(u){return o._handleMousedown(u)})("keydown",function(u){return o._handleKeydown(u)}),2&n&&zn("aria-haspopup",o.menu?"menu":null)("aria-expanded",o.menuOpen)("aria-controls",o.menuOpen?o.menu.panelId:null)},inputs:{_deprecatedMatMenuTriggerFor:[0,"mat-menu-trigger-for","_deprecatedMatMenuTriggerFor"],menu:[0,"matMenuTriggerFor","menu"],menuData:[0,"matMenuTriggerData","menuData"],restoreFocus:[0,"matMenuTriggerRestoreFocus","restoreFocus"]},outputs:{menuOpened:"menuOpened",onMenuOpen:"onMenuOpen",menuClosed:"menuClosed",onMenuClose:"onMenuClose"},exportAs:["matMenuTrigger"]})}return t})(),ube=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({providers:[cbe],imports:[e0,Ki,Ib,T_,Ki]})}return t})(),JT=(()=>{class t{payload;copied=new Tt;onClick(e){if(e.preventDefault(),!this.payload)return;let n=o=>{(o.clipboardData||window.clipboardData).setData("text",this.payload.toString()),o.preventDefault(),this.copied.emit(this.payload)};document.addEventListener("copy",n,!1),document.execCommand("copy"),document.removeEventListener("copy",n,!1)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","copy-clipboard",""]],hostBindings:function(n,o){1&n&&we("click",function(u){return o.onClick(u)})},inputs:{payload:[0,"copy-clipboard","payload"]},outputs:{copied:"copied"},standalone:!1})}return t})();function hbe(t,i){1&t&&(at(0),w(1,"div",3)(2,"span",4),M(3,"Loading\u2026"),x(),Re(4,"mat-progress-bar",5),x(),st())}function pbe(t,i){if(1&t&&(at(0),w(1,"div",6),M(2),x(),st()),2&t){const e=X(2);E(2),Ct(e.noRowsText)}}function mbe(t,i){if(1&t&&te(0,pbe,3,1,"ng-container",2),2&t){const e=X(),n=Vi(4);N("ngIf",0===e.dataSource.data.length)("ngIfElse",n)}}function fbe(t,i){if(1&t&&(w(0,"div",6),M(1),x()),2&t){const e=X(2);E(),Jt(" ",e.noResultsText," ")}}function _be(t,i){1&t&&te(0,fbe,2,1,"div",7),2&t&&N("ngIf",0===X().dataSource.filteredData.length)}let F_=(()=>{class t{isLoading=!1;dataSource;noRowsText="No items";noResultsText="No results found. Try adjusting your filters.";static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["app-table-placeholder"]],inputs:{isLoading:"isLoading",dataSource:"dataSource",noRowsText:"noRowsText",noResultsText:"noResultsText"},standalone:!1,decls:5,vars:2,consts:[["loaded",""],["hasRows",""],[4,"ngIf","ngIfElse"],[1,"progress-content"],[1,"progress-text"],["mode","indeterminate"],[1,"empty-table"],["class","empty-table",4,"ngIf"]],template:function(n,o){if(1&n&&te(0,hbe,5,0,"ng-container",2)(1,mbe,1,2,"ng-template",null,0,Ud)(3,_be,1,1,"ng-template",null,1,Ud),2&n){const r=Vi(2);N("ngIf",o.isLoading)("ngIfElse",r)}},dependencies:[ir,m0],encapsulation:2})}return t})();const gbe=["licenseSetPaginator"],bbe=["standaloneStatusPaginator"],ybe=["standalonePaginator"],vbe=["ondemandStatusPaginator"],xbe=["ondemandPrivatePaginator"],wbe=["ondemandPaginator"],Cbe=["sortOptions"],Sbe=["sortStandaloneStatus"],Tbe=["sortStandaloneActive"],Dbe=["sortOnDemandStatus"],Ibe=["sortOnDemandClaimed"],Ebe=["sortOnDemandPrivate"],ow=()=>[10,25,50,75,100],iA=()=>({color:"orange"}),Mbe=()=>({color:"purple"}),Abe=()=>({color:"green"}),kbe=()=>({color:"orangered"}),Rbe=()=>({color:"red"});function Obe(t,i){if(1&t&&(w(0,"button",39)(1,"span",42),M(2),x()()),2&t){const e=X(2);N("copy-clipboard",e.currentOrgUUID),E(2),Ct(e.currentOrgUUID)}}function Pbe(t,i){if(1&t&&(w(0,"div",37)(1,"button",38)(2,"mat-icon",29),M(3,"info"),x()(),w(4,"mat-menu",null,0)(6,"button",39)(7,"span"),M(8),x(),M(9," \xa0 "),w(10,"span",40),M(11),x()(),te(12,Obe,3,2,"button",41),x()()),2&t){const e=Vi(5),n=X();E(),N("matMenuTriggerFor",e),E(5),N("copy-clipboard",n.currentOrg),E(2),Ct(n.currentOrg),E(2),N("ngClass",n.currentOrgEnabled?"enabled-org-color":"disabled-org-color"),E(),Jt("(",n.currentOrgEnabled?"Enabled":"Disabled",")"),E(),N("ngIf",n.isMasterAdmin())}}function Lbe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",23)(1,"mat-label"),M(2,"Claimed Filter:"),x(),w(3,"mat-select",24),we("selectionChange",function(){return fe(e),ge(X().SaveFilters())}),w(4,"mat-option",43),M(5,"All"),x(),w(6,"mat-option",44),M(7,"Unclaimed"),x(),w(8,"mat-option",45),M(9,"Claimed"),x()()()}if(2&t){const e=X();E(3),N("formControl",e.claimedFilter)}}function Fbe(t,i){if(1&t&&(w(0,"mat-option",46),M(1),x()),2&t){const e=i.$implicit;ys("value",e.key),E(),Ct(e.value)}}function Nbe(t,i){if(1&t&&(w(0,"mat-option",46),M(1),x()),2&t){const e=i.$implicit;N("value",e),E(),Ct(e)}}function zbe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",23)(1,"mat-label"),M(2,"Subscription Filter:"),x(),w(3,"mat-select",24),we("selectionChange",function(){return fe(e),ge(X().SaveFilters())}),w(4,"mat-option",43),M(5,"All"),x(),w(6,"mat-option",47),M(7,"No Subscription"),x(),w(8,"mat-option",48),M(9,"Expired"),x(),w(10,"mat-option",49),M(11,"Expiring"),x(),w(12,"mat-option",50),M(13,"Active"),x(),w(14,"mat-option",51),M(15,"Not Started"),x()()()}if(2&t){const e=X();E(3),N("formControl",e.subFilter)}}function Bbe(t,i){if(1&t){const e=pt();w(0,"button",54),we("click",function(){fe(e);const o=X(2);return ge(o.ClearFilter(o.noteFilter))}),w(1,"mat-icon",29),M(2,"close"),x()()}}function Vbe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",23)(1,"mat-label"),M(2,"Notes Filter:"),x(),w(3,"input",52),we("input",function(){return fe(e),ge(X().SaveFilters())}),x(),te(4,Bbe,3,0,"button",53),x()}if(2&t){const e=X();E(3),N("formControl",e.noteFilter),E(),N("ngIf",""!=e.noteFilter.value)}}function Ube(t,i){if(1&t){const e=pt();w(0,"button",55),we("click",function(){return fe(e),ge(X().loadCurrentTabData())}),w(1,"mat-icon",29),M(2,"refresh"),x()()}}function Hbe(t,i){if(1&t){const e=pt();w(0,"button",56),we("click",function(){return fe(e),ge(X().onEditOption(null,0))}),w(1,"mat-icon",29),M(2,"add_circle"),x()()}}function jbe(t,i){if(1&t){const e=pt();w(0,"button",57),we("click",function(){return fe(e),ge(X().onExpirationNotify())}),w(1,"mat-icon",29),M(2,"forward_to_inbox"),x()()}}function $be(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function Gbe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(3);E(),Ct(n.applications.get(e.application))}}function qbe(t,i){1&t&&(w(0,"span"),M(1,"group.application"),x())}function Wbe(t,i){if(1&t&&(w(0,"td",90),te(1,Gbe,2,1,"span",34)(2,qbe,2,0,"span",34),x()),2&t){const e=i.$implicit,n=X(3);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function Zbe(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function Ybe(t,i){1&t&&(w(0,"span"),M(1,"12.x"),x())}function Xbe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ct(e.version)}}function Kbe(t,i){1&t&&(w(0,"td",91),te(1,Ybe,2,0,"span",92)(2,Xbe,2,1,"span",93),x()),2&t&&(N("ngSwitch",i.$implicit.version),E(),N("ngSwitchCase","12.2"))}function Qbe(t,i){1&t&&(w(0,"th",89),M(1,"License Type"),x())}function Jbe(t,i){if(1&t&&(w(0,"td",94),M(1),x()),2&t){const e=i.$implicit,n=X(3);E(),Ct(n.getLicenseTypeLabel(e.license_type))}}function eye(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function tye(t,i){if(1&t&&(w(0,"td",95),M(1),x()),2&t){const e=i.$implicit,n=X(3);E(),Ct(n.getCategoryLabel(e.application,e.license_type,e.category))}}function nye(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function iye(t,i){if(1&t&&(w(0,"td",96),M(1),x()),2&t){const e=i.$implicit,n=X(3);E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function oye(t,i){1&t&&(w(0,"th",89),M(1,"Notes"),x())}function rye(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function aye(t,i){if(1&t&&(w(0,"span")(1,"p",98),M(2),x()()),2&t){const e=X().$implicit;E(2),Ct(e.notes)}}function sye(t,i){if(1&t&&(w(0,"td",97),te(1,rye,2,0,"span",34)(2,aye,3,1,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.notes||""==e.notes.trim()),E(),N("ngIf",e.notes&&""!=e.notes.trim())}}function lye(t,i){1&t&&(w(0,"th",89),M(1,"Options"),x())}function cye(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function dye(t,i){if(1&t&&(w(0,"span",101),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" License ID:",e.id,":\xa0 ")}}function uye(t,i){if(1&t&&(w(0,"span")(1,"p",98),te(2,dye,2,1,"span",100),M(3),x()()),2&t){const e=X().$implicit,n=X(3);E(2),N("ngIf",n.userInfo&&n.userInfo.isMasterDBUser()&&n.showLicenseID(e.application)),E(),Jt(" ",e.optionlist," ")}}function hye(t,i){if(1&t&&(w(0,"td",99),te(1,cye,2,0,"span",34)(2,uye,4,2,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.optionlist||""==e.optionlist.trim()),E(),N("ngIf",e.optionlist&&""!=e.optionlist.trim())}}function pye(t,i){1&t&&(w(0,"th",89),M(1,"Private Server"),x())}function mye(t,i){1&t&&(w(0,"span")(1,"mat-icon",29),M(2,"done"),x()())}function fye(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function _ye(t,i){if(1&t&&(w(0,"td",102),te(1,mye,3,0,"span",34)(2,fye,2,0,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.local_license),E(),N("ngIf",!e.local_license)}}function gye(t,i){1&t&&(w(0,"th",89),M(1,"Subscription"),x())}function bye(t,i){1&t&&(w(0,"span")(1,"mat-icon",104),M(2,"remove"),x()())}function yye(t,i){1&t&&(w(0,"span")(1,"mat-icon",105),M(2,"event_busy"),x()()),2&t&&(E(),N("ngStyle",jn(1,iA)))}function vye(t,i){if(1&t&&(w(0,"span",110),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function xye(t,i){if(1&t&&(w(0,"span",111),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function wye(t,i){if(1&t&&(w(0,"span",112)(1,"span",113),M(2),ti(3,"date"),x(),M(4," \xa0-\xa0 "),w(5,"span",114),M(6),ti(7,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Jt(" ",hi(3,2,e.sub_start+"Z","mediumDate")," "),E(4),Jt(" ",hi(7,5,e.sub_end+"Z","mediumDate")," ")}}function Cye(t,i){if(1&t&&(w(0,"span",115)(1,"span",116),M(2),ti(3,"date"),ti(4,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Ea(" ",hi(3,2,e.sub_start+"Z","mediumDate")," - ",hi(4,5,e.sub_end+"Z","mediumDate")," ")}}function Sye(t,i){if(1&t&&(w(0,"span"),te(1,vye,4,8,"span",106)(2,xye,4,8,"span",107)(3,wye,8,8,"span",108)(4,Cye,5,8,"span",109),x()),2&t){const e=X(2).$implicit;E(),N("ngIf",e.is_sub_delayed),E(),N("ngIf",!e.is_sub_delayed&&!e.is_sub_expired&&!e.is_sub_expiring),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expiring&&!e.is_sub_expired),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expired)}}function Tye(t,i){if(1&t&&(w(0,"span"),te(1,yye,3,2,"span",34)(2,Sye,5,4,"span",34),x()),2&t){const e=X().$implicit;E(),N("ngIf",""==e.sub_end),E(),N("ngIf",""!=e.sub_end)}}function Dye(t,i){if(1&t&&(w(0,"td",103),te(1,bye,3,0,"span",34)(2,Tye,3,2,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.is_subscription),E(),N("ngIf",e.is_subscription)}}function Iye(t,i){1&t&&(w(0,"th",89),M(1,"Limit"),x())}function Eye(t,i){if(1&t&&(w(0,"span",119),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" ",e.limit," ")}}function Mye(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" ",e.limit," ")}}function Aye(t,i){if(1&t&&(w(0,"td",117),te(1,Eye,2,1,"span",118)(2,Mye,2,1,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.promo_limit>0),E(),N("ngIf",e.promo_limit<=0)}}function kye(t,i){1&t&&(w(0,"th",89),M(1,"Purchase Orders"),x())}function Rye(t,i){1&t&&(at(0),M(1," None "),st())}function Oye(t,i){if(1&t){const e=pt();at(0),w(1,"mat-icon",121),M(2,"receipt_long"),x(),w(3,"span",122),we("click",function(){fe(e);const o=X().$implicit;return ge(X(3).viewPurchaseOrder(o.purchase_orders[0]))}),M(4),x(),st()}if(2&t){const e=X().$implicit;E(4),Ct(e.purchase_orders[0].po)}}function Pye(t,i){if(1&t){const e=pt();w(0,"mat-list-item")(1,"mat-icon",125),M(2,"receipt_long"),x(),w(3,"span",122),we("click",function(){const o=fe(e).$implicit;return ge(X(5).viewPurchaseOrder(o))}),M(4),x()()}if(2&t){const e=i.$implicit;E(4),Ct(e.po)}}function Lye(t,i){if(1&t&&(at(0),w(1,"mat-expansion-panel",123)(2,"mat-expansion-panel-header"),M(3),x(),w(4,"mat-list"),te(5,Pye,5,1,"mat-list-item",124),x()(),st()),2&t){const e=X().$implicit;E(3),Jt(" PO List (",e.purchase_orders.length,") "),E(2),N("ngForOf",e.purchase_orders)}}function Fye(t,i){if(1&t&&(w(0,"td",120),te(1,Rye,2,0,"ng-container",34)(2,Oye,5,1,"ng-container",34)(3,Lye,6,2,"ng-container",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",0==e.purchase_orders.length),E(),N("ngIf",1==e.purchase_orders.length),E(),N("ngIf",e.purchase_orders.length>1)}}function Nye(t,i){1&t&&(w(0,"th",129),M(1,"Actions"),x())}function zye(t,i){if(1&t){const e=pt();at(0),w(1,"button",133),we("click",function(){fe(e);const o=X(2).$implicit;return ge(X(4).onModifySub(o))}),w(2,"mat-icon",29),M(3,"date_range"),x()(),st()}}function Bye(t,i){if(1&t){const e=pt();at(0)(1),w(2,"button",131),we("click",function(){fe(e);const o=X().$implicit;return ge(X(4).onEditOption(o,o.activated))}),w(3,"mat-icon",29),M(4,"edit"),x()(),st(),te(5,zye,4,0,"ng-container",34),at(6),w(7,"button",132),we("click",function(){fe(e);const o=X().$implicit;return ge(X(4).onDeleteOptionSet(o.id))}),w(8,"mat-icon",29),M(9,"delete"),x()(),st()()}if(2&t){const e=X().$implicit;E(5),N("ngIf",e.is_subscription)}}function Vye(t,i){1&t&&(at(0),Re(1,"p"),st())}function Uye(t,i){if(1&t&&(w(0,"td",130),te(1,Bye,10,1,"ng-container",34)(2,Vye,2,0,"ng-container",34),x()),2&t){const e=X(4);E(),N("ngIf",e.userInfo&&e.userInfo.isMasterAdmin()),E(),N("ngIf",!e.userInfo||!e.userInfo.isMasterAdmin())}}function Hye(t,i){1&t&&(at(0,126),te(1,Nye,2,0,"th",127)(2,Uye,3,2,"td",128),st())}function jye(t,i){1&t&&Re(0,"tr",134)}function $ye(t,i){1&t&&Re(0,"tr",135)}function Gye(t,i){if(1&t){const e=pt();w(0,"div",58)(1,"table",59,1)(3,"caption",60),M(4," License Sets "),x(),at(5,61),te(6,$be,2,0,"th",62)(7,Wbe,3,2,"td",63),st(),at(8,64),te(9,Zbe,2,0,"th",62)(10,Kbe,3,2,"td",65),st(),at(11,66),te(12,Qbe,2,0,"th",62)(13,Jbe,2,1,"td",67),st(),at(14,68),te(15,eye,2,0,"th",62)(16,tye,2,1,"td",69),st(),at(17,70),te(18,nye,2,0,"th",62)(19,iye,2,1,"td",71),st(),at(20,72),te(21,oye,2,0,"th",62)(22,sye,3,2,"td",73),st(),at(23,74),te(24,lye,2,0,"th",62)(25,hye,3,2,"td",75),st(),at(26,76),te(27,pye,2,0,"th",62)(28,_ye,3,2,"td",77),st(),at(29,78),te(30,gye,2,0,"th",62)(31,Dye,3,2,"td",79),st(),at(32,80),te(33,Iye,2,0,"th",62)(34,Aye,3,2,"td",81),st(),at(35,82),te(36,kye,2,0,"th",62)(37,Fye,4,3,"td",83),st(),te(38,Hye,3,0,"ng-container",84)(39,jye,1,0,"tr",85)(40,$ye,1,0,"tr",86),x(),Re(41,"app-table-placeholder",87),w(42,"mat-paginator",88,2),we("page",function(){return fe(e),ge(X(2).onPageLicenseSet())}),x()()}if(2&t){const e=X(2);E(),N("dataSource",e.optionsSource),E(37),N("ngIf",e.userInfo&&e.userInfo.isMasterAdmin()),E(),N("matHeaderRowDef",e.columnsToDisplayOptions),E(),N("matRowDefColumns",e.columnsToDisplayOptions),E(),N("isLoading",e.isLoadingOptions)("dataSource",e.optionsSource),E(),N("hidden",e.optionsSource.filteredData.length<10)("length",e.optionsSource.filteredData.length)("pageSize",e.licenseSetPageSize)("pageSizeOptions",jn(11,ow))("showFirstLastButtons",!0)}}function qye(t,i){if(1&t&&(w(0,"div")(1,"mat-tab",35),te(2,Gye,44,12,"ng-template",36),x()()),2&t){const e=X();E(),N("label",e.MainTabs.CURRENT_FEATURES_TAB)}}function Wye(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function Zye(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Ct(n.applications.get(e.application))}}function Yye(t,i){1&t&&(w(0,"span"),M(1,"status.application"),x())}function Xye(t,i){if(1&t&&(w(0,"td",90),te(1,Zye,2,1,"span",34)(2,Yye,2,0,"span",34),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function Kye(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function Qye(t,i){1&t&&(w(0,"span"),M(1,"12.x"),x())}function Jye(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ct(e.version)}}function eve(t,i){1&t&&(w(0,"td",91),te(1,Qye,2,0,"span",92)(2,Jye,2,1,"span",93),x()),2&t&&(N("ngSwitch",i.$implicit.version),E(),N("ngSwitchCase","12.2"))}function tve(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function nve(t,i){if(1&t&&(w(0,"td",159),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.category),E(),Ct(n.getCategoryLabel(e.application,"standalone",e.category))}}function ive(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function ove(t,i){if(1&t&&(w(0,"td",160),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.sub_category),E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function rve(t,i){1&t&&(w(0,"th",89),M(1,"Options"),x())}function ave(t,i){if(1&t&&(w(0,"span",101),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" License ID:",e.id,":\xa0 ")}}function sve(t,i){if(1&t&&(w(0,"td",99),te(1,ave,2,1,"span",100),M(2),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.userInfo&&n.userInfo.isMasterDBUser()&&n.showLicenseID(e.application)),E(),Jt(" ",e.optionlist," ")}}function lve(t,i){1&t&&(w(0,"th",89),M(1,"Activated"),x())}function cve(t,i){if(1&t&&(w(0,"td",161),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.current)}}function dve(t,i){1&t&&(w(0,"th",89),M(1,"Purchased"),x())}function uve(t,i){if(1&t&&(w(0,"td",162),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.current+e.available)}}function hve(t,i){1&t&&(w(0,"th",89),M(1,"Subscription"),x())}function pve(t,i){1&t&&(w(0,"span")(1,"mat-icon",163),M(2,"remove"),x()())}function mve(t,i){1&t&&(w(0,"span")(1,"mat-icon",164),M(2,"event_busy"),x()()),2&t&&(E(),N("ngStyle",jn(1,iA)))}function fve(t,i){if(1&t&&(w(0,"span",110),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function _ve(t,i){if(1&t&&(w(0,"span",111),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function gve(t,i){if(1&t&&(w(0,"span",112)(1,"span",113),M(2),ti(3,"date"),x(),M(4," \xa0-\xa0 "),w(5,"span",114),M(6),ti(7,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Jt(" ",hi(3,2,e.sub_start+"Z","mediumDate")," "),E(4),Jt(" ",hi(7,5,e.sub_end+"Z","mediumDate")," ")}}function bve(t,i){if(1&t&&(w(0,"span",115)(1,"span",116),M(2),ti(3,"date"),ti(4,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Ea(" ",hi(3,2,e.sub_start+"Z","mediumDate")," - ",hi(4,5,e.sub_end+"Z","mediumDate")," ")}}function yve(t,i){if(1&t&&(w(0,"span"),te(1,fve,4,8,"span",106)(2,_ve,4,8,"span",107)(3,gve,8,8,"span",108)(4,bve,5,8,"span",109),x()),2&t){const e=X(2).$implicit;E(),N("ngIf",e.is_sub_delayed),E(),N("ngIf",!e.is_sub_delayed&&!e.is_sub_expired&&!e.is_sub_expiring),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expiring&&!e.is_sub_expired),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expired)}}function vve(t,i){if(1&t&&(w(0,"span"),te(1,mve,3,2,"span",34)(2,yve,5,4,"span",34),x()),2&t){const e=X().$implicit;E(),N("ngIf",""==e.sub_end),E(),N("ngIf",""!=e.sub_end)}}function xve(t,i){if(1&t&&(w(0,"td",103),te(1,pve,3,0,"span",34)(2,vve,3,2,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.is_subscription),E(),N("ngIf",e.is_subscription)}}function wve(t,i){if(1&t&&(w(0,"th",165),M(1),x()),2&t){const e=X(2);E(),Ct(e.userInfo&&e.userInfo.isAdmin2()?"Activation":"")}}function Cve(t,i){if(1&t){const e=pt();w(0,"td",167)(1,"button",168),we("click",function(){const o=fe(e).$implicit;return ge(X(3).addStandaloneLicense(o,o.is_subscription))}),w(2,"mat-icon",29),M(3,"add_task"),x()()()}if(2&t){const e=i.$implicit;E(),N("disabled",e.current>=e.max)}}function Sve(t,i){1&t&&(w(0,"span"),te(1,Cve,4,1,"td",166),x())}function Tve(t,i){1&t&&(w(0,"td",170),Re(1,"p"),x())}function Dve(t,i){1&t&&(w(0,"span"),te(1,Tve,2,0,"td",169),x())}function Ive(t,i){1&t&&Re(0,"tr",134)}function Eve(t,i){1&t&&Re(0,"tr",135)}function Mve(t,i){1&t&&(w(0,"th",89),M(1,"Computer Name"),x())}function Ave(t,i){if(1&t&&(w(0,"td",171),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.computername)}}function kve(t,i){1&t&&(w(0,"th",89),M(1,"Windows User"),x())}function Rve(t,i){if(1&t&&(w(0,"td",172),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.windows_user)}}function Ove(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function Pve(t,i){if(1&t&&(w(0,"td",173),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.version_string)}}function Lve(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function Fve(t,i){if(1&t&&(w(0,"td",159),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.category),E(),Ct(n.getCategoryLabel(e.application,"standalone",e.category))}}function Nve(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function zve(t,i){if(1&t&&(w(0,"td",160),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.sub_category),E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function Bve(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function Vve(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Ea("",n.applications.get(e.application)," ",n.getDisplayVersion(e.application,e.version),"")}}function Uve(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ea("",e.application," ",e.version,"")}}function Hve(t,i){if(1&t&&(w(0,"td",90),te(1,Vve,2,2,"span",34)(2,Uve,2,2,"span",34),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function jve(t,i){1&t&&(w(0,"th",89),M(1,"Options"),x())}function $ve(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function Gve(t,i){if(1&t&&(w(0,"span",101),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" License ID:",e.set_id,":\xa0 ")}}function qve(t,i){if(1&t&&(w(0,"span")(1,"p",98),te(2,Gve,2,1,"span",100),M(3),x()()),2&t){const e=X().$implicit,n=X(2);E(2),N("ngIf",n.userInfo&&n.userInfo.isMasterDBUser()&&n.showLicenseID(e.application)),E(),Jt(" ",e.optionlist," ")}}function Wve(t,i){if(1&t&&(w(0,"td",99),te(1,$ve,2,0,"span",34)(2,qve,4,2,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.optionlist||""==e.optionlist.trim()),E(),N("ngIf",e.optionlist&&""!=e.optionlist.trim())}}function Zve(t,i){1&t&&(w(0,"th",89),M(1,"Claimed"),x())}function Yve(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X().$implicit;E(),Ct(hi(2,1,e.last_renewed+"Z","medium"))}}function Xve(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X().$implicit;E(),Ct(hi(2,1,e.last_renewed,"mediumDate"))}}function Kve(t,i){1&t&&(w(0,"span"),M(1,"(never)"),x())}function Qve(t,i){if(1&t&&(w(0,"td",174),te(1,Yve,3,4,"span",34)(2,Xve,3,4,"span",34)(3,Kve,2,0,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.last_renewed&&!e.isusb),E(),N("ngIf",e.last_renewed&&e.isusb),E(),N("ngIf",!e.last_renewed)}}function Jve(t,i){1&t&&(w(0,"th",89)(1,"span"),M(2),x()()),2&t&&(E(2),Jt(" ","Notes"," "))}function e0e(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function t0e(t,i){if(1&t&&(w(0,"span",98),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" ",e.notes," ")}}function n0e(t,i){if(1&t&&(w(0,"td",97),te(1,e0e,2,0,"span",34)(2,t0e,2,1,"span",175),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.notes||""==e.notes.trim()),E(),N("ngIf",e.notes&&""!=e.notes.trim())}}function i0e(t,i){1&t&&(w(0,"th",89),M(1,"Code"),x())}function o0e(t,i){if(1&t&&(w(0,"td",176),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.activationcode)}}function r0e(t,i){1&t&&(w(0,"th",89),M(1," Subscription Status "),x())}function a0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",178),M(2,"remove"),x()())}function s0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",164),M(2,"event_busy"),x()()),2&t&&(E(),N("ngStyle",jn(1,iA)))}function l0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",179),M(2,"event_available"),x()()),2&t&&(E(),N("ngStyle",jn(1,Mbe)))}function c0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",180),M(2,"check_circle"),x()()),2&t&&(E(),N("ngStyle",jn(1,Abe)))}function d0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",181),M(2,"check_circle"),x()()),2&t&&(E(),N("ngStyle",jn(1,kbe)))}function u0e(t,i){1&t&&(w(0,"span")(1,"mat-icon",182),M(2,"error"),x()()),2&t&&(E(),N("ngStyle",jn(1,Rbe)))}function h0e(t,i){if(1&t&&(w(0,"span"),te(1,l0e,3,2,"span",34)(2,c0e,3,2,"span",34)(3,d0e,3,2,"span",34)(4,u0e,3,2,"span",34),x()),2&t){const e=X(2).$implicit;E(),N("ngIf",e.is_sub_delayed),E(),N("ngIf",!e.is_sub_delayed&&!e.is_sub_expired&&!e.is_sub_expiring),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expiring&&!e.is_sub_expired),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expired)}}function p0e(t,i){if(1&t&&(w(0,"span"),te(1,s0e,3,2,"span",34)(2,h0e,5,4,"span",34),x()),2&t){const e=X().$implicit;E(),N("ngIf",""==e.sub_end),E(),N("ngIf",""!=e.sub_end)}}function m0e(t,i){if(1&t&&(w(0,"td",177),te(1,a0e,3,0,"span",34)(2,p0e,3,2,"span",34),x()),2&t){const e=i.$implicit;N("ngSwitch",e.application),E(),N("ngIf",!e.is_subscription),E(),N("ngIf",e.is_subscription)}}function f0e(t,i){1&t&&(w(0,"th",165),M(1,"Actions"),x())}function _0e(t,i){if(1&t){const e=pt();at(0),w(1,"button",183),we("click",function(){fe(e);const o=X().$implicit;return ge(X(2).revoke(o))}),w(2,"mat-icon",29),M(3,"cancel"),x()(),st()}if(2&t){const e=X().$implicit;E(),N("disabled",!e.last_renewed||e.isusb)}}function g0e(t,i){if(1&t){const e=pt();at(0),w(1,"button",184),we("click",function(){fe(e);const o=X(2).$implicit;return ge(X(2).revoke(o))}),w(2,"mat-icon",29),M(3,"cancel"),x()(),st()}}function b0e(t,i){if(1&t){const e=pt();at(0),w(1,"button",185),we("click",function(){fe(e);const o=X(2).$implicit;return ge(X(2).revoke(o))}),w(2,"mat-icon",29),M(3,"delete"),x()(),st()}}function y0e(t,i){if(1&t){const e=pt();at(0),w(1,"button",186),we("click",function(){fe(e);const o=X(2).$implicit;return ge(X(2).editStandaloneLicense(o))}),w(2,"mat-icon",29),M(3,"edit"),x()(),st()}}function v0e(t,i){if(1&t&&(at(0),te(1,g0e,4,0,"ng-container",34)(2,b0e,4,0,"ng-container",34)(3,y0e,4,0,"ng-container",34),st()),2&t){const e=X().$implicit,n=X(2);E(),N("ngIf",e.last_renewed&&!e.isusb),E(),N("ngIf",!e.last_renewed||e.isusb),E(),N("ngIf",n.userInfo&&n.userInfo.isAdmin2())}}function x0e(t,i){if(1&t&&(w(0,"td",130),te(1,_0e,4,1,"ng-container",34)(2,v0e,4,3,"ng-container",34),x()),2&t){const e=X(2);E(),N("ngIf",!e.userInfo||!e.userInfo.isAdmin2()),E(),N("ngIf",e.userInfo&&e.userInfo.isAdmin2())}}function w0e(t,i){1&t&&Re(0,"tr",134)}function C0e(t,i){1&t&&Re(0,"tr",135)}function S0e(t,i){if(1&t){const e=pt();w(0,"mat-tab-group",33),we("selectedTabChange",function(o){return fe(e),ge(X().onStandaloneTabChange(o))}),w(1,"mat-tab",35)(2,"div",58)(3,"table",136,3)(5,"caption",60),M(6," License Availability "),x(),at(7,61),te(8,Wye,2,0,"th",62)(9,Xye,3,2,"td",63),st(),at(10,64),te(11,Kye,2,0,"th",62)(12,eve,3,2,"td",65),st(),at(13,68),te(14,tve,2,0,"th",62)(15,nve,2,2,"td",137),st(),at(16,70),te(17,ive,2,0,"th",62)(18,ove,2,2,"td",138),st(),at(19,74),te(20,rve,2,0,"th",62)(21,sve,3,2,"td",75),st(),at(22,139),te(23,lve,2,0,"th",62)(24,cve,2,1,"td",140),st(),at(25,141),te(26,dve,2,0,"th",62)(27,uve,2,1,"td",142),st(),at(28,78),te(29,hve,2,0,"th",62)(30,xve,3,2,"td",79),st(),at(31,143),te(32,wve,2,1,"th",144)(33,Sve,2,0,"span",34)(34,Dve,2,0,"span",34),st(),te(35,Ive,1,0,"tr",85)(36,Eve,1,0,"tr",86),x()(),Re(37,"app-table-placeholder",145),w(38,"mat-paginator",88,4),we("page",function(){return fe(e),ge(X().onPageStandaloneStatus())}),x()(),w(40,"mat-tab",35)(41,"div",58)(42,"table",136,5)(44,"caption",60),M(45," Activated Licenses "),x(),at(46,146),te(47,Mve,2,0,"th",62)(48,Ave,2,1,"td",147),st(),at(49,148),te(50,kve,2,0,"th",62)(51,Rve,2,1,"td",149),st(),at(52,150),te(53,Ove,2,0,"th",62)(54,Pve,2,1,"td",151),st(),at(55,68),te(56,Lve,2,0,"th",62)(57,Fve,2,2,"td",137),st(),at(58,70),te(59,Nve,2,0,"th",62)(60,zve,2,2,"td",138),st(),at(61,61),te(62,Bve,2,0,"th",62)(63,Hve,3,2,"td",63),st(),at(64,74),te(65,jve,2,0,"th",62)(66,Wve,3,2,"td",75),st(),at(67,152),te(68,Zve,2,0,"th",62)(69,Qve,4,3,"td",153),st(),at(70,72),te(71,Jve,3,1,"th",62)(72,n0e,3,2,"td",73),st(),at(73,154),te(74,i0e,2,0,"th",62)(75,o0e,2,1,"td",155),st(),at(76,156),te(77,r0e,2,0,"th",62)(78,m0e,3,3,"td",157),st(),at(79,126),te(80,f0e,2,0,"th",144)(81,x0e,3,2,"td",128),st(),te(82,w0e,1,0,"tr",85)(83,C0e,1,0,"tr",86),x()(),Re(84,"app-table-placeholder",158),w(85,"mat-paginator",88,6),we("page",function(){return fe(e),ge(X().onPageStandalone())}),x()()()}if(2&t){const e=X();N("selectedIndex",e.standaloneTabIndex),E(),N("label",e.SubTabs.AVAILABILITY_TAB),E(2),N("dataSource",e.standalonelicensestatus),E(30),N("ngIf",e.userInfo&&e.userInfo.isAdmin2()),E(),N("ngIf",!e.userInfo||!e.userInfo.isAdmin2()),E(),N("matHeaderRowDef",e.columnsToDisplayStandaloneStatus),E(),N("matRowDefColumns",e.columnsToDisplayStandaloneStatus),E(),N("isLoading",e.isLoadingStandaloneStatus)("dataSource",e.standalonelicensestatus),E(),N("hidden",e.standalonelicensestatus.filteredData.length<10)("length",e.standalonelicensestatus.filteredData.length)("pageSize",e.standaloneStatusPageSize)("pageSizeOptions",jn(25,ow))("showFirstLastButtons",!0),E(2),N("label",e.SubTabs.ACTIVE_TAB),E(2),N("dataSource",e.standaloneSource),E(40),N("matHeaderRowDef",e.columnsToDisplayStandalone),E(),N("matRowDefColumns",e.columnsToDisplayStandalone),E(),N("isLoading",e.isLoadingStandaloneActive)("dataSource",e.standaloneSource),E(),N("hidden",e.standaloneSource.filteredData.length<10)("length",e.standaloneSource.filteredData.length)("pageSize",e.standalonePageSize)("pageSizeOptions",jn(26,ow))("showFirstLastButtons",!0)}}function T0e(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function D0e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(3);E(),Ea("",n.applications.get(e.application)," ",n.getDisplayVersion(e.application,e.version),"")}}function I0e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ea("",e.application," ",e.version,"")}}function E0e(t,i){if(1&t&&(w(0,"td",90),te(1,D0e,2,2,"span",34)(2,I0e,2,2,"span",34),x()),2&t){const e=i.$implicit,n=X(3);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function M0e(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function A0e(t,i){1&t&&(w(0,"span"),M(1,"12.x"),x())}function k0e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ct(e.version)}}function R0e(t,i){1&t&&(w(0,"td",91),te(1,A0e,2,0,"span",92)(2,k0e,2,1,"span",93),x()),2&t&&(N("ngSwitch",i.$implicit.version),E(),N("ngSwitchCase","12.2"))}function O0e(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function P0e(t,i){if(1&t&&(w(0,"td",159),M(1),x()),2&t){const e=i.$implicit,n=X(3);N("ngSwitch",e.category),E(),Ct(n.getCategoryLabel(e.application,"ondemand",e.category))}}function L0e(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function F0e(t,i){if(1&t&&(w(0,"td",160),M(1),x()),2&t){const e=i.$implicit,n=X(3);N("ngSwitch",e.sub_category),E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function N0e(t,i){1&t&&(w(0,"th",89),M(1,"License Count"),x())}function z0e(t,i){if(1&t&&(w(0,"td",209),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.limit)}}function B0e(t,i){1&t&&(w(0,"th",89),M(1,"Computer ID"),x())}function V0e(t,i){if(1&t&&(w(0,"td",210),M(1),x()),2&t){const e=i.$implicit;E(),Ct(null==e.computer_id?"(none)":e.computer_id)}}function U0e(t,i){1&t&&(w(0,"th",89),M(1,"License Key"),x())}function H0e(t,i){if(1&t&&(w(0,"td",211),M(1),x()),2&t){const e=i.$implicit;E(),Ct(null==e.license_key?"(none)":e.license_key)}}function j0e(t,i){if(1&t&&(w(0,"th",165),M(1),x()),2&t){const e=X(3);E(),Ct(e.userInfo&&e.userInfo.isAdmin2()?"Action":"")}}function $0e(t,i){1&t&&(at(0),Re(1,"p"),st())}function G0e(t,i){if(1&t){const e=pt();at(0),w(1,"button",213),we("click",function(){fe(e);const o=X().$implicit;return ge(X(3).onClaimPrivateLicense(o.id,o.computer_id,o.license_key))}),w(2,"mat-icon",29),M(3),x()(),st()}if(2&t){const e=X().$implicit;E(),ys("matTooltip",null==e.license_key?"Claim License":"Edit License"),E(2),Ct(null==e.license_key?"add_task":"edit")}}function q0e(t,i){if(1&t&&(w(0,"td",212),te(1,$0e,2,0,"ng-container",34)(2,G0e,4,2,"ng-container",34),x()),2&t){const e=X(3);E(),N("ngIf",!e.userInfo||!e.userInfo.isAdmin2()),E(),N("ngIf",e.userInfo&&e.userInfo.isAdmin2())}}function W0e(t,i){1&t&&Re(0,"tr",134)}function Z0e(t,i){1&t&&Re(0,"tr",135)}function Y0e(t,i){if(1&t){const e=pt();w(0,"div")(1,"div",58)(2,"table",187,11)(4,"caption",60),M(5," Private License Server "),x(),at(6,61),te(7,T0e,2,0,"th",62)(8,E0e,3,2,"td",63),st(),at(9,64),te(10,M0e,2,0,"th",62)(11,R0e,3,2,"td",65),st(),at(12,68),te(13,O0e,2,0,"th",62)(14,P0e,2,2,"td",137),st(),at(15,70),te(16,L0e,2,0,"th",62)(17,F0e,2,2,"td",138),st(),at(18,80),te(19,N0e,2,0,"th",62)(20,z0e,2,1,"td",201),st(),at(21,202),te(22,B0e,2,0,"th",62)(23,V0e,2,1,"td",203),st(),at(24,204),te(25,U0e,2,0,"th",62)(26,H0e,2,1,"td",205),st(),at(27,206),te(28,j0e,2,1,"th",144)(29,q0e,3,2,"td",207),st(),te(30,W0e,1,0,"tr",85)(31,Z0e,1,0,"tr",86),x()(),Re(32,"app-table-placeholder",208),w(33,"mat-paginator",88,12),we("page",function(){return fe(e),ge(X(2).onPageOnDemandStatus())}),x()()}if(2&t){const e=X(2);E(2),N("dataSource",e.ondemandprivatelicenses),E(28),N("matHeaderRowDef",e.columnsToDisplayOnDemandPrivate),E(),N("matRowDefColumns",e.columnsToDisplayOnDemandPrivate),E(),N("isLoading",e.isLoadingOnDemandStatus)("dataSource",e.ondemandprivatelicenses),E(),N("hidden",e.ondemandprivatelicenses.filteredData.length<10)("length",e.ondemandprivatelicenses.filteredData.length)("pageSize",e.ondemandPrivatePageSize)("pageSizeOptions",jn(10,ow))("showFirstLastButtons",!0)}}function X0e(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function K0e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Ct(n.applications.get(e.application))}}function Q0e(t,i){1&t&&(w(0,"span"),M(1,"status.application"),x())}function J0e(t,i){if(1&t&&(w(0,"td",90),te(1,K0e,2,1,"span",34)(2,Q0e,2,0,"span",34),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function e1e(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function t1e(t,i){1&t&&(w(0,"span"),M(1,"12.x"),x())}function n1e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ct(e.version)}}function i1e(t,i){1&t&&(w(0,"td",91),te(1,t1e,2,0,"span",92)(2,n1e,2,1,"span",93),x()),2&t&&(N("ngSwitch",i.$implicit.version),E(),N("ngSwitchCase","12.2"))}function o1e(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function r1e(t,i){if(1&t&&(w(0,"td",159),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.category),E(),Ct(n.getCategoryLabel(e.application,"ondemand",e.category))}}function a1e(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function s1e(t,i){if(1&t&&(w(0,"td",160),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.sub_category),E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function l1e(t,i){1&t&&(w(0,"th",89),M(1,"In Use"),x())}function c1e(t,i){if(1&t&&(w(0,"td",214),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.current)}}function d1e(t,i){1&t&&(w(0,"th",89),M(1,"Available"),x())}function u1e(t,i){if(1&t&&(w(0,"td",215),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.available)}}function h1e(t,i){1&t&&(w(0,"th",89),M(1,"Subscription"),x())}function p1e(t,i){1&t&&(w(0,"span")(1,"mat-icon",104),M(2,"remove"),x()())}function m1e(t,i){1&t&&(w(0,"span")(1,"mat-icon",105),M(2,"event_busy"),x()()),2&t&&(E(),N("ngStyle",jn(1,iA)))}function f1e(t,i){if(1&t&&(w(0,"span",110),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function _1e(t,i){if(1&t&&(w(0,"span",111),M(1),ti(2,"date"),ti(3,"date"),x()),2&t){const e=X(3).$implicit;E(),Ea(" ",hi(2,2,e.sub_start+"Z","mediumDate")," - ",hi(3,5,e.sub_end+"Z","mediumDate")," ")}}function g1e(t,i){if(1&t&&(w(0,"span",112)(1,"span",113),M(2),ti(3,"date"),x(),M(4," \xa0-\xa0 "),w(5,"span",114),M(6),ti(7,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Jt(" ",hi(3,2,e.sub_start+"Z","mediumDate")," "),E(4),Jt(" ",hi(7,5,e.sub_end+"Z","mediumDate")," ")}}function b1e(t,i){if(1&t&&(w(0,"span",115)(1,"span",116),M(2),ti(3,"date"),ti(4,"date"),x()()),2&t){const e=X(3).$implicit;E(2),Ea(" ",hi(3,2,e.sub_start+"Z","mediumDate")," - ",hi(4,5,e.sub_end+"Z","mediumDate")," ")}}function y1e(t,i){if(1&t&&(w(0,"span"),te(1,f1e,4,8,"span",106)(2,_1e,4,8,"span",107)(3,g1e,8,8,"span",108)(4,b1e,5,8,"span",109),x()),2&t){const e=X(2).$implicit;E(),N("ngIf",e.is_sub_delayed),E(),N("ngIf",!e.is_sub_delayed&&!e.is_sub_expired&&!e.is_sub_expiring),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expiring&&!e.is_sub_expired),E(),N("ngIf",!e.is_sub_delayed&&e.is_sub_expired)}}function v1e(t,i){if(1&t&&(w(0,"span"),te(1,m1e,3,2,"span",34)(2,y1e,5,4,"span",34),x()),2&t){const e=X().$implicit;E(),N("ngIf",""==e.sub_end),E(),N("ngIf",""!=e.sub_end)}}function x1e(t,i){if(1&t&&(w(0,"td",103),te(1,p1e,3,0,"span",34)(2,v1e,3,2,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.is_subscription),E(),N("ngIf",e.is_subscription)}}function w1e(t,i){1&t&&(w(0,"th",89),M(1,"Expiration"),x())}function C1e(t,i){if(1&t&&(w(0,"td",216),M(1),x()),2&t){const e=i.$implicit;E(),Jt("",e.duration/3600," hours")}}function S1e(t,i){1&t&&(w(0,"th",165),M(1,"Set Duration"),x())}function T1e(t,i){if(1&t){const e=pt();w(0,"td",217)(1,"button",218),we("click",function(){const o=fe(e).$implicit;return ge(X(2).onEditDuration(o))}),w(2,"mat-icon",29),M(3,"timer"),x()()()}}function D1e(t,i){1&t&&Re(0,"tr",134)}function I1e(t,i){1&t&&Re(0,"tr",135)}function E1e(t,i){1&t&&(w(0,"th",89),M(1,"Computer Name"),x())}function M1e(t,i){if(1&t&&(w(0,"td",171),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.computername)}}function A1e(t,i){1&t&&(w(0,"th",89),M(1,"User"),x())}function k1e(t,i){if(1&t&&(w(0,"td",219),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.username)}}function R1e(t,i){1&t&&(w(0,"th",89),M(1,"Windows User"),x())}function O1e(t,i){if(1&t&&(w(0,"td",172),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.windows_user)}}function P1e(t,i){1&t&&(w(0,"th",89),M(1,"Version"),x())}function L1e(t,i){if(1&t&&(w(0,"td",173),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.version_string)}}function F1e(t,i){1&t&&(w(0,"th",89),M(1,"Category"),x())}function N1e(t,i){if(1&t&&(w(0,"td",159),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.category),E(),Ct(n.getCategoryLabel(e.application,"ondemand",e.category))}}function z1e(t,i){1&t&&(w(0,"th",89),M(1,"Sub Category"),x())}function B1e(t,i){if(1&t&&(w(0,"td",160),M(1),x()),2&t){const e=i.$implicit,n=X(2);N("ngSwitch",e.sub_category),E(),Ct(n.getSubCategoryLabel(e.category,e.sub_category))}}function V1e(t,i){1&t&&(w(0,"th",89),M(1,"Application"),x())}function U1e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit,n=X(2);E(),Ea("",n.applications.get(e.application)," ",n.getDisplayVersion(e.application,e.version),"")}}function H1e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Ea("",e.application," ",e.version,"")}}function j1e(t,i){if(1&t&&(w(0,"td",90),te(1,U1e,2,2,"span",34)(2,H1e,2,2,"span",34),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.applications.has(e.application)),E(),N("ngIf",!n.applications.has(e.application))}}function $1e(t,i){1&t&&(w(0,"th",89),M(1,"Options"),x())}function G1e(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function q1e(t,i){if(1&t&&(w(0,"span")(1,"p",98),M(2),x()()),2&t){const e=X().$implicit;E(2),Jt(" ",e.optionlist," ")}}function W1e(t,i){if(1&t&&(w(0,"td",99),te(1,G1e,2,0,"span",34)(2,q1e,3,1,"span",34),x()),2&t){const e=i.$implicit;E(),N("ngIf",!e.optionlist||""==e.optionlist.trim()),E(),N("ngIf",e.optionlist&&""!=e.optionlist.trim())}}function Z1e(t,i){1&t&&(w(0,"th",89),M(1,"Expires"),x())}function Y1e(t,i){if(1&t&&(w(0,"td",220),M(1),ti(2,"date"),x()),2&t){const e=i.$implicit;E(),Ct(hi(2,1,e.expires+"Z","medium"))}}function X1e(t,i){1&t&&(w(0,"th",165),M(1,"Release"),x())}function K1e(t,i){if(1&t){const e=pt();w(0,"td",221)(1,"button",222),we("click",function(){const o=fe(e).$implicit;return ge(X(2).release(o.id))}),w(2,"mat-icon",29),M(3,"cancel"),x()()()}}function Q1e(t,i){1&t&&Re(0,"tr",134)}function J1e(t,i){1&t&&Re(0,"tr",135)}function exe(t,i){if(1&t){const e=pt();w(0,"mat-tab-group",33),we("selectedTabChange",function(o){return fe(e),ge(X().onDemandTabChange(o))}),w(1,"mat-tab",35),te(2,Y0e,35,11,"div",34),w(3,"div",58)(4,"table",187,7)(6,"caption",60),M(7," License Availability "),x(),at(8,61),te(9,X0e,2,0,"th",62)(10,J0e,3,2,"td",63),st(),at(11,64),te(12,e1e,2,0,"th",62)(13,i1e,3,2,"td",65),st(),at(14,68),te(15,o1e,2,0,"th",62)(16,r1e,2,2,"td",137),st(),at(17,70),te(18,a1e,2,0,"th",62)(19,s1e,2,2,"td",138),st(),at(20,139),te(21,l1e,2,0,"th",62)(22,c1e,2,1,"td",188),st(),at(23,141),te(24,d1e,2,0,"th",62)(25,u1e,2,1,"td",189),st(),at(26,78),te(27,h1e,2,0,"th",62)(28,x1e,3,2,"td",79),st(),at(29,190),te(30,w1e,2,0,"th",62)(31,C1e,2,1,"td",191),st(),at(32,192),te(33,S1e,2,0,"th",144)(34,T1e,4,0,"td",193),st(),te(35,D1e,1,0,"tr",85)(36,I1e,1,0,"tr",86),x()(),Re(37,"app-table-placeholder",194),w(38,"mat-paginator",88,8),we("page",function(){return fe(e),ge(X().onPageOnDemandStatus())}),x()(),w(40,"mat-tab",35)(41,"div",58)(42,"table",187,9)(44,"caption",60),M(45," Licenses In Use "),x(),at(46,146),te(47,E1e,2,0,"th",62)(48,M1e,2,1,"td",147),st(),at(49,195),te(50,A1e,2,0,"th",62)(51,k1e,2,1,"td",196),st(),at(52,148),te(53,R1e,2,0,"th",62)(54,O1e,2,1,"td",149),st(),at(55,150),te(56,P1e,2,0,"th",62)(57,L1e,2,1,"td",151),st(),at(58,68),te(59,F1e,2,0,"th",62)(60,N1e,2,2,"td",137),st(),at(61,70),te(62,z1e,2,0,"th",62)(63,B1e,2,2,"td",138),st(),at(64,61),te(65,V1e,2,0,"th",62)(66,j1e,3,2,"td",63),st(),at(67,74),te(68,$1e,2,0,"th",62)(69,W1e,3,2,"td",75),st(),at(70,197),te(71,Z1e,2,0,"th",62)(72,Y1e,3,4,"td",198),st(),at(73,199),te(74,X1e,2,0,"th",144)(75,K1e,4,0,"td",200),st(),te(76,Q1e,1,0,"tr",85)(77,J1e,1,0,"tr",86),x()(),Re(78,"app-table-placeholder",194),w(79,"mat-paginator",88,10),we("page",function(){return fe(e),ge(X().onPageOnDemand())}),x()()()}if(2&t){const e=X();N("selectedIndex",e.ondemandTabIndex),E(),N("label",e.SubTabs.AVAILABILITY_TAB),E(),N("ngIf",e.ondemandprivatelicenses.data.length>0),E(2),N("dataSource",e.ondemandlicensestatus),E(31),N("matHeaderRowDef",e.columnsToDisplayOnDemandStatus),E(),N("matRowDefColumns",e.columnsToDisplayOnDemandStatus),E(),N("isLoading",e.isLoadingOnDemandStatus)("dataSource",e.ondemandlicensestatus),E(),N("hidden",e.ondemandlicensestatus.filteredData.length<10)("length",e.ondemandlicensestatus.filteredData.length)("pageSize",e.ondemandStatusPageSize)("pageSizeOptions",jn(24,ow))("showFirstLastButtons",!0),E(2),N("label",e.SubTabs.ACTIVE_TAB),E(2),N("dataSource",e.ondemandlicenses),E(34),N("matHeaderRowDef",e.columnsToDisplayOnDemand),E(),N("matRowDefColumns",e.columnsToDisplayOnDemand),E(),N("isLoading",e.isLoadingOnDemandActive)("dataSource",e.ondemandlicenses),E(),N("hidden",e.ondemandlicenses.filteredData.length<10)("length",e.ondemandlicenses.filteredData.length)("pageSize",e.ondemandPageSize)("pageSizeOptions",jn(25,ow))("showFirstLastButtons",!0)}}const txe=li_backendURL+"/ondemandlicense";var rs=function(t){return t.CURRENT_FEATURES_TAB="CURRENT FEATURES",t.STANDALONE_TAB="STANDALONE",t.ONDEMAND_TAB="ON-DEMAND",t}(rs||{}),Kd=function(t){return t.AVAILABILITY_TAB="Availability",t.ACTIVE_TAB="Activated",t}(Kd||{});let b7=(()=>{class t{http;loginService;licenseService;route;dialog;optionsSource=new Fr([]);standaloneSource=new Fr([]);ondemandlicenses=new Fr([]);ondemandprivatelicenses=new Fr([]);standalonelicensestatus=new Fr([]);ondemandlicensestatus=new Fr([]);isLoadingOptions=!1;isLoadingStandaloneStatus=!1;isLoadingStandaloneActive=!1;isLoadingOnDemandStatus=!1;isLoadingOnDemandActive=!1;tabGroups;LicenseSetPaginator;StandaloneStatusPaginator;StandalonePaginator;OnDemandStatusPaginator;OnDemandPrivatePaginator;OnDemandPaginator;optionSort;standaloneStatusSort;standaloneActiveSort;ondemandStatusSort;ondemandClaimedSort;ondemandPrivateSort;MainTabs=rs;SubTabs=Kd;mainTabID;standaloneTabID;ondemandTabID;mainTabIndex=0;standaloneTabIndex=0;ondemandTabIndex=0;currentOrg;currentOrgDisplayName;currentOrgUUID;currentOrgEnabled;licenseSetPageSize=10;standaloneStatusPageSize=10;standalonePageSize=10;ondemandStatusPageSize=10;ondemandPrivatePageSize=10;ondemandPageSize=10;currentOnDemand;totalOnDemand;onDemandDuration;userInfo=null;columnsToDisplayOptions=["application","version","license_type","category","sub_category","notes","optionlist","local_license","is_subscription","limit","po_list","actions"];columnsToDisplayOptionsPriv=["application","version","license_type","category","sub_category","notes","optionlist","local_license","is_subscription","limit","po_list"];columnsToDisplayStandaloneStatus=["application","version","category","sub_category","optionlist","current","available","is_subscription","activate"];columnsToDisplayStandalone=["computername","windows_user","version_string","category","sub_category","application","optionlist","last_renewed","notes","activationcode","subscription_status","actions"];columnsToDisplayOnDemandStatus=["application","version","category","sub_category","current","available","is_subscription","expiration","change"];columnsToDisplayOnDemand=["computername","username","windows_user","version_string","category","sub_category","application","optionlist","expires","release"];columnsToDisplayOnDemandPrivate=["application","version","category","sub_category","limit","computer_id","license_key","claim"];applications=new Map(Wx);license_versions_filter=new Lj(!0);claimedFilter=new po;appFilter=new po;versionFilter=new po;subFilter=new po;noteFilter=new po;filteredValues={claimed:"",app:"",version:"",sub_status:"",notes:""};constructor(e,n,o,r,u){this.http=e,this.loginService=n,this.licenseService=o,this.route=r,this.dialog=u}ngOnInit(){this.initFilters(),this.loginService.userInfo$.subscribe(I=>{this.userInfo=I}),this.loginService.updateNavigatedOrg(this.route),this.userInfo.isMasterAdmin()||(this.columnsToDisplayOptions=this.columnsToDisplayOptionsPriv);let e=localStorage.getItem("licenseSetPageSize");(""==e||null==e)&&(e="10");let n=localStorage.getItem("standaloneStatusPageSize");(""==n||null==n)&&(n="10");let o=localStorage.getItem("standalonePageSize");(""==o||null==o)&&(o="10");let r=localStorage.getItem("ondemandStatusPageSize");(""==r||null==r)&&(r="10");let u=localStorage.getItem("ondemandPrivatePageSize");(""==u||null==u)&&(u="10");let y=localStorage.getItem("ondemandPageSize");(""==y||null==y)&&(y="10"),this.licenseSetPageSize=parseInt(e),this.standaloneStatusPageSize=parseInt(n),this.standalonePageSize=parseInt(o),this.ondemandStatusPageSize=parseInt(r),this.ondemandPrivatePageSize=parseInt(u),this.ondemandPageSize=parseInt(y),this.initTabs(),this.loadCurrentTabData()}initTabs(){let e="";e=localStorage.getItem("licenseTabSelection"),this.userInfo.isMasterDBUser()?Object.values(rs).includes(e)||(e=rs.CURRENT_FEATURES_TAB):(!Object.values(rs).includes(e)||e==rs.CURRENT_FEATURES_TAB)&&(e=rs.STANDALONE_TAB),this.mainTabID=e,e=localStorage.getItem("standaloneTabSelection"),Object.values(Kd).includes(e)||(e=Kd.ACTIVE_TAB),this.standaloneTabID=e,e=localStorage.getItem("ondemandTabSelection"),Object.values(Kd).includes(e)||(e=Kd.ACTIVE_TAB),this.ondemandTabID=e,this.loginService.userInfo$.subscribe(o=>{this.userInfo=o}),this.currentOrg=this.loginService.getOrg(this.route),this.http.get(li_backendURL+"/organization/info/"+this.currentOrg,{withCredentials:!0,observe:"response"}).subscribe(o=>{let r=o.body;this.currentOrgEnabled=r.enabled,this.currentOrgDisplayName=r.friendly_name,this.currentOrgUUID=r.uuid}),this.initTabIndexes()}initTabIndexes(){this.userInfo.isMasterDBUser()?(this.mainTabIndex=[rs.CURRENT_FEATURES_TAB,rs.STANDALONE_TAB,rs.ONDEMAND_TAB].findIndex(o=>o===this.mainTabID),this.mainTabIndex<0&&(this.mainTabIndex=0)):this.mainTabIndex=[rs.STANDALONE_TAB,rs.ONDEMAND_TAB].findIndex(o=>o===this.mainTabID);let e=[Kd.AVAILABILITY_TAB,Kd.ACTIVE_TAB];this.standaloneTabIndex=e.findIndex(n=>n===this.standaloneTabID),this.standaloneTabIndex<0&&(this.standaloneTabIndex=0),this.ondemandTabIndex=e.findIndex(n=>n===this.ondemandTabID),this.ondemandTabIndex<0&&(this.ondemandTabIndex=0)}initFilters(){this.initCurrentFeatureFilters(),this.initStandaloneAvailabilityFilters(),this.initStandaloneActivatedFilters(),this.initOnDemandAvailabilityFilters(),this.initOnDemandActiveFilters(),this.LoadFilters()}LoadFilters(){this.claimedFilter.setValue($i.LoadLocalStorageSetting("licenseClaimedFilter","null")),this.appFilter.setValue($i.LoadLocalStorageSetting("licenseAppFilter","All")),this.versionFilter.setValue($i.LoadLocalStorageSetting("licenseVersionFilter","All")),this.subFilter.setValue($i.LoadLocalStorageSetting("licenseSubFilter","null")),this.noteFilter.setValue($i.LoadLocalStorageSetting("licenseNoteFilter"))}SaveFilters(){$i.SaveLocalStorageSetting("licenseClaimedFilter",this.claimedFilter.value),$i.SaveLocalStorageSetting("licenseAppFilter",this.appFilter.value),$i.SaveLocalStorageSetting("licenseVersionFilter",this.versionFilter.value),$i.SaveLocalStorageSetting("licenseSubFilter",this.subFilter.value),$i.SaveLocalStorageSetting("licenseNoteFilter",this.noteFilter.value)}ClearFilters(){this.claimedFilter.setValue("null"),this.appFilter.setValue("All"),this.versionFilter.setValue("All"),this.subFilter.setValue("null"),this.noteFilter.setValue(""),this.SaveFilters()}ClearFilter(e,n=""){e.setValue(n),this.SaveFilters()}showActivatedFilter(){return this.mainTabID==rs.STANDALONE_TAB&&this.standaloneTabID==Kd.ACTIVE_TAB}showSubscriptionFilter(){return this.mainTabID==rs.CURRENT_FEATURES_TAB||this.mainTabID==rs.STANDALONE_TAB||this.mainTabID==rs.ONDEMAND_TAB&&this.ondemandTabID!=Kd.ACTIVE_TAB}showNotesFilter(){return this.mainTabID==rs.CURRENT_FEATURES_TAB||this.mainTabID==rs.STANDALONE_TAB&&this.standaloneTabID==Kd.ACTIVE_TAB}showRefreshButton(){return this.mainTabID==rs.STANDALONE_TAB&&this.standaloneTabID==Kd.ACTIVE_TAB||this.mainTabID==rs.ONDEMAND_TAB&&this.ondemandTabID==Kd.ACTIVE_TAB}showAddLicenseSetButton(){return this.mainTabID==rs.CURRENT_FEATURES_TAB}showSendNotificationButton(){return this.mainTabID==rs.CURRENT_FEATURES_TAB}initCurrentFeatureFilters(){this.appFilter.valueChanges.subscribe(e=>{this.filteredValues.app=e,this.optionsSource.filter=JSON.stringify(this.filteredValues)}),this.versionFilter.valueChanges.subscribe(e=>{this.filteredValues.version=e,this.optionsSource.filter=JSON.stringify(this.filteredValues)}),this.subFilter.valueChanges.subscribe(e=>{this.filteredValues.sub_status=e,this.optionsSource.filter=JSON.stringify(this.filteredValues)}),this.noteFilter.valueChanges.subscribe(e=>{this.filteredValues.notes=e,this.optionsSource.filter=JSON.stringify(this.filteredValues)}),this.optionsSource.filterPredicate=this.currentFeaturesFilterPredicate()}initStandaloneAvailabilityFilters(){this.appFilter.valueChanges.subscribe(e=>{this.filteredValues.app=e,this.standalonelicensestatus.filter=JSON.stringify(this.filteredValues)}),this.versionFilter.valueChanges.subscribe(e=>{this.filteredValues.version=e,this.standalonelicensestatus.filter=JSON.stringify(this.filteredValues)}),this.subFilter.valueChanges.subscribe(e=>{this.filteredValues.sub_status=e,this.standalonelicensestatus.filter=JSON.stringify(this.filteredValues)}),this.standalonelicensestatus.filterPredicate=this.standaloneAvailableFilterPredicate()}initStandaloneActivatedFilters(){this.claimedFilter.valueChanges.subscribe(e=>{this.filteredValues.claimed=e,this.standaloneSource.filter=JSON.stringify(this.filteredValues)}),this.appFilter.valueChanges.subscribe(e=>{this.filteredValues.app=e,this.standaloneSource.filter=JSON.stringify(this.filteredValues)}),this.versionFilter.valueChanges.subscribe(e=>{this.filteredValues.version=e,this.standaloneSource.filter=JSON.stringify(this.filteredValues)}),this.subFilter.valueChanges.subscribe(e=>{this.filteredValues.sub_status=e,this.standaloneSource.filter=JSON.stringify(this.filteredValues)}),this.noteFilter.valueChanges.subscribe(e=>{this.filteredValues.notes=e,this.standaloneSource.filter=JSON.stringify(this.filteredValues)}),this.standaloneSource.filterPredicate=this.standaloneActivatedFilterPredicate()}initOnDemandAvailabilityFilters(){this.appFilter.valueChanges.subscribe(e=>{this.filteredValues.app=e,this.ondemandprivatelicenses.filter=JSON.stringify(this.filteredValues),this.ondemandlicensestatus.filter=JSON.stringify(this.filteredValues)}),this.versionFilter.valueChanges.subscribe(e=>{this.filteredValues.version=e,this.ondemandprivatelicenses.filter=JSON.stringify(this.filteredValues),this.ondemandlicensestatus.filter=JSON.stringify(this.filteredValues)}),this.subFilter.valueChanges.subscribe(e=>{this.filteredValues.sub_status=e,this.ondemandprivatelicenses.filter=JSON.stringify(this.filteredValues),this.ondemandlicensestatus.filter=JSON.stringify(this.filteredValues)}),this.ondemandprivatelicenses.filterPredicate=this.ondemandAvailableFilterPredicate(),this.ondemandlicensestatus.filterPredicate=this.ondemandAvailableFilterPredicate()}initOnDemandActiveFilters(){this.appFilter.valueChanges.subscribe(e=>{this.filteredValues.app=e,this.ondemandlicenses.filter=JSON.stringify(this.filteredValues)}),this.versionFilter.valueChanges.subscribe(e=>{this.filteredValues.version=e,this.ondemandlicenses.filter=JSON.stringify(this.filteredValues)}),this.ondemandlicenses.filterPredicate=this.ondemandAvailableFilterPredicate()}onPageLicenseSet(){this.licenseSetPageSize=this.LicenseSetPaginator.pageSize;let e=this.licenseSetPageSize.toString();localStorage.setItem("licenseSetPageSize",e)}onPageStandaloneStatus(){this.standaloneStatusPageSize=this.StandaloneStatusPaginator.pageSize;let e=this.standaloneStatusPageSize.toString();localStorage.setItem("standaloneStatusPageSize",e)}onPageStandalone(){this.standalonePageSize=this.StandalonePaginator.pageSize;let e=this.standalonePageSize.toString();localStorage.setItem("standalonePageSize",e)}onPageOnDemandStatus(){this.ondemandStatusPageSize=this.OnDemandStatusPaginator.pageSize;let e=this.ondemandStatusPageSize.toString();localStorage.setItem("ondemandStatusPageSize",e)}onPageOnDemandPrivate(){this.ondemandPrivatePageSize=this.OnDemandPrivatePaginator.pageSize;let e=this.ondemandPrivatePageSize.toString();localStorage.setItem("ondemandPrivatePageSize",e)}onPageOnDemand(){this.ondemandPageSize=this.OnDemandPaginator.pageSize;let e=this.ondemandPageSize.toString();localStorage.setItem("ondemandPageSize",e)}release(e){this.http.delete(txe+"/"+e,{withCredentials:!0,observe:"response"}).subscribe(()=>{this.loadCurrentTabData()})}addStandaloneLicense(e,n){this.dialog.open(a7,{data:{route:this.route,set_uuid:e.set_uuid,app:e.application,category:e.category,sub_category:e.sub_category,version:e.version,id:null,usbcomputerid:null,usbserial:null,usbregcode:null,usbpurchasedate:null,is_subscription:n}}).afterClosed().subscribe(()=>{this.loadCurrentTabData()})}editStandaloneLicense(e){this.dialog.open(a7,{data:{route:this.route,id:e.id,set_uuid:e.set_uuid,app:e.application,category:e.category,sub_category:e.sub_category,version:e.version,usbcomputerid:e.usb_computerid,usbserial:e.usb_serial,activationcode:e.activationcode,usbpurchasedate:e.last_renewed,notes:e.notes}}).afterClosed().subscribe(()=>{this.loadCurrentTabData()})}revoke(e){this.dialog.open(rme,{data:e}).afterClosed().subscribe(r=>{r&&this.loadCurrentTabData()})}hasMultiRoutes(){let e=!1;return e=this.loginService.isMultiRoute(this.route),e}OnAppFilterChange(e){this.license_versions_filter[e].includes(this.versionFilter.value,0)||this.versionFilter.setValue("All"),this.SaveFilters()}onEditDuration(e){return this.dialog.open(Khe,{data:{application:e.application,version:e.version,category:e.category,sub_category:e.sub_category,duration:e.duration/3600,route:this.route}}).afterClosed().subscribe(u=>{u&&(e.duration=3600*u),this.loadCurrentTabData()}),!1}onClaimPrivateLicense(e,n,o){this.dialog.open(tfe,{data:{route:this.route,id:e,computer_id:n,license_key:o}}).afterClosed().subscribe(()=>{this.loadCurrentTabData()})}onDeleteOptionSet(e){if(!this.userInfo.isMasterAdmin())return;let n=new rf;n.msg="This will remove the license set and all associated licenses. You will also need to select a purchase order to associate with the license removal. Would you like to continue?";const o=new ha;o.autoFocus=!1,o.data=n,this.dialog.open(af,o).afterClosed().subscribe(y=>{if(y&&y.confirmed){let I=new Zx;I.navigated_org=this.currentOrg,I.config_type=cf.PO_CONFIG_SELECT;let V=new ha;V.minWidth=400,V.data=I;let ee=me=>{null!=me&&this.http.post(li_backendURL+"/license/"+e+"/delete",{purchase_order:me},{withCredentials:!0}).subscribe(()=>{this.loadCurrentTabData()})};this.dialog.open(Yx,V).afterClosed().subscribe(ee)}})}onEditOption(e,n){if(!this.userInfo.isMasterAdmin())return;let o=new Wpe;o.data=e,o.activated=n,o.route=this.route,this.dialog.open(Zpe,{data:o}).afterClosed().subscribe(()=>{this.loadCurrentTabData()})}onExpirationNotify(){if(!this.userInfo.isMasterAdmin())return;let e=new s7;e.org_name=this.currentOrg,e.org_friendly_name=this.currentOrgDisplayName,e.device_list="",e.imei_list="",e.iccid_list="",e.update_command="expire_notify",e.sub_start=null,e.sub_end=null,e.org_lock=!0,this.dialog.open(l7,{data:e}).afterClosed().subscribe(()=>{})}onModifySub(e){if(!this.userInfo.isMasterAdmin())return;let n=new hfe;n.data=e,n.route=this.route,this.dialog.open(pfe,{data:n}).afterClosed().subscribe(()=>{this.loadCurrentTabData()})}viewPurchaseOrder(e){let n=new ZT;n.org_name=this.currentOrg,n.po_id=e.id,n.po_number=e.po;let o=new ha;o.data=n,this.dialog.open(YT,o).afterClosed().subscribe(y=>{})}onMainTabChange(e){this.mainTabIndex=e.index,this.mainTabID=e.tab.textLabel,this.save("licenseTabSelection",this.mainTabID),this.loadCurrentTabData()}onStandaloneTabChange(e){this.standaloneTabIndex=e.index,this.standaloneTabID=e.tab.textLabel,this.save("standaloneTabSelection",this.standaloneTabID),this.loadCurrentTabData()}onDemandTabChange(e){this.ondemandTabIndex=e.index,this.ondemandTabID=e.tab.textLabel,this.save("ondemandTabSelection",this.ondemandTabID),this.loadCurrentTabData()}loadCurrentTabData(){switch(this.mainTabID){case rs.CURRENT_FEATURES_TAB:this.loadOptionSets();break;case rs.STANDALONE_TAB:this.standaloneTabID===Kd.AVAILABILITY_TAB?this.loadStandaloneStatus():this.loadStandaloneActive();break;case rs.ONDEMAND_TAB:this.ondemandTabID===Kd.AVAILABILITY_TAB?(this.isLoadingOnDemandStatus=!0,fO({status:this.licenseService.getOnDemandStatus(this.route),priv:this.licenseService.getOnDemandPrivate(this.route)}).pipe($h(()=>this.isLoadingOnDemandStatus=!1)).subscribe(({status:e,priv:n})=>{this.ondemandlicensestatus.data=e,this.ondemandlicensestatus.sort=this.ondemandStatusSort,this.ondemandlicensestatus.paginator=this.OnDemandStatusPaginator,this.ondemandprivatelicenses.data=n,this.ondemandprivatelicenses.sort=this.ondemandPrivateSort,this.ondemandprivatelicenses.paginator=this.OnDemandPrivatePaginator})):this.loadOnDemandActive()}}loadOptionSets(){this.isLoadingOptions=!0,this.licenseService.getOptionSets(this.route).pipe($h(()=>this.isLoadingOptions=!1)).subscribe(e=>{this.optionsSource.data=e,this.optionsSource.sort=this.optionSort,this.optionsSource.paginator=this.LicenseSetPaginator})}loadStandaloneStatus(){this.isLoadingStandaloneStatus=!0,this.licenseService.getStandaloneStatus(this.route).pipe($h(()=>this.isLoadingStandaloneStatus=!1)).subscribe(e=>{this.standalonelicensestatus.data=e,this.standalonelicensestatus.sort=this.standaloneStatusSort,this.standalonelicensestatus.paginator=this.StandaloneStatusPaginator})}loadStandaloneActive(){this.isLoadingStandaloneActive=!0,this.licenseService.getStandaloneActive(this.route).pipe($h(()=>this.isLoadingStandaloneActive=!1)).subscribe(e=>{this.standaloneSource.data=e,this.standaloneSource.sort=this.standaloneActiveSort,this.standaloneSource.paginator=this.StandalonePaginator})}loadOnDemandActive(){this.isLoadingOnDemandActive=!0,this.licenseService.getOnDemandActive(this.route).pipe($h(()=>this.isLoadingOnDemandActive=!1)).subscribe(e=>{this.ondemandlicenses.data=e,this.ondemandlicenses.sort=this.ondemandClaimedSort,this.ondemandlicenses.paginator=this.OnDemandPaginator})}save(e,n){localStorage.setItem(e,n)}isMasterAdmin(){return this.userInfo.isMasterAdmin()}smallerScreenSize(){return window.innerWidth<900}filterMatchApplication(e,n){return""==n||"All"==n||e.toString().trim().toLowerCase()==n.toLowerCase()}filterMatchVersion(e,n){return Xh.FilterMatchVersion(e,n)}filterMatchSubscription(e,n,o,r,u){let y=e&&!n&&!r;return""==u.toLowerCase()||"null"==u.toLowerCase()||"none"==u.toLowerCase()&&!e||"true"==u.toLowerCase()&&y||"pending"==u.toLowerCase()&&n||"expiring"==u.toLowerCase()&&o||"expired"==u.toLowerCase()&&r}filterMatchNotes(e,n){return""==n||null!=e&&-1!=e.toString().trim().toLowerCase().search(n.toLowerCase())}currentFeaturesFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=this.filterMatchApplication(n.application,r.app),y=this.filterMatchVersion(n.version,r.version),I=this.filterMatchSubscription(n.is_subscription,n.is_sub_delayed,n.is_sub_expiring,n.is_sub_expired,r.sub_status),V=this.filterMatchNotes(n.notes,r.notes);return u&&y&&I&&V}}standaloneAvailableFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=this.filterMatchApplication(n.application,r.app),y=this.filterMatchVersion(n.version,r.version),I=this.filterMatchSubscription(n.is_subscription,n.is_sub_delayed,n.is_sub_expiring,n.is_sub_expired,r.sub_status);return u&&y&&I}}standaloneActivatedFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=""==r.claimed||"null"==r.claimed||"unclaimed"==n.computername.toString().trim().toLowerCase()&&"unclaimed"==r.claimed.toLowerCase()||"unclaimed"!=n.computername.toString().trim().toLowerCase()&&"claimed"==r.claimed.toLowerCase(),y=this.filterMatchApplication(n.application,r.app),I=this.filterMatchVersion(n.version,r.version),V=this.filterMatchSubscription(n.is_subscription,n.is_sub_delayed,n.is_sub_expiring,n.is_sub_expired,r.sub_status),q=this.filterMatchNotes(n.notes,r.notes);return u&&y&&I&&V&&q}}ondemandAvailableFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=this.filterMatchApplication(n.application,r.app),y=this.filterMatchVersion(n.version,r.version),I=this.filterMatchSubscription(n.is_subscription,n.is_sub_delayed,n.is_sub_expiring,n.is_sub_expired,r.sub_status);return u&&y&&I}}ondemandActiveFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=this.filterMatchApplication(n.application,r.app),y=this.filterMatchVersion(n.version,r.version);return u&&y}}getLicenseTypeLabel(e){return Xh.GetLicenseTypeLabel(e)}getCategoryLabel(e,n,o){return Xh.GetCategoryLabel(e,n,o)}getSubCategoryLabel(e,n){return Xh.GetSubCategoryLabel(e,n)}getDisplayVersion(e,n){return Xh.GetDisplayVersionString(e,n)}showLicenseID(e){return Xh.ShowLicenseID(e)}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(Po),$e(hge),$e(id),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-licenses"]],viewQuery:function(n,o){if(1&n&&(mn(gbe,5,kr),mn(bbe,5,kr),mn(ybe,5,kr),mn(vbe,5,kr),mn(xbe,5,kr),mn(wbe,5,kr),mn(Cbe,5),mn(Sbe,5),mn(Tbe,5),mn(Dbe,5),mn(Ibe,5),mn(Ebe,5),mn(L_,5)),2&n){let r;Bt(r=Vt())&&(o.LicenseSetPaginator=r.first),Bt(r=Vt())&&(o.StandaloneStatusPaginator=r.first),Bt(r=Vt())&&(o.StandalonePaginator=r.first),Bt(r=Vt())&&(o.OnDemandStatusPaginator=r.first),Bt(r=Vt())&&(o.OnDemandPrivatePaginator=r.first),Bt(r=Vt())&&(o.OnDemandPaginator=r.first),Bt(r=Vt())&&(o.optionSort=r.first),Bt(r=Vt())&&(o.standaloneStatusSort=r.first),Bt(r=Vt())&&(o.standaloneActiveSort=r.first),Bt(r=Vt())&&(o.ondemandStatusSort=r.first),Bt(r=Vt())&&(o.ondemandClaimedSort=r.first),Bt(r=Vt())&&(o.ondemandPrivateSort=r.first),Bt(r=Vt())&&(o.tabGroups=r)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:45,vars:19,consts:[["orgInfoMenu","matMenu"],["sortOptions","matSort"],["licenseSetPaginator","matPaginator"],["sortStandaloneStatus","matSort"],["standaloneStatusPaginator","matPaginator"],["sortStandaloneActive","matSort"],["standalonePaginator","matPaginator"],["sortOnDemandStatus","matSort"],["ondemandStatusPaginator","matPaginator"],["sortOnDemandClaimed","matSort"],["ondemandPaginator","matPaginator"],["sortOnDemandPrivate","matSort"],["ondemandPrivatePaginator","matPaginator"],[1,"main-container"],[1,"flex-org-container"],[1,"flex-org-title-item"],[1,"flex-org-title-content"],[1,"org-name-item"],["class","flex-org-icon-item",4,"ngIf"],[1,"main-header"],[3,"expanded"],[1,"controls"],["class","filter-field",4,"ngIf"],[1,"filter-field"],[3,"selectionChange","formControl"],["value","All"],[3,"value",4,"ngFor","ngForOf"],[1,"button-group"],["mat-icon-button","","aria-label","Clear Filters","matTooltip","Clear Filters",3,"click"],["fontSet","material-symbols-outlined"],["mat-icon-button","","aria-label","Refresh Activated Licenses","matTooltip","Refresh Activated Licenses",3,"click",4,"ngIf"],["mat-icon-button","","aria-label","Add License Set","matTooltip","Add License Set",3,"click",4,"ngIf"],["mat-icon-button","","aria-label","Send Expiration Notifications","matTooltip","Send Expiration Notifications",3,"click",4,"ngIf"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedTabChange","selectedIndex"],[4,"ngIf"],[3,"label"],["matTabContent",""],[1,"flex-org-icon-item"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","","role","button","value","Copy","matTooltip","Click to copy","matTooltipPosition","below",3,"copy-clipboard"],[3,"ngClass"],["mat-menu-item","","role","button","value","Copy","matTooltip","Click to copy","matTooltipPosition","below",3,"copy-clipboard",4,"ngIf"],[1,"uuid-org-item"],["value","null"],["value","Unclaimed"],["value","Claimed"],[3,"value"],["value","none"],["value","expired"],["value","expiring"],["value","true"],["value","pending"],["matInput","",1,"form-field",3,"input","formControl"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click"],["mat-icon-button","","aria-label","Refresh Activated Licenses","matTooltip","Refresh Activated Licenses",3,"click"],["mat-icon-button","","aria-label","Add License Set","matTooltip","Add License Set",3,"click"],["mat-icon-button","","aria-label","Send Expiration Notifications","matTooltip","Send Expiration Notifications",3,"click"],[1,"custom-table-responsive"],["matSort","","mat-table","","matSortActive","license_type","matSortDirection","asc",3,"dataSource"],[1,"table-caption"],["matColumnDef","application"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Application",4,"matCellDef"],["matColumnDef","version"],["mat-cell","","data-label","Version",3,"ngSwitch",4,"matCellDef"],["matColumnDef","license_type"],["mat-cell","","data-label","License Type",4,"matCellDef"],["matColumnDef","category"],["mat-cell","","style","padding-left: 0.5em;","data-label","Category",4,"matCellDef"],["matColumnDef","sub_category"],["mat-cell","","data-label","Sub Category",4,"matCellDef"],["matColumnDef","notes"],["mat-cell","","data-label","Notes",4,"matCellDef"],["matColumnDef","optionlist"],["mat-cell","","data-label","Options",4,"matCellDef"],["matColumnDef","local_license"],["class","icon-cell","mat-cell","","data-label","Private Server",4,"matCellDef"],["matColumnDef","is_subscription"],["mat-cell","","data-label","Subscription",4,"matCellDef"],["matColumnDef","limit"],["mat-cell","","data-label","Limit",4,"matCellDef"],["matColumnDef","po_list"],["mat-cell","","data-label","PO List",4,"matCellDef"],["matColumnDef","actions",4,"ngIf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","hover-row",4,"matRowDef","matRowDefColumns"],["noRowsText","No license sets",3,"isLoading","dataSource"],[3,"page","hidden","length","pageSize","pageSizeOptions","showFirstLastButtons"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Application"],["mat-cell","","data-label","Version",3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-cell","","data-label","License Type"],["mat-cell","","data-label","Category",2,"padding-left","0.5em"],["mat-cell","","data-label","Sub Category"],["mat-cell","","data-label","Notes"],[1,"block-text"],["mat-cell","","data-label","Options"],["class","license-id",4,"ngIf"],[1,"license-id"],["mat-cell","","data-label","Private Server",1,"icon-cell"],["mat-cell","","data-label","Subscription"],["fontSet","material-symbols-outlined","matTooltip","Not a Subscription"],["fontSet","material-symbols-outlined","matTooltip","Subscription Not Activated",3,"ngStyle"],["class","delayed-subscription","matTooltip","Subscription Not Started",4,"ngIf"],["class","active-subscription","matTooltip","Subscription Active",4,"ngIf"],["matTooltip","Subscription Active (Expiring Soon)",4,"ngIf"],["matTooltip","Subscription Expired",4,"ngIf"],["matTooltip","Subscription Not Started",1,"delayed-subscription"],["matTooltip","Subscription Active",1,"active-subscription"],["matTooltip","Subscription Active (Expiring Soon)"],[1,"active-subscription"],[1,"expiring-subscription"],["matTooltip","Subscription Expired"],[1,"expired-subscription"],["mat-cell","","data-label","Limit"],["class","promo_text",4,"ngIf"],[1,"promo_text"],["mat-cell","","data-label","PO List"],[1,"po-icon"],[1,"po-item",3,"click"],[1,"mat-elevation-z0"],[4,"ngFor","ngForOf"],["fontSet","material-symbols-outlined",1,"po-icon"],["matColumnDef","actions"],["mat-header-cell","","mat-sort-header","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Actions","class","button-group",4,"matCellDef"],["mat-header-cell","","mat-sort-header","","disabled",""],["mat-cell","","data-label","Actions",1,"button-group"],["mat-mini-fab","","color","primary","matTooltip","Edit License Set",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-mini-fab","","color","warn","matTooltip","Delete License Set",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-mini-fab","","color","primary","matTooltip","Update Subscription",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-header-row",""],["mat-row","",1,"hover-row"],["matSort","","mat-table","","matSortActive","category","matSortDirection","asc",2,"width","100%",3,"dataSource"],["mat-cell","","data-label","Category",3,"ngSwitch",4,"matCellDef"],["mat-cell","","data-label","Sub Category",3,"ngSwitch",4,"matCellDef"],["matColumnDef","current"],["mat-cell","","data-label","Activated",4,"matCellDef"],["matColumnDef","available"],["mat-cell","","data-label","Purchased",4,"matCellDef"],["matColumnDef","activate"],["mat-header-cell","","disabled","",4,"matHeaderCellDef"],["noRowsText","No standalone licenses",3,"isLoading","dataSource"],["matColumnDef","computername"],["mat-cell","","data-label","Computer Name",4,"matCellDef"],["matColumnDef","windows_user"],["mat-cell","","data-label","Windows User Name",4,"matCellDef"],["matColumnDef","version_string"],["mat-cell","","data-label","Version",4,"matCellDef"],["matColumnDef","last_renewed"],["mat-cell","","data-label","Claimed",4,"matCellDef"],["matColumnDef","activationcode"],["mat-cell","","data-label","Code",4,"matCellDef"],["matColumnDef","subscription_status"],["mat-cell","","data-label","Subscription Status",3,"ngSwitch",4,"matCellDef"],["noRowsText","No activated licenses",3,"isLoading","dataSource"],["mat-cell","","data-label","Category",3,"ngSwitch"],["mat-cell","","data-label","Sub Category",3,"ngSwitch"],["mat-cell","","data-label","Activated"],["mat-cell","","data-label","Purchased"],["matTooltip","Not a Subscription"],["matTooltip","Subscription Not Activated",3,"ngStyle"],["mat-header-cell","","disabled",""],["mat-cell","","data-label","Activate",4,"matCellDef"],["mat-cell","","data-label","Activate"],["mat-mini-fab","","color","primary","matTooltip","Activate License",1,"sm-mini-fab-button",3,"click","disabled"],["mat-cell","",4,"matCellDef"],["mat-cell",""],["mat-cell","","data-label","Computer Name"],["mat-cell","","data-label","Windows User Name"],["mat-cell","","data-label","Version"],["mat-cell","","data-label","Claimed"],["class","block-text",4,"ngIf"],["mat-cell","","data-label","Code"],["mat-cell","","data-label","Subscription Status",3,"ngSwitch"],["matTooltip","Not Subscription"],["matTooltip","Subscription Not Started",3,"ngStyle"],["matTooltip","Subscription Active",3,"ngStyle"],["matTooltip","Subscription Active (Expiring Soon)",3,"ngStyle"],["matTooltip","Subscription Expired",3,"ngStyle"],["mat-mini-fab","","color","warn","matTooltip","Revoke License",1,"sm-mini-fab-button","action-btn",3,"click","disabled"],["mat-mini-fab","","color","warn","matTooltip","Revoke License",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-mini-fab","","color","warn","matTooltip","Remove License",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-mini-fab","","color","primary","matTooltip","Edit License",1,"sm-mini-fab-button","action-btn",3,"click"],["matSort","","mat-table","","matSortActive","application","matSortDirection","asc",2,"width","100%",3,"dataSource"],["mat-cell","","data-label","In Use",4,"matCellDef"],["mat-cell","","data-label","Available",4,"matCellDef"],["matColumnDef","expiration"],["mat-cell","","data-label","Expiration",4,"matCellDef"],["matColumnDef","change"],["mat-cell","","data-label","Change",4,"matCellDef"],["noRowsText","No on-demand licenses",3,"isLoading","dataSource"],["matColumnDef","username"],["mat-cell","","data-label","User",4,"matCellDef"],["matColumnDef","expires"],["mat-cell","","data-label","Expires",4,"matCellDef"],["matColumnDef","release"],["mat-cell","","data-label","Release",4,"matCellDef"],["mat-cell","","data-label","License Count",4,"matCellDef"],["matColumnDef","computer_id"],["mat-cell","","data-label","Computer ID",4,"matCellDef"],["matColumnDef","license_key"],["mat-cell","","data-label","License Key",4,"matCellDef"],["matColumnDef","claim"],["mat-cell","","data-label","Action",4,"matCellDef"],["noRowsText","No private licenses",3,"isLoading","dataSource"],["mat-cell","","data-label","License Count"],["mat-cell","","data-label","Computer ID"],["mat-cell","","data-label","License Key"],["mat-cell","","data-label","Action"],["mat-mini-fab","","color","primary",1,"sm-mini-fab-button","action-btn",3,"click","matTooltip"],["mat-cell","","data-label","In Use"],["mat-cell","","data-label","Available"],["mat-cell","","data-label","Expiration"],["mat-cell","","data-label","Change"],["mat-mini-fab","","color","primary","matTooltip","Change Duration",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-cell","","data-label","User"],["mat-cell","","data-label","Expires"],["mat-cell","","data-label","Release"],["mat-mini-fab","","color","warn","matTooltip","Release License",1,"sm-mini-fab-button","action-btn",3,"click"]],template:function(n,o){1&n&&(w(0,"main",13)(1,"mat-toolbar",14)(2,"div",15)(3,"div",16)(4,"div",17),M(5),x(),w(6,"div"),M(7,"Licenses"),x()()(),te(8,Pbe,13,6,"div",18),x(),w(9,"mat-accordion",19)(10,"mat-expansion-panel",20)(11,"mat-expansion-panel-header")(12,"mat-panel-title"),M(13,"License Controls"),x()(),w(14,"div",21),te(15,Lbe,10,1,"mat-form-field",22),w(16,"mat-form-field",23)(17,"mat-label"),M(18,"Application Filter:"),x(),w(19,"mat-select",24),we("selectionChange",function(u){return o.OnAppFilterChange(u.value)}),w(20,"mat-option",25),M(21,"All"),x(),te(22,Fbe,2,2,"mat-option",26),ti(23,"keyvalue"),x()(),w(24,"mat-form-field",23)(25,"mat-label"),M(26,"Version Filter:"),x(),w(27,"mat-select",24),we("selectionChange",function(){return o.SaveFilters()}),te(28,Nbe,2,2,"mat-option",26),x()(),te(29,zbe,16,1,"mat-form-field",22)(30,Vbe,5,2,"mat-form-field",22),w(31,"span",27)(32,"button",28),we("click",function(){return o.ClearFilters()}),w(33,"mat-icon",29),M(34,"clear"),x()(),te(35,Ube,3,0,"button",30)(36,Hbe,3,0,"button",31)(37,jbe,3,0,"button",32),x()()()(),Re(38,"mat-divider"),w(39,"mat-tab-group",33),we("selectedTabChange",function(u){return o.onMainTabChange(u)}),te(40,qye,3,1,"div",34),w(41,"mat-tab",35),te(42,S0e,87,27,"ng-template",36),x(),w(43,"mat-tab",35),te(44,exe,81,26,"ng-template",36),x()()()),2&n&&(E(5),Ct(o.currentOrgDisplayName),E(3),N("ngIf",o.userInfo&&(o.userInfo.isMasterAdmin()||o.userInfo.isDistributorAdmin())),E(2),N("expanded",!0),E(5),N("ngIf",o.showActivatedFilter()),E(4),N("formControl",o.appFilter),E(3),N("ngForOf",Zm(23,17,o.applications)),E(5),N("formControl",o.versionFilter),E(),N("ngForOf",o.license_versions_filter[o.appFilter.value]),E(),N("ngIf",o.showSubscriptionFilter()),E(),N("ngIf",o.showNotesFilter()),E(5),N("ngIf",o.showRefreshButton()),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterAdmin()&&o.showAddLicenseSetButton()),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterAdmin()&&o.showSendNotificationButton()),E(2),N("selectedIndex",o.mainTabIndex),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()),E(),N("label",o.MainTabs.STANDALONE_TAB),E(2),N("label",o.MainTabs.ONDEMAND_TAB))},dependencies:[$d,kl,ir,Ym,LS,UR,HR,jr,wr,Xu,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,qa,D_,th,zl,Bl,od,Tu,nh,uc,Sr,XT,KT,Pa,jM,Ob,L_,kr,_0,g0,iw,zL,JT,F_,Rl,OI],styles:["table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}.header-form[_ngcontent-%COMP%]{display:inline-block}.block-text[_ngcontent-%COMP%]{word-wrap:break-word}.top-header[_ngcontent-%COMP%]{position:relative;top:3em;padding-top:3em}.main-container[_ngcontent-%COMP%]{padding-top:3em}.main-header[_ngcontent-%COMP%]{height:auto;position:sticky;top:3em;width:100%;z-index:1000}.icon-cell[_ngcontent-%COMP%]{text-align:left!important}.license-id[_ngcontent-%COMP%], .promo_text[_ngcontent-%COMP%]{font-weight:700;color:#007bff}.po-item[_ngcontent-%COMP%]{color:#007bff;cursor:pointer}.po-icon[_ngcontent-%COMP%]{margin-right:.2em;vertical-align:middle}.filter-field[_ngcontent-%COMP%]{margin-right:.5em}.flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;gap:10px}.flex-item-start[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:flex-start}.flex-item-mid[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:center}.flex-item-end[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:flex-end}.device-button[_ngcontent-%COMP%]{margin-right:1em;margin-top:.5em;margin-bottom:.5em}.controls[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}@media screen and (max-width: 1150px){ .mdc-tab__text-label{font-size:x-small}}"],changeDetection:0})}return t})();class nxe{user_name="";user_friendly="";org_name="";org_friendly=""}class rh{static nti_pwd_complextity=new RegExp(new RegExp("^(((?=.*\\p{S})|(?=.*\\p{P}))(?=.*\\p{N})(?=.*\\p{Ll})(?=.*\\p{Lu})).{12,}$","u"));static nti_pwd_complexity_requirement=["Minimum of 12 characters","1 mathematical/currency symbol (+, $, \u2200, etc)","1 number character (1, 2, 3, etc)","1 upper-case letter (A, B, \u0122, etc)","1 lower-case letter (a, b, \u016f, etc)"];static COLLECTION_100="100";static COLLECTION_500="500";static COLLECTION_1000="1000";static COLLECTION_10000="10000";static COLLECTION_100000="100000";static COLLECTION_1000000="1000000";static COLLECTIONS_FILE="mostcommon_"+rh.COLLECTION_10000;static COLLECTIONS_PATH="../assets/collections/";static COLLECTIONS_FILE_LOCAL_STORAGE="NBP_"+rh.COLLECTIONS_FILE;static initNBP(){NBP.init(rh.COLLECTIONS_FILE,rh.COLLECTIONS_PATH,!0)}static isCommonCompanyPassword(i){let e=!1,n=["polysmith","nihon","kohden","neurotronics"],o=i.toLowerCase();for(let r=0;r0&&n.includes(o)||u.length>0&&n.includes(u))return!0;for(let q=0;q3&&n.includes(I[q]))return!0;for(let q=0;q3&&n.includes(V[q]))return!0;return!1}static isComplexityRequirementMet(i){return null!=i&&0!=i.length&&this.nti_pwd_complextity.test(i)}}let y7=(()=>{class t{validate(e){return(t=>{let i={};null!=t.errors&&(i=t.errors);const e=t.get("passwordOne"),n=t.get("passwordTwo");return e&&n&&e.value!=n.value?i.passwordMismatch=!0:delete i.passwordMismatch,0===Object.keys(i).length?null:i})(e)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","appPasswordMatchCheck",""]],standalone:!1,features:[Bn([{provide:ba,useExisting:t,multi:!0}])]})}return t})();class v7{isErrorState(i,e){return(i.dirty||i.touched)&&e.errors&&e.errors.passwordMismatch}}let x7=(()=>{class t{validate(e){return(t=>{let i={};null!=t.errors&&(i=t.errors);const e=t.get("passwordOne");let o=!0,u=!1;return e&&e.value&&(o=rh.isComplexityRequirementMet(e.value),u=rh.isCommonPassword(e.value)),o?delete i.passwordNotComplex:i.passwordNotComplex=!0,u?i.passwordCommon=!0:delete i.passwordCommon,0===Object.keys(i).length?null:i})(e)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","appPasswordStrengthCheck",""]],standalone:!1,features:[Bn([{provide:ba,useExisting:t,multi:!0}])]})}return t})();class w7{isErrorState(i,e){return(i.dirty||i.touched)&&null!=e.errors}}const rxe=["changePasswordForm"];function axe(t,i){if(1&t&&(w(0,"li"),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",e," ")}}function sxe(t,i){1&t&&(w(0,"mat-error"),M(1,"Password must meet complexity requirements."),x())}function lxe(t,i){1&t&&(w(0,"mat-error"),M(1,"Password is too common."),x())}function cxe(t,i){1&t&&(w(0,"mat-error"),M(1,"Password cannot contain username or organization."),x())}function dxe(t,i){if(1&t){const e=pt();w(0,"button",15),we("click",function(){return fe(e),ge(X().onSave())}),w(1,"mat-icon",11),M(2,"save"),x(),M(3," Update Password "),x()}2&t&&(X(),N("disabled",!Vi(2).form.valid))}const oA="archive",BL="Polysmith Cloud Service User";class rA{user_info=new nxe;id="";enabled=!1;exists=!1;cloud=!1}class uxe{token=""}let eD=(()=>{class t{http;loginService;snackBar;allowEmpty=!1;allowSave=!0;passwordReset=null;pwUserInfo=null;userInfo=null;saveResultChange=new Tt;passwordChange=new Tt;passwordValidChange=new Tt;show_pass=!1;password1="";password2="";password1matcher;password2matcher;pwd_complex_req;passwordForm;constructor(e,n,o){this.http=e,this.loginService=n,this.snackBar=o,this.password1matcher=new w7,this.password2matcher=new v7}ngOnInit(){this.pwd_complex_req=rh.nti_pwd_complexity_requirement,this.loginService.userInfo$.subscribe(e=>{null==this.userInfo&&(this.userInfo=e),null!=this.pwUserInfo?this.pwUserInfo.cloud&&(this.pwUserInfo.user_info.user_name=oA,this.pwUserInfo.user_info.user_friendly=BL):null==this.passwordReset?(this.pwUserInfo=new rA,this.pwUserInfo.user_info.user_name=this.userInfo.user,this.pwUserInfo.user_info.user_friendly=this.userInfo.userDisplayName,this.pwUserInfo.user_info.org_name=this.userInfo.organization,this.pwUserInfo.user_info.org_friendly=this.userInfo.organizationDisplayName,this.pwUserInfo.id=this.userInfo.userID.toString(),this.pwUserInfo.cloud=!1,this.pwUserInfo.enabled=!0,this.pwUserInfo.exists=!0):this.pwUserInfo=new rA})}onSave(){this.allowSave&&(this.pwUserInfo.cloud?this.onSaveCloudUser():null!=this.passwordReset?this.onSavePasswordReset():this.onSavePassword())}onSavePassword(){this.http.post(li_backendURL+"/password",{password:this.password1},{withCredentials:!0}).subscribe({next:()=>{this.password1=this.password2="",this.passwordForm.resetForm(),this.snackBar.open("Your password has been changed.","Dismiss",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom"})},error:o=>{this.snackBar.open("Error updating password: "+o.message,"Dismiss",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom"})}})}onSavePasswordReset(){this.http.post(li_backendURL+"/email/password_reset/change",{token:this.passwordReset.token,password:this.password1},{withCredentials:!0}).subscribe({next:o=>{this.saveResultChange.emit(o)},error:o=>{this.snackBar.open("Error resetting password: "+o.message,"Dismiss",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom"}),this.saveResultChange.emit(null)}})}onSaveCloudUser(){let e=li_backendURL+"/organizations/"+this.pwUserInfo.user_info.org_name+"/user",n={name:oA,friendly_name:BL,priv:0,password:this.password1};this.pwUserInfo.exists?(e=li_backendURL+"/user/"+this.pwUserInfo.id,n.enabled=this.pwUserInfo.enabled):n.clouduser=!0,this.http.post(e,n,{withCredentials:!0}).subscribe({next:o=>{o?this.snackBar.open("Cloud user updated.","Dismiss",{duration:5e3}):this.snackBar.open("There was an error updating the cloud user.","Dismiss",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom"}),this.saveResultChange.emit(o)},error:o=>{this.snackBar.open("Error updating cloud user: "+o.message,"Dismiss",{duration:5e3,horizontalPosition:"center",verticalPosition:"bottom"}),this.saveResultChange.emit(null)}})}isEmptyValue(e){return null==e||"string"==typeof e&&""===e.trim()}getComplexityCheckClass(){return this.isEmptyValue(this.password1)&&this.isEmptyValue(this.password2)?"":this.password1===this.password2&&rh.isComplexityRequirementMet(this.password1)?"custom-panel complexity-met":"custom-panel complexity-not-met"}formHasError(e,n){return!(!e||!e.errors)&&n in e.errors}onToggleViewPassword(){this.show_pass=!this.show_pass}onChangePass(e){null==e&&(e=this.passwordForm.form);let n=rh.isUserInfoRelatedPassword(this.pwUserInfo.user_info,this.password1);null!=e.errors?n?e.errors.passwordUserInfo=!0:delete e.errors.passwordUserInfo:n&&e.setErrors({passwordUserInfo:!0}),this.passwordValidChange.emit(!(!this.allowEmpty||this.password1!=this.password2||0!=this.password1.length)||this.password1.trim().length>0&&!this.formHasError(this.passwordForm.form,"passwordNotComplex")&&!this.formHasError(this.passwordForm.form,"passwordCommon")&&!this.formHasError(this.passwordForm.form,"passwordUserInfo")),this.passwordChange.emit(this.password1)}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(Po),$e(Mc))};static \u0275cmp=cn({type:t,selectors:[["app-password-entry"]],viewQuery:function(n,o){if(1&n&&mn(rxe,5),2&n){let r;Bt(r=Vt())&&(o.passwordForm=r.first)}},inputs:{allowEmpty:"allowEmpty",allowSave:"allowSave",passwordReset:"passwordReset",pwUserInfo:"pwUserInfo",userInfo:"userInfo"},outputs:{saveResultChange:"saveResultChange",passwordChange:"passwordChange",passwordValidChange:"passwordValidChange"},standalone:!1,decls:32,vars:14,consts:[["changePasswordForm","ngForm"],[1,"change-card-content"],["appPasswordMatchCheck","","appPasswordStrengthCheck","",1,"password-form"],[3,"ngClass"],[1,"complexity-title"],[1,"complexity-list"],[4,"ngFor","ngForOf"],[2,"line-height",".001em"],["hideRequiredMarker",""],["matInput","","required","","name","passwordOne","autocomplete","new-password",3,"ngModelChange","ngModel","errorStateMatcher","type"],["matSuffix","","mat-icon-button","","type","button",3,"click"],["fontSet","material-symbols-outlined"],[4,"ngIf"],["matInput","","name","passwordTwo","autocomplete","new-password","required","",3,"ngModelChange","ngModel","errorStateMatcher","type"],["mat-fab","","extended","","type","button",3,"disabled","click",4,"ngIf"],["mat-fab","","extended","","type","button",3,"click","disabled"]],template:function(n,o){if(1&n){const r=pt();w(0,"div",1)(1,"form",2,0)(3,"mat-accordion")(4,"mat-expansion-panel",3)(5,"mat-expansion-panel-header")(6,"mat-panel-title",4),M(7,"Password Complexity Requirements"),x()(),w(8,"ul",5),te(9,axe,2,1,"li",6),x()()(),w(10,"p",7),M(11,"\xa0"),x(),w(12,"mat-form-field",8)(13,"mat-label"),M(14,"New Password"),x(),w(15,"input",9),Qn("ngModelChange",function(y){return fe(r),ei(o.password1,y)||(o.password1=y),ge(y)}),we("ngModelChange",function(){fe(r);const y=Vi(2);return ge(o.onChangePass(y.form))}),x(),w(16,"button",10),we("click",function(){return fe(r),ge(o.onToggleViewPassword())}),w(17,"mat-icon",11),M(18),x()(),te(19,sxe,2,0,"mat-error",12)(20,lxe,2,0,"mat-error",12)(21,cxe,2,0,"mat-error",12),x(),w(22,"mat-form-field",8)(23,"mat-label"),M(24,"Confirm Password"),x(),w(25,"input",13),Qn("ngModelChange",function(y){return fe(r),ei(o.password2,y)||(o.password2=y),ge(y)}),x(),w(26,"button",10),we("click",function(){return fe(r),ge(o.onToggleViewPassword())}),w(27,"mat-icon",11),M(28),x()(),w(29,"mat-error"),M(30,"The passwords do not match."),x()()(),te(31,dxe,4,1,"button",14),x()}if(2&n){const r=Vi(2);E(4),N("ngClass",o.getComplexityCheckClass()),E(5),N("ngForOf",o.pwd_complex_req),E(6),Kn("ngModel",o.password1),N("errorStateMatcher",o.password1matcher)("type",o.show_pass?"text":"password"),E(3),Ct(o.show_pass?"visibility":"visibility_off"),E(),N("ngIf",o.formHasError(r.form,"passwordNotComplex")),E(),N("ngIf",!o.formHasError(r.form,"passwordNotComplex")&&o.formHasError(r.form,"passwordCommon")),E(),N("ngIf",!o.formHasError(r.form,"passwordNotComplex")&&!o.formHasError(r.form,"passwordCommon")&&o.formHasError(r.form,"passwordUserInfo")),E(4),Kn("ngModel",o.password2),N("errorStateMatcher",o.password2matcher)("type",o.show_pass?"text":"password"),E(3),Ct(o.show_pass?"visibility":"visibility_off"),E(3),N("ngIf",o.allowSave)}},dependencies:[$d,kl,ir,ka,jr,wr,Aa,Jl,ts,Cr,na,Oa,fM,Qs,xa,qa,Ab,th,zl,Bl,od,Sr,y7,x7],styles:[".mat-expansion-panel[_ngcontent-%COMP%]:not(.complexity-met,.complexity-not-met){background-color:var(--mat-sys-primary-container)!important}.mat-expansion-panel[_ngcontent-%COMP%]:not(.complexity-met,.complexity-not-met) .mat-expansion-panel-header[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-primary-container)!important}.mat-expansion-panel.complexity-met[_ngcontent-%COMP%], .mat-expansion-panel.complexity-met[_ngcontent-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]:hover{background-color:#98e5b0!important}.mat-expansion-panel.complexity-not-met[_ngcontent-%COMP%], .mat-expansion-panel.complexity-not-met[_ngcontent-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-error-container)!important}.complexity-title[_ngcontent-%COMP%]{font-size:small}.mat-snack-bar-container[_ngcontent-%COMP%]{justify-content:center!important}.container-form[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:100%;margin:0 auto}.complexity-list[_ngcontent-%COMP%]{font-size:14px}.change-card-container[_ngcontent-%COMP%]{border-radius:1em;max-width:40em;width:80%;margin-top:2em}.change-card[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.change-card-content[_ngcontent-%COMP%], .password-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto;width:100%}.title[_ngcontent-%COMP%]{text-align:center;font-weight:700;color:#3f51b5}input[_ngcontent-%COMP%]{width:100%!important}.change-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:auto}.bold-text[_ngcontent-%COMP%]{font-weight:700}.require-mfa-field[_ngcontent-%COMP%]{margin-top:1em}.passkey-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center}.card-container[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:center;border-radius:1.2em!important;background-color:transparent!important}.passkey-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center;width:fit-content;padding:0;margin:0}.passkey-item[_ngcontent-%COMP%]{margin-left:.5em;margin-right:.5em}.spacer[_ngcontent-%COMP%]{height:.2em}"]})}return t})();const hxe=t=>({"danger-input-field":t}),C7=()=>({standalone:!0});function pxe(t,i){1&t&&(w(0,"div",23),M(1,"Email must be unique per user."),x())}function mxe(t,i){1&t&&(w(0,"mat-option",12),M(1,"System Administrator"),x()),2&t&&N("value",3)}function fxe(t,i){1&t&&(w(0,"mat-option",12),M(1,"Privileged"),x()),2&t&&N("value",2)}function _xe(t,i){1&t&&(w(0,"mat-option",12),M(1,"Administrator"),x()),2&t&&N("value",1)}function gxe(t,i){1&t&&(w(0,"mat-label"),M(1,"Application"),x())}function bxe(t,i){1&t&&(w(0,"mat-label"),M(1,"Application Access Control"),x())}function yxe(t,i){1&t&&(w(0,"mat-icon",27),M(1,"admin_panel_settings"),x())}function vxe(t,i){1&t&&(w(0,"mat-option",12),M(1,"None"),x()),2&t&&N("value",0)}function xxe(t,i){if(1&t&&(w(0,"mat-option",12),M(1),x()),2&t){const e=X(2);N("value",0),E(),Ct(e.getDefaultValueText())}}function wxe(t,i){if(1&t){const e=pt();w(0,"span")(1,"mat-form-field"),te(2,gxe,2,0,"mat-label",24)(3,bxe,2,0,"mat-label",24),Re(4,"input",25),te(5,yxe,2,0,"mat-icon",26),x(),w(6,"mat-form-field")(7,"mat-label"),M(8,"Access"),x(),w(9,"mat-select",10),we("selectionChange",function(o){const r=fe(e).$implicit;return ge(X().onChangeWebAppAccess(r.name,o.value))}),w(10,"mat-option",12),M(11,"Administrator"),x(),w(12,"mat-option",12),M(13,"Privileged"),x(),w(14,"mat-option",12),M(15,"Basic"),x(),te(16,vxe,2,1,"mat-option",11)(17,xxe,2,2,"mat-option",11),x()()()}if(2&t){const e=i.$implicit,n=X();E(),bs("default"==e.uuid?"default-field":"label-field"),E(),N("ngIf","default"!=e.uuid),E(),N("ngIf","default"==e.uuid),E(),bs("bold-label"),ys("value","default"==e.uuid?"Global Access":e.name),N("matTooltip","default"==e.uuid?"Default access level for all web applications when not specified.":""),E(),N("ngIf","default"==e.uuid),E(4),N("value",e.access)("disabled",n.disableChangeAppAccess(e.uuid)),E(),N("value",3),E(2),N("value",2),E(2),N("value",1),E(2),N("ngIf",n.showNoPermissionOption(e)),E(),N("ngIf",0!=n.default_access)}}function Cxe(t,i){if(1&t){const e=pt();w(0,"mat-expansion-panel",28)(1,"mat-expansion-panel-header")(2,"mat-panel-title"),M(3,"Set password"),x()(),w(4,"app-password-entry",29),we("passwordChange",function(o){return fe(e),ge(X().onPasswordChanged(o))})("passwordValidChange",function(o){return fe(e),ge(X().onPasswordValidChanged(o))}),x()()}if(2&t){const e=X();N("disabled",!e.isOrgAdmin()),E(4),N("userInfo",e.userInfo)("allowSave",!1)("allowEmpty",!e.new_user)}}function Sxe(t,i){if(1&t){const e=pt();w(0,"button",30),we("click",function(){return fe(e),ge(X().onNavigateToAuthentication())}),w(1,"mat-icon",31),M(2,"encrypted"),x(),M(3," Configure Authentication "),x()}}function Txe(t,i){1&t&&(w(0,"mat-label"),M(1,"Type 'Delete MFA'"),x())}function Dxe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",32),te(1,Txe,2,0,"mat-label",24),w(2,"mat-slide-toggle",33),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.delete_mfa_enabled,o)||(r.delete_mfa_enabled=o),ge(o)}),we("change",function(){return fe(e),ge(X().onChangeMFADeleteToggle())}),x(),w(3,"input",34),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.delete_mfa_input,o)||(r.delete_mfa_input=o),ge(o)}),x(),w(4,"button",35),we("click",function(){return fe(e),ge(X().onDeleteMFA())}),w(5,"mat-icon",36),M(6,"delete_forever"),x()()()}if(2&t){const e=X();N("ngClass",Ar(9,hxe,e.delete_mfa_enabled)),E(),N("ngIf",e.delete_mfa_enabled),E(),Kn("ngModel",e.delete_mfa_enabled),N("ngModelOptions",jn(11,C7)),E(),Kn("ngModel",e.delete_mfa_input),N("ngModelOptions",jn(12,C7))("readonly",!e.delete_mfa_enabled)("placeholder",e.delete_mfa_enabled?"":"Delete MFA"),E(),N("disabled",!e.deleteMFAChallengeMet())}}const Ixe=li_backendURL+"/user";let Exe=(()=>{class t{dialogRef;inputData;http;router;loginService;snackBar;dialog;password_entry;pwUserInfo=new rA;userInfo=null;editUserInfo=new Nl;show_pass=!1;admin=!1;admin_lite=!1;admin_init=!1;admin_lite_init=!1;require_mfa=!1;watchtower=!1;data;originalData;route;usersorg;usersorgfriendly;org_mfa_required=!1;email_nonunique=!1;app_list=new Array;default_access=0;user_info_changed=!1;auth_info=new iM;delete_mfa_enabled=!1;delete_mfa_input="";userpriv=0;password="";validPassword=!1;new_user=!1;constructor(e,n,o,r,u,y,I){this.dialogRef=e,this.inputData=n,this.http=o,this.router=r,this.loginService=u,this.snackBar=y,this.dialog=I,this.originalData=n.originalData,this.usersorg=n.org,this.usersorgfriendly=n.orgfriendly,this.org_mfa_required=n.org_mfa_required,this.originalData?(this.data=Object.assign(new Object,this.originalData),this.validPassword=!0):(this.new_user=!0,this.data={name:"",friendly_name:"",priv:0,require_mfa:!1},this.watchtower=!1),this.route=n.route}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.new_user||(this.userInfo.isMasterDBUser()&&"neurotronics.com"==this.usersorg?(this.admin=3==this.data.priv,this.admin_lite=2==this.data.priv):(this.admin=this.data.priv>=1,this.admin_lite=!1),this.editUserInfo.organization=this.userInfo.isMasterDBUser()||this.userInfo.isDistributorAdmin()?this.route.params.value.org:this.originalData.organization_name),this.watchtower=this.data.watchtower_access,this.userpriv=this.data.priv,this.admin_init=this.admin,this.admin_lite_init=this.admin_lite,this.require_mfa=this.data.require_mfa,this.org_mfa_required&&(this.require_mfa=!0),this.isRootUser()||((this.isSelf()||this.userInfo.isOrgAdmin()||this.userInfo.isMasterAdmin()||this.userInfo.isDistributorAdmin())&&this.getAuthInfo(),this.getAppAccess())}getAuthInfo(){this.data.hasOwnProperty("id")&&this.http.get(li_backendURL+"/user/auth/"+this.data.id,{withCredentials:!0}).subscribe({next:o=>{this.auth_info=o},error:o=>{this.snackBar.open("Error getting authentication info: "+o.message,"Dismiss",{duration:5e3})}})}getDRBRAccess(){return this.userpriv}onChangeDRBRAccess(e){this.user_info_changed=!0,3==e&&this.userInfo.isMasterAdmin()&&this.isMasterOrg()?(this.userpriv=3,this.admin=!0,this.admin_lite=!1):2==e&&this.userInfo.isMasterDBUser()&&this.userInfo.isAdmin()&&this.isMasterOrg()?(this.userpriv=2,this.admin=!1,this.admin_lite=!0):1==e&&this.userInfo.isAdmin()&&!this.isMasterOrg()?(this.userpriv=1,this.admin=!0,this.admin_lite=!1):(this.userpriv=0,this.admin=this.admin_lite=!1)}onToggleWatchTowerAccess(e){this.user_info_changed=!0,this.watchtower=1==e}disableChangeAppAccess(e){let n=!this.isOrgAdmin()&&!this.isSelf(),o="default"==e&&this.isSelf(),r="default"==e&&"neurotronics.com"==this.usersorg.toLowerCase()&&this.userpriv>=3;return n||o||r}onChangeWebAppAccess(e,n){this.user_info_changed=!0;const o=this.app_list.find(r=>r.name===e);o&&("default"==o.uuid?(this.default_access=n,this.app_list.forEach(r=>{r.access=0==n&&r.default_basic?1:n})):o.access=n)}showNoPermissionOption(e){return"default"===e.uuid||!e.default_basic&&0==this.default_access}getDefaultValueText(){let e="None";switch(this.default_access){case 3:e="Administrator";break;case 2:e="Privileged";break;case 2:e="Basic"}return e}canDeleteMFA(){let e=this.auth_info.has_passkey||this.auth_info.has_totp,n=this.originalData,o=this.userInfo.isMasterAdmin(),r=this.userInfo.isDistributorAdmin(),u=this.userInfo.isOrgAdmin();return e&&n&&(o||r||u)}isOrgAdmin(){return this.userInfo.isOrgAdmin()||this.userInfo.priv>this.userpriv}isRootUser(){return"neurotronics.com"==this.usersorg&&"root"==this.data.name}isMasterOrg(){return"neurotronics.com"==this.usersorg}isSelf(){let o=this.usersorg,r=this.userInfo.organization,u=0===this.data.name.localeCompare(this.userInfo.user,void 0,{sensitivity:"accent"}),y=0===o.localeCompare(r,void 0,{sensitivity:"accent"});return u&&y}getAppAccess(){let e=li_backendURL+"/user/apps",n={},o=null;this.data.hasOwnProperty("id")&&(o=this.data.id),n.id=o,n.org_name=this.usersorg,this.http.post(e,n,{withCredentials:!0}).subscribe({next:r=>{r&&"apps"in r&&(this.app_list=r.apps,this.app_list.forEach(u=>{"default"==u.uuid&&(this.default_access=u.access)}))},error:r=>{this.snackBar.open("Error getting app permissions: "+r.message,"Dismiss",{duration:5e3})}})}onSubmit(){if(this.deleteMFAChallengeMet()){let r="The 'Delete MFA' challenge prompt was completed, but the delete button was not pressed. Please confirm the change or disable it before closing.",u=new rf;u.msg=r,u.html=!1,u.yes_no=!1,u.title="Delete MFA Incomplete";const y=new ha;return y.autoFocus=!1,y.data=u,void this.dialog.open(af,y)}let o,e=Object.assign(new Object,this.data);if(this.email_nonunique=!1,delete e.hidden,delete e.last_login,delete e.organization_name,delete e.organization_friendly,(this.admin_init!=this.admin||this.admin_lite_init!=this.admin_lite)&&(e.priv=this.admin||this.admin_lite?1:0),this.userInfo.isMasterDBUser()&&(e.lite=this.admin_lite),this.password&&this.password.length>0&&(e.password=this.password),e.lite=!!this.admin_lite,e.watchtower_access=this.watchtower,e.require_mfa=this.require_mfa,this.app_list.length>0&&(e.app_access=this.app_list),this.originalData){let r=e.id;delete e.id,o=Ixe+"/"+r}else o=this.loginService.getURL("user",this.route);this.http.post(o,e,{withCredentials:!0}).subscribe({next:r=>{null===r?this.email_nonunique=!0:this.originalData?(Object.assign(this.originalData,r),this.dialogRef.close(!0)):this.dialogRef.close(r)}})}onChangePasswordRelatedInfo(){this.password_entry.onChangePass(null)}onPasswordChanged(e){this.password=e}onPasswordValidChanged(e){this.validPassword=e}canToggleRequireMFA(){return!this.org_mfa_required}onChangeEmail(){this.user_info_changed=!0,this.email_nonunique=!1}onNavigateToAuthentication(){if(this.user_info_changed){let e="Save changes?",n=new rf;n.msg=e,n.html=!1,n.yes_no=!0,n.title="Unsaved Changes";const o=new ha;o.autoFocus=!1,o.data=n,this.dialog.open(af,o).afterClosed().subscribe(r=>{r&&(r.confirmed?(this.onSubmit(),this.navigateToAuthentication(!1)):this.navigateToAuthentication(!0))})}else this.navigateToAuthentication(!0)}navigateToAuthentication(e){this.router.navigate(["/authentication"]),e&&this.dialogRef.close()}deleteMFAChallengeMet(){return this.delete_mfa_enabled&&"Delete MFA"===this.delete_mfa_input}onChangeMFADeleteToggle(){this.delete_mfa_input=""}onDeleteMFA(){this.data.hasOwnProperty("id")&&this.http.delete(li_backendURL+"/user/mfa/"+this.data.id,{withCredentials:!0}).subscribe({next:()=>{this.snackBar.open("User MFA deleted.","Dismiss",{duration:5e3}),this.delete_mfa_input="",this.delete_mfa_enabled=!1,this.getAuthInfo()},error:o=>{this.snackBar.open("Delete MFA failed: "+o.message,"Dismiss",{duration:5e3})}})}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(Ga),$e(Po),$e(Mc),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-users-edit"]],viewQuery:function(n,o){if(1&n&&mn(eD,5),2&n){let r;Bt(r=Vt())&&(o.password_entry=r.first)}},standalone:!1,decls:59,vars:19,consts:[["userEditForm","ngForm"],["appPasswordMatchCheck","","appPasswordStrengthCheck","",3,"ngSubmit"],[1,"input"],["matInput","","required","","name","username","placeholder","Username",3,"ngModelChange","ngModel","disabled"],["matInput","","required","","name","displayName","placeholder","Display name",3,"ngModelChange","ngModel"],[1,"input",3,"keyup"],["matInput","","email","","required","","type","email","name","email","placeholder","Email address",3,"ngModelChange","ngModel"],["class","margin-bottom-thin custom-error",4,"ngIf"],[1,"label-field"],["matInput","","readonly","","value","DrawBridge",1,"bold-label"],[3,"selectionChange","value","disabled"],[3,"value",4,"ngIf"],[3,"value"],["matInput","","readonly","","value","WatchTower",1,"bold-label"],[3,"selectionChange","value"],[4,"ngFor","ngForOf"],[2,"line-height",".001em"],[3,"disabled",4,"ngIf"],["class","auth-button","type","button","mat-fab","","extended","",3,"click",4,"ngIf"],["class","input",3,"ngClass",4,"ngIf"],[2,"line-height","0.9em"],["align","center"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],[1,"margin-bottom-thin","custom-error"],[4,"ngIf"],["matInput","","readonly","",3,"value","matTooltip"],["matSuffix","","fontSet","material-symbols-outlined",4,"ngIf"],["matSuffix","","fontSet","material-symbols-outlined"],[3,"disabled"],[3,"passwordChange","passwordValidChange","userInfo","allowSave","allowEmpty"],["type","button","mat-fab","","extended","",1,"auth-button",3,"click"],["fontSet","material-symbols-outlined","matTooltip","Go to Authentication Settings"],[1,"input",3,"ngClass"],["matPrefix","","matTooltip","Removes user MFA, if they have lost their device(s) used for authentication.",3,"ngModelChange","change","ngModel","ngModelOptions"],["matInput","","autocomplete","off",3,"ngModelChange","ngModel","ngModelOptions","readonly","placeholder"],["matSuffix","","mat-icon-button","","type","button","matTooltip","Confirm Delete MFA.",3,"click","disabled"],["fontSet","material-symbols-outlined"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content")(3,"div")(4,"mat-form-field",2)(5,"input",3),Qn("ngModelChange",function(y){return fe(r),ei(o.data.name,y)||(o.data.name=y),ge(y)}),we("ngModelChange",function(){return fe(r),ge(o.onChangePasswordRelatedInfo())}),x()()(),w(6,"div")(7,"mat-form-field",2)(8,"input",4),Qn("ngModelChange",function(y){return fe(r),ei(o.data.friendly_name,y)||(o.data.friendly_name=y),ge(y)}),we("ngModelChange",function(){return fe(r),ge(o.onChangePasswordRelatedInfo())}),x()()(),w(9,"div")(10,"mat-form-field",5),we("keyup",function(){return fe(r),ge(o.onChangeEmail())}),w(11,"input",6),Qn("ngModelChange",function(y){return fe(r),ei(o.data.email,y)||(o.data.email=y),ge(y)}),x(),te(12,pxe,2,0,"div",7),w(13,"mat-error"),M(14,"A valid email address is required."),x()()(),w(15,"mat-expansion-panel")(16,"mat-expansion-panel-header"),M(17,"Application Access"),x(),w(18,"form")(19,"span")(20,"mat-form-field",8)(21,"mat-label"),M(22,"Application"),x(),Re(23,"input",9),x(),w(24,"mat-form-field")(25,"mat-label"),M(26,"Access"),x(),w(27,"mat-select",10),we("selectionChange",function(y){return fe(r),ge(o.onChangeDRBRAccess(y.value))}),te(28,mxe,2,1,"mat-option",11)(29,fxe,2,1,"mat-option",11)(30,_xe,2,1,"mat-option",11),w(31,"mat-option",12),M(32,"Basic"),x()()()(),w(33,"span")(34,"mat-form-field",8)(35,"mat-label"),M(36,"Application"),x(),Re(37,"input",13),x(),w(38,"mat-form-field")(39,"mat-label"),M(40,"Access"),x(),w(41,"mat-select",14),we("selectionChange",function(y){return fe(r),ge(o.onToggleWatchTowerAccess(y.value))}),w(42,"mat-option",12),M(43,"Enabled"),x(),w(44,"mat-option",12),M(45,"Disabled"),x()()()(),te(46,wxe,18,16,"span",15),x()(),w(47,"p",16),M(48,"\xa0"),x(),te(49,Cxe,5,4,"mat-expansion-panel",17),w(50,"p",16),M(51,"\xa0"),x(),te(52,Sxe,4,0,"button",18)(53,Dxe,7,13,"mat-form-field",19),w(54,"p",20),M(55,"\xa0"),x()(),w(56,"mat-dialog-actions",21)(57,"button",22),M(58,"Save Changes"),x()()()}if(2&n){const r=Vi(1);E(5),Kn("ngModel",o.data.name),N("disabled",o.isRootUser()),E(3),Kn("ngModel",o.data.friendly_name),E(3),Kn("ngModel",o.data.email),E(),N("ngIf",o.email_nonunique),E(15),N("value",o.getDRBRAccess())("disabled",!o.isOrgAdmin()&&!o.isSelf()),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterAdmin()&&o.isMasterOrg()),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()&&o.isMasterOrg()),E(),N("ngIf",o.userInfo&&!o.isMasterOrg()),E(),N("value",0),E(10),N("value",o.watchtower?1:0),E(),N("value",1),E(2),N("value",0),E(2),N("ngForOf",o.app_list),E(3),N("ngIf",!o.isSelf()),E(3),N("ngIf",o.isSelf()),E(),N("ngIf",!o.isSelf()&&o.canDeleteMFA()),E(4),N("disabled",!r.form.valid||!o.validPassword)}},dependencies:[$d,kl,ir,ka,jr,wr,Aa,Jl,NO,ts,Cr,na,Oa,fM,Ple,Qs,xa,ws,qa,Ab,Fl,Os,zl,Bl,od,Gd,nh,uc,Sr,Pa,y7,x7,eD],styles:[".input[_ngcontent-%COMP%]{width:100%}mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}.auth-button[_ngcontent-%COMP%]{width:100%}.custom-error[_ngcontent-%COMP%]{color:red;transform:translateY(20px);font-size:x-small}.app-info-container[_ngcontent-%COMP%]{display:flex;flex-direction:row}.label-field[_ngcontent-%COMP%]{margin-right:.1em}.default-field[_ngcontent-%COMP%]{width:47.5%;margin-right:.1em}.bold-label[_ngcontent-%COMP%]{font-weight:500}.wide-input[_ngcontent-%COMP%]{width:95%}@media screen and (min-width: 900px){.inputemail[_ngcontent-%COMP%]{width:20em}}@media screen and (max-width: 900px){.inputemail[_ngcontent-%COMP%]{width:15em}}"]})}return t})();const Mxe=()=>[10,25,50,75,100];function Axe(t,i){if(1&t&&(w(0,"button",54)(1,"span",57),M(2),x()()),2&t){const e=X(2);N("copy-clipboard",e.currentOrgUUID),E(2),Ct(e.currentOrgUUID)}}function kxe(t,i){if(1&t&&(w(0,"div",52)(1,"button",53)(2,"mat-icon",27),M(3,"info"),x()(),w(4,"mat-menu",null,0)(6,"button",54)(7,"span"),M(8),x(),M(9," \xa0 "),w(10,"span",55),M(11),x()(),te(12,Axe,3,2,"button",56),x()()),2&t){const e=Vi(5),n=X();E(),N("matMenuTriggerFor",e),E(5),N("copy-clipboard",n.currentOrg),E(2),Ct(n.currentOrg),E(2),N("ngClass",n.currentOrgEnabled?"enabled-org-color":"disabled-org-color"),E(),Jt("(",n.currentOrgEnabled?"Enabled":"Disabled",")"),E(),N("ngIf",n.userInfo&&n.userInfo.isMasterAdmin())}}function Rxe(t,i){if(1&t){const e=pt();w(0,"button",58),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.nameFilter))}),w(1,"mat-icon",27),M(2,"close"),x()()}}function Oxe(t,i){if(1&t){const e=pt();w(0,"button",58),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.emailFilter))}),w(1,"mat-icon",27),M(2,"close"),x()()}}function Pxe(t,i){1&t&&(w(0,"mat-option",59),M(1,"Admin"),x())}function Lxe(t,i){1&t&&(w(0,"mat-option",60),M(1,"Privileged"),x())}function Fxe(t,i){1&t&&(w(0,"mat-option",61),M(1,"Admin"),x())}function Nxe(t,i){1&t&&(w(0,"th",62),M(1,"Username"),x())}function zxe(t,i){if(1&t&&(w(0,"td",63),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.name)}}function Bxe(t,i){1&t&&(w(0,"th",62),M(1,"Display Name"),x())}function Vxe(t,i){if(1&t&&(w(0,"td",64),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",e.friendly_name,"")}}function Uxe(t,i){1&t&&(w(0,"th",62),M(1,"Email"),x())}function Hxe(t,i){if(1&t&&(w(0,"td",65),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.email)}}function jxe(t,i){1&t&&(w(0,"th",62),M(1,"Type"),x())}function $xe(t,i){1&t&&(w(0,"span"),M(1,"Basic"),x())}function Gxe(t,i){1&t&&(w(0,"span"),M(1,"Admin"),x())}function qxe(t,i){1&t&&(w(0,"span"),M(1,"Privileged"),x())}function Wxe(t,i){if(1&t&&(w(0,"td",66),te(1,$xe,2,0,"span",67)(2,Gxe,2,0,"span",67)(3,qxe,2,0,"span",67),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.priv<1),E(),N("ngIf",1==e.priv||3==e.priv),E(),N("ngIf",2==e.priv)}}function Zxe(t,i){1&t&&(w(0,"th",62),M(1,"Last Login"),x())}function Yxe(t,i){1&t&&(w(0,"span"),M(1,"Never"),x())}function Xxe(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X().$implicit;E(),Ct(hi(2,1,e.last_login,"medium"))}}function Kxe(t,i){if(1&t&&(w(0,"td",68),te(1,Yxe,2,0,"span",67)(2,Xxe,3,4,"span",67),x()),2&t){const e=i.$implicit;E(),N("ngIf",null==e.last_login),E(),N("ngIf",null!=e.last_login)}}function Qxe(t,i){1&t&&(w(0,"th",69),M(1,"Enabled"),x())}function Jxe(t,i){if(1&t){const e=pt();w(0,"td",70)(1,"mat-slide-toggle",71),we("change",function(){const o=fe(e).$implicit;return ge(X().onToggle(o))}),x()()}if(2&t){const e=i.$implicit,n=X();E(),N("checked",e.enabled)("disabled",n.isRootUser(e)||n.isSelf(e.name)||n.isPrimaryContact(e.id))("matTooltip",n.isPrimaryContact(e.id)?"Cannot disable primary contact.\nThis can be changed on Account page.":null)}}function ewe(t,i){1&t&&(w(0,"th",69),M(1,"Actions"),x())}function twe(t,i){if(1&t){const e=pt();w(0,"td",72),at(1),w(2,"button",73),we("click",function(){const o=fe(e).$implicit;return ge(X().edit(o))}),w(3,"mat-icon",27),M(4,"edit"),x()(),st(),at(5),w(6,"div",74)(7,"button",75),we("click",function(){const o=fe(e).$implicit;return ge(X().delete(o))}),w(8,"mat-icon",27),M(9,"delete"),x()()(),st(),x()}if(2&t){const e=i.$implicit,n=X();E(6),N("matTooltip",n.isPrimaryContact(e.id)?"Cannot delete primary contact.\nThis can be changed on Account page.":"Delete User"),E(),N("disabled",n.isSelf(e.name)||n.isRootUser(e)||n.isPrimaryContact(e.id))}}function nwe(t,i){1&t&&Re(0,"tr",76)}function iwe(t,i){1&t&&Re(0,"tr",77)}const S7=li_backendURL+"/user";let T7=(()=>{class t{http;loginService;dialog;route;usersSource=new Fr;columnsToDisplay=["name","friendly_name","email","priv","last_login","enabled","actions"];sort;paginator;constructor(e,n,o,r){this.http=e,this.loginService=n,this.dialog=o,this.route=r}currentOrg;currentOrgDisplayName;currentOrgEnabled;currentOrgUUID;currentOrgPrimaryContactID=-1;currentOrgRequireMFA;userInfo=null;loadingUsers=!1;pageSize=10;nameFilter=new po;emailFilter=new po;typeFilter=new po;lastLoginFilter=new po;enabledFilter=new po;filteredValues={name:"",email:"",type:"",last_login:"",enabled:""};ngOnInit(){this.loginService.updateNavigatedOrg(this.route),this.loginService.userInfo$.subscribe(n=>{this.userInfo=n}),this.refresh(),this.nameFilter.valueChanges.subscribe(n=>{this.filteredValues.name=n,this.usersSource.filter=JSON.stringify(this.filteredValues)}),this.emailFilter.valueChanges.subscribe(n=>{this.filteredValues.email=n,this.usersSource.filter=JSON.stringify(this.filteredValues)}),this.typeFilter.valueChanges.subscribe(n=>{this.filteredValues.type=n,this.usersSource.filter=JSON.stringify(this.filteredValues)}),this.lastLoginFilter.valueChanges.subscribe(n=>{this.filteredValues.last_login=n,this.usersSource.filter=JSON.stringify(this.filteredValues)}),this.enabledFilter.valueChanges.subscribe(n=>{this.filteredValues.enabled=n,this.usersSource.filter=JSON.stringify(this.filteredValues)}),this.LoadFilters(),this.usersSource.filterPredicate=this.userFilterPredicate();let e=localStorage.getItem("userPageSize");(""==e||null==e)&&(e="10"),this.pageSize=parseInt(e)}refresh(){this.loadingUsers=!0,this.http.get(this.loginService.getURL("user",this.route),{withCredentials:!0}).subscribe(r=>{this.usersSource.data=r,this.usersSource.sortingDataAccessor=(u,y)=>null==u[y]?u[y]:u[y].toString().toLowerCase(),this.usersSource.sort=this.sort,this.usersSource.paginator=this.paginator,this.loadingUsers=!1}),this.currentOrg=this.loginService.getOrg(this.route),this.http.get(li_backendURL+"/organization/info/"+this.currentOrg,{withCredentials:!0,observe:"response"}).subscribe(r=>{let u=r.body;this.currentOrgEnabled=u.enabled,this.currentOrgDisplayName=u.friendly_name,this.currentOrgUUID=u.uuid,this.currentOrgPrimaryContactID=u.notify_user_id,this.currentOrgRequireMFA=u.require_mfa})}LoadFilters(){this.nameFilter.setValue($i.LoadLocalStorageSetting("userNameFilter")),this.emailFilter.setValue($i.LoadLocalStorageSetting("userEmailFilter")),this.typeFilter.setValue($i.LoadLocalStorageSetting("userTypeFilter")),this.lastLoginFilter.setValue($i.LoadLocalStorageSetting("userLastLoginFilter","null")),this.enabledFilter.setValue($i.LoadLocalStorageSetting("userEnabledFilter","true"))}SaveFilters(){$i.SaveLocalStorageSetting("userNameFilter",this.nameFilter.value),$i.SaveLocalStorageSetting("userEmailFilter",this.emailFilter.value),$i.SaveLocalStorageSetting("userTypeFilter",this.typeFilter.value),$i.SaveLocalStorageSetting("userLastLoginFilter",this.lastLoginFilter.value),$i.SaveLocalStorageSetting("userEnabledFilter",this.enabledFilter.value)}ClearFilters(){this.nameFilter.setValue(""),this.emailFilter.setValue(""),this.typeFilter.setValue("null"),this.lastLoginFilter.setValue("null"),this.enabledFilter.setValue("true"),this.SaveFilters(),this.refresh()}ClearFilter(e,n=""){e.setValue(n),this.SaveFilters()}onPage(){this.pageSize=this.paginator.pageSize;let e=this.pageSize.toString();localStorage.setItem("userPageSize",e)}isSystemAdminOrg(){return"neurotronics.com"==this.currentOrg}isRootUser(e){return null!=e&&"neurotronics.com"==e.organization_name&&"root"==e.name}isSelf(e){let r=this.currentOrg,u=this.userInfo.organization,y=0===e.localeCompare(this.userInfo.user,void 0,{sensitivity:"accent"}),I=0===r.localeCompare(u,void 0,{sensitivity:"accent"});return y&&I}isPrimaryContact(e){return e==this.currentOrgPrimaryContactID}hasMultiRoutes(){let e=!1;return e=this.loginService.isMultiRoute(this.route),e}onToggle(e){return this.http.post(S7+"/"+e.id,{name:e.name,friendly_name:e.friendly_name,priv:e.priv,enabled:!e.enabled},{withCredentials:!0}).subscribe(()=>{("true"==this.enabledFilter.value&&!e.enabled||"false"==this.enabledFilter.value&&e.enabled)&&(this.userFilterPredicate(),this.usersSource.sort=this.sort)}),!0}edit(e){let n=this.dialog.open(Exe,{data:{originalData:e,org:this.currentOrg,orgfriendly:this.currentOrgDisplayName,org_mfa_required:this.currentOrgRequireMFA,route:this.route}});if(!e){let o=r=>{if(r){let u=this.usersSource.data;u.push(r),this.usersSource.data=u}};n.afterClosed().subscribe(o)}}delete(e){let n=new rf;n.msg=`Are you sure you want to delete the user "${e.name}" (${e.friendly_name})?`,this.dialog.open(af,{data:n}).afterClosed().subscribe(u=>{u&&u.confirmed&&this.http.delete(S7+"/"+e.id,{withCredentials:!0}).subscribe(()=>{let V=this.usersSource.data.filter(q=>q.id!=e.id);this.usersSource.data=V})})}getDayDifference(e){if(null==e)return-1;let n=new Date,o=new Date(e),r=Math.abs(n.getTime()-o.getTime());return Math.ceil(r/864e5)}nameFilterMatch(e,n){let o=JSON.parse(n);return-1!=e.name.toString().trim().toLowerCase().search(o.name.toLowerCase())||-1!=e.friendly_name.toString().trim().toLowerCase().search(o.name.toLowerCase())}emailFilterMatch(e,n){let o=JSON.parse(n);return null!=e.email&&-1!=e.email?.toString().trim().toLowerCase().search(o.email.toLowerCase())||""==o.email.toLowerCase()}typeFilterMatch(e,n){let o=JSON.parse(n);return-1!=e.priv.toString().trim().search(o.type.toLowerCase())||"null"==o.type.toLowerCase()}lastLoginFilterMatch(e,n){let o=JSON.parse(n);return"null"==o.last_login.toLowerCase()||("never"==o.last_login.toLowerCase()?null==e.last_login:"active"==o.last_login.toLowerCase()?null!=e.last_login&&this.getDayDifference(e.last_login)<=7:"recent"==o.last_login.toLowerCase()?null!=e.last_login&&this.getDayDifference(e.last_login)<=30:"inactive"==o.last_login.toLowerCase()?null==e.last_login||this.getDayDifference(e.last_login)>30:"never"==o.last_login.toLowerCase()&&null==e.last_login)}enabledFilterMatch(e,n){let o=JSON.parse(n);return-1!=e.enabled.toString().trim().search(o.enabled.toLowerCase())||"null"==o.enabled.toLowerCase()}userFilterPredicate(){return(n,o)=>{let r=this.nameFilterMatch(n,o),u=this.emailFilterMatch(n,o),y=this.typeFilterMatch(n,o),I=this.lastLoginFilterMatch(n,o),V=this.enabledFilterMatch(n,o);return r&&u&&y&&I&&V}}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(Po),$e(pa),$e(id))};static \u0275cmp=cn({type:t,selectors:[["app-users"]],viewQuery:function(n,o){if(1&n&&(mn(Js,5),mn(kr,5)),2&n){let r;Bt(r=Vt())&&(o.sort=r.first),Bt(r=Vt())&&(o.paginator=r.first)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:97,vars:25,consts:[["orgInfoMenu","matMenu"],[1,"main-container"],[1,"flex-org-container"],[1,"flex-org-title-item"],[1,"flex-org-title-content"],[1,"org-name-item"],["class","flex-org-icon-item",4,"ngIf"],[1,"main-header"],[3,"expanded"],[1,"controls"],[1,"filters"],["matInput","",1,"form-field",3,"input","formControl"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],[3,"selectionChange","formControl"],["value","null"],["value","0"],["value","1",4,"ngIf"],["value","2",4,"ngIf"],["value","3",4,"ngIf"],["value","active","matTooltip","Last 7 Days"],["value","recent","matTooltip","Last 30 Days"],["value","inactive","matTooltip","Over 30 Days"],["value","never"],["value","true"],["value","false"],[1,"button-group"],["mat-icon-button","","aria-label","Clear Filters","matTooltip","Clear Filters",3,"click"],["fontSet","material-symbols-outlined"],["mat-icon-button","","aria-label","Add User","matTooltip","Add User",3,"click"],[1,"custom-table-responsive"],["matSort","","mat-table","",2,"width","100%",3,"dataSource"],[1,"table-caption"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Username",4,"matCellDef"],["matColumnDef","friendly_name"],["mat-cell","","data-label","Display Name",4,"matCellDef"],["matColumnDef","email"],["mat-cell","","data-label","Email",4,"matCellDef"],["matColumnDef","priv"],["mat-cell","","data-label","Type",4,"matCellDef"],["matColumnDef","last_login"],["mat-cell","","data-label","Last Login",4,"matCellDef"],["matColumnDef","enabled"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Enabled",4,"matCellDef"],["matColumnDef","actions"],["mat-cell","","data-label","Actions","class","button-group",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","hover-row",4,"matRowDef","matRowDefColumns"],["noRowsText","No users",3,"isLoading","dataSource"],[3,"page","hidden","length","pageSize","pageSizeOptions","showFirstLastButtons"],[1,"flex-org-icon-item"],["mat-icon-button","",3,"matMenuTriggerFor"],["mat-menu-item","","role","button","value","Copy","matTooltip","Click to copy","matTooltipPosition","below",3,"copy-clipboard"],[3,"ngClass"],["mat-menu-item","","role","button","value","Copy","matTooltip","Click to copy","matTooltipPosition","below",3,"copy-clipboard",4,"ngIf"],[1,"uuid-org-item"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click"],["value","1"],["value","2"],["value","3"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Username"],["mat-cell","","data-label","Display Name"],["mat-cell","","data-label","Email"],["mat-cell","","data-label","Type"],[4,"ngIf"],["mat-cell","","data-label","Last Login"],["mat-header-cell",""],["mat-cell","","data-label","Enabled"],["matTooltipClass","multiline-tooltip",3,"change","checked","disabled","matTooltip"],["mat-cell","","data-label","Actions",1,"button-group"],["mat-mini-fab","","color","primary","matTooltip","Edit User",1,"sm-mini-fab-button","action-btn",3,"click"],["matTooltipClass","multiline-tooltip",3,"matTooltip"],["mat-mini-fab","","color","warn",1,"sm-mini-fab-button","action-btn",3,"click","disabled"],["mat-header-row",""],["mat-row","",1,"hover-row"]],template:function(n,o){1&n&&(w(0,"main",1)(1,"mat-toolbar",2)(2,"div",3)(3,"div",4)(4,"div",5),M(5),x(),w(6,"div"),M(7,"Users"),x()()(),te(8,kxe,13,6,"div",6),x(),w(9,"mat-accordion",7)(10,"mat-expansion-panel",8)(11,"mat-expansion-panel-header")(12,"mat-panel-title"),M(13,"User Controls"),x()(),w(14,"div",9)(15,"span",10)(16,"mat-form-field")(17,"mat-label"),M(18,"Name Filter:"),x(),w(19,"input",11),we("input",function(){return o.SaveFilters()}),x(),te(20,Rxe,3,0,"button",12),x(),w(21,"mat-form-field")(22,"mat-label"),M(23,"Email Filter:"),x(),w(24,"input",11),we("input",function(){return o.SaveFilters()}),x(),te(25,Oxe,3,0,"button",12),x(),w(26,"mat-form-field")(27,"mat-label"),M(28,"Type Filter:"),x(),w(29,"mat-select",13),we("selectionChange",function(){return o.SaveFilters()}),w(30,"mat-option",14),M(31,"All"),x(),w(32,"mat-option",15),M(33,"Basic"),x(),te(34,Pxe,2,0,"mat-option",16)(35,Lxe,2,0,"mat-option",17)(36,Fxe,2,0,"mat-option",18),x()(),w(37,"mat-form-field")(38,"mat-label"),M(39,"Last Login Filter:"),x(),w(40,"mat-select",13),we("selectionChange",function(){return o.SaveFilters()}),w(41,"mat-option",14),M(42,"All"),x(),w(43,"mat-option",19),M(44,"Active"),x(),w(45,"mat-option",20),M(46,"Recently Active"),x(),w(47,"mat-option",21),M(48,"Inactive"),x(),w(49,"mat-option",22),M(50,"Never"),x()()(),w(51,"mat-form-field")(52,"mat-label"),M(53,"Enabled Filter:"),x(),w(54,"mat-select",13),we("selectionChange",function(){return o.SaveFilters()}),w(55,"mat-option",14),M(56,"All"),x(),w(57,"mat-option",23),M(58,"Enabled"),x(),w(59,"mat-option",24),M(60,"Disabled"),x()()()(),w(61,"span",25)(62,"button",26),we("click",function(){return o.ClearFilters()}),w(63,"mat-icon",27),M(64,"clear"),x()(),w(65,"button",28),we("click",function(){return o.edit(null)}),w(66,"mat-icon",27),M(67,"add"),x()()()()()(),w(68,"div",29)(69,"table",30)(70,"caption",31),M(71),x(),at(72,32),te(73,Nxe,2,0,"th",33)(74,zxe,2,1,"td",34),st(),at(75,35),te(76,Bxe,2,0,"th",33)(77,Vxe,2,1,"td",36),st(),at(78,37),te(79,Uxe,2,0,"th",33)(80,Hxe,2,1,"td",38),st(),at(81,39),te(82,jxe,2,0,"th",33)(83,Wxe,4,3,"td",40),st(),at(84,41),te(85,Zxe,2,0,"th",33)(86,Kxe,3,2,"td",42),st(),at(87,43),te(88,Qxe,2,0,"th",44)(89,Jxe,2,3,"td",45),st(),at(90,46),te(91,ewe,2,0,"th",44)(92,twe,10,2,"td",47),st(),te(93,nwe,1,0,"tr",48)(94,iwe,1,0,"tr",49),x()(),Re(95,"app-table-placeholder",50),w(96,"mat-paginator",51),we("page",function(){return o.onPage()}),x()()),2&n&&(E(5),Ct(o.currentOrgDisplayName),E(3),N("ngIf",o.userInfo&&(o.userInfo.isMasterAdmin()||o.userInfo.isDistributorAdmin())),E(2),N("expanded",!0),E(9),N("formControl",o.nameFilter),E(),N("ngIf",""!=o.nameFilter.value),E(4),N("formControl",o.emailFilter),E(),N("ngIf",""!=o.emailFilter.value),E(4),N("formControl",o.typeFilter),E(5),N("ngIf",!o.isSystemAdminOrg()),E(),N("ngIf",o.isSystemAdminOrg()),E(),N("ngIf",o.isSystemAdminOrg()),E(4),N("formControl",o.lastLoginFilter),E(14),N("formControl",o.enabledFilter),E(15),N("dataSource",o.usersSource),E(2),Jt(" ",o.currentOrgDisplayName," Users "),E(22),N("matHeaderRowDef",o.columnsToDisplay),E(),N("matRowDefColumns",o.columnsToDisplay),E(),N("isLoading",o.loadingUsers)("dataSource",o.usersSource),E(),N("hidden",o.usersSource.filteredData.length<10)("length",o.usersSource.filteredData.length)("pageSize",o.pageSize)("pageSizeOptions",jn(24,Mxe))("showFirstLastButtons",!0))},dependencies:[$d,ir,jr,wr,Xu,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,qa,D_,th,zl,Bl,od,Gd,nh,uc,Sr,Pa,kr,_0,g0,iw,zL,JT,F_,Rl],styles:["table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}mat-form-field[_ngcontent-%COMP%]{margin-right:1em}.main-container[_ngcontent-%COMP%]{padding-top:3em}.main-header[_ngcontent-%COMP%]{height:auto;position:sticky;top:3em;width:100%;z-index:1000}.controls[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.button-group[_ngcontent-%COMP%]{flex:0 0 auto;box-sizing:border-box} .multiline-tooltip{white-space:pre-line}"]})}return t})(),rwe=(()=>{class t{validate(e){return(t=>{let i=new RegExp("([^a-zA-Z\\d\\.\\-])"),e={};null!=t.errors&&(e=t.errors);const n=t.get("name");let o="";return n&&n.value&&(o=n.value),i.test(o)?e.orgnameInvalidChars=!0:delete e.orgnameInvalidChars,0===Object.keys(e).length?null:e})(e)}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["","appOrgNameCharCheck",""]],standalone:!1,features:[Bn([{provide:ba,useExisting:t,multi:!0}])]})}return t})();class awe{isErrorState(i,e){return(i.dirty||i.touched)&&e.errors&&e.errors.orgnameInvalidChars}}const lwe=li_backendURL+"/pids/status";class VL{http;constructor(i){this.http=i}getPidsStatus(){var i=this;return bt(function*(){return yield function swe(t,i){const e="object"==typeof i;return new Promise((n,o)=>{let u,r=!1;t.subscribe({next:y=>{u=y,r=!0},error:o,complete:()=>{r?n(u):e?n(i.defaultValue):o(new Cx)}})})}(i.http.get(lwe,{withCredentials:!0,observe:"response"})).then(e=>{if(200===e.status)return e.body;throw new Error("Failed to fetch PID status: "+e.statusText)}).catch(e=>{throw console.error("Error fetching PID status:",e),e})})()}}function cwe(t,i){1&t&&(w(0,"mat-error"),M(1,"Invalid characters."),x())}function dwe(t,i){if(1&t){const e=pt();w(0,"mat-form-field",3)(1,"input",19),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.data.customer_id,o)||(r.data.customer_id=o),ge(o)}),x()()}if(2&t){const e=X();E(),Kn("ngModel",e.data.customer_id)}}function uwe(t,i){if(1&t){const e=pt();w(0,"div",10)(1,"div",11),M(2,"MFA Required:"),x(),w(3,"div",12)(4,"mat-slide-toggle",20),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.data.require_mfa,o)||(r.data.require_mfa=o),ge(o)}),we("change",function(o){return fe(e),ge(X().onToggleMFARequired(o))}),x()()()}if(2&t){const e=X();E(4),Kn("ngModel",e.data.require_mfa),N("checked",e.data.require_mfa)}}function hwe(t,i){if(1&t){const e=pt();w(0,"div",10)(1,"div",11),M(2,"Allow Email MFA:"),x(),w(3,"div",12)(4,"mat-slide-toggle",21),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.data.allow_email_mfa,o)||(r.data.allow_email_mfa=o),ge(o)}),x()()()}if(2&t){const e=X();E(4),Kn("ngModel",e.data.allow_email_mfa),N("checked",e.data.allow_email_mfa)}}function pwe(t,i){if(1&t&&(w(0,"mat-option",24),M(1),x()),2&t){const e=i.$implicit;N("value",e.id),E(),Ct(e.name)}}function mwe(t,i){if(1&t){const e=pt();w(0,"mat-form-field")(1,"mat-label",22),M(2,"Distributed by:"),x(),w(3,"mat-select",23),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.data.distributor_id,o)||(r.data.distributor_id=o),ge(o)}),w(4,"mat-option",24),M(5,"None"),x(),te(6,pwe,2,2,"mat-option",25),x()()}if(2&t){const e=X();E(3),Kn("ngModel",e.data.distributor_id),N("disabled",!e.canBeDistributed()),E(),N("value",-1),E(2),N("ngForOf",e.distributors)}}function fwe(t,i){if(1&t){const e=pt();w(0,"mat-form-field")(1,"label"),M(2,"Application"),x(),Re(3,"input",30),w(4,"mat-slide-toggle",31),we("change",function(){const o=fe(e).$implicit;return ge(X(3).onToggleWebAppAccess(o.name))}),x()()}if(2&t){const e=i.$implicit,n=X(3);E(3),N("value",e.name),E(),N("checked",e.access)("disabled",n.isMasterOrganization()||!e.revokable)("matTooltip",e.revokable?"":"This application has default basic access enabled and cannot be restricted.")}}function _we(t,i){if(1&t&&(w(0,"div",28),te(1,fwe,5,4,"mat-form-field",29),x()),2&t){const e=X(2);E(),N("ngForOf",e.app_access)}}function gwe(t,i){1&t&&(w(0,"div"),M(1," This organization has access to all apps. "),x())}function bwe(t,i){if(1&t&&(w(0,"mat-expansion-panel")(1,"mat-expansion-panel-header",26),M(2,"Application Access"),x(),te(3,_we,2,1,"div",27)(4,gwe,2,0,"div",5),x()),2&t){const e=X();E(3),N("ngIf",!e.isMasterOrganization()),E(),N("ngIf",e.isMasterOrganization())}}const D7=li_backendURL+"/organization",ywe=li_backendURL+"/distributor_organization";class I7{organization;importing}class vwe{uuid;name;access;revokable}let E7=(()=>{class t{dialogRef;originalData;http;dialog;loginService;snackBar;data;importing=!1;distributors=new Object([]);orgnameInvalidCharMatcher;app_access=new Array;userInfo=null;access_changed=!1;init_mfa_required=!1;pids_enabled=!1;constructor(e,n,o,r,u,y){this.dialogRef=e,this.originalData=n,this.http=o,this.dialog=r,this.loginService=u,this.snackBar=y,this.loginService.userInfo$.subscribe(I=>{this.userInfo=I}),this.orgnameInvalidCharMatcher=new awe,n.organization?(n.importing&&(this.importing=!0),this.data={...n.organization},(null==this.data.distributor_id||-1==this.data.distributor_id)&&(this.data.distributor_id=-1)):(this.data=new df,this.data.enabled=!0,this.data.test=!1,this.data.distributor_id=-1,this.data.is_distributor=!1,this.data.has_cloudarchiving=!1,this.data.require_mfa=!1,this.data.allow_email_mfa=!1),this.init_mfa_required=this.data.require_mfa}ngOnInit(){this.userInfo&&this.userInfo.isMasterDBUser()&&this.userInfo.isAdmin()&&this.getOrgAppAccess(),this.http.get(ywe,{withCredentials:!0}).subscribe(n=>{this.distributors=n}),this.checkForPIDS()}checkForPIDS(){new VL(this.http).getPidsStatus().then(n=>{this.pids_enabled=n.enabled}).catch(n=>{this.snackBar.open("Error getting PIDS status: "+n.message,"Dismiss",{duration:5e3})})}isMasterOrganization(){return"neurotronics.com"==this.data.name}getOrgAppAccess(){this.app_access=[];let e=this.data.name;null==e?this.http.get(li_backendURL+"/pids/apps",{withCredentials:!0}).subscribe({next:o=>{"apps"in o&&o.apps.forEach(u=>{if("drawbridge"!=u.name.toLowerCase()){let y=new vwe;y.uuid=u.uuid,y.name=u.name,y.access=u.default_basic,y.revokable=!u.default_basic,this.app_access.push(y)}})},error:o=>{this.snackBar.open("Error retrieving app access: "+o.message,"Dismiss",{duration:5e3})}}):this.http.get(li_backendURL+"/organizations/"+e+"/apps",{withCredentials:!0}).subscribe({next:o=>{"apps"in o&&(this.app_access=o.apps)},error:o=>{this.snackBar.open("Error retrieving app access: "+o.message,"Dismiss",{duration:5e3})}})}formHasError(e,n){return!(!e||!e.errors)&&n in e.errors}onToggleWebAppAccess(e){this.access_changed=!0,this.app_access.forEach(n=>{n.name.toLowerCase()===e.toLowerCase()&&(n.access=!n.access)})}onToggleMFARequired(e){if(e.checked){e.source.checked=!1,this.data.require_mfa=!1;let n=new rf;n.html=!1,n.title="Confirm MFA Required",n.msg="Any users currently logged into web applications may be required to re-login (this does not affect license retrievals). If this is your organization, you will be logged out. Any users without MFA setup will be prompted to do so on login, would you like to continue?",n.yes_no=!0;let o=new ha;o.data=n,this.dialog.open(af,o).afterClosed().subscribe({next:r=>{r&&(r.confirmed?(e.source.checked=!0,this.data.require_mfa=!0,this.snackBar.open("Click OK to apply MFA requirement.","Dismiss",{duration:5e3})):this.data.require_mfa=!1)}})}else this.data.require_mfa=!1}onSubmit(){let n,e={...this.data};if(console.log(this.data),console.log(e),this.importing||delete e.uuid,delete e.hidden,null==this.originalData.organization||this.importing?n=D7:(n=D7+"/"+this.originalData.organization.id,delete e.id),null!=e.customer_id&&""==e.customer_id.trim()&&(e.customer_id=null),e.is_distributor?e.distributor_id=-1:-1==e.distributor_id&&(e.is_distributor=!1),this.access_changed&&this.userInfo.isAdmin2()){let o=[];this.app_access.forEach(r=>{r.access&&o.push({uuid:r.uuid,name:r.name})}),e.apps=o}if(null!=this.originalData.organization&&(this.originalData.organization.name!=e.name||this.originalData.organization.is_distributor&&!e.is_distributor)){let o=new rf;o.msg="",this.originalData.organization.name!=e.name&&(o.msg+="Changing the organization name will change part of the login credentials for users. You should make sure all users are aware of this change. "),this.originalData.organization.is_distributor&&!e.is_distributor&&(o.msg+="You are about to remove this organization from being a distributor. Any assigned organizations will be unassigned. "),o.msg+="Would you like to continue?";const r=new ha;r.autoFocus=!1,r.data=o;let y=I=>{if(I){if(!I.confirmed)return;this.finishSubmit(n,e)}};this.dialog.open(af,r).afterClosed().subscribe(y)}else this.finishSubmit(n,e)}finishSubmit(e,n){this.http.post(e,n,{withCredentials:!0}).subscribe(u=>{this.originalData?(Object.assign(this.originalData,u),this.data.require_mfa&&!this.init_mfa_required&&this.userInfo.organization==this.data.name&&this.loginService.logout(!0),this.dialogRef.close(!0)):this.dialogRef.close(u)})}canBeDistributor(){return null==this.data.distributor_id||-1==this.data.distributor_id}canBeDistributed(){return!this.isMasterOrganization()&&0==this.data.is_distributor}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(pa),$e(Po),$e(Mc))};static \u0275cmp=cn({type:t,selectors:[["app-orgs-edit"]],standalone:!1,decls:39,vars:20,consts:[["orgEditForm","ngForm"],["appOrgNameCharCheck","",1,"org-edit-form",3,"ngSubmit"],[1,"input-field-container"],["hideRequiredMarker",""],["matInput","","required","","name","name","placeholder","Name",3,"ngModelChange","readonly","errorStateMatcher","ngModel"],[4,"ngIf"],["matInput","","required","","name","displayName","placeholder","Display name",3,"ngModelChange","readonly","ngModel"],["hideRequiredMarker","",4,"ngIf"],[3,"expanded"],["class","flex-container-rows",4,"ngIf"],[1,"flex-container-rows"],[1,"slide-label"],[1,"slide"],["name","is_test","matTooltip","Allows this organization to be filtered out as an organization used for testing.",3,"ngModelChange","ngModel","checked"],["name","cloud_archive","matTooltip","Enables cloud archiving option for the organization.",3,"ngModelChange","ngModel","checked"],["name","is_dist","matTooltip","Allows this organization to be a distributor for other organizations.",3,"ngModelChange","ngModel","checked","disabled"],[2,"line-height","0.2em"],["align","center"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["matInput","","name","customerID","placeholder","Customer ID",3,"ngModelChange","ngModel"],["name","require_mfa","matTooltip","Require multi-factor login for web (does not apply to license retrieval).",3,"ngModelChange","change","ngModel","checked"],["name","email_mfa","matTooltip","Allow users to receive One-Time Passwords through email.",3,"ngModelChange","ngModel","checked"],[1,"label"],["name","distributor_id","placeholder","Distributed by","matTooltip","Distributor Organization for this organization.",3,"ngModelChange","ngModel","disabled"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],[1,"expansion-header"],["class","flex-container-columns",4,"ngIf"],[1,"flex-container-columns"],[4,"ngFor","ngForOf"],["matInput","","readonly","",3,"value"],["matSuffix","",3,"change","checked","disabled","matTooltip"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content")(3,"div",2)(4,"mat-form-field",3)(5,"input",4),Qn("ngModelChange",function(y){return fe(r),ei(o.data.name,y)||(o.data.name=y),ge(y)}),x(),te(6,cwe,2,0,"mat-error",5),x(),w(7,"mat-form-field",3)(8,"input",6),Qn("ngModelChange",function(y){return fe(r),ei(o.data.friendly_name,y)||(o.data.friendly_name=y),ge(y)}),x()(),te(9,dwe,2,1,"mat-form-field",7),x(),w(10,"mat-expansion-panel",8)(11,"mat-expansion-panel-header"),M(12,"Options"),x(),te(13,uwe,5,2,"div",9)(14,hwe,5,2,"div",9),w(15,"div",10)(16,"div",11),M(17,"Test Organization:"),x(),w(18,"div",12)(19,"mat-slide-toggle",13),Qn("ngModelChange",function(y){return fe(r),ei(o.data.test,y)||(o.data.test=y),ge(y)}),x()()(),w(20,"div",10)(21,"div",11),M(22,"Cloud Archiving:"),x(),w(23,"div",12)(24,"mat-slide-toggle",14),Qn("ngModelChange",function(y){return fe(r),ei(o.data.has_cloudarchiving,y)||(o.data.has_cloudarchiving=y),ge(y)}),x()()(),w(25,"div",10)(26,"div",11),M(27,"Distributor:"),x(),w(28,"div",12)(29,"mat-slide-toggle",15),Qn("ngModelChange",function(y){return fe(r),ei(o.data.is_distributor,y)||(o.data.is_distributor=y),ge(y)}),x()()(),te(30,mwe,7,4,"mat-form-field",5),x(),w(31,"p",16),M(32,"\xa0"),x(),te(33,bwe,5,2,"mat-expansion-panel",5),w(34,"p",16),M(35,"\xa0"),x()(),w(36,"mat-dialog-actions",17)(37,"button",18),M(38,"Save"),x()()()}if(2&n){const r=Vi(1);E(5),N("readonly",o.isMasterOrganization())("errorStateMatcher",o.orgnameInvalidCharMatcher),Kn("ngModel",o.data.name),E(),N("ngIf",o.formHasError(r.form,"orgnameInvalidChars")),E(2),N("readonly",o.isMasterOrganization()),Kn("ngModel",o.data.friendly_name),E(),N("ngIf",!o.isMasterOrganization()),E(),N("expanded",!0),E(3),N("ngIf",o.pids_enabled),E(),N("ngIf",o.pids_enabled),E(5),Kn("ngModel",o.data.test),N("checked",o.data.test),E(5),Kn("ngModel",o.data.has_cloudarchiving),N("checked",o.data.has_cloudarchiving),E(5),Kn("ngModel",o.data.is_distributor),N("checked",o.data.is_distributor)("disabled",!o.canBeDistributor()),E(),N("ngIf",!o.isMasterOrganization()),E(3),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()&&o.userInfo.isAdmin()&&o.app_access.length>0),E(4),N("disabled",!r.form.valid)}},dependencies:[kl,ir,ka,jr,wr,Aa,Jl,ts,Cr,na,Oa,fM,Qs,xa,ws,Fl,Os,zl,Bl,Gd,nh,uc,Pa,rwe],styles:[".input-field-container[_ngcontent-%COMP%]{display:flex;flex-direction:column}.label[_ngcontent-%COMP%]{font-size:small}.uuid[_ngcontent-%COMP%]{font-weight:700;color:gray}.flex-container-columns[_ngcontent-%COMP%]{display:flex;flex-direction:column}.flex-container-rows[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.slide-label[_ngcontent-%COMP%]{font-size:small;vertical-align:bottom}.slide[_ngcontent-%COMP%]{transform:scale(.8);display:flex;align-items:center;padding-bottom:.2em}.input[_ngcontent-%COMP%]{width:100%}.enabled[_ngcontent-%COMP%]{color:green!important}.disabled[_ngcontent-%COMP%]{color:red!important}"]})}return t})();const xwe=()=>[10,25,50,75,100],wwe=t=>["/account/",t],Cwe=t=>["/org/",t,"licenses"],Swe=t=>["/org/",t,"users"],Twe=t=>["/org/",t,"logs"];function Dwe(t,i){if(1&t){const e=pt();w(0,"button",44),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.nameFilter))}),w(1,"mat-icon",18),M(2,"close"),x()()}}function Iwe(t,i){if(1&t){const e=pt();w(0,"button",44),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.customerIDFilter))}),w(1,"mat-icon",18),M(2,"close"),x()()}}function Ewe(t,i){if(1&t&&(w(0,"mat-option",45),M(1),x()),2&t){const e=i.$implicit;N("value",e.value),E(),Ct(e.label)}}function Mwe(t,i){if(1&t){const e=pt();w(0,"button",46),we("click",function(){return fe(e),ge(X().edit(null))}),w(1,"mat-icon",18),M(2,"add"),x()()}}function Awe(t,i){1&t&&(w(0,"th",47),M(1,"Name"),x())}function kwe(t,i){if(1&t&&(w(0,"td",48),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.name)}}function Rwe(t,i){1&t&&(w(0,"th",47),M(1,"Display Name"),x())}function Owe(t,i){if(1&t&&(w(0,"td",49),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.friendly_name)}}function Pwe(t,i){1&t&&(w(0,"th",47),M(1,"Customer ID"),x())}function Lwe(t,i){if(1&t&&(w(0,"td",50),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.customer_id)}}function Fwe(t,i){1&t&&(w(0,"th",51),M(1,"Access Links"),x())}function Nwe(t,i){if(1&t&&(w(0,"td",52)(1,"span",16)(2,"div",53)(3,"a",54)(4,"mat-icon",18),M(5,"account_balance"),x()(),w(6,"span"),M(7,"Account"),x()(),w(8,"div",53)(9,"a",54)(10,"mat-icon",18),M(11,"license"),x()(),w(12,"span"),M(13,"Licenses"),x()(),w(14,"div",53)(15,"a",55)(16,"mat-icon",18),M(17,"group"),x()(),w(18,"span",56),M(19,"Users"),x()(),w(20,"div",53)(21,"a",54)(22,"mat-icon",18),M(23,"article"),x()(),w(24,"span"),M(25,"Logs"),x()()()()),2&t){const e=i.$implicit,n=X();E(3),N("routerLink",Ar(6,wwe,e.name)),E(6),N("routerLink",Ar(8,Cwe,e.name)),E(6),N("routerLink",Ar(10,Swe,e.name))("disabled",!n.canAccessUsers(e.name)),E(3),N("ngClass",n.canAccessUsers(e.name)?"":"disabled-color"),E(3),N("routerLink",Ar(12,Twe,e.name))}}function zwe(t,i){1&t&&(w(0,"th",57),M(1,"Distributor"),x())}function Bwe(t,i){1&t&&(w(0,"span")(1,"mat-icon",60),M(2,"done"),x()())}function Vwe(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",61),M(2,"link"),x()()),2&t){const e=X(2).$implicit;E(),Iv("matTooltip","Distributed by: ",e.distributor_name,"")}}function Uwe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function Hwe(t,i){if(1&t&&(w(0,"span"),te(1,Vwe,3,2,"span",59)(2,Uwe,2,0,"span",59),x()),2&t){const e=X().$implicit;E(),N("ngIf",e.distributor_id&&-1!=e.distributor_id),E(),N("ngIf",!e.distributor_id||-1==e.distributor_id)}}function jwe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function $we(t,i){if(1&t&&(w(0,"td",58)(1,"span"),te(2,Bwe,3,0,"span",59)(3,Hwe,3,2,"span",59),x(),te(4,jwe,2,0,"span",59),x()),2&t){const e=i.$implicit;E(2),N("ngIf",e.is_distributor),E(),N("ngIf",!e.is_distributor),E(),N("ngIf","neurotronics.com"==e.name)}}function Gwe(t,i){1&t&&(w(0,"th",62),M(1,"Enabled"),x())}function qwe(t,i){if(1&t){const e=pt();w(0,"span")(1,"mat-slide-toggle",64),we("change",function(){fe(e);const o=X().$implicit;return ge(X().onToggle(o))}),x()()}if(2&t){const e=X().$implicit,n=X();E(),N("checked",e.enabled)("disabled",!n.userInfo||!n.userInfo.isMasterAdmin())}}function Wwe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function Zwe(t,i){if(1&t&&(w(0,"td",63),te(1,qwe,2,2,"span",59)(2,Wwe,2,0,"span",59),x()),2&t){const e=i.$implicit;E(),N("ngIf","neurotronics.com"!=e.name),E(),N("ngIf","neurotronics.com"==e.name)}}function Ywe(t,i){1&t&&(w(0,"th",57),M(1,"Edit"),x())}function Xwe(t,i){if(1&t){const e=pt();w(0,"span")(1,"button",68),we("click",function(){fe(e);const o=X().$implicit;return ge(X(2).edit(o))}),w(2,"mat-icon",18),M(3,"edit"),x()()()}}function Kwe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function Qwe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function Jwe(t,i){if(1&t&&(w(0,"td",67),te(1,Xwe,4,0,"span",59)(2,Kwe,2,0,"span",59)(3,Qwe,2,0,"span",59),x()),2&t){const e=i.$implicit,n=X(2);E(),N("ngIf",n.userInfo&&n.userInfo.isMasterAdmin()),E(),N("ngIf",n.userInfo&&n.userInfo.isMasterAdmin()&&"neurotronics.com"==e.name),E(),N("ngIf",n.userInfo&&!n.userInfo.isMasterAdmin())}}function eCe(t,i){1&t&&(at(0,65),te(1,Ywe,2,0,"th",34)(2,Jwe,4,3,"td",66),st())}function tCe(t,i){1&t&&Re(0,"tr",69)}function nCe(t,i){1&t&&Re(0,"tr",70)}const M7=li_backendURL+"/organization";let iCe=(()=>{class t{http;dialog;loginService;router;setting={element:{dynamicDownload:null}};paginator;sort;orgsSource=new Fr;userInfo=null;loadingOrgs=!1;nameFilter=new po;customerIDFilter=new po;enabledFilter=new po;distributorFilter=new po;showTestFilter=new po;filteredValues={name:"",customerID:"",enabled:"",distributor_id:"",show_test:""};distributorOrgs=new Set;pageSize=10;columnsToDisplay=["name","friendly_name","customer_id","access-links","is_distributor","enabled","edit"];columnsToDisplayLite=["name","friendly_name","customer_id","access-links","is_distributor","enabled"];constructor(e,n,o,r){this.http=e,this.dialog=n,this.loginService=o,this.router=r}ngOnInit(){this.loginService.userInfo$.subscribe(n=>{this.userInfo=n}),this.refresh(!0);let e=localStorage.getItem("orgPageSize");(""==e||null==e)&&(e="10"),this.pageSize=parseInt(e)}initFilters(){this.LoadFilters()}LoadFilter(e,n=""){let o=localStorage.getItem(e);return(null==o||""==o)&&(o=n),o}LoadFilters(){this.nameFilter.setValue($i.LoadLocalStorageSetting("orgNameFilter")),this.customerIDFilter.setValue($i.LoadLocalStorageSetting("orgCustomerIDFilter")),this.enabledFilter.setValue($i.LoadLocalStorageSetting("orgEnabledFilter","true")),this.distributorFilter.setValue($i.LoadLocalStorageSetting("orgDistFilter","-1")),this.showTestFilter.setValue($i.LoadLocalStorageSetting("orgShowTest","true"))}SaveFilters(){$i.SaveLocalStorageSetting("orgNameFilter",this.nameFilter.value),$i.SaveLocalStorageSetting("orgCustomerIDFilter",this.customerIDFilter.value),$i.SaveLocalStorageSetting("orgEnabledFilter",this.enabledFilter.value),$i.SaveLocalStorageSetting("orgDistFilter",this.distributorFilter.value),$i.SaveLocalStorageSetting("orgShowTest",this.showTestFilter.value)}ClearFilters(){this.nameFilter.setValue(""),this.customerIDFilter.setValue(""),this.enabledFilter.setValue("true"),this.distributorFilter.setValue("-1"),this.showTestFilter.setValue("true"),this.SaveFilters()}ClearFilter(e,n=""){e.setValue(n),this.SaveFilters()}onPage(){this.pageSize=this.paginator.pageSize;let e=this.pageSize.toString();localStorage.setItem("orgPageSize",e)}refresh(e=!1){this.loadingOrgs=!0,this.http.get(M7,{withCredentials:!0}).subscribe(n=>{this.orgsSource.data=n,this.distributorOrgs.clear(),this.distributorOrgs.add({value:String(-1),label:"All"});for(var o=0;onull==r[u]?r[u]:r[u].toString().toLowerCase(),this.orgsSource.sort=this.sort,this.nameFilter.valueChanges.subscribe(r=>{this.filteredValues.name=r,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.customerIDFilter.valueChanges.subscribe(r=>{this.filteredValues.customerID=r,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.enabledFilter.valueChanges.subscribe(r=>{this.filteredValues.enabled=r,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.distributorFilter.valueChanges.subscribe(r=>{this.filteredValues.distributor_id=r,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.showTestFilter.valueChanges.subscribe(r=>{this.filteredValues.show_test=r,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.orgsSource.filterPredicate=this.orgFilterPredicate(),e&&this.initFilters(),this.orgsSource.paginator=this.paginator,this.loadingOrgs=!1})}canAccessUsers(e){return this.userInfo&&this.userInfo.isMasterAdmin()||"neurotronics.com"!=e}clearFilters(){this.nameFilter.setValue(""),this.customerIDFilter.setValue(""),this.enabledFilter.setValue("null"),this.distributorFilter.setValue(""),this.showTestFilter.setValue("true"),this.refresh()}edit(e){let n=new I7;n.importing=!1,n.organization=e;let o=this.dialog.open(E7,{data:n});if(e){let r=u=>{this.refresh()};o.afterClosed().subscribe(r)}else{let r=u=>{if(u){let y=this.orgsSource.data;y.push(u),this.orgsSource.data=y,this.refresh()}};o.afterClosed().subscribe(r)}}onToggle(e){if(!this.userInfo.isMasterAdmin())return;null!=e.customer_id&&""==e.customer_id.trim()&&(e.customer_id=null),e.enabled=!e.enabled;let n=Object.assign(new df,e);null==n.distributor_id&&(n.distributor_id=-1),null==n.is_distributor&&(n.is_distributor=!1),delete n.uuid,delete n.hidden;let o=n.id;return delete n.id,this.http.post(M7+"/"+o,n,{withCredentials:!0}).subscribe(()=>{("true"==this.enabledFilter.value&&!e.enabled||"false"==this.enabledFilter.value&&e.enabled)&&(this.orgFilterPredicate(),this.orgsSource.sort=this.sort)}),!0}onChangeTypeFilter(){localStorage.setItem("orgTypeFilter",this.filteredValues.type)}orgFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=-1!=n.name.toString().trim().toLowerCase().search(r.name.toLowerCase())||-1!=n.friendly_name.toString().trim().toLowerCase().search(r.name.toLowerCase()),y=-1!=n.enabled.toString().trim().search(r.enabled.toLowerCase())||"null"==r.enabled.toLowerCase(),I=""==r.customerID.toLowerCase()||null!=n.customer_id&&-1!=n.customer_id.toString().toLowerCase().search(r.customerID.toLowerCase()),V=null!=n.distributor_id&&n.distributor_id.toString()===r.distributor_id.toLowerCase()||"-1"==r.distributor_id.toLowerCase()||""==r.distributor_id,q="only"==r.show_test.toString().toLowerCase(),ee="true"==r.show_test.toString().toLowerCase(),me="true"==n.test.toString().toLowerCase();return u&&y&&I&&V&&(ee||q&&me||!q&&!ee&&!me)}}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(pa),$e(Po),$e(Ga))};static \u0275cmp=cn({type:t,selectors:[["app-organizations"]],viewQuery:function(n,o){if(1&n&&(mn(kr,5),mn(Js,5)),2&n){let r;Bt(r=Vt())&&(o.paginator=r.first),Bt(r=Vt())&&(o.sort=r.first)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:78,vars:22,consts:[[1,"main-container"],[1,"main-header"],[3,"expanded"],[1,"controls"],[1,"filters"],[1,"filter-field"],["matInput","","id","org-name-filter",1,"form-field",3,"input","formControl"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","id","org-custid-filter",1,"form-field",3,"input","formControl"],["id","org-enabled-filter",3,"selectionChange","formControl"],["value","null"],["value","true"],["value","false"],["id","org-dist-filter",3,"selectionChange","formControl"],[3,"value",4,"ngFor","ngForOf"],["value","only"],[1,"button-group"],["mat-icon-button","","aria-label","Clear Filters","matTooltip","Clear Filters","id","filter-clear-btn",3,"click"],["fontSet","material-symbols-outlined"],["mat-icon-button","","aria-label","Add Organization","matTooltip","Add Organization","id","add-org-btn",3,"click",4,"ngIf"],[1,"custom-table-responsive"],["mat-table","","matSort","","id","org-table",3,"dataSource"],[1,"table-caption"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Name",4,"matCellDef"],["matColumnDef","friendly_name"],["mat-cell","","data-label","Display Name",4,"matCellDef"],["matColumnDef","customer_id"],["mat-cell","","data-label","Customer ID",4,"matCellDef"],["matColumnDef","access-links"],["mat-header-cell","","mat-sort-header","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Access Links",4,"matCellDef"],["matColumnDef","is_distributor"],["mat-header-cell","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Distributor",4,"matCellDef"],["matColumnDef","enabled"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Enabled",4,"matCellDef"],["matColumnDef","edit",4,"ngIf"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","hover-row",4,"matRowDef","matRowDefColumns"],["noRowsText","No organizations",3,"isLoading","dataSource"],[3,"page","hidden","length","pageSize","pageSizeOptions","showFirstLastButtons"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click"],[3,"value"],["mat-icon-button","","aria-label","Add Organization","matTooltip","Add Organization","id","add-org-btn",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Name"],["mat-cell","","data-label","Display Name"],["mat-cell","","data-label","Customer ID"],["mat-header-cell","","mat-sort-header","","disabled",""],["mat-cell","","data-label","Access Links"],[1,"labeled-icon-button"],["mat-icon-button","","href","#",1,"sm-icon-btn",3,"routerLink"],["mat-icon-button","","href","#",1,"sm-icon-btn",3,"routerLink","disabled"],[3,"ngClass"],["mat-header-cell","","disabled",""],["mat-cell","","data-label","Distributor"],[4,"ngIf"],["fontSet","material-symbols-outlined","matTooltip","Distributor"],["fontSet","material-symbols-outlined",3,"matTooltip"],["mat-header-cell",""],["mat-cell","","data-label","Enabled"],[3,"change","checked","disabled"],["matColumnDef","edit"],["mat-cell","","data-label","Edit",4,"matCellDef"],["mat-cell","","data-label","Edit"],["mat-mini-fab","","color","primary","matTooltip","Edit Organization",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-header-row",""],["mat-row","",1,"hover-row"]],template:function(n,o){1&n&&(w(0,"main",0)(1,"header",1)(2,"mat-accordion")(3,"mat-expansion-panel",2)(4,"mat-expansion-panel-header")(5,"mat-panel-title")(6,"h5"),M(7,"Organizations"),x()()(),w(8,"form")(9,"div",3)(10,"span",4)(11,"mat-form-field",5)(12,"mat-label"),M(13,"Name Filter:"),x(),w(14,"input",6),we("input",function(){return o.SaveFilters()}),x(),te(15,Dwe,3,0,"button",7),x(),w(16,"mat-form-field",5)(17,"mat-label"),M(18,"Customer ID Filter:"),x(),w(19,"input",8),we("input",function(){return o.SaveFilters()}),x(),te(20,Iwe,3,0,"button",7),x(),w(21,"mat-form-field",5)(22,"mat-label"),M(23,"Enabled Filter:"),x(),w(24,"mat-select",9),we("selectionChange",function(){return o.SaveFilters()}),w(25,"mat-option",10),M(26,"All"),x(),w(27,"mat-option",11),M(28,"Enabled"),x(),w(29,"mat-option",12),M(30,"Disabled"),x()()(),w(31,"mat-form-field",5)(32,"mat-label"),M(33,"Distributor Filter:"),x(),w(34,"mat-select",13),we("selectionChange",function(){return o.SaveFilters()}),te(35,Ewe,2,2,"mat-option",14),x()(),w(36,"mat-form-field",5)(37,"mat-label"),M(38,"Include Tests:"),x(),w(39,"mat-select",13),we("selectionChange",function(){return o.SaveFilters()}),w(40,"mat-option",11),M(41,"Show"),x(),w(42,"mat-option",12),M(43,"Hide"),x(),w(44,"mat-option",15),M(45,"Only"),x()()()(),w(46,"span",16)(47,"button",17),we("click",function(){return o.ClearFilters()}),w(48,"mat-icon",18),M(49,"clear"),x()(),te(50,Mwe,3,0,"button",19),x()()()()()(),w(51,"div",20)(52,"table",21)(53,"caption",22),M(54," Organizations "),x(),at(55,23),te(56,Awe,2,0,"th",24)(57,kwe,2,1,"td",25),st(),at(58,26),te(59,Rwe,2,0,"th",24)(60,Owe,2,1,"td",27),st(),at(61,28),te(62,Pwe,2,0,"th",24)(63,Lwe,2,1,"td",29),st(),at(64,30),te(65,Fwe,2,0,"th",31)(66,Nwe,26,14,"td",32),st(),at(67,33),te(68,zwe,2,0,"th",34)(69,$we,5,3,"td",35),st(),at(70,36),te(71,Gwe,2,0,"th",37)(72,Zwe,3,2,"td",38),st(),te(73,eCe,3,0,"ng-container",39)(74,tCe,1,0,"tr",40)(75,nCe,1,0,"tr",41),x(),Re(76,"app-table-placeholder",42),w(77,"mat-paginator",43),we("page",function(){return o.onPage()}),x()()()),2&n&&(E(3),N("expanded",!0),E(11),N("formControl",o.nameFilter),E(),N("ngIf",""!=o.nameFilter.value),E(4),N("formControl",o.customerIDFilter),E(),N("ngIf",""!=o.customerIDFilter.value),E(4),N("formControl",o.enabledFilter),E(10),N("formControl",o.distributorFilter),E(),N("ngForOf",o.distributorOrgs),E(4),N("formControl",o.showTestFilter),E(11),N("ngIf",o.userInfo&&o.userInfo.isMasterAdmin()),E(2),N("dataSource",o.orgsSource),E(21),N("ngIf",o.userInfo&&o.userInfo.isMasterAdmin()),E(),N("matHeaderRowDef",o.userInfo&&o.userInfo.isMasterAdmin()?o.columnsToDisplay:o.columnsToDisplayLite),E(),N("matRowDefColumns",o.userInfo&&o.userInfo.isMasterAdmin()?o.columnsToDisplay:o.columnsToDisplayLite),E(),N("isLoading",o.loadingOrgs)("dataSource",o.orgsSource),E(),N("hidden",o.orgsSource.filteredData.length<10)("length",o.orgsSource.filteredData.length)("pageSize",o.pageSize)("pageSizeOptions",jn(21,xwe))("showFirstLastButtons",!0))},dependencies:[$d,kl,ir,xb,ka,jr,wr,Aa,Xu,Cr,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,T3,qa,D_,th,zl,Bl,od,Gd,nh,uc,Sr,Pa,kr,F_],styles:[".main-header[_ngcontent-%COMP%]{height:auto;position:sticky;top:3em;width:100%;z-index:1000}.controls[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}@media screen and (max-width: 900px){ .mdc-tab__text-label{font-size:x-small}.button-group[_ngcontent-%COMP%]{justify-content:end}}"]})}return t})();const A7=li_backendURL+"/organization";let oCe=(()=>{class t{dialogRef;originalData;http;dialog;data;constructor(e,n,o,r){this.dialogRef=e,this.originalData=n,this.http=o,this.dialog=r,n?this.data={...n}:(this.data=new df,this.data.enabled=!0)}ngOnInit(){}onSubmit(){let n,e=new df;e.name=this.originalData.name,e.friendly_name=this.data.friendly_name,delete e.uuid,delete e.hidden,this.originalData?(n=A7+"/"+this.originalData.id,delete e.id):n=A7,e.customer_id=this.originalData.customer_id,e.name=this.originalData.name,e.distributor_id=this.originalData.distributor_id,e.is_distributor=this.originalData.is_distributor,e.enabled=this.originalData.enabled,null!=e.customer_id&&""==e.customer_id.trim()&&(e.customer_id=null),this.finishSubmit(n,e)}finishSubmit(e,n){this.http.post(e,n,{withCredentials:!0}).subscribe(u=>{this.originalData?(Object.assign(this.originalData,u),this.dialogRef.close(!0)):this.dialogRef.close(u)})}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Uo),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-orgs-edit"]],standalone:!1,decls:9,vars:2,consts:[["orgEditForm","ngForm"],[3,"ngSubmit"],["hideRequiredMarker",""],["matInput","","required","","name","displayName","placeholder","Display name",3,"ngModelChange","ngModel"],["align","center"],["mat-raised-button","","color","primary","type","submit",3,"disabled"]],template:function(n,o){if(1&n){const r=pt();w(0,"form",1,0),we("ngSubmit",function(){return fe(r),ge(o.onSubmit())}),w(2,"mat-dialog-content")(3,"div")(4,"mat-form-field",2)(5,"input",3),Qn("ngModelChange",function(y){return fe(r),ei(o.data.friendly_name,y)||(o.data.friendly_name=y),ge(y)}),x()()()(),w(6,"mat-dialog-actions",4)(7,"button",5),M(8,"Save"),x()()()}if(2&n){const r=Vi(1);E(5),Kn("ngModel",o.data.friendly_name),E(2),N("disabled",!r.form.valid)}},dependencies:[ka,jr,wr,Aa,Jl,ts,Cr,na,xa,ws,Fl,Os],styles:["mat-divider[_ngcontent-%COMP%]{margin-top:.5em;margin-bottom:.5em}"]})}return t})();const rCe=()=>[10,25,50,75,100],aCe=t=>["/account/",t],sCe=t=>["/org/",t,"licenses"],lCe=t=>["/org/",t,"users"];function cCe(t,i){if(1&t){const e=pt();w(0,"button",37),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.nameFilter))}),w(1,"mat-icon",15),M(2,"close"),x()()}}function dCe(t,i){if(1&t){const e=pt();w(0,"button",37),we("click",function(){fe(e);const o=X();return ge(o.ClearFilter(o.customerIDFilter))}),w(1,"mat-icon",15),M(2,"close"),x()()}}function uCe(t,i){1&t&&(w(0,"th",38),M(1,"Name"),x())}function hCe(t,i){if(1&t&&(w(0,"td",39),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.name)}}function pCe(t,i){1&t&&(w(0,"th",38),M(1,"Display Name"),x())}function mCe(t,i){if(1&t&&(w(0,"td",40),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.friendly_name)}}function fCe(t,i){1&t&&(w(0,"th",38),M(1,"Customer ID"),x())}function _Ce(t,i){if(1&t&&(w(0,"td",41),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.customer_id)}}function gCe(t,i){1&t&&(w(0,"th",42),M(1,"Access Links"),x())}function bCe(t,i){if(1&t&&(w(0,"td",43)(1,"span",44)(2,"span",13)(3,"div",45)(4,"a",46)(5,"mat-icon",15),M(6,"account_balance"),x()(),w(7,"span"),M(8,"Account"),x()(),w(9,"div",45)(10,"a",46)(11,"mat-icon",15),M(12,"license"),x()(),w(13,"span"),M(14,"Licenses"),x()(),w(15,"div",45)(16,"a",46)(17,"mat-icon",15),M(18,"group"),x()(),w(19,"span"),M(20,"Users"),x()()()()()),2&t){const e=i.$implicit;E(4),N("routerLink",Ar(3,aCe,e.name)),E(6),N("routerLink",Ar(5,sCe,e.name)),E(6),N("routerLink",Ar(7,lCe,e.name))}}function yCe(t,i){1&t&&(w(0,"th",42),M(1,"Enabled"),x())}function vCe(t,i){1&t&&(w(0,"span")(1,"mat-icon",15),M(2,"check_circle"),x()())}function xCe(t,i){1&t&&(w(0,"span")(1,"mat-icon",15),M(2,"cancel"),x()())}function wCe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function CCe(t,i){if(1&t&&(w(0,"td",47),te(1,vCe,3,0,"span",48)(2,xCe,3,0,"span",48)(3,wCe,2,0,"span",48),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.enabled),E(),N("ngIf",!e.enabled),E(),N("ngIf",!e.is_distributor)}}function SCe(t,i){1&t&&(w(0,"th",42),M(1,"Edit"),x())}function TCe(t,i){if(1&t){const e=pt();w(0,"span")(1,"button",50),we("click",function(){fe(e);const o=X().$implicit;return ge(X().edit(o))}),w(2,"mat-icon",15),M(3,"edit"),x()()()}}function DCe(t,i){1&t&&(w(0,"span"),Re(1,"p"),x())}function ICe(t,i){if(1&t&&(w(0,"td",49),te(1,TCe,4,0,"span",48)(2,DCe,2,0,"span",48),x()),2&t){const e=X();E(),N("ngIf",e.userInfo&&e.userInfo.isDistributorAdmin()),E(),N("ngIf",e.userInfo&&!e.userInfo.isDistributorAdmin())}}function ECe(t,i){1&t&&Re(0,"tr",51)}function MCe(t,i){1&t&&Re(0,"tr",52)}const ACe=li_backendURL+"/distributor_organizations";let kCe=(()=>{class t{http;dialog;loginService;paginator;sort;orgsSource=new Fr;userInfo=null;loadingOrgs=!0;nameFilter=new po;customerIDFilter=new po;enabledFilter=new po;pageSize=10;filteredValues={name:"",customerID:"",enabled:""};columnsToDisplay=["name","friendly_name","customer_id","access-links","enabled","edit"];constructor(e,n,o){this.http=e,this.dialog=n,this.loginService=o}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.refresh(),this.initPageSize()}refresh(){this.loadingOrgs=!0;let e={};e.name=this.userInfo.organization,this.http.get(ACe,{params:e,withCredentials:!0}).subscribe(n=>{this.orgsSource.data=n,this.orgsSource.sortingDataAccessor=(o,r)=>null==o[r]?o[r]:o[r].toString().toLowerCase(),this.orgsSource.sort=this.sort,this.nameFilter.valueChanges.subscribe(o=>{this.filteredValues.name=o,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.customerIDFilter.valueChanges.subscribe(o=>{this.filteredValues.customerID=o,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.enabledFilter.valueChanges.subscribe(o=>{this.filteredValues.enabled=o,this.orgsSource.filter=JSON.stringify(this.filteredValues)}),this.nameFilter.setValue(""),this.customerIDFilter.setValue(""),this.enabledFilter.setValue("null"),this.orgsSource.filterPredicate=this.orgFilterPredicate(),this.orgsSource.paginator=this.paginator,this.loadingOrgs=!1})}initPageSize(){let e=localStorage.getItem("orgDistPageSize");(""==e||null==e)&&(e="10"),this.orgsSource.data.length>10&&(this.pageSize=parseInt(e))}onPage(){this.pageSize=this.paginator.pageSize;let e=this.pageSize.toString();localStorage.setItem("orgDistPageSize",e)}LoadFilters(){this.nameFilter.setValue($i.LoadLocalStorageSetting("orgNameFilter")),this.customerIDFilter.setValue($i.LoadLocalStorageSetting("orgCustomerIDFilter")),this.enabledFilter.setValue($i.LoadLocalStorageSetting("orgEnabledFilter","null"))}SaveFilters(){$i.SaveLocalStorageSetting("orgNameFilter",this.nameFilter.value),$i.SaveLocalStorageSetting("orgCustomerIDFilter",this.customerIDFilter.value),$i.SaveLocalStorageSetting("orgEnabledFilter",this.enabledFilter.value)}ClearFilters(){this.nameFilter.setValue(""),this.customerIDFilter.setValue(""),this.enabledFilter.setValue("true"),this.SaveFilters(),this.refresh()}ClearFilter(e,n=""){e.setValue(n),this.SaveFilters()}edit(e){this.dialog.open(oCe,{data:e})}orgFilterPredicate(){return(n,o)=>{let r=JSON.parse(o);return!(-1==n.name.toString().trim().toLowerCase().search(r.name.toLowerCase())&&-1==n.friendly_name.toString().trim().toLowerCase().search(r.name.toLowerCase())||-1==n.enabled.toString().trim().search(r.enabled.toLowerCase())&&"null"!=r.enabled.toLowerCase()||""!=r.customerID.toLowerCase()&&(null==n.customer_id||-1==n.customer_id.toString().toLowerCase().search(r.customerID.toLowerCase())))}}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(pa),$e(Po))};static \u0275cmp=cn({type:t,selectors:[["app-organizations"]],viewQuery:function(n,o){if(1&n&&(mn(kr,5),mn(Js,5)),2&n){let r;Bt(r=Vt())&&(o.paginator=r.first),Bt(r=Vt())&&(o.sort=r.first)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:59,vars:17,consts:[[1,"main-container"],[1,"main-header"],[3,"expanded"],[1,"controls"],[1,"filters"],[1,"filter-field"],["matInput","","id","org-name-filter",1,"form-field",3,"input","formControl"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","id","org-custid-filter",1,"form-field",3,"input","formControl"],["id","org-enabled-filter",3,"selectionChange","formControl"],["value","null"],["value","true"],["value","false"],[1,"button-group"],["mat-icon-button","","aria-label","Clear Filters","matTooltip","Clear Filters","id","filter-clear-btn",3,"click"],["fontSet","material-symbols-outlined"],[1,"custom-table-responsive"],["matSort","","mat-table","","id","org-table",3,"dataSource"],[1,"table-caption"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Name",4,"matCellDef"],["matColumnDef","friendly_name"],["mat-cell","","data-label","Display Name",4,"matCellDef"],["matColumnDef","customer_id"],["mat-cell","","data-label","Customer ID",4,"matCellDef"],["matColumnDef","access-links"],["mat-header-cell","","mat-sort-header","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Access Links",4,"matCellDef"],["matColumnDef","enabled"],["mat-cell","","data-label","Enabled",4,"matCellDef"],["matColumnDef","edit"],["mat-cell","","data-label","Edit",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","hover-row",4,"matRowDef","matRowDefColumns"],["noRowsText","No distributed organizations",3,"isLoading","dataSource"],[3,"page","hidden","length","pageSize","pageSizeOptions","showFirstLastButtons"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Name"],["mat-cell","","data-label","Display Name"],["mat-cell","","data-label","Customer ID"],["mat-header-cell","","mat-sort-header","","disabled",""],["mat-cell","","data-label","Access Links"],[1,"button-test"],[1,"labeled-icon-button"],["mat-icon-button","","href","#",1,"sm-icon-btn",3,"routerLink"],["mat-cell","","data-label","Enabled"],[4,"ngIf"],["mat-cell","","data-label","Edit"],["mat-mini-fab","","color","primary","matTooltip","Edit Organization",1,"sm-mini-fab-button","action-btn",3,"click"],["mat-header-row",""],["mat-row","",1,"hover-row"]],template:function(n,o){1&n&&(w(0,"main",0)(1,"mat-accordion",1)(2,"mat-expansion-panel",2)(3,"mat-expansion-panel-header")(4,"mat-panel-title"),M(5,"Organization Controls"),x()(),w(6,"form")(7,"div",3)(8,"span",4)(9,"mat-form-field",5)(10,"mat-label"),M(11,"Name Filter:"),x(),w(12,"input",6),we("input",function(){return o.SaveFilters()}),x(),te(13,cCe,3,0,"button",7),x(),w(14,"mat-form-field",5)(15,"mat-label"),M(16,"Customer ID Filter:"),x(),w(17,"input",8),we("input",function(){return o.SaveFilters()}),x(),te(18,dCe,3,0,"button",7),x(),w(19,"mat-form-field",5)(20,"mat-label"),M(21,"Enabled Filter:"),x(),w(22,"mat-select",9),we("selectionChange",function(){return o.SaveFilters()}),w(23,"mat-option",10),M(24,"All"),x(),w(25,"mat-option",11),M(26,"Enabled"),x(),w(27,"mat-option",12),M(28,"Disabled"),x()()()(),w(29,"span",13)(30,"button",14),we("click",function(){return o.ClearFilters()}),w(31,"mat-icon",15),M(32,"clear"),x()()()()()()(),w(33,"div",16)(34,"table",17)(35,"caption",18),M(36," Distributed Organizations "),x(),at(37,19),te(38,uCe,2,0,"th",20)(39,hCe,2,1,"td",21),st(),at(40,22),te(41,pCe,2,0,"th",20)(42,mCe,2,1,"td",23),st(),at(43,24),te(44,fCe,2,0,"th",20)(45,_Ce,2,1,"td",25),st(),at(46,26),te(47,gCe,2,0,"th",27)(48,bCe,21,9,"td",28),st(),at(49,29),te(50,yCe,2,0,"th",27)(51,CCe,4,3,"td",30),st(),at(52,31),te(53,SCe,2,0,"th",27)(54,ICe,3,2,"td",32),st(),te(55,ECe,1,0,"tr",33)(56,MCe,1,0,"tr",34),x(),Re(57,"app-table-placeholder",35),w(58,"mat-paginator",36),we("page",function(){return o.onPage()}),x()()()),2&n&&(E(2),N("expanded",!0),E(10),N("formControl",o.nameFilter),E(),N("ngIf",""!=o.nameFilter.value),E(4),N("formControl",o.customerIDFilter),E(),N("ngIf",""!=o.customerIDFilter.value),E(4),N("formControl",o.enabledFilter),E(12),N("dataSource",o.orgsSource),E(21),N("matHeaderRowDef",o.columnsToDisplay),E(),N("matRowDefColumns",o.columnsToDisplay),E(),N("isLoading",o.loadingOrgs)("dataSource",o.orgsSource),E(),N("hidden",o.orgsSource.filteredData.length<=10)("length",o.orgsSource.filteredData.length)("pageSize",o.pageSize)("pageSizeOptions",jn(16,rCe))("showFirstLastButtons",!0))},dependencies:[ir,xb,ka,jr,wr,Aa,Xu,Cr,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,T3,qa,D_,th,zl,Bl,od,nh,uc,Sr,Pa,kr,F_],styles:["table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}.main-header[_ngcontent-%COMP%]{height:auto;position:sticky;top:3em;width:100%;z-index:1000}.controls[_ngcontent-%COMP%], .filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}@media screen and (max-width: 900px){.button-group[_ngcontent-%COMP%]{justify-content:end}}"]})}return t})();const RCe=["sortLicense"],OCe=["licensePaginator"],PCe=["sortOrganization"],LCe=["organizationPaginator"],FCe=["sortPurchaseOrders"],NCe=["purchaseOrderPaginator"],UL=()=>[10,25,50,75,100],HL=t=>["/account/",t],k7=t=>["/org/",t,"licenses"],R7=t=>["/org/",t,"users"],O7=t=>["/org/",t,"logs"];function zCe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).orgNameSearchLicense.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function BCe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).noteSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function VCe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).codeSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function UCe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).computerNameSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function HCe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).userNameSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function jCe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Name"),x())}function $Ce(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.orgname)}}function GCe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Display Name"),x())}function qCe(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.orgfriendlyname)}}function WCe(t,i){1&t&&(w(0,"th",48),M(1,"Access Links"),x())}function ZCe(t,i){if(1&t&&(w(0,"td",49)(1,"span",50)(2,"div",51)(3,"a",52)(4,"mat-icon",17),M(5,"account_balance"),x()(),w(6,"span"),M(7,"Account"),x()(),w(8,"div",51)(9,"a",52)(10,"mat-icon",17),M(11,"license"),x()(),w(12,"span"),M(13,"Licenses"),x()(),w(14,"div",51)(15,"a",53)(16,"mat-icon",17),M(17,"group"),x()(),w(18,"span",19),M(19,"Users"),x()(),w(20,"div",51)(21,"a",52)(22,"mat-icon",17),M(23,"article"),x()(),w(24,"span"),M(25,"Logs"),x()()()()),2&t){const e=i.$implicit,n=X(3);E(3),N("routerLink",Ar(6,HL,e.orgname)),E(6),N("routerLink",Ar(8,k7,e.orgname)),E(6),N("routerLink",Ar(10,R7,e.orgname))("disabled",!n.canAccessUsers(e.orgname)),E(3),N("ngClass",n.canAccessUsers(e.orgname)?"":"disabled-color"),E(3),N("routerLink",Ar(12,O7,e.orgname))}}function YCe(t,i){1&t&&(w(0,"th",46),M(1,"Computer Name"),x())}function XCe(t,i){if(1&t&&(w(0,"td",54),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.computername)}}function KCe(t,i){1&t&&(w(0,"th",46),M(1,"Username"),x())}function QCe(t,i){if(1&t&&(w(0,"td",55),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.username)}}function JCe(t,i){1&t&&(w(0,"th",46),M(1,"Code"),x())}function eSe(t,i){if(1&t&&(w(0,"td",56),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.code)}}function tSe(t,i){1&t&&(w(0,"th",46),M(1,"License Subject"),x())}function nSe(t,i){if(1&t&&(w(0,"td",57),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.license_subject)}}function iSe(t,i){1&t&&(w(0,"th",46),M(1,"License Set Notes"),x())}function oSe(t,i){if(1&t&&(w(0,"td",58),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.licensesetnote)}}function rSe(t,i){1&t&&(w(0,"th",46),M(1,"License Notes"),x())}function aSe(t,i){if(1&t&&(w(0,"td",59),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.licensenote)}}function sSe(t,i){1&t&&Re(0,"tr",60)}function lSe(t,i){1&t&&Re(0,"tr",61)}function cSe(t,i){if(1&t){const e=pt();w(0,"mat-accordion",11)(1,"mat-expansion-panel",12)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),M(4,"Search Parameters"),x()(),w(5,"form")(6,"mat-form-field",13)(7,"mat-label"),M(8,"Organization Name"),x(),Re(9,"input",14),te(10,zCe,3,0,"button",15),x(),w(11,"mat-form-field",13)(12,"mat-label"),M(13,"License Notes"),x(),Re(14,"input",14),te(15,BCe,3,0,"button",15),x(),w(16,"mat-form-field",13)(17,"mat-label"),M(18,"Activation Code"),x(),Re(19,"input",14),te(20,VCe,3,0,"button",15),x(),w(21,"mat-form-field",13)(22,"mat-label"),M(23,"Computer Name/ID"),x(),Re(24,"input",14),te(25,UCe,3,0,"button",15),x(),w(26,"mat-form-field",13)(27,"mat-label"),M(28,"User Name"),x(),Re(29,"input",14),te(30,HCe,3,0,"button",15),x(),w(31,"button",16),we("click",function(){return fe(e),ge(X(2).onLicenseSearch())}),w(32,"mat-icon",17),M(33,"play_arrow"),x()(),w(34,"button",18),we("click",function(){return fe(e),ge(X(2).onResetLicenseSearch())}),w(35,"mat-icon",17),M(36,"clear"),x()()(),w(37,"mat-accordion")(38,"mat-expansion-panel")(39,"mat-expansion-panel-header")(40,"mat-panel-title"),M(41,"Search Rules"),x(),w(42,"mat-panel-description"),M(43,"Review search field details."),x()(),w(44,"ul")(45,"li"),M(46,"Search results are displayed only when search criteria has been entered and submitted."),x(),w(47,"li"),M(48,"Organization name is a partial match search and searches both name and display name."),x(),w(49,"li"),M(50,"License notes is a partial match search and searches both license set notes as well as Standalone license notes."),x(),w(51,"li"),M(52,"Activation code is an exact search. It will search for activation codes in Standalone licenses as well as license keys in Private Server licenses."),x(),w(53,"li"),M(54,"Computer name / ID is a partial match search for computer names in Standalone licenses. It can also be used as an exact match for the computer ID in Private Server licenses."),x(),w(55,"li"),M(56,"User name is a partial match search."),x()()()()()(),w(57,"div",19)(58,"table",20,0)(60,"caption",21),M(61," Activated License Search "),x(),at(62,22),te(63,jCe,2,0,"th",23)(64,$Ce,2,1,"td",24),st(),at(65,25),te(66,GCe,2,0,"th",23)(67,qCe,2,1,"td",24),st(),at(68,26),te(69,WCe,2,0,"th",27)(70,ZCe,26,14,"td",28),st(),at(71,29),te(72,YCe,2,0,"th",23)(73,XCe,2,1,"td",30),st(),at(74,31),te(75,KCe,2,0,"th",23)(76,QCe,2,1,"td",32),st(),at(77,33),te(78,JCe,2,0,"th",23)(79,eSe,2,1,"td",34),st(),at(80,35),te(81,tSe,2,0,"th",23)(82,nSe,2,1,"td",36),st(),at(83,37),te(84,iSe,2,0,"th",23)(85,oSe,2,1,"td",38),st(),at(86,39),te(87,rSe,2,0,"th",23)(88,aSe,2,1,"td",40),st(),te(89,sSe,1,0,"tr",41)(90,lSe,1,0,"tr",42),x(),Re(91,"app-table-placeholder",43),w(92,"mat-paginator",44,1),we("page",function(){return fe(e),ge(X(2).onLicensePage())}),x()()}if(2&t){const e=X(2);E(),N("expanded",!0),E(8),N("formControl",e.orgNameSearchLicense),E(),N("ngIf",""!=e.orgNameSearchLicense.value),E(4),N("formControl",e.noteSearch),E(),N("ngIf",""!=e.noteSearch.value),E(4),N("formControl",e.codeSearch),E(),N("ngIf",""!=e.codeSearch.value),E(4),N("formControl",e.computerNameSearch),E(),N("ngIf",""!=e.computerNameSearch.value),E(4),N("formControl",e.userNameSearch),E(),N("ngIf",""!=e.userNameSearch.value),E(),N("disabled",!e.canSearchLicense()),E(26),N("ngClass","custom-table-responsive"),E(),N("dataSource",e.licenseSearchResults),E(31),N("matHeaderRowDef",e.licenseColumnsToDisplay),E(),N("matRowDefColumns",e.licenseColumnsToDisplay),E(),N("isLoading",e.licenseSearchInProgress)("dataSource",e.licenseSearchResults),E(),N("hidden",e.licenseSearchResults.filteredData.length<10)("length",e.licenseSearchResults.filteredData.length)("pageSize",e.licensePageSize)("pageSizeOptions",jn(22,UL))}}function dSe(t,i){1&t&&(w(0,"mat-tab",9),te(1,cSe,94,23,"ng-template",10),x()),2&t&&N("label",X().searchTabs.LICENSE_SEARCH)}function uSe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(2).orgNameSearchOrg.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function hSe(t,i){if(1&t&&(w(0,"mat-option",80),M(1),x()),2&t){const e=i.$implicit;ys("value",e.key),E(),Ct(e.value)}}function pSe(t,i){if(1&t&&(w(0,"mat-option",80),M(1),x()),2&t){const e=i.$implicit;N("value",e),E(),Ct(e)}}function mSe(t,i){if(1&t&&(w(0,"mat-form-field",13)(1,"mat-label"),M(2,"Include Test"),x(),w(3,"mat-select",62)(4,"mat-option",66),M(5,"Yes"),x(),w(6,"mat-option",67),M(7,"No"),x()()()),2&t){const e=X(2);E(3),N("formControl",e.includeTestInSearch)}}function fSe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Name"),x())}function _Se(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.orgname)}}function gSe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Display Name"),x())}function bSe(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.orgfriendlyname)}}function ySe(t,i){1&t&&(w(0,"th",48),M(1,"Access Links"),x())}function vSe(t,i){if(1&t&&(w(0,"div",51)(1,"a",52)(2,"mat-icon",17),M(3,"article"),x()(),w(4,"span"),M(5,"Logs"),x()()),2&t){const e=X().$implicit;E(),N("routerLink",Ar(1,O7,e.orgname))}}function xSe(t,i){if(1&t&&(w(0,"td",49)(1,"span",50)(2,"div",51)(3,"a",52)(4,"mat-icon",17),M(5,"account_balance"),x()(),w(6,"span"),M(7,"Account"),x()(),w(8,"div",51)(9,"a",52)(10,"mat-icon",17),M(11,"license"),x()(),w(12,"span"),M(13,"Licenses"),x()(),w(14,"div",51)(15,"a",53)(16,"mat-icon",17),M(17,"group"),x()(),w(18,"span",19),M(19,"Users"),x()(),te(20,vSe,6,3,"div",81),x()()),2&t){const e=i.$implicit,n=X(2);E(3),N("routerLink",Ar(6,HL,e.orgname)),E(6),N("routerLink",Ar(8,k7,e.orgname)),E(6),N("routerLink",Ar(10,R7,e.orgname))("disabled",!n.canAccessUsers(e.orgname)),E(3),N("ngClass",n.canAccessUsers(e.orgname)?"":"disabled-color"),E(2),N("ngIf",n.userInfo&&n.userInfo.isAdmin2())}}function wSe(t,i){1&t&&(w(0,"th",46),M(1,"Standalone Count"),x())}function CSe(t,i){if(1&t&&(w(0,"td",84),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.standalonecount_total?"None":e.standalonecount_total," ")}}function SSe(t,i){1&t&&(at(0,82),te(1,wSe,2,0,"th",23)(2,CSe,2,1,"td",83),st())}function TSe(t,i){1&t&&(w(0,"th",46),M(1,"Standalone Count Non-Sub"),x())}function DSe(t,i){if(1&t&&(w(0,"td",87),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.standalonecount_nosub?"None":e.standalonecount_nosub," ")}}function ISe(t,i){1&t&&(at(0,85),te(1,TSe,2,0,"th",23)(2,DSe,2,1,"td",86),st())}function ESe(t,i){1&t&&(w(0,"th",46),M(1,"Standalone Count Sub"),x())}function MSe(t,i){if(1&t&&(w(0,"td",90),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.standalonecount_sub?"None":e.standalonecount_sub," ")}}function ASe(t,i){1&t&&(at(0,88),te(1,ESe,2,0,"th",23)(2,MSe,2,1,"td",89),st())}function kSe(t,i){1&t&&(w(0,"th",46),M(1,"On-Demand Count"),x())}function RSe(t,i){if(1&t&&(w(0,"td",93),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.ondemandcount_total?"None":e.ondemandcount_total," ")}}function OSe(t,i){1&t&&(at(0,91),te(1,kSe,2,0,"th",23)(2,RSe,2,1,"td",92),st())}function PSe(t,i){1&t&&(w(0,"th",46),M(1,"On-Demand Count Non-Sub"),x())}function LSe(t,i){if(1&t&&(w(0,"td",96),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.ondemandcount_nosub?"None":e.ondemandcount_nosub," ")}}function FSe(t,i){1&t&&(at(0,94),te(1,PSe,2,0,"th",23)(2,LSe,2,1,"td",95),st())}function NSe(t,i){1&t&&(w(0,"th",46),M(1,"On-Demand Count Sub"),x())}function zSe(t,i){if(1&t&&(w(0,"td",99),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.ondemandcount_sub?"None":e.ondemandcount_sub," ")}}function BSe(t,i){1&t&&(at(0,97),te(1,NSe,2,0,"th",23)(2,zSe,2,1,"td",98),st())}function VSe(t,i){1&t&&(w(0,"th",46),M(1,"Private Server Count"),x())}function USe(t,i){if(1&t&&(w(0,"td",100),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",0==e.privateservercount?"None":e.privateservercount," ")}}function HSe(t,i){1&t&&Re(0,"tr",60)}function jSe(t,i){1&t&&Re(0,"tr",61)}function $Se(t,i){if(1&t){const e=pt();w(0,"mat-accordion",11)(1,"mat-expansion-panel",12)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),M(4,"Search Parameters"),x()(),w(5,"form")(6,"mat-form-field",13)(7,"mat-label"),M(8,"Organization Name"),x(),Re(9,"input",14),te(10,uSe,3,0,"button",15),x(),w(11,"mat-form-field",13)(12,"mat-label"),M(13,"Application"),x(),w(14,"mat-select",62)(15,"mat-option",63),M(16,"All"),x(),te(17,hSe,2,2,"mat-option",64),ti(18,"keyvalue"),x()(),w(19,"mat-form-field",13)(20,"mat-label"),M(21,"Version"),x(),w(22,"mat-select",62),te(23,pSe,2,2,"mat-option",64),x()(),te(24,mSe,8,1,"mat-form-field",65),w(25,"mat-form-field",13)(26,"mat-label"),M(27,"Breakout Subscription"),x(),w(28,"mat-select",62)(29,"mat-option",66),M(30,"Yes"),x(),w(31,"mat-option",67),M(32,"No"),x()()(),w(33,"button",68),we("click",function(){return fe(e),ge(X().onOrganizationSearch(!1))}),w(34,"mat-icon",17),M(35,"play_arrow"),x()(),w(36,"button",18),we("click",function(){return fe(e),ge(X().onResetOrganizationSearch())}),w(37,"mat-icon",17),M(38,"clear"),x()(),w(39,"button",69),we("click",function(){return fe(e),ge(X().onOrganizationSearch(!0))}),w(40,"mat-icon",17),M(41,"download"),x()()(),w(42,"mat-accordion")(43,"mat-expansion-panel")(44,"mat-expansion-panel-header")(45,"mat-panel-title"),M(46,"Search Rules"),x(),w(47,"mat-panel-description"),M(48,"Review search field details."),x()(),w(49,"ul")(50,"li"),M(51,"Search results are displayed only when search criteria has been entered and submitted."),x(),w(52,"li"),M(53,"Organization name is a partial match search and searches both name and display name."),x(),w(54,"li"),M(55,"Application is selectable, available choices are dependent on the selected version."),x(),w(56,"li"),M(57,"Version is selectable, available choices are dependent on the selected application."),x()()()()()(),w(58,"div",19)(59,"table",70,2)(61,"caption",71),M(62," Organization Application Search "),x(),at(63,22),te(64,fSe,2,0,"th",23)(65,_Se,2,1,"td",24),st(),at(66,25),te(67,gSe,2,0,"th",23)(68,bSe,2,1,"td",24),st(),at(69,26),te(70,ySe,2,0,"th",27)(71,xSe,21,12,"td",28),st(),te(72,SSe,3,0,"ng-container",72)(73,ISe,3,0,"ng-container",73)(74,ASe,3,0,"ng-container",74)(75,OSe,3,0,"ng-container",75)(76,FSe,3,0,"ng-container",76)(77,BSe,3,0,"ng-container",77),at(78,78),te(79,VSe,2,0,"th",23)(80,USe,2,1,"td",79),st(),te(81,HSe,1,0,"tr",41)(82,jSe,1,0,"tr",42),x(),Re(83,"app-table-placeholder",43),w(84,"mat-paginator",44,3),we("page",function(){return fe(e),ge(X().onOrganizationPage())}),x()()}if(2&t){const e=X();E(),N("expanded",!0),E(8),N("formControl",e.orgNameSearchOrg),E(),N("ngIf",""!=e.orgNameSearchOrg.value),E(4),N("formControl",e.appSearch),E(3),N("ngForOf",Zm(18,26,e.applications)),E(5),N("formControl",e.versionSearch),E(),N("ngForOf",e.versions_filter[e.appSearch.value]),E(),N("ngIf",e.userInfo&&e.userInfo.isMasterDBUser()),E(4),N("formControl",e.breakoutSubscription),E(11),N("disabled",0==e.organizationSearchResults.data.length),E(19),N("ngClass","custom-table-responsive"),E(),N("dataSource",e.organizationSearchResults),E(13),N("ngIf",!e.breakoutSubscriptions()),E(),N("ngIf",e.breakoutSubscriptions()),E(),N("ngIf",e.breakoutSubscriptions()),E(),N("ngIf",!e.breakoutSubscriptions()),E(),N("ngIf",e.breakoutSubscriptions()),E(),N("ngIf",e.breakoutSubscriptions()),E(4),N("matHeaderRowDef",e.breakoutSubscriptions()?e.orgColumnsToDisplayBreakoutSub:e.orgColumnsToDisplay),E(),N("matRowDefColumns",e.breakoutSubscriptions()?e.orgColumnsToDisplayBreakoutSub:e.orgColumnsToDisplay),E(),N("isLoading",e.orgSearchInProgress)("dataSource",e.organizationSearchResults),E(),N("hidden",e.organizationSearchResults.filteredData.length<10)("length",e.organizationSearchResults.filteredData.length)("pageSize",e.orgPageSize)("pageSizeOptions",jn(28,UL))}}function GSe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).orgNameSearchPurchaseOrders.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function qSe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).poSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function WSe(t,i){if(1&t){const e=pt();w(0,"button",45),we("click",function(){return fe(e),ge(X(3).openSearch.setValue(""))}),w(1,"mat-icon",17),M(2,"close"),x()()}}function ZSe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Name"),x())}function YSe(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.org_name)}}function XSe(t,i){1&t&&(w(0,"th",46),M(1,"Organization Display Name"),x())}function KSe(t,i){if(1&t&&(w(0,"td",117),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.org_friendly)}}function QSe(t,i){1&t&&(w(0,"th",118),M(1,"Account"),x())}function JSe(t,i){if(1&t&&(w(0,"td",119)(1,"div",51)(2,"a",52)(3,"mat-icon",17),M(4,"account_balance"),x()(),w(5,"span"),M(6,"Account"),x()()()),2&t){const e=i.$implicit;E(2),N("routerLink",Ar(1,HL,e.org_name))}}function eTe(t,i){1&t&&(w(0,"th",46),M(1,"PO Number"),x())}function tTe(t,i){if(1&t&&(w(0,"td",120),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",e.po," ")}}function nTe(t,i){1&t&&(w(0,"th",46),M(1,"Open Status"),x())}function iTe(t,i){1&t&&(w(0,"span",125),M(1,"Open"),x())}function oTe(t,i){1&t&&(w(0,"span",126),M(1,"Closed"),x())}function rTe(t,i){if(1&t){const e=pt();w(0,"td",121)(1,"mat-slide-toggle",122),we("change",function(){const o=fe(e).$implicit;return ge(X(3).onPurchaseOrderOpenToggle(o))}),te(2,iTe,2,0,"span",123)(3,oTe,2,0,"span",124),x()()}if(2&t){const e=i.$implicit;E(),N("checked",e.open),E(),N("ngIf",e.open),E(),N("ngIf",!e.open)}}function aTe(t,i){1&t&&(w(0,"th",127),M(1,"Details"),x())}function sTe(t,i){if(1&t){const e=pt();w(0,"td",128)(1,"button",129),we("click",function(){const o=fe(e).$implicit;return ge(X(3).viewPurchaseOrderDetails(o))}),w(2,"mat-icon",17),M(3,"receipt_long"),x()()()}}function lTe(t,i){1&t&&Re(0,"tr",60)}function cTe(t,i){1&t&&Re(0,"tr",61)}function dTe(t,i){if(1&t){const e=pt();w(0,"mat-accordion",11)(1,"mat-expansion-panel",12)(2,"mat-expansion-panel-header")(3,"mat-panel-title"),M(4,"Search Parameters"),x()(),w(5,"form")(6,"mat-form-field",13)(7,"mat-label"),M(8,"Organization Name"),x(),Re(9,"input",14),te(10,GSe,3,0,"button",15),x(),w(11,"mat-form-field",13)(12,"mat-label"),M(13,"PO Number"),x(),Re(14,"input",14),te(15,qSe,3,0,"button",15),x(),w(16,"mat-form-field",13)(17,"mat-label"),M(18,"Open Status"),x(),w(19,"mat-select",101)(20,"mat-option",80),M(21,"All"),x(),w(22,"mat-option",80),M(23,"Open"),x(),w(24,"mat-option",80),M(25,"Closed"),x()(),te(26,WSe,3,0,"button",15),x(),w(27,"button",68),we("click",function(){return fe(e),ge(X(2).onPurchaseOrderSearch())}),w(28,"mat-icon",17),M(29,"play_arrow"),x()(),w(30,"button",18),we("click",function(){return fe(e),ge(X(2).onResetPurchaseOrderSearch())}),w(31,"mat-icon",17),M(32,"clear"),x()()(),w(33,"mat-accordion")(34,"mat-expansion-panel")(35,"mat-expansion-panel-header")(36,"mat-panel-title"),M(37,"Search Rules"),x(),w(38,"mat-panel-description"),M(39,"Review search field details."),x()(),w(40,"ul")(41,"li"),M(42,"Search results are displayed only when search criteria has been entered and submitted."),x(),w(43,"li"),M(44,"Organization name is a partial match search and searches both name and display name."),x(),w(45,"li"),M(46,"PO Number is a partial match search."),x(),w(47,"li"),M(48,"Open Status filters by all/open/closed."),x()()()()()(),w(49,"div",19)(50,"table",102,4)(52,"caption",71),M(53," Purchase Order Search "),x(),at(54,103),te(55,ZSe,2,0,"th",23)(56,YSe,2,1,"td",24),st(),at(57,104),te(58,XSe,2,0,"th",23)(59,KSe,2,1,"td",105),st(),at(60,106),te(61,QSe,2,0,"th",107)(62,JSe,7,3,"td",108),st(),at(63,109),te(64,eTe,2,0,"th",23)(65,tTe,2,1,"td",110),st(),at(66,111),te(67,nTe,2,0,"th",23)(68,rTe,4,3,"td",112),st(),at(69,113),te(70,aTe,2,0,"th",114)(71,sTe,4,0,"td",115),st(),te(72,lTe,1,0,"tr",41)(73,cTe,1,0,"tr",42),x(),Re(74,"app-table-placeholder",116),w(75,"mat-paginator",44,5),we("page",function(){return fe(e),ge(X(2).onPurchaseOrderPage())}),x()()}if(2&t){const e=X(2);E(),N("expanded",!0),E(8),N("formControl",e.orgNameSearchPurchaseOrders),E(),N("ngIf",""!=e.orgNameSearchPurchaseOrders.value),E(4),N("formControl",e.poSearch),E(),N("ngIf",""!=e.poSearch.value),E(4),N("formControl",e.openSearch),E(),N("value","ALL"),E(2),N("value",!0),E(2),N("value",!1),E(2),N("ngIf",""!=e.openSearch.value),E(23),N("ngClass",e.poSearchInProgress?"hide-item":"custom-table-responsive"),E(),N("dataSource",e.poSearchResults),E(22),N("matHeaderRowDef",e.poColumnsToDisplay),E(),N("matRowDefColumns",e.poColumnsToDisplay),E(),N("isLoading",e.poSearchInProgress)("dataSource",e.poSearchResults),E(),N("hidden",e.poSearchResults.filteredData.length<10)("length",e.poSearchResults.filteredData.length)("pageSize",e.poPageSize)("pageSizeOptions",jn(20,UL))}}function uTe(t,i){1&t&&(w(0,"mat-tab",9),te(1,dTe,77,21,"ng-template",10),x()),2&t&&N("label",X().searchTabs.PURCHASE_ORDER_SEARCH)}const hTe=li_backendURL+"/search",pTe=li_backendURL+"/org_search",mTe=li_backendURL+"/po_search";var Fb=function(t){return t.LICENSE_SEARCH="License Search",t.ORGANIZATION_SEARCH="Organization Search",t.PURCHASE_ORDER_SEARCH="Purchase Order Search",t}(Fb||{});let fTe=(()=>{class t{http;loginService;dialog;downloadSetting=new uge;userInfo=null;tabIndex=0;licenseSort;LicensesPaginator;licenseSearchResults=new Fr([]);orgNameSearchLicense=new po("");noteSearch=new po("");codeSearch=new po("");computerNameSearch=new po("");userNameSearch=new po("");licenseSearchInProgress=!1;licensePageSize=10;distributorOrgs=new Set;licenseColumnsToDisplay=["orgname","orgfriendlyname","access-links","computername","username","code","license_subject","setnotes","licensenotes"];orgSort;OrganizationPaginator;organizationSearchResults=new Fr([]);orgNameSearchOrg=new po("");appSearch=new po("");versionSearch=new po("");includeTestInSearch=new po("");breakoutSubscription=new po("");orgSearchInProgress=!1;orgPageSize=10;orgColumnsToDisplay=["orgname","orgfriendlyname","access-links","standalonecount_total","ondemandcount_total","privateservercount"];orgColumnsToDisplayBreakoutSub=["orgname","orgfriendlyname","access-links","standalonecount_nosub","standalonecount_sub","ondemandcount_nosub","ondemandcount_sub","privateservercount"];purchaseOrderSort;PurchaseOrderPaginator;poSearchResults=new Fr([]);orgNameSearchPurchaseOrders=new po;poSearch=new po;openSearch=new po;poSearchInProgress=!1;poPageSize=10;poColumnsToDisplay=["org_name","org_friendly","account-links","po","open","details"];searchTabs=Fb;applications=new Map(Wx);versions_filter=new Lj(!0);constructor(e,n,o){this.http=e,this.loginService=n,this.dialog=o}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.loadTabSelection(),this.resetFilters(),this.loadPageSizes()}loadTabSelection(){let e=localStorage.getItem("searchTabSelection");Object.values(Fb).includes(e)||(e=Fb.ORGANIZATION_SEARCH),this.tabIndex=this.userInfo.isMasterDBUser()?[Fb.LICENSE_SEARCH,Fb.ORGANIZATION_SEARCH,Fb.PURCHASE_ORDER_SEARCH].findIndex(o=>o===e):[Fb.ORGANIZATION_SEARCH].findIndex(o=>o===e)}loadPageSizes(){let e=localStorage.getItem("searchPageSize");(""==e||null==e)&&(e="10"),this.licensePageSize=parseInt(e),e=localStorage.getItem("orgSearchPageSize"),(""==e||null==e)&&(e="10"),this.orgPageSize=parseInt(e),e=localStorage.getItem("poSearchPageSize"),(""==e||null==e)&&(e="10"),this.poPageSize=parseInt(e),this.poSearchResults.data.length>10&&(this.PurchaseOrderPaginator.pageSize=this.poPageSize)}onTabChange(e){null!=e&&localStorage.setItem("searchTabSelection",e.tab.textLabel)}resetFilters(){this.onResetLicenseSearch(),this.onResetOrganizationSearch(),this.onResetPurchaseOrderSearch()}canAccessUsers(e){return this.userInfo&&this.userInfo.isMasterAdmin()||"neurotronics.com"!=e}onLicenseSearch(){if(!this.userInfo||!this.userInfo.isMasterDBUser())return;this.licenseSearchInProgress=!0,this.licenseSearchResults.data=[];let e={};""!=this.orgNameSearchLicense.value&&null!=this.orgNameSearchLicense.value&&(e.orgname=this.orgNameSearchLicense.value),""!=this.noteSearch.value&&null!=this.noteSearch.value&&(e.note=this.noteSearch.value),""!=this.codeSearch.value&&null!=this.codeSearch.value&&(e.code=this.codeSearch.value),""!=this.computerNameSearch.value&&null!=this.computerNameSearch.value&&(e.computername=this.computerNameSearch.value),""!=this.userNameSearch.value&&null!=this.userNameSearch.value&&(e.username=this.userNameSearch.value),this.http.post(hTe,e,{withCredentials:!0}).subscribe(r=>{this.licenseSearchResults.data=r,this.licenseSearchResults.sortingDataAccessor=(u,y)=>null==u[y]?u[y]:u[y].toString().toLowerCase(),this.licenseSearchResults.sort=this.licenseSort,this.licenseSearchResults.data.length>10&&(this.LicensesPaginator.pageSize=this.licensePageSize),this.licenseSearchResults.paginator=this.LicensesPaginator,this.licenseSearchInProgress=!1})}canSearchLicense(){return""!=this.orgNameSearchLicense.value||""!=this.noteSearch.value||""!=this.codeSearch.value||""!=this.computerNameSearch.value||""!=this.userNameSearch.value}onResetLicenseSearch(){this.licenseSearchResults.data=[],this.orgNameSearchLicense.setValue(""),this.noteSearch.setValue(""),this.codeSearch.setValue(""),this.computerNameSearch.setValue(""),this.userNameSearch.setValue(""),this.licenseSearchResults.data=[]}onLicensePage(){this.licensePageSize=this.LicensesPaginator.pageSize;let e=this.licensePageSize.toString();localStorage.setItem("searchPageSize",e)}onOrganizationSearch(e){let n={};""!=this.orgNameSearchOrg.value&&null!=this.orgNameSearchOrg.value&&(n.orgname=this.orgNameSearchOrg.value),""!=this.appSearch.value&&"All"!=this.appSearch.value&&null!=this.appSearch.value&&(n.app=this.appSearch.value),""!=this.versionSearch.value&&"All"!=this.versionSearch.value&&null!=this.versionSearch.value&&(n.version=this.versionSearch.value),e&&(n.csv=!0),n.include_test=!this.userInfo.isMasterDBUser()||"true"==this.includeTestInSearch.value,n.breakout_sub="true"==this.breakoutSubscription.value,e||(this.orgSearchInProgress=!0,this.organizationSearchResults.data=[]),this.http.post(pTe,n,{withCredentials:!0}).subscribe(u=>{if(e){if(null!=u.csv){let y=new Date,I=new $i,V={fileName:"",text:"",type:""};V.fileName="OrgApplicationSearch"+y.toISOString(),V.text=u.csv,V.type="csv",I.onDynamicDownloadByHtmlTag(this.downloadSetting,V)}}else this.organizationSearchResults.data=u.data,this.organizationSearchResults.sortingDataAccessor=(y,I)=>{switch(I){case"standalonecount_total":return y.standalonecount_total;case"standalonecount_nosub":return y.standalonecount_nosub;case"standalonecount_sub":return y.standalonecount_sub;case"ondemandcount_total":return y.ondemandcount_total;case"ondemandcount_nosub":return y.ondemandcount_nosub;case"ondemandcount_sub":return y.ondemandcount_sub;case"privateservercount":return y.privateservercount;default:return null==y[I]?y[I]:y[I].toLowerCase()}},this.organizationSearchResults.sort=this.orgSort,this.organizationSearchResults.data.length>10&&(this.OrganizationPaginator.pageSize=this.orgPageSize),this.organizationSearchResults.paginator=this.OrganizationPaginator,this.orgSearchInProgress=!1})}onResetOrganizationSearch(){this.organizationSearchResults.data=[],this.orgNameSearchOrg.setValue(""),this.appSearch.setValue("All"),this.versionSearch.setValue("All"),this.includeTestInSearch.setValue("false"),this.breakoutSubscription.setValue("false"),this.organizationSearchResults.data=[]}breakoutSubscriptions(){return"true"==this.breakoutSubscription.value}onOrganizationPage(){this.orgPageSize=this.OrganizationPaginator.pageSize;let e=this.orgPageSize.toString();localStorage.setItem("orgSearchPageSize",e)}onPurchaseOrderSearch(){this.poSearchInProgress=!0,this.poSearchResults.data=[];let e={};""!=this.orgNameSearchPurchaseOrders.value&&null!=this.orgNameSearchPurchaseOrders.value&&(e.orgname=this.orgNameSearchPurchaseOrders.value),""!=this.poSearch.value&&null!=this.poSearch.value&&(e.purchase_order=this.poSearch.value),"boolean"==typeof this.openSearch.value?e.open=this.openSearch.value:"string"==typeof this.openSearch.value&&"ALL"==this.openSearch.value&&(e.all=!0),this.http.post(mTe,e,{withCredentials:!0}).subscribe(r=>{this.poSearchResults.data=r,this.poSearchResults.sortingDataAccessor=(u,y)=>{switch(y){case"org_name":return u.org_name;case"org_friendly":return u.org_friendly;case"po":return u.po;case"open":return u.open;default:return null==u[y]?u[y]:u[y].toString().toLowerCase()}},this.poSearchResults.sort=this.purchaseOrderSort,this.poSearchResults.paginator=this.PurchaseOrderPaginator,this.poSearchInProgress=!1})}onPurchaseOrderOpenToggle(e){let n={};n.purchase_order=e.po,n.org=e.org_name,n.open=!e.open,this.http.post(li_backendURL+"/purchase_orders",n,{withCredentials:!0,observe:"response"}).subscribe(r=>{this.onPurchaseOrderSearch()})}viewPurchaseOrderDetails(e){let n=new ZT;n.po_id=e.id,n.po_number=e.po,n.org_name=e.org_name;let o=new ha;o.data=n,this.dialog.open(YT,o).afterClosed().subscribe(y=>{})}onResetPurchaseOrderSearch(){this.poSearchResults.data=[],this.orgNameSearchPurchaseOrders.setValue(""),this.poSearch.setValue(""),this.openSearch.setValue("ALL"),this.poSearchResults.data=[]}onPurchaseOrderPage(){this.poPageSize=this.PurchaseOrderPaginator.pageSize;let e=this.poPageSize.toString();localStorage.setItem("poSearchPageSize",e)}doNothing(){}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(Po),$e(pa))};static \u0275cmp=cn({type:t,selectors:[["app-search"]],viewQuery:function(n,o){if(1&n&&(mn(RCe,5),mn(OCe,5,kr),mn(PCe,5),mn(LCe,5,kr),mn(FCe,5),mn(NCe,5,kr)),2&n){let r;Bt(r=Vt())&&(o.licenseSort=r.first),Bt(r=Vt())&&(o.LicensesPaginator=r.first),Bt(r=Vt())&&(o.orgSort=r.first),Bt(r=Vt())&&(o.OrganizationPaginator=r.first),Bt(r=Vt())&&(o.purchaseOrderSort=r.first),Bt(r=Vt())&&(o.PurchaseOrderPaginator=r.first)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:6,vars:4,consts:[["sortLicense","matSort"],["licensePaginator","matPaginator"],["sortOrganization","matSort"],["organizationPaginator","matPaginator"],["sortPurchaseOrders","matSort"],["purchaseOrderPaginator","matPaginator"],[1,"main-container"],["mat-stretch-tabs","false","mat-align-tabs","start",1,"top-header",3,"selectedTabChange","selectedIndex"],[3,"label",4,"ngIf"],[3,"label"],["matTabContent",""],[1,"sticky-header"],[3,"expanded"],[1,"filter-field"],["matInput","",1,"form-field",3,"formControl"],["mat-icon-button","","type","button","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],["mat-icon-button","","aria-label","Search","matTooltip","Search",3,"click","disabled"],["fontSet","material-symbols-outlined"],["mat-icon-button","","type","button","aria-label","Clear Search","matTooltip","Clear Search",3,"click"],[3,"ngClass"],["matSort","","mat-table","",3,"dataSource"],[1,"table-caption"],["matColumnDef","orgname"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Organization Name",4,"matCellDef"],["matColumnDef","orgfriendlyname"],["matColumnDef","access-links"],["mat-header-cell","","mat-sort-header","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Licensing",4,"matCellDef"],["matColumnDef","computername"],["mat-cell","","data-label","Computer Name",4,"matCellDef"],["matColumnDef","username"],["mat-cell","","data-label","Username",4,"matCellDef"],["matColumnDef","code"],["mat-cell","","data-label","Code",4,"matCellDef"],["matColumnDef","license_subject"],["mat-cell","","data-label","License Subject",4,"matCellDef"],["matColumnDef","setnotes"],["mat-cell","","data-label","License Set Notes",4,"matCellDef"],["matColumnDef","licensenotes"],["mat-cell","","data-label","License Notes",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","hover-row",4,"matRowDef","matRowDefColumns"],["noRowsText","No Licenses to display",3,"isLoading","dataSource"],[3,"page","hidden","length","pageSize","pageSizeOptions"],["mat-icon-button","","type","button","matSuffix","","aria-label","Clear",3,"click"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Organization Name"],["mat-header-cell","","mat-sort-header","","disabled",""],["mat-cell","","data-label","Licensing"],[1,"button-group"],[1,"labeled-icon-button"],["mat-icon-button","","href","#",1,"sm-icon-btn",3,"routerLink"],["mat-icon-button","","href","#",1,"sm-icon-btn",3,"routerLink","disabled"],["mat-cell","","data-label","Computer Name"],["mat-cell","","data-label","Username"],["mat-cell","","data-label","Code"],["mat-cell","","data-label","License Subject"],["mat-cell","","data-label","License Set Notes"],["mat-cell","","data-label","License Notes"],["mat-header-row",""],["mat-row","",1,"hover-row"],[3,"formControl"],["value","All"],[3,"value",4,"ngFor","ngForOf"],["class","filter-field",4,"ngIf"],["value","true"],["value","false"],["mat-icon-button","","aria-label","Search","matTooltip","Search",3,"click"],["mat-icon-button","","type","button","aria-label","Download Results","matTooltip","Download Results CSV",3,"click","disabled"],["matSort","","mat-table","","matSortActive","license_type","matSortDirection","asc",3,"dataSource"],[1,"table-caption","main-header"],["matColumnDef","standalonecount_total",4,"ngIf"],["matColumnDef","standalonecount_nosub",4,"ngIf"],["matColumnDef","standalonecount_sub",4,"ngIf"],["matColumnDef","ondemandcount_total",4,"ngIf"],["matColumnDef","ondemandcount_nosub",4,"ngIf"],["matColumnDef","ondemandcount_sub",4,"ngIf"],["matColumnDef","privateservercount"],["mat-cell","","data-label","Private Server Count",4,"matCellDef"],[3,"value"],["class","labeled-icon-button",4,"ngIf"],["matColumnDef","standalonecount_total"],["mat-cell","","data-label","Standalone Count",4,"matCellDef"],["mat-cell","","data-label","Standalone Count"],["matColumnDef","standalonecount_nosub"],["mat-cell","","data-label","Standalone Count Non-Sub",4,"matCellDef"],["mat-cell","","data-label","Standalone Count Non-Sub"],["matColumnDef","standalonecount_sub"],["mat-cell","","data-label","Standalone Count Sub",4,"matCellDef"],["mat-cell","","data-label","Standalone Count Sub"],["matColumnDef","ondemandcount_total"],["mat-cell","","data-label","On-Demand Count",4,"matCellDef"],["mat-cell","","data-label","On-Demand Count"],["matColumnDef","ondemandcount_nosub"],["mat-cell","","data-label","On-Demand Count Non-Sub",4,"matCellDef"],["mat-cell","","data-label","On-Demand Count Non-Sub"],["matColumnDef","ondemandcount_sub"],["mat-cell","","data-label","On-Demand Count Sub",4,"matCellDef"],["mat-cell","","data-label","On-Demand Count Sub"],["mat-cell","","data-label","Private Server Count"],[1,"form-field",3,"formControl"],["matSort","","mat-table","","matSortActive","po","matSortDirection","asc",3,"dataSource"],["matColumnDef","org_name"],["matColumnDef","org_friendly"],["mat-cell","","data-label","Organization Display Name",4,"matCellDef"],["matColumnDef","account-links"],["mat-header-cell","","disabled","",4,"matHeaderCellDef"],["mat-cell","","data-label","Account","class","column-content",4,"matCellDef"],["matColumnDef","po"],["mat-cell","","data-label","PO Number",4,"matCellDef"],["matColumnDef","open"],["mat-cell","","data-label","Open Status",4,"matCellDef"],["matColumnDef","details"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Details",4,"matCellDef"],["noRowsText","No Purchase Orders to display",3,"isLoading","dataSource"],["mat-cell","","data-label","Organization Display Name"],["mat-header-cell","","disabled",""],["mat-cell","","data-label","Account",1,"column-content"],["mat-cell","","data-label","PO Number"],["mat-cell","","data-label","Open Status"],[3,"change","checked"],["class","open-po",4,"ngIf"],["class","close-po",4,"ngIf"],[1,"open-po"],[1,"close-po"],["mat-header-cell",""],["mat-cell","","data-label","Details"],["mat-mini-fab","","color","primary","matTooltip","View Details",3,"click"]],template:function(n,o){1&n&&(w(0,"main",6)(1,"mat-tab-group",7),we("selectedTabChange",function(u){return o.onTabChange(u)}),te(2,dSe,2,1,"mat-tab",8),w(3,"mat-tab",9),te(4,$Se,86,29,"ng-template",10),x(),te(5,uTe,2,1,"mat-tab",8),x()()),2&n&&(E(),N("selectedIndex",o.tabIndex),E(),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()),E(),N("label",o.searchTabs.ORGANIZATION_SEARCH),E(2),N("ngIf",o.userInfo&&o.userInfo.isMasterDBUser()))},dependencies:[$d,kl,ir,xb,ka,jr,wr,Aa,Xu,Cr,na,Oa,Qs,xa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,T3,qa,D_,th,zl,Bl,od,yM,Gd,nh,uc,Sr,Pa,jM,Ob,L_,kr,F_,OI],styles:[".mat-mdc-tab-body-wrapper{overflow:visible!important} .mat-mdc-tab-body{overflow:visible!important} .mat-mdc-tab-body-content{overflow:visible!important}.top-header[_ngcontent-%COMP%]{padding-top:3em}.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1000;background-color:#fff}.open-po[_ngcontent-%COMP%]{color:green}.close-po[_ngcontent-%COMP%]{color:#ff4500}.column-content[_ngcontent-%COMP%]{display:flex;justify-content:start}@media screen and (max-width: 900px){.button-group[_ngcontent-%COMP%]{justify-content:end}}"]})}return t})();function jL(t=0,i=yT){return t<0&&(t=0),wb(t,t,i)}let tD=(()=>{class t{breakpointObserver;isExtraSmall;constructor(e){this.breakpointObserver=e,this.isExtraSmall=this.breakpointObserver.observe("(max-width: 599.98px)")}openCenterFull(e,n,o){var r=void 0===o.width||void 0===o.height;o.maxWidth="100vw";const u=e.open(n,o),y=this.isExtraSmall.subscribe(I=>{I.matches?(u.updateSize("100vw","100vh"),u.addPanelClass("full-screen-dialog")):(r&&u.updateSize("auto","auto"),u.removePanelClass("full-screen-dialog"))});return u.afterClosed().subscribe(()=>{y.unsubscribe()}),u}openCenterBottom(e,n,o){o.maxWidth="100vw",o.height="100vh";const r=e.open(n,o),u=this.isExtraSmall.subscribe(y=>{y.matches?(r.updateSize("100%","auto"),r.updatePosition({left:"25%",right:"50%",bottom:"0px"})):(r.updateSize("auto","auto"),r.updatePosition({left:"",top:"",right:"",bottom:""}))});return r.afterClosed().subscribe(()=>{u.unsubscribe()}),r}openRightFull(e,n,o){o.maxWidth="100vw",o.height="100vh";const r=e.open(n,o),u=this.isExtraSmall.subscribe(y=>{y.matches?r.updateSize("100%","100%"):(r.updateSize("auto","100%"),r.updatePosition({left:"",top:"",right:"0px",bottom:""}))});return r.afterClosed().subscribe(()=>{u.unsubscribe()}),r}openLeftFull(e,n,o){o.maxWidth="100vw",o.height="100vh";const r=e.open(n,o),u=this.isExtraSmall.subscribe(y=>{y.matches?r.updateSize("100%","100%"):(r.updateSize("auto","100%"),r.updatePosition({left:"0px",top:"",right:"",bottom:""}))});return r.afterClosed().subscribe(()=>{u.unsubscribe()}),r}static \u0275fac=function(n){return new(n||t)(xn(UE))};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[j5]})}return t})();const _Te=["statusPaginator"],gTe=()=>[10,25,50,75,100],bTe=()=>({"background-color":"#84A6D6"}),P7=t=>({color:t}),yTe=t=>({color:t,"vertical-align":"middle","font-size":"large"}),rw=t=>({"background-color":t}),uf=()=>({color:"RGBA(187,28,28,1.0)","vertical-align":"middle","font-size":"16px"}),aA=()=>({"vertical-align":"middle","font-size":"16px",color:"black"}),L7=()=>({color:"RGBA(58,141,35,1.0)","vertical-align":"middle","font-size":"16px"}),aw=()=>({color:"RGBA(33,139,130,1.0)","vertical-align":"middle","font-size":"16px"}),F7=()=>({color:"RGBA(87,132,186,1.0)","vertical-align":"middle","font-size":"16px"});function vTe(t,i){if(1&t&&(w(0,"span")(1,"h4"),M(2),x(),w(3,"h6"),M(4),x()()),2&t){const e=X();E(2),Jt("",e.friendlyName," Status History"),E(2),Ct(e.serialNumber)}}function xTe(t,i){if(1&t&&(w(0,"span")(1,"h4"),M(2),x()()),2&t){const e=X();E(2),Jt("",e.serialNumber," Status History")}}function wTe(t,i){1&t&&(w(0,"th",44),M(1,"Start Type"),x())}function CTe(t,i){if(1&t&&(w(0,"td",45),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.start_type)}}function STe(t,i){1&t&&(w(0,"th",44),M(1,"Worn On"),x())}function TTe(t,i){if(1&t&&(w(0,"td",46),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",e.wrist?"Wrist":"Chest"," ")}}function DTe(t,i){1&t&&(w(0,"th",44),M(1,"Set Duration"),x())}function ITe(t,i){if(1&t&&(w(0,"td",47),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.duration)}}function ETe(t,i){1&t&&(w(0,"th",44),M(1,"Launch DMS Contact"),x())}function MTe(t,i){if(1&t){const e=pt();w(0,"td",48)(1,"button",49),we("click",function(){return fe(e),ge(X().launchDMSSchedule())}),w(2,"mat-icon",50),M(3,"contact_phone"),x()()()}if(2&t){const e=X();E(),N("disabled",!e.canLaunchDMSSchedule()),E(),ys("matTooltip",e.getDMSScheduleLaunchTooltip())}}function ATe(t,i){1&t&&Re(0,"tr",51)}function kTe(t,i){1&t&&Re(0,"tr",52),2&t&&N("ngStyle",jn(1,bTe))}function RTe(t,i){1&t&&Re(0,"th",44)}function OTe(t,i){if(1&t&&(w(0,"td",53)(1,"mat-icon",54),M(2),x()()),2&t){const e=i.$implicit;E(),N("ngClass",e.status_extra_info.upload_failed?"statuscodeiconpos_rotate":"statuscodeiconpos")("ngStyle",Ar(3,P7,e.ui_info.mode_icon_clr)),E(),Ct(e.ui_info.mode_icon)}}function PTe(t,i){1&t&&Re(0,"th",44)}function LTe(t,i){if(1&t&&(w(0,"td",55)(1,"mat-icon",56),M(2),x()()),2&t){const e=i.$implicit;E(),ys("matTooltip",e.ui_info.good_data_icon_tooltip_set),N("ngStyle",Ar(4,yTe,e.ui_info.good_data_icon_clr))("inline",!0),E(),Ct(e.ui_info.good_data_icon_set)}}function FTe(t,i){1&t&&(w(0,"th",44),M(1,"Status Time"),x())}function NTe(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X().$implicit,n=X();E(),Jt(" ",hi(2,1,n.commonFunctionHelper.getDateFromDateString(e.status_info.statustime),"medium")," ")}}function zTe(t,i){1&t&&(w(0,"span"),M(1," - "),x())}function BTe(t,i){if(1&t&&(w(0,"td",57),te(1,NTe,3,4,"span",2)(2,zTe,2,0,"span",2),x()),2&t){const e=i.$implicit;E(),N("ngIf",""!=e.status_info.statustime&&null!=e.status_info.statustime),E(),N("ngIf",""==e.status_info.statustime)}}function VTe(t,i){1&t&&(w(0,"th",44),M(1,"Mode"),x())}function UTe(t,i){if(1&t&&(w(0,"td",58),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.mode_text)}}function HTe(t,i){1&t&&(w(0,"th",44),M(1,"Status"),x())}function jTe(t,i){if(1&t&&(w(0,"td",59),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.status_text)}}function $Te(t,i){1&t&&(w(0,"th",44),M(1,"Data Check"),x())}function GTe(t,i){1&t&&(w(0,"span")(1,"mat-icon",70),M(2,"horizontal_rule"),x()()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aA)))}function qTe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" ",e.status_info.pulse," ")}}function WTe(t,i){1&t&&(w(0,"span")(1,"mat-icon",71),M(2,"horizontal_rule"),x()()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aA)))}function ZTe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" ",e.status_info.spo2," ")}}function YTe(t,i){1&t&&(w(0,"mat-icon",72),M(1,"check_box"),x()),2&t&&N("inline",!0)("ngStyle",jn(2,L7))}function XTe(t,i){1&t&&(w(0,"mat-icon",73),M(1,"report"),x()),2&t&&N("inline",!0)("ngStyle",jn(2,uf))}function KTe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function QTe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function JTe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function eDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function tDe(t,i){if(1&t&&(w(0,"span")(1,"mat-list-item",74)(2,"div",63)(3,"div",64),te(4,JTe,4,3,"span",2)(5,eDe,4,3,"span",2),x(),w(6,"div",64)(7,"span",75),M(8,"Belt"),x(),M(9,"\xa0 "),x(),w(10,"div",64)(11,"mat-icon",78),M(12,"360"),x()()()(),Re(13,"mat-divider"),x()),2&t){const e=X(3).$implicit;E(4),N("ngIf",e.status_info.beltconnected),E(),N("ngIf",!e.status_info.beltconnected),E(6),N("inline",!0)("ngStyle",jn(4,F7))}}function nDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function iDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function oDe(t,i){if(1&t&&(w(0,"mat-list")(1,"mat-list-item",74)(2,"div",63)(3,"div",64),te(4,KTe,4,3,"span",2)(5,QTe,4,3,"span",2),x(),w(6,"div",64)(7,"span",75),M(8,"SpO2"),x(),M(9,"\xa0 "),x(),w(10,"div",64),Re(11,"mat-icon",76),x()()(),Re(12,"mat-divider"),te(13,tDe,14,5,"span",2),w(14,"mat-list-item",74)(15,"div",63)(16,"div",64),te(17,nDe,4,3,"span",2)(18,iDe,4,3,"span",2),x(),w(19,"div",64)(20,"span",75),M(21,"Airflow"),x(),M(22,"\xa0 "),x(),w(23,"div",64),Re(24,"mat-icon",77),x()()()()),2&t){const e=X(2).$implicit;E(4),N("ngIf",e.status_info.spo2connected),E(),N("ngIf",!e.status_info.spo2connected),E(6),N("inline",!0),E(2),N("ngIf",!e.status_info.wornonwrist),E(4),N("ngIf",e.status_info.airflowconnected),E(),N("ngIf",!e.status_info.airflowconnected),E(6),N("inline",!0)}}function rDe(t,i){if(1&t&&(w(0,"div")(1,"mat-expansion-panel",61)(2,"mat-expansion-panel-header",62)(3,"mat-panel-title")(4,"div",63)(5,"div",64)(6,"mat-icon",65),M(7,"favorite"),x()(),w(8,"div",64),te(9,GTe,3,3,"span",2)(10,qTe,2,1,"span",2),x(),w(11,"div",64),Re(12,"mat-icon",66),x(),w(13,"div",64),te(14,WTe,3,3,"span",2)(15,ZTe,2,1,"span",2),x()()(),w(16,"mat-panel-description"),te(17,YTe,2,3,"mat-icon",67)(18,XTe,2,3,"mat-icon",68),x()(),te(19,oDe,25,7,"ng-template",69),x()()),2&t){const e=X().$implicit;N("@.disabled",X().disableAnimation),E(),N("ngStyle",Ar(15,rw,e.ui_info.background_clr))("expanded",!1)("disabled",!e.status_extra_info.sensor_error)("hideToggle",!e.status_extra_info.sensor_error),E(),N("ngStyle",Ar(17,rw,e.ui_info.background_clr)),E(4),N("inline",!0)("ngStyle",jn(19,uf)),E(3),N("ngIf",!e.status_info.spo2connected),E(),N("ngIf",e.status_info.spo2connected),E(2),N("inline",!0),E(2),N("ngIf",!e.status_info.spo2connected),E(),N("ngIf",e.status_info.spo2connected),E(2),N("ngIf",!e.status_extra_info.sensor_error),E(),N("ngIf",e.status_extra_info.sensor_error)}}function aDe(t,i){1&t&&(w(0,"div"),M(1,"-"),x())}function sDe(t,i){if(1&t&&(w(0,"td",60),te(1,rDe,20,20,"div",2)(2,aDe,2,0,"div",2),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.status_extra_info.recording),E(),N("ngIf",!e.status_extra_info.recording)}}function lDe(t,i){1&t&&(w(0,"th",44),M(1,"Night"),x())}function cDe(t,i){if(1&t&&(w(0,"td",79),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.night)}}function dDe(t,i){1&t&&Re(0,"tr",51)}function uDe(t,i){1&t&&Re(0,"tr",52),2&t&&N("ngStyle",Ar(1,rw,i.$implicit.ui_info.background_clr))}function hDe(t,i){1&t&&(w(0,"div",80),M(1,"No recent status"),x())}function pDe(t,i){1&t&&Re(0,"th",44)}function mDe(t,i){if(1&t&&(w(0,"td",53)(1,"mat-icon",81),M(2),x()()),2&t){const e=i.$implicit;E(),N("ngStyle",Ar(2,P7,e.ui_info.mode_icon_clr)),E(),Ct(e.ui_info.mode_icon)}}function fDe(t,i){1&t&&(w(0,"th",82),M(1,"Status Time"),x())}function _De(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X().$implicit,n=X();E(),Jt(" ",hi(2,1,n.commonFunctionHelper.getDateFromDateString(e.status_info.statustime),"medium")," ")}}function gDe(t,i){1&t&&(w(0,"span"),M(1," - "),x())}function bDe(t,i){if(1&t&&(w(0,"td",57),te(1,_De,3,4,"span",2)(2,gDe,2,0,"span",2),x()),2&t){const e=i.$implicit;E(),N("ngIf",""!=e.status_info.statustime&&null!=e.status_info.statustime),E(),N("ngIf",""==e.status_info.statustime)}}function yDe(t,i){1&t&&(w(0,"th",82),M(1,"Mode"),x())}function vDe(t,i){if(1&t&&(w(0,"td",58),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.mode_text)}}function xDe(t,i){1&t&&(w(0,"th",82),M(1,"Status"),x())}function wDe(t,i){if(1&t&&(w(0,"td",59),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.status_text)}}function CDe(t,i){1&t&&(w(0,"th",82),M(1,"Data Check"),x())}function SDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",70),M(2,"horizontal_rule"),x()()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aA)))}function TDe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" ",e.status_info.pulse," ")}}function DDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",71),M(2,"horizontal_rule"),x()()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aA)))}function IDe(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2).$implicit;E(),Jt(" ",e.status_info.spo2," ")}}function EDe(t,i){1&t&&(w(0,"mat-icon",72),M(1,"check_box"),x()),2&t&&N("inline",!0)("ngStyle",jn(2,L7))}function MDe(t,i){1&t&&(w(0,"mat-icon",73),M(1,"report"),x()),2&t&&N("inline",!0)("ngStyle",jn(2,uf))}function ADe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function kDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function RDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function ODe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function PDe(t,i){if(1&t&&(w(0,"span")(1,"mat-list-item",74)(2,"div",63)(3,"div",64),te(4,RDe,4,3,"span",2)(5,ODe,4,3,"span",2),x(),w(6,"div",64)(7,"span",75),M(8,"Belt"),x(),M(9,"\xa0 "),x(),w(10,"div",64)(11,"mat-icon",78),M(12,"360"),x()()()(),Re(13,"mat-divider"),x()),2&t){const e=X(3).$implicit;E(4),N("ngIf",e.status_info.beltconnected),E(),N("ngIf",!e.status_info.beltconnected),E(6),N("inline",!0)("ngStyle",jn(4,F7))}}function LDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"check_circle"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,aw)))}function FDe(t,i){1&t&&(w(0,"span")(1,"mat-icon",78),M(2,"report"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0)("ngStyle",jn(2,uf)))}function NDe(t,i){if(1&t&&(w(0,"mat-list")(1,"mat-list-item",74)(2,"div",63)(3,"div",64),te(4,ADe,4,3,"span",2)(5,kDe,4,3,"span",2),x(),w(6,"div",64)(7,"span",75),M(8,"SpO2"),x(),M(9,"\xa0 "),x(),w(10,"div",64),Re(11,"mat-icon",76),x()()(),Re(12,"mat-divider"),te(13,PDe,14,5,"span",2),w(14,"mat-list-item",74)(15,"div",63)(16,"div",64),te(17,LDe,4,3,"span",2)(18,FDe,4,3,"span",2),x(),w(19,"div",64)(20,"span",75),M(21,"Airflow"),x(),M(22,"\xa0 "),x(),w(23,"div",64),Re(24,"mat-icon",77),x()()()()),2&t){const e=X(2).$implicit;E(4),N("ngIf",e.status_info.spo2connected),E(),N("ngIf",!e.status_info.spo2connected),E(6),N("inline",!0),E(2),N("ngIf",!e.status_info.wornonwrist),E(4),N("ngIf",e.status_info.airflowconnected),E(),N("ngIf",!e.status_info.airflowconnected),E(6),N("inline",!0)}}function zDe(t,i){if(1&t&&(w(0,"div")(1,"mat-expansion-panel",61)(2,"mat-expansion-panel-header",62)(3,"mat-panel-title")(4,"div",63)(5,"div",64)(6,"mat-icon",65),M(7,"favorite"),x()(),w(8,"div",64),te(9,SDe,3,3,"span",2)(10,TDe,2,1,"span",2),x(),w(11,"div",64),Re(12,"mat-icon",66),x(),w(13,"div",64),te(14,DDe,3,3,"span",2)(15,IDe,2,1,"span",2),x()()(),w(16,"mat-panel-description"),te(17,EDe,2,3,"mat-icon",67)(18,MDe,2,3,"mat-icon",68),x()(),te(19,NDe,25,7,"ng-template",69),x()()),2&t){const e=X().$implicit;N("@.disabled",X().disableAnimation),E(),N("ngStyle",Ar(15,rw,e.ui_info.background_clr))("expanded",!1)("disabled",!e.status_extra_info.sensor_error)("hideToggle",!e.status_extra_info.sensor_error),E(),N("ngStyle",Ar(17,rw,e.ui_info.background_clr)),E(4),N("inline",!0)("ngStyle",jn(19,uf)),E(3),N("ngIf",!e.status_info.spo2connected),E(),N("ngIf",e.status_info.spo2connected),E(2),N("inline",!0),E(2),N("ngIf",!e.status_info.spo2connected),E(),N("ngIf",e.status_info.spo2connected),E(2),N("ngIf",!e.status_extra_info.sensor_error),E(),N("ngIf",e.status_extra_info.sensor_error)}}function BDe(t,i){1&t&&(w(0,"div"),M(1,"-"),x())}function VDe(t,i){if(1&t&&(w(0,"td",60),te(1,zDe,20,20,"div",2)(2,BDe,2,0,"div",2),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.status_extra_info.recording),E(),N("ngIf",!e.status_extra_info.recording)}}function UDe(t,i){1&t&&(w(0,"th",82),M(1,"Night"),x())}function HDe(t,i){if(1&t&&(w(0,"td",79),M(1),x()),2&t){const e=i.$implicit;E(),Ct(e.status_extra_info.night)}}function jDe(t,i){1&t&&Re(0,"tr",51)}function $De(t,i){1&t&&Re(0,"tr",52),2&t&&N("ngStyle",Ar(1,rw,i.$implicit.ui_info.background_clr))}function GDe(t,i){1&t&&(w(0,"div",80),M(1,"No past status"),x())}function qDe(t,i){1&t&&(w(0,"div",80),M(1,"No results found. Try adjusting your filters."),x())}function WDe(t,i){1&t&&te(0,qDe,2,0,"div",31),2&t&&N("ngIf",0==X().nomadAirStatusHistory.filteredData.length)}let ZDe=(()=>{class t{dialogRef;data;loginService;el;dialog;layout;nightlyStatusHistory=new Fr([]);nomadAirStatusHistory=new Fr([]);pastHistorySort;StatusPaginator;commonFunctionHelper=new Rb;serialNumber="";friendlyName="";scheduleUUID="";hasFriendlyName=!1;recordedText="n/a";userInfo=null;pageSize=10;hasNightOneStatus=!1;hasNightTwoStatus=!1;hasNightThreeStatus=!1;locationAvailable=!0;disableAnimation=!0;statusFilter=new po;filteredValues={has_error:"",study_id:""};study_config_data=[];study_config_columns=["start_type","wrist","duration","dms_launch"];nightlyColumnsToDisplay=["mode_icon","ssdi_icon","status_time","mode_text","code_text","data_check","night"];pastColumnsToDisplay=["mode_icon","status_time","mode_text","code_text","data_check","night"];constructor(e,n,o,r,u,y){this.dialogRef=e,this.data=n,this.loginService=o,this.el=r,this.dialog=u,this.layout=y,this.scheduleUUID=n.scheduleUUID,this.serialNumber=n.serialnumber,this.friendlyName=n.friendlyname;let I={start_type:n.starttype,wrist:n.wornonwrist,duration:this.getTimeDurationString(n.duration_frames)};this.study_config_data.push(I),this.recordedText=this.getTimeDurationString(n.rec_frames),""!=this.friendlyName&&this.friendlyName!=this.serialNumber&&(this.hasFriendlyName=!0),this.locationAvailable=n.has_location}ngOnInit(){this.loginService.userInfo$.subscribe(e=>{this.userInfo=e}),this.refreshNomadAirStatusHistory(),this.initPageSize(),jL(500).subscribe(()=>this.refreshNomadAirStatusHistory())}ngAfterViewInit(){setTimeout(()=>this.disableAnimation=!1)}initPageSize(){let e=localStorage.getItem("statusHistoryPageSize");(""==e||null==e)&&(e="10"),this.pageSize=parseInt(e),this.nomadAirStatusHistory.data.length>10&&(this.StatusPaginator.pageSize=this.pageSize)}getTimeDurationString(e){var n="n/a",o=0,r=0,u=0,I="",V="";return e>0&&(n="",u=e-3600*(o=Math.floor(e/3600))-60*(r=Math.floor(e/60-60*o)),o>0&&(n=Math.floor(o).toString()+" hrs"),r>0&&(I=Math.floor(r).toString()+" min",n.length>0?(n+=", ",n+=I):n=I),u>0&&(V=Math.floor(u).toString()+" sec",n.length>0?(n+=", ",n+=V):n=V)),n}refreshNomadAirStatusHistory(){this.nightlyStatusHistory.data.length=0,this.nomadAirStatusHistory.data.length=0;let e=this.loginService.getNomadAirStatusHistory(this.serialNumber.toString());for(var n=0;n{switch(r){case"status_time":return o.status_info.statustime;case"mode_text":return o.status_extra_info.mode_text;case"code_text":return o.status_extra_info.status_text;case"data_check":return o.status_extra_info.notify_error.toString().toLowerCase();case"night":return o.status_extra_info.night;default:return o[r].toString().toLowerCase()}},this.nomadAirStatusHistory.sort=this.pastHistorySort,this.statusFilter.valueChanges.subscribe(o=>{this.filteredValues.has_error=o,this.nomadAirStatusHistory.filter=JSON.stringify(this.filteredValues)}),this.nomadAirStatusHistory.filterPredicate=this.statusFilterPredicate(),this.nomadAirStatusHistory.paginator=this.StatusPaginator}onViewMap(){var e=this.el.nativeElement.parentElement,n=(1*e.offsetWidth).toString()+"px",o=(1*e.offsetHeight).toString()+"px";this.layout.openCenterFull(this.dialog,kM,{height:o,width:n,data:this.nightlyStatusHistory.data[0],autoFocus:!1})}onCloseDialog(){this.dialogRef.close(!1)}onPage(){this.pageSize=this.StatusPaginator.pageSize;let e=this.pageSize.toString();localStorage.setItem("statusHistoryPageSize",e)}getDMSScheduleLaunchTooltip(){let n="Lauch patient contact information in DMS";return""!=this.scheduleUUID&&null!=this.scheduleUUID||(n="No DMS schedule ID. Cannot launch patient contact information."),n}canLaunchDMSSchedule(){return""!=this.scheduleUUID&&null!=this.scheduleUUID}launchDMSSchedule(){""!=this.scheduleUUID&&null!=this.scheduleUUID&&window.open(encodeURI("nti-dms:launchsched?uuid="+this.scheduleUUID),"_self")}statusFilterPredicate(){return(n,o)=>{let r=JSON.parse(o),u=!0;return r.has_error&&""!=r.has_error.trim()&&(u=n.status_extra_info.notify_error||n.status_extra_info.upload_failed||n.status_extra_info.sensor_error),u}}static \u0275fac=function(n){return new(n||t)($e(xs),$e(Ks),$e(Po),$e(Pn),$e(pa),$e(tD))};static \u0275cmp=cn({type:t,selectors:[["app-status_history"]],viewQuery:function(n,o){if(1&n&&(mn(Js,5),mn(_Te,5,kr)),2&n){let r;Bt(r=Vt())&&(o.pastHistorySort=r.first),Bt(r=Vt())&&(o.StatusPaginator=r.first)}},standalone:!1,features:[Bn([{provide:Xd,useClass:tm}])],decls:94,vars:21,consts:[["filteredEmpty",""],["statusPaginator","matPaginator"],[4,"ngIf"],[1,"custom-table-responsive"],["mat-table","",3,"dataSource"],[1,"table-caption"],["matColumnDef","start_type"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Start Type",4,"matCellDef"],["matColumnDef","wrist"],["mat-cell","","data-label","Worn On",4,"matCellDef"],["matColumnDef","duration"],["mat-cell","","data-label","Set Duration",4,"matCellDef"],["matColumnDef","dms_launch"],["mat-cell","","data-label","Launch DMS Contact",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",3,"ngStyle",4,"matRowDef","matRowDefColumns"],["matColumnDef","mode_icon"],["mat-cell","","data-label","Status Indicator",4,"matCellDef"],["matColumnDef","ssdi_icon"],["mat-cell","","data-label","SSDI",4,"matCellDef"],["matColumnDef","status_time"],["mat-cell","","data-label","Status Time",4,"matCellDef"],["matColumnDef","mode_text"],["mat-cell","","data-label","Mode",4,"matCellDef"],["matColumnDef","code_text"],["mat-cell","","data-label","Code",4,"matCellDef"],["matColumnDef","data_check"],["mat-cell","","data-label","Data Check",4,"matCellDef"],["matColumnDef","night"],["mat-cell","","data-label","Night",4,"matCellDef"],["class","empty-table",4,"ngIf"],["mat-table","","matSort","",3,"dataSource"],[2,"margin-right","0.5em"],[3,"formControl"],["value",""],["value","has_error"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["class","empty-table",4,"ngIf","ngIfElse"],[3,"page","ngClass","length","pageSize","pageSizeOptions"],["align","end"],[1,"button-span"],["mat-raised-button","","color","primary",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click"],["mat-header-cell",""],["mat-cell","","data-label","Start Type"],["mat-cell","","data-label","Worn On"],["mat-cell","","data-label","Set Duration"],["mat-cell","","data-label","Launch DMS Contact"],["mat-mini-fab","",1,"patient-btn",3,"click","disabled"],["fontSet","material-symbols-outlined",1,"contact-icon",3,"matTooltip"],["mat-header-row",""],["mat-row","",3,"ngStyle"],["mat-cell","","data-label","Status Indicator"],["fontSet","material-symbols-outlined",3,"ngClass","ngStyle"],["mat-cell","","data-label","SSDI"],["fontSet","material-symbols-outlined",3,"ngStyle","inline","matTooltip"],["mat-cell","","data-label","Status Time"],["mat-cell","","data-label","Mode"],["mat-cell","","data-label","Code"],["mat-cell","","data-label","Data Check"],[1,"mat-elevation-z0","custom-panel",3,"ngStyle","expanded","disabled","hideToggle"],[3,"ngStyle"],[1,"flex-container-row"],[1,"flex-item"],["fontSet","material-symbols-outlined","matTooltip","Pulse",3,"inline","ngStyle"],["matTooltip","SpO2","svgIcon","blooddrop",1,"customicon",3,"inline"],["fontSet","material-symbols-outlined","matTooltip","Sensors Connected",3,"inline","ngStyle",4,"ngIf"],["fontSet","material-symbols-outlined","matTooltip","Sensor(s) Disconnected",3,"inline","ngStyle",4,"ngIf"],["matExpansionPanelContent",""],["fontSet","material-symbols-outlined","matTooltip","SpO2 not connected, cannot show pulse",3,"inline","ngStyle"],["fontSet","material-symbols-outlined","matTooltip","SpO2 not connected, cannot show SpO2",3,"inline","ngStyle"],["fontSet","material-symbols-outlined","matTooltip","Sensors Connected",3,"inline","ngStyle"],["fontSet","material-symbols-outlined","matTooltip","Sensor(s) Disconnected",3,"inline","ngStyle"],[1,"statusinfo"],[1,"boldtext"],["svgIcon","blooddrop",1,"customicon",3,"inline"],["svgIcon","air",1,"customicon",3,"inline"],["fontSet","material-symbols-outlined",3,"inline","ngStyle"],["mat-cell","","data-label","Night"],[1,"empty-table"],["fontSet","material-symbols-outlined",1,"statuscodeiconpos",3,"ngStyle"],["mat-header-cell","","mat-sort-header",""]],template:function(n,o){if(1&n){const r=pt();w(0,"mat-dialog-content"),te(1,vTe,5,2,"span",2)(2,xTe,3,1,"span",2),w(3,"div",3)(4,"table",4)(5,"caption",5),M(6,"Study Configuration"),x(),at(7,6),te(8,wTe,2,0,"th",7)(9,CTe,2,1,"td",8),st(),at(10,9),te(11,STe,2,0,"th",7)(12,TTe,2,1,"td",10),st(),at(13,11),te(14,DTe,2,0,"th",7)(15,ITe,2,1,"td",12),st(),at(16,13),te(17,ETe,2,0,"th",7)(18,MTe,4,2,"td",14),st(),te(19,ATe,1,0,"tr",15)(20,kTe,1,2,"tr",16),x()(),w(21,"div",3)(22,"table",4)(23,"caption",5),M(24,"Recent Status History"),x(),at(25,17),te(26,RTe,1,0,"th",7)(27,OTe,3,5,"td",18),st(),at(28,19),te(29,PTe,1,0,"th",7)(30,LTe,3,6,"td",20),st(),at(31,21),te(32,FTe,2,0,"th",7)(33,BTe,3,2,"td",22),st(),at(34,23),te(35,VTe,2,0,"th",7)(36,UTe,2,1,"td",24),st(),at(37,25),te(38,HTe,2,0,"th",7)(39,jTe,2,1,"td",26),st(),at(40,27),te(41,$Te,2,0,"th",7)(42,sDe,3,2,"td",28),st(),at(43,29),te(44,lDe,2,0,"th",7)(45,cDe,2,1,"td",30),st(),te(46,dDe,1,0,"tr",15)(47,uDe,1,3,"tr",16),x()(),te(48,hDe,2,0,"div",31),w(49,"div",3)(50,"table",32)(51,"caption",5),M(52," Past Status History "),Re(53,"br"),w(54,"form")(55,"mat-form-field",33)(56,"mat-label"),M(57,"Status Filter:"),x(),w(58,"mat-select",34)(59,"mat-option",35),M(60,"All"),x(),w(61,"mat-option",36),M(62,"Has Error"),x()()()()(),at(63,17),te(64,pDe,1,0,"th",7)(65,mDe,3,4,"td",18),st(),at(66,21),te(67,fDe,2,0,"th",37)(68,bDe,3,2,"td",22),st(),at(69,23),te(70,yDe,2,0,"th",37)(71,vDe,2,1,"td",24),st(),at(72,25),te(73,xDe,2,0,"th",37)(74,wDe,2,1,"td",26),st(),at(75,27),te(76,CDe,2,0,"th",37)(77,VDe,3,2,"td",28),st(),at(78,29),te(79,UDe,2,0,"th",37)(80,HDe,2,1,"td",30),st(),te(81,jDe,1,0,"tr",15)(82,$De,1,3,"tr",16),x(),te(83,GDe,2,0,"div",38)(84,WDe,1,1,"ng-template",null,0,Ud),w(86,"mat-paginator",39,1),we("page",function(){return fe(r),ge(o.onPage())}),x()()(),w(88,"mat-dialog-actions",40)(89,"span",41)(90,"button",42),we("click",function(){return fe(r),ge(o.onViewMap())}),M(91,"Map"),x(),w(92,"button",43),we("click",function(){return fe(r),ge(o.onCloseDialog())}),M(93,"Close"),x()()()}if(2&n){const r=Vi(85);E(),N("ngIf",o.hasFriendlyName),E(),N("ngIf",!o.hasFriendlyName),E(2),N("dataSource",o.study_config_data),E(15),N("matHeaderRowDef",o.study_config_columns),E(),N("matRowDefColumns",o.study_config_columns),E(2),N("dataSource",o.nightlyStatusHistory),E(24),N("matHeaderRowDef",o.nightlyColumnsToDisplay),E(),N("matRowDefColumns",o.nightlyColumnsToDisplay),E(),N("ngIf",0==o.nightlyStatusHistory.data.length),E(2),N("dataSource",o.nomadAirStatusHistory),E(8),N("formControl",o.statusFilter),E(23),N("matHeaderRowDef",o.pastColumnsToDisplay),E(),N("matRowDefColumns",o.pastColumnsToDisplay),E(),N("ngIf",0==o.nomadAirStatusHistory.data.length)("ngIfElse",r),E(3),N("ngClass",o.nomadAirStatusHistory.filteredData.length>10?"show-item":"hide-item")("length",o.nomadAirStatusHistory.filteredData.length)("pageSize",o.pageSize)("pageSizeOptions",jn(20,gTe)),E(4),N("disabled",!o.locationAvailable)}},dependencies:[$d,ir,Ym,ka,wr,Aa,Xu,Cr,na,Oa,rd,sd,qd,Ac,ad,Wd,ld,cd,Zd,Yd,Js,oh,ws,D_,Fl,Os,zl,Bl,od,yM,L3,Tu,nh,uc,Sr,XT,KT,Pa,kr,Rl],styles:['table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}td[_ngcontent-%COMP%]{color:#000}.main-container[_ngcontent-%COMP%]{background:#fff}.main-header[_ngcontent-%COMP%]{height:auto;background:#fff;position:sticky;top:0;width:100%;z-index:1000}span.button-span[_ngcontent-%COMP%]{float:right}.statuscodeiconpos[_ngcontent-%COMP%]{display:inline-flex;vertical-align:middle}.statuscodeiconpos_rotate[_ngcontent-%COMP%]{display:inline-flex;vertical-align:middle;transform:rotate(90deg)}.statusinfo[_ngcontent-%COMP%]{font-size:small}.boldtext[_ngcontent-%COMP%]{font-weight:700;color:#000} .mat-icon{padding:0!important;white-space:nowrap}.flex-container-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap}.flex-item[_ngcontent-%COMP%]{align-items:center}.customicon[_ngcontent-%COMP%]{color:"RGBA(187,28,28,1.0)";vertical-align:middle;font-size:16px;width:18px;height:20px}.patient-btn[_ngcontent-%COMP%]{background-color:#3151b5}.study-config[_ngcontent-%COMP%]{background-color:"#84A6D6"}.contact-icon[_ngcontent-%COMP%]{color:#fff} .mat-expansion-panel-header[aria-disabled=true]{color:#000;cursor:default}']})}return t})(),YDe=(()=>{class t{transform(e,n){return e&&n?e.filter(o=>this.applyFilter(o,n)):e}applyFilter(e,n){var o=!0;return 0==n.device_filter&&(o=!1),n.device_filter&Hx.idle_filter&&(0==e.status_info.mode||100==e.status_info.mode||101==e.status_info.mode)&&(o=!1),n.device_filter&Hx.schedule_filter&&1==e.status_info.mode&&(o=!1),n.device_filter&Hx.flex_schedule_filter&&99==e.status_info.mode&&(o=!1),n.device_filter&Hx.record_filter&&(2==e.status_info.mode||4==e.status_info.mode&&!e.status_extra_info.final_status_upload)&&(o=!1),n.device_filter&Hx.upload_filter&&(3==e.status_info.mode||4==e.status_info.mode&&e.status_extra_info.final_status_upload)&&(o=!1),""!=n.serial_filter.trim()&&e.status_info.serialnumber.trim().toLowerCase().search(n.serial_filter.trim().toLowerCase())<0&&(o=!0),""!=n.friendly_name_filter.trim()&&e.status_info.friendlyname.trim().toLowerCase().search(n.friendly_name_filter.trim().toLowerCase())<0&&(o=!0),e.status_extra_info.place_holder&&(o=!0),!o}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=zd({name:"nomadAirStatusFilter",type:t,pure:!1,standalone:!1})}return t})();class XDe{buckets=new Map;recentDates=[];fallbackBucket=[];getDateKey(i){return i.toISOString().split("T")[0]}insert(i){if(!i.date)return void this.fallbackBucket.push(i);const e=this.getDateKey(i.date);this.buckets.has(e)||this.buckets.set(e,[]),this.buckets.get(e).push(i),this.recentDates=Array.from(new Set([...this.buckets.keys()])).sort((n,o)=>ni.value)}getSecondMostRecent(){return(this.buckets.get(this.recentDates[1])??[]).map(i=>i.value)}getFallBack(){return this.fallbackBucket.map(i=>i.value)}reset(){this.buckets.clear(),this.recentDates=[],this.fallbackBucket=[]}}const KDe=["button"],QDe=["*"];function JDe(t,i){if(1&t&&(w(0,"div",2),Re(1,"mat-pseudo-checkbox",6),x()),2&t){const e=X();E(),N("disabled",e.disabled)}}const N7=new yt("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:function e2e(){return{hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1}}}),z7=new yt("MatButtonToggleGroup"),t2e={provide:Pl,useExisting:lo(()=>$L),multi:!0};class B7{source;value;constructor(i,e){this.source=i,this.value=e}}let $L=(()=>{class t{_changeDetector=Y(So);_dir=Y(ul,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=Y(ta).getId("mat-button-toggle-group-");vertical;get value(){const e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(n=>n.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new Tt;get selected(){const e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}change=new Tt;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){const e=Y(N7,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this.hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this.hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new GT(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled)return;const o=e.target.id,r=this._buttonToggles.toArray().findIndex(y=>y.buttonId===o);let u=null;switch(e.keyCode){case 32:case 13:u=this._buttonToggles.get(r)||null;break;case 38:u=this._getNextButton(r,-1);break;case 37:u=this._getNextButton(r,"ltr"===this.dir?-1:1);break;case 40:u=this._getNextButton(r,1);break;case 39:u=this._getNextButton(r,"ltr"===this.dir?1:-1);break;default:return}u&&(e.preventDefault(),u._onButtonClick(),u.focus())}_emitChangeEvent(e){const n=new B7(e,this.value);this._rawValue=n.value,this._controlValueAccessorChangeFn(n.value),this.change.emit(n)}_syncButtonToggle(e,n,o=!1,r=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?n?this._selectionModel.select(e):this._selectionModel.deselect(e):r=!0,r?Promise.resolve().then(()=>this._updateModelValue(e,o)):this._updateModelValue(e,o)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return!(typeof this._rawValue>"u")&&(this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(n=>null!=e.value&&n===e.value):e.value===this._rawValue)}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;ethis._selectValue(o,n))):(this._clearSelection(),this._selectValue(e,n)),!this.multiple&&n.every(o=>-1===o.tabIndex))for(const o of n)if(!o.disabled){o.tabIndex=0;break}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,n){for(const o of n)if(o.value===e){o.checked=!0,this._selectionModel.select(o),this.multiple||(o.tabIndex=0);break}}_updateModelValue(e,n){n&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(n){return new(n||t)};static \u0275dir=Gt({type:t,selectors:[["mat-button-toggle-group"]],contentQueries:function(n,o,r){if(1&n&&oo(r,sA,5),2&n){let u;Bt(u=Vt())&&(o._buttonToggles=u)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(n,o){1&n&&we("keydown",function(u){return o._keydown(u)}),2&n&&(zn("role",o.multiple?"group":"radiogroup")("aria-disabled",o.disabled),Hn("mat-button-toggle-vertical",o.vertical)("mat-button-toggle-group-appearance-standard","standard"===o.appearance))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",fn],value:"value",multiple:[2,"multiple","multiple",fn],disabled:[2,"disabled","disabled",fn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",fn],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",fn]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[Bn([t2e,{provide:z7,useExisting:t}])]})}return t})(),sA=(()=>{class t{_changeDetectorRef=Y(So);_elementRef=Y(Pn);_focusMonitor=Y(eh);_idGenerator=Y(ta);_animationMode=Y(Kr,{optional:!0});_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex}set tabIndex(e){e!==this._tabIndex&&(this._tabIndex=e,this._markForCheck())}_tabIndex;disableRipple;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||null!==this.buttonToggleGroup&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new Tt;constructor(){Y(Rs).load(wu);const e=Y(z7,{optional:!0}),n=Y(new Mt("tabindex"),{optional:!0})||"",o=Y(N7,{optional:!0});this._tabIndex=parseInt(n)||0,this.buttonToggleGroup=e,this.appearance=o&&o.appearance?o.appearance:"standard",this.disabledInteractive=o?.disabledInteractive??!1}ngOnInit(){const e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){"NoopAnimations"!==this._animationMode&&this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){const e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;const e=!!this.isSingleSelector()||!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){const n=this.buttonToggleGroup._buttonToggles.find(o=>0===o.tabIndex);n&&(n.tabIndex=-1),this.tabIndex=0}this.change.emit(new B7(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["mat-button-toggle"]],viewQuery:function(n,o){if(1&n&&mn(KDe,5),2&n){let r;Bt(r=Vt())&&(o._buttonElement=r.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(n,o){1&n&&we("focus",function(){return o.focus()}),2&n&&(zn("aria-label",null)("aria-labelledby",null)("id",o.id)("name",null),Hn("mat-button-toggle-standalone",!o.buttonToggleGroup)("mat-button-toggle-checked",o.checked)("mat-button-toggle-disabled",o.disabled)("mat-button-toggle-disabled-interactive",o.disabledInteractive)("mat-button-toggle-appearance-standard","standard"===o.appearance))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",fn],appearance:"appearance",checked:[2,"checked","checked",fn],disabled:[2,"disabled","disabled",fn],disabledInteractive:[2,"disabledInteractive","disabledInteractive",fn]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:QDe,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(n,o){if(1&n){const r=pt();ho(),w(0,"button",1,0),we("click",function(){return fe(r),ge(o._onButtonClick())}),te(2,JDe,2,1,"div",2),w(3,"span",3),On(4),x()(),Re(5,"span",4)(6,"span",5)}if(2&n){const r=Vi(1);N("id",o.buttonId)("disabled",o.disabled&&!o.disabledInteractive||null),zn("role",o.isSingleSelector()?"radio":"button")("tabindex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("aria-pressed",o.isSingleSelector()?null:o.checked)("aria-checked",o.isSingleSelector()?o.checked:null)("name",o._getButtonName())("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledby)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),E(2),Xi(o.buttonToggleGroup&&(!o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideSingleSelectionIndicator||o.buttonToggleGroup.multiple&&!o.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),E(4),N("matRippleTrigger",r)("matRippleDisabled",o.disableRipple||o.disabled)}},dependencies:[Mb,gj],styles:[".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0);border-radius:var(--mat-legacy-button-toggle-shape)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-legacy-button-toggle-text-color);font-family:var(--mat-legacy-button-toggle-label-text-font);font-size:var(--mat-legacy-button-toggle-label-text-size);line-height:var(--mat-legacy-button-toggle-label-text-line-height);font-weight:var(--mat-legacy-button-toggle-label-text-weight);letter-spacing:var(--mat-legacy-button-toggle-label-text-tracking);--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-legacy-button-toggle-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-legacy-button-toggle-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-legacy-button-toggle-selected-state-text-color);background-color:var(--mat-legacy-button-toggle-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-legacy-button-toggle-disabled-state-text-color);background-color:var(--mat-legacy-button-toggle-disabled-state-background-color);--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-legacy-button-toggle-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-legacy-button-toggle-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-standard-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-standard-button-toggle-background-color, transparent);font-family:var(--mat-standard-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-standard-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-standard-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-standard-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-standard-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-standard-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-standard-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-standard-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color: var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-standard-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-standard-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-standard-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-standard-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-legacy-button-toggle-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-standard-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-legacy-button-toggle-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-standard-button-toggle-shape, var(--mat-sys-corner-extra-large))}\n"],encapsulation:2,changeDetection:0})}return t})(),n2e=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=Ni({type:t});static \u0275inj=_i({imports:[Ki,e0,sA,Ki]})}return t})(),V7=(()=>{class t{progressHours;progressPercentage;radius;width;circumference;stroke_width=3;incompleteColor="#E0E2EC";completeColor="#000000";dash_array;dash_offset;display_radius;display_width;display_transform;display_text_x;display_text_y;constructor(){}ngOnInit(){this.width=2*this.radius,this.circumference=2*this.radius*Math.PI,this.dash_array=this.circumference.toString()+" "+this.circumference.toString(),this.dash_offset=this.getOffset(),this.display_radius=.75*this.radius,this.display_width=2*this.display_radius,this.display_transform=this.getDisplayTransform()}getOffset(){return 100==this.progressPercentage?"0":((100-this.progressPercentage)/100*this.circumference).toString()}getDisplayTransform(){let e=.5*this.radius;return"translate("+e.toString()+", "+e.toString()+")"}getCircleCenterX(){return 2*this.radius*Math.cos(Math.PI/4)}getCircleCenterY(){return 2*this.radius*Math.cos(Math.PI/4)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=cn({type:t,selectors:[["app-hour-circle-progress"]],inputs:{progressHours:"progressHours",progressPercentage:"progressPercentage",radius:"radius"},standalone:!1,decls:7,vars:27,consts:[[1,"progress-ring"],["fill","transparent",1,"progress-ring-circle-bottom"],["fill","transparent","transform-origin","50% 50%","transform","rotate(-90 0 0)",1,"progress-ring-circle-top"],[1,"progress-display"],["x","50%","y","50%","text-anchor","middle","dominant-baseline","middle",1,"progress-display-text"]],template:function(n,o){1&n&&(Va(),w(0,"svg",0),Re(1,"circle",1)(2,"circle",2)(3,"circle",3),w(4,"text",4),M(5),ti(6,"number"),x()()),2&n&&(zn("width",2*o.width)("height",2*o.width),E(),zn("stroke",o.incompleteColor)("stroke-width",o.stroke_width)("r",o.radius)("cx",o.width)("cy",o.width),E(),zn("stroke",o.completeColor)("stroke-width",o.stroke_width)("r",o.radius)("cx",o.width)("cy",o.width)("stroke-dasharray",o.dash_array)("stroke-dashoffset",o.dash_offset),E(),zn("r",o.display_radius)("cx",o.display_width)("cy",o.display_width)("fill",o.completeColor)("transform",o.display_transform),E(),zn("fill",o.incompleteColor)("font-size",3*o.width/7)("dy",o.width/15)("font-weight","bold"),E(),Jt(" ",hi(6,24,o.progressHours,"1.1-1")," "))},dependencies:[U5],styles:[".progress-ring[_ngcontent-%COMP%]{transform:translate(0);padding:0%;margin:0%}"]})}return t})();const i2e=(t,i)=>({"pin-icon-fill":t,"pin-icon":i});function o2e(t,i){1&t&&Re(0,"mat-card",2)}function r2e(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",21),M(2),x()()),2&t){const e=X(2);E(),Iv("matTooltip","Valid data status (",e.statusInfo.status_extra_info.good_data_hours.toFixed(2)," hours)"),E(),Ct(e.statusInfo.ui_info.good_data_icon)}}function a2e(t,i){if(1&t&&(w(0,"span")(1,"div",22),Re(2,"app-hour-circle-progress",23),x()()),2&t){const e=X(2);E(2),N("progressPercentage",e.statusInfo.status_extra_info.good_data_pcnt)("progressHours",e.statusInfo.status_extra_info.good_data_hours)("radius",15)}}function s2e(t,i){if(1&t){const e=pt();w(0,"span")(1,"button",24),we("click",function(o){fe(e);const r=X(2);return r.viewSingleDeviceMap(r.statusInfo),ge(o.stopPropagation())}),w(2,"mat-icon",25),M(3,"location_searching"),x()()()}}function l2e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2);E(),Jt(" ",e.statusInfo.status_info.friendlyname," ")}}function c2e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X(2);E(),Jt(" ",e.statusInfo.status_info.serialnumber," ")}}function d2e(t,i){if(1&t&&(w(0,"span",26),Re(1,"mat-progress-bar",27),x()),2&t){const e=X(2);E(),DS("matTooltip","Valid Data ",e.statusInfo.status_extra_info.good_data_hours.toFixed(2),"hrs / Recorded ",e.statusInfo.status_extra_info.record_hours.toFixed(2),"hrs"),ys("value",e.statusInfo.status_extra_info.record_pcnt)}}function u2e(t,i){1&t&&(w(0,"span",28)(1,"span",8),M(2,"No Status Available"),x()())}function h2e(t,i){1&t&&(w(0,"span",28)(1,"span",8),M(2,"No Subscription"),x()())}function p2e(t,i){if(1&t&&(w(0,"div",29)(1,"mat-icon",30),M(2),x()()),2&t){const e=X(2);E(2),Ct(e.statusInfo.ui_info.notify_err_icon)}}function m2e(t,i){1&t&&(w(0,"span"),Re(1,"mat-icon",32),M(2,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function f2e(t,i){1&t&&(w(0,"span")(1,"mat-icon",33),M(2,"360"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function _2e(t,i){1&t&&(w(0,"span"),Re(1,"mat-icon",34),M(2,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function g2e(t,i){if(1&t&&(w(0,"span")(1,"div",31),te(2,m2e,3,1,"span",4)(3,f2e,4,1,"span",4)(4,_2e,3,1,"span",4),x()()),2&t){const e=X(2);E(2),N("ngIf",!e.statusInfo.status_info.spo2connected),E(),N("ngIf",!e.statusInfo.status_info.beltconnected&&!e.statusInfo.status_info.wornonwrist),E(),N("ngIf",!e.statusInfo.status_info.airflowconnected)}}function b2e(t,i){if(1&t&&(w(0,"div",35)(1,"mat-icon",36),M(2),x()()),2&t){const e=X(2);E(2),Ct(e.statusInfo.ui_info.reccomplete_final_icon)}}function y2e(t,i){if(1&t&&(w(0,"div",37)(1,"mat-icon",38),M(2),x()()),2&t){const e=X(2);E(2),Ct(e.statusInfo.ui_info.upload_success_icon)}}function v2e(t,i){if(1&t&&(w(0,"span",39)(1,"mat-icon",40),M(2),x()()),2&t){const e=X(2);E(2),Ct(e.statusInfo.ui_info.comm_err_icon)}}function x2e(t,i){if(1&t&&(w(0,"span",41)(1,"mat-icon",42),M(2),x()()),2&t){const e=X(2);E(2),Ct(e.statusInfo.ui_info.upload_fail_icon)}}function w2e(t,i){1&t&&(w(0,"div",43)(1,"mat-icon",40),M(2,"report"),x()())}function C2e(t,i){if(1&t){const e=pt();w(0,"mat-card",3),we("click",function(){return fe(e),ge(X().onOpenCardHistory())}),te(1,r2e,3,3,"span",4)(2,a2e,3,3,"span",4)(3,s2e,4,0,"span",4),w(4,"button",5),we("click",function(o){fe(e);const r=X();return r.togglePinnedDevice(r.statusInfo.status_info.serialnumber),ge(o.stopPropagation())}),w(5,"mat-icon",6),M(6,"bookmark"),x()(),Re(7,"div",7),w(8,"mat-card-header")(9,"mat-card-title")(10,"div",8),te(11,l2e,2,1,"span",4)(12,c2e,2,1,"span",4),x()()(),w(13,"div",9),Re(14,"mat-icon",10),x(),w(15,"div",11),M(16),x(),Re(17,"div",12),te(18,d2e,2,4,"span",13),Re(19,"div",7),te(20,u2e,3,0,"span",14)(21,h2e,3,0,"span",14)(22,p2e,3,1,"div",15)(23,g2e,5,3,"span",4)(24,b2e,3,1,"div",16)(25,y2e,3,1,"div",17)(26,v2e,3,1,"span",18)(27,x2e,3,1,"span",19)(28,w2e,3,0,"div",20),x()}if(2&t){const e=X();N("ngStyle",e.commonFunctionHelper.getCardStyle(e.statusInfo,!1)),E(),N("ngIf",e.statusInfo.status_extra_info.sufficient_data),E(),N("ngIf",e.statusInfo.status_extra_info.recording||e.statusInfo.status_extra_info.recorded),E(),N("ngIf",e.locationAvailable(e.statusInfo)),E(2),N("ngClass",ux(18,i2e,e.statusInfo.status_extra_info.pinned,!e.statusInfo.status_extra_info.pinned)),E(6),N("ngIf",""!=e.statusInfo.status_info.friendlyname),E(),N("ngIf",""==e.statusInfo.status_info.friendlyname),E(4),Jt(" ",e.statusInfo.status_extra_info.night," "),E(2),N("ngIf",e.statusInfo.status_extra_info.recording),E(2),N("ngIf",100==e.statusInfo.status_info.mode),E(),N("ngIf",101==e.statusInfo.status_info.mode),E(),N("ngIf",e.commonFunctionHelper.canShowNotifyErrorIcon(e.statusInfo)),E(),N("ngIf",e.commonFunctionHelper.hasSensorErrors(e.statusInfo)),E(),N("ngIf",e.commonFunctionHelper.canShowRecordCompleteIcon(e.statusInfo)),E(),N("ngIf",e.commonFunctionHelper.canShowUploadCompleteIcon(e.statusInfo)),E(),N("ngIf",e.commonFunctionHelper.canShowCommunicationErrorIcon(e.statusInfo)),E(),N("ngIf",e.statusInfo.status_extra_info.upload_failed),E(),N("ngIf",101==e.statusInfo.status_info.mode)}}let S2e=(()=>{class t{dialog;el;layout;statusInfo=new W3;demoMode;togglePin=new Tt;viewHistory=new Tt;commonFunctionHelper=new Rb;constructor(e,n,o){this.dialog=e,this.el=n,this.layout=o}ngOnInit(){}onOpenCardHistory(){this.viewHistory.emit(this.statusInfo)}doNothing(){}locationAvailable(e){return e.status_info.has_location_info}viewSingleDeviceMap(e){this.commonFunctionHelper.viewSingleDeviceMap(this.layout,this.dialog,e)}togglePinnedDevice(e){this.togglePin.emit(e)}static \u0275fac=function(n){return new(n||t)($e(pa),$e(Pn),$e(tD))};static \u0275cmp=cn({type:t,selectors:[["app-status-card"]],inputs:{statusInfo:"statusInfo",demoMode:"demoMode"},outputs:{togglePin:"togglePin",viewHistory:"viewHistory"},standalone:!1,decls:2,vars:2,consts:[["class","card",4,"ngIf"],["class","card",3,"ngStyle","click",4,"ngIf"],[1,"card"],[1,"card",3,"click","ngStyle"],[4,"ngIf"],["mat-icon-button","",1,"pin-button",3,"click"],["fontSet","material-symbols-outlined",3,"ngClass"],[1,"spacer-1"],[1,"serialnumber"],[1,"svgiconparent"],["svgIcon","nomadair",1,"nomadairicon"],["matTooltip","recording night",1,"nomadaircenterpos"],[1,"spacer-3"],["class","ssdi-rec-hours",4,"ngIf"],["class","no-subscription",4,"ngIf"],["matTooltip","status error","matTooltipPosition","left",4,"ngIf"],["matTooltip","recording complete","matTooltipPosition","above",4,"ngIf"],["matTooltip","upload complete","matTooltipPosition","above",4,"ngIf"],["matTooltip","communication error","matTooltipPosition","above",4,"ngIf"],["class","upload-failed-container","matTooltip","Upload failed. Download study from device.","matTooltipPosition","above",4,"ngIf"],["matTooltip","subscription is required to receive status messages","matTooltipPosition","above",4,"ngIf"],["fontSet","material-symbols-outlined",1,"ssdi-icon",3,"matTooltip"],[1,"ssdi-hours"],[3,"progressPercentage","progressHours","radius"],["mat-icon-button","",1,"map-button",3,"click"],["fontSet","material-symbols-outlined",1,"map-icon"],[1,"ssdi-rec-hours"],["mode","determinate",1,"black-progress",3,"matTooltip","value"],[1,"no-subscription"],["matTooltip","status error","matTooltipPosition","left"],["fontSet","material-symbols-outlined",1,"notify-error-icon"],[1,"sensor-error-icons"],["svgIcon","blooddrop_black",1,"customicon",3,"inline"],["fontSet","material-symbols-outlined",1,"customicon",3,"inline"],["svgIcon","air_black",1,"customicon",3,"inline"],["matTooltip","recording complete","matTooltipPosition","above"],["fontSet","material-symbols-outlined",1,"record-complete-icon"],["matTooltip","upload complete","matTooltipPosition","above"],["fontSet","material-symbols-outlined",1,"upload-complete-icon"],["matTooltip","communication error","matTooltipPosition","above"],["fontSet","material-symbols-outlined",1,"comm-error-icon"],["matTooltip","Upload failed. Download study from device.","matTooltipPosition","above",1,"upload-failed-container"],["fontSet","material-symbols-outlined",1,"upload-failed-icon"],["matTooltip","subscription is required to receive status messages","matTooltipPosition","above"]],template:function(n,o){1&n&&te(0,o2e,1,0,"mat-card",0)(1,C2e,29,21,"mat-card",1),2&n&&(N("ngIf",o.statusInfo.status_extra_info.place_holder),E(),N("ngIf",!o.statusInfo.status_extra_info.place_holder))},dependencies:[$d,ir,Ym,qa,Sr,Pa,r0,a0,Nx,m0,V7],styles:['html[_ngcontent-%COMP%]{font-size:100%}svg[_ngcontent-%COMP%]{display:block}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}.customicon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:26px}.black-text[_ngcontent-%COMP%]{color:#000!important}.svgiconparent[_ngcontent-%COMP%]{font-size:0;width:100px;height:65px;margin-left:auto;margin-right:auto;padding:0}.card[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;width:var(--watchtower-card-width);position:relative;padding:0;margin:0}.nomadairicon[_ngcontent-%COMP%]{color:#000;height:100%;width:100%;display:block}.nomadairicon-2[_ngcontent-%COMP%]{color:#000;width:100px;height:65px}.nomadaircenterpos[_ngcontent-%COMP%]{font-size:x-large;font-variant-numeric:tabular-nums;display:block;margin:0 auto;position:relative;top:-32px;padding:0;line-height:0%}.status-mode-flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:left;gap:.15em}.status-mode-flex-item[_ngcontent-%COMP%]{align-self:center;min-width:2em}.statusmodetext[_ngcontent-%COMP%]{font-weight:700;text-align:center;white-space:nowrap}.serialnumber[_ngcontent-%COMP%]{font-weight:700;color:#000;font-size:.8rem;white-space:nowrap;text-align:center}.spacer-1[_ngcontent-%COMP%]{height:1.5em}.spacer-2[_ngcontent-%COMP%]{height:2em}.spacer-3[_ngcontent-%COMP%]{height:3em}.ssdi-icon[_ngcontent-%COMP%]{font-size:x-large;position:absolute;left:1.55em;top:.3em}.ssdi-hours[_ngcontent-%COMP%]{position:absolute;left:-.6em;top:-.6em}.ssdi-rec-hours[_ngcontent-%COMP%]{position:absolute;top:9.6em;margin-left:auto;margin-right:auto;width:50%}.no-subscription[_ngcontent-%COMP%]{position:absolute;top:10.1em;margin-left:auto;margin-right:auto}.map-button[_ngcontent-%COMP%]{position:absolute;right:1.5em;top:0;outline:none!important;color:#000;z-index:2}.pin-button[_ngcontent-%COMP%]{position:absolute;right:.2em;top:0;outline:none!important;color:#000;z-index:2}.pin-icon[_ngcontent-%COMP%]{font-size:1.2em!important}.pin-icon-fill[_ngcontent-%COMP%]{font-size:1.2em!important;font-variation-settings:"FILL" 1!important}.notify-error-icon[_ngcontent-%COMP%]{font-size:3em;width:3em;height:3em;position:absolute;left:0;bottom:-2em} .mat-tooltip.notify-error-icon{position:relative;left:-.75rem;top:-3rem}.sensor-error-icons[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.1em;position:absolute;left:3em;bottom:0}.record-complete-icon[_ngcontent-%COMP%], .upload-complete-icon[_ngcontent-%COMP%]{font-size:2em;width:2em;height:2em;position:absolute;right:-.8em;bottom:-.9em}.comm-error-icon[_ngcontent-%COMP%]{font-size:3em;width:3em;height:3em;position:absolute;right:-2em;bottom:-2em}.upload-failed-container[_ngcontent-%COMP%]{position:relative}.upload-failed-icon[_ngcontent-%COMP%]{transform:rotate(90deg);font-size:3em;width:3em;height:3em;position:absolute;right:-2em;bottom:-2em} .mat-card-header{margin-bottom:4px!important} .mat-card-header-text{margin:0 auto!important}']})}return t})();function T2e(t,i){1&t&&(w(0,"th",16),M(1,"Pinned"),x())}function D2e(t,i){1&t&&(w(0,"span")(1,"mat-icon",20),M(2,"bookmark"),x()())}function I2e(t,i){1&t&&(w(0,"span")(1,"mat-icon",21),M(2,"bookmark"),x()())}function E2e(t,i){if(1&t){const e=pt();w(0,"td",17)(1,"button",18),we("click",function(o){const r=fe(e).$implicit;return X().togglePinnedDevice(r.status_info.serialnumber),ge(o.stopPropagation())}),te(2,D2e,3,0,"span",19)(3,I2e,3,0,"span",19),x()()}if(2&t){const e=i.$implicit;E(2),N("ngIf",e.status_extra_info.pinned),E(),N("ngIf",!e.status_extra_info.pinned)}}function M2e(t,i){1&t&&(w(0,"th",22),M(1,"Friendly Name"),x())}function A2e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" ",e.status_info.friendlyname," ")}}function k2e(t,i){1&t&&(w(0,"span")(1,"span",24),M(2," None "),x()())}function R2e(t,i){if(1&t&&(w(0,"td",23),te(1,A2e,2,1,"span",19)(2,k2e,3,0,"span",19),x()),2&t){const e=i.$implicit;E(),N("ngIf",""!=e.status_info.friendlyname),E(),N("ngIf",""==e.status_info.friendlyname)}}function O2e(t,i){1&t&&(w(0,"th",22),M(1,"Serial Number"),x())}function P2e(t,i){if(1&t&&(w(0,"td",25),M(1),x()),2&t){const e=i.$implicit;E(),Jt(" ",e.status_info.serialnumber," ")}}function L2e(t,i){1&t&&(w(0,"th",22),M(1,"Status Time"),x())}function F2e(t,i){1&t&&(w(0,"span"),M(1," Subscription Required for Status "),x())}function N2e(t,i){1&t&&(w(0,"span"),M(1," No Status Available "),x())}function z2e(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",27),M(2),x()()),2&t){const e=X(2).$implicit;E(2),Ct(e.ui_info.notify_err_icon)}}function B2e(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",28),M(2),x()()),2&t){const e=X(2).$implicit;E(2),Ct(e.ui_info.comm_err_icon)}}function V2e(t,i){1&t&&(w(0,"span"),Re(1,"mat-icon",29),M(2,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function U2e(t,i){1&t&&(w(0,"span")(1,"mat-icon",30),M(2,"360"),x(),M(3,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function H2e(t,i){1&t&&(w(0,"span"),Re(1,"mat-icon",31),M(2,"\xa0 "),x()),2&t&&(E(),N("inline",!0))}function j2e(t,i){if(1&t&&(w(0,"span"),te(1,V2e,3,1,"span",19)(2,U2e,4,1,"span",19)(3,H2e,3,1,"span",19),x()),2&t){const e=X(2).$implicit;E(),N("ngIf",!e.status_info.spo2connected),E(),N("ngIf",!e.status_info.beltconnected&&!e.status_info.wornonwrist),E(),N("ngIf",!e.status_info.airflowconnected)}}function $2e(t,i){if(1&t&&(w(0,"span"),M(1),ti(2,"date"),x()),2&t){const e=X(2).$implicit,n=X();E(),Jt(" ",hi(2,1,n.commonFunctionHelper.getDateFromDateString(e.status_info.statustime),"medium")," ")}}function G2e(t,i){if(1&t&&(w(0,"span"),te(1,z2e,3,1,"span",19)(2,B2e,3,1,"span",19)(3,j2e,4,3,"span",19)(4,$2e,3,4,"span",19),x()),2&t){const e=X().$implicit,n=X();E(),N("ngIf",e.status_extra_info.notify_error||e.status_extra_info.sensor_error),E(),N("ngIf",e.status_extra_info.comm_error),E(),N("ngIf",n.commonFunctionHelper.hasSensorErrors(e)),E(),N("ngIf",""!=e.status_info.statustime)}}function q2e(t,i){if(1&t&&(w(0,"td",26),te(1,F2e,2,0,"span",19)(2,N2e,2,0,"span",19)(3,G2e,5,4,"span",19),x()),2&t){const e=i.$implicit;E(),N("ngIf",101==e.status_info.mode),E(),N("ngIf",100==e.status_info.mode),E(),N("ngIf",100!=e.status_info.mode)}}function W2e(t,i){1&t&&(w(0,"th",22),M(1,"Night"),x())}function Z2e(t,i){if(1&t&&(w(0,"span"),M(1),x()),2&t){const e=X().$implicit;E(),Jt(" ",e.status_extra_info.night," ")}}function Y2e(t,i){1&t&&(w(0,"span"),M(1," - "),x())}function X2e(t,i){if(1&t&&(w(0,"td",32),te(1,Z2e,2,1,"span",19)(2,Y2e,2,0,"span",19),x()),2&t){const e=i.$implicit;E(),N("ngIf",0!=e.status_info.mode&&100!=e.status_info.mode),E(),N("ngIf",0==e.status_info.mode||100==e.status_info.mode)}}function K2e(t,i){1&t&&(w(0,"th",22),M(1,"Status Mode"),x())}function Q2e(t,i){if(1&t){const e=pt();w(0,"div",36)(1,"button",39),we("click",function(o){fe(e);const r=X().$implicit;return X().viewSingleDeviceMap(r),ge(o.stopPropagation())}),w(2,"mat-icon",40),M(3,"location_searching"),x()()()}}function J2e(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",41),M(2),x()()),2&t){const e=X().$implicit;E(2),Ct(e.ui_info.mode_icon)}}function eIe(t,i){if(1&t&&(w(0,"span")(1,"mat-icon",42),M(2),x()()),2&t){const e=X().$implicit;E(2),Ct(e.ui_info.good_data_icon)}}function tIe(t,i){if(1&t&&(w(0,"td",33)(1,"div",34),te(2,Q2e,4,0,"div",35),w(3,"div",36),Re(4,"app-hour-circle-progress",37),x(),w(5,"div",36),te(6,J2e,3,1,"span",19)(7,eIe,3,1,"span",19),x(),w(8,"div",38),M(9),x()()()),2&t){const e=i.$implicit,n=X();E(2),N("ngIf",n.locationAvailable(e)),E(2),N("progressPercentage",e.status_extra_info.good_data_pcnt)("progressHours",e.status_extra_info.good_data_hours)("radius",12),E(2),N("ngIf",!e.status_extra_info.sufficient_data),E(),N("ngIf",e.status_extra_info.sufficient_data),E(2),Jt(" ",e.status_extra_info.mode_text," ")}}function nIe(t,i){1&t&&(w(0,"th",22),M(1,"Record Progress"),x())}function iIe(t,i){if(1&t&&(w(0,"div",45),Re(1,"mat-progress-bar",46),x()),2&t){const e=X().$implicit;E(),DS("matTooltip","Valid Data ",e.status_extra_info.good_data_hours.toFixed(2),"hrs / Recorded ",e.status_extra_info.record_hours.toFixed(2),"hrs"),ys("value",e.status_extra_info.record_pcnt)}}function oIe(t,i){if(1&t&&(w(0,"div")(1,"mat-icon",47),M(2),x()()),2&t){const e=X().$implicit;E(),DS("matTooltip","Valid Data ",e.status_extra_info.good_data_hours.toFixed(2),"hrs / Recorded ",e.status_extra_info.record_hours.toFixed(2),"hrs"),E(),Jt(" ",e.ui_info.reccomplete_final_icon," ")}}function rIe(t,i){if(1&t&&(w(0,"div")(1,"mat-icon",47),M(2),x()()),2&t){const e=X().$implicit;E(),ys("matTooltip",e.ui_info.good_data_icon_tooltip_set),E(),Jt(" ",e.ui_info.good_data_icon_set," ")}}function aIe(t,i){if(1&t&&(w(0,"td",43),te(1,iIe,2,4,"div",44)(2,oIe,3,4,"div",19)(3,rIe,3,2,"div",19),x()),2&t){const e=i.$implicit;E(),N("ngIf",e.status_extra_info.recording),E(),N("ngIf",e.status_extra_info.recorded),E(),N("ngIf",!e.status_extra_info.recording&&!e.status_extra_info.recorded&&""!=e.ui_info.good_data_icon_set)}}let sIe=(()=>{class t{table;cdRef;dialog;layout;demoMode;togglePin=new Tt;viewMap=new Tt;columnDefs;commonFunctionHelper=new Rb;constructor(e,n,o,r){this.table=e,this.cdRef=n,this.dialog=o,this.layout=r}ngOnInit(){this.cdRef.detectChanges(),this.updateColumnDefs()}ngAfterViewInit(){}updateColumnDefs(){this.columnDefs.forEach(e=>this.table.addColumnDef(e))}doNothing(){}locationAvailable(e){return e.status_info.has_location_info}viewSingleDeviceMap(e){this.commonFunctionHelper.viewSingleDeviceMap(this.layout,this.dialog,e)}togglePinnedDevice(e){this.togglePin.emit(e)}static \u0275fac=function(n){return new(n||t)($e(rd),$e(So),$e(pa),$e(tD))};static \u0275cmp=cn({type:t,selectors:[["app-status-row"]],viewQuery:function(n,o){if(1&n&&mn(Ac,5),2&n){let r;Bt(r=Vt())&&(o.columnDefs=r)}},inputs:{demoMode:"demoMode"},outputs:{togglePin:"togglePin",viewMap:"viewMap"},standalone:!1,decls:21,vars:0,consts:[["matColumnDef","pinned"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","data-label","Pinned",4,"matCellDef"],["matColumnDef","friendly_name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","data-label","Friendly Name","class","black-text",4,"matCellDef"],["matColumnDef","serial_number"],["mat-cell","","data-label","Serial Number","class","black-text",4,"matCellDef"],["matColumnDef","status_time"],["mat-cell","","data-label","Status Time","class","black-text",4,"matCellDef"],["matColumnDef","night"],["mat-cell","","data-label","Night","class","black-text",4,"matCellDef"],["matColumnDef","mode_text"],["class","status-mode-column","mat-cell","","data-label","Status Mode",4,"matCellDef"],["matColumnDef","ssdi"],["mat-cell","","data-label","Record Progress:",4,"matCellDef"],["mat-header-cell",""],["mat-cell","","data-label","Pinned"],[1,"pin-button-listview",3,"click"],[4,"ngIf"],["fontSet","material-symbols-outlined",1,"pin-icon-listview-fill"],["fontSet","material-symbols-outlined",1,"pin-icon-listview"],["mat-header-cell","","mat-sort-header",""],["mat-cell","","data-label","Friendly Name",1,"black-text"],[2,"font-style","italic"],["mat-cell","","data-label","Serial Number",1,"black-text"],["mat-cell","","data-label","Status Time",1,"black-text"],["fontSet","material-symbols-outlined","matTooltip","notify error",1,"staleicon"],["fontSet","material-symbols-outlined","matTooltip","communication error",1,"staleicon"],["svgIcon","blooddrop_black",1,"customicon",3,"inline"],["fontSet","material-symbols-outlined",1,"customicon",3,"inline"],["svgIcon","air_black",1,"customicon",3,"inline"],["mat-cell","","data-label","Night",1,"black-text"],["mat-cell","","data-label","Status Mode",1,"status-mode-column"],[1,"status-mode-flex-container"],["class","status-mode-flex-item",4,"ngIf"],[1,"status-mode-flex-item"],[3,"progressPercentage","progressHours","radius"],[1,"status-mode-flex-item","black-text"],["mat-icon-button","",1,"map-button",3,"click"],["fontSet","material-symbols-outlined",1,"map-icon"],["fontSet","material-symbols-outlined",1,"statusmodeicon_listview"],["fontSet","material-symbols-outlined",1,"statusmodeicon_ssdi_listview","statusmodeicon_listview_ssdi_compact"],["mat-cell","","data-label","Record Progress:"],["class","gooddataprogresswrapper-listview",4,"ngIf"],[1,"gooddataprogresswrapper-listview"],["mode","determinate",1,"black-progress",3,"matTooltip","value"],["fontSet","material-symbols-outlined",3,"matTooltip"]],template:function(n,o){1&n&&(at(0,0),te(1,T2e,2,0,"th",1)(2,E2e,4,2,"td",2),st(),at(3,3),te(4,M2e,2,0,"th",4)(5,R2e,3,2,"td",5),st(),at(6,6),te(7,O2e,2,0,"th",4)(8,P2e,2,1,"td",7),st(),at(9,8),te(10,L2e,2,0,"th",4)(11,q2e,4,3,"td",9),st(),at(12,10),te(13,W2e,2,0,"th",4)(14,X2e,3,2,"td",11),st(),at(15,12),te(16,K2e,2,0,"th",4)(17,tIe,10,7,"td",13),st(),at(18,14),te(19,nIe,2,0,"th",4)(20,aIe,4,3,"td",15),st())},dependencies:[ir,sd,Ac,ad,ld,cd,oh,qa,Sr,Pa,m0,V7,Rl],styles:['html[_ngcontent-%COMP%]{font-size:100%}svg[_ngcontent-%COMP%]{display:block}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}.customicon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:26px}.black-text[_ngcontent-%COMP%]{color:#000!important}.status-mode-flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:left;gap:.15em}.status-mode-flex-item[_ngcontent-%COMP%]{align-self:center;min-width:2em}.statusmodeicon_listview[_ngcontent-%COMP%]{font-size:x-large;color:#000!important;vertical-align:middle}.statusmodeicon_ssdi_listview[_ngcontent-%COMP%]{font-size:x-large;color:#000!important}.serialnumber[_ngcontent-%COMP%]{font-weight:700;color:#000;font-size:.8rem;white-space:nowrap;text-align:center}.staleicon[_ngcontent-%COMP%]{display:inline-flex}.gooddataprogresswrapper-listview[_ngcontent-%COMP%]{padding-top:.8em}.pin-icon[_ngcontent-%COMP%]{font-size:1.2em}.pin-icon-fill[_ngcontent-%COMP%]{font-size:1.2em;font-variation-settings:"FILL" 1}.pin-button-listview[_ngcontent-%COMP%]{border:none;background:none}.pin-icon-listview[_ngcontent-%COMP%]{font-size:large}.pin-icon-listview-fill[_ngcontent-%COMP%]{font-size:large;font-variation-settings:"FILL" 1}tr.mat-row[_ngcontent-%COMP%]{height:.1em!important}@media screen and (max-width: 900px){.gooddataprogresswrapper-listview[_ngcontent-%COMP%]{text-align:left!important;padding-bottom:1em!important}.statusmodeicon_listview_ssdi_compact[_ngcontent-%COMP%]{left:-6px}.status-mode-flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:right!important;gap:.15em}}']})}return t})();const lIe=["accordion"],sw=t=>({"background-color":t});function cIe(t,i){1&t&&(w(0,"div",32)(1,"mat-icon",40),M(2,"cancel"),x()())}function dIe(t,i){1&t&&(w(0,"div",32)(1,"mat-icon",40),M(2,"cancel"),x()())}function uIe(t,i){1&t&&(w(0,"div",32)(1,"mat-icon",40),M(2,"cancel"),x()())}function hIe(t,i){1&t&&(w(0,"div",32)(1,"mat-icon",40),M(2,"cancel"),x()())}function pIe(t,i){1&t&&(w(0,"div",32)(1,"mat-icon",40),M(2,"cancel"),x()())}function mIe(t,i){if(1&t){const e=pt();w(0,"button",41),we("click",function(){fe(e);const o=X(2);return o.filter.serial_filter="",ge(o.onFilterTextChange())}),w(1,"mat-icon",42),M(2,"close"),x()()}}function fIe(t,i){if(1&t){const e=pt();w(0,"button",41),we("click",function(){fe(e);const o=X(2);return o.filter.friendly_name_filter="",ge(o.onFilterTextChange())}),w(1,"mat-icon",42),M(2,"close"),x()()}}function _Ie(t,i){if(1&t){const e=pt();w(0,"button",47),we("click",function(){return fe(e),ge(X(3).demoModeCountChange(-10))}),w(1,"mat-icon",42),M(2,"remove"),x()()}2&t&&N("disabled",!X(3).enabledDemoModeCountChange(!1))}function gIe(t,i){if(1&t){const e=pt();w(0,"button",48),we("click",function(){return fe(e),ge(X(3).demoModeCountChange(10))}),w(1,"mat-icon",42),M(2,"add"),x()()}2&t&&N("disabled",!X(3).enabledDemoModeCountChange(!0))}function bIe(t,i){if(1&t){const e=pt();w(0,"div",43)(1,"mat-slide-toggle",44),we("change",function(){return fe(e),ge(X(2).toggleDemoMode())}),M(2,"Demo Mode"),x(),te(3,_Ie,3,1,"button",45)(4,gIe,3,1,"button",46),x()}if(2&t){const e=X(2);E(),N("checked",e.demo_mode)("disabled",!e.userInfo.isMasterDBUser()&&!e.userInfo.isDistributor()),E(2),N("ngIf",e.demo_mode),E(),N("ngIf",e.demo_mode)}}function yIe(t,i){if(1&t){const e=pt();w(0,"mat-chip-listbox",29)(1,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClearClick())}),w(2,"div",31)(3,"div",32),M(4," Clear Filters "),x()()(),w(5,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClick(1))}),w(6,"div",31)(7,"div",32),M(8," Idle "),x(),te(9,cIe,3,0,"div",33),x()(),w(10,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClick(2))}),w(11,"div",31)(12,"div",32),M(13," Schedule "),x(),te(14,dIe,3,0,"div",33),x()(),w(15,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClick(16))}),w(16,"div",31)(17,"div",32),M(18," Flex Schedule "),x(),te(19,uIe,3,0,"div",33),x()(),w(20,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClick(4))}),w(21,"div",31)(22,"div",32),M(23," Record "),x(),te(24,hIe,3,0,"div",33),x()(),w(25,"mat-chip",30),we("click",function(){return fe(e),ge(X().onFilterClick(8))}),w(26,"div",31)(27,"div",32),M(28," Upload "),x(),te(29,pIe,3,0,"div",33),x()()(),w(30,"span",34)(31,"mat-form-field",35)(32,"mat-label"),M(33,"Serial Filter:"),x(),w(34,"input",36),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.filter.serial_filter,o)||(r.filter.serial_filter=o),ge(o)}),we("keypress",function(){return fe(e),ge(X().onFilterTextChange())}),x(),te(35,mIe,3,0,"button",37),x(),w(36,"mat-form-field",35)(37,"mat-label"),M(38,"Friendly Name Filter:"),x(),w(39,"input",38),Qn("ngModelChange",function(o){fe(e);const r=X();return ei(r.filter.friendly_name_filter,o)||(r.filter.friendly_name_filter=o),ge(o)}),we("keypress",function(){return fe(e),ge(X().onFilterTextChange())}),x(),te(40,fIe,3,0,"button",37),x(),te(41,bIe,5,4,"div",39),x()}if(2&t){const e=X();E(),N("ngStyle",Ar(22,sw,e.info_chip_clr))("selectable",!0),E(4),N("ngStyle",Ar(24,sw,e.idle_statusclr))("selectable",!0),E(4),N("ngIf",e.isFilterApplied(1)),E(),N("ngStyle",Ar(26,sw,e.sched_statusclr))("selectable",!0),E(4),N("ngIf",e.isFilterApplied(2)),E(),N("ngStyle",Ar(28,sw,e.flex_sched_statusclr))("selectable",!0),E(4),N("ngIf",e.isFilterApplied(16)),E(),N("ngStyle",Ar(30,sw,e.rec_statusclr))("selectable",!0),E(4),N("ngIf",e.isFilterApplied(4)),E(),N("ngStyle",Ar(32,sw,e.upload_statusclr))("selectable",!0),E(4),N("ngIf",e.isFilterApplied(8)),E(5),Kn("ngModel",e.filter.serial_filter),E(),N("ngIf",""!=e.filter.serial_filter),E(4),Kn("ngModel",e.filter.friendly_name_filter),E(),N("ngIf",""!=e.filter.friendly_name_filter),E(),N("ngIf",e.userInfo.isMasterDBUser()||e.userInfo.isDistributor())}}function vIe(t,i){1&t&&(w(0,"div",49),M(1," Retrieving device info... "),Re(2,"mat-progress-bar",50),x())}function xIe(t,i){if(1&t){const e=pt();w(0,"div",57)(1,"app-status-card",58),we("togglePin",function(o){return fe(e),ge(X(3).togglePinnedDevice(o))})("viewHistory",function(o){return fe(e),ge(X(3).onOpenCardHistory(o))})("viewMap",function(o){return fe(e),ge(X(3).viewSingleDeviceMap(o))}),x()()}if(2&t){const e=i.$implicit,n=X(3);E(),N("statusInfo",e)("demoMode",n.demo_mode)}}function wIe(t,i){if(1&t&&(w(0,"div",55),te(1,xIe,2,2,"div",56),x()),2&t){const e=X(2);E(),N("ngForOf",e.scheduledDayGroups[0].data)}}function CIe(t,i){1&t&&(w(0,"div",59)(1,"div"),M(2,"Recent"),x()())}function SIe(t,i){if(1&t){const e=pt();w(0,"div",57)(1,"app-status-card",58),we("togglePin",function(o){return fe(e),ge(X(3).togglePinnedDevice(o))})("viewHistory",function(o){return fe(e),ge(X(3).onOpenCardHistory(o))})("viewMap",function(o){return fe(e),ge(X(3).viewSingleDeviceMap(o))}),x()()}if(2&t){const e=i.$implicit,n=X(3);E(),N("statusInfo",e)("demoMode",n.demo_mode)}}function TIe(t,i){if(1&t&&(w(0,"div",55),te(1,SIe,2,2,"div",56),x()),2&t){const e=X(2);E(),N("ngForOf",e.scheduledDayGroups[1].data)}}function DIe(t,i){1&t&&(w(0,"div",59)(1,"div"),M(2,"Other"),x()())}function IIe(t,i){if(1&t){const e=pt();w(0,"div",57)(1,"app-status-card",58),we("togglePin",function(o){return fe(e),ge(X(3).togglePinnedDevice(o))})("viewHistory",function(o){return fe(e),ge(X(3).onOpenCardHistory(o))})("viewMap",function(o){return fe(e),ge(X(3).viewSingleDeviceMap(o))}),x()()}if(2&t){const e=i.$implicit,n=X(3);E(),N("statusInfo",e)("demoMode",n.demo_mode)}}function EIe(t,i){if(1&t&&(w(0,"div",55),te(1,IIe,2,2,"div",56),x()),2&t){const e=X(2);E(),N("ngForOf",e.scheduledDayGroups[2].data)}}function MIe(t,i){1&t&&(w(0,"div",49),M(1,"No results found. Try adjusting your filters."),x())}function AIe(t,i){1&t&&(w(0,"span"),M(1,"No device status"),x())}function kIe(t,i){if(1&t&&(w(0,"div",49),te(1,AIe,2,0,"span",60),x()),2&t){const e=X(3);E(),N("ngIf",!e.loadingData())}}function RIe(t,i){if(1&t&&te(0,kIe,2,1,"div",54),2&t){const e=X(2);N("ngIf",0==e.nomadAirLatestStatusResults.data.length)("ngIfElse",e.filteredEmpty)}}function OIe(t,i){if(1&t&&(w(0,"div",51),te(1,wIe,2,1,"div",52)(2,CIe,3,0,"div",53)(3,TIe,2,1,"div",52)(4,DIe,3,0,"div",53)(5,EIe,2,1,"div",52)(6,MIe,2,0,"div",54)(7,RIe,1,2,"ng-template",null,0,Ud),x()),2&t){const e=Vi(8),n=X();E(),N("ngIf",n.hasCurrentData()),E(),N("ngIf",n.hasRecentData()),E(),N("ngIf",n.hasRecentData()),E(),N("ngIf",n.hasOtherData()),E(),N("ngIf",n.hasOtherData()),E(),N("ngIf",n.hasNoFilteredResults())("ngIfElse",e)}}function PIe(t,i){1&t&&Re(0,"tr",67)}function LIe(t,i){if(1&t){const e=pt();w(0,"tr",68),we("click",function(){const o=fe(e).$implicit;return ge(X(3).onOpenCardHistory(o))}),x()}if(2&t){const e=i.$implicit,n=X(3);N("hidden",e.status_extra_info.place_holder)("ngStyle",n.commonFunctionHelper.getCardStyle(e,!0))}}function FIe(t,i){if(1&t){const e=pt();w(0,"table",63)(1,"app-status-row",64),we("togglePin",function(o){return fe(e),ge(X(2).togglePinnedDevice(o))})("viewMap",function(o){return fe(e),ge(X(2).viewSingleDeviceMap(o))}),x(),te(2,PIe,1,0,"tr",65)(3,LIe,1,2,"tr",66),x()}if(2&t){const e=X(2);N("dataSource",e.scheduledDayGroups[0].data),E(),N("demoMode",e.demo_mode),E(),N("matHeaderRowDef",e.columnsToDisplayWatchTowerListView),E(),N("matRowDefColumns",e.columnsToDisplayWatchTowerListView)}}function NIe(t,i){1&t&&(w(0,"div",59)(1,"div"),M(2,"Recent"),x()())}function zIe(t,i){1&t&&Re(0,"tr",67)}function BIe(t,i){if(1&t){const e=pt();w(0,"tr",68),we("click",function(){const o=fe(e).$implicit;return ge(X(3).onOpenCardHistory(o))}),x()}if(2&t){const e=i.$implicit,n=X(3);N("hidden",e.status_extra_info.place_holder)("ngStyle",n.commonFunctionHelper.getCardStyle(e,!0))}}function VIe(t,i){if(1&t){const e=pt();w(0,"table",63)(1,"app-status-row",69),we("togglePin",function(o){return fe(e),ge(X(2).togglePinnedDevice(o))}),x(),te(2,zIe,1,0,"tr",65)(3,BIe,1,2,"tr",66),x()}if(2&t){const e=X(2);N("dataSource",e.scheduledDayGroups[1].data),E(2),N("matHeaderRowDef",e.columnsToDisplayWatchTowerListView),E(),N("matRowDefColumns",e.columnsToDisplayWatchTowerListView)}}function UIe(t,i){1&t&&(w(0,"div",59)(1,"div"),M(2,"Other"),x()())}function HIe(t,i){1&t&&Re(0,"tr",67)}function jIe(t,i){if(1&t){const e=pt();w(0,"tr",68),we("click",function(){const o=fe(e).$implicit;return ge(X(3).onOpenCardHistory(o))}),x()}if(2&t){const e=i.$implicit,n=X(3);N("hidden",e.status_extra_info.place_holder)("ngStyle",n.commonFunctionHelper.getCardStyle(e,!0))}}function $Ie(t,i){if(1&t){const e=pt();w(0,"table",63)(1,"app-status-row",69),we("togglePin",function(o){return fe(e),ge(X(2).togglePinnedDevice(o))}),x(),te(2,HIe,1,0,"tr",65)(3,jIe,1,2,"tr",66),x()}if(2&t){const e=X(2);N("dataSource",e.scheduledDayGroups[2].data),E(2),N("matHeaderRowDef",e.columnsToDisplayWatchTowerListView),E(),N("matRowDefColumns",e.columnsToDisplayWatchTowerListView)}}function GIe(t,i){1&t&&(w(0,"div",49),M(1,"No results found. Try adjusting your filters."),x())}function qIe(t,i){1&t&&(w(0,"div",49),M(1,"No device status"),x())}function WIe(t,i){if(1&t&&te(0,qIe,2,0,"div",54),2&t){const e=X(2);N("ngIf",0==e.nomadAirLatestStatusResults.data.length)("ngIfElse",e.filteredEmpty)}}function ZIe(t,i){if(1&t&&(w(0,"div",61),te(1,FIe,4,4,"table",62)(2,NIe,3,0,"div",53)(3,VIe,4,3,"table",62)(4,UIe,3,0,"div",53)(5,$Ie,4,3,"table",62)(6,GIe,2,0,"div",54)(7,WIe,1,2,"ng-template",null,0,Ud),x()),2&t){const e=Vi(8),n=X();E(),N("ngIf",n.hasCurrentData()),E(),N("ngIf",n.hasRecentData()),E(),N("ngIf",n.hasRecentData()),E(),N("ngIf",n.hasOtherData()),E(),N("ngIf",n.hasOtherData()),E(),N("ngIf",n.hasNoFilteredResults())("ngIfElse",e)}}const YIe=li_backendURL+"/drbr_refresh",U7="PinnedNomadAir";var b0=function(t){return t[t.SCHEDULED_CURRENT=0]="SCHEDULED_CURRENT",t[t.SCHEDULED_RECENT=1]="SCHEDULED_RECENT",t[t.SCHEDULED_OTHER=2]="SCHEDULED_OTHER",t}(b0||{}),ud=function(t){return t[t.RECORDING_WITH_URGENT_ERROR=0]="RECORDING_WITH_URGENT_ERROR",t[t.RECORDING_WITH_ERROR=1]="RECORDING_WITH_ERROR",t[t.RECORDING_NO_ERROR=2]="RECORDING_NO_ERROR",t[t.RECORDING_COMPLETE=3]="RECORDING_COMPLETE",t[t.UPLOAD_FAILED=4]="UPLOAD_FAILED",t[t.UPLOAD_IN_PROGRESS=5]="UPLOAD_IN_PROGRESS",t[t.UPLOAD_COMPLETE=6]="UPLOAD_COMPLETE",t[t.FLEX_SCHEDULED=7]="FLEX_SCHEDULED",t[t.SCHEDULED=8]="SCHEDULED",t[t.IDLE_STALE=9]="IDLE_STALE",t[t.IDLE_NO_STATUS=10]="IDLE_NO_STATUS",t[t.IDLE_NO_SUBSCRIPTION=11]="IDLE_NO_SUBSCRIPTION",t}(ud||{});let XIe=(()=>{class t{http;loginService;router;route;dialog;layout;cdr;el;commonFunctionHelper=new Rb;scrHeight;scrWidth;nomadAirLatestStatusResults=new Fr([]);scheduledDayGroups=[new Fr,new Fr,new Fr];nomadAirStatusPageInfoStore=new XDe;onResize(e){this.scrHeight=window.innerHeight,this.scrWidth=window.innerWidth,this.calculateMaxItemsPerRow()}sort;accordion;wt_card_width;wt_card_grid_gap;wt_max_items_per_row;wt_common=new Rb;userInfo=null;filter=new Cde;displayedItemCount=0;goodDataHours=0;demo_mode=!1;demo_mode_count=50;page_view="gridview";prev_view="gridview";time_remaining="";enableMapView=!1;service_loading_data=!0;info_chip_clr;idle_statusclr;sched_statusclr;flex_sched_statusclr;rec_statusclr;upload_statusclr;error_statusclr;pinnedDevices=new Array;columnsToDisplayWatchTowerListView=["pinned","friendly_name","serial_number","status_time","night","mode_text","ssdi"];availableViews=["gridview","listview"];latestScheduleTime=null;statusDataAvailableSubscription;statusUpdateSubscription;destroy$=new Ee;constructor(e,n,o,r,u,y,I,V){this.http=e,this.loginService=n,this.router=o,this.route=r,this.dialog=u,this.layout=y,this.cdr=I,this.el=V;const q=getComputedStyle(document.documentElement);this.wt_card_width=parseFloat(q.getPropertyValue("--watchtower-card-width")),this.wt_card_grid_gap=parseFloat(q.getPropertyValue("--watchtower-card-grid-gap")),this.onResize()}calculateMaxItemsPerRow(){const e=window.innerWidth,n=parseFloat(getComputedStyle(document.documentElement).fontSize),r=this.wt_card_grid_gap*n;this.wt_max_items_per_row=Math.floor((e+r)/(this.wt_card_width*n+r))}ngOnInit(){this.loginService.userInfo$.pipe(ro(this.destroy$)).subscribe(e=>this.userInfo=e),this.loginService.setWatchTowerActive(!0),this.pinnedDevices.length=0,this.demo_mode=this.loginService.getNomadAirStatusDemoMode(),this.demo_mode_count=this.loginService.getNomadAirStatusDemoCount(),this.getLastFilterSet(),this.getLocalData(),this.initView(),this.service_loading_data=!0,this.statusDataAvailableSubscription=this.loginService.getWatchTowerStatusInitialized().pipe(or(e=>e),$a(1)).subscribe(()=>{this.refreshNomadAirStatus(),this.enableMapView=this.demo_mode||this.loginService.getLocationsAvailable(),this.service_loading_data=!1,this.cdr.detectChanges()}),this.loginService.refreshNomadAirStatusNow().pipe(ro(this.destroy$)).subscribe(()=>{this.startStatusSubscription()})}startStatusSubscription(){this.statusUpdateSubscription&&this.statusUpdateSubscription.unsubscribe(),this.statusUpdateSubscription=jL(1e3).pipe(ro(this.destroy$)).subscribe(()=>{this.service_loading_data||(this.refreshNomadAirStatus(),this.updateSessionTimeRemaining(),this.cdr.detectChanges())})}ngAfterViewInit(){this.scheduledDayGroups.forEach(e=>{e.sortData=(n,o)=>{const r=o.active,u=o.direction;let y=new Fr([]);return y.data=n.sort((I,V)=>{const q=this.nomadAirLatestStatusResults.sortingDataAccessor(I,r),ee=this.nomadAirLatestStatusResults.sortingDataAccessor(V,r);return this.compareFunction(q,ee)*("asc"==u?1:-1)}),y.data=this.sortNomadAirStatusData(y.data),y.data}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.statusUpdateSubscription&&this.statusUpdateSubscription.unsubscribe(),this.statusDataAvailableSubscription&&this.statusDataAvailableSubscription.unsubscribe(),this.loginService.setWatchTowerActive(!1)}initView(){let e=!1,n=$i.LoadLocalStorageSetting("watchTowerPageView","gridview");for(let o=0;o{}),e&&this.loginService.refreshNomadAirStatusNow()}goToHelpPage(){this.page_view=this.prev_view,this.router.navigate(["/watchtower/watchtower_help"])}getLastFilterSet(){let e=Number(localStorage.getItem("watchTowerLastFilterCodeSet"));!isNaN(e)&&Hx.isFilterCodeValid(e)&&(this.filter.device_filter=e)}saveFilterSet(){$i.SaveLocalStorageSetting("watchTowerLastFilterCodeSet",this.filter.device_filter.toString())}getLocalData(){let e=new Array;e=JSON.parse(localStorage.getItem(U7)),null!=e&&(this.pinnedDevices=e)}saveLocalData(){let e=new Array;e=this.pinnedDevices,localStorage.setItem(U7,JSON.stringify(e))}onChangePageView(){["gridview","listview"].includes(this.page_view)&&(this.prev_view=this.page_view),"mapview"!=this.page_view&&"helpview"!=this.page_view&&localStorage.setItem("watchTowerPageView",this.page_view)}dateMatch(e,n){const o=e.getFullYear()===n.getFullYear(),r=e.getMonth()===n.getMonth(),u=e.getDate()===n.getDate();return o&&r&&u}updateStatusTables(){this.nomadAirStatusPageInfoStore.getMostRecent().forEach(e=>{this.scheduledDayGroups[b0.SCHEDULED_CURRENT].data.push(e)}),this.nomadAirStatusPageInfoStore.getSecondMostRecent().forEach(e=>{this.scheduledDayGroups[b0.SCHEDULED_RECENT].data.push(e)}),this.nomadAirStatusPageInfoStore.getFallBack().forEach(e=>{this.scheduledDayGroups[b0.SCHEDULED_OTHER].data.push(e)})}hasCurrentData(){return!!this.hasData()&&this.scheduledDayGroups[b0.SCHEDULED_CURRENT].data.length>0}hasRecentData(){return!!this.hasData()&&this.scheduledDayGroups[b0.SCHEDULED_RECENT].data.length>0}hasOtherData(){return!!this.hasData()&&this.scheduledDayGroups[b0.SCHEDULED_OTHER].data.length>0}hasData(){return this.nomadAirLatestStatusResults.data.length>0}addPaddingToRows(){this.scheduledDayGroups.forEach(e=>{let n=e.filteredData.length;if(n>0)for(;n<=this.wt_max_items_per_row;){let o=new W3;o.status_extra_info.place_holder=!0,o.status_info.mode=101,e.data.push(o),n++}})}refreshNomadAirStatus(){this.scheduledDayGroups.forEach(e=>e.data=[]),this.nomadAirStatusPageInfoStore.reset(),this.nomadAirLatestStatusResults.data=this.loginService.getLatestNomadAirStatus(),this.latestScheduleTime=this.loginService.getNomadAirStatusLatestSchedule(),this.nomadAirLatestStatusResults.data.forEach(e=>{const o={date:this.wt_common.getDateFromDateString(e.status_info.schedule_time),value:e};this.nomadAirStatusPageInfoStore.insert(o)}),this.updateStatusTables(),"listview"==this.page_view&&(this.nomadAirLatestStatusResults.sort=this.sort,this.nomadAirLatestStatusResults.sortingDataAccessor=(e,n)=>{let o="";switch(n){case"pinned":o=e.status_extra_info.pinned.toString().toLowerCase();break;case"friendly_name":o=e.status_info.friendlyname;break;case"serial_number":o=e.status_info.serialnumber;break;case"status_time":o=e.status_info.statustime;break;case"mode_text":o=e.status_extra_info.mode_text;break;case"ssdi":o=isNaN(Number(e.status_extra_info.record_pcnt))?0:Number(e.status_extra_info.record_pcnt);break;case"night":o=isNaN(Number(e.status_extra_info.night))?0:Number(e.status_extra_info.night)}return o},this.nomadAirLatestStatusResults.sortData=(e,n)=>{const o=n.active,r=n.direction;let u=new Fr([]);return u.data=e.sort((y,I)=>{const V=this.nomadAirLatestStatusResults.sortingDataAccessor(y,o),q=this.nomadAirLatestStatusResults.sortingDataAccessor(I,o);return this.compareFunction(V,q)*("asc"==r?1:-1)}),u.data=this.sortNomadAirStatusData(u.data),u.data}),this.scheduledDayGroups.forEach(e=>{e.data=this.sortNomadAirStatusData(e.data)}),this.nomadAirLatestStatusResults.data=this.sortNomadAirStatusData(this.nomadAirLatestStatusResults.data),this.addPaddingToRows()}compareFunction(e,n){let o=0;return null!=e&&null!=n?e>n?o=1:e0&&(e=0==e.length?n[u]:e.concat(n[u]));if("listview"==this.page_view)for(u=0;u0&&(e=0==e.length?r[u]:e.concat(r[u]));else for(u=0;u0&&(e=0==e.length?o[u]:e.concat(o[u]));return this.displayedItemCount=e.length,e}viewAllDeviceMap(){this.loginService.mapService.updateFilteredData(this.nomadAirLatestStatusResults.filteredData),this.dialog.afterAllClosed.subscribe(()=>{this.page_view=this.prev_view,this.cdr.detectChanges()}),this.commonFunctionHelper.viewAllDeviceMap(this.layout,this.dialog,"100em","100em")}onOpenCardHistory(e){if(100==e.status_info.mode||101==e.status_info.mode)return;let n=new Ide;n.scheduleUUID=e.status_info.study_id,n.serialnumber=e.status_info.serialnumber,n.friendlyname=e.status_info.friendlyname,n.starttype=e.status_extra_info.start_type_text,n.wornonwrist=e.status_info.wornonwrist,n.night=e.status_info.night,n.duration_frames=e.status_info.duration_frames,n.rec_frames=e.status_info.frame,n.has_location=e.status_info.has_location_info,this.layout.openCenterFull(this.dialog,ZDe,{data:n,autoFocus:!1})}doNothing(){}hasNoFilteredResults(){return this.filter.filtersApplied()&&0==this.displayedItemCount}isFilterApplied(e){return!!(this.filter.device_filter&e)}onFilterClearClick(){this.filter.device_filter=0,this.filter.serial_filter="",this.filter.friendly_name_filter="",this.saveFilterSet()}onFilterClick(e){this.isFilterApplied(e)?this.filter.device_filter=this.filter.device_filter&~e:this.filter.device_filter|=e,this.saveFilterSet()}onFilterTextChange(){}toggleDemoMode(){(this.userInfo.isMasterDBUser()||this.userInfo.isDistributor())&&(this.demo_mode=!this.demo_mode,this.scheduledDayGroups.forEach(e=>e.data=[]),this.nomadAirLatestStatusResults.data=[],this.service_loading_data=!0,this.loginService.setNomadAirStatusDemoMode(this.demo_mode).subscribe(()=>{this.refreshNomadAirStatus(),this.enableMapView=this.demo_mode||this.loginService.getLocationsAvailable(),this.service_loading_data=!1,this.cdr.detectChanges()}))}demoModeCountChange(e){if(!this.userInfo.isMasterDBUser()&&!this.userInfo.isDistributor())return;let n=this.demo_mode_count,o=this.demo_mode_count+e;this.demo_mode_count=o<10?10:o>100?100:o,n!=this.demo_mode_count&&(this.statusUpdateSubscription.unsubscribe(),this.loginService.setNomadAirStatusDemoCount(this.demo_mode_count).subscribe(()=>{this.refreshNomadAirStatus(),this.enableMapView=this.demo_mode||this.loginService.getLocationsAvailable(),this.service_loading_data=!1,this.cdr.detectChanges()}))}loadingData(){return this.service_loading_data}enabledDemoModeCountChange(e){return!(this.loadingData()||e&&this.demo_mode_count>=100||!e&&this.demo_mode_count<=10)}togglePinnedDevice(e){if(this.pinnedDevices.includes(e)){let n=this.pinnedDevices.findIndex(o=>o===e);this.pinnedDevices.splice(n,1)}else this.pinnedDevices.push(e);this.saveLocalData(),this.nomadAirLatestStatusResults.data=this.sortNomadAirStatusData(this.nomadAirLatestStatusResults.data)}updateSessionTimeRemaining(){null!=this.userInfo&&(this.time_remaining=this.userInfo.getNomadAirSessionTimeRemaining(),this.latestScheduleTime=this.loginService.getNomadAirStatusLatestSchedule()),this.cdr.detectChanges()}static \u0275fac=function(n){return new(n||t)($e(Uo),$e(Po),$e(Ga),$e(id),$e(pa),$e(tD),$e(So),$e(Pn))};static \u0275cmp=cn({type:t,selectors:[["app-watchtower"]],viewQuery:function(n,o){if(1&n&&(mn(Js,5),mn(lIe,5)),2&n){let r;Bt(r=Vt())&&(o.sort=r.first),Bt(r=Vt())&&(o.accordion=r.first)}},hostBindings:function(n,o){1&n&&we("resize",function(u){return o.onResize(u)},0,Lp)},standalone:!1,decls:42,vars:8,consts:[["emptyTable",""],[1,"main-container"],[1,"main-header"],[1,"flex-org-container"],[1,"flex-org-title-item"],[1,"flex-org-title-content"],[1,"flex-org-icon-item","d-none","d-md-block"],[1,"session-time"],["mat-icon-button","","matTooltip","Renew session",1,"session-refresh-btn",3,"click"],["fontSet","material-symbols-outlined",1,"session-refresh-icon"],[1,"page-view-controls"],["name","pageView","aria-label","Page View",3,"ngModelChange","change","ngModel"],["value","gridview"],["fontSet","material-symbols-outlined","matTooltip","Grid View"],["value","listview"],["fontSet","material-symbols-outlined","matTooltip","List View"],["value","mapview",3,"click","disabled"],["fontSet","material-symbols-outlined","matTooltip","View Map"],["value","helpview",3,"click"],["fontSet","material-symbols-outlined","matTooltip","WatchTower Help"],[3,"expanded"],[1,"filter-header-container"],[1,"filter-expansion-title","filter-header-item-l"],[1,"filter-result-chip","filter-header-item-r"],["matExpansionPanelContent",""],[1,"content"],["class","empty-table",4,"ngIf"],["class","grid-wrapper",4,"ngIf"],["class","custom-table-responsive",4,"ngIf"],[1,"chips"],["selected","",1,"chip-container",3,"click","ngStyle","selectable"],["onmouseover","this.style.cursor='pointer'",1,"chip-content"],[1,"chip-item"],["class","chip-item",4,"ngIf"],[1,"page-filter-controls"],[2,"margin-right","0.5em"],["matInput","","type","text","name","serial_number","placeholder","Serial","value","",1,"form-field",3,"ngModelChange","keypress","ngModel"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","type","text","name","friendly_name","placeholder","Friendly Name","value","",1,"form-field",3,"ngModelChange","keypress","ngModel"],["class","demo-mode-group",4,"ngIf"],["fontSet","material-symbols-outlined",1,"chip-icon"],["mat-icon-button","","matSuffix","","aria-label","Clear",3,"click"],["fontSet","material-symbols-outlined"],[1,"demo-mode-group"],[3,"change","checked","disabled"],["mat-icon-button","","class","demo-mode-count-button","matTooltip","Decrease demo units",3,"disabled","click",4,"ngIf"],["mat-icon-button","","class","demo-mode-count-button","matTooltip","Increase demo units",3,"disabled","click",4,"ngIf"],["mat-icon-button","","matTooltip","Decrease demo units",1,"demo-mode-count-button",3,"click","disabled"],["mat-icon-button","","matTooltip","Increase demo units",1,"demo-mode-count-button",3,"click","disabled"],[1,"empty-table"],["mode","query",1,"loading-page-progress"],[1,"grid-wrapper"],["class","grid-container",4,"ngIf"],["class","content-divider",4,"ngIf"],["class","empty-table",4,"ngIf","ngIfElse"],[1,"grid-container"],["class","card-container","appMaterialElevation","","defaultElevation","4","raisedElevation","16",4,"ngFor","ngForOf"],["appMaterialElevation","","defaultElevation","4","raisedElevation","16",1,"card-container"],[3,"togglePin","viewHistory","viewMap","statusInfo","demoMode"],[1,"content-divider"],[4,"ngIf"],[1,"custom-table-responsive"],["style","width:100%;","mat-table","","matSort","",3,"dataSource",4,"ngIf"],["mat-table","","matSort","",2,"width","100%",3,"dataSource"],[3,"togglePin","viewMap","demoMode"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","appMaterialElevation","","defaultElevation","0","raisedElevation","12",3,"hidden","ngStyle","click",4,"matRowDef","matRowDefColumns"],["mat-header-row",""],["mat-row","","appMaterialElevation","","defaultElevation","0","raisedElevation","12",3,"click","hidden","ngStyle"],[3,"togglePin"]],template:function(n,o){1&n&&(w(0,"main",1)(1,"header",2)(2,"form")(3,"mat-toolbar",3)(4,"div",4)(5,"div",5)(6,"div"),M(7,"WatchTower"),x()()(),w(8,"div",6)(9,"span",7),M(10),x(),w(11,"button",8),we("click",function(){return o.refreshBackend(!0)}),w(12,"mat-icon",9),M(13,"refresh"),x()()(),w(14,"div",10)(15,"mat-button-toggle-group",11),Qn("ngModelChange",function(u){return ei(o.page_view,u)||(o.page_view=u),u}),we("change",function(){return o.onChangePageView()}),w(16,"mat-button-toggle",12)(17,"mat-icon",13),M(18,"grid_view"),x()(),w(19,"mat-button-toggle",14)(20,"mat-icon",15),M(21,"view_list"),x()(),w(22,"mat-button-toggle",16),we("click",function(){return o.viewAllDeviceMap()}),w(23,"mat-icon",17),M(24,"map"),x()(),w(25,"mat-button-toggle",18),we("click",function(){return o.goToHelpPage()}),w(26,"mat-icon",19),M(27,"help_center"),x()()()()(),w(28,"mat-expansion-panel",20)(29,"mat-expansion-panel-header")(30,"mat-panel-title",21)(31,"span",22),M(32," WatchTower Controls "),x(),w(33,"mat-chip",23),M(34),x()()(),te(35,yIe,42,34,"ng-template",24),M(36," \xa0 "),x()()(),Re(37,"br"),w(38,"div",25),te(39,vIe,3,0,"div",26)(40,OIe,9,7,"div",27)(41,ZIe,9,7,"div",28),x()()),2&n&&(E(10),Jt("Session Expiration: ",o.time_remaining,""),E(5),Kn("ngModel",o.page_view),E(7),N("disabled",!o.enableMapView),E(6),N("expanded",o.scrWidth>900),E(6),Jt("Results: ",o.displayedItemCount,""),E(5),N("ngIf",o.loadingData()),E(),N("ngIf","gridview"==o.page_view&&!o.loadingData()),E(),N("ngIf","listview"==o.page_view&&!o.loadingData()))},dependencies:[kl,ir,Ym,ka,jr,wr,Aa,ts,Cr,na,Oa,Qs,xa,rd,qd,Wd,Zd,Yd,Js,qa,zl,Bl,od,L3,Gd,Sr,Pa,m0,_0,$L,sA,k_,Q3,S2e,sIe,NT],styles:['html[_ngcontent-%COMP%]{font-size:100%}svg[_ngcontent-%COMP%]{display:block}table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.5em}.session-time[_ngcontent-%COMP%]{color:#40b569;font-size:small;vertical-align:middle}.session-refresh-btn[_ngcontent-%COMP%]{vertical-align:middle}.session-refresh-icon[_ngcontent-%COMP%]{color:#40b569}.filter-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.filter-header-item-l[_ngcontent-%COMP%]{justify-self:flex-start}.filter-header-item-r[_ngcontent-%COMP%]{margin-left:.5em;justify-self:flex-end}.filter-expansion-title[_ngcontent-%COMP%]{font-family:Arial,Helvetica,sans-serif;font-weight:700;font-size:medium;font-style:italic;margin-top:.2em}.filter-result-chip[_ngcontent-%COMP%]{font-style:normal;white-space:nowrap;width:fit-content;max-width:100%;min-width:6.5em}.page-filter-controls[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.5em}.demo-mode-group[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.5em;padding-top:.75em}.main-header[_ngcontent-%COMP%]{height:auto;position:sticky;top:3em;width:100%;z-index:1000;padding-bottom:calc(24px + env(safe-area-inset-bottom,0) + .5em)}.content[_ngcontent-%COMP%]{overflow:hidden}.page-view-controls[_ngcontent-%COMP%]{display:block;float:right;margin-right:.4em;margin-left:.4em}.help-button-icon[_ngcontent-%COMP%]{font-size:1.8em;width:1.8em;height:1.8em;margin:0;padding:0;vertical-align:bottom;top:.65em}.chips[_ngcontent-%COMP%]{display:flex;flex-flow:row;flex-wrap:wrap;justify-content:left;gap:.5em}.chip-container[_ngcontent-%COMP%]{align-self:center;vertical-align:middle}.chip-content[_ngcontent-%COMP%]{display:flex;flex-flow:row;flex-wrap:nowrap;gap:.1em;color:#fff!important}.chip-item[_ngcontent-%COMP%]{align-self:center;vertical-align:middle}.chip-icon[_ngcontent-%COMP%]{font-size:1.4em;width:100%;height:100%;vertical-align:middle;padding-left:.2em}.grid-wrapper[_ngcontent-%COMP%]{width:100%}.grid-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--watchtower-card-width),max-content));grid-gap:var(--watchtower-card-grid-gap);justify-content:center;padding-bottom:.5em}.card-container[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;align-self:center;justify-content:center;align-items:center;border-radius:1.5em!important;background-color:transparent!important}tr.mat-row[_ngcontent-%COMP%]{height:.1em!important}.headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%], .headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{flex-basis:0}.headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.content-divider[_ngcontent-%COMP%]{display:flex;align-items:center;text-align:center;margin:1em 0;font-family:Roboto,Helvetica Neue,sans-serif;font-weight:500;font-size:large;color:var(--header-item-color)}.content-divider[_ngcontent-%COMP%]:before, .content-divider[_ngcontent-%COMP%]:after{content:"";flex:1;border-bottom:1px solid var(--header-item-color);margin:0 1.5em}.loading-page-progress[_ngcontent-%COMP%]{width:95%;margin:0 auto}']})}return t})();const KIe=["helpToggleGroup"],QIe=["watchTowerToggle"],JIe=["printToggle"];function eEe(t,i){1&t&&(w(0,"strong"),M(1,"Display Configuration"),x(),M(2,"\xa0\xa0 "),w(3,"mat-icon",7),M(4,"filter_alt"),x())}function tEe(t,i){1&t&&(w(0,"strong"),M(1,"Device Status Information"),x(),M(2,"\xa0\xa0 "),w(3,"mat-icon",7),M(4,"analytics"),x())}function nEe(t,i){1&t&&(w(0,"strong"),M(1,"Device Status History"),x(),M(2,"\xa0\xa0 "),w(3,"mat-icon",7),M(4,"history"),x())}function iEe(t,i){1&t&&(w(0,"strong"),M(1,"Device Map Information"),x(),M(2,"\xa0\xa0 "),w(3,"mat-icon",7),M(4,"map"),x())}let oEe=(()=>{class t{http;loginService;router;route;toggleGroup;watchTowerToggle;printToggle;tabGroup;tabBodies;scrHeight;scrWidth;getScreenSize(e){this.scrHeight=window.innerHeight,this.scrWidth=window.innerWidth}helpPrintSection;helpPrintSectionTitle;helpTabIndex;userInfo=null;helpPrintID="help-section-0";help_panel_clr="#DDF2F4";constructor(e,n,o,r){this.http=e,this.loginService=n,this.router=o,this.route=r,this.getScreenSize()}ngOnInit(){this.loginService.userInfo$.subscribe(o=>{this.userInfo=o}),this.loginService.updateNavigatedOrg(this.route);let e=localStorage.getItem("watchTowerHelpTabSelection");(""==e||null==e)&&(e="0");let n=parseInt(e);this.helpTabIndex=n,this.updateHelpSection()}doNothing(){}updateHelpSection(){this.helpPrintSection="help-section-"+this.helpTabIndex.toString(),this.updateHelpSectionTitle()}updateHelpSectionTitle(){switch(this.helpPrintSectionTitle="WatchTower Help",this.helpTabIndex){case 0:this.helpPrintSectionTitle="WatchTower Help: Display Configuration";break;case 1:this.helpPrintSectionTitle="WatchTower Help: Device Status Information";break;case 2:this.helpPrintSectionTitle="WatchTower Help: Device Status History";break;case 3:this.helpPrintSectionTitle="WatchTower Help: Device Map Information"}}onHelpTabChange(e){null!=e&&(localStorage.setItem("watchTowerHelpTabSelection",e.index.toString()),this.helpTabIndex=e.index,this.updateHelpSection())}goToWatchTower(){this.toggleGroup.value=null,this.watchTowerToggle.checked=!1,this.router.navigate(["/watchtower"])}printPage(){if(this.toggleGroup.value=null,this.printToggle.checked=!1,!this.tabGroup)return void console.error("Error: MatTabGroup not found.");const e=this.tabGroup.selectedIndex;if(null==e)return void console.error("Error: Active tab index not found.");const n=`help-section-${e}`,o=document.getElementById(n);if(!o)return void console.error(`Error: No tab content found for ID: ${n}`);let r=o.innerHTML;Array.from(o.getElementsByTagName("img")).forEach(I=>{const V=I.getAttribute("src");if(V&&!V.startsWith("http")){const q=new URL(V,window.location.origin).href;r=r.replace(V,q)}});const y=window.open("","_blank","width=900,height=600");!y||y.closed||typeof y.closed>"u"?alert("Print popup blocked. Please allow popups in order to print."):(y.document.open(),y.document.write(`\n \n \n Print - ${this.helpPrintSectionTitle}\n \n \n \n

${this.helpPrintSectionTitle}

\n ${r}\n