leiting-bim 2.1.198 → 2.1.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/leiting-bim.umd.js
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
material.diffuse *= u_tilesBrightness;
|
|
11
11
|
}
|
|
12
12
|
`});c.isModelAdjustment=!0,l.customShader=c}else{let c="color('white')";e!==1&&(c=`${c} * ${e}`),l.style=new i.Cesium3DTileStyle({color:c})}}}}var Kd=typeof global=="object"&&global&&global.Object===Object&&global,qy=typeof self=="object"&&self&&self.Object===Object&&self,Wn=Kd||qy||Function("return this")(),zo=Wn.Symbol,Xd=Object.prototype,Ky=Xd.hasOwnProperty,Xy=Xd.toString,vs=zo?zo.toStringTag:void 0;function Jy(n){var e=Ky.call(n,vs),t=n[vs];try{n[vs]=void 0;var i=!0}catch{}var s=Xy.call(n);return i&&(e?n[vs]=t:delete n[vs]),s}var Zy=Object.prototype,eA=Zy.toString;function tA(n){return eA.call(n)}var nA="[object Null]",iA="[object Undefined]",Jd=zo?zo.toStringTag:void 0;function bs(n){return n==null?n===void 0?iA:nA:Jd&&Jd in Object(n)?Jy(n):tA(n)}function wi(n){return n!=null&&typeof n=="object"}var sA="[object Symbol]";function oA(n){return typeof n=="symbol"||wi(n)&&bs(n)==sA}var Ho=Array.isArray,rA=/\s/;function aA(n){for(var e=n.length;e--&&rA.test(n.charAt(e)););return e}var lA=/^\s+/;function cA(n){return n&&n.slice(0,aA(n)+1).replace(lA,"")}function jt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Zd=NaN,dA=/^[-+]0x[0-9a-f]+$/i,hA=/^0b[01]+$/i,uA=/^0o[0-7]+$/i,fA=parseInt;function eh(n){if(typeof n=="number")return n;if(oA(n))return Zd;if(jt(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=jt(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=cA(n);var t=hA.test(n);return t||uA.test(n)?fA(n.slice(2),t?2:8):dA.test(n)?Zd:+n}function th(n){return n}var pA="[object AsyncFunction]",mA="[object Function]",gA="[object GeneratorFunction]",yA="[object Proxy]";function Va(n){if(!jt(n))return!1;var e=bs(n);return e==mA||e==gA||e==pA||e==yA}var Qa=Wn["__core-js_shared__"],nh=(function(){var n=/[^.]+$/.exec(Qa&&Qa.keys&&Qa.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function AA(n){return!!nh&&nh in n}var vA=Function.prototype,bA=vA.toString;function CA(n){if(n!=null){try{return bA.call(n)}catch{}try{return n+""}catch{}}return""}var wA=/[\\^$.*+?()[\]{}|]/g,EA=/^\[object .+?Constructor\]$/,xA=Function.prototype,IA=Object.prototype,SA=xA.toString,MA=IA.hasOwnProperty,TA=RegExp("^"+SA.call(MA).replace(wA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function BA(n){if(!jt(n)||AA(n))return!1;var e=Va(n)?TA:EA;return e.test(CA(n))}function _A(n,e){return n?.[e]}function za(n,e){var t=_A(n,e);return BA(t)?t:void 0}var ih=Object.create,kA=(function(){function n(){}return function(e){if(!jt(e))return{};if(ih)return ih(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function PA(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function DA(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}var NA=800,LA=16,RA=Date.now;function FA(n){var e=0,t=0;return function(){var i=RA(),s=LA-(i-t);if(t=i,s>0){if(++e>=NA)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function OA(n){return function(){return n}}var Yo=(function(){try{var n=za(Object,"defineProperty");return n({},"",{}),n}catch{}})(),GA=Yo?function(n,e){return Yo(n,"toString",{configurable:!0,enumerable:!1,value:OA(e),writable:!0})}:th,UA=FA(GA),VA=9007199254740991,QA=/^(?:0|[1-9]\d*)$/;function sh(n,e){var t=typeof n;return e=e??VA,!!e&&(t=="number"||t!="symbol"&&QA.test(n))&&n>-1&&n%1==0&&n<e}function Ha(n,e,t){e=="__proto__"&&Yo?Yo(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function $o(n,e){return n===e||n!==n&&e!==e}var zA=Object.prototype,HA=zA.hasOwnProperty;function YA(n,e,t){var i=n[e];(!(HA.call(n,e)&&$o(i,t))||t===void 0&&!(e in n))&&Ha(n,e,t)}function $A(n,e,t,i){var s=!t;t||(t={});for(var o=-1,r=e.length;++o<r;){var a=e[o],l=void 0;l===void 0&&(l=n[a]),s?Ha(t,a,l):YA(t,a,l)}return t}var oh=Math.max;function jA(n,e,t){return e=oh(e===void 0?n.length-1:e,0),function(){for(var i=arguments,s=-1,o=oh(i.length-e,0),r=Array(o);++s<o;)r[s]=i[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=i[s];return a[e]=t(r),PA(n,this,a)}}function WA(n,e){return UA(jA(n,e,th),n+"")}var qA=9007199254740991;function rh(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=qA}function Ya(n){return n!=null&&rh(n.length)&&!Va(n)}function KA(n,e,t){if(!jt(t))return!1;var i=typeof e;return(i=="number"?Ya(t)&&sh(e,t.length):i=="string"&&e in t)?$o(t[e],n):!1}function XA(n){return WA(function(e,t){var i=-1,s=t.length,o=s>1?t[s-1]:void 0,r=s>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(s--,o):void 0,r&&KA(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++i<s;){var a=t[i];a&&n(e,a,i,o)}return e})}var JA=Object.prototype;function ah(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||JA;return n===t}function ZA(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var e1="[object Arguments]";function lh(n){return wi(n)&&bs(n)==e1}var ch=Object.prototype,t1=ch.hasOwnProperty,n1=ch.propertyIsEnumerable,$a=lh((function(){return arguments})())?lh:function(n){return wi(n)&&t1.call(n,"callee")&&!n1.call(n,"callee")};function i1(){return!1}var dh=typeof V=="object"&&V&&!V.nodeType&&V,hh=dh&&typeof module=="object"&&module&&!module.nodeType&&module,s1=hh&&hh.exports===dh,uh=s1?Wn.Buffer:void 0,o1=uh?uh.isBuffer:void 0,fh=o1||i1,r1="[object Arguments]",a1="[object Array]",l1="[object Boolean]",c1="[object Date]",d1="[object Error]",h1="[object Function]",u1="[object Map]",f1="[object Number]",p1="[object Object]",m1="[object RegExp]",g1="[object Set]",y1="[object String]",A1="[object WeakMap]",v1="[object ArrayBuffer]",b1="[object DataView]",C1="[object Float32Array]",w1="[object Float64Array]",E1="[object Int8Array]",x1="[object Int16Array]",I1="[object Int32Array]",S1="[object Uint8Array]",M1="[object Uint8ClampedArray]",T1="[object Uint16Array]",B1="[object Uint32Array]",Ie={};Ie[C1]=Ie[w1]=Ie[E1]=Ie[x1]=Ie[I1]=Ie[S1]=Ie[M1]=Ie[T1]=Ie[B1]=!0,Ie[r1]=Ie[a1]=Ie[v1]=Ie[l1]=Ie[b1]=Ie[c1]=Ie[d1]=Ie[h1]=Ie[u1]=Ie[f1]=Ie[p1]=Ie[m1]=Ie[g1]=Ie[y1]=Ie[A1]=!1;function _1(n){return wi(n)&&rh(n.length)&&!!Ie[bs(n)]}function k1(n){return function(e){return n(e)}}var ph=typeof V=="object"&&V&&!V.nodeType&&V,Cs=ph&&typeof module=="object"&&module&&!module.nodeType&&module,P1=Cs&&Cs.exports===ph,ja=P1&&Kd.process,mh=(function(){try{var n=Cs&&Cs.require&&Cs.require("util").types;return n||ja&&ja.binding&&ja.binding("util")}catch{}})(),gh=mh&&mh.isTypedArray,yh=gh?k1(gh):_1;function D1(n,e){var t=Ho(n),i=!t&&$a(n),s=!t&&!i&&fh(n),o=!t&&!i&&!s&&yh(n),r=t||i||s||o,a=r?ZA(n.length,String):[],l=a.length;for(var c in n)r&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||sh(c,l))||a.push(c);return a}function N1(n,e){return function(t){return n(e(t))}}function L1(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var R1=Object.prototype,F1=R1.hasOwnProperty;function O1(n){if(!jt(n))return L1(n);var e=ah(n),t=[];for(var i in n)i=="constructor"&&(e||!F1.call(n,i))||t.push(i);return t}function Ah(n){return Ya(n)?D1(n):O1(n)}var ws=za(Object,"create");function G1(){this.__data__=ws?ws(null):{},this.size=0}function U1(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var V1="__lodash_hash_undefined__",Q1=Object.prototype,z1=Q1.hasOwnProperty;function H1(n){var e=this.__data__;if(ws){var t=e[n];return t===V1?void 0:t}return z1.call(e,n)?e[n]:void 0}var Y1=Object.prototype,$1=Y1.hasOwnProperty;function j1(n){var e=this.__data__;return ws?e[n]!==void 0:$1.call(e,n)}var W1="__lodash_hash_undefined__";function q1(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=ws&&e===void 0?W1:e,this}function qn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}qn.prototype.clear=G1,qn.prototype.delete=U1,qn.prototype.get=H1,qn.prototype.has=j1,qn.prototype.set=q1;function K1(){this.__data__=[],this.size=0}function jo(n,e){for(var t=n.length;t--;)if($o(n[t][0],e))return t;return-1}var X1=Array.prototype,J1=X1.splice;function Z1(n){var e=this.__data__,t=jo(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():J1.call(e,t,1),--this.size,!0}function ev(n){var e=this.__data__,t=jo(e,n);return t<0?void 0:e[t][1]}function tv(n){return jo(this.__data__,n)>-1}function nv(n,e){var t=this.__data__,i=jo(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function hn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}hn.prototype.clear=K1,hn.prototype.delete=Z1,hn.prototype.get=ev,hn.prototype.has=tv,hn.prototype.set=nv;var vh=za(Wn,"Map");function iv(){this.size=0,this.__data__={hash:new qn,map:new(vh||hn),string:new qn}}function sv(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Wo(n,e){var t=n.__data__;return sv(e)?t[typeof e=="string"?"string":"hash"]:t.map}function ov(n){var e=Wo(this,n).delete(n);return this.size-=e?1:0,e}function rv(n){return Wo(this,n).get(n)}function av(n){return Wo(this,n).has(n)}function lv(n,e){var t=Wo(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function Ei(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Ei.prototype.clear=iv,Ei.prototype.delete=ov,Ei.prototype.get=rv,Ei.prototype.has=av,Ei.prototype.set=lv;var bh=N1(Object.getPrototypeOf,Object),cv="[object Object]",dv=Function.prototype,hv=Object.prototype,Ch=dv.toString,uv=hv.hasOwnProperty,fv=Ch.call(Object);function pv(n){if(!wi(n)||bs(n)!=cv)return!1;var e=bh(n);if(e===null)return!0;var t=uv.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Ch.call(t)==fv}function mv(){this.__data__=new hn,this.size=0}function gv(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function yv(n){return this.__data__.get(n)}function Av(n){return this.__data__.has(n)}var vv=200;function bv(n,e){var t=this.__data__;if(t instanceof hn){var i=t.__data__;if(!vh||i.length<vv-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ei(i)}return t.set(n,e),this.size=t.size,this}function xi(n){var e=this.__data__=new hn(n);this.size=e.size}xi.prototype.clear=mv,xi.prototype.delete=gv,xi.prototype.get=yv,xi.prototype.has=Av,xi.prototype.set=bv;var wh=typeof V=="object"&&V&&!V.nodeType&&V,Eh=wh&&typeof module=="object"&&module&&!module.nodeType&&module,Cv=Eh&&Eh.exports===wh,xh=Cv?Wn.Buffer:void 0;xh&&xh.allocUnsafe;function wv(n,e){return n.slice()}var Ih=Wn.Uint8Array;function Ev(n){var e=new n.constructor(n.byteLength);return new Ih(e).set(new Ih(n)),e}function xv(n,e){var t=Ev(n.buffer);return new n.constructor(t,n.byteOffset,n.length)}function Iv(n){return typeof n.constructor=="function"&&!ah(n)?kA(bh(n)):{}}function Sv(n){return function(e,t,i){for(var s=-1,o=Object(e),r=i(e),a=r.length;a--;){var l=r[++s];if(t(o[l],l,o)===!1)break}return e}}var Mv=Sv(),Wa=function(){return Wn.Date.now()},Tv="Expected a function",Bv=Math.max,_v=Math.min;function qo(n,e,t){var i,s,o,r,a,l,c=0,h=!1,u=!1,p=!0;if(typeof n!="function")throw new TypeError(Tv);e=eh(e)||0,jt(t)&&(h=!!t.leading,u="maxWait"in t,o=u?Bv(eh(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function f(x){var I=i,B=s;return i=s=void 0,c=x,r=n.apply(B,I),r}function m(x){return c=x,a=setTimeout(A,e),h?f(x):r}function y(x){var I=x-l,B=x-c,R=e-I;return u?_v(R,o-B):R}function g(x){var I=x-l,B=x-c;return l===void 0||I>=e||I<0||u&&B>=o}function A(){var x=Wa();if(g(x))return v(x);a=setTimeout(A,y(x))}function v(x){return a=void 0,p&&i?f(x):(i=s=void 0,r)}function C(){a!==void 0&&clearTimeout(a),c=0,i=l=s=a=void 0}function w(){return a===void 0?r:v(Wa())}function S(){var x=Wa(),I=g(x);if(i=arguments,s=this,l=x,I){if(a===void 0)return m(l);if(u)return clearTimeout(a),a=setTimeout(A,e),f(l)}return a===void 0&&(a=setTimeout(A,e)),r}return S.cancel=C,S.flush=w,S}function qa(n,e,t){(t!==void 0&&!$o(n[e],t)||t===void 0&&!(e in n))&&Ha(n,e,t)}function kv(n){return wi(n)&&Ya(n)}function Ka(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Pv(n){return $A(n,Ah(n))}function Dv(n,e,t,i,s,o,r){var a=Ka(n,t),l=Ka(e,t),c=r.get(l);if(c){qa(n,t,c);return}var h=o?o(a,l,t+"",n,e,r):void 0,u=h===void 0;if(u){var p=Ho(l),f=!p&&fh(l),m=!p&&!f&&yh(l);h=l,p||f||m?Ho(a)?h=a:kv(a)?h=DA(a):f?(u=!1,h=wv(l)):m?(u=!1,h=xv(l)):h=[]:pv(l)||$a(l)?(h=a,$a(a)?h=Pv(a):(!jt(a)||Va(a))&&(h=Iv(l))):u=!1}u&&(r.set(l,h),s(h,l,i,o,r),r.delete(l)),qa(n,t,h)}function Sh(n,e,t,i,s){n!==e&&Mv(e,function(o,r){if(s||(s=new xi),jt(o))Dv(n,e,r,t,Sh,i,s);else{var a=i?i(Ka(n,r),o,r+"",n,e,s):void 0;a===void 0&&(a=o),qa(n,r,a)}},Ah)}var Nv=XA(function(n,e,t){Sh(n,e,t)});function Xa({Cesium:n,tileset:e}){const t=e.leiting;if(!t||!t.model||!t.model.formData)return;const i=t.model.formData,s=t.box,o=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(i.totalRotation||0)),r=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(o),n.Cartesian3.ZERO),a=n.Cartesian3.fromDegrees(i.longitude,i.latitude,i.height),l=n.Transforms.eastNorthUpToFixedFrame(a),c=n.Matrix4.multiply(l,r,new n.Matrix4);if(e._root){if(!s){e._root.transform=c;return}try{const{center:h}=s,u=e.root.boundingVolume.boundingSphere,p=new n.Cartesian3(h.x,h.y,0),f=n.Matrix4.multiplyByPoint(c,p,new n.Cartesian3),m=n.Cartographic.fromCartesian(f),y=u.center,g=n.Transforms.eastNorthUpToFixedFrame(new n.Cartesian3(y.x,y.y,y.z)),A=new n.Cartesian3(-h.x+(i.X||0),-h.y+(i.Y||0),i.Z||0),v=n.Matrix4.fromTranslation(A),C=n.Matrix4.multiply(r,v,new n.Matrix4),w=n.Cartesian3.fromDegrees(m.longitude/Math.PI*180,m.latitude/Math.PI*180,i.height),S=n.Transforms.eastNorthUpToFixedFrame(w),x=n.Matrix4.multiply(S,C,new n.Matrix4);n.Matrix4.multiply(g,C,g),e._root.transform=x}catch(h){console.error("Update model position failed:",h)}}}const Ii={NotLoaded:0,Loading:1,Loaded:2,Error:3},Kn=4294967295,Wt=65535,Ja=255,Lv=8,Mh=9,Rv=0,Fv=99,Ov=67324752,Th=134695760,Gv=Th,Bh=33639248,Uv=101010256,_h=101075792,Vv=117853008,Si=22,Za=20,el=56,Qv=12,zv=20,kh=4,Hv=1,Yv=39169,$v=10,jv=1,Wv=21589,qv=28789,Kv=25461,Xv=6534,Jv=30837,Zv=30805,Ph=1,eb=6,Dh=8,Nh=2048,tb=16,nb=1,ib=2,sb=4,ob=32,Lh=61440,tl=16384,nl=73,rb=420,ab=2048,lb=1024,cb=512,db="/",il=30,hb=10,ub=14,fb=18,Se=void 0,xn="undefined",Xn="function",pb=64;let Rh=2;try{typeof navigator!=xn&&navigator.hardwareConcurrency&&(Rh=navigator.hardwareConcurrency)}catch{}const mb={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:Rh,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=xn&&CompressionStream,DecompressionStream:typeof DecompressionStream!=xn&&DecompressionStream},Fh=Object.assign({},mb);function gb(){return Fh}function yb(n){return Math.max(n.chunkSize,pb)}function Ko(n){const{baseURI:e,chunkSize:t,maxWorkers:i,terminateWorkerTimeout:s,useCompressionStream:o,useWebWorkers:r,CompressionStream:a,DecompressionStream:l,CompressionStreamZlib:c,DecompressionStreamZlib:h,workerURI:u,wasmURI:p}=n;_t("baseURI",e),_t("wasmURI",p),_t("workerURI",u),_t("chunkSize",t),_t("maxWorkers",i),_t("terminateWorkerTimeout",s),_t("useCompressionStream",o),_t("useWebWorkers",r),_t("CompressionStream",a),_t("DecompressionStream",l),_t("CompressionStreamZlib",c),_t("DecompressionStreamZlib",h)}function _t(n,e){e!==Se&&(Fh[n]=e)}function Ab(n){let e;n({workerURI:()=>(e||(e="data:text/javascript,"+encodeURIComponent(`(t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){"use strict";const{Array:t,Object:e,Number:n,Math:s,Error:r,Uint8Array:o,Uint16Array:i,Uint32Array:c,Int32Array:a,Map:h,DataView:f,Promise:l,TextEncoder:u,crypto:w,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:g,DecompressionStream:S}=self,b=void 0,v="undefined",k="function",z=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;z[t]=e}class C{constructor(t){this.t=t||-1}append(t){let e=0|this.t;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^z[255&(e^t[n])];this.t=e}get(){return~this.t}}class A extends d{constructor(){let t;const e=new C;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new o(4);new f(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}const x={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=x.o(n);return 32===s?t.concat(e):x.i(e,s,0|n,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+x.o(n)},l(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=x.u(e,t[n-1]&2147483648>>e-1,1)),t},u:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,o:t=>s.round(t/1099511627776)||32,i(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let r=0;r<t.length;r++)s.push(n|t[r]>>>e),n=t[r]<<32-e;const r=t.length?t[t.length-1]:0,o=x.o(r);return s.push(x.u(e+o&31,e+o>32?n:s.pop(),1)),s}},I={bytes:{p(t){const e=x.h(t)/8,n=new o(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},m(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(x.u(8*(3&n),s)),e}}},R=class{constructor(t){const e=this;e.blockSize=512,e.S=[1732584193,4023233417,2562383102,271733878,3285377520],e.v=[1518500249,1859775393,2400959708,3395469782],t?(e.k=t.k.slice(0),e.C=t.C.slice(0),e.A=t.A):e.reset()}reset(){const t=this;return t.k=t.S.slice(0),t.C=[],t.A=0,t}update(t){const e=this;"string"==typeof t&&(t=I.I.m(t));const n=e.C=x.concat(e.C,t),s=e.A,o=e.A=s+x.h(t);if(o>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const i=new c(n);let a=0;for(let t=e.blockSize+s-(e.blockSize+s&e.blockSize-1);o>=t;t+=e.blockSize)e.R(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}P(){const t=this;let e=t.C;const n=t.k;e=x.concat(e,[x.u(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.A/4294967296)),e.push(0|t.A);e.length;)t.R(e.splice(0,16));return t.reset(),n}U(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}V(t,e){return e<<t|e>>>32-t}R(e){const n=this,r=n.k,o=t(80);for(let t=0;16>t;t++)o[t]=e[t];let i=r[0],c=r[1],a=r[2],h=r[3],f=r[4];for(let t=0;79>=t;t++){16>t||(o[t]=n.V(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.V(5,i)+n.U(t,c,a,h)+f+o[t]+n.v[s.floor(t/20)]|0;f=h,h=a,a=n.V(30,c),c=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+c|0,r[2]=r[2]+a|0,r[3]=r[3]+h|0,r[4]=r[4]+f|0}},P={getRandomValues(t){const e=new c(t.buffer),n=t=>{let e=987654321;const n=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&n,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,o=0;o<t.length;o+=4){const t=n(4294967296*(r||s.random()));r=987654071*t(),e[o/4]=4294967296*t()|0}return t}},U={importKey:t=>new U.M(I.bytes.m(t)),_(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const o=1+(s>>5)<<2;let i,c,a,h,l;const u=new ArrayBuffer(o),w=new f(u);let p=0;const d=x;for(e=I.bytes.m(e),l=1;(o||1)>p;l++){for(i=c=t.encrypt(d.concat(e,[l])),a=1;n>a;a++)for(c=t.encrypt(c),h=0;h<c.length;h++)i[h]^=c[h];for(a=0;(o||1)>p&&a<i.length;a++)w.setInt32(p,i[a]),p+=4}return u.slice(0,s/8)},M:class{constructor(t){const e=this,n=e.B=R,s=[[],[]];e.D=[new n,new n];const r=e.D[0].blockSize/32;t.length>r&&(t=(new n).update(t).P());for(let e=0;r>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e.D[0].update(s[0]),e.D[1].update(s[1]),e.W=new n(e.D[0])}reset(){const t=this;t.W=new t.B(t.D[0]),t.K=!1}update(t){this.K=!0,this.W.update(t)}digest(){const t=this,e=t.W.P(),n=new t.B(t.D[1]).update(e).P();return t.reset(),n}encrypt(t){if(this.K)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},V=typeof w!=v&&typeof w.getRandomValues==k,M="Invalid password",_="Invalid signature",B="zipjs-abort-check-password";function D(t){return V?w.getRandomValues(t):P.getRandomValues(t)}const W=16,K={name:"PBKDF2"},E=e.assign({hash:{name:"HMAC"}},K),L=e.assign({iterations:1e3,hash:{name:"SHA-1"}},K),O=["deriveBits"],T=[8,12,16],j=[16,24,32],H=10,Z=[0,0,0,0],F=typeof w!=v,N=F&&w.subtle,q=F&&typeof N!=v,G=I.bytes,J=class{constructor(t){const e=this;e.L=[[[],[],[],[],[]],[[],[],[],[],[]]],e.L[0][0][0]||e.O();const n=e.L[0][4],s=e.L[1],o=t.length;let i,c,a,h=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(e.v=[c=t.slice(0),a=[]],i=o;4*o+28>i;i++){let t=c[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^h<<24,h=h<<1^283*(h>>7))),c[i]=c[i-o]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];a[t]=4>=i||4>t?e:s[0][n[e>>>24]]^s[1][n[e>>16&255]]^s[2][n[e>>8&255]]^s[3][n[255&e]]}}encrypt(t){return this.T(t,0)}decrypt(t){return this.T(t,1)}O(){const t=this.L[0],e=this.L[1],n=t[4],s=e[4],r=[],o=[];let i,c,a,h;for(let t=0;256>t;t++)o[(r[t]=t<<1^283*(t>>7))^t]=t;for(let f=i=0;!n[f];f^=c||1,i=o[i]||1){let o=i^i<<1^i<<2^i<<3^i<<4;o=o>>8^255&o^99,n[f]=o,s[o]=f,h=r[a=r[c=r[f]]];let l=16843009*h^65537*a^257*c^16843008*f,u=257*r[o]^16843008*o;for(let n=0;4>n;n++)t[n][f]=u=u<<24^u>>>8,e[n][o]=l=l<<24^l>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}T(t,e){if(4!==t.length)throw new r("invalid aes block size");const n=this.v[e],s=n.length/4-2,o=[0,0,0,0],i=this.L[e],c=i[0],a=i[1],h=i[2],f=i[3],l=i[4];let u,w,p,d=t[0]^n[0],y=t[e?3:1]^n[1],m=t[2]^n[2],g=t[e?1:3]^n[3],S=4;for(let t=0;s>t;t++)u=c[d>>>24]^a[y>>16&255]^h[m>>8&255]^f[255&g]^n[S],w=c[y>>>24]^a[m>>16&255]^h[g>>8&255]^f[255&d]^n[S+1],p=c[m>>>24]^a[g>>16&255]^h[d>>8&255]^f[255&y]^n[S+2],g=c[g>>>24]^a[d>>16&255]^h[y>>8&255]^f[255&m]^n[S+3],S+=4,d=u,y=w,m=p;for(let t=0;4>t;t++)o[e?3&-t:t]=l[d>>>24]<<24^l[y>>16&255]<<16^l[m>>8&255]<<8^l[255&g]^n[S++],u=d,d=y,y=m,m=g,g=u;return o}},Q=class{constructor(t,e){this.j=t,this.H=e,this.Z=e}reset(){this.Z=this.H}update(t){return this.F(this.j,t,this.Z)}N(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}q(t){0===(t[0]=this.N(t[0]))&&(t[1]=this.N(t[1]))}F(t,e,n){let s;if(!(s=e.length))return[];const r=x.h(e);for(let r=0;s>r;r+=4){this.q(n);const s=t.encrypt(n);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return x.l(e,r)}},X=U.M;let Y=F&&q&&typeof N.importKey==k,$=F&&q&&typeof N.deriveBits==k;class tt extends d{constructor({password:t,rawPassword:n,signed:s,encryptionStrength:i,checkPasswordOnly:c}){super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),signed:s,J:i-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:i,G:a,ready:h}=n;s?(await(async(t,e,n,s)=>{const o=await st(t,e,n,it(s,0,T[e])),i=it(s,T[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new r(M)})(n,i,s,it(t,0,T[i]+2)),t=it(t,T[i]+2),c?e.error(new r(B)):a()):await h;const f=new o(t.length-H-(t.length-H)%W);e.enqueue(nt(n,t,f,0,H,!0))},async flush(t){const{signed:e,X:n,Y:s,pending:i,ready:c}=this;if(s&&n){await c;const a=it(i,0,i.length-H),h=it(i,i.length-H);let f=new o;if(a.length){const t=at(G,a);s.update(t);const e=n.update(t);f=ct(G,e)}if(e){const t=it(ct(G,s.digest()),0,H);for(let e=0;H>e;e++)if(t[e]!=h[e])throw new r(_)}t.enqueue(f)}}})}}class et extends d{constructor({password:t,rawPassword:n,encryptionStrength:s}){let r;super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),J:s-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:r,G:i,ready:c}=n;let a=new o;s?(a=await(async(t,e,n)=>{const s=D(new o(T[e]));return ot(s,await st(t,e,n,s))})(n,r,s),i()):await c;const h=new o(a.length+t.length-t.length%W);h.set(a,0),e.enqueue(nt(n,t,h,a.length,0))},async flush(t){const{X:e,Y:n,pending:s,ready:i}=this;if(n&&e){await i;let c=new o;if(s.length){const t=e.update(at(G,s));n.update(t),c=ct(G,t)}r.signature=ct(G,n.digest()).slice(0,H),t.enqueue(ot(c,r.signature))}}}),r=this}}function nt(t,e,n,s,r,i){const{X:c,Y:a,pending:h}=t,f=e.length-r;let l;for(h.length&&(e=ot(h,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new o(e)).set(n,0)}return t})(n,f-f%W)),l=0;f-W>=l;l+=W){const t=at(G,it(e,l,l+W));i&&a.update(t);const r=c.update(t);i||a.update(r),n.set(ct(G,r),l+s)}return t.pending=it(e,l),n}async function st(n,s,r,i){n.password=null;const c=await(async(t,e,n,s,r)=>{if(!Y)return U.importKey(e);try{return await N.importKey("raw",e,n,!1,r)}catch{return Y=!1,U.importKey(e)}})(0,r,E,0,O),a=await(async(t,e,n)=>{if(!$)return U._(e,t.salt,L.iterations,n);try{return await N.deriveBits(t,e,n)}catch{return $=!1,U._(e,t.salt,L.iterations,n)}})(e.assign({salt:i},L),c,8*(2*j[s]+2)),h=new o(a),f=at(G,it(h,0,j[s])),l=at(G,it(h,j[s],2*j[s])),u=it(h,2*j[s]);return e.assign(n,{keys:{key:f,$:l,passwordVerification:u},X:new Q(new J(f),t.from(Z)),Y:new X(l)}),u}function rt(t,e){return e===b?(t=>{if(typeof u==v){const e=new o((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new u).encode(t)})(t):e}function ot(t,e){let n=t;return t.length+e.length&&(n=new o(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function it(t,e,n){return t.subarray(e,n)}function ct(t,e){return t.p(e)}function at(t,e){return t.m(e)}class ht extends d{constructor({password:t,passwordVerification:n,checkPasswordOnly:s}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;if(n.password){const e=lt(n,t.subarray(0,12));if(n.password=null,e.at(-1)!=n.passwordVerification)throw new r(M);t=t.subarray(12)}s?e.error(new r(B)):e.enqueue(lt(n,t))}})}}class ft extends d{constructor({password:t,passwordVerification:n}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;let s,r;if(n.password){n.password=null;const e=D(new o(12));e[11]=n.passwordVerification,s=new o(t.length+e.length),s.set(ut(n,e),0),r=12}else s=new o(t.length),r=0;s.set(ut(n,t),r),e.enqueue(s)}})}}function lt(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,n[s]);return n}function ut(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,e[s]);return n}function wt(t,n){const s=[305419896,591751049,878082192];e.assign(t,{keys:s,tt:new C(s[0]),et:new C(s[2])});for(let e=0;e<n.length;e++)pt(t,n.charCodeAt(e))}function pt(t,e){let[n,r,o]=t.keys;t.tt.append([e]),n=~t.tt.get(),r=mt(s.imul(mt(r+yt(n)),134775813)+1),t.et.append([r>>>24]),o=~t.et.get(),t.keys=[n,r,o]}function dt(t){const e=2|t.keys[2];return yt(s.imul(e,1^e)>>>8)}function yt(t){return 255&t}function mt(t){return 4294967295&t}class gt extends d{constructor(t,{chunkSize:e,nt:n,CompressionStream:s}){super({});const{compressed:r,encrypted:o,useCompressionStream:i,zipCrypto:c,signed:a,level:h}=t,l=this;let u,w,p=super.readable;o&&!c||!a||(u=new A,p=kt(p,u)),r&&(p=vt(p,i,{level:h,chunkSize:e},s,n,s)),o&&(c?p=kt(p,new ft(t)):(w=new et(t),p=kt(p,w))),bt(l,p,()=>{let t;o&&!c&&(t=w.signature),o&&!c||!a||(t=new f(u.value.buffer).getUint32(0)),l.signature=t})}}class St extends d{constructor(t,{chunkSize:e,st:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:i,signed:c,signature:a,compressed:h,useCompressionStream:l,rt:u}=t;let w,p,d=super.readable;i&&(o?d=kt(d,new ht(t)):(p=new tt(t),d=kt(d,p))),h&&(d=vt(d,l,{chunkSize:e,rt:u},s,n,s)),i&&!o||!c||(w=new A,d=kt(d,w)),bt(this,d,()=>{if((!i||o)&&c){const t=new f(w.value.buffer);if(a!=t.getUint32(0,!1))throw new r(_)}})}}function bt(t,n,s){n=kt(n,new d({flush:s})),e.defineProperty(t,"readable",{get:()=>n})}function vt(t,e,n,s,r,o){const i=e&&s?s:r||o,c=n.rt?"deflate64-raw":"deflate-raw";try{t=kt(t,new i(c,n))}catch(s){if(!e)throw s;if(r)t=kt(t,new r(c,n));else{if(!o)throw s;t=kt(t,new o(c,n))}}return t}function kt(t,e){return t.pipeThrough(e)}const zt="data",Ct="close";class At extends d{constructor(t,n){super({});const s=this,{codecType:o}=t;let i;o.startsWith("deflate")?i=gt:o.startsWith("inflate")&&(i=St),s.outputSize=0;let c=0;const a=new i(t,n),h=super.readable,f=new d({transform(t,e){t&&t.length&&(c+=t.length,e.enqueue(t))},flush(){e.assign(s,{inputSize:c})}}),l=new d({transform(e,n){if(e&&e.length&&(n.enqueue(e),s.outputSize+=e.length,t.outputSize!==b&&s.outputSize>t.outputSize))throw new r("Invalid uncompressed size")},flush(){const{signature:t}=a;e.assign(s,{signature:t,inputSize:c})}});e.defineProperty(s,"readable",{get:()=>h.pipeThrough(f).pipeThrough(a).pipeThrough(l)})}}class xt extends d{constructor(t){let e;super({transform:function n(s,r){if(e){const t=new o(e.length+s.length);t.set(e),t.set(s,e.length),s=t,e=null}s.length>t?(r.enqueue(s.slice(0,t)),n(s.slice(t),r)):e=s},flush(t){e&&e.length&&t.enqueue(e)}})}}const It=new h,Rt=new h;let Pt,Ut,Vt,Mt,_t,Bt=0;async function Dt(t){try{const{options:e,config:s}=t;if(!e.useCompressionStream)try{await self.initModule(t.config)}catch{e.useCompressionStream=!0}s.CompressionStream=self.CompressionStream,s.DecompressionStream=self.DecompressionStream;const r={highWaterMark:1},o=t.readable||new y({async pull(t){const e=new l(t=>It.set(Bt,t));Wt({type:"pull",messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await e;t.enqueue(s),r&&t.close()}},r),i=t.writable||new m({async write(t){let e;const s=new l(t=>e=t);Rt.set(Bt,e),Wt({type:zt,value:t,messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER,await s}},r),c=new At(e,s);Pt=new AbortController;const{signal:a}=Pt;await o.pipeThrough(c).pipeThrough(new xt(s.chunkSize)).pipeTo(i,{signal:a,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:h,inputSize:f,outputSize:u}=c;Wt({type:Ct,result:{signature:h,inputSize:f,outputSize:u}})}catch(t){t.outputSize=0,Kt(t)}}function Wt(t){let{value:e}=t;if(e)if(e.length)try{e=new o(e),t.value=e.buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t)}function Kt(t=new r("Unknown error")){const{message:e,stack:n,code:s,name:o,outputSize:i}=t;p({error:{message:e,stack:n,code:s,name:o,outputSize:i}})}function Et(t,e,n={}){const i="number"==typeof n.level?n.level:-1,c="number"==typeof n.ot?n.ot:65536,a="number"==typeof n.it?n.it:65536;return new d({start(){let n;if(this.ct=Vt(c),this.in=Vt(a),this.it=a,this.ht=new o(c),t?(this.ft=Ut.deflate_process,this.lt=Ut.deflate_last_consumed,this.ut=Ut.deflate_end,this.wt=Ut.deflate_new(),n="gzip"===e?Ut.deflate_init_gzip(this.wt,i):"deflate-raw"===e?Ut.deflate_init_raw(this.wt,i):Ut.deflate_init(this.wt,i)):"deflate64-raw"===e?(this.ft=Ut.inflate9_process,this.lt=Ut.inflate9_last_consumed,this.ut=Ut.inflate9_end,this.wt=Ut.inflate9_new(),n=Ut.inflate9_init_raw(this.wt)):(this.ft=Ut.inflate_process,this.lt=Ut.inflate_last_consumed,this.ut=Ut.inflate_end,this.wt=Ut.inflate_new(),n="deflate-raw"===e?Ut.inflate_init_raw(this.wt):"gzip"===e?Ut.inflate_init_gzip(this.wt):Ut.inflate_init(this.wt)),0!==n)throw new r("init failed:"+n)},transform(e,n){try{const i=e,a=new o(_t.buffer),h=this.ft,f=this.lt,l=this.ct,u=this.ht;let w=0;for(;w<i.length;){const e=s.min(i.length-w,32768);this.in&&this.it>=e||(this.in&&Mt&&Mt(this.in),this.in=Vt(e),this.it=e),a.set(i.subarray(w,w+e),this.in);const o=h(this.wt,this.in,e,l,c,0),p=16777215&o;if(p&&(u.set(a.subarray(l,l+p),0),n.enqueue(u.slice(0,p))),!t){const t=o>>24&255,e=128&t?t-256:t;if(0>e)throw new r("process error:"+e)}const d=f(this.wt);if(0===d)break;w+=d}}catch(t){this.ut&&this.wt&&this.ut(this.wt),this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct),n.error(t)}},flush(e){try{const n=new o(_t.buffer),s=this.ft,i=this.ct,a=this.ht;for(;;){const o=s(this.wt,0,0,i,c,4),h=16777215&o,f=o>>24&255;if(!t){const t=128&f?f-256:f;if(0>t)throw new r("process error:"+t)}if(h&&(a.set(n.subarray(i,i+h),0),e.enqueue(a.slice(0,h))),1===f||0===h)break}}catch(t){e.error(t)}finally{if(this.ut&&this.wt){const t=this.ut(this.wt);0!==t&&e.error(new r("end error:"+t))}this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct)}}})}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if("start"==e&&Dt(t),e==zt){const t=It.get(n);It.delete(n),t({value:new o(s),done:r})}if("ack"==e){const t=Rt.get(n);Rt.delete(n),t()}e==Ct&&Pt.abort()}catch(t){Kt(t)}});class Lt{constructor(t="deflate",e){return Et(!0,t,e)}}class Ot{constructor(t="deflate",e){return Et(!1,t,e)}}let Tt=!1;self.initModule=async t=>{try{const e=await(async(t,{baseURI:e})=>{if(!Tt){let n,s;try{try{s=new URL(t,e)}catch{}const r=await fetch(s);n=await r.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;n=(t=>{const e=t.split(",")[1],n=atob(e),s=n.length,r=new o(s);for(let t=0;s>t;++t)r[t]=n.charCodeAt(t);return r.buffer})(t)}(t=>{if(Ut=t,({malloc:Vt,free:Mt,memory:_t}=Ut),"function"!=typeof Vt||"function"!=typeof Mt||!_t)throw Ut=Vt=Mt=_t=null,new r("Invalid WASM module")})((await WebAssembly.instantiate(n)).instance.exports),Tt=!0}})(t.wasmURI,t);return t.nt=Lt,t.st=Ot,e}catch{}}});
|
|
13
|
-
`)),e)})}const Oh=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;Oh[n]=e}class Xo{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let i=0,s=e.length|0;i<s;i++)t=t>>>8^Oh[(t^e[i])&255];this.crc=t}get(){return~this.crc}}class Gh extends TransformStream{constructor(){let e;const t=new Xo;super({transform(i,s){t.append(i),s.enqueue(i)},flush(){const i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,t.get()),e.value=i}}),e=this}}function vb(n){if(typeof TextEncoder==xn){n=unescape(encodeURIComponent(n));const e=new Uint8Array(n.length);for(let t=0;t<e.length;t++)e[t]=n.charCodeAt(t);return e}else return new TextEncoder().encode(n)}const pt={concat(n,e){if(n.length===0||e.length===0)return n.concat(e);const t=n[n.length-1],i=pt.getPartial(t);return i===32?n.concat(e):pt._shiftRight(e,i,t|0,n.slice(0,n.length-1))},bitLength(n){const e=n.length;if(e===0)return 0;const t=n[e-1];return(e-1)*32+pt.getPartial(t)},clamp(n,e){if(n.length*32<e)return n;n=n.slice(0,Math.ceil(e/32));const t=n.length;return e=e&31,t>0&&e&&(n[t-1]=pt.partial(e,n[t-1]&2147483648>>e-1,1)),n},partial(n,e,t){return n===32?e:(t?e|0:e<<32-n)+n*1099511627776},getPartial(n){return Math.round(n/1099511627776)||32},_shiftRight(n,e,t,i){for(i===void 0&&(i=[]);e>=32;e-=32)i.push(t),t=0;if(e===0)return i.concat(n);for(let r=0;r<n.length;r++)i.push(t|n[r]>>>e),t=n[r]<<32-e;const s=n.length?n[n.length-1]:0,o=pt.getPartial(s);return i.push(pt.partial(e+o&31,e+o>32?t:i.pop(),1)),i}},Jo={bytes:{fromBits(n){const t=pt.bitLength(n)/8,i=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=n[o/4]),i[o]=s>>>24,s<<=8;return i},toBits(n){const e=[];let t,i=0;for(t=0;t<n.length;t++)i=i<<8|n[t],(t&3)===3&&(e.push(i),i=0);return t&3&&e.push(pt.partial(8*(t&3),i)),e}}},Uh={};Uh.sha1=class{constructor(n){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],n?(e._h=n._h.slice(0),e._buffer=n._buffer.slice(0),e._length=n._length):e.reset()}reset(){const n=this;return n._h=n._init.slice(0),n._buffer=[],n._length=0,n}update(n){const e=this;typeof n=="string"&&(n=Jo.utf8String.toBits(n));const t=e._buffer=pt.concat(e._buffer,n),i=e._length,s=e._length=i+pt.bitLength(n);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(t);let r=0;for(let a=e.blockSize+i-(e.blockSize+i&e.blockSize-1);a<=s;a+=e.blockSize)e._block(o.subarray(16*r,16*(r+1))),r+=1;return t.splice(0,16*r),e}finalize(){const n=this;let e=n._buffer;const t=n._h;e=pt.concat(e,[pt.partial(1,1)]);for(let i=e.length+2;i&15;i++)e.push(0);for(e.push(Math.floor(n._length/4294967296)),e.push(n._length|0);e.length;)n._block(e.splice(0,16));return n.reset(),t}_f(n,e,t,i){if(n<=19)return e&t|~e&i;if(n<=39)return e^t^i;if(n<=59)return e&t|e&i|t&i;if(n<=79)return e^t^i}_S(n,e){return e<<n|e>>>32-n}_block(n){const e=this,t=e._h,i=Array(80);for(let c=0;c<16;c++)i[c]=n[c];let s=t[0],o=t[1],r=t[2],a=t[3],l=t[4];for(let c=0;c<=79;c++){c>=16&&(i[c]=e._S(1,i[c-3]^i[c-8]^i[c-14]^i[c-16]));const h=e._S(5,s)+e._f(c,o,r,a)+l+i[c]+e._key[Math.floor(c/20)]|0;l=a,a=r,r=e._S(30,o),o=s,s=h}t[0]=t[0]+s|0,t[1]=t[1]+o|0,t[2]=t[2]+r|0,t[3]=t[3]+a|0,t[4]=t[4]+l|0}};const Vh={};Vh.aes=class{constructor(n){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],i=e._tables[1],s=n.length;let o,r,a,l=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[r=n.slice(0),a=[]],o=s;o<4*s+28;o++){let c=r[o-1];(o%s===0||s===8&&o%s===4)&&(c=t[c>>>24]<<24^t[c>>16&255]<<16^t[c>>8&255]<<8^t[c&255],o%s===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),r[o]=r[o-s]^c}for(let c=0;o;c++,o--){const h=r[c&3?o:o-4];o<=4||c<4?a[c]=h:a[c]=i[0][t[h>>>24]]^i[1][t[h>>16&255]]^i[2][t[h>>8&255]]^i[3][t[h&255]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],e=this._tables[1],t=n[4],i=e[4],s=[],o=[];let r,a,l,c;for(let h=0;h<256;h++)o[(s[h]=h<<1^(h>>7)*283)^h]=h;for(let h=r=0;!t[h];h^=a||1,r=o[r]||1){let u=r^r<<1^r<<2^r<<3^r<<4;u=u>>8^u&255^99,t[h]=u,i[u]=h,c=s[l=s[a=s[h]]];let p=c*16843009^l*65537^a*257^h*16843008,f=s[u]*257^u*16843008;for(let m=0;m<4;m++)n[m][h]=f=f<<24^f>>>8,e[m][u]=p=p<<24^p>>>8}for(let h=0;h<5;h++)n[h]=n[h].slice(0),e[h]=e[h].slice(0)}_crypt(n,e){if(n.length!==4)throw new Error("invalid aes block size");const t=this._key[e],i=t.length/4-2,s=[0,0,0,0],o=this._tables[e],r=o[0],a=o[1],l=o[2],c=o[3],h=o[4];let u=n[0]^t[0],p=n[e?3:1]^t[1],f=n[2]^t[2],m=n[e?1:3]^t[3],y=4,g,A,v;for(let C=0;C<i;C++)g=r[u>>>24]^a[p>>16&255]^l[f>>8&255]^c[m&255]^t[y],A=r[p>>>24]^a[f>>16&255]^l[m>>8&255]^c[u&255]^t[y+1],v=r[f>>>24]^a[m>>16&255]^l[u>>8&255]^c[p&255]^t[y+2],m=r[m>>>24]^a[u>>16&255]^l[p>>8&255]^c[f&255]^t[y+3],y+=4,u=g,p=A,f=v;for(let C=0;C<4;C++)s[e?3&-C:C]=h[u>>>24]<<24^h[p>>16&255]<<16^h[f>>8&255]<<8^h[m&255]^t[y++],g=u,u=p,p=f,f=m,m=g;return s}};const bb={getRandomValues(n){const e=new Uint32Array(n.buffer),t=i=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,i=18e3*(i&65535)+(i>>16)&o,(((s<<16)+i&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,s;i<n.length;i+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[i/4]=o()*4294967296|0}return n}},Qh={};Qh.ctrGladman=class{constructor(n,e){this._prf=n,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)===255){let e=n>>16&255,t=n>>8&255,i=n&255;e===255?(e=0,t===255?(t=0,i===255?i=0:++i):++t):++e,n=0,n+=e<<16,n+=t<<8,n+=i}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,e,t){let i;if(!(i=e.length))return[];const s=pt.bitLength(e);for(let o=0;o<i;o+=4){this.incCounter(t);const r=n.encrypt(t);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return pt.clamp(e,s)}};const Jn={importKey(n){return new Jn.hmacSha1(Jo.bytes.toBits(n))},pbkdf2(n,e,t,i){if(t=t||1e4,i<0||t<0)throw new Error("invalid params to pbkdf2");const s=(i>>5)+1<<2;let o,r,a,l,c;const h=new ArrayBuffer(s),u=new DataView(h);let p=0;const f=pt;for(e=Jo.bytes.toBits(e),c=1;p<(s||1);c++){for(o=r=n.encrypt(f.concat(e,[c])),a=1;a<t;a++)for(r=n.encrypt(r),l=0;l<r.length;l++)o[l]^=r[l];for(a=0;p<(s||1)&&a<o.length;a++)u.setInt32(p,o[a]),p+=4}return h.slice(0,i/8)}};Jn.hmacSha1=class{constructor(n){const e=this,t=e._hash=Uh.sha1,i=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;n.length>s&&(n=new t().update(n).finalize());for(let o=0;o<s;o++)i[0][o]=n[o]^909522486,i[1][o]=n[o]^1549556828;e._baseHash[0].update(i[0]),e._baseHash[1].update(i[1]),e._resultHash=new t(e._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){const e=this;e._updated=!0,e._resultHash.update(n)}digest(){const n=this,e=n._resultHash.finalize(),t=new n._hash(n._baseHash[1]).update(e).finalize();return n.reset(),t}encrypt(n){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}};const Cb=typeof crypto!=xn&&typeof crypto.getRandomValues==Xn,zh="Invalid password",Hh="Invalid signature",sl="zipjs-abort-check-password";function Yh(n){return Cb?crypto.getRandomValues(n):bb.getRandomValues(n)}const Mi=16,wb="raw",$h={name:"PBKDF2"},Eb={name:"HMAC"},xb="SHA-1",Ib=Object.assign({hash:Eb},$h),ol=Object.assign({iterations:1e3,hash:{name:xb}},$h),Sb=["deriveBits"],Es=[8,12,16],xs=[16,24,32],In=10,Mb=[0,0,0,0],Zo=typeof crypto!=xn,Is=Zo&&crypto.subtle,jh=Zo&&typeof Is!=xn,qt=Jo.bytes,Tb=Vh.aes,Bb=Qh.ctrGladman,_b=Jn.hmacSha1;let Wh=Zo&&jh&&typeof Is.importKey==Xn,qh=Zo&&jh&&typeof Is.deriveBits==Xn;class kb extends TransformStream{constructor({password:e,rawPassword:t,signed:i,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Jh(e,t),signed:i,strength:s-1,pending:new Uint8Array})},async transform(r,a){const l=this,{password:c,strength:h,resolveReady:u,ready:p}=l;c?(await Db(l,h,c,kt(r,0,Es[h]+2)),r=kt(r,Es[h]+2),o?a.error(new Error(sl)):u()):await p;const f=new Uint8Array(r.length-In-(r.length-In)%Mi);a.enqueue(Kh(l,r,f,0,In,!0))},async flush(r){const{signed:a,ctr:l,hmac:c,pending:h,ready:u}=this;if(c&&l){await u;const p=kt(h,0,h.length-In),f=kt(h,h.length-In);let m=new Uint8Array;if(p.length){const y=Ms(qt,p);c.update(y);const g=l.update(y);m=Ss(qt,g)}if(a){const y=kt(Ss(qt,c.digest()),0,In);for(let g=0;g<In;g++)if(y[g]!=f[g])throw new Error(Hh)}r.enqueue(m)}}})}}class Pb extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:i}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:Jh(e,t),strength:i-1,pending:new Uint8Array})},async transform(o,r){const a=this,{password:l,strength:c,resolveReady:h,ready:u}=a;let p=new Uint8Array;l?(p=await Nb(a,c,l),h()):await u;const f=new Uint8Array(p.length+o.length-o.length%Mi);f.set(p,0),r.enqueue(Kh(a,o,f,p.length,0))},async flush(o){const{ctr:r,hmac:a,pending:l,ready:c}=this;if(a&&r){await c;let h=new Uint8Array;if(l.length){const u=r.update(Ms(qt,l));a.update(u),h=Ss(qt,u)}s.signature=Ss(qt,a.digest()).slice(0,In),o.enqueue(rl(h,s.signature))}}}),s=this}}function Kh(n,e,t,i,s,o){const{ctr:r,hmac:a,pending:l}=n,c=e.length-s;l.length&&(e=rl(l,e),t=Fb(t,c-c%Mi));let h;for(h=0;h<=c-Mi;h+=Mi){const u=Ms(qt,kt(e,h,h+Mi));o&&a.update(u);const p=r.update(u);o||a.update(p),t.set(Ss(qt,p),h+i)}return n.pending=kt(e,h),t}async function Db(n,e,t,i){const s=await Xh(n,e,t,kt(i,0,Es[e])),o=kt(i,Es[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(zh)}async function Nb(n,e,t){const i=Yh(new Uint8Array(Es[e])),s=await Xh(n,e,t,i);return rl(i,s)}async function Xh(n,e,t,i){n.password=null;const s=await Lb(wb,t,Ib,!1,Sb),o=await Rb(Object.assign({salt:i},ol),s,8*(xs[e]*2+2)),r=new Uint8Array(o),a=Ms(qt,kt(r,0,xs[e])),l=Ms(qt,kt(r,xs[e],xs[e]*2)),c=kt(r,xs[e]*2);return Object.assign(n,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new Bb(new Tb(a),Array.from(Mb)),hmac:new _b(l)}),c}async function Lb(n,e,t,i,s){if(Wh)try{return await Is.importKey(n,e,t,i,s)}catch{return Wh=!1,Jn.importKey(e)}else return Jn.importKey(e)}async function Rb(n,e,t){if(qh)try{return await Is.deriveBits(n,e,t)}catch{return qh=!1,Jn.pbkdf2(e,n.salt,ol.iterations,t)}else return Jn.pbkdf2(e,n.salt,ol.iterations,t)}function Jh(n,e){return e===Se?vb(n):e}function rl(n,e){let t=n;return n.length+e.length&&(t=new Uint8Array(n.length+e.length),t.set(n,0),t.set(e,n.length)),t}function Fb(n,e){if(e&&e>n.length){const t=n;n=new Uint8Array(e),n.set(t,0)}return n}function kt(n,e,t){return n.subarray(e,t)}function Ss(n,e){return n.fromBits(e)}function Ms(n,e){return n.toBits(e)}const Ts=12;class Ob extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),tu(this,e)},transform(s,o){const r=this;if(r.password){const a=Zh(r,s.subarray(0,Ts));if(r.password=null,a.at(-1)!=r.passwordVerification)throw new Error(zh);s=s.subarray(Ts)}i?o.error(new Error(sl)):o.enqueue(Zh(r,s))}})}}class Gb extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),tu(this,e)},transform(i,s){const o=this;let r,a;if(o.password){o.password=null;const l=Yh(new Uint8Array(Ts));l[Ts-1]=o.passwordVerification,r=new Uint8Array(i.length+l.length),r.set(eu(o,l),0),a=Ts}else r=new Uint8Array(i.length),a=0;r.set(eu(o,i),a),s.enqueue(r)}})}}function Zh(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=nu(n)^e[i],al(n,t[i]);return t}function eu(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=nu(n)^e[i],al(n,e[i]);return t}function tu(n,e){const t=[305419896,591751049,878082192];Object.assign(n,{keys:t,crcKey0:new Xo(t[0]),crcKey2:new Xo(t[2])});for(let i=0;i<e.length;i++)al(n,e.charCodeAt(i))}function al(n,e){let[t,i,s]=n.keys;n.crcKey0.append([e]),t=~n.crcKey0.get(),i=su(Math.imul(su(i+iu(t)),134775813)+1),n.crcKey2.append([i>>>24]),s=~n.crcKey2.get(),n.keys=[t,i,s]}function nu(n){const e=n.keys[2]|2;return iu(Math.imul(e,e^1)>>>8)}function iu(n){return n&255}function su(n){return n&4294967295}const ou="Invalid uncompressed size",Ub="deflate-raw",Vb="deflate64-raw";class Qb extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:i,CompressionStream:s}){super({});const{compressed:o,encrypted:r,useCompressionStream:a,zipCrypto:l,signed:c,level:h}=e,u=this;let p,f,m=super.readable;(!r||l)&&c&&(p=new Gh,m=Kt(m,p)),o&&(m=au(m,a,{level:h,chunkSize:t},s,i,s)),r&&(l?m=Kt(m,new Gb(e)):(f=new Pb(e),m=Kt(m,f))),ru(u,m,()=>{let y;r&&!l&&(y=f.signature),(!r||l)&&c&&(y=new DataView(p.value.buffer).getUint32(0)),u.signature=y})}}class zb extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:i,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:r,signed:a,signature:l,compressed:c,useCompressionStream:h,deflate64:u}=e;let p,f,m=super.readable;r&&(o?m=Kt(m,new Ob(e)):(f=new kb(e),m=Kt(m,f))),c&&(m=au(m,h,{chunkSize:t,deflate64:u},s,i,s)),(!r||o)&&a&&(p=new Gh,m=Kt(m,p)),ru(this,m,()=>{if((!r||o)&&a){const y=new DataView(p.value.buffer);if(l!=y.getUint32(0,!1))throw new Error(Hh)}})}}function ru(n,e,t){e=Kt(e,new TransformStream({flush:t})),Object.defineProperty(n,"readable",{get(){return e}})}function au(n,e,t,i,s,o){const r=e&&i?i:s||o,a=t.deflate64?Vb:Ub;try{n=Kt(n,new r(a,t))}catch(l){if(e)if(s)n=Kt(n,new s(a,t));else if(o)n=Kt(n,new o(a,t));else throw l;else throw l}return n}function Kt(n,e){return n.pipeThrough(e)}const Hb="message",Yb="start",$b="pull",lu="data",jb="ack",cu="close",Wb="deflate",du="inflate";class qb extends TransformStream{constructor(e,t){super({});const i=this,{codecType:s}=e;let o;s.startsWith(Wb)?o=Qb:s.startsWith(du)&&(o=zb),i.outputSize=0;let r=0;const a=new o(e,t),l=super.readable,c=new TransformStream({transform(u,p){u&&u.length&&(r+=u.length,p.enqueue(u))},flush(){Object.assign(i,{inputSize:r})}}),h=new TransformStream({transform(u,p){if(u&&u.length&&(p.enqueue(u),i.outputSize+=u.length,e.outputSize!==Se&&i.outputSize>e.outputSize))throw new Error(ou)},flush(){const{signature:u}=a;Object.assign(i,{signature:u,inputSize:r})}});Object.defineProperty(i,"readable",{get(){return l.pipeThrough(c).pipeThrough(a).pipeThrough(h)}})}}class Kb extends TransformStream{constructor(e){let t;super({transform:i,flush(s){t&&t.length&&s.enqueue(t)}});function i(s,o){if(t){const r=new Uint8Array(t.length+s.length);r.set(t),r.set(s,t.length),s=r,t=null}s.length>e?(o.enqueue(s.slice(0,e)),i(s.slice(e),o)):t=s}}}let hu=typeof Worker!=xn,uu=()=>{};function Xb({initModule:n}){uu=n}class ll{constructor(e,{readable:t,writable:i},{options:s,config:o,streamOptions:r,useWebWorkers:a,transferStreams:l,workerURI:c},h){const{signal:u}=r;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new Kb(o.chunkSize)).pipeThrough(new Jb(r),{signal:u}),writable:i,options:Object.assign({},s),workerURI:c,transferStreams:l,terminate(){return new Promise(p=>{const{worker:f,busy:m}=e;f?(m?e.resolveTerminated=p:(f.terminate(),p()),e.interface=null):p()})},onTaskFinished(){const{resolveTerminated:p}=e;p&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),p()),e.busy=!1,h(e)}}),(a&&hu?Zb:fu)(e,o)}}class Jb extends TransformStream{constructor({onstart:e,onprogress:t,size:i,onend:s}){let o=0;super({async start(){e&&await cl(e,i)},async transform(r,a){o+=r.length,t&&await cl(t,o,i),a.enqueue(r)},async flush(){s&&await cl(s,o)}})}}async function cl(n,...e){try{await n(...e)}catch{}}function fu(n,e){return{run:()=>eC(n,e)}}function Zb(n,e){const{baseURI:t,chunkSize:i}=e;let{wasmURI:s}=e;if(!n.interface){typeof s==Xn&&(s=s());let o;try{o=iC(n.workerURI,t,n)}catch{return hu=!1,fu(n,e)}Object.assign(n,{worker:o,interface:{run:()=>tC(n,{chunkSize:i,wasmURI:s,baseURI:t})}})}return n.interface}async function eC({options:n,readable:e,writable:t,onTaskFinished:i},s){let o;try{if(!n.useCompressionStream)try{await uu(s)}catch{n.useCompressionStream=!0}o=new qb(n,s),await e.pipeThrough(o).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:a,outputSize:l}=o;return{signature:r,inputSize:a,outputSize:l}}catch(r){throw o&&(r.outputSize=o.outputSize),r}finally{i()}}async function tC(n,e){let t,i;const s=new Promise((u,p)=>{t=u,i=p});Object.assign(n,{reader:null,writer:null,resolveResult:t,rejectResult:i,result:s});const{readable:o,options:r}=n,{writable:a,closed:l}=nC(n.writable),c=er({type:Yb,options:r,config:e,readable:o,writable:a},n);c||Object.assign(n,{reader:o.getReader(),writer:a.getWriter()});const h=await s;return c||await a.getWriter().close(),await l,h}function nC(n){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=n.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return n.getWriter().abort(s)}}),closed:t}}let pu=!0;function iC(n,e,t){const i={type:"module"};let s,o;if(typeof n==Xn&&(n=n()),n.startsWith("data:")||n.startsWith("blob:"))try{o=new Worker(n)}catch{o=new Worker(n,i)}else{try{s=new URL(n,e)}catch{s=n}o=new Worker(s,i)}return o.addEventListener(Hb,r=>sC(r,t)),o}function er(n,{worker:e,writer:t,onTaskFinished:i,transferStreams:s}){try{const{value:o,readable:r,writable:a}=n,l=[];if(o&&(n.value=o,l.push(n.value.buffer)),s&&pu?(r&&l.push(r),a&&l.push(a)):n.readable=n.writable=null,l.length)try{return e.postMessage(n,l),!0}catch{pu=!1,n.readable=n.writable=null,e.postMessage(n)}else e.postMessage(n)}catch(o){throw t&&t.releaseLock(),i(),o}}async function sC({data:n},e){const{type:t,value:i,messageId:s,result:o,error:r}=n,{reader:a,writer:l,resolveResult:c,rejectResult:h,onTaskFinished:u}=e;try{if(r){const{message:f,stack:m,code:y,name:g,outputSize:A}=r,v=new Error(f);Object.assign(v,{stack:m,code:y,name:g,outputSize:A}),p(v)}else{if(t==$b){const{value:f,done:m}=await a.read();er({type:lu,value:f,done:m,messageId:s},e)}t==lu&&(await l.ready,await l.write(new Uint8Array(i)),er({type:jb,messageId:s},e)),t==cu&&p(null,o)}}catch(f){er({type:cu,messageId:s},e),p(f)}function p(f,m){f?h(f):c(m),l&&l.releaseLock(),u()}}let Zn=[];const dl=[];let mu=0;async function oC(n,e){const{options:t,config:i}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:a,signed:l,encrypted:c}=t,{workerURI:h,maxWorkers:u}=i;e.transferStreams=s||s===Se;const p=!a&&!l&&!c&&!e.transferStreams;return e.useWebWorkers=!p&&(o||o===Se&&i.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Se,t.useCompressionStream=r||r===Se&&i.useCompressionStream,(await f()).run();async function f(){const y=Zn.find(g=>!g.busy);if(y)return gu(y),new ll(y,n,e,m);if(Zn.length<u){const g={indexWorker:mu};return mu++,Zn.push(g),new ll(g,n,e,m)}else return new Promise(g=>dl.push({resolve:g,stream:n,workerOptions:e}))}function m(y){if(dl.length){const[{resolve:g,stream:A,workerOptions:v}]=dl.splice(0,1);g(new ll(y,A,v,m))}else y.worker?(gu(y),rC(y,e)):Zn=Zn.filter(g=>g!=y)}}function rC(n,e){const{config:t}=e,{terminateWorkerTimeout:i}=t;Number.isFinite(i)&&i>=0&&(n.terminated?n.terminated=!1:n.terminateTimeout=setTimeout(async()=>{Zn=Zn.filter(s=>s!=n);try{await n.terminate()}catch{}},i))}function gu(n){const{terminateTimeout:e}=n;e&&(clearTimeout(e),n.terminateTimeout=null)}const aC="Writer iterator completed too soon",lC="Content-Type",cC=64*1024,yu="writable";class hl{constructor(){this.size=0}init(){this.initialized=!0}}class Au extends hl{get readable(){const e=this,{chunkSize:t=cC}=e,i=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:a}=i,{chunkOffset:l}=this,c=r===Se?t:Math.min(t,r-l),h=await tt(e,o+l,c,a);s.enqueue(h),l+t>r||r===Se&&!h.length&&c?s.close():this.chunkOffset+=t}});return i}}class tr extends Au{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const i=this,s=e+t;let r=await(e||s<i.size?i.blob.slice(e,s):i.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class dC extends hl{constructor(e){super();const t=this,i=new TransformStream,s=[];e&&s.push([lC,e]),Object.defineProperty(t,yu,{get(){return i.writable}}),t.blob=new Response(i.readable,{headers:s}).blob()}getData(){return this.blob}}class hC extends dC{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,i=await super.getData();if(i.text&&t)return i.text();{const s=new FileReader;return new Promise((o,r)=>{Object.assign(s,{onload:({target:a})=>o(a.result),onerror:()=>r(s.error)}),s.readAsText(i,e)})}}}class uC extends Au{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(i,s)=>{await i.init(),s!=t.length-1&&(e.lastDiskOffset+=i.size),e.size+=i.size})),super.init()}async readUint8Array(e,t,i=0){const s=this,{readers:o}=this;let r,a=i;a==-1&&(a=o.length-1);let l=e;for(;o[a]&&l>=o[a].size;)l-=o[a].size,a++;const c=o[a];if(c){const h=c.size;if(l+t<=h)r=await tt(c,l,t);else{const u=h-l;r=new Uint8Array(t);const p=await tt(c,l,u);r.set(p,0);const f=await s.readUint8Array(e+u,t-u,i);r.set(f,u),p.length+f.length<t&&(r=r.subarray(0,p.length+f.length))}}else r=new Uint8Array;return s.lastDiskNumber=Math.max(a,s.lastDiskNumber),r}}class vu extends hl{constructor(e,t=4294967295){super();const i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const a=new WritableStream({async write(h){const{availableSize:u}=i;if(r)h.length>=u?(await l(h.subarray(0,u)),await c(),i.diskOffset+=s.size,i.diskNumber++,r=null,await this.write(h.subarray(u))):await l(h);else{const{value:p,done:f}=await e.next();if(f&&!p)throw new Error(aC);s=p,s.size=0,s.maxSize&&(i.maxSize=s.maxSize),i.availableSize=i.maxSize,await nr(s),o=p.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await c()}});Object.defineProperty(i,yu,{get(){return a}});async function l(h){const u=h.length;u&&(await r.ready,await r.write(h),s.size+=u,i.size+=u,i.availableSize-=u)}async function c(){await r.close()}}}class fC{constructor(e){return Array.isArray(e)&&(e=new uC(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class pC{constructor(e){return e.writable===Se&&typeof e.next==Xn&&(e=new vu(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Se&&(e.size=0),e instanceof vu||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function nr(n,e){if(n.init&&!n.initialized)await n.init(e);else return Promise.resolve()}function tt(n,e,t,i){return n.readUint8Array(e,t,i)}const bu="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),mC=bu.length==256;function gC(n){if(mC){let e="";for(let t=0;t<n.length;t++)e+=bu[n[t]];return e}else return new TextDecoder().decode(n)}function ir(n,e){return e&&e.trim().toLowerCase()=="cp437"?gC(n):new TextDecoder(e).decode(n)}const Cu="filename",wu="rawFilename",Eu="comment",xu="rawComment",Iu="uncompressedSize",Su="compressedSize",Mu="offset",Tu="diskNumberStart",ul="lastModDate",fl="rawLastModDate",Bu="lastAccessDate",yC="rawLastAccessDate",_u="creationDate",ku="rawCreationDate",AC=[Cu,wu,Iu,Su,ul,fl,Eu,xu,Bu,_u,ku,Mu,Tu,"internalFileAttributes","externalFileAttributes","msdosAttributesRaw","msdosAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","compressionMethod","signature","extraField","extraFieldUnix","extraFieldInfoZip","uid","gid","unixMode","setuid","setgid","sticky","bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Pu{constructor(e){AC.forEach(t=>this[t]=e[t])}}const vC="filenameEncoding",bC="commentEncoding",CC="decodeText",wC="extractPrependedData",EC="extractAppendedData",xC="password",IC="rawPassword",SC="passThrough",MC="signal",TC="checkPasswordOnly",BC="checkOverlappingEntryOnly",_C="checkOverlappingEntry",kC="checkSignature",PC="useWebWorkers",DC="useCompressionStream",NC="transferStreams",LC="preventClose",pl="File format is not recognized",RC="End of central directory not found",FC="End of Zip64 central directory locator not found",OC="Central directory header not found",GC="Local file header not found",UC="Zip64 extra field not found",VC="File contains encrypted entry",QC="Encryption method not supported",Du="Compression method not supported",Nu="Split zip file",zC="Overlapping entry found",Lu="utf-8",HC="UTF8",Ru="cp437",YC=[[Iu,Kn],[Su,Kn],[Mu,Kn],[Tu,Wt]],$C={[Wt]:{getValue:Me,bytes:4},[Kn]:{getValue:Ti,bytes:8}};class ml{constructor(e,t={}){Object.assign(this,{reader:new fC(e),options:t,config:gb(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:i}=t;const{config:s}=t;if(await nr(i),(i.size===Se||!i.readUint8Array)&&(i=new tr(await new Response(i.readable).blob()),await nr(i)),i.size<Si)throw new Error(pl);i.chunkSize=yb(s);const o=await ZC(i,Uv,i.size,Si,Wt*16);if(!o){const b=await tt(i,0,4),T=Te(b);throw Me(T)==Th?new Error(Nu):new Error(RC)}const r=Te(o);let a=Me(r,12),l=Me(r,16);const c=o.offset,h=Ze(r,20),u=c+Si+h;let p=Ze(r,4);const f=i.lastDiskNumber||0;let m=Ze(r,6),y=Ze(r,8),g=0,A=0;if(l==Kn||a==Kn||y==Wt||m==Wt){const b=await tt(i,o.offset-Za,Za),T=Te(b);if(Me(T,0)==Vv){l=Ti(T,8);let L=await tt(i,l,el,-1),O=Te(L);const D=o.offset-Za-el;if(Me(O,0)!=_h&&l!=D){const M=l;l=D,l>M&&(g=l-M),L=await tt(i,l,el,-1),O=Te(L)}if(Me(O,0)!=_h)throw new Error(FC);p==Wt&&(p=Me(O,16)),m==Wt&&(m=Me(O,20)),y==Wt&&(y=Ti(O,32)),a==Kn&&(a=Ti(O,40)),l-=a}}if(l>=i.size&&(g=i.size-l-a-Si,l=i.size-a-Si),f!=p)throw new Error(Nu);if(l<0)throw new Error(pl);let v=0,C=await tt(i,l,a,m),w=Te(C);if(a){const b=o.offset-a;if(Me(w,v)!=Bh&&l!=b){const T=l;l=b,l>T&&(g+=l-T),C=await tt(i,l,a,m),w=Te(C)}}const S=o.offset-l-(i.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,C=await tt(i,l,a,m),w=Te(C)),l<0||l>=i.size)throw new Error(pl);const x=nt(t,e,vC),I=nt(t,e,bC);for(let b=0;b<y;b++){const T=new jC(i,s,t.options);if(Me(w,v)!=Bh)throw new Error(OC);Fu(T,w,v+6);const L=!!T.bitFlag.languageEncodingFlag,O=v+46,D=O+T.filenameLength,M=D+T.extraFieldLength,E=Ze(w,v+4),_=E>>8==0,N=E>>8==3,F=C.subarray(O,D),Q=Ze(w,v+32),G=M+Q,P=C.subarray(M,G),k=L,U=L,H=Me(w,v+38),q=H&Ja,j={readOnly:!!(q&nb),hidden:!!(q&ib),system:!!(q&sb),directory:!!(q&tb),archive:!!(q&ob)},ce=Me(w,v+42)+g,de=nt(t,e,CC)||ir,me=k?Lu:x||Ru,Ae=U?Lu:I||Ru;let _e=de(F,me);_e===Se&&(_e=ir(F,me));let Je=de(P,Ae);Je===Se&&(Je=ir(P,Ae)),Object.assign(T,{versionMadeBy:E,msDosCompatible:_,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:ce,diskNumberStart:Ze(w,v+34),internalFileAttributes:Ze(w,v+36),externalFileAttributes:H,msdosAttributesRaw:q,msdosAttributes:j,rawFilename:F,filenameUTF8:k,commentUTF8:U,rawExtraField:C.subarray(D,M),rawComment:P,filename:_e,comment:Je}),A=Math.max(ce,A),Ou(T,T,w,v+6);const lt=T.externalFileAttributes>>16&Wt;T.unixMode===Se&&(lt&(rb|nl|tl))!=0&&(T.unixMode=lt);const ct=!!(T.unixMode&ab),Bt=!!(T.unixMode&lb),vt=!!(T.unixMode&cb),W=T.unixMode!==Se?(T.unixMode&nl)!=0:N&&(lt&nl)!=0,Y=T.unixMode!==Se&&(T.unixMode&Lh)==tl,te=(lt&Lh)==tl;Object.assign(T,{setuid:ct,setgid:Bt,sticky:vt,unixExternalUpper:lt,internalFileAttribute:T.internalFileAttributes,externalFileAttribute:T.externalFileAttributes,executable:W,directory:Y||te||_&&j.directory||_e.endsWith(db)&&!T.uncompressedSize,zipCrypto:T.encrypted&&!T.extraFieldAES});const ze=new Pu(T);ze.getData=(Yt,yi)=>T.getData(Yt,ze,t.readRanges,yi),ze.arrayBuffer=async Yt=>{const yi=new TransformStream,[$n]=await Promise.all([new Response(yi.readable).arrayBuffer(),T.getData(yi,ze,t.readRanges,Yt)]);return $n},v=G;const{onprogress:It}=e;if(It)try{await It(b+1,y,new Pu(T))}catch{}yield ze}const B=nt(t,e,wC),R=nt(t,e,EC);return B&&(t.prependedData=A>0?await tt(i,0,A):new Uint8Array),t.comment=h?await tt(i,c+Si,h):new Uint8Array,R&&(t.appendedData=u<i.size?await tt(i,u,i.size-u):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const i of this.getEntriesGenerator(e))t.push(i);return t}async close(){}}class jC{constructor(e,t,i){Object.assign(this,{reader:e,config:t,options:i})}async getData(e,t,i,s={}){const o=this,{reader:r,offset:a,diskNumberStart:l,extraFieldAES:c,extraFieldZip64:h,compressionMethod:u,config:p,bitFlag:f,signature:m,rawLastModDate:y,uncompressedSize:g,compressedSize:A}=o,{dataDescriptor:v}=f,C=t.localDirectory={},w=await tt(r,a,il,l),S=Te(w);let x=nt(o,s,xC),I=nt(o,s,IC);const B=nt(o,s,SC);if(x=x&&x.length&&x,I=I&&I.length&&I,c&&c.originalCompressionMethod!=Fv)throw new Error(Du);if(u!=Rv&&u!=Lv&&u!=Mh&&!B)throw new Error(Du);if(Me(S,0)!=Ov)throw new Error(GC);Fu(C,S,4);const{extraFieldLength:R,filenameLength:b,lastAccessDate:T,creationDate:L}=C;C.rawExtraField=R?await tt(r,a+il+b,R,l):new Uint8Array,Ou(o,C,S,4,!0),Object.assign(t,{lastAccessDate:T,creationDate:L});const O=o.encrypted&&C.encrypted&&!B,D=O&&!c;if(B||(t.zipCrypto=D),O){if(!D&&c.strength===Se)throw new Error(QC);if(!x&&!I)throw new Error(VC)}const M=a+il+b+R,E=A,_=r.readable;Object.assign(_,{diskNumberStart:l,offset:M,size:E});const N=nt(o,s,MC),F=nt(o,s,TC);let Q=nt(o,s,_C);const G=nt(o,s,BC);G&&(Q=!0);const{onstart:P,onprogress:k,onend:U}=s,H=u==Mh;let q=nt(o,s,DC);H&&(q=!1);const j={options:{codecType:du,password:x,rawPassword:I,zipCrypto:D,encryptionStrength:c&&c.strength,signed:nt(o,s,kC)&&!B,passwordVerification:D&&(v?y>>>8&Ja:m>>>24&Ja),outputSize:B?A:g,signature:m,compressed:u!=0&&!B,encrypted:o.encrypted&&!B,useWebWorkers:nt(o,s,PC),useCompressionStream:q,transferStreams:nt(o,s,NC),deflate64:H,checkPasswordOnly:F},config:p,streamOptions:{signal:N,size:E,onstart:P,onprogress:k,onend:U}};Q&&await JC({reader:r,fileEntry:t,offset:a,diskNumberStart:l,signature:m,compressedSize:A,uncompressedSize:g,dataOffset:M,dataDescriptor:v||C.bitFlag.dataDescriptor,extraFieldZip64:h||C.extraFieldZip64,readRanges:i});let ce;try{if(!G){F&&(e=new WritableStream),e=new pC(e),await nr(e,B?A:g),{writable:ce}=e;const{outputSize:de}=await oC({readable:_,writable:ce},j);if(e.size+=de,de!=(B?A:g))throw new Error(ou)}}catch(de){if(de.outputSize!==Se&&(e.size+=de.outputSize),!F||de.message!=sl)throw de}finally{!nt(o,s,LC)&&ce&&!ce.locked&&await ce.getWriter().close()}return F||G?Se:e.getData?e.getData():ce}}function Fu(n,e,t){const i=n.rawBitFlag=Ze(e,t+2),s=(i&Ph)==Ph,o=Me(e,t+6);Object.assign(n,{encrypted:s,version:Ze(e,t),bitFlag:{level:(i&eb)>>1,dataDescriptor:(i&Dh)==Dh,languageEncodingFlag:(i&Nh)==Nh},rawLastModDate:o,lastModDate:ew(o),filenameLength:Ze(e,t+22),extraFieldLength:Ze(e,t+24)})}function Ou(n,e,t,i,s){const{rawExtraField:o}=e,r=e.extraField=new Map,a=Te(new Uint8Array(o));let l=0;try{for(;l<o.length;){const v=Ze(a,l),C=Ze(a,l+2);r.set(v,{type:v,data:o.slice(l+4,l+4+C)}),l+=4+C}}catch{}const c=Ze(t,i+4);Object.assign(e,{signature:Me(t,i+hb),compressedSize:Me(t,i+ub),uncompressedSize:Me(t,i+fb)});const h=r.get(Hv);h&&(WC(h,e),e.extraFieldZip64=h);const u=r.get(qv);u&&(Gu(u,Cu,wu,e,n),e.extraFieldUnicodePath=u);const p=r.get(Kv);p&&(Gu(p,Eu,xu,e,n),e.extraFieldUnicodeComment=p);const f=r.get(Yv);f?(qC(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const m=r.get($v);m&&(KC(m,e),e.extraFieldNTFS=m);const y=r.get(Zv);if(y)Uu(y,e,!1),e.extraFieldUnix=y;else{const v=r.get(Jv);v&&(Uu(v,e,!0),e.extraFieldInfoZip=v)}const g=r.get(Wv);g&&(XC(g,e,s),e.extraFieldExtendedTimestamp=g);const A=r.get(Xv);A&&(e.extraFieldUSDZ=A)}function WC(n,e){e.zip64=!0;const t=Te(n.data),i=YC.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<i.length;s++){const[r,a]=i[s];if(e[r]==a){const l=$C[a];e[r]=n[r]=l.getValue(t,o),o+=l.bytes}else if(n[r])throw new Error(UC)}}function Gu(n,e,t,i,s){const o=Te(n.data),r=new Xo;r.append(s[t]);const a=Te(new Uint8Array(4));a.setUint32(0,r.get(),!0);const l=Me(o,1);Object.assign(n,{version:Sn(o,0),[e]:ir(n.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&l==Me(a,0)}),n.valid&&(i[e]=n[e],i[e+HC]=!0)}function qC(n,e,t){const i=Te(n.data),s=Sn(i,4);Object.assign(n,{vendorVersion:Sn(i,0),vendorId:Sn(i,2),strength:s,originalCompressionMethod:t,compressionMethod:Ze(i,5)}),e.compressionMethod=n.compressionMethod}function KC(n,e){const t=Te(n.data);let i=4,s;try{for(;i<n.data.length&&!s;){const o=Ze(t,i),r=Ze(t,i+2);o==jv&&(s=n.data.slice(i+4,i+4+r)),i+=4+r}}catch{}try{if(s&&s.length==24){const o=Te(s),r=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),l=o.getBigUint64(16,!0);Object.assign(n,{rawLastModDate:r,rawLastAccessDate:a,rawCreationDate:l});const c=gl(r),h=gl(a),u=gl(l),p={lastModDate:c,lastAccessDate:h,creationDate:u};Object.assign(n,p),Object.assign(e,p)}}catch{}}function Uu(n,e,t){try{const i=Te(new Uint8Array(n.data));let s=0;const o=Sn(i,s++),r=Sn(i,s++),a=n.data.subarray(s,s+r);s+=r;const l=Vu(a),c=Sn(i,s++),h=n.data.subarray(s,s+c);s+=c;const u=Vu(h);let p=Se;if(!t&&s+2<=n.data.length){const f=n.data;p=new DataView(f.buffer,f.byteOffset+s,2).getUint16(0,!0)}Object.assign(n,{version:o,uid:l,gid:u,unixMode:p}),l!==Se&&(e.uid=l),u!==Se&&(e.gid=u),p!==Se&&(e.unixMode=p)}catch{}}function Vu(n){const e=new Uint8Array(4);return e.set(n,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function XC(n,e,t){const i=Te(n.data),s=Sn(i,0),o=[],r=[];t?((s&1)==1&&(o.push(ul),r.push(fl)),(s&2)==2&&(o.push(Bu),r.push(yC)),(s&4)==4&&(o.push(_u),r.push(ku))):n.data.length>=5&&(o.push(ul),r.push(fl));let a=1;o.forEach((l,c)=>{if(n.data.length>=a+4){const h=Me(i,a);e[l]=n[l]=new Date(h*1e3);const u=r[c];n[u]=h}a+=4})}async function JC({reader:n,fileEntry:e,offset:t,diskNumberStart:i,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:a,dataDescriptor:l,extraFieldZip64:c,readRanges:h}){let u=0;if(i)for(let m=0;m<i;m++){const y=n.readers[m];u+=y.size}let p=0;if(l&&(c?p=zv:p=Qv),p){const m=await tt(n,a+o,p+kh,i);if(Me(Te(m),0)==Gv){const g=Me(Te(m),4);let A,v;c?(A=Ti(Te(m),8),v=Ti(Te(m),16)):(A=Me(Te(m),8),v=Me(Te(m),12)),(e.encrypted&&!e.zipCrypto||g==s)&&A==o&&v==r&&(p+=kh)}}const f={start:u+t,end:u+a+o+p,fileEntry:e};for(const m of h)if(m.fileEntry!=e&&f.start>=m.start&&f.start<m.end){const y=new Error(zC);throw y.overlappingEntry=m.fileEntry,y}h.push(f)}async function ZC(n,e,t,i,s){const o=new Uint8Array(4),r=Te(o);tw(r,0,e);const a=i+s;return await l(i)||await l(Math.min(a,t));async function l(c){const h=t-c,u=await tt(n,h,c);for(let p=u.length-i;p>=0;p--)if(u[p]==o[0]&&u[p+1]==o[1]&&u[p+2]==o[2]&&u[p+3]==o[3])return{offset:h+p,buffer:u.slice(p,p+i).buffer}}}function nt(n,e,t){return e[t]===Se?n.options[t]:e[t]}function ew(n){const e=(n&4294901760)>>16,t=n&Wt;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function gl(n){return new Date(Number(n/BigInt(1e4)-BigInt(116444736e5)))}function Sn(n,e){return n.getUint8(e)}function Ze(n,e){return n.getUint16(e,!0)}function Me(n,e){return n.getUint32(e,!0)}function Ti(n,e){return Number(n.getBigUint64(e,!0))}function tw(n,e,t){n.setUint32(e,t,!0)}function Te(n){return new DataView(n.buffer)}try{Ko({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ke&&ke.tagName.toUpperCase()==="SCRIPT"&&ke.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function nw(n){let e;n({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(r=>{const a=(r=(r+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,l=[];for(let c=0;a>c;c+=4){const h=St.indexOf(r[c])<<18|St.indexOf(r[c+1])<<12|(63&St.indexOf(r[c+2]))<<6|63&St.indexOf(r[c+3]);l.push(h>>16&255),r[c+2]!=="="&&l.push(h>>8&255),r[c+3]!=="="&&l.push(255&h)}return new Uint8Array(l)})(t);let i=new Uint8Array(1024),s=0;for(let r=0;r<t.length;){const a=t[r++];if(128&a){const l=3+(127&a),c=t[r++]<<8|t[r++],h=s-c;o(s+l);for(let u=0;l>u;u++)i[s++]=i[h+u]}else{const l=a;o(s+l);for(let c=0;l>c&&r<t.length;c++)i[s++]=t[r++]}}return(r=>{let a="";const l=r.length;let c=0;for(;l>c+2;c+=3){const u=r[c]<<16|r[c+1]<<8|r[c+2];a+=St[u>>18&63]+St[u>>12&63]+St[u>>6&63]+St[63&u]}const h=l-c;if(h===1){const u=r[c]<<16;a+=St[u>>18&63]+St[u>>12&63]+"=="}else if(h===2){const u=r[c]<<16|r[c+1]<<8;a+=St[u>>18&63]+St[u>>12&63]+St[u>>6&63]+"="}return a})(new Uint8Array(i.buffer.slice(0,s)));function o(r){if(i.length<r){let a=2*i.length;for(;r>a;)a*=2;const l=new Uint8Array(a);l.set(i.subarray(0,s)),i=l}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdiIAdiIBQQNxBIEAMgYBQX9zQQGAAB8GaiICQQN0gAAZDMwnaiIAIAEoAtQnIoAABgQIIgVGggBSCSADQX4gAndxNoACphEBCyAFIAA2AgwgACAFNgIIC4AASAMIaiGAAD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EBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Fe,Bi,Mt,Bs;function iw(n){if(Fe=n,{malloc:Bi,free:Mt,memory:Bs}=Fe,typeof Bi!="function"||typeof Mt!="function"||!Bs)throw Fe=Bi=Mt=Bs=null,new Error("Invalid WASM module")}function Qu(n,e,t={}){const i=typeof t.level=="number"?t.level:-1,s=typeof t.outBuffer=="number"?t.outBuffer:64*1024,o=typeof t.inBufferSize=="number"?t.inBufferSize:64*1024;return new TransformStream({start(){let r;if(this.out=Bi(s),this.in=Bi(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),n?(this._process=Fe.deflate_process,this._last_consumed=Fe.deflate_last_consumed,this._end=Fe.deflate_end,this.streamHandle=Fe.deflate_new(),e==="gzip"?r=Fe.deflate_init_gzip(this.streamHandle,i):e==="deflate-raw"?r=Fe.deflate_init_raw(this.streamHandle,i):r=Fe.deflate_init(this.streamHandle,i)):e==="deflate64-raw"?(this._process=Fe.inflate9_process,this._last_consumed=Fe.inflate9_last_consumed,this._end=Fe.inflate9_end,this.streamHandle=Fe.inflate9_new(),r=Fe.inflate9_init_raw(this.streamHandle)):(this._process=Fe.inflate_process,this._last_consumed=Fe.inflate_last_consumed,this._end=Fe.inflate_end,this.streamHandle=Fe.inflate_new(),e==="deflate-raw"?r=Fe.inflate_init_raw(this.streamHandle):e==="gzip"?r=Fe.inflate_init_gzip(this.streamHandle):r=Fe.inflate_init(this.streamHandle)),r!==0)throw new Error("init failed:"+r)},transform(r,a){try{const l=r,c=new Uint8Array(Bs.buffer),h=this._process,u=this._last_consumed,p=this.out,f=this._scratch;let m=0;for(;m<l.length;){const y=Math.min(l.length-m,32768);(!this.in||this.inBufferSize<y)&&(this.in&&Mt&&Mt(this.in),this.in=Bi(y),this.inBufferSize=y),c.set(l.subarray(m,m+y),this.in);const g=h(this.streamHandle,this.in,y,p,s,0),A=g&16777215;if(A&&(f.set(c.subarray(p,p+A),0),a.enqueue(f.slice(0,A))),!n){const C=g>>24&255,w=C&128?C-256:C;if(w<0)throw new Error("process error:"+w)}const v=u(this.streamHandle);if(v===0)break;m+=v}}catch(l){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Mt&&Mt(this.in),this.out&&Mt&&Mt(this.out),a.error(l)}},flush(r){try{const a=new Uint8Array(Bs.buffer),l=this._process,c=this.out,h=this._scratch;for(;;){const u=l(this.streamHandle,0,0,c,s,4),p=u&16777215,f=u>>24&255;if(!n){const m=f&128?f-256:f;if(m<0)throw new Error("process error:"+m)}if(p&&(h.set(a.subarray(c,c+p),0),r.enqueue(h.slice(0,p))),f===1||p===0)break}}catch(a){r.error(a)}finally{if(this._end&&this.streamHandle){const a=this._end(this.streamHandle);a!==0&&r.error(new Error("end error:"+a))}this.in&&Mt&&Mt(this.in),this.out&&Mt&&Mt(this.out)}}})}class sw{constructor(e="deflate",t){return Qu(!0,e,t)}}class ow{constructor(e="deflate",t){return Qu(!1,e,t)}}let zu=!1;async function rw(n,{baseURI:e}){if(!zu){let t,i;try{try{i=new URL(n,e)}catch{}t=await(await fetch(i)).arrayBuffer()}catch(o){if(n.startsWith("data:application/wasm;base64,"))t=aw(n);else throw o}const s=await WebAssembly.instantiate(t);iw(s.instance.exports),zu=!0}}function aw(n){const e=n.split(",")[1],t=atob(e),i=t.length,s=new Uint8Array(i);for(let o=0;o<i;++o)s[o]=t.charCodeAt(o);return s.buffer}let yl;nw(Ko),Xb({initModule:n=>{if(!yl){let{wasmURI:e}=n;typeof e==Xn&&(e=e()),yl=rw(e,n)}return yl}}),Ko({CompressionStreamZlib:sw,DecompressionStreamZlib:ow});const Al={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const n={};for(const e of Object.keys(Al))for(const t of Object.keys(Al[e])){const i=Al[e][t];if(typeof i=="string")n[i]=e+"/"+t;else for(let s=0;s<i.length;s++)n[i[s]]=e+"/"+t}return n})(),Ab(Ko);const lw="E84#E3C4!8C4&A1";async function Xt(n){try{const e=await fetch(n);if(!e.ok)return!1;const t=await e.blob();try{const i=new ml(new tr(t),{password:lw}),o=(await i.getEntries()).find(a=>!a.directory&&a.filename.endsWith(".json"));if(!o)return await i.close(),!1;const r=await o.getData(new hC);return await i.close(),JSON.parse(r.trim())}catch{const i=await t.text();try{return JSON.parse(i.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${n}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${n} ${e}`),!1}}function cw(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}class _s{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(i=>i(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(i=>i!==t))}}const Hu="35aa3175ce8b1a55331e.64c93d5e3268979d98c900",Yu=new WeakSet;async function $u(n,e){if(n)try{let t=null;if(typeof e=="string")t=document.querySelector(e);else if(e instanceof HTMLElement)t=e;else if(e&&typeof e=="object"){const o=e.container??e;o instanceof HTMLElement&&(t=o)}if(!t){console.warn("applyWatermark: 未提供有效容器,跳过水印添加");return}if(Yu.has(t))return;Yu.add(t);const{Watermark:i}=await Promise.resolve().then(()=>gR);await new i({content:n.content||"© 2026 晨曦雷霆BIM",fontFamily:n.font||"Arial, sans-serif",fontSize:n.fontSize?`${n.fontSize}px`:"25px",fontWeight:n.fontWeight||"bold",rotate:n.rotate??0,fontColor:n.color||"rgba(225, 225, 225, 1.0)",zIndex:n.zIndex??99999,parent:t,backgroundRepeat:"no-repeat",backgroundPosition:"center"}).create(),console.log("水印已添加")}catch(t){console.error("添加水印出错:",t)}}class ju{cesium;viewer;watermarkEnabled=!0;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new _s;options={flyTo:!0,flyToDuration:0,loadTreeNodeDetails:!0,loadTreeNodeDetailsUrl:"/elementInfo.zip",loadTree:!0,loadTreeUrl:"/allElementsInfo.zip",boxRegionUrl:"/BoundingBoxInfo.zip",regionUrl:"/region.zip",batchIDInfoUrl:"/batchIDInfo.zip",enabledSection:!0,delay:0,tilesetOptions:{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:32,skipLevelOfDetail:!0,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:128,skipLevels:5,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*10,preloadWhenHidden:!0,preferLeaves:!0,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.options.tilesetOptions&&(this.options.tilesetOptions.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE)}deleteAllModels(){const e=[];return Object.keys(this.mapTileset).forEach(t=>{const i=this.mapTileset[t];i&&(this.viewer.scene.primitives.remove(i),e.push(t)),delete this.mapTileset[t],delete this.hasLoaded3dTiles[t],delete this.mapRecordModelId[t]}),this.modelList=[],this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:[]}),e}deleteModels(e){const t=[];return e.forEach(({modelId:i})=>{const s=this.mapTileset[i];s&&(this.viewer.scene.primitives.remove(s),t.push(i)),delete this.mapTileset[i],delete this.hasLoaded3dTiles[i],delete this.mapRecordModelId[i]}),this.modelList=this.modelList.filter(i=>!t.includes(i.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(i=>{const s=`${i.modelId}`,o=this.mapTileset[s];o&&(o.show=!!i.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:i}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,i)}async add3DTilesModel(e,t){const i=t?Nv({},this.options,t):{...this.options};if(e?.length){for(const s of e){const o=`${s.modelId}`;if(this.mapRecordModelId[o])continue;const r=`${s.outPutPath}${s.dbName}/tileset.json`;this.modelList.push({...s,url:r,state:Ii.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(i)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===Ii.NotLoaded);if(!t.length)return;const i=t.length;this.events.emit("loadingStatus",`正在加载 ${i} 个模型`);let s=0,o=!1;if(t.length>0){const r=t[0],a=`${r.outPutPath}${r.dbName}/config.zip`;try{const l=await Xt(a);l&&typeof l=="object"&&this.events.emit("configureLoaded",l)}catch{}}for(const r of t){s++;try{r.state=Ii.Loading;const a=r.url,l=this.getBaseUrlPath(a);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}构件信息`);let c=e.loadTreeNodeDetails?await Xt(`${l}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await Xt(`${l}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}模型数据`);const u=e.boxRegionUrl?await Xt(`${l}${e.boxRegionUrl}`):!1,p=e.batchIDInfoUrl?await Xt(`${l}${e.batchIDInfoUrl}`):!1;p&&(c||(c=p));const f=await this.loadTilesetWithZipSupport(a,r.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(f),await f.readyPromise;const m=`${f?.asset?.tilesetVersion??r.modelId}`;this.mapTileset[`${r.modelId}`]=f;const y={versionId:m,selectedFn:e.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:r.url,treeUrl:`${l}${e.loadTreeUrl}`,nodeUrl:`${l}${e.loadTreeNodeDetailsUrl}`,formData:r.formData,type:"BIM"},node:c||null,tree:h||null,box:null};if(u?.min&&u?.max){const g={x:u.min.X,y:u.min.Y,z:u.min.Z},A={x:u.max.X,y:u.max.Y,z:u.max.Z},v={x:(g.x+A.x)/2,y:(g.y+A.y)/2,z:(g.z+A.z)/2};y.box={min:g,max:A,center:v}}if(!r.formData){const g=await Xt(`${r.outPutPath}${r.dbName}${e.regionUrl}`);if(g)r.formData={modelId:r.modelId.toString(),longitude:g.Longitude,latitude:g.Latitude,distance:1e-6,rotation:30,totalRotation:g.DAngle||0,height:g.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:g?.X||0,Y:g?.Y||0,Z:g?.Z||0};else{const A=t.indexOf(r);r.formData={modelId:r.modelId.toString(),longitude:118.12548706388897,latitude:24.596796919444404,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:0,lonlat:1e-5,modelOptions:[{value:A+1,label:r.modelName}],X:0,Y:0,Z:0}}}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1,y.model.formData=r.formData),f.leiting=y,Xa({Cesium:this.cesium,tileset:f}),r.state=Ii.Loaded,this.mapRecordModelId[r.modelId]=!0,this.events.emit("tilesetLoaded",f),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(f),!o&&e.flyTo&&(this.BIMmodelId=r.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),o=!0),e.delay&&await new Promise(g=>setTimeout(g,e.delay))}catch(a){console.error(`模型 ${r.modelName} 加载失败:`,a),this.events.emit("loadingStatus",`模型 ${r.modelName} 加载失败`),r.state=Ii.Error}}e.mountAll3Dtiles&&e.mountAll3Dtiles(this.modelList),e.onMountAll3Dtiles&&e.onMountAll3Dtiles(this.modelList),this.events.emit("loadingStatus",""),this.events.emit("mountAll3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset})}async addOSGB({files:e,options:t}){const i=this.cesium;if(!e?.length)return;this.events.emit("loadingStatus",`正在加载 ${e.length} 个倾斜摄影模型`);let s=!1,o=0;for(const r of e){o++,this.events.emit("loadingStatus",`正在加载第 ${o}/${e.length} 个模型: 加载${r.modelName}`);try{const{outPutPath:a,dbName:l,modelId:c}=r,u=`${/^https?:\/\//i.test(a)?a:`${window.location.origin}${a}`}${l}/tileset.json`,p=await i.Cesium3DTileset.fromUrl(u,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(p.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(p),await p.readyPromise,this.mapTileset[`${c}`]=p,this.hasLoaded3dTiles[`${c}`]=(this.hasLoaded3dTiles[`${c}`]||0)+1,this.mapRecordModelId[`${c}`]=!0,!r?.formData){const f=p.root.computedTransform;if(f){const m=i.Matrix4.fromColumnMajorArray(f),y=i.Matrix4.getTranslation(m,new i.Cartesian3),g=i.Ellipsoid.WGS84.cartesianToCartographic(y),A=i.Math.toDegrees(g.longitude),v=i.Math.toDegrees(g.latitude),C=g.height;r.formData={modelId:r.modelId.toString(),longitude:A,latitude:v,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:C,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:0,Y:0,Z:0}}else console.warn(`OSGB模型 ${c} 无法获取初始位置信息`)}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1),p.leiting={versionId:`${p?.asset?.tilesetVersion??c}`,selectedFn:t?.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:u,formData:r.formData,type:"OSGB"},box:null},Xa({Cesium:this.cesium,tileset:p}),this.modelList.push({...r,url:u,state:Ii.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=r.modelId,this.viewer.zoomTo(p),s=!0)}catch(a){console.error(`OSGB模型 ${r.dbName} 加载失败:`,a);continue}}this.events.emit("loadingStatus",""),this.events.emit("onMountAllOsgb3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset}),t?.onMountAllOsgb3Dtiles(this.modelList)}updateOSGBMatrix(e){const{X:t,Y:i,Z:s,modelId:o}=e,r=this.cesium,a=this.mapTileset[o];if(!a){console.warn("tileSet not found for modelId:",o);return}let l=t||0,c=i||0,h=s||0;const u=a.boundingSphere.center,p=r.Transforms.eastNorthUpToFixedFrame(u),f=new r.Cartesian3(l,c,h),m=r.Matrix4.multiplyByPoint(p,f,new r.Cartesian3(0,0,0)),y=r.Cartesian3.subtract(m,u,new r.Cartesian3);a.modelMatrix=r.Matrix4.fromTranslation(y)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:o,cancel:r,...a}=t,l={duration:0,...a};this.viewer.flyTo(s,l).then(c=>{c?o&&o():r&&r()}).catch(c=>{r&&r(),console.error("FlyTo error",c)})}getMapTileset(){return this.mapTileset}getBIMmodelId(){return this.BIMmodelId}getModelList(){return this.modelList}setMapTileset(e){this.mapTileset=e}setBIMmodelId(e){this.BIMmodelId=e}setModelList(e){this.modelList=e}getBaseUrlPath(e){const t=/^https?:\/\//i.test(e)?e:`${window.location.origin}${e}`,i=t.lastIndexOf("/");return i===-1?".":t.substr(0,i)}async loadTilesetWithZipSupport(e,t,i,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`);if((await fetch(o,{method:"HEAD"})).status===200){const l=await Xt(o);if(l){l?.asset?.watermark&&this.watermarkEnabled&&$u(l.asset.watermark,this.viewer?.container);const c=this.getBaseUrlPath(e),h=f=>{!f||typeof f!="object"||(typeof f.uri=="string"&&!/^(data:|https?:\/\/)/i.test(f.uri)&&(f.uri=encodeURI(`${c}/${f.uri.replace(/^\.?\//,"")}`)),Object.values(f).forEach(m=>{if(Array.isArray(m)){m.forEach(y=>h(y));return}m&&typeof m=="object"&&h(m)}))};h(l);const u=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(l))))}`,p=new s.Resource({url:u});try{return await s.Cesium3DTileset.fromUrl(p,{id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const i=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${i} 目录树...`);try{if(s){const r=await Xt(s);if(Ho(r)&&r[0].name&&(r[0].name=i),r)return t.leiting.tree=r,r}}catch(r){console.error(`Failed to load tree for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async _loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Xt(i);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Xt(i);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}}const Wu={normal:0,process:2},dw={color:1};function qu(n){return n===1||n==="exist"?1:n===2||n==="process"?2:0}function _i(n){return Number.isNaN(n)?0:n<=1?Math.min(Math.max(n,0),1):Math.min(Math.max(n/255,0),1)}function Ku(n){return Number.isNaN(n)?1:n<=1?Math.min(Math.max(n,0),1):1}function vl(n){if(!n)return null;const e=Number(n.r),t=Number(n.g),i=Number(n.b),s=n.a===void 0?1:Number(n.a);if([e,t,i,s].some(l=>Number.isNaN(l)))return null;const o=Math.round(e*255),r=Math.round(t*255),a=Math.round(i*255);return`rgba(${o},${r},${a},${s})`}function hw(n){if(!n||typeof n!="string")return null;const t=n.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const i=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[i,s,o,r].some(a=>Number.isNaN(a))?null:{r:Math.min(Math.max(i/255,0),1),g:Math.min(Math.max(s/255,0),1),b:Math.min(Math.max(o/255,0),1),a:Math.min(Math.max(r,0),1)}}function uw(n){if(n==null)return null;const e=Number(n);return Number.isNaN(e)?null:e}function fw(n){const e=n.lastIndexOf("-"),t=n.substring(0,e),i=n.substring(e+1);return[t,i]}function bl(n){if(!n)return null;const e=n.Min??n.min,t=n.Max??n.max;if(!e||!t)return null;const i=Number(e.x??e.X),s=Number(e.y??e.Y),o=Number(e.z??e.Z),r=Number(t.x??t.X),a=Number(t.y??t.Y),l=Number(t.z??t.Z);return[i,s,o,r,a,l].some(c=>Number.isNaN(c))?null:{min:{x:i,y:s,z:o},max:{x:r,y:a,z:l}}}function ks(n,e){if(e)return`${e}`;const t=n?.leiting?.model?.modelId??n?.modelId??n?.id;return t==null?null:`${t}`}function pw(n,e){if(e==null)return null;const t=n?.leiting?.node;if(!t)return null;const i=`${e}`,s=t?.[i],o=bl(s?.box3??s?.box);if(o)return o;const r=t?.element?.[i]??t?.elements?.[i]??t?.nodeExtras?.element?.[i]??t?.nodeExtras?.elements?.[i];return bl(r?.box3??r?.box)}function mw(n){const e=n?.leiting?.box;return e?bl({min:e.min,max:e.max}):null}class gw{base;constructor(e){this.base=e}initTime(){const t=this.base.cesium.JulianDate.fromDate(new Date(2023,3,21,10,0));this.base.viewer.clock.currentTime=t,this.base.start=this.base.viewer.clock.currentTime.secondsOfDay*1e3}processAnimation(e,t,i,s=null){if(this.base.start==null)return;const o=this.base.start+(e?.delay??0),r=this.base.start+(e?.playtime??0)+(e?.delay??0);t<=o&&(e.cash=!0,e.groupData.forEach(a=>{const{batchIds:l,modelId:c,rgba:h}=a;if(Array.isArray(l)&&l[0]){l[0][1]=h;const u=i[c];u?u.push(l[0]):i[c]=[l[0]]}})),t>=o&&t<r&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(a=>{const{batchIds:l,playTimeColor:c,modelId:h}=a;if(Array.isArray(l)&&l[0]){l[0][1]=c;const u=i[h];u?u.push(l[0]):i[h]=[l[0]]}})),t>=r&&(e.finished=!0)}onTick=e=>{if(!this.base.cesium||!this.base.viewer)return;const t=e?.currentTime?.secondsOfDay?e.currentTime.secondsOfDay*1e3:this.base.viewer.clock.currentTime.secondsOfDay*1e3,i={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,i,.1)});const s=Object.entries(i);if(s.forEach(([o,r])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:r})}),Object.keys(this.base.mapAnimations).forEach(o=>{const r=this.base.mapAnimations[o];r.length&&r.every(a=>a.finished)&&!this.base.clearedModelIds.has(o)&&(this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:[]}),this.base.clearedModelIds.add(o))}),this.base.recoverStaus){s.length&&(this.base.recoverStaus=!1);return}s.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(o=>{o.groupData.forEach(r=>{const{modelId:a}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:a,batchIds:[]})}),this.base.recoverStaus=!0})};enableConstructionProgressTracking(){this.base.clearedModelIds.clear(),this.initTime(),this.base.groupBatchIds={},Array.isArray(this.base.data)&&(this.base.data.forEach(e=>{e.cash=!1,e.playCash=!1,e.groupData.forEach(t=>{const{batchIds:i,modelId:s,rgba:o}=t;if(Array.isArray(i)&&i[0]){i[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(i[0]):this.base.groupBatchIds[s]=[i[0]]}})}),Object.entries(this.base.groupBatchIds).forEach(([e,t])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t})})),this.base.viewer.clock.onTick.addEventListener(this.onTick)}disableConstructionProgressTracking(){this.base.viewer.clock.onTick.removeEventListener(this.onTick),this.base.viewer.scene.ambientLightIntensity=1,Array.isArray(this.base.data)&&this.base.data.forEach(e=>{e.cash=!0,e.playCash=!0,e.groupData.forEach(t=>{const{modelId:i}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:i,batchIds:s})})}),this.base.start=null}freshConstructionProgressTracking(){const e=this.base.viewer.clock.currentTime.secondsOfDay*1e3,t={};Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.playCash=!1,this.processAnimation(s,e,t)});const i=Object.entries(t);i.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),i.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.groupData.forEach(o=>{const{modelId:r}=o;this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:[]})})})}reStartAnimation(){let e={};this.base.clearedModelIds.clear(),Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData.forEach(i=>{const{batchIds:s,modelId:o,rgba:r}=i;if(Array.isArray(s)&&s[0]){s[0][1]=r;const a=e[o];a?a.push(s[0]):e[o]=[s[0]]}})}),Object.entries(e).forEach(([t,i])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:i})}),this.initTime()}setAllConstructionProgressTracking(e){this.base.data=e,Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData=[],t.finished=!1,t.mergeCpts.forEach(i=>{const s=[];i.cpts.forEach(l=>{s.push({dbName:i.linkModelId,modelId:i.modelId,elementId:`${l}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=Wu.process,r=dw.color,{allElements:a}=this.base.groupByModelId(s);this.base.mapAnimations[i.modelId]=this.base.mapAnimations[i.modelId]||[],this.base.mapAnimations[i.modelId].push(t),Object.entries(a).forEach(([l,c])=>{const[h,u]=fw(l),p=this.base.getTileSyltByConstructionProcessTracking({elementIds:c,modelId:h,color:u,colorRank:o,show:!0,selectionRank:r}),f=t?.playTimeColor?.r??1,m=t?.playTimeColor?.g??1,y=t?.playTimeColor?.b??0,g=t?.playTimeColor?.a??.1,A=this.base.setColor({r:f,g:m,b:y,a:g}),v=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:p,playTimeColor:A,rgba:v})})})})}}class yw{base;constructor(e){this.base=e}attachTileset(e,t,i){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=ks(e,i);o&&(this.base.tilesetMap[o]=e),t&&(this.base.selectedColor=t),this.bindInputs()}bindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.setInputAction(async t=>{if(!this.base.clickToHighlightEnabled){await this.base.clearSelection();return}let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=ks(i.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(i);if(o==="-1")return;let r;const a=this.base.viewer.scene.pickPosition(t.position);if(e.defined(a)){const h=e.Cartographic.fromCartesian(a),u=e.Math.toDegrees(h.longitude),p=e.Math.toDegrees(h.latitude),f=h.height;r=[u,p,f]}const c=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...c,{batchId:o,selectedColor:this.base.selectedColor,rank:0,point:r,isTrigger:!0}],this.base.setBaseStyle(s),await this.base.triggerSelectionChange(s),i.tileset.leiting?.selectedFn)if(i.tileset.leiting.node){const h=i.tileset.leiting.node.batchIdEIDInfos[o].elementID,u=i.tileset.leiting.node.nodeExtras.element[h];u.elementId=h,u.modelId=i.tileset.leiting.model.modelId,i.tileset.leiting.selectedFn({elementInfo:u,elementId:h,point:r,modelId:i.tileset.leiting.model.modelId,_propsData:u})}else i.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){const s=ks(i.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(i);if(o==="-1")return;let r;const a=this.base.viewer.scene.pickPosition(t.position);if(e.defined(a)){const l=e.Cartographic.fromCartesian(a),c=e.Math.toDegrees(l.longitude),h=e.Math.toDegrees(l.latitude),u=l.height;r=[c,h,u]}await this.base.toggleMultiSelect(s,o,this.base.selectedColor,r)}},e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{this.base.ensureSelectionDiv();const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:i.enableRotate,enableTilt:i.enableTilt,enableLook:i.enableLook},i.enableRotate=!1,i.enableTilt=!1,i.enableLook=!1),this.base.selectStart=this.base.cesium.Cartesian2.clone(t.position),this.base.selectEnd=null,this.base.selectionDiv&&this.base.selectStart&&(this.base.selectionDiv.style.left=`${this.base.selectStart.x}px`,this.base.selectionDiv.style.top=`${this.base.selectStart.y}px`,this.base.selectionDiv.style.width="0px",this.base.selectionDiv.style.height="0px",this.base.selectionDiv.style.display="block")},e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{if(!this.base.selectStart||!this.base.selectionDiv)return;const i=performance.now();if(i-this.base.lastDrawTime<20)return;this.base.lastDrawTime=i,this.base.selectEnd=this.base.cesium.Cartesian2.clone(t.endPosition);const s=Math.min(this.base.selectStart.x,this.base.selectEnd.x),o=Math.min(this.base.selectStart.y,this.base.selectEnd.y),r=Math.abs(this.base.selectStart.x-this.base.selectEnd.x),a=Math.abs(this.base.selectStart.y-this.base.selectEnd.y);this.base.selectionDiv.style.left=`${s}px`,this.base.selectionDiv.style.top=`${o}px`,this.base.selectionDiv.style.width=`${r}px`,this.base.selectionDiv.style.height=`${a}px`,this.base.selectionDiv.style.backgroundColor="rgba(0, 255, 255, 0.5)",this.base.selectionDiv.style.position="absolute",this.base.selectionDiv.style.zIndex="2"},e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(async()=>{if(!this.base.selectStart||!this.base.selectionDiv)return;if(!this.base.selectStart||!this.base.selectEnd){this.base.selectionDiv.style.display="none";const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState!==null&&(i.enableRotate=this.base.cameraControllerState.enableRotate,i.enableTilt=this.base.cameraControllerState.enableTilt,i.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null);return}this.base.selectionDiv.style.display="none",await this.base.selectTilesInRectangle(this.base.selectStart,this.base.selectEnd,this.base.selectedColor),this.base.viewer.scene.requestRender(),this.base.selectStart=null,this.base.selectEnd=null;const t=this.base.viewer?.scene?.screenSpaceCameraController;t&&this.base.cameraControllerState!==null&&(t.enableRotate=this.base.cameraControllerState.enableRotate,t.enableTilt=this.base.cameraControllerState.enableTilt,t.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null)},e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}unbindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}}class Aw{cesium;viewer;data;handler;selectedColor="rgba(255,0,0,1.0)";tilesetMap={};hasSelectedFeaturesMap={};colorRankColor=[];showStateMap={};selectedPosition={x:null,y:null};selectionDiv=null;lastDrawTime=0;selectStart=null;selectEnd=null;cameraControllerState=null;start=null;groupBatchIds={};recoverStaus=!1;mapAnimations={};clearedModelIds=new Set;eidToBatchIdMap={};batchIdToElementIdMap={};animationModule;selectionModule;onSelectionChangeCallbacks=[];loadNodeDetailsForModel;loadNodeDetailsCallback;clickToHighlightEnabled=!0;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.animationModule=new gw(this),this.selectionModule=new yw(this)}attachTileset(e,t,i){this.selectionModule.attachTileset(e,t,i)}setLoadNodeDetailsCallback(e){this.loadNodeDetailsCallback=e}selectionChange(e){e&&typeof e=="function"&&this.onSelectionChangeCallbacks.push(e)}removeSelectionChange(e){this.onSelectionChangeCallbacks=this.onSelectionChangeCallbacks.filter(t=>t!==e)}async triggerSelectionChange(e){if(e)await this.loadNodeDetailsForModel(e);else{const t=Object.keys(this.hasSelectedFeaturesMap);t.length>0&&await Promise.all(t.map(i=>{try{return this.loadNodeDetailsForModel(i)}catch(s){return console.error(`Error loading node details for model ${i}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(i=>{try{i(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}async clearAllHaveSelected(){this.getTargetModelIds().forEach(t=>{this.hasSelectedFeaturesMap[t]&&(delete this.hasSelectedFeaturesMap[t],this.applyShowStyleOnly(t))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange()}async loadAllNodeDetailsForModel(){for(const e of Object.keys(this.tilesetMap))await this.loadNodeDetailsForModel(e)}getSelected(e){const t=e&&typeof e=="object"&&"rank"in e?e.rank:e,i=qu(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(a=>{if(a.rank!==i)return;const l=hw(a.selectedColor);let c=this.getBatchIdToElementIdSync(a.batchId,o);c===null&&(c=a.batchId),a.isTrigger&&s.push({elementId:c,modelId:o,rgba:l||void 0,point:a?.point||void 0})});return s}getBatchIdToElementIdSync(e,t){if(this.batchIdToElementIdMap[t])return this.batchIdToElementIdMap[t].get(e)??null;const s=this.tilesetMap[t]?.leiting?.node?.batchIdEIDInfos;if(s&&Array.isArray(s)){const o=new Map;return s.forEach(r=>{r&&r.elementID&&o.set(`${r.batchId}`,`${r.elementID}`)}),this.batchIdToElementIdMap[t]=o,o.get(e)??null}return null}setAllConstructionProgressTracking(e){this.animationModule.setAllConstructionProgressTracking(e)}initTime(){this.animationModule.initTime()}processAnimation(e,t,i,s=null){this.animationModule.processAnimation(e,t,i,s)}onTick=e=>{this.animationModule.onTick(e)};enableConstructionProgressTracking(){this.animationModule.enableConstructionProgressTracking()}disableConstructionProgressTracking(){this.animationModule.disableConstructionProgressTracking()}freshConstructionProgressTracking(){this.animationModule.freshConstructionProgressTracking()}reStartAnimation(){this.animationModule.reStartAnimation()}setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t}){const i=this.tilesetMap[e];if(!i)return;const s=i?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?i.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):i.style=new this.cesium.Cesium3DTileStyle({color:{conditions:t}}):this.applyShowStyleOnly(e),this.viewer.scene.requestRender()}resumeFlyTo(){this.viewer.clock.shouldAnimate=!0}pauseFlyTo(){this.viewer.clock.shouldAnimate=!1}async flyToObjects({selectCpts:e,options:t}){if(!Array.isArray(e)||e.length===0)return;await this.clearSelection(),await this.setSelectColorUserModelCpt(e,{rank:0});const i=this.cesium,s=t?.scale??1,o=[];for(const r of e){const a=r?.modelId;if(a==null)continue;await this.loadNodeDetailsForModel(a);const l=r?.elementId,c=this.tilesetMap[`${a}`];if(!c)continue;const u=pw(c,l)||mw(c);if(!u)continue;const p=new i.Cartesian3(u.min.x,u.min.y,u.min.z),f=new i.Cartesian3(u.max.x,u.max.y,u.max.z),m=c?.root?.computedTransform??c?.modelMatrix;if(m){const y=i.Matrix4.multiplyByPoint(m,p,new i.Cartesian3),g=i.Matrix4.multiplyByPoint(m,f,new i.Cartesian3);o.push(y,g)}else o.push(p,f)}if(o.length){const r=i.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const a=this.viewer.scene.camera,l=new i.HeadingPitchRange(a.heading,a.pitch,0);a.flyToBoundingSphere(r,{duration:t?.duration??0,complete:t?.complete,offset:l})}else{const r=e[0]?.modelId,a=r?this.tilesetMap[`${r}`]:null;a&&this.viewer.flyTo(a,{duration:t?.duration??0,complete:t?.complete})}}setBaseStyle(e){this.getTargetModelIds(e).forEach(i=>{this.setColorStyle(i)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],i=this.hasSelectedFeaturesMap[e];if(!t||!i?.length)return;const s=new Map;i.forEach(l=>{const c=s.get(l.batchId);(!c||l.rank>=c.rank)&&s.set(l.batchId,l)});const o=new Map;if(s.forEach(({batchId:l,selectedColor:c})=>{o.has(c)||o.set(c,new Set),o.get(c)?.add(l)}),this.colorRankColor.length){const l=new Set;this.colorRankColor.forEach(c=>{const h=o.get(c);h&&h.forEach(u=>l.add(u))}),o.forEach((c,h)=>{if(this.colorRankColor.includes(h))return;const u=new Set;c.forEach(p=>{l.has(p)||u.add(p)}),o.set(h,u)})}const r=[...this.colorRankColor.filter(l=>o.has(l)),...Array.from(o.keys()).filter(l=>!this.colorRankColor.includes(l))],a=[];return r.forEach(l=>{const c=o.get(l);if(!c||!c.size)return;const h=Array.from(c).join("|");h&&a.push([`(regExp('^(${h})$').test(\${id}))`,l])}),a.length?a:void 0}updateTilesetStyle(e){const t=this.tilesetMap[e];if(!t)return;t.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0,o=this.buildColorConditions(e);s||o?t.style=new this.cesium.Cesium3DTileStyle({show:s?{conditions:s}:void 0,color:o?{conditions:o}:void 0}):t.style=void 0,this.viewer.scene.requestRender()}setShowStyle(e){this.getTargetModelIds(e?.modelId).forEach(i=>{const s=this.showStateMap[i]||{batchIds:[],mode:"include"};this.showStateMap[i]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(i)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=_i(Number(e.r)),i=_i(Number(e.g)),s=_i(Number(e.b)),o=Ku(e.a===void 0?1:Number(e.a));return vl({r:t,g:i,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(i=>{const s=i?.modelId,o=i?.elementId;if(s==null||o===void 0||o===null)return;const r=i?.color??i?.rgba,a=this.setColor(r??{r:.4,g:.4,b:.4,a:.1}),l=`${s}-${a}`;t[l]||(t[l]=[]),t[l].push(`${o}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const i=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[i]){const l=this.eidToBatchIdMap[i].get(s);if(l!==void 0)return l}const r=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(r&&Array.isArray(r)){const l=new Map;r.forEach(h=>{const u=`${h.elementID}`,p=`${h.batchId}`;l.has(u)||l.set(u,[]),l.get(u).push(p)}),this.eidToBatchIdMap[i]=l;const c=l.get(s);if(c!==void 0)return c}const a=uw(e);return a!=null?[String(a)]:[]}async setComponentVisibility(e){if(Array.isArray(e)){Object.keys(this.showStateMap).forEach(t=>{this.showStateMap[t]={batchIds:[],mode:"exclude"}});for(const t of e){const i=`${t.modelId}`;this.showStateMap[i]||(this.showStateMap[i]={batchIds:[],mode:"exclude"});const s=this.showStateMap[i];if(!t.show){const o=this.getBatchIds(t.elementId,i);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(i=>{const s=`${i.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${i.elementId}`)});for(const i of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(i);const o=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[i]={batchIds:[],mode:"exclude"};const r=t[i];if(r&&r.size>0){const a=[];for(const l of o)r.has(`${l.elementID}`)||a.push(`${l.batchId}`);this.showStateMap[i].batchIds=a;continue}this.showStateMap[i].batchIds=o.map(a=>a.batchId)}Object.keys(this.showStateMap).forEach(i=>{this.updateTilesetStyle(i)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const i of t)await this.loadNodeDetailsForModel(i),e?this.setShowStyle({modelId:i,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:i,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),i=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const a=r.leiting.node.batchIdEIDInfos,l=new Set(o?.batchIds??[]),c=o?.mode??"exclude",h=new Set;a.forEach(u=>{const p=l.has(`${u.batchId}`);if((c==="include"?p:!p)===e){const m=`${u.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const i=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const a=r.leiting.node.batchIdEIDInfos,l=new Set(o?.batchIds??[]),c=o?.mode??"exclude",h=new Set;a.forEach(u=>{const p=l.has(`${u.batchId}`);if((c==="include"?p:!p)===e){const m=`${u.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:i,colorRank:s,show:o,selectionRank:r}){const a=this.tilesetMap[t];if(!Array.isArray(e))return[];const l=a.leiting.node,c=new Set(e),h=l.batchIdEIDInfos.filter(p=>c.has(`${p.elementID}`)).map(p=>String(p.batchId));return h.length?(s===Wu.normal&&!this.colorRankColor.includes(i)&&(this.colorRankColor=[i]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,i]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const i=new Map,s=t?.rank===void 0?"exist":t?.rank,o=qu(s),r=t?.isTrigger??!0;for(const a of e){const l=a?.modelId;if(l==null)continue;const c=`${l}`;await this.loadNodeDetailsForModel(c);const h=Array.isArray(a?.elementIds)?a.elementIds:a?.elementId?[a.elementId]:[];if(!h.length)continue;const u=vl(a?.rgba)||this.selectedColor;for(const p of h){const f=this.getBatchIds(p,c);if(f.length!==0){i.has(c)||i.set(c,[]);for(const m of f)i.get(c)?.push({batchId:m,selectedColor:u,rank:o,isTrigger:r})}}}for(const[a,l]of i){const c=this.mergeSelections(a,l);this.hasSelectedFeaturesMap[a]=c,this.setBaseStyle(a)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:i,rgba:s}=e,o=t?.isTrigger??!0;if(!i)return;await this.loadNodeDetailsForModel(i);const r=String(i),a=this.tilesetMap[r];if(!a)return;const l=a?.leiting?.node?.batchIdEIDInfos;if(!l||!Array.isArray(l))return;const c=[];l.forEach(h=>{h&&h.elementID!==void 0&&c.push(h.elementID)}),c.length!==0&&await this.setSelectColorUserModelCpt([{modelId:r,elementIds:c,rgba:s}],{rank:0,isTrigger:o})}getFeatureId(e){if(this.cesium.defined(e)&&this.cesium.defined(e.getProperty)){const t=e.getProperty("id");return t!=null?String(t):"-1"}return"-1"}getTargetModelIds(e){return e?[e]:Object.keys(this.tilesetMap)}buildShowConditions(e,t){const i=e.join("|");return i?t==="include"?[[`(regExp('^(${i})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${i})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,i,s=1){const o=_i(e),r=_i(t),a=_i(i),l=Ku(s),c=vl({r:o,g:r,b:a,a:l});c&&(this.selectedColor=c)}mergeSelections(e,t){const i=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>i.set(o.batchId,o)),t.forEach(o=>{const r=i.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&i.set(o.batchId,o)}),Array.from(i.values())}async toggleMultiSelect(e,t,i,s){const o=this.hasSelectedFeaturesMap[e]||[],r=o.filter(u=>u.rank!==0),a=o.filter(u=>u.rank===0),c=a.some(u=>u.batchId===t)?a.filter(u=>u.batchId!==t):[...a,{batchId:t,selectedColor:i,rank:0,point:s,isTrigger:!0}],h=[...r,...c];h.length?(this.hasSelectedFeaturesMap[e]=h,this.setBaseStyle(e)):(delete this.hasSelectedFeaturesMap[e],this.applyShowStyleOnly(e)),await this.triggerSelectionChange(e)}ensureSelectionDiv(){if(this.selectionDiv)return;const e=document.createElement("div");e.style.display="none",e.style.pointerEvents="none",e.style.border="1px solid rgba(0, 255, 255, 0.8)",this.viewer.container.appendChild(e),this.selectionDiv=e}isRepeatedClick(e){const t=e?.position;return!t||typeof t.x!="number"||typeof t.y!="number"?!1:this.selectedPosition.x===t.x&&this.selectedPosition.y===t.y?!0:(this.selectedPosition.x=t.x,this.selectedPosition.y=t.y,!1)}async selectTilesInRectangle(e,t,i){const s=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),a=Math.max(e.y,t.y),l=o-s,c=a-r;if(Math.abs(l)<15||Math.abs(c)<15)return;const h=s+l/2,u=r+c/2,p=new this.cesium.Cartesian2(h,u),f=this.viewer.scene.drillPick(p,void 0,l,c);if(!Array.isArray(f))return;const m=new Map;f.forEach(y=>{if(!(y instanceof this.cesium.Cesium3DTileFeature))return;const g=ks(y.tileset);if(!g||!this.tilesetMap[g])return;const A=this.getFeatureId(y);A!=="-1"&&(m.has(g)||m.set(g,new Set),m.get(g)?.add(A))}),m.forEach((y,g)=>{const A=this.hasSelectedFeaturesMap[g]||[],v=A.filter(x=>x.rank!==0),C=new Set(A.filter(x=>x.rank===0).map(x=>x.batchId)),w=[];y.forEach(x=>{C.has(x)||w.push({batchId:x,selectedColor:i,rank:0,isTrigger:!0})});const S=A.filter(x=>x.rank===0);this.hasSelectedFeaturesMap[g]=[...v,...S,...w],this.setBaseStyle(g)}),await this.triggerSelectionChange()}}class vw{cesium;viewer;tilesetMap={};planeEntities=[];clippingPlanesMap={};activeModelIds=new Set;boxMatrix=null;boxInverseMatrix=null;boxCenter=null;boxOrientation=null;targetZPlus=0;targetZMinus=0;targetXPlus=0;targetXMinus=0;targetYPlus=0;targetYMinus=0;currentPlaneType="";selectedPlane=null;hoveredPlane=null;dragStartPoint=null;moveCallBack=null;downHandler=null;upHandler=null;moveHandler=null;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}attachTileset(e,t){this.tilesetMap[t]=e}open(e,t){!this.tilesetMap[e]||this.activeModelIds.has(e)||(this.activeModelIds.add(e),this.moveCallBack=t?.moveCallBack,this.fitToModels(),this.activeModelIds.size===1&&(this.createPlaneEntities(),this.initEventHandlers()))}setupClippingPlanes(e){const t=this.cesium,i=this.tilesetMap[e];if(!i||!this.boxMatrix)return;const s=new t.ClippingPlaneCollection({planes:[new t.ClippingPlane(new t.Cartesian3(1,0,0),this.targetXMinus),new t.ClippingPlane(new t.Cartesian3(-1,0,0),this.targetXPlus),new t.ClippingPlane(new t.Cartesian3(0,1,0),this.targetYMinus),new t.ClippingPlane(new t.Cartesian3(0,-1,0),this.targetYPlus),new t.ClippingPlane(new t.Cartesian3(0,0,1),this.targetZMinus),new t.ClippingPlane(new t.Cartesian3(0,0,-1),this.targetZPlus)],edgeWidth:2,edgeColor:t.Color.WHITE,enabled:!0,unionClippingRegions:!0}),o=t.Matrix4.inverse(i.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),i.clippingPlanes=s,this.clippingPlanesMap[e]=s}createPlaneEntities(){const e=this.cesium,t=this.viewer;this.planeEntities.forEach(s=>t.entities.remove(s)),this.planeEntities=[];const i=["left","right","behind","front","top","down"];for(const s of i){const o=t.entities.add({name:s,position:new e.CallbackProperty(()=>{if(!this.boxMatrix)return e.Cartesian3.ZERO;const r=this.getPlaneOffsetCartesian(s);return e.Matrix4.multiplyByPoint(this.boxMatrix,r,new e.Cartesian3)},!1),orientation:new e.CallbackProperty(()=>this.boxOrientation||e.Quaternion.IDENTITY,!1),plane:{dimensions:new e.CallbackProperty(()=>{if(this.activeModelIds.size===0)return new e.Cartesian2(0,0);const r=.1,a=Math.max(r,this.targetXMinus+this.targetXPlus),l=Math.max(r,this.targetYPlus+this.targetYMinus),c=Math.max(r,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(a,l):s==="left"||s==="right"?new e.Cartesian2(l,c):new e.Cartesian2(a,c)},!1),material:e.Color.WHITE.withAlpha(.1),outline:!0,outlineColor:e.Color.YELLOW,plane:new e.CallbackProperty(()=>new e.Plane(this.getNormalByType(s),0),!1)}});this.planeEntities.push(o)}}getPlaneOffsetCartesian(e){const t=(this.targetXPlus-this.targetXMinus)/2,i=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,i,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,i,s);case"behind":return new this.cesium.Cartesian3(t,-this.targetYMinus,s);case"front":return new this.cesium.Cartesian3(t,this.targetYPlus,s);case"top":return new this.cesium.Cartesian3(t,i,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,i,-this.targetZMinus);default:return this.cesium.Cartesian3.ZERO}}getNormalByType(e){const t=this.cesium;switch(e){case"left":return new t.Cartesian3(1,0,0);case"right":return new t.Cartesian3(-1,0,0);case"behind":return new t.Cartesian3(0,1,0);case"front":return new t.Cartesian3(0,-1,0);case"top":return new t.Cartesian3(0,0,-1);case"down":return new t.Cartesian3(0,0,1);default:return t.Cartesian3.UNIT_X}}getPlaneByType(e){const t=this.cesium,i=this.getNormalByType(e),s=t.Cartesian3.negate(i,new t.Cartesian3);let o=0;switch(e){case"left":o=this.targetXMinus;break;case"right":o=this.targetXPlus;break;case"behind":o=this.targetYMinus;break;case"front":o=this.targetYPlus;break;case"top":o=this.targetZPlus;break;case"down":o=this.targetZMinus;break}return new t.Plane(s,-o)}initEventHandlers(){const e=this.cesium,t=this.viewer.scene.canvas,i=this.viewer.scene;this.downHandler=new e.ScreenSpaceEventHandler(t),this.upHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler.setInputAction(s=>{if(this.selectedPlane)return;let o;try{o=i.pick(s.endPosition)}catch{}e.defined(o)&&o.id&&o.id.plane?this.hoveredPlane!==o.id.plane&&(this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1)),this.hoveredPlane=o.id.plane,this.hoveredPlane.material=e.Color.YELLOW.withAlpha(.3),t.style.cursor="pointer"):this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1),this.hoveredPlane=null,t.style.cursor="default")},e.ScreenSpaceEventType.MOUSE_MOVE),this.downHandler.setInputAction(s=>{let o;try{o=i.pick(s.position)}catch{}if(e.defined(o)&&o.id&&o.id.plane){this.currentPlaneType=o.id.name,this.selectedPlane=o.id.plane,this.selectedPlane.material=e.Color.RED.withAlpha(.4),i.screenSpaceCameraController.enableInputs=!1;const r=i.camera.getPickRay(s.position),a=this.boxInverseMatrix,l=e.Matrix4.multiplyByPoint(a,r.origin,new e.Cartesian3),c=e.Matrix4.multiplyByPointAsVector(a,r.direction,new e.Cartesian3);e.Cartesian3.normalize(c,c);const h=new e.Ray(l,c),u=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,u,new e.Cartesian3),this.dragStartPoint||(this.dragStartPoint=this.getPlaneOffsetCartesian(this.currentPlaneType))}},e.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(s=>{if(!this.selectedPlane||!this.dragStartPoint)return;const o=i.camera.getPickRay(s.endPosition),r=this.boxInverseMatrix,a=e.Matrix4.multiplyByPoint(r,o.origin,new e.Cartesian3),l=e.Matrix4.multiplyByPointAsVector(r,o.direction,new e.Cartesian3);e.Cartesian3.normalize(l,l);const c=new e.Ray(a,l);let h=new e.Cartesian3;this.currentPlaneType==="top"||this.currentPlaneType==="down"?h=Math.abs(l.x)>Math.abs(l.y)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Y:this.currentPlaneType==="left"||this.currentPlaneType==="right"?h=Math.abs(l.y)>Math.abs(l.z)?e.Cartesian3.UNIT_Y:e.Cartesian3.UNIT_Z:h=Math.abs(l.x)>Math.abs(l.z)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z;const u=-e.Cartesian3.dot(this.dragStartPoint,h),p=new e.Plane(h,u);let f=e.IntersectionTests.rayPlane(c,p,new e.Cartesian3);if(!f){const y=h===e.Cartesian3.UNIT_X?e.Cartesian3.UNIT_Y:h===e.Cartesian3.UNIT_Y&&(this.currentPlaneType==="top"||this.currentPlaneType==="down")?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z,g=-e.Cartesian3.dot(this.dragStartPoint,y);f=e.IntersectionTests.rayPlane(c,new e.Plane(y,g),new e.Cartesian3)}if(!f)return;const m=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+m,-f.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+m,f.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+m,-f.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+m,f.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+m,f.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+m,-f.z);break}this.syncClippingPlanes(),this.moveCallBack&&this.moveCallBack(this.getRangeParams())},e.ScreenSpaceEventType.MOUSE_MOVE),this.upHandler.setInputAction(()=>{this.selectedPlane&&(this.selectedPlane.material=e.Color.WHITE.withAlpha(.1),this.selectedPlane=null,this.currentPlaneType="",this.dragStartPoint=null),i.screenSpaceCameraController.enableInputs=!0,t.style.cursor="default"},e.ScreenSpaceEventType.LEFT_UP)}syncClippingPlanes(){this.activeModelIds.size!==0&&Object.keys(this.clippingPlanesMap).forEach(e=>{const t=this.clippingPlanesMap[e],i=this.tilesetMap[e];if(t&&i&&!t.isDestroyed()){const s=this.cesium;t.get(0).distance=this.targetXMinus,t.get(1).distance=this.targetXPlus,t.get(2).distance=this.targetYMinus,t.get(3).distance=this.targetYPlus,t.get(4).distance=this.targetZMinus,t.get(5).distance=this.targetZPlus;const o=s.Matrix4.inverse(i.root.transform,new s.Matrix4);t.modelMatrix=s.Matrix4.multiply(o,this.boxMatrix,new s.Matrix4)}})}fitToModels(){const e=this.cesium;if(this.activeModelIds.size===0)return;let t=[];if(this.activeModelIds.forEach(u=>{const p=this.tilesetMap[u];p&&p.boundingSphere&&t.push(p.boundingSphere.center)}),t.length===0)return;const i=new e.Cartesian3;t.forEach(u=>e.Cartesian3.add(i,u,i)),this.boxCenter=e.Cartesian3.divideByScalar(i,t.length,new e.Cartesian3),this.boxMatrix=e.Transforms.eastNorthUpToFixedFrame(this.boxCenter),this.boxInverseMatrix=e.Matrix4.inverse(this.boxMatrix,new e.Matrix4),this.boxOrientation=e.Quaternion.fromRotationMatrix(e.Matrix4.getMatrix3(this.boxMatrix,new e.Matrix3));let s=1/0,o=-1/0,r=1/0,a=-1/0,l=1/0,c=-1/0;this.activeModelIds.forEach(u=>{const p=this.tilesetMap[u];if(!p)return;const f=[],m=p.leiting?.box,y=p.root?.boundingVolume?.boundingVolume;if(m&&m.min&&m.max){const{min:g,max:A}=m,v=[new e.Cartesian3(g.x,g.y,g.z),new e.Cartesian3(A.x,g.y,g.z),new e.Cartesian3(g.x,A.y,g.z),new e.Cartesian3(A.x,A.y,g.z),new e.Cartesian3(g.x,g.y,A.z),new e.Cartesian3(A.x,g.y,A.z),new e.Cartesian3(g.x,A.y,A.z),new e.Cartesian3(A.x,A.y,A.z)],C=p.root.transform;v.forEach(w=>{f.push(e.Matrix4.multiplyByPoint(C,w,new e.Cartesian3))})}else if(y&&y.halfAxes){const g=y.center,A=y.halfAxes,v=e.Matrix3.getColumn(A,0,new e.Cartesian3),C=e.Matrix3.getColumn(A,1,new e.Cartesian3),w=e.Matrix3.getColumn(A,2,new e.Cartesian3);for(let S=0;S<8;S++){const x=e.Cartesian3.clone(g,new e.Cartesian3);e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(v,S&1?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(C,S&2?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(w,S&4?1:-1,new e.Cartesian3),x),f.push(x)}}else if(p.boundingSphere){const g=p.boundingSphere,A=g.center,v=g.radius,C=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,A,new e.Cartesian3);s=Math.min(s,C.x-v),o=Math.max(o,C.x+v),r=Math.min(r,C.y-v),a=Math.max(a,C.y+v),l=Math.min(l,C.z-v),c=Math.max(c,C.z+v)}f.forEach(g=>{const A=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,g,new e.Cartesian3);s=Math.min(s,A.x),o=Math.max(o,A.x),r=Math.min(r,A.y),a=Math.max(a,A.y),l=Math.min(l,A.z),c=Math.max(c,A.z)})});const h=1.01;this.targetXMinus=Math.abs(s)*h,this.targetXPlus=Math.abs(o)*h,this.targetYMinus=Math.abs(r)*h,this.targetYPlus=Math.abs(a)*h,this.targetZMinus=Math.abs(l)*h,this.targetZPlus=Math.abs(c)*h,this.activeModelIds.forEach(u=>{this.setupClippingPlanes(u)}),this.viewer.scene.requestRender()}getRangeParams(){const e=this.cesium;return{targetZPlus:this.targetZPlus,targetZMinus:this.targetZMinus,targetXPlus:this.targetXPlus,targetXMinus:this.targetXMinus,targetYPlus:this.targetYPlus,targetYMinus:this.targetYMinus,maxBox:new e.Cartesian3(this.targetXPlus,this.targetYPlus,this.targetZPlus),minBox:new e.Cartesian3(-this.targetXMinus,-this.targetYMinus,-this.targetZMinus)}}updateRange(e){if(!this.boxMatrix)return;e.targetXMinus!==void 0&&(this.targetXMinus=e.targetXMinus),e.targetXPlus!==void 0&&(this.targetXPlus=e.targetXPlus),e.targetYMinus!==void 0&&(this.targetYMinus=e.targetYMinus),e.targetYPlus!==void 0&&(this.targetYPlus=e.targetYPlus),e.targetZPlus!==void 0&&(this.targetZPlus=e.targetZPlus),e.targetZMinus!==void 0&&(this.targetZMinus=e.targetZMinus);const t=.1;this.targetXMinus+this.targetXPlus<t&&(this.targetXPlus=t-this.targetXMinus),this.targetYPlus+this.targetYMinus<t&&(this.targetYPlus=t-this.targetYMinus),this.targetZPlus+this.targetZMinus<t&&(this.targetZPlus=t-this.targetZMinus),this.syncClippingPlanes(),this.viewer.scene.requestRender()}getRange(){return this.getRangeParams()}setBoxVisibility(e){this.planeEntities.forEach(t=>{t.show=e}),this.viewer.scene.requestRender()}close(e){if(e){const t=this.tilesetMap[e];t&&(t.clippingPlanes&&(t.clippingPlanes.enabled=!1),t.clippingPlanes=void 0),delete this.clippingPlanesMap[e],this.activeModelIds.delete(e),this.activeModelIds.size>0&&this.fitToModels()}else Object.keys(this.clippingPlanesMap).forEach(t=>{const i=this.tilesetMap[t];i&&(i.clippingPlanes&&(i.clippingPlanes.enabled=!1),i.clippingPlanes=void 0)}),this.clippingPlanesMap={},this.activeModelIds.clear();this.activeModelIds.size===0&&(this.planeEntities.forEach(t=>{this.viewer.entities.remove(t)}),this.planeEntities=[],this.destroyEventHandlers(),this.boxMatrix=null,this.boxInverseMatrix=null),this.viewer.scene.requestRender()}destroyEventHandlers(){this.downHandler?.destroy(),this.upHandler?.destroy(),this.moveHandler?.destroy(),this.downHandler=this.upHandler=this.moveHandler=null}}let Cl=performance.now();const bw=10;class Cw{cesium;viewer;modelInfo={modelName:"Person",modelId:"player_111",url:"person/model.glb",scale:.0032};startTime=0;radian=0;speed=.1;speedVector;position;hpRoll;cameralHpRoll;fixedFrameTransforms;model;transparentTest=!0;gravityTestByMove=!1;gravityTest=!0;lastMoveTime=0;moveInterval=.01;collisionTest=!0;wheelCount=2;isLeftDragging=!1;lastScreenY=0;lastScreenX=0;pauseAnimationFn;resumeAnimationFn;selectedColor;selectedColorRecover;handler;moveState={moveFront:!1,moveBack:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1};onLoading=null;onSuccess=null;onError=null;constructor({cesium:e,viewer:t,modelInfo:i,callbacks:s}){this.cesium=e,this.viewer=t,this.radian=this.cesium.Math.toRadians(4),this.speedVector=new this.cesium.Cartesian3,this.position=new this.cesium.Cartesian3,this.hpRoll=new this.cesium.HeadingPitchRoll,this.cameralHpRoll=new this.cesium.HeadingPitchRoll,this.fixedFrameTransforms=new this.cesium.Transforms.localFrameToFixedFrameGenerator("north","west"),i&&(this.modelInfo=Object.assign(this.modelInfo,i)),s&&(this.onLoading=s.onLoading||null,this.onSuccess=s.onSuccess||null,this.onError=s.onError||null),this.selectedColor=new this.cesium.Color(1,1,1,.4),this.selectedColorRecover=new this.cesium.Color(1,1,1,1);const o=this.viewer.scene.canvas;this.handler=new this.cesium.ScreenSpaceEventHandler(o)}getModel(){return this.model}setPauseAnimation(e){this.pauseAnimationFn=e}setResumeAnimationFn(e){this.resumeAnimationFn=e}async setPersonPosition(e){e&&(this.position=e),this.getModel()?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(e,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.model.show=!0,this.initKeyBoard()):await this.openPlayer(),this.setCameralDefault(!1)}setModelInfo(e){e&&(this.modelInfo=Object.assign(this.modelInfo,e))}async openPlayer(){if(this.enablePositionSelection(),this.model){this.model.show=!0,this.initKeyBoard(),this.setCameralDefault(!1);return}this.position&&!(this.position.x===0&&this.position.y===0&&this.position.z===0)?(await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)):this.onLoading&&this.onLoading("请按住 Ctrl + 左键点击场景选择初始位置...")}enablePositionSelection(){this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null);const e=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);e.setInputAction(async t=>{const i=this.viewer.scene;let s;try{s=i.pickPosition(t.position)}catch(o){console.warn("pickPosition failed:",o)}s&&(this.position=s,this.model?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.updatedCamera(),this.onSuccess&&this.onSuccess("已更新漫游位置")):(this.onSuccess&&this.onSuccess("位置已选择,正在加载模型..."),await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)))},this.cesium.ScreenSpaceEventType.LEFT_CLICK,this.cesium.KeyboardEventModifier.CTRL),this._positionHandler=e}_positionHandler;setDefaultPosition(){const e=this.viewer.scene,t=this.viewer.camera,i=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(i)}catch(o){console.warn("pickPosition failed:",o)}if(s)this.position=s;else{const o=t.direction,a=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(o,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=a}}async loadModel(){let e;try{this.onLoading&&this.onLoading("正在加载漫游人物...");const t=await this.cesium.Model.fromGltfAsync({id:this.modelInfo.modelId,url:this.modelInfo.url,modelMatrix:this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),scale:this.modelInfo.scale,allowPicking:!1,debugShowBoundingVolume:!1,debugWireframe:!1,cull:!1,gltfCallback:s=>{e=s.animations},backFaceCulling:!1}),i=()=>{if(e&&e.length>0){console.log("Model has animations:",e.length);try{t.activeAnimations.add({index:0,loop:this.cesium.ModelAnimationLoop.REPEAT,multiplier:1})}catch(s){console.error("Failed to add animation:",s)}this.pauseAnimationFn=()=>{this.viewer.clock.shouldAnimate=!1},this.resumeAnimationFn=()=>{this.viewer.clock.shouldAnimate=!0},this.viewer.clock.shouldAnimate=!1}else console.warn("No animations found in the model.")};t.ready?i():t.readyEvent.addEventListener(i),this.model=await this.viewer.scene.primitives.add(t),this.updatedCamera(),this.onLoading&&this.onLoading(""),this.onSuccess&&this.onSuccess("漫游模型加载完成")}catch(t){console.error("Failed to load model:",t),this.onLoading&&this.onLoading(""),this.onError&&this.onError("漫游模型加载失败")}}initKeyBoard(){const e=this.handler,t=this.cesium;Cl=performance.now();const i=(o,r)=>{const a=o.code,l=o.keyCode;a==="KeyA"||l===65?this.moveState.moveLeft=r:a==="KeyW"||l===87?this.moveState.moveFront=r:a==="KeyD"||l===68?this.moveState.moveRight=r:a==="KeyS"||l===83?this.moveState.moveBack=r:a==="KeyQ"||l===81?this.moveState.moveUp=r:(a==="KeyE"||l===69)&&(this.moveState.moveDown=r)};e.setInputAction(o=>{this.wheelCount-=o*.001,this.wheelCount<.1&&(this.wheelCount=.1),this.updatedCamera()},t.ScreenSpaceEventType.WHEEL),this._keydownHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(i(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(i(o,!1),Object.keys(this.moveState).every(r=>this.moveState[r]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())},document.addEventListener("keydown",this._keydownHandler),document.addEventListener("keyup",this._keyupHandler),e.setInputAction(o=>{this.isLeftDragging=!0,this.lastScreenY=o.position.y,this.lastScreenX=o.position.x},this.cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(o=>{if(!this.isLeftDragging)return;const r=o.endPosition.x,a=o.endPosition.y,l=a-this.lastScreenY,c=r-this.lastScreenX;Math.abs(l)<Math.abs(c)&&(c>0?(this.cameralHpRoll.heading+=this.radian,this.hpRoll.heading+=this.radian):(this.cameralHpRoll.heading-=this.radian,this.hpRoll.heading-=this.radian),s(0),this.lastScreenX=r),this.lastScreenY=a;const h=this.viewer.camera;this.cameralHpRoll.pitch=h.pitch+this.cesium.Math.toRadians(-l*.1),this.updatedCamera()},t.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(()=>{this.isLeftDragging&&(this.isLeftDragging=!1)},t.ScreenSpaceEventType.LEFT_UP);const s=o=>{const r=performance.now();if(r-Cl<bw)return;Cl=r;const a=1.75;if(o===1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,-this.speed,this.speedVector),this.gravityTestByMove=!0):o===0?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,0,this.speedVector),this.gravityTestByMove=!1):o===2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,.05,this.speedVector),this.gravityTestByMove=!1):o===-2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,-.05,this.speedVector),this.gravityTestByMove=!1):o===3?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-3&&(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,-this.speed,this.speedVector),this.gravityTestByMove=!0),!this.viewer||!this.model)return;const l=(u,p)=>new this.cesium.Ray(u,p),c=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,c),this.cesium.Cartesian3.normalize(c,c);const h=new this.cesium.Cartesian3;if(this.cesium.Matrix4.getColumn(this.model.modelMatrix,1,h),this.cesium.Cartesian3.normalize(h,h),Math.abs(o)!=2&&this.collisionTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,a),u);let f=c;o===-1?f=this.cesium.Cartesian3.multiplyByScalar(c,-1,new this.cesium.Cartesian3):o===3?f=h:o===-3&&(f=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const m=l(p,f),y=this.viewer.scene.pickFromRay(m,[this.model],1);if(y&&y.position&&this.cesium.Cartesian3.distance(p,y.position)<.9&&o!==0)return}if(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,this.speedVector,this.position),this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.gravityTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=.5,f=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),u),m=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,f,m),this.cesium.Cartesian3.normalize(m,m);const y=l(f,m),g=this.viewer.scene.pickFromRay(y,[this.model],1),A=a,v=this.cesium.Cartesian3.add(f,this.cesium.Cartesian3.multiplyByScalar(c,A,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(g)){const C=t.Cartesian3.distance(f,g.position);C-p>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),C-p<-.1&&C<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!g&&this.gravityTestByMove){const C=l(this.position,m),w=this.viewer.scene.pickFromRay(C,[this.model],1);if(w){const S=this.cesium.Cartesian3.distance(this.position,w.position);Math.abs(S-1)>.05&&S<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(g&&this.gravityTestByMove&&this.gravityTest){const C=this.cesium.Cartesian3.distance(v,g.position);Math.abs(C-a)>.1&&(this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,(a-C)/Math.abs(a-C)*.05),this.position))}}if(this.transparentTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=1.75,f=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),u),m=this.viewer.camera.positionWC,y=f,g=t.Cartesian3.subtract(y,m,new t.Cartesian3),A=t.Cartesian3.distance(f,m),v=t.Cartesian3.normalize(g,new t.Cartesian3),C=new t.Ray(m,v);let w;try{w=this.viewer.scene.pickFromRay(C,void 0,1)}catch{}t.defined(w)&&w.primitive!==this.model&&w.position&&t.Cartesian3.distance(m,w.position)<A&&(this.wheelCount-=.1,this.wheelCount<.1&&(this.wheelCount=.1))}this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.updatedCamera()};this._tickHandler=()=>{const o=performance.now()/1e3;(o-this.lastMoveTime>=this.moveInterval||this.lastMoveTime==0)&&(this.moveState.moveFront?s(1):this.moveState.moveBack?s(-1):this.moveState.moveLeft?s(3):this.moveState.moveRight?s(-3):this.moveState.moveUp?s(2):this.moveState.moveDown&&s(-2),this.lastMoveTime=o)},this.viewer.clock.onTick.addEventListener(this._tickHandler)}updatedCamera(){if(!this.model)return;const e=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),t=1.75,i=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(i,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,i])=>{if(!i)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);i.addEventListener("mousedown",s),i.addEventListener("mouseup",o),i.addEventListener("mouseleave",o),i.addEventListener("touchstart",r=>{r.preventDefault(),s()}),i.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{i.removeEventListener("mousedown",s),i.removeEventListener("mouseup",o),i.removeEventListener("mouseleave",o),i.removeEventListener("touchstart",s),i.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,i=t.camera;this.setDefaultPosition(),this.setCameralDefault(!1);const s=this.handler;let o=!1,r=0,a=0;s.setInputAction(l=>{o=!0,r=l.position.x,a=l.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(l=>{if(!o)return;const c=l.endPosition.x,h=l.endPosition.y,u=c-r,p=h-a;Math.abs(u)>Math.abs(p)&&(i.heading-=u*.003),i.pitch+=p*.003,r=c,a=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{o=!1},e.ScreenSpaceEventType.LEFT_UP),s.setInputAction(l=>{this.wheelCount-=l*.001,this.wheelCount<.1&&(this.wheelCount=.1)},e.ScreenSpaceEventType.WHEEL),this._tickHandler=()=>{if(!this.moveState.moveFront&&!this.moveState.moveBack&&!this.moveState.moveLeft&&!this.moveState.moveRight&&!this.moveState.moveUp&&!this.moveState.moveDown)return;const l=(this.speed||.02)*12,c=i.direction,h=i.right,u=i.up;let p=0,f=0,m=0;this.moveState.moveFront&&(p+=c.x*l,f+=c.y*l,m+=c.z*l),this.moveState.moveBack&&(p-=c.x*l,f-=c.y*l,m-=c.z*l),this.moveState.moveRight&&(p+=h.x*l,f+=h.y*l,m+=h.z*l),this.moveState.moveLeft&&(p-=h.x*l,f-=h.y*l,m-=h.z*l),this.moveState.moveUp&&(p+=u.x*l,f+=u.y*l,m+=u.z*l),this.moveState.moveDown&&(p-=u.x*l,f-=u.y*l,m-=u.z*l),i.position=new e.Cartesian3(i.position.x+p,i.position.y+f,i.position.z+m)},t.clock.onTick.addEventListener(this._tickHandler),this.onSuccess&&this.onSuccess("视角漫游已启动")}closePlayer(){const e=this.cesium;this.model&&(this.model.show=!1),this.setCameralDefault(!0),this.handler&&(this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(e.ScreenSpaceEventType.WHEEL)),this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._keyupHandler&&document.removeEventListener("keyup",this._keyupHandler),this._tickHandler&&this.viewer.clock.onTick.removeEventListener(this._tickHandler),this.unbindUiKeys(),this.viewer.camera.lookAtTransform(e.Matrix4.IDENTITY),this.onLoading&&this.onLoading("")}setSpeed({speed:e}){this.speed=e/50}setParams({gravityTest:e,collisionTest:t,transparentTest:i}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),i!==void 0&&(this.transparentTest=i)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(i=>this.moveState[i]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())}setCameralDefault(e){const t=this.viewer;t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableLook=e,t.scene.screenSpaceCameraController.enableTilt=e}}class ww{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Wy(e),this.baseTiles=new ju(e),this.baseCompt=new Aw(e),this.baseSection=new vw(e),this.basePlayer=new Cw({cesium:e.cesium,viewer:e.viewer,modelInfo:{url:e.options?.playerUrl,modelName:e.options?.playerModelName,modelId:e.options?.playerModelId,scale:e.options?.playerScale},callbacks:e.callbacks})}getCesium(){return this.cesium}getViewer(){return this.viewer}setSceneOptions(...e){this.baseCesium.setSceneOptions(...e)}getSnapDomSImageBase64(...e){return this.baseCesium.getSnapDomSImageBase64(...e)}clearBackground(){this.baseCesium.clearBackground()}enableTestLabel(){this.baseCesium.enableTestLabel()}enableCesiumFXAA(e){this.baseCesium.enableCesiumFXAA(e)}updateModelEffect(e){this.baseCesium.updateModelEffect(e)}addModels(...e){return this.baseTiles.addModels(...e)}}class Ew{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new _s;showGlobal=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}flyToCadModel(e={}){const t=e.modelId||this.modelId,i=this.dxfModelsList.find(s=>s.modelId===t);i&&this.flyToBounds(i)}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.dxfModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.dxfModelsList.find(i=>i.modelId===t):this.dxfModelsList}showJson({modelId:e,show:t}){this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})});const i=this.dxfModelsList.find(s=>s.modelId===e);i&&(i.show=t)}showJsonByLayer({modelId:e,show:t,layers:i}){const s=this.dxfModelsList.find(r=>r.modelId===e);if(!s){console.error("Tileset not found for modelId:",e);return}s.hiddenBatchIds||(s.hiddenBatchIds=new Set),s.layerMap&&Array.isArray(i)&&i.forEach(r=>{const a=s.layerMap[r];a!==void 0&&(t?s.hiddenBatchIds.delete(a):s.hiddenBatchIds.add(a))});const o=Array.from(s.hiddenBatchIds);if(o.length>0){const r=o.map(a=>`\${_BATCHID} !== ${a}`).join(" && ");s.style=new this.cesium.Cesium3DTileStyle({show:r})}else s.style=new this.cesium.Cesium3DTileStyle({show:!0});s.hasVisibilityListener||(s.hasVisibilityListener=!0,s.tileVisible.addEventListener(r=>{const a=r.content,l=a.featuresLength;if(l>0&&s.hiddenBatchIds)for(let c=0;c<l;c++)s.hiddenBatchIds.has(c)?a.getFeature(c).show=!1:a.getFeature(c).show=!0}))}flyToBounds(e,t){const i=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new i.HeadingPitchRange(0,i.Math.toRadians(-90),s*2),...t},r=o.duration??0;e&&this.viewer.flyTo(e,{duration:r,offset:o.offset})}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const i=await t.blob(),s=new ml(new tr(i),{password:Hu,useWebWorkers:!1}),r=(await s.getEntries()).find(c=>!c.directory&&c.filename.endsWith(".json"));if(!r)return console.error("未找到 JSON 文件"),await s.close(),!1;const a=await r.arrayBuffer({useWebWorkers:!1});await s.close();const l=new TextDecoder().decode(a);return JSON.parse(l.trim())}catch(t){return console.error("解压或获取失败:",t),!1}}getBaseUrlPath(e){const t=e.lastIndexOf("/");return t===-1?".":e.substring(0,t)}async loadTilesetWithZipSupport(e,t){const i=this.getBaseUrlPath(e),s=encodeURI(`${i}/tileset.zip`);try{if((await fetch(s,{method:"HEAD"})).status===200){const r=await this.loadModelFile(s);if(r){const a=h=>{!h||typeof h!="object"||(typeof h.uri=="string"&&!/^(data:|https?:\/\/)/i.test(h.uri)&&(h.uri=encodeURI(`${i}/${h.uri.replace(/^\.?\//,"")}`)),Object.values(h).forEach(u=>{if(Array.isArray(u)){u.forEach(p=>a(p));return}u&&typeof u=="object"&&a(u)}))};a(r);const l=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(r))))}`,c=new this.cesium.Resource({url:l});try{return await this.cesium.Cesium3DTileset.fromUrl(c,t)}catch{return await this.cesium.Cesium3DTileset.fromUrl(e,t)}}}}catch{}return await this.cesium.Cesium3DTileset.fromUrl(e,t)}async addDxfModel({fileNames:e,options:t}){const i=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==i)return;const o=this.renderGenByModel[s.modelId]||0;if((this.renderGenByModel[s.modelId]||0)!==o||~this.dxfModelsList.findIndex(c=>c.modelId===s.modelId))return;/^https?:\/\//i.test(s.outPutPath)||(s.outPutPath=`${window.location.origin}${s.outPutPath}`);const a=`${s.outPutPath}${s.dbName}/tileset.json`,l={...this.options,...t};try{const c=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(c);if(this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;const u=await this.loadTilesetWithZipSupport(a,{allowPicking:!1,clampToTerrain:!0});if(u.maximumScreenSpaceError=0,this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;if(Object.assign(u,{modelId:s.modelId,modelName:s.modelName,deltaLatitude:s.deltaLatitude||0,deltaLongitude:s.deltaLongitude||0,relocated:!0,dbName:s.dbName,outPutPath:s.outPutPath,totalRotation:s.totalRotation||0,layerInfo:h}),s.formData?u.formData=s.formData:u.formData={modelId:u.modelId,longitude:u.deltaLongitude,latitude:u.deltaLatitude,distance:1e-6,rotation:0,totalRotation:u.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:u.modelId,label:u.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...u.formData,tileset:u}),Array.isArray(h)){const p=h;u.layerMap={};let f=this.mapLayers[s.modelId];f||(f={},this.mapLayers[s.modelId]=f),p.forEach(m=>{u.layerMap[m.layerName]=m.batchId,f[m.layerName]||(f[m.layerName]=[]),f[m.layerName].push({batchId:m.batchId,color:m.layerColor})})}if(this.dxfModelsList.push(u),this.setModelId(s.modelId),this.viewer.scene.primitives.add(u),this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;l.flyTo&&this.flyToBounds(u),l.onSuccess&&l.onSuccess(u)}catch(c){console.error(`Failed to load tileset or layer info: ${a}`,c)}}this.events.emit("mountAllCad",this.dxfModelsList)}}adjustingModelByCad(e){const t=this.cesium,i=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(i),new t.Cartesian3(0,0,0)),o=t.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),r=t.Transforms.eastNorthUpToFixedFrame(o);t.Matrix4.multiply(r,s,r),e.tileset?._root&&(e.tileset._root.transform=r)}deleteCad({modelId:e}){this.mapLayers[e]&&(Object.values(this.mapLayers[e]).forEach(i=>{i.forEach(s=>{this.viewer.scene.primitives.remove(s.primitive),s.primitive?.destroy()})}),delete this.mapLayers[e]),this.renderGen[e]=(this.renderGen[e]||0)+1,this.renderGenByModel[e]=(this.renderGenByModel[e]||0)+1;const t=this.dxfModelsList.findIndex(i=>i.modelId===e);if(t>-1){const i=this.dxfModelsList[t];this.viewer.scene.primitives.remove(i),i.destroy&&!i.isDestroyed()&&i.destroy(),this.dxfModelsList.splice(t,1)}}deleteAllCad(){Object.keys(this.mapLayers).forEach(e=>{this.deleteCad({modelId:e})}),[...this.dxfModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}function xw(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)n("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),n("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");n("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var ei=1,ti=2,ki=3,Iw=4,wl=5,Xu=6378137,Sw=6356752314e-3,Ju=.0066943799901413165,Ps=484813681109536e-20,$=Math.PI/2,Mw=.16666666666666666,Tw=.04722222222222222,Bw=.022156084656084655,X=1e-10,Oe=.017453292519943295,bt=57.29577951308232,ve=Math.PI/4,Ds=Math.PI*2,Ge=3.14159265359,Ct={};Ct.greenwich=0,Ct.lisbon=-9.131906111111,Ct.paris=2.337229166667,Ct.bogota=-74.080916666667,Ct.madrid=-3.687938888889,Ct.rome=12.452333333333,Ct.bern=7.439583333333,Ct.jakarta=106.807719444444,Ct.ferro=-17.666666666667,Ct.brussels=4.367975,Ct.stockholm=18.058277777778,Ct.athens=23.7163375,Ct.oslo=10.722916666667;const _w={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var Zu=/[\s_\-\/\(\)]/g;function Mn(n,e){if(n[e])return n[e];for(var t=Object.keys(n),i=e.toLowerCase().replace(Zu,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(Zu,""),r===i)return n[o]}function El(n){var e={},t=n.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,l){var c=l.split("=");return c.push(!0),a[c[0].toLowerCase()]=c[1],a},{}),i,s,o,r={proj:"projName",datum:"datumCode",rf:function(a){e.rf=parseFloat(a)},lat_0:function(a){e.lat0=a*Oe},lat_1:function(a){e.lat1=a*Oe},lat_2:function(a){e.lat2=a*Oe},lat_ts:function(a){e.lat_ts=a*Oe},lon_0:function(a){e.long0=a*Oe},lon_1:function(a){e.long1=a*Oe},lon_2:function(a){e.long2=a*Oe},alpha:function(a){e.alpha=parseFloat(a)*Oe},gamma:function(a){e.rectified_grid_angle=parseFloat(a)*Oe},lonc:function(a){e.longc=a*Oe},x_0:function(a){e.x0=parseFloat(a)},y_0:function(a){e.y0=parseFloat(a)},k_0:function(a){e.k0=parseFloat(a)},k:function(a){e.k0=parseFloat(a)},a:function(a){e.a=parseFloat(a)},b:function(a){e.b=parseFloat(a)},r:function(a){e.a=e.b=parseFloat(a)},r_a:function(){e.R_A=!0},zone:function(a){e.zone=parseInt(a,10)},south:function(){e.utmSouth=!0},towgs84:function(a){e.datum_params=a.split(",").map(function(l){return parseFloat(l)})},to_meter:function(a){e.to_meter=parseFloat(a)},units:function(a){e.units=a;var l=Mn(_w,a);l&&(e.to_meter=l.to_meter)},from_greenwich:function(a){e.from_greenwich=a*Oe},pm:function(a){var l=Mn(Ct,a);e.from_greenwich=(l||parseFloat(a))*Oe},nadgrids:function(a){a==="@null"?e.datumCode="none":e.nadgrids=a},axis:function(a){var l="ewnsud";a.length===3&&l.indexOf(a.substr(0,1))!==-1&&l.indexOf(a.substr(1,1))!==-1&&l.indexOf(a.substr(2,1))!==-1&&(e.axis=a)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(i in t)s=t[i],i in r?(o=r[i],typeof o=="function"?o(s):e[o]=s):e[i]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=n,e}class ef{static getId(e){const t=e.find(i=>Array.isArray(i)&&i[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const i=e[1],s=parseFloat(e[2])||null,o=e.find(a=>Array.isArray(a)&&a[0]==="ID"),r=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:t,name:i,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let i;const s=t.match(/^\((.)\)$/);if(s){const c=s[1].toUpperCase();if(c==="E")i="east";else if(c==="N")i="north";else if(c==="U")i="up";else throw new Error(`Unknown axis abbreviation: ${c}`)}else i=e[2]?e[2].toLowerCase():"unknown";const o=e.find(c=>Array.isArray(c)&&c[0]==="ORDER"),r=o?parseInt(o[1],10):null,a=e.find(c=>Array.isArray(c)&&(c[0]==="LENGTHUNIT"||c[0]==="ANGLEUNIT"||c[0]==="SCALEUNIT")),l=this.convertUnit(a);return{name:t,direction:i,unit:l,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,i)=>(t.order||0)-(i.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(p=>Array.isArray(p)&&p[0]==="BASEGEOGCRS")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="BASEGEOGCRS")):null,t.conversion=e.find(p=>Array.isArray(p)&&p[0]==="CONVERSION")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="CONVERSION")):null;const i=e.find(p=>Array.isArray(p)&&p[0]==="CS");i&&(t.coordinate_system={type:i[1],axis:this.extractAxes(e)});const s=e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT");if(s){const p=this.convertUnit(s);t.coordinate_system.unit=p}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const o=e.find(p=>Array.isArray(p)&&(p[0]==="DATUM"||p[0]==="ENSEMBLE"));if(o){const p=this.convert(o);o[0]==="ENSEMBLE"?t.datum_ensemble=p:t.datum=p;const f=e.find(m=>Array.isArray(m)&&m[0]==="PRIMEM");f&&f[1]!=="Greenwich"&&(p.prime_meridian={name:f[1],longitude:parseFloat(f[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(p=>Array.isArray(p)&&p[0]==="MEMBER").map(p=>({type:"DatumEnsembleMember",name:p[1],id:this.getId(p)}));const r=e.find(p=>Array.isArray(p)&&p[0]==="ENSEMBLEACCURACY");r&&(t.accuracy=parseFloat(r[1]));const a=e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID");a&&(t.ellipsoid=this.convert(a)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT")&&this.convert(e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(p=>Array.isArray(p)&&p[0]==="METHOD")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="METHOD")):null,t.parameters=e.filter(p=>Array.isArray(p)&&p[0]==="PARAMETER").map(p=>this.convert(p));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(p=>Array.isArray(p)&&(p[0]==="LENGTHUNIT"||p[0]==="ANGLEUNIT"||p[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const l=e.find(p=>Array.isArray(p)&&p[0]==="SOURCECRS");if(l){const p=l.find(f=>Array.isArray(f));t.source_crs=p?this.convert(p):null}const c=e.find(p=>Array.isArray(p)&&p[0]==="TARGETCRS");if(c){const p=c.find(f=>Array.isArray(f));t.target_crs=p?this.convert(p):null}const h=e.find(p=>Array.isArray(p)&&p[0]==="ABRIDGEDTRANSFORMATION");h?t.transformation=this.convert(h):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(p=>Array.isArray(p)&&p[0]==="METHOD")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="METHOD")):null,t.parameters=e.filter(p=>Array.isArray(p)&&(p[0]==="PARAMETER"||p[0]==="PARAMETERFILE")).map(p=>{if(p[0]==="PARAMETER")return this.convert(p);if(p[0]==="PARAMETERFILE")return{name:p[1],value:p[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const p=t.parameters[6];p.name==="Scale difference"&&(p.value=Math.round((p.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const u=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(p=>{p.unit||(p.unit=u)}),u.conversion_factor&&u.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:u});break;default:t.keyword=e[0];break}return t}}class kw extends ef{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class Pw extends ef{static convert(e,t={}){super.convert(e,t);const i=e.find(o=>Array.isArray(o)&&o[0]==="CS");i&&(t.coordinate_system={subtype:i[1],axis:this.extractAxes(e)});const s=e.find(o=>Array.isArray(o)&&o[0]==="USAGE");if(s){const o=s.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),r=s.find(l=>Array.isArray(l)&&l[0]==="AREA"),a=s.find(l=>Array.isArray(l)&&l[0]==="BBOX");t.usage={},o&&(t.usage.scope=o[1]),r&&(t.usage.area=r[1]),a&&(t.usage.bbox=a.slice(1))}return t}}function Dw(n){return n.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(n.find(e=>Array.isArray(e)&&e[0]==="CS")||n[0]==="BOUNDCRS"||n[0]==="PROJCRS"||n[0]==="GEOGCRS","2015")}function Nw(n){return(Dw(n)==="2019"?Pw:kw).convert(n)}function Lw(n){const e=n.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Ns=1,tf=2,nf=3,sr=4,sf=5,xl=-1,Rw=/\s/,Fw=/[A-Za-z]/,Ow=/[A-Za-z84_]/,or=/[,\]]/,of=/[\d\.E\-\+]/;function un(n){if(typeof n!="string")throw new Error("not a string");this.text=n.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ns}un.prototype.readCharicter=function(){var n=this.text[this.place++];if(this.state!==sr)for(;Rw.test(n);){if(this.place>=this.text.length)return;n=this.text[this.place++]}switch(this.state){case Ns:return this.neutral(n);case tf:return this.keyword(n);case sr:return this.quoted(n);case sf:return this.afterquote(n);case nf:return this.number(n);case xl:return}},un.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=sr;return}if(or.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)},un.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ns;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ns,this.currentObject=this.stack.pop(),this.currentObject||(this.state=xl);return}},un.prototype.number=function(n){if(of.test(n)){this.word+=n;return}if(or.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)},un.prototype.quoted=function(n){if(n==='"'){this.state=sf;return}this.word+=n},un.prototype.keyword=function(n){if(Ow.test(n)){this.word+=n;return}if(n==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Ns;return}if(or.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)},un.prototype.neutral=function(n){if(Fw.test(n)){this.word=n,this.state=tf;return}if(n==='"'){this.word="",this.state=sr;return}if(of.test(n)){this.word=n,this.state=nf;return}if(or.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)},un.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===xl)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Gw(n){var e=new un(n);return e.output()}function Il(n,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var i=e?{}:n,s=t.reduce(function(o,r){return Pi(r,o),o},i);e&&(n[e]=s)}function Pi(n,e){if(!Array.isArray(n)){e[n]=!0;return}var t=n.shift();if(t==="PARAMETER"&&(t=n.shift()),n.length===1){if(Array.isArray(n[0])){e[t]={},Pi(n[0],e[t]);return}e[t]=n[0];return}if(!n.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=n;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(n);return}Array.isArray(t)||(e[t]={});var i;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:n[0].toLowerCase(),convert:n[1]},n.length===3&&Pi(n[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:n[0],a:n[1],rf:n[2]},n.length===4&&Pi(n[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":n[0]=["name",n[0]],Il(e,t,n);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":n[0]=["name",n[0]],Il(e,t,n),e[t].type=t;return;default:for(i=-1;++i<n.length;)if(!Array.isArray(n[i]))return Pi(n,e[t]);return Il(e,t,n)}}var Uw=.017453292519943295;function Rt(n){return n*Uw}function rf(n){const e=(n.projName||"").toLowerCase().replace(/_/g," ");!n.long0&&n.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(n.long0=n.longc),!n.lat_ts&&n.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(n.lat0=Rt(n.lat1>0?90:-90),n.lat_ts=n.lat1,delete n.lat1):!n.lat_ts&&n.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(n.lat_ts=n.lat0,n.lat0=Rt(n.lat0>0?90:-90),delete n.lat1)}function af(n){let e={units:null,to_meter:void 0};return typeof n=="string"?(e.units=n.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):n&&n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=n.conversion_factor),e}function lf(n){return typeof n=="object"?n.value*n.unit.conversion_factor:n}function cf(n,e){n.ellipsoid.radius?(e.a=n.ellipsoid.radius,e.rf=0):(e.a=lf(n.ellipsoid.semi_major_axis),n.ellipsoid.inverse_flattening!==void 0?e.rf=n.ellipsoid.inverse_flattening:n.ellipsoid.semi_major_axis!==void 0&&n.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-lf(n.ellipsoid.semi_minor_axis))))}function rr(n,e={}){return!n||typeof n!="object"?n:n.type==="BoundCRS"?(rr(n.source_crs,e),n.transformation&&(n.transformation.method&&n.transformation.method.name==="NTv2"?e.nadgrids=n.transformation.parameters[0].value:e.datum_params=n.transformation.parameters.map(t=>t.value)),e):(Object.keys(n).forEach(t=>{const i=n[t];if(i!==null)switch(t){case"name":if(e.srsCode)break;e.name=i,e.srsCode=i;break;case"type":i==="GeographicCRS"?e.projName="longlat":i==="ProjectedCRS"&&n.conversion&&n.conversion.method&&(e.projName=n.conversion.method.name);break;case"datum":case"datum_ensemble":i.ellipsoid&&(e.ellps=i.ellipsoid.name,cf(i,e)),i.prime_meridian&&(e.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=i.name,cf(i,e);break;case"prime_meridian":e.long0=(i.longitude||0)*Math.PI/180;break;case"coordinate_system":if(i.axis){if(e.axis=i.axis.map(s=>{const o=s.direction;if(o==="east")return"e";if(o==="north")return"n";if(o==="west")return"w";if(o==="south")return"s";throw new Error(`Unknown axis direction: ${o}`)}).join("")+"u",i.unit){const{units:s,to_meter:o}=af(i.unit);e.units=s,e.to_meter=o}else if(i.axis[0]&&i.axis[0].unit){const{units:s,to_meter:o}=af(i.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":i.authority&&i.code&&(e.title=i.authority+":"+i.code);break;case"conversion":i.method&&i.method.name&&(e.projName=i.method.name),i.parameters&&i.parameters.forEach(s=>{const o=s.name.toLowerCase().replace(/\s+/g,"_"),r=s.value;s.unit&&s.unit.conversion_factor?e[o]=r*s.unit.conversion_factor:s.unit==="degree"?e[o]=r*Math.PI/180:e[o]=r});break;case"unit":i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),i.conversion_factor&&(e.to_meter=i.conversion_factor);break;case"base_crs":rr(i,e),e.datumCode=i.id?i.id.authority+"_"+i.id.code:i.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),rf(e),e)}var Vw=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Qw(n,e){var t=e[0],i=e[1];!(t in n)&&i in n&&(n[t]=n[i],e.length===3&&(n[t]=e[2](n[t])))}function df(n){for(var e=Object.keys(n),t=0,i=e.length;t<i;++t){var s=e[t];Vw.indexOf(s)!==-1&&zw(n[s]),typeof n[s]=="object"&&df(n[s])}}function zw(n){if(n.AUTHORITY){var e=Object.keys(n.AUTHORITY)[0];e&&e in n.AUTHORITY&&(n.title=e+":"+n.AUTHORITY[e])}if(n.type==="GEOGCS"?n.projName="longlat":n.type==="LOCAL_CS"?(n.projName="identity",n.local=!0):typeof n.PROJECTION=="object"?n.projName=Object.keys(n.PROJECTION)[0]:n.projName=n.PROJECTION,n.AXIS){for(var t="",i=0,s=n.AXIS.length;i<s;++i){var o=[n.AXIS[i][0].toLowerCase(),n.AXIS[i][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?t+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?t+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?t+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(n.axis=t)}n.UNIT&&(n.units=n.UNIT.name.toLowerCase(),n.units==="metre"&&(n.units="meter"),n.UNIT.convert&&(n.type==="GEOGCS"?n.DATUM&&n.DATUM.SPHEROID&&(n.to_meter=n.UNIT.convert*n.DATUM.SPHEROID.a):n.to_meter=n.UNIT.convert));var r=n.GEOGCS;n.type==="GEOGCS"&&(r=n),r&&(r.DATUM?n.datumCode=r.DATUM.name.toLowerCase():n.datumCode=r.name.toLowerCase(),n.datumCode.slice(0,2)==="d_"&&(n.datumCode=n.datumCode.slice(2)),n.datumCode==="new_zealand_1949"&&(n.datumCode="nzgd49"),(n.datumCode==="wgs_1984"||n.datumCode==="world_geodetic_system_1984")&&(n.PROJECTION==="Mercator_Auxiliary_Sphere"&&(n.sphere=!0),n.datumCode="wgs84"),n.datumCode==="belge_1972"&&(n.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(n.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),n.ellps.toLowerCase().slice(0,13)==="international"&&(n.ellps="intl"),n.a=r.DATUM.SPHEROID.a,n.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(n.datum_params=r.DATUM.TOWGS84),~n.datumCode.indexOf("osgb_1936")&&(n.datumCode="osgb36"),~n.datumCode.indexOf("osni_1952")&&(n.datumCode="osni52"),(~n.datumCode.indexOf("tm65")||~n.datumCode.indexOf("geodetic_datum_of_1965"))&&(n.datumCode="ire65"),n.datumCode==="ch1903+"&&(n.datumCode="ch1903"),~n.datumCode.indexOf("israel")&&(n.datumCode="isr93")),n.b&&!isFinite(n.b)&&(n.b=n.a),n.rectified_grid_angle&&(n.rectified_grid_angle=Rt(n.rectified_grid_angle));function a(h){var u=n.to_meter||1;return h*u}var l=function(h){return Qw(n,h)},c=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Rt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Rt],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Rt],["lat0","latitude_of_origin",Rt],["lat0","standard_parallel_1",Rt],["lat1","standard_parallel_1",Rt],["lat2","standard_parallel_2",Rt],["azimuth","Azimuth"],["alpha","azimuth",Rt],["srsCode","name"]];c.forEach(l),rf(n)}function ar(n){if(typeof n=="object")return rr(n);const e=Lw(n);var t=Gw(n);if(e==="WKT2"){const o=Nw(t);return rr(o)}var i=t[0],s={};return Pi(t,s),df(s),s[i]}function it(n){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?it[n]=El(arguments[1]):it[n]=ar(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?it[n]=ar(arguments[1]):(it[n]=t,t||delete it[n])}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){return Array.isArray(i)?it.apply(e,i):it(i)});if(typeof n=="string"){if(n in it)return it[n]}else"EPSG"in n?it["EPSG:"+n.EPSG]=n:"ESRI"in n?it["ESRI:"+n.ESRI]=n:"IAU2000"in n?it["IAU2000:"+n.IAU2000]=n:console.log(n);return}}xw(it);function Hw(n){return typeof n=="string"}function Yw(n){return n in it}function $w(n){return n.indexOf("+")!==0&&n.indexOf("[")!==-1||typeof n=="object"&&!("srsCode"in n)}var jw=["3857","900913","3785","102113"];function Ww(n){var e=Mn(n,"authority");if(e){var t=Mn(e,"epsg");return t&&jw.indexOf(t)>-1}}function qw(n){var e=Mn(n,"extension");if(e)return Mn(e,"proj4")}function Kw(n){return n[0]==="+"}function Xw(n){if(Hw(n)){if(Yw(n))return it[n];if($w(n)){var e=ar(n);if(Ww(e))return it["EPSG:3857"];var t=qw(e);return t?El(t):e}if(Kw(n))return El(n)}else return"projName"in n?n:ar(n)}function hf(n,e){n=n||{};var t,i;if(!e)return n;for(i in e)t=e[i],t!==void 0&&(n[i]=t);return n}function Jt(n,e,t){var i=n*e;return t/Math.sqrt(1-i*i)}function Ls(n){return n<0?-1:1}function J(n,e){return e||Math.abs(n)<=Ge?n:n-Ls(n)*Ds}function Ft(n,e,t){var i=n*t,s=.5*n;return i=Math.pow((1-i)/(1+i),s),Math.tan(.5*($-e))/i}function Rs(n,e){for(var t=.5*n,i,s,o=$-2*Math.atan(e),r=0;r<=15;r++)if(i=n*Math.sin(o),s=$-2*Math.atan(e*Math.pow((1-i)/(1+i),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function Jw(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Zw(n){var e=n.x,t=n.y;if(t*bt>90&&t*bt<-90&&e*bt>180&&e*bt<-180)return null;var i,s;if(Math.abs(Math.abs(t)-$)<=X)return null;if(this.sphere)i=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(ve+.5*t));else{var o=Math.sin(t),r=Ft(this.e,t,o);i=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return n.x=i,n.y=s,n}function eE(n){var e=n.x-this.x0,t=n.y-this.y0,i,s;if(this.sphere)s=$-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var o=Math.exp(-t/(this.a*this.k0));if(s=Rs(this.e,o),s===-9999)return null}return i=J(this.long0+e/(this.a*this.k0),this.over),n.x=i,n.y=s,n}var tE=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const nE={init:Jw,forward:Zw,inverse:eE,names:tE};function iE(){}function uf(n){return n}var ff=["longlat","identity"],sE=[nE,{init:iE,forward:uf,inverse:uf,names:ff}],ni={},Di=[];function pf(n,e){var t=Di.length;return n.names?(Di[t]=n,n.names.forEach(function(i){ni[i.toLowerCase()]=t}),this):(console.log(e),!0)}function mf(n){return n.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function oE(n){if(!n)return!1;var e=n.toLowerCase();if(typeof ni[e]<"u"&&Di[ni[e]]||(e=mf(e),e in ni&&Di[ni[e]]))return Di[ni[e]]}function rE(){sE.forEach(pf)}const aE={start:rE,add:pf,get:oE};var gf={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const lE=gf.WGS84;function cE(n,e,t,i){var s=n*n,o=e*e,r=(s-o)/s,a=0;i?(n*=1-r*(Mw+r*(Tw+r*Bw)),s=n*n,r=0):a=Math.sqrt(r);var l=(s-o)/o;return{es:r,e:a,ep2:l}}function dE(n,e,t,i,s){if(!n){var o=Mn(gf,i);o||(o=lE),n=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)<X)&&(s=!0,e=n),{a:n,b:e,rf:t,sphere:s}}var lr={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var hE in lr){var Sl=lr[hE];Sl.datumName&&(lr[Sl.datumName]=Sl)}function uE(n,e,t,i,s,o,r){var a={};return n===void 0||n==="none"?a.datum_type=wl:a.datum_type=Iw,e&&(a.datum_params=e.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=ei),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=ti,a.datum_params[3]*=Ps,a.datum_params[4]*=Ps,a.datum_params[5]*=Ps,a.datum_params[6]=a.datum_params[6]/1e6+1)),r&&(a.datum_type=ki,a.grids=r),a.a=t,a.b=i,a.es=s,a.ep2=o,a}var Ml={};function fE(n,e,t){return e instanceof ArrayBuffer?pE(n,e,t):{ready:mE(n,e)}}function pE(n,e,t){var i=!0;t!==void 0&&t.includeErrorFields===!1&&(i=!1);var s=new DataView(e),o=AE(s),r=vE(s,o),a=bE(s,r,o,i),l={header:r,subgrids:a};return Ml[n]=l,l}async function mE(n,e){for(var t=[],i=await e.getImageCount(),s=i-1;s>=0;s--){var o=await e.getImage(s),r=await o.readRasters(),a=r,l=[o.getWidth(),o.getHeight()],c=o.getBoundingBox().map(yf),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(yf),u=c[0]+(l[0]-1)*h[0],p=c[3]-(l[1]-1)*h[1],f=a[0],m=a[1],y=[];for(let v=l[1]-1;v>=0;v--)for(let C=l[0]-1;C>=0;C--){var g=v*l[0]+C;y.push([-Tn(m[g]),Tn(f[g])])}t.push({del:h,lim:l,ll:[-u,p],cvs:y})}var A={header:{nSubgrids:i},subgrids:t};return Ml[n]=A,A}function gE(n){if(n===void 0)return null;var e=n.split(",");return e.map(yE)}function yE(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:Ml[n]||null,isNull:!1}}function yf(n){return n*Math.PI/180}function Tn(n){return n/3600*Math.PI/180}function AE(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function vE(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:Tl(n,56,64).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function Tl(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function bE(n,e,t,i){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var a=wE(n,s,t),l=EE(n,s,a,t,i),c=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);o.push({ll:[Tn(a.lowerLongitude),Tn(a.lowerLatitude)],del:[Tn(a.longitudeInterval),Tn(a.latitudeInterval)],lim:[c,h],count:a.gridNodeCount,cvs:CE(l)});var u=16;i===!1&&(u=8),s+=176+a.gridNodeCount*u}return o}function CE(n){return n.map(function(e){return[Tn(e.longitudeShift),Tn(e.latitudeShift)]})}function wE(n,e,t){return{name:Tl(n,e+8,e+16).trim(),parent:Tl(n,e+24,e+24+8).trim(),lowerLatitude:n.getFloat64(e+72,t),upperLatitude:n.getFloat64(e+88,t),lowerLongitude:n.getFloat64(e+104,t),upperLongitude:n.getFloat64(e+120,t),latitudeInterval:n.getFloat64(e+136,t),longitudeInterval:n.getFloat64(e+152,t),gridNodeCount:n.getInt32(e+168,t)}}function EE(n,e,t,i,s){var o=e+176,r=16;s===!1&&(r=8);for(var a=[],l=0;l<t.gridNodeCount;l++){var c={latitudeShift:n.getFloat32(o+l*r,i),longitudeShift:n.getFloat32(o+l*r+4,i)};s!==!1&&(c.latitudeAccuracy=n.getFloat32(o+l*r+8,i),c.longitudeAccuracy=n.getFloat32(o+l*r+12,i)),a.push(c)}return a}function Pt(n,e){if(!(this instanceof Pt))return new Pt(n);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(c){if(c)throw c};var t=Xw(n);if(typeof t!="object"){e("Could not parse to valid json: "+n);return}var i=Pt.projections.get(t.projName);if(!i){e("Could not get projection name from: "+n);return}if(t.datumCode&&t.datumCode!=="none"){var s=Mn(lr,t.datumCode);s&&(t.datum_params=t.datum_params||(s.towgs84?s.towgs84.split(","):null),t.ellps=s.ellipse,t.datumName=s.datumName?s.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var o=dE(t.a,t.b,t.rf,t.ellps,t.sphere),r=cE(o.a,o.b,o.rf,t.R_A),a=gE(t.nadgrids),l=t.datum||uE(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,a);hf(this,t),hf(this,i),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=r.es,this.e=r.e,this.ep2=r.ep2,this.datum=l,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}Pt.projections=aE,Pt.projections.start();function xE(n,e){return n.datum_type!==e.datum_type||n.a!==e.a||Math.abs(n.es-e.es)>5e-11?!1:n.datum_type===ei?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===ti?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function Af(n,e,t){var i=n.x,s=n.y,o=n.z?n.z:0,r,a,l,c;if(s<-$&&s>-1.001*$)s=-$;else if(s>$&&s<1.001*$)s=$;else{if(s<-$)return{x:-1/0,y:-1/0,z:n.z};if(s>$)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),a=Math.sin(s),c=Math.cos(s),l=a*a,r=t/Math.sqrt(1-e*l),{x:(r+o)*c*Math.cos(i),y:(r+o)*c*Math.sin(i),z:(r*(1-e)+o)*a}}function vf(n,e,t,i){var s=1e-12,o=s*s,r=30,a,l,c,h,u,p,f,m,y,g,A,v,C,w=n.x,S=n.y,x=n.z?n.z:0,I,B,R;if(a=Math.sqrt(w*w+S*S),l=Math.sqrt(w*w+S*S+x*x),a/t<s){if(I=0,l/t<s)return B=$,R=-i,{x:n.x,y:n.y,z:n.z}}else I=Math.atan2(S,w);c=x/l,h=a/l,u=1/Math.sqrt(1-e*(2-e)*h*h),m=h*(1-e)*u,y=c*u,C=0;do C++,f=t/Math.sqrt(1-e*y*y),R=a*m+x*y-f*(1-e*y*y),p=e*f/(f+R),u=1/Math.sqrt(1-p*(2-p)*h*h),g=h*(1-p)*u,A=c*u,v=A*m-g*y,m=g,y=A;while(v*v>o&&C<r);return B=Math.atan(A/Math.abs(g)),{x:I,y:B,z:R}}function IE(n,e,t){if(e===ei)return{x:n.x+t[0],y:n.y+t[1],z:n.z+t[2]};if(e===ti){var i=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6];return{x:c*(n.x-l*n.y+a*n.z)+i,y:c*(l*n.x+n.y-r*n.z)+s,z:c*(-a*n.x+r*n.y+n.z)+o}}}function SE(n,e,t){if(e===ei)return{x:n.x-t[0],y:n.y-t[1],z:n.z-t[2]};if(e===ti){var i=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6],h=(n.x-i)/c,u=(n.y-s)/c,p=(n.z-o)/c;return{x:h+l*u-a*p,y:-l*h+u+r*p,z:a*h-r*u+p}}}function cr(n){return n===ei||n===ti}function ME(n,e,t){if(xE(n,e)||n.datum_type===wl||e.datum_type===wl)return t;var i=n.a,s=n.es;if(n.datum_type===ki){var o=bf(n,!1,t);if(o!==0)return;i=Xu,s=Ju}var r=e.a,a=e.b,l=e.es;if(e.datum_type===ki&&(r=Xu,a=Sw,l=Ju),s===l&&i===r&&!cr(n.datum_type)&&!cr(e.datum_type))return t;if(t=Af(t,s,i),cr(n.datum_type)&&(t=IE(t,n.datum_type,n.datum_params)),cr(e.datum_type)&&(t=SE(t,e.datum_type,e.datum_params)),t=vf(t,l,r,a),e.datum_type===ki){var c=bf(e,!0,t);if(c!==0)return}return t}function bf(n,e,t){if(n.grids===null||n.grids.length===0)return console.log("Grid shift grids not found"),-1;var i={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<n.grids.length;r++){var a=n.grids[r];if(o.push(a.name),a.isNull){s=i;break}if(a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var l=a.grid.subgrids,c=0,h=l.length;c<h;c++){var u=l[c],p=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,f=u.ll[0]-p,m=u.ll[1]-p,y=u.ll[0]+(u.lim[0]-1)*u.del[0]+p,g=u.ll[1]+(u.lim[1]-1)*u.del[1]+p;if(!(m>i.y||f>i.x||g<i.y||y<i.x)&&(s=TE(i,e,u),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*bt+" "+i.y*bt+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function TE(n,e,t){var i={x:Number.NaN,y:Number.NaN};if(isNaN(n.x))return i;var s={x:n.x,y:n.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=J(s.x-Math.PI)+Math.PI;var o=Cf(s,t);if(e){if(isNaN(o.x))return i;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,a=1e-12,l,c;do{if(c=Cf(o,t),isNaN(c.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:s.x-(c.x+o.x),y:s.y-(c.y+o.y)},o.x+=l.x,o.y+=l.y}while(r--&&Math.abs(l.x)>a&&Math.abs(l.y)>a);if(r<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=J(o.x+t.ll[0]),i.y=o.y+t.ll[1]}else isNaN(o.x)||(i.x=n.x+o.x,i.y=n.y+o.y);return i}function Cf(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},i={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*i.x,y:t.y-1*i.y},o={x:Number.NaN,y:Number.NaN},r;if(i.x<0||i.x>=e.lim[0]||i.y<0||i.y>=e.lim[1])return o;r=i.y*e.lim[0]+i.x;var a={x:e.cvs[r][0],y:e.cvs[r][1]};r++;var l={x:e.cvs[r][0],y:e.cvs[r][1]};r+=e.lim[0];var c={x:e.cvs[r][0],y:e.cvs[r][1]};r--;var h={x:e.cvs[r][0],y:e.cvs[r][1]},u=s.x*s.y,p=s.x*(1-s.y),f=(1-s.x)*(1-s.y),m=(1-s.x)*s.y;return o.x=f*a.x+p*l.x+m*h.x+u*c.x,o.y=f*a.y+p*l.y+m*h.y+u*c.y,o}function wf(n,e,t){var i=t.x,s=t.y,o=t.z||0,r,a,l,c={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(r=i,"ew".indexOf(n.axis[l])!==-1?a="x":a="y"):l===1?(r=s,"ns".indexOf(n.axis[l])!==-1?a="y":a="x"):(r=o,a="z"),n.axis[l]){case"e":c[a]=r;break;case"w":c[a]=-r;break;case"n":c[a]=r;break;case"s":c[a]=-r;break;case"u":t[a]!==void 0&&(c.z=r);break;case"d":t[a]!==void 0&&(c.z=-r);break;default:return null}return c}function Ef(n){var e={x:n[0],y:n[1]};return n.length>2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function BE(n){xf(n.x),xf(n.y)}function xf(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function _E(n,e){return(n.datum.datum_type===ei||n.datum.datum_type===ti||n.datum.datum_type===ki)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ei||e.datum.datum_type===ti||e.datum.datum_type===ki)&&n.datumCode!=="WGS84"}function dr(n,e,t,i){var s;Array.isArray(t)?t=Ef(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(BE(t),n.datum&&e.datum&&_E(n,e)&&(s=new Pt("WGS84"),t=dr(n,s,t,i),n=s),i&&n.axis!=="enu"&&(t=wf(n,!1,t)),n.projName==="longlat")t={x:t.x*Oe,y:t.y*Oe,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=ME(n.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*bt,y:t.y*bt,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),i&&e.axis!=="enu"?wf(e,!0,t):(t&&!o&&delete t.z,t)}var If=Pt("WGS84");function Bl(n,e,t,i){var s,o,r;return Array.isArray(t)?(s=dr(n,e,t,i)||{x:NaN,y:NaN},t.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(t.slice(3)):[s.x,s.y,t[2]].concat(t.slice(3)):[s.x,s.y].concat(t.slice(2)):[s.x,s.y]):(o=dr(n,e,t,i),r=Object.keys(t),r.length===2||r.forEach(function(a){if(typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;o[a]=t[a]}),o)}function hr(n){return n instanceof Pt?n:typeof n=="object"&&"oProj"in n?n.oProj:Pt(n)}function kE(n,e,t){var i,s,o=!1,r;return typeof e>"u"?(s=hr(n),i=If,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=hr(n),i=If,o=!0),i||(i=hr(n)),s||(s=hr(e)),t?Bl(i,s,t):(r={forward:function(a,l){return Bl(i,s,a,l)},inverse:function(a,l){return Bl(s,i,a,l)}},o&&(r.oProj=s),r)}var Sf=6,Mf="AJSAJS",Tf="AFAFAF",Ni=65,wt=73,Dt=79,Fs=86,Os=90;const PE={forward:Bf,inverse:DE,toPoint:_f};function Bf(n,e){return e=e||5,RE(NE({lat:n[1],lon:n[0]}),e)}function DE(n){var e=kl(Df(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function _f(n){var e=kl(Df(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function _l(n){return n*(Math.PI/180)}function kf(n){return 180*(n/Math.PI)}function NE(n){var e=n.lat,t=n.lon,i=6378137,s=.00669438,o=.9996,r,a,l,c,h,u,p,f=_l(e),m=_l(t),y,g;g=Math.floor((t+180)/6)+1,t===180&&(g=60),e>=56&&e<64&&t>=3&&t<12&&(g=32),e>=72&&e<84&&(t>=0&&t<9?g=31:t>=9&&t<21?g=33:t>=21&&t<33?g=35:t>=33&&t<42&&(g=37)),r=(g-1)*6-180+3,y=_l(r),a=s/(1-s),l=i/Math.sqrt(1-s*Math.sin(f)*Math.sin(f)),c=Math.tan(f)*Math.tan(f),h=a*Math.cos(f)*Math.cos(f),u=Math.cos(f)*(m-y),p=i*((1-s/4-3*s*s/64-5*s*s*s/256)*f-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*f)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*f)-35*s*s*s/3072*Math.sin(6*f));var A=o*l*(u+(1-c+h)*u*u*u/6+(5-18*c+c*c+72*h-58*a)*u*u*u*u*u/120)+5e5,v=o*(p+l*Math.tan(f)*(u*u/2+(5-c+9*h+4*h*h)*u*u*u*u/24+(61-58*c+c*c+600*h-330*a)*u*u*u*u*u*u/720));return e<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(A),zoneNumber:g,zoneLetter:LE(e)}}function kl(n){var e=n.northing,t=n.easting,i=n.zoneLetter,s=n.zoneNumber;if(s<0||s>60)return null;var o=.9996,r=6378137,a=.00669438,l,c=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),h,u,p,f,m,y,g,A,v,C=t-5e5,w=e;i<"N"&&(w-=1e7),g=(s-1)*6-180+3,l=a/(1-a),y=w/o,A=y/(r*(1-a/4-3*a*a/64-5*a*a*a/256)),v=A+(3*c/2-27*c*c*c/32)*Math.sin(2*A)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*A)+151*c*c*c/96*Math.sin(6*A),h=r/Math.sqrt(1-a*Math.sin(v)*Math.sin(v)),u=Math.tan(v)*Math.tan(v),p=l*Math.cos(v)*Math.cos(v),f=r*(1-a)/Math.pow(1-a*Math.sin(v)*Math.sin(v),1.5),m=C/(h*o);var S=v-h*Math.tan(v)/f*(m*m/2-(5+3*u+10*p-4*p*p-9*l)*m*m*m*m/24+(61+90*u+298*p+45*u*u-252*l-3*p*p)*m*m*m*m*m*m/720);S=kf(S);var x=(m-(1+2*u+p)*m*m*m/6+(5-2*p+28*u-3*p*p+8*l+24*u*u)*m*m*m*m*m/120)/Math.cos(v);x=g+kf(x);var I;if(n.accuracy){var B=kl({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});I={top:B.lat,right:B.lon,bottom:S,left:x}}else I={lat:S,lon:x};return I}function LE(n){var e="Z";return 84>=n&&n>=72?e="X":72>n&&n>=64?e="W":64>n&&n>=56?e="V":56>n&&n>=48?e="U":48>n&&n>=40?e="T":40>n&&n>=32?e="S":32>n&&n>=24?e="R":24>n&&n>=16?e="Q":16>n&&n>=8?e="P":8>n&&n>=0?e="N":0>n&&n>=-8?e="M":-8>n&&n>=-16?e="L":-16>n&&n>=-24?e="K":-24>n&&n>=-32?e="J":-32>n&&n>=-40?e="H":-40>n&&n>=-48?e="G":-48>n&&n>=-56?e="F":-56>n&&n>=-64?e="E":-64>n&&n>=-72?e="D":-72>n&&n>=-80&&(e="C"),e}function RE(n,e){var t="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+FE(n.easting,n.northing,n.zoneNumber)+t.substr(t.length-5,e)+i.substr(i.length-5,e)}function FE(n,e,t){var i=Pf(t),s=Math.floor(n/1e5),o=Math.floor(e/1e5)%20;return OE(s,o,i)}function Pf(n){var e=n%Sf;return e===0&&(e=Sf),e}function OE(n,e,t){var i=t-1,s=Mf.charCodeAt(i),o=Tf.charCodeAt(i),r=s+n-1,a=o+e,l=!1;r>Os&&(r=r-Os+Ni-1,l=!0),(r===wt||s<wt&&r>wt||(r>wt||s<wt)&&l)&&r++,(r===Dt||s<Dt&&r>Dt||(r>Dt||s<Dt)&&l)&&(r++,r===wt&&r++),r>Os&&(r=r-Os+Ni-1),a>Fs?(a=a-Fs+Ni-1,l=!0):l=!1,(a===wt||o<wt&&a>wt||(a>wt||o<wt)&&l)&&a++,(a===Dt||o<Dt&&a>Dt||(a>Dt||o<Dt)&&l)&&(a++,a===wt&&a++),a>Fs&&(a=a-Fs+Ni-1);var c=String.fromCharCode(r)+String.fromCharCode(a);return c}function Df(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var e=n.length,t=null,i="",s,o=0;!/[A-Z]/.test(s=n.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+n;i+=s,o++}var r=parseInt(i,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+n;var a=n.charAt(o++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+n;t=n.substring(o,o+=2);for(var l=Pf(r),c=GE(t.charAt(0),l),h=UE(t.charAt(1),l);h<VE(a);)h+=2e6;var u=e-o;if(u%2!==0)throw`MGRSPoint has to have an even number
|
|
13
|
+
`)),e)})}const Oh=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;Oh[n]=e}class Xo{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let i=0,s=e.length|0;i<s;i++)t=t>>>8^Oh[(t^e[i])&255];this.crc=t}get(){return~this.crc}}class Gh extends TransformStream{constructor(){let e;const t=new Xo;super({transform(i,s){t.append(i),s.enqueue(i)},flush(){const i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,t.get()),e.value=i}}),e=this}}function vb(n){if(typeof TextEncoder==xn){n=unescape(encodeURIComponent(n));const e=new Uint8Array(n.length);for(let t=0;t<e.length;t++)e[t]=n.charCodeAt(t);return e}else return new TextEncoder().encode(n)}const pt={concat(n,e){if(n.length===0||e.length===0)return n.concat(e);const t=n[n.length-1],i=pt.getPartial(t);return i===32?n.concat(e):pt._shiftRight(e,i,t|0,n.slice(0,n.length-1))},bitLength(n){const e=n.length;if(e===0)return 0;const t=n[e-1];return(e-1)*32+pt.getPartial(t)},clamp(n,e){if(n.length*32<e)return n;n=n.slice(0,Math.ceil(e/32));const t=n.length;return e=e&31,t>0&&e&&(n[t-1]=pt.partial(e,n[t-1]&2147483648>>e-1,1)),n},partial(n,e,t){return n===32?e:(t?e|0:e<<32-n)+n*1099511627776},getPartial(n){return Math.round(n/1099511627776)||32},_shiftRight(n,e,t,i){for(i===void 0&&(i=[]);e>=32;e-=32)i.push(t),t=0;if(e===0)return i.concat(n);for(let r=0;r<n.length;r++)i.push(t|n[r]>>>e),t=n[r]<<32-e;const s=n.length?n[n.length-1]:0,o=pt.getPartial(s);return i.push(pt.partial(e+o&31,e+o>32?t:i.pop(),1)),i}},Jo={bytes:{fromBits(n){const t=pt.bitLength(n)/8,i=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=n[o/4]),i[o]=s>>>24,s<<=8;return i},toBits(n){const e=[];let t,i=0;for(t=0;t<n.length;t++)i=i<<8|n[t],(t&3)===3&&(e.push(i),i=0);return t&3&&e.push(pt.partial(8*(t&3),i)),e}}},Uh={};Uh.sha1=class{constructor(n){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],n?(e._h=n._h.slice(0),e._buffer=n._buffer.slice(0),e._length=n._length):e.reset()}reset(){const n=this;return n._h=n._init.slice(0),n._buffer=[],n._length=0,n}update(n){const e=this;typeof n=="string"&&(n=Jo.utf8String.toBits(n));const t=e._buffer=pt.concat(e._buffer,n),i=e._length,s=e._length=i+pt.bitLength(n);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(t);let r=0;for(let a=e.blockSize+i-(e.blockSize+i&e.blockSize-1);a<=s;a+=e.blockSize)e._block(o.subarray(16*r,16*(r+1))),r+=1;return t.splice(0,16*r),e}finalize(){const n=this;let e=n._buffer;const t=n._h;e=pt.concat(e,[pt.partial(1,1)]);for(let i=e.length+2;i&15;i++)e.push(0);for(e.push(Math.floor(n._length/4294967296)),e.push(n._length|0);e.length;)n._block(e.splice(0,16));return n.reset(),t}_f(n,e,t,i){if(n<=19)return e&t|~e&i;if(n<=39)return e^t^i;if(n<=59)return e&t|e&i|t&i;if(n<=79)return e^t^i}_S(n,e){return e<<n|e>>>32-n}_block(n){const e=this,t=e._h,i=Array(80);for(let c=0;c<16;c++)i[c]=n[c];let s=t[0],o=t[1],r=t[2],a=t[3],l=t[4];for(let c=0;c<=79;c++){c>=16&&(i[c]=e._S(1,i[c-3]^i[c-8]^i[c-14]^i[c-16]));const h=e._S(5,s)+e._f(c,o,r,a)+l+i[c]+e._key[Math.floor(c/20)]|0;l=a,a=r,r=e._S(30,o),o=s,s=h}t[0]=t[0]+s|0,t[1]=t[1]+o|0,t[2]=t[2]+r|0,t[3]=t[3]+a|0,t[4]=t[4]+l|0}};const Vh={};Vh.aes=class{constructor(n){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],i=e._tables[1],s=n.length;let o,r,a,l=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[r=n.slice(0),a=[]],o=s;o<4*s+28;o++){let c=r[o-1];(o%s===0||s===8&&o%s===4)&&(c=t[c>>>24]<<24^t[c>>16&255]<<16^t[c>>8&255]<<8^t[c&255],o%s===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),r[o]=r[o-s]^c}for(let c=0;o;c++,o--){const h=r[c&3?o:o-4];o<=4||c<4?a[c]=h:a[c]=i[0][t[h>>>24]]^i[1][t[h>>16&255]]^i[2][t[h>>8&255]]^i[3][t[h&255]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],e=this._tables[1],t=n[4],i=e[4],s=[],o=[];let r,a,l,c;for(let h=0;h<256;h++)o[(s[h]=h<<1^(h>>7)*283)^h]=h;for(let h=r=0;!t[h];h^=a||1,r=o[r]||1){let u=r^r<<1^r<<2^r<<3^r<<4;u=u>>8^u&255^99,t[h]=u,i[u]=h,c=s[l=s[a=s[h]]];let p=c*16843009^l*65537^a*257^h*16843008,f=s[u]*257^u*16843008;for(let m=0;m<4;m++)n[m][h]=f=f<<24^f>>>8,e[m][u]=p=p<<24^p>>>8}for(let h=0;h<5;h++)n[h]=n[h].slice(0),e[h]=e[h].slice(0)}_crypt(n,e){if(n.length!==4)throw new Error("invalid aes block size");const t=this._key[e],i=t.length/4-2,s=[0,0,0,0],o=this._tables[e],r=o[0],a=o[1],l=o[2],c=o[3],h=o[4];let u=n[0]^t[0],p=n[e?3:1]^t[1],f=n[2]^t[2],m=n[e?1:3]^t[3],y=4,g,A,v;for(let C=0;C<i;C++)g=r[u>>>24]^a[p>>16&255]^l[f>>8&255]^c[m&255]^t[y],A=r[p>>>24]^a[f>>16&255]^l[m>>8&255]^c[u&255]^t[y+1],v=r[f>>>24]^a[m>>16&255]^l[u>>8&255]^c[p&255]^t[y+2],m=r[m>>>24]^a[u>>16&255]^l[p>>8&255]^c[f&255]^t[y+3],y+=4,u=g,p=A,f=v;for(let C=0;C<4;C++)s[e?3&-C:C]=h[u>>>24]<<24^h[p>>16&255]<<16^h[f>>8&255]<<8^h[m&255]^t[y++],g=u,u=p,p=f,f=m,m=g;return s}};const bb={getRandomValues(n){const e=new Uint32Array(n.buffer),t=i=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,i=18e3*(i&65535)+(i>>16)&o,(((s<<16)+i&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,s;i<n.length;i+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[i/4]=o()*4294967296|0}return n}},Qh={};Qh.ctrGladman=class{constructor(n,e){this._prf=n,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)===255){let e=n>>16&255,t=n>>8&255,i=n&255;e===255?(e=0,t===255?(t=0,i===255?i=0:++i):++t):++e,n=0,n+=e<<16,n+=t<<8,n+=i}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,e,t){let i;if(!(i=e.length))return[];const s=pt.bitLength(e);for(let o=0;o<i;o+=4){this.incCounter(t);const r=n.encrypt(t);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return pt.clamp(e,s)}};const Jn={importKey(n){return new Jn.hmacSha1(Jo.bytes.toBits(n))},pbkdf2(n,e,t,i){if(t=t||1e4,i<0||t<0)throw new Error("invalid params to pbkdf2");const s=(i>>5)+1<<2;let o,r,a,l,c;const h=new ArrayBuffer(s),u=new DataView(h);let p=0;const f=pt;for(e=Jo.bytes.toBits(e),c=1;p<(s||1);c++){for(o=r=n.encrypt(f.concat(e,[c])),a=1;a<t;a++)for(r=n.encrypt(r),l=0;l<r.length;l++)o[l]^=r[l];for(a=0;p<(s||1)&&a<o.length;a++)u.setInt32(p,o[a]),p+=4}return h.slice(0,i/8)}};Jn.hmacSha1=class{constructor(n){const e=this,t=e._hash=Uh.sha1,i=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;n.length>s&&(n=new t().update(n).finalize());for(let o=0;o<s;o++)i[0][o]=n[o]^909522486,i[1][o]=n[o]^1549556828;e._baseHash[0].update(i[0]),e._baseHash[1].update(i[1]),e._resultHash=new t(e._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){const e=this;e._updated=!0,e._resultHash.update(n)}digest(){const n=this,e=n._resultHash.finalize(),t=new n._hash(n._baseHash[1]).update(e).finalize();return n.reset(),t}encrypt(n){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}};const Cb=typeof crypto!=xn&&typeof crypto.getRandomValues==Xn,zh="Invalid password",Hh="Invalid signature",sl="zipjs-abort-check-password";function Yh(n){return Cb?crypto.getRandomValues(n):bb.getRandomValues(n)}const Mi=16,wb="raw",$h={name:"PBKDF2"},Eb={name:"HMAC"},xb="SHA-1",Ib=Object.assign({hash:Eb},$h),ol=Object.assign({iterations:1e3,hash:{name:xb}},$h),Sb=["deriveBits"],Es=[8,12,16],xs=[16,24,32],In=10,Mb=[0,0,0,0],Zo=typeof crypto!=xn,Is=Zo&&crypto.subtle,jh=Zo&&typeof Is!=xn,qt=Jo.bytes,Tb=Vh.aes,Bb=Qh.ctrGladman,_b=Jn.hmacSha1;let Wh=Zo&&jh&&typeof Is.importKey==Xn,qh=Zo&&jh&&typeof Is.deriveBits==Xn;class kb extends TransformStream{constructor({password:e,rawPassword:t,signed:i,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Jh(e,t),signed:i,strength:s-1,pending:new Uint8Array})},async transform(r,a){const l=this,{password:c,strength:h,resolveReady:u,ready:p}=l;c?(await Db(l,h,c,kt(r,0,Es[h]+2)),r=kt(r,Es[h]+2),o?a.error(new Error(sl)):u()):await p;const f=new Uint8Array(r.length-In-(r.length-In)%Mi);a.enqueue(Kh(l,r,f,0,In,!0))},async flush(r){const{signed:a,ctr:l,hmac:c,pending:h,ready:u}=this;if(c&&l){await u;const p=kt(h,0,h.length-In),f=kt(h,h.length-In);let m=new Uint8Array;if(p.length){const y=Ms(qt,p);c.update(y);const g=l.update(y);m=Ss(qt,g)}if(a){const y=kt(Ss(qt,c.digest()),0,In);for(let g=0;g<In;g++)if(y[g]!=f[g])throw new Error(Hh)}r.enqueue(m)}}})}}class Pb extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:i}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:Jh(e,t),strength:i-1,pending:new Uint8Array})},async transform(o,r){const a=this,{password:l,strength:c,resolveReady:h,ready:u}=a;let p=new Uint8Array;l?(p=await Nb(a,c,l),h()):await u;const f=new Uint8Array(p.length+o.length-o.length%Mi);f.set(p,0),r.enqueue(Kh(a,o,f,p.length,0))},async flush(o){const{ctr:r,hmac:a,pending:l,ready:c}=this;if(a&&r){await c;let h=new Uint8Array;if(l.length){const u=r.update(Ms(qt,l));a.update(u),h=Ss(qt,u)}s.signature=Ss(qt,a.digest()).slice(0,In),o.enqueue(rl(h,s.signature))}}}),s=this}}function Kh(n,e,t,i,s,o){const{ctr:r,hmac:a,pending:l}=n,c=e.length-s;l.length&&(e=rl(l,e),t=Fb(t,c-c%Mi));let h;for(h=0;h<=c-Mi;h+=Mi){const u=Ms(qt,kt(e,h,h+Mi));o&&a.update(u);const p=r.update(u);o||a.update(p),t.set(Ss(qt,p),h+i)}return n.pending=kt(e,h),t}async function Db(n,e,t,i){const s=await Xh(n,e,t,kt(i,0,Es[e])),o=kt(i,Es[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(zh)}async function Nb(n,e,t){const i=Yh(new Uint8Array(Es[e])),s=await Xh(n,e,t,i);return rl(i,s)}async function Xh(n,e,t,i){n.password=null;const s=await Lb(wb,t,Ib,!1,Sb),o=await Rb(Object.assign({salt:i},ol),s,8*(xs[e]*2+2)),r=new Uint8Array(o),a=Ms(qt,kt(r,0,xs[e])),l=Ms(qt,kt(r,xs[e],xs[e]*2)),c=kt(r,xs[e]*2);return Object.assign(n,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new Bb(new Tb(a),Array.from(Mb)),hmac:new _b(l)}),c}async function Lb(n,e,t,i,s){if(Wh)try{return await Is.importKey(n,e,t,i,s)}catch{return Wh=!1,Jn.importKey(e)}else return Jn.importKey(e)}async function Rb(n,e,t){if(qh)try{return await Is.deriveBits(n,e,t)}catch{return qh=!1,Jn.pbkdf2(e,n.salt,ol.iterations,t)}else return Jn.pbkdf2(e,n.salt,ol.iterations,t)}function Jh(n,e){return e===Se?vb(n):e}function rl(n,e){let t=n;return n.length+e.length&&(t=new Uint8Array(n.length+e.length),t.set(n,0),t.set(e,n.length)),t}function Fb(n,e){if(e&&e>n.length){const t=n;n=new Uint8Array(e),n.set(t,0)}return n}function kt(n,e,t){return n.subarray(e,t)}function Ss(n,e){return n.fromBits(e)}function Ms(n,e){return n.toBits(e)}const Ts=12;class Ob extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),tu(this,e)},transform(s,o){const r=this;if(r.password){const a=Zh(r,s.subarray(0,Ts));if(r.password=null,a.at(-1)!=r.passwordVerification)throw new Error(zh);s=s.subarray(Ts)}i?o.error(new Error(sl)):o.enqueue(Zh(r,s))}})}}class Gb extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),tu(this,e)},transform(i,s){const o=this;let r,a;if(o.password){o.password=null;const l=Yh(new Uint8Array(Ts));l[Ts-1]=o.passwordVerification,r=new Uint8Array(i.length+l.length),r.set(eu(o,l),0),a=Ts}else r=new Uint8Array(i.length),a=0;r.set(eu(o,i),a),s.enqueue(r)}})}}function Zh(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=nu(n)^e[i],al(n,t[i]);return t}function eu(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=nu(n)^e[i],al(n,e[i]);return t}function tu(n,e){const t=[305419896,591751049,878082192];Object.assign(n,{keys:t,crcKey0:new Xo(t[0]),crcKey2:new Xo(t[2])});for(let i=0;i<e.length;i++)al(n,e.charCodeAt(i))}function al(n,e){let[t,i,s]=n.keys;n.crcKey0.append([e]),t=~n.crcKey0.get(),i=su(Math.imul(su(i+iu(t)),134775813)+1),n.crcKey2.append([i>>>24]),s=~n.crcKey2.get(),n.keys=[t,i,s]}function nu(n){const e=n.keys[2]|2;return iu(Math.imul(e,e^1)>>>8)}function iu(n){return n&255}function su(n){return n&4294967295}const ou="Invalid uncompressed size",Ub="deflate-raw",Vb="deflate64-raw";class Qb extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:i,CompressionStream:s}){super({});const{compressed:o,encrypted:r,useCompressionStream:a,zipCrypto:l,signed:c,level:h}=e,u=this;let p,f,m=super.readable;(!r||l)&&c&&(p=new Gh,m=Kt(m,p)),o&&(m=au(m,a,{level:h,chunkSize:t},s,i,s)),r&&(l?m=Kt(m,new Gb(e)):(f=new Pb(e),m=Kt(m,f))),ru(u,m,()=>{let y;r&&!l&&(y=f.signature),(!r||l)&&c&&(y=new DataView(p.value.buffer).getUint32(0)),u.signature=y})}}class zb extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:i,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:r,signed:a,signature:l,compressed:c,useCompressionStream:h,deflate64:u}=e;let p,f,m=super.readable;r&&(o?m=Kt(m,new Ob(e)):(f=new kb(e),m=Kt(m,f))),c&&(m=au(m,h,{chunkSize:t,deflate64:u},s,i,s)),(!r||o)&&a&&(p=new Gh,m=Kt(m,p)),ru(this,m,()=>{if((!r||o)&&a){const y=new DataView(p.value.buffer);if(l!=y.getUint32(0,!1))throw new Error(Hh)}})}}function ru(n,e,t){e=Kt(e,new TransformStream({flush:t})),Object.defineProperty(n,"readable",{get(){return e}})}function au(n,e,t,i,s,o){const r=e&&i?i:s||o,a=t.deflate64?Vb:Ub;try{n=Kt(n,new r(a,t))}catch(l){if(e)if(s)n=Kt(n,new s(a,t));else if(o)n=Kt(n,new o(a,t));else throw l;else throw l}return n}function Kt(n,e){return n.pipeThrough(e)}const Hb="message",Yb="start",$b="pull",lu="data",jb="ack",cu="close",Wb="deflate",du="inflate";class qb extends TransformStream{constructor(e,t){super({});const i=this,{codecType:s}=e;let o;s.startsWith(Wb)?o=Qb:s.startsWith(du)&&(o=zb),i.outputSize=0;let r=0;const a=new o(e,t),l=super.readable,c=new TransformStream({transform(u,p){u&&u.length&&(r+=u.length,p.enqueue(u))},flush(){Object.assign(i,{inputSize:r})}}),h=new TransformStream({transform(u,p){if(u&&u.length&&(p.enqueue(u),i.outputSize+=u.length,e.outputSize!==Se&&i.outputSize>e.outputSize))throw new Error(ou)},flush(){const{signature:u}=a;Object.assign(i,{signature:u,inputSize:r})}});Object.defineProperty(i,"readable",{get(){return l.pipeThrough(c).pipeThrough(a).pipeThrough(h)}})}}class Kb extends TransformStream{constructor(e){let t;super({transform:i,flush(s){t&&t.length&&s.enqueue(t)}});function i(s,o){if(t){const r=new Uint8Array(t.length+s.length);r.set(t),r.set(s,t.length),s=r,t=null}s.length>e?(o.enqueue(s.slice(0,e)),i(s.slice(e),o)):t=s}}}let hu=typeof Worker!=xn,uu=()=>{};function Xb({initModule:n}){uu=n}class ll{constructor(e,{readable:t,writable:i},{options:s,config:o,streamOptions:r,useWebWorkers:a,transferStreams:l,workerURI:c},h){const{signal:u}=r;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new Kb(o.chunkSize)).pipeThrough(new Jb(r),{signal:u}),writable:i,options:Object.assign({},s),workerURI:c,transferStreams:l,terminate(){return new Promise(p=>{const{worker:f,busy:m}=e;f?(m?e.resolveTerminated=p:(f.terminate(),p()),e.interface=null):p()})},onTaskFinished(){const{resolveTerminated:p}=e;p&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),p()),e.busy=!1,h(e)}}),(a&&hu?Zb:fu)(e,o)}}class Jb extends TransformStream{constructor({onstart:e,onprogress:t,size:i,onend:s}){let o=0;super({async start(){e&&await cl(e,i)},async transform(r,a){o+=r.length,t&&await cl(t,o,i),a.enqueue(r)},async flush(){s&&await cl(s,o)}})}}async function cl(n,...e){try{await n(...e)}catch{}}function fu(n,e){return{run:()=>eC(n,e)}}function Zb(n,e){const{baseURI:t,chunkSize:i}=e;let{wasmURI:s}=e;if(!n.interface){typeof s==Xn&&(s=s());let o;try{o=iC(n.workerURI,t,n)}catch{return hu=!1,fu(n,e)}Object.assign(n,{worker:o,interface:{run:()=>tC(n,{chunkSize:i,wasmURI:s,baseURI:t})}})}return n.interface}async function eC({options:n,readable:e,writable:t,onTaskFinished:i},s){let o;try{if(!n.useCompressionStream)try{await uu(s)}catch{n.useCompressionStream=!0}o=new qb(n,s),await e.pipeThrough(o).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:a,outputSize:l}=o;return{signature:r,inputSize:a,outputSize:l}}catch(r){throw o&&(r.outputSize=o.outputSize),r}finally{i()}}async function tC(n,e){let t,i;const s=new Promise((u,p)=>{t=u,i=p});Object.assign(n,{reader:null,writer:null,resolveResult:t,rejectResult:i,result:s});const{readable:o,options:r}=n,{writable:a,closed:l}=nC(n.writable),c=er({type:Yb,options:r,config:e,readable:o,writable:a},n);c||Object.assign(n,{reader:o.getReader(),writer:a.getWriter()});const h=await s;return c||await a.getWriter().close(),await l,h}function nC(n){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=n.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return n.getWriter().abort(s)}}),closed:t}}let pu=!0;function iC(n,e,t){const i={type:"module"};let s,o;if(typeof n==Xn&&(n=n()),n.startsWith("data:")||n.startsWith("blob:"))try{o=new Worker(n)}catch{o=new Worker(n,i)}else{try{s=new URL(n,e)}catch{s=n}o=new Worker(s,i)}return o.addEventListener(Hb,r=>sC(r,t)),o}function er(n,{worker:e,writer:t,onTaskFinished:i,transferStreams:s}){try{const{value:o,readable:r,writable:a}=n,l=[];if(o&&(n.value=o,l.push(n.value.buffer)),s&&pu?(r&&l.push(r),a&&l.push(a)):n.readable=n.writable=null,l.length)try{return e.postMessage(n,l),!0}catch{pu=!1,n.readable=n.writable=null,e.postMessage(n)}else e.postMessage(n)}catch(o){throw t&&t.releaseLock(),i(),o}}async function sC({data:n},e){const{type:t,value:i,messageId:s,result:o,error:r}=n,{reader:a,writer:l,resolveResult:c,rejectResult:h,onTaskFinished:u}=e;try{if(r){const{message:f,stack:m,code:y,name:g,outputSize:A}=r,v=new Error(f);Object.assign(v,{stack:m,code:y,name:g,outputSize:A}),p(v)}else{if(t==$b){const{value:f,done:m}=await a.read();er({type:lu,value:f,done:m,messageId:s},e)}t==lu&&(await l.ready,await l.write(new Uint8Array(i)),er({type:jb,messageId:s},e)),t==cu&&p(null,o)}}catch(f){er({type:cu,messageId:s},e),p(f)}function p(f,m){f?h(f):c(m),l&&l.releaseLock(),u()}}let Zn=[];const dl=[];let mu=0;async function oC(n,e){const{options:t,config:i}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:a,signed:l,encrypted:c}=t,{workerURI:h,maxWorkers:u}=i;e.transferStreams=s||s===Se;const p=!a&&!l&&!c&&!e.transferStreams;return e.useWebWorkers=!p&&(o||o===Se&&i.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Se,t.useCompressionStream=r||r===Se&&i.useCompressionStream,(await f()).run();async function f(){const y=Zn.find(g=>!g.busy);if(y)return gu(y),new ll(y,n,e,m);if(Zn.length<u){const g={indexWorker:mu};return mu++,Zn.push(g),new ll(g,n,e,m)}else return new Promise(g=>dl.push({resolve:g,stream:n,workerOptions:e}))}function m(y){if(dl.length){const[{resolve:g,stream:A,workerOptions:v}]=dl.splice(0,1);g(new ll(y,A,v,m))}else y.worker?(gu(y),rC(y,e)):Zn=Zn.filter(g=>g!=y)}}function rC(n,e){const{config:t}=e,{terminateWorkerTimeout:i}=t;Number.isFinite(i)&&i>=0&&(n.terminated?n.terminated=!1:n.terminateTimeout=setTimeout(async()=>{Zn=Zn.filter(s=>s!=n);try{await n.terminate()}catch{}},i))}function gu(n){const{terminateTimeout:e}=n;e&&(clearTimeout(e),n.terminateTimeout=null)}const aC="Writer iterator completed too soon",lC="Content-Type",cC=64*1024,yu="writable";class hl{constructor(){this.size=0}init(){this.initialized=!0}}class Au extends hl{get readable(){const e=this,{chunkSize:t=cC}=e,i=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:a}=i,{chunkOffset:l}=this,c=r===Se?t:Math.min(t,r-l),h=await tt(e,o+l,c,a);s.enqueue(h),l+t>r||r===Se&&!h.length&&c?s.close():this.chunkOffset+=t}});return i}}class tr extends Au{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const i=this,s=e+t;let r=await(e||s<i.size?i.blob.slice(e,s):i.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class dC extends hl{constructor(e){super();const t=this,i=new TransformStream,s=[];e&&s.push([lC,e]),Object.defineProperty(t,yu,{get(){return i.writable}}),t.blob=new Response(i.readable,{headers:s}).blob()}getData(){return this.blob}}class hC extends dC{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,i=await super.getData();if(i.text&&t)return i.text();{const s=new FileReader;return new Promise((o,r)=>{Object.assign(s,{onload:({target:a})=>o(a.result),onerror:()=>r(s.error)}),s.readAsText(i,e)})}}}class uC extends Au{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(i,s)=>{await i.init(),s!=t.length-1&&(e.lastDiskOffset+=i.size),e.size+=i.size})),super.init()}async readUint8Array(e,t,i=0){const s=this,{readers:o}=this;let r,a=i;a==-1&&(a=o.length-1);let l=e;for(;o[a]&&l>=o[a].size;)l-=o[a].size,a++;const c=o[a];if(c){const h=c.size;if(l+t<=h)r=await tt(c,l,t);else{const u=h-l;r=new Uint8Array(t);const p=await tt(c,l,u);r.set(p,0);const f=await s.readUint8Array(e+u,t-u,i);r.set(f,u),p.length+f.length<t&&(r=r.subarray(0,p.length+f.length))}}else r=new Uint8Array;return s.lastDiskNumber=Math.max(a,s.lastDiskNumber),r}}class vu extends hl{constructor(e,t=4294967295){super();const i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const a=new WritableStream({async write(h){const{availableSize:u}=i;if(r)h.length>=u?(await l(h.subarray(0,u)),await c(),i.diskOffset+=s.size,i.diskNumber++,r=null,await this.write(h.subarray(u))):await l(h);else{const{value:p,done:f}=await e.next();if(f&&!p)throw new Error(aC);s=p,s.size=0,s.maxSize&&(i.maxSize=s.maxSize),i.availableSize=i.maxSize,await nr(s),o=p.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await c()}});Object.defineProperty(i,yu,{get(){return a}});async function l(h){const u=h.length;u&&(await r.ready,await r.write(h),s.size+=u,i.size+=u,i.availableSize-=u)}async function c(){await r.close()}}}class fC{constructor(e){return Array.isArray(e)&&(e=new uC(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class pC{constructor(e){return e.writable===Se&&typeof e.next==Xn&&(e=new vu(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Se&&(e.size=0),e instanceof vu||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function nr(n,e){if(n.init&&!n.initialized)await n.init(e);else return Promise.resolve()}function tt(n,e,t,i){return n.readUint8Array(e,t,i)}const bu="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),mC=bu.length==256;function gC(n){if(mC){let e="";for(let t=0;t<n.length;t++)e+=bu[n[t]];return e}else return new TextDecoder().decode(n)}function ir(n,e){return e&&e.trim().toLowerCase()=="cp437"?gC(n):new TextDecoder(e).decode(n)}const Cu="filename",wu="rawFilename",Eu="comment",xu="rawComment",Iu="uncompressedSize",Su="compressedSize",Mu="offset",Tu="diskNumberStart",ul="lastModDate",fl="rawLastModDate",Bu="lastAccessDate",yC="rawLastAccessDate",_u="creationDate",ku="rawCreationDate",AC=[Cu,wu,Iu,Su,ul,fl,Eu,xu,Bu,_u,ku,Mu,Tu,"internalFileAttributes","externalFileAttributes","msdosAttributesRaw","msdosAttributes","msDosCompatible","zip64","encrypted","version","versionMadeBy","zipCrypto","directory","executable","compressionMethod","signature","extraField","extraFieldUnix","extraFieldInfoZip","uid","gid","unixMode","setuid","setgid","sticky","bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Pu{constructor(e){AC.forEach(t=>this[t]=e[t])}}const vC="filenameEncoding",bC="commentEncoding",CC="decodeText",wC="extractPrependedData",EC="extractAppendedData",xC="password",IC="rawPassword",SC="passThrough",MC="signal",TC="checkPasswordOnly",BC="checkOverlappingEntryOnly",_C="checkOverlappingEntry",kC="checkSignature",PC="useWebWorkers",DC="useCompressionStream",NC="transferStreams",LC="preventClose",pl="File format is not recognized",RC="End of central directory not found",FC="End of Zip64 central directory locator not found",OC="Central directory header not found",GC="Local file header not found",UC="Zip64 extra field not found",VC="File contains encrypted entry",QC="Encryption method not supported",Du="Compression method not supported",Nu="Split zip file",zC="Overlapping entry found",Lu="utf-8",HC="UTF8",Ru="cp437",YC=[[Iu,Kn],[Su,Kn],[Mu,Kn],[Tu,Wt]],$C={[Wt]:{getValue:Me,bytes:4},[Kn]:{getValue:Ti,bytes:8}};class ml{constructor(e,t={}){Object.assign(this,{reader:new fC(e),options:t,config:gb(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:i}=t;const{config:s}=t;if(await nr(i),(i.size===Se||!i.readUint8Array)&&(i=new tr(await new Response(i.readable).blob()),await nr(i)),i.size<Si)throw new Error(pl);i.chunkSize=yb(s);const o=await ZC(i,Uv,i.size,Si,Wt*16);if(!o){const b=await tt(i,0,4),T=Te(b);throw Me(T)==Th?new Error(Nu):new Error(RC)}const r=Te(o);let a=Me(r,12),l=Me(r,16);const c=o.offset,h=Ze(r,20),u=c+Si+h;let p=Ze(r,4);const f=i.lastDiskNumber||0;let m=Ze(r,6),y=Ze(r,8),g=0,A=0;if(l==Kn||a==Kn||y==Wt||m==Wt){const b=await tt(i,o.offset-Za,Za),T=Te(b);if(Me(T,0)==Vv){l=Ti(T,8);let L=await tt(i,l,el,-1),O=Te(L);const D=o.offset-Za-el;if(Me(O,0)!=_h&&l!=D){const M=l;l=D,l>M&&(g=l-M),L=await tt(i,l,el,-1),O=Te(L)}if(Me(O,0)!=_h)throw new Error(FC);p==Wt&&(p=Me(O,16)),m==Wt&&(m=Me(O,20)),y==Wt&&(y=Ti(O,32)),a==Kn&&(a=Ti(O,40)),l-=a}}if(l>=i.size&&(g=i.size-l-a-Si,l=i.size-a-Si),f!=p)throw new Error(Nu);if(l<0)throw new Error(pl);let v=0,C=await tt(i,l,a,m),w=Te(C);if(a){const b=o.offset-a;if(Me(w,v)!=Bh&&l!=b){const T=l;l=b,l>T&&(g+=l-T),C=await tt(i,l,a,m),w=Te(C)}}const S=o.offset-l-(i.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,C=await tt(i,l,a,m),w=Te(C)),l<0||l>=i.size)throw new Error(pl);const x=nt(t,e,vC),I=nt(t,e,bC);for(let b=0;b<y;b++){const T=new jC(i,s,t.options);if(Me(w,v)!=Bh)throw new Error(OC);Fu(T,w,v+6);const L=!!T.bitFlag.languageEncodingFlag,O=v+46,D=O+T.filenameLength,M=D+T.extraFieldLength,E=Ze(w,v+4),_=E>>8==0,N=E>>8==3,F=C.subarray(O,D),Q=Ze(w,v+32),G=M+Q,P=C.subarray(M,G),k=L,U=L,H=Me(w,v+38),q=H&Ja,j={readOnly:!!(q&nb),hidden:!!(q&ib),system:!!(q&sb),directory:!!(q&tb),archive:!!(q&ob)},ce=Me(w,v+42)+g,de=nt(t,e,CC)||ir,me=k?Lu:x||Ru,Ae=U?Lu:I||Ru;let _e=de(F,me);_e===Se&&(_e=ir(F,me));let Je=de(P,Ae);Je===Se&&(Je=ir(P,Ae)),Object.assign(T,{versionMadeBy:E,msDosCompatible:_,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:ce,diskNumberStart:Ze(w,v+34),internalFileAttributes:Ze(w,v+36),externalFileAttributes:H,msdosAttributesRaw:q,msdosAttributes:j,rawFilename:F,filenameUTF8:k,commentUTF8:U,rawExtraField:C.subarray(D,M),rawComment:P,filename:_e,comment:Je}),A=Math.max(ce,A),Ou(T,T,w,v+6);const lt=T.externalFileAttributes>>16&Wt;T.unixMode===Se&&(lt&(rb|nl|tl))!=0&&(T.unixMode=lt);const ct=!!(T.unixMode&ab),Bt=!!(T.unixMode&lb),vt=!!(T.unixMode&cb),W=T.unixMode!==Se?(T.unixMode&nl)!=0:N&&(lt&nl)!=0,Y=T.unixMode!==Se&&(T.unixMode&Lh)==tl,te=(lt&Lh)==tl;Object.assign(T,{setuid:ct,setgid:Bt,sticky:vt,unixExternalUpper:lt,internalFileAttribute:T.internalFileAttributes,externalFileAttribute:T.externalFileAttributes,executable:W,directory:Y||te||_&&j.directory||_e.endsWith(db)&&!T.uncompressedSize,zipCrypto:T.encrypted&&!T.extraFieldAES});const ze=new Pu(T);ze.getData=(Yt,yi)=>T.getData(Yt,ze,t.readRanges,yi),ze.arrayBuffer=async Yt=>{const yi=new TransformStream,[$n]=await Promise.all([new Response(yi.readable).arrayBuffer(),T.getData(yi,ze,t.readRanges,Yt)]);return $n},v=G;const{onprogress:It}=e;if(It)try{await It(b+1,y,new Pu(T))}catch{}yield ze}const B=nt(t,e,wC),R=nt(t,e,EC);return B&&(t.prependedData=A>0?await tt(i,0,A):new Uint8Array),t.comment=h?await tt(i,c+Si,h):new Uint8Array,R&&(t.appendedData=u<i.size?await tt(i,u,i.size-u):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const i of this.getEntriesGenerator(e))t.push(i);return t}async close(){}}class jC{constructor(e,t,i){Object.assign(this,{reader:e,config:t,options:i})}async getData(e,t,i,s={}){const o=this,{reader:r,offset:a,diskNumberStart:l,extraFieldAES:c,extraFieldZip64:h,compressionMethod:u,config:p,bitFlag:f,signature:m,rawLastModDate:y,uncompressedSize:g,compressedSize:A}=o,{dataDescriptor:v}=f,C=t.localDirectory={},w=await tt(r,a,il,l),S=Te(w);let x=nt(o,s,xC),I=nt(o,s,IC);const B=nt(o,s,SC);if(x=x&&x.length&&x,I=I&&I.length&&I,c&&c.originalCompressionMethod!=Fv)throw new Error(Du);if(u!=Rv&&u!=Lv&&u!=Mh&&!B)throw new Error(Du);if(Me(S,0)!=Ov)throw new Error(GC);Fu(C,S,4);const{extraFieldLength:R,filenameLength:b,lastAccessDate:T,creationDate:L}=C;C.rawExtraField=R?await tt(r,a+il+b,R,l):new Uint8Array,Ou(o,C,S,4,!0),Object.assign(t,{lastAccessDate:T,creationDate:L});const O=o.encrypted&&C.encrypted&&!B,D=O&&!c;if(B||(t.zipCrypto=D),O){if(!D&&c.strength===Se)throw new Error(QC);if(!x&&!I)throw new Error(VC)}const M=a+il+b+R,E=A,_=r.readable;Object.assign(_,{diskNumberStart:l,offset:M,size:E});const N=nt(o,s,MC),F=nt(o,s,TC);let Q=nt(o,s,_C);const G=nt(o,s,BC);G&&(Q=!0);const{onstart:P,onprogress:k,onend:U}=s,H=u==Mh;let q=nt(o,s,DC);H&&(q=!1);const j={options:{codecType:du,password:x,rawPassword:I,zipCrypto:D,encryptionStrength:c&&c.strength,signed:nt(o,s,kC)&&!B,passwordVerification:D&&(v?y>>>8&Ja:m>>>24&Ja),outputSize:B?A:g,signature:m,compressed:u!=0&&!B,encrypted:o.encrypted&&!B,useWebWorkers:nt(o,s,PC),useCompressionStream:q,transferStreams:nt(o,s,NC),deflate64:H,checkPasswordOnly:F},config:p,streamOptions:{signal:N,size:E,onstart:P,onprogress:k,onend:U}};Q&&await JC({reader:r,fileEntry:t,offset:a,diskNumberStart:l,signature:m,compressedSize:A,uncompressedSize:g,dataOffset:M,dataDescriptor:v||C.bitFlag.dataDescriptor,extraFieldZip64:h||C.extraFieldZip64,readRanges:i});let ce;try{if(!G){F&&(e=new WritableStream),e=new pC(e),await nr(e,B?A:g),{writable:ce}=e;const{outputSize:de}=await oC({readable:_,writable:ce},j);if(e.size+=de,de!=(B?A:g))throw new Error(ou)}}catch(de){if(de.outputSize!==Se&&(e.size+=de.outputSize),!F||de.message!=sl)throw de}finally{!nt(o,s,LC)&&ce&&!ce.locked&&await ce.getWriter().close()}return F||G?Se:e.getData?e.getData():ce}}function Fu(n,e,t){const i=n.rawBitFlag=Ze(e,t+2),s=(i&Ph)==Ph,o=Me(e,t+6);Object.assign(n,{encrypted:s,version:Ze(e,t),bitFlag:{level:(i&eb)>>1,dataDescriptor:(i&Dh)==Dh,languageEncodingFlag:(i&Nh)==Nh},rawLastModDate:o,lastModDate:ew(o),filenameLength:Ze(e,t+22),extraFieldLength:Ze(e,t+24)})}function Ou(n,e,t,i,s){const{rawExtraField:o}=e,r=e.extraField=new Map,a=Te(new Uint8Array(o));let l=0;try{for(;l<o.length;){const v=Ze(a,l),C=Ze(a,l+2);r.set(v,{type:v,data:o.slice(l+4,l+4+C)}),l+=4+C}}catch{}const c=Ze(t,i+4);Object.assign(e,{signature:Me(t,i+hb),compressedSize:Me(t,i+ub),uncompressedSize:Me(t,i+fb)});const h=r.get(Hv);h&&(WC(h,e),e.extraFieldZip64=h);const u=r.get(qv);u&&(Gu(u,Cu,wu,e,n),e.extraFieldUnicodePath=u);const p=r.get(Kv);p&&(Gu(p,Eu,xu,e,n),e.extraFieldUnicodeComment=p);const f=r.get(Yv);f?(qC(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const m=r.get($v);m&&(KC(m,e),e.extraFieldNTFS=m);const y=r.get(Zv);if(y)Uu(y,e,!1),e.extraFieldUnix=y;else{const v=r.get(Jv);v&&(Uu(v,e,!0),e.extraFieldInfoZip=v)}const g=r.get(Wv);g&&(XC(g,e,s),e.extraFieldExtendedTimestamp=g);const A=r.get(Xv);A&&(e.extraFieldUSDZ=A)}function WC(n,e){e.zip64=!0;const t=Te(n.data),i=YC.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<i.length;s++){const[r,a]=i[s];if(e[r]==a){const l=$C[a];e[r]=n[r]=l.getValue(t,o),o+=l.bytes}else if(n[r])throw new Error(UC)}}function Gu(n,e,t,i,s){const o=Te(n.data),r=new Xo;r.append(s[t]);const a=Te(new Uint8Array(4));a.setUint32(0,r.get(),!0);const l=Me(o,1);Object.assign(n,{version:Sn(o,0),[e]:ir(n.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&l==Me(a,0)}),n.valid&&(i[e]=n[e],i[e+HC]=!0)}function qC(n,e,t){const i=Te(n.data),s=Sn(i,4);Object.assign(n,{vendorVersion:Sn(i,0),vendorId:Sn(i,2),strength:s,originalCompressionMethod:t,compressionMethod:Ze(i,5)}),e.compressionMethod=n.compressionMethod}function KC(n,e){const t=Te(n.data);let i=4,s;try{for(;i<n.data.length&&!s;){const o=Ze(t,i),r=Ze(t,i+2);o==jv&&(s=n.data.slice(i+4,i+4+r)),i+=4+r}}catch{}try{if(s&&s.length==24){const o=Te(s),r=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),l=o.getBigUint64(16,!0);Object.assign(n,{rawLastModDate:r,rawLastAccessDate:a,rawCreationDate:l});const c=gl(r),h=gl(a),u=gl(l),p={lastModDate:c,lastAccessDate:h,creationDate:u};Object.assign(n,p),Object.assign(e,p)}}catch{}}function Uu(n,e,t){try{const i=Te(new Uint8Array(n.data));let s=0;const o=Sn(i,s++),r=Sn(i,s++),a=n.data.subarray(s,s+r);s+=r;const l=Vu(a),c=Sn(i,s++),h=n.data.subarray(s,s+c);s+=c;const u=Vu(h);let p=Se;if(!t&&s+2<=n.data.length){const f=n.data;p=new DataView(f.buffer,f.byteOffset+s,2).getUint16(0,!0)}Object.assign(n,{version:o,uid:l,gid:u,unixMode:p}),l!==Se&&(e.uid=l),u!==Se&&(e.gid=u),p!==Se&&(e.unixMode=p)}catch{}}function Vu(n){const e=new Uint8Array(4);return e.set(n,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function XC(n,e,t){const i=Te(n.data),s=Sn(i,0),o=[],r=[];t?((s&1)==1&&(o.push(ul),r.push(fl)),(s&2)==2&&(o.push(Bu),r.push(yC)),(s&4)==4&&(o.push(_u),r.push(ku))):n.data.length>=5&&(o.push(ul),r.push(fl));let a=1;o.forEach((l,c)=>{if(n.data.length>=a+4){const h=Me(i,a);e[l]=n[l]=new Date(h*1e3);const u=r[c];n[u]=h}a+=4})}async function JC({reader:n,fileEntry:e,offset:t,diskNumberStart:i,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:a,dataDescriptor:l,extraFieldZip64:c,readRanges:h}){let u=0;if(i)for(let m=0;m<i;m++){const y=n.readers[m];u+=y.size}let p=0;if(l&&(c?p=zv:p=Qv),p){const m=await tt(n,a+o,p+kh,i);if(Me(Te(m),0)==Gv){const g=Me(Te(m),4);let A,v;c?(A=Ti(Te(m),8),v=Ti(Te(m),16)):(A=Me(Te(m),8),v=Me(Te(m),12)),(e.encrypted&&!e.zipCrypto||g==s)&&A==o&&v==r&&(p+=kh)}}const f={start:u+t,end:u+a+o+p,fileEntry:e};for(const m of h)if(m.fileEntry!=e&&f.start>=m.start&&f.start<m.end){const y=new Error(zC);throw y.overlappingEntry=m.fileEntry,y}h.push(f)}async function ZC(n,e,t,i,s){const o=new Uint8Array(4),r=Te(o);tw(r,0,e);const a=i+s;return await l(i)||await l(Math.min(a,t));async function l(c){const h=t-c,u=await tt(n,h,c);for(let p=u.length-i;p>=0;p--)if(u[p]==o[0]&&u[p+1]==o[1]&&u[p+2]==o[2]&&u[p+3]==o[3])return{offset:h+p,buffer:u.slice(p,p+i).buffer}}}function nt(n,e,t){return e[t]===Se?n.options[t]:e[t]}function ew(n){const e=(n&4294901760)>>16,t=n&Wt;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(t&63488)>>11,(t&2016)>>5,(t&31)*2,0)}catch{}}function gl(n){return new Date(Number(n/BigInt(1e4)-BigInt(116444736e5)))}function Sn(n,e){return n.getUint8(e)}function Ze(n,e){return n.getUint16(e,!0)}function Me(n,e){return n.getUint32(e,!0)}function Ti(n,e){return Number(n.getBigUint64(e,!0))}function tw(n,e,t){n.setUint32(e,t,!0)}function Te(n){return new DataView(n.buffer)}try{Ko({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ke&&ke.tagName.toUpperCase()==="SCRIPT"&&ke.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function nw(n){let e;n({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(r=>{const a=(r=(r+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,l=[];for(let c=0;a>c;c+=4){const h=St.indexOf(r[c])<<18|St.indexOf(r[c+1])<<12|(63&St.indexOf(r[c+2]))<<6|63&St.indexOf(r[c+3]);l.push(h>>16&255),r[c+2]!=="="&&l.push(h>>8&255),r[c+3]!=="="&&l.push(255&h)}return new Uint8Array(l)})(t);let i=new Uint8Array(1024),s=0;for(let r=0;r<t.length;){const a=t[r++];if(128&a){const l=3+(127&a),c=t[r++]<<8|t[r++],h=s-c;o(s+l);for(let u=0;l>u;u++)i[s++]=i[h+u]}else{const l=a;o(s+l);for(let c=0;l>c&&r<t.length;c++)i[s++]=t[r++]}}return(r=>{let a="";const l=r.length;let c=0;for(;l>c+2;c+=3){const u=r[c]<<16|r[c+1]<<8|r[c+2];a+=St[u>>18&63]+St[u>>12&63]+St[u>>6&63]+St[63&u]}const h=l-c;if(h===1){const u=r[c]<<16;a+=St[u>>18&63]+St[u>>12&63]+"=="}else if(h===2){const u=r[c]<<16|r[c+1]<<8;a+=St[u>>18&63]+St[u>>12&63]+St[u>>6&63]+"="}return a})(new Uint8Array(i.buffer.slice(0,s)));function o(r){if(i.length<r){let a=2*i.length;for(;r>a;)a*=2;const l=new Uint8Array(a);l.set(i.subarray(0,s)),i=l}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MA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EFgAOcgE92gAAEARGAAAQBCYAABAEZgAAEgQACARWAAAQBDYAABAEdgAAEgL59gAKkgQZAAQWAAiyBBaYBBYABtAEFgD3fAxsLTYMfuYcABIC+rooABIEHUYkABAEEjAAEAQWKAAQEQbAcC4C9CosAS40AO4UALwEGhAAEgQWIgQAEgQEKgQAEgQGSgQAEgIS2ggAEAQuEAAQBDIQABIAF24FHeQTgHQsjhQBfhQXLAhARgAVtBgcJBgoFC4A6uAQNAg4BgAclBJQeC2mFAJCFAIiFAICFAHiBAGiBAFyBBh8BEIAABAEUgAAEARiAAAQBHIAABAEggAAEASiAAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Fe,Bi,Mt,Bs;function iw(n){if(Fe=n,{malloc:Bi,free:Mt,memory:Bs}=Fe,typeof Bi!="function"||typeof Mt!="function"||!Bs)throw Fe=Bi=Mt=Bs=null,new Error("Invalid WASM module")}function Qu(n,e,t={}){const i=typeof t.level=="number"?t.level:-1,s=typeof t.outBuffer=="number"?t.outBuffer:64*1024,o=typeof t.inBufferSize=="number"?t.inBufferSize:64*1024;return new TransformStream({start(){let r;if(this.out=Bi(s),this.in=Bi(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),n?(this._process=Fe.deflate_process,this._last_consumed=Fe.deflate_last_consumed,this._end=Fe.deflate_end,this.streamHandle=Fe.deflate_new(),e==="gzip"?r=Fe.deflate_init_gzip(this.streamHandle,i):e==="deflate-raw"?r=Fe.deflate_init_raw(this.streamHandle,i):r=Fe.deflate_init(this.streamHandle,i)):e==="deflate64-raw"?(this._process=Fe.inflate9_process,this._last_consumed=Fe.inflate9_last_consumed,this._end=Fe.inflate9_end,this.streamHandle=Fe.inflate9_new(),r=Fe.inflate9_init_raw(this.streamHandle)):(this._process=Fe.inflate_process,this._last_consumed=Fe.inflate_last_consumed,this._end=Fe.inflate_end,this.streamHandle=Fe.inflate_new(),e==="deflate-raw"?r=Fe.inflate_init_raw(this.streamHandle):e==="gzip"?r=Fe.inflate_init_gzip(this.streamHandle):r=Fe.inflate_init(this.streamHandle)),r!==0)throw new Error("init failed:"+r)},transform(r,a){try{const l=r,c=new Uint8Array(Bs.buffer),h=this._process,u=this._last_consumed,p=this.out,f=this._scratch;let m=0;for(;m<l.length;){const y=Math.min(l.length-m,32768);(!this.in||this.inBufferSize<y)&&(this.in&&Mt&&Mt(this.in),this.in=Bi(y),this.inBufferSize=y),c.set(l.subarray(m,m+y),this.in);const g=h(this.streamHandle,this.in,y,p,s,0),A=g&16777215;if(A&&(f.set(c.subarray(p,p+A),0),a.enqueue(f.slice(0,A))),!n){const C=g>>24&255,w=C&128?C-256:C;if(w<0)throw new Error("process error:"+w)}const v=u(this.streamHandle);if(v===0)break;m+=v}}catch(l){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Mt&&Mt(this.in),this.out&&Mt&&Mt(this.out),a.error(l)}},flush(r){try{const a=new Uint8Array(Bs.buffer),l=this._process,c=this.out,h=this._scratch;for(;;){const u=l(this.streamHandle,0,0,c,s,4),p=u&16777215,f=u>>24&255;if(!n){const m=f&128?f-256:f;if(m<0)throw new Error("process error:"+m)}if(p&&(h.set(a.subarray(c,c+p),0),r.enqueue(h.slice(0,p))),f===1||p===0)break}}catch(a){r.error(a)}finally{if(this._end&&this.streamHandle){const a=this._end(this.streamHandle);a!==0&&r.error(new Error("end error:"+a))}this.in&&Mt&&Mt(this.in),this.out&&Mt&&Mt(this.out)}}})}class sw{constructor(e="deflate",t){return Qu(!0,e,t)}}class ow{constructor(e="deflate",t){return Qu(!1,e,t)}}let zu=!1;async function rw(n,{baseURI:e}){if(!zu){let t,i;try{try{i=new URL(n,e)}catch{}t=await(await fetch(i)).arrayBuffer()}catch(o){if(n.startsWith("data:application/wasm;base64,"))t=aw(n);else throw o}const s=await WebAssembly.instantiate(t);iw(s.instance.exports),zu=!0}}function aw(n){const e=n.split(",")[1],t=atob(e),i=t.length,s=new Uint8Array(i);for(let o=0;o<i;++o)s[o]=t.charCodeAt(o);return s.buffer}let yl;nw(Ko),Xb({initModule:n=>{if(!yl){let{wasmURI:e}=n;typeof e==Xn&&(e=e()),yl=rw(e,n)}return yl}}),Ko({CompressionStreamZlib:sw,DecompressionStreamZlib:ow});const Al={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const n={};for(const e of Object.keys(Al))for(const t of Object.keys(Al[e])){const i=Al[e][t];if(typeof i=="string")n[i]=e+"/"+t;else for(let s=0;s<i.length;s++)n[i[s]]=e+"/"+t}return n})(),Ab(Ko);const lw="E84#E3C4!8C4&A1";async function Xt(n){try{const e=await fetch(n);if(!e.ok)return!1;const t=await e.blob();try{const i=new ml(new tr(t),{password:lw}),o=(await i.getEntries()).find(a=>!a.directory&&a.filename.endsWith(".json"));if(!o)return await i.close(),!1;const r=await o.getData(new hC);return await i.close(),JSON.parse(r.trim())}catch{const i=await t.text();try{return JSON.parse(i.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${n}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${n} ${e}`),!1}}function cw(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}class _s{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(i=>i(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(i=>i!==t))}}const Hu="35aa3175ce8b1a55331e.64c93d5e3268979d98c900",Yu=new WeakSet;async function $u(n,e){if(n)try{let t=null;if(typeof e=="string")t=document.querySelector(e);else if(e instanceof HTMLElement)t=e;else if(e&&typeof e=="object"){const o=e.container??e;o instanceof HTMLElement&&(t=o)}if(!t){console.warn("applyWatermark: 未提供有效容器,跳过水印添加");return}if(Yu.has(t))return;Yu.add(t);const{Watermark:i}=await Promise.resolve().then(()=>gR);await new i({content:n.content||"© 2026 晨曦雷霆BIM",fontFamily:n.font||"Arial, sans-serif",fontSize:n.fontSize?`${n.fontSize}px`:"25px",fontWeight:n.fontWeight||"bold",rotate:n.rotate??0,fontColor:n.color||"rgba(225, 225, 225, 1.0)",zIndex:n.zIndex??99999,parent:t,backgroundRepeat:"no-repeat",backgroundPosition:"center"}).create(),console.log("水印已添加")}catch(t){console.error("添加水印出错:",t)}}class ju{cesium;viewer;watermarkEnabled=!0;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new _s;options={flyTo:!0,flyToDuration:0,loadTreeNodeDetails:!0,loadTreeNodeDetailsUrl:"/elementInfo.zip",loadTree:!0,loadTreeUrl:"/allElementsInfo.zip",boxRegionUrl:"/BoundingBoxInfo.zip",regionUrl:"/region.zip",batchIDInfoUrl:"/batchIDInfo.zip",enabledSection:!0,delay:0,tilesetOptions:{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:32,skipLevelOfDetail:!0,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:128,skipLevels:5,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*10,preloadWhenHidden:!0,preferLeaves:!0,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.options.tilesetOptions&&(this.options.tilesetOptions.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE)}deleteAllModels(){const e=[];return Object.keys(this.mapTileset).forEach(t=>{const i=this.mapTileset[t];i&&(this.viewer.scene.primitives.remove(i),e.push(t)),delete this.mapTileset[t],delete this.hasLoaded3dTiles[t],delete this.mapRecordModelId[t]}),this.modelList=[],this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:[]}),e}deleteModels(e){const t=[];return e.forEach(({modelId:i})=>{const s=this.mapTileset[i];s&&(this.viewer.scene.primitives.remove(s),t.push(i)),delete this.mapTileset[i],delete this.hasLoaded3dTiles[i],delete this.mapRecordModelId[i]}),this.modelList=this.modelList.filter(i=>!t.includes(i.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(i=>{const s=`${i.modelId}`,o=this.mapTileset[s];o&&(o.show=!!i.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:i}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,i)}async add3DTilesModel(e,t){const i=t?Nv({},this.options,t):{...this.options};if(e?.length){for(const s of e){const o=`${s.modelId}`;if(this.mapRecordModelId[o])continue;const r=`${s.outPutPath}${s.dbName}/tileset.json`;this.modelList.push({...s,url:r,state:Ii.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(i)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===Ii.NotLoaded);if(!t.length)return;const i=t.length;this.events.emit("loadingStatus",`正在加载 ${i} 个模型`);let s=0,o=!1;if(t.length>0){const r=t[0],a=`${r.outPutPath}${r.dbName}/config.zip`;try{const l=await Xt(a);l&&typeof l=="object"&&this.events.emit("configureLoaded",l)}catch{}}for(const r of t){s++;try{r.state=Ii.Loading;const a=r.url,l=this.getBaseUrlPath(a);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}构件信息`);let c=e.loadTreeNodeDetails?await Xt(`${l}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await Xt(`${l}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${r.modelName}模型数据`);const u=e.boxRegionUrl?await Xt(`${l}${e.boxRegionUrl}`):!1,p=e.batchIDInfoUrl?await Xt(`${l}${e.batchIDInfoUrl}`):!1;p&&(c||(c=p));const f=await this.loadTilesetWithZipSupport(a,r.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(f),await f.readyPromise;const m=`${f?.asset?.tilesetVersion??r.modelId}`;this.mapTileset[`${r.modelId}`]=f;const y={versionId:m,selectedFn:e.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:r.url,treeUrl:`${l}${e.loadTreeUrl}`,nodeUrl:`${l}${e.loadTreeNodeDetailsUrl}`,formData:r.formData,type:"BIM"},node:c||null,tree:h||null,box:null};if(u?.min&&u?.max){const g={x:u.min.X,y:u.min.Y,z:u.min.Z},A={x:u.max.X,y:u.max.Y,z:u.max.Z},v={x:(g.x+A.x)/2,y:(g.y+A.y)/2,z:(g.z+A.z)/2};y.box={min:g,max:A,center:v}}if(!r.formData){const g=await Xt(`${r.outPutPath}${r.dbName}${e.regionUrl}`);if(g)r.formData={modelId:r.modelId.toString(),longitude:g.Longitude,latitude:g.Latitude,distance:1e-6,rotation:30,totalRotation:g.DAngle||0,height:g.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:g?.X||0,Y:g?.Y||0,Z:g?.Z||0};else{const A=t.indexOf(r);r.formData={modelId:r.modelId.toString(),longitude:118.12548706388897,latitude:24.596796919444404,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:0,lonlat:1e-5,modelOptions:[{value:A+1,label:r.modelName}],X:0,Y:0,Z:0}}}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1,y.model.formData=r.formData),f.leiting=y,Xa({Cesium:this.cesium,tileset:f}),r.state=Ii.Loaded,this.mapRecordModelId[r.modelId]=!0,this.events.emit("tilesetLoaded",f),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(f),!o&&e.flyTo&&(this.BIMmodelId=r.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),o=!0),e.delay&&await new Promise(g=>setTimeout(g,e.delay))}catch(a){console.error(`模型 ${r.modelName} 加载失败:`,a),this.events.emit("loadingStatus",`模型 ${r.modelName} 加载失败`),r.state=Ii.Error}}e.mountAll3Dtiles&&e.mountAll3Dtiles(this.modelList),e.onMountAll3Dtiles&&e.onMountAll3Dtiles(this.modelList),this.events.emit("loadingStatus",""),this.events.emit("mountAll3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset})}async addOSGB({files:e,options:t}){const i=this.cesium;if(!e?.length)return;this.events.emit("loadingStatus",`正在加载 ${e.length} 个倾斜摄影模型`);let s=!1,o=0;for(const r of e){o++,this.events.emit("loadingStatus",`正在加载第 ${o}/${e.length} 个模型: 加载${r.modelName}`);try{const{outPutPath:a,dbName:l,modelId:c}=r,u=`${/^(https?|atom):\/\//i.test(a)?a:`${window.location.origin}${a}`}${l}/tileset.json`,p=await i.Cesium3DTileset.fromUrl(u,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(p.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(p),await p.readyPromise,this.mapTileset[`${c}`]=p,this.hasLoaded3dTiles[`${c}`]=(this.hasLoaded3dTiles[`${c}`]||0)+1,this.mapRecordModelId[`${c}`]=!0,!r?.formData){const f=p.root.computedTransform;if(f){const m=i.Matrix4.fromColumnMajorArray(f),y=i.Matrix4.getTranslation(m,new i.Cartesian3),g=i.Ellipsoid.WGS84.cartesianToCartographic(y),A=i.Math.toDegrees(g.longitude),v=i.Math.toDegrees(g.latitude),C=g.height;r.formData={modelId:r.modelId.toString(),longitude:A,latitude:v,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:C,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:0,Y:0,Z:0}}else console.warn(`OSGB模型 ${c} 无法获取初始位置信息`)}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1),p.leiting={versionId:`${p?.asset?.tilesetVersion??c}`,selectedFn:t?.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:u,formData:r.formData,type:"OSGB"},box:null},Xa({Cesium:this.cesium,tileset:p}),this.modelList.push({...r,url:u,state:Ii.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=r.modelId,this.viewer.zoomTo(p),s=!0)}catch(a){console.error(`OSGB模型 ${r.dbName} 加载失败:`,a);continue}}this.events.emit("loadingStatus",""),this.events.emit("onMountAllOsgb3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset}),t?.onMountAllOsgb3Dtiles(this.modelList)}updateOSGBMatrix(e){const{X:t,Y:i,Z:s,modelId:o}=e,r=this.cesium,a=this.mapTileset[o];if(!a){console.warn("tileSet not found for modelId:",o);return}let l=t||0,c=i||0,h=s||0;const u=a.boundingSphere.center,p=r.Transforms.eastNorthUpToFixedFrame(u),f=new r.Cartesian3(l,c,h),m=r.Matrix4.multiplyByPoint(p,f,new r.Cartesian3(0,0,0)),y=r.Cartesian3.subtract(m,u,new r.Cartesian3);a.modelMatrix=r.Matrix4.fromTranslation(y)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:o,cancel:r,...a}=t,l={duration:0,...a};this.viewer.flyTo(s,l).then(c=>{c?o&&o():r&&r()}).catch(c=>{r&&r(),console.error("FlyTo error",c)})}getMapTileset(){return this.mapTileset}getBIMmodelId(){return this.BIMmodelId}getModelList(){return this.modelList}setMapTileset(e){this.mapTileset=e}setBIMmodelId(e){this.BIMmodelId=e}setModelList(e){this.modelList=e}getBaseUrlPath(e){const t=/^(https?|atom):\/\//i.test(e)?e:`${window.location.origin}${e}`,i=t.lastIndexOf("/");return i===-1?".":t.substr(0,i)}async loadTilesetWithZipSupport(e,t,i,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`);if((await fetch(o,{method:"HEAD"})).status===200){const l=await Xt(o);if(l){l?.asset?.watermark&&this.watermarkEnabled&&$u(l.asset.watermark,this.viewer?.container);const c=this.getBaseUrlPath(e),h=f=>{!f||typeof f!="object"||(typeof f.uri=="string"&&!/^(data:|https?:|atom:)\/\//i.test(f.uri)&&(f.uri=encodeURI(`${c}/${f.uri.replace(/^\.?\//,"")}`)),Object.values(f).forEach(m=>{if(Array.isArray(m)){m.forEach(y=>h(y));return}m&&typeof m=="object"&&h(m)}))};h(l);const u=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(l))))}`,p=new s.Resource({url:u});try{return await s.Cesium3DTileset.fromUrl(p,{id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const i=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${i} 目录树...`);try{if(s){const r=await Xt(s);if(Ho(r)&&r[0].name&&(r[0].name=i),r)return t.leiting.tree=r,r}}catch(r){console.error(`Failed to load tree for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async _loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Xt(i);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Xt(i);if(o)return o.batchIdEIDInfos||(o.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=o,o}catch(o){console.error(`Failed to load node details for model ${e}:`,o)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}}const Wu={normal:0,process:2},dw={color:1};function qu(n){return n===1||n==="exist"?1:n===2||n==="process"?2:0}function _i(n){return Number.isNaN(n)?0:n<=1?Math.min(Math.max(n,0),1):Math.min(Math.max(n/255,0),1)}function Ku(n){return Number.isNaN(n)?1:n<=1?Math.min(Math.max(n,0),1):1}function vl(n){if(!n)return null;const e=Number(n.r),t=Number(n.g),i=Number(n.b),s=n.a===void 0?1:Number(n.a);if([e,t,i,s].some(l=>Number.isNaN(l)))return null;const o=Math.round(e*255),r=Math.round(t*255),a=Math.round(i*255);return`rgba(${o},${r},${a},${s})`}function hw(n){if(!n||typeof n!="string")return null;const t=n.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const i=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[i,s,o,r].some(a=>Number.isNaN(a))?null:{r:Math.min(Math.max(i/255,0),1),g:Math.min(Math.max(s/255,0),1),b:Math.min(Math.max(o/255,0),1),a:Math.min(Math.max(r,0),1)}}function uw(n){if(n==null)return null;const e=Number(n);return Number.isNaN(e)?null:e}function fw(n){const e=n.lastIndexOf("-"),t=n.substring(0,e),i=n.substring(e+1);return[t,i]}function bl(n){if(!n)return null;const e=n.Min??n.min,t=n.Max??n.max;if(!e||!t)return null;const i=Number(e.x??e.X),s=Number(e.y??e.Y),o=Number(e.z??e.Z),r=Number(t.x??t.X),a=Number(t.y??t.Y),l=Number(t.z??t.Z);return[i,s,o,r,a,l].some(c=>Number.isNaN(c))?null:{min:{x:i,y:s,z:o},max:{x:r,y:a,z:l}}}function ks(n,e){if(e)return`${e}`;const t=n?.leiting?.model?.modelId??n?.modelId??n?.id;return t==null?null:`${t}`}function pw(n,e){if(e==null)return null;const t=n?.leiting?.node;if(!t)return null;const i=`${e}`,s=t?.[i],o=bl(s?.box3??s?.box);if(o)return o;const r=t?.element?.[i]??t?.elements?.[i]??t?.nodeExtras?.element?.[i]??t?.nodeExtras?.elements?.[i];return bl(r?.box3??r?.box)}function mw(n){const e=n?.leiting?.box;return e?bl({min:e.min,max:e.max}):null}class gw{base;constructor(e){this.base=e}initTime(){const t=this.base.cesium.JulianDate.fromDate(new Date(2023,3,21,10,0));this.base.viewer.clock.currentTime=t,this.base.start=this.base.viewer.clock.currentTime.secondsOfDay*1e3}processAnimation(e,t,i,s=null){if(this.base.start==null)return;const o=this.base.start+(e?.delay??0),r=this.base.start+(e?.playtime??0)+(e?.delay??0);t<=o&&(e.cash=!0,e.groupData.forEach(a=>{const{batchIds:l,modelId:c,rgba:h}=a;if(Array.isArray(l)&&l[0]){l[0][1]=h;const u=i[c];u?u.push(l[0]):i[c]=[l[0]]}})),t>=o&&t<r&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(a=>{const{batchIds:l,playTimeColor:c,modelId:h}=a;if(Array.isArray(l)&&l[0]){l[0][1]=c;const u=i[h];u?u.push(l[0]):i[h]=[l[0]]}})),t>=r&&(e.finished=!0)}onTick=e=>{if(!this.base.cesium||!this.base.viewer)return;const t=e?.currentTime?.secondsOfDay?e.currentTime.secondsOfDay*1e3:this.base.viewer.clock.currentTime.secondsOfDay*1e3,i={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,i,.1)});const s=Object.entries(i);if(s.forEach(([o,r])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:r})}),Object.keys(this.base.mapAnimations).forEach(o=>{const r=this.base.mapAnimations[o];r.length&&r.every(a=>a.finished)&&!this.base.clearedModelIds.has(o)&&(this.base.setTileSyltByConstructionProcessTracking({modelId:o,batchIds:[]}),this.base.clearedModelIds.add(o))}),this.base.recoverStaus){s.length&&(this.base.recoverStaus=!1);return}s.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(o=>{o.groupData.forEach(r=>{const{modelId:a}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:a,batchIds:[]})}),this.base.recoverStaus=!0})};enableConstructionProgressTracking(){this.base.clearedModelIds.clear(),this.initTime(),this.base.groupBatchIds={},Array.isArray(this.base.data)&&(this.base.data.forEach(e=>{e.cash=!1,e.playCash=!1,e.groupData.forEach(t=>{const{batchIds:i,modelId:s,rgba:o}=t;if(Array.isArray(i)&&i[0]){i[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(i[0]):this.base.groupBatchIds[s]=[i[0]]}})}),Object.entries(this.base.groupBatchIds).forEach(([e,t])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t})})),this.base.viewer.clock.onTick.addEventListener(this.onTick)}disableConstructionProgressTracking(){this.base.viewer.clock.onTick.removeEventListener(this.onTick),this.base.viewer.scene.ambientLightIntensity=1,Array.isArray(this.base.data)&&this.base.data.forEach(e=>{e.cash=!0,e.playCash=!0,e.groupData.forEach(t=>{const{modelId:i}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:i,batchIds:s})})}),this.base.start=null}freshConstructionProgressTracking(){const e=this.base.viewer.clock.currentTime.secondsOfDay*1e3,t={};Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.playCash=!1,this.processAnimation(s,e,t)});const i=Object.entries(t);i.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),i.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.groupData.forEach(o=>{const{modelId:r}=o;this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:[]})})})}reStartAnimation(){let e={};this.base.clearedModelIds.clear(),Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData.forEach(i=>{const{batchIds:s,modelId:o,rgba:r}=i;if(Array.isArray(s)&&s[0]){s[0][1]=r;const a=e[o];a?a.push(s[0]):e[o]=[s[0]]}})}),Object.entries(e).forEach(([t,i])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:i})}),this.initTime()}setAllConstructionProgressTracking(e){this.base.data=e,Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData=[],t.finished=!1,t.mergeCpts.forEach(i=>{const s=[];i.cpts.forEach(l=>{s.push({dbName:i.linkModelId,modelId:i.modelId,elementId:`${l}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=Wu.process,r=dw.color,{allElements:a}=this.base.groupByModelId(s);this.base.mapAnimations[i.modelId]=this.base.mapAnimations[i.modelId]||[],this.base.mapAnimations[i.modelId].push(t),Object.entries(a).forEach(([l,c])=>{const[h,u]=fw(l),p=this.base.getTileSyltByConstructionProcessTracking({elementIds:c,modelId:h,color:u,colorRank:o,show:!0,selectionRank:r}),f=t?.playTimeColor?.r??1,m=t?.playTimeColor?.g??1,y=t?.playTimeColor?.b??0,g=t?.playTimeColor?.a??.1,A=this.base.setColor({r:f,g:m,b:y,a:g}),v=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:p,playTimeColor:A,rgba:v})})})})}}class yw{base;constructor(e){this.base=e}attachTileset(e,t,i){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=ks(e,i);o&&(this.base.tilesetMap[o]=e),t&&(this.base.selectedColor=t),this.bindInputs()}bindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.setInputAction(async t=>{if(!this.base.clickToHighlightEnabled){await this.base.clearSelection();return}let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=ks(i.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(i);if(o==="-1")return;let r;const a=this.base.viewer.scene.pickPosition(t.position);if(e.defined(a)){const h=e.Cartographic.fromCartesian(a),u=e.Math.toDegrees(h.longitude),p=e.Math.toDegrees(h.latitude),f=h.height;r=[u,p,f]}const c=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...c,{batchId:o,selectedColor:this.base.selectedColor,rank:0,point:r,isTrigger:!0}],this.base.setBaseStyle(s),await this.base.triggerSelectionChange(s),i.tileset.leiting?.selectedFn)if(i.tileset.leiting.node){const h=i.tileset.leiting.node.batchIdEIDInfos[o].elementID,u=i.tileset.leiting.node.nodeExtras.element[h];u.elementId=h,u.modelId=i.tileset.leiting.model.modelId,i.tileset.leiting.selectedFn({elementInfo:u,elementId:h,point:r,modelId:i.tileset.leiting.model.modelId,_propsData:u})}else i.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){const s=ks(i.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(i);if(o==="-1")return;let r;const a=this.base.viewer.scene.pickPosition(t.position);if(e.defined(a)){const l=e.Cartographic.fromCartesian(a),c=e.Math.toDegrees(l.longitude),h=e.Math.toDegrees(l.latitude),u=l.height;r=[c,h,u]}await this.base.toggleMultiSelect(s,o,this.base.selectedColor,r)}},e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{this.base.ensureSelectionDiv();const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:i.enableRotate,enableTilt:i.enableTilt,enableLook:i.enableLook},i.enableRotate=!1,i.enableTilt=!1,i.enableLook=!1),this.base.selectStart=this.base.cesium.Cartesian2.clone(t.position),this.base.selectEnd=null,this.base.selectionDiv&&this.base.selectStart&&(this.base.selectionDiv.style.left=`${this.base.selectStart.x}px`,this.base.selectionDiv.style.top=`${this.base.selectStart.y}px`,this.base.selectionDiv.style.width="0px",this.base.selectionDiv.style.height="0px",this.base.selectionDiv.style.display="block")},e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{if(!this.base.selectStart||!this.base.selectionDiv)return;const i=performance.now();if(i-this.base.lastDrawTime<20)return;this.base.lastDrawTime=i,this.base.selectEnd=this.base.cesium.Cartesian2.clone(t.endPosition);const s=Math.min(this.base.selectStart.x,this.base.selectEnd.x),o=Math.min(this.base.selectStart.y,this.base.selectEnd.y),r=Math.abs(this.base.selectStart.x-this.base.selectEnd.x),a=Math.abs(this.base.selectStart.y-this.base.selectEnd.y);this.base.selectionDiv.style.left=`${s}px`,this.base.selectionDiv.style.top=`${o}px`,this.base.selectionDiv.style.width=`${r}px`,this.base.selectionDiv.style.height=`${a}px`,this.base.selectionDiv.style.backgroundColor="rgba(0, 255, 255, 0.5)",this.base.selectionDiv.style.position="absolute",this.base.selectionDiv.style.zIndex="2"},e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(async()=>{if(!this.base.selectStart||!this.base.selectionDiv)return;if(!this.base.selectStart||!this.base.selectEnd){this.base.selectionDiv.style.display="none";const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState!==null&&(i.enableRotate=this.base.cameraControllerState.enableRotate,i.enableTilt=this.base.cameraControllerState.enableTilt,i.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null);return}this.base.selectionDiv.style.display="none",await this.base.selectTilesInRectangle(this.base.selectStart,this.base.selectEnd,this.base.selectedColor),this.base.viewer.scene.requestRender(),this.base.selectStart=null,this.base.selectEnd=null;const t=this.base.viewer?.scene?.screenSpaceCameraController;t&&this.base.cameraControllerState!==null&&(t.enableRotate=this.base.cameraControllerState.enableRotate,t.enableTilt=this.base.cameraControllerState.enableTilt,t.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null)},e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}unbindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}}class Aw{cesium;viewer;data;handler;selectedColor="rgba(255,0,0,1.0)";tilesetMap={};hasSelectedFeaturesMap={};colorRankColor=[];showStateMap={};selectedPosition={x:null,y:null};selectionDiv=null;lastDrawTime=0;selectStart=null;selectEnd=null;cameraControllerState=null;start=null;groupBatchIds={};recoverStaus=!1;mapAnimations={};clearedModelIds=new Set;eidToBatchIdMap={};batchIdToElementIdMap={};animationModule;selectionModule;onSelectionChangeCallbacks=[];loadNodeDetailsForModel;loadNodeDetailsCallback;clickToHighlightEnabled=!0;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.animationModule=new gw(this),this.selectionModule=new yw(this)}attachTileset(e,t,i){this.selectionModule.attachTileset(e,t,i)}setLoadNodeDetailsCallback(e){this.loadNodeDetailsCallback=e}selectionChange(e){e&&typeof e=="function"&&this.onSelectionChangeCallbacks.push(e)}removeSelectionChange(e){this.onSelectionChangeCallbacks=this.onSelectionChangeCallbacks.filter(t=>t!==e)}async triggerSelectionChange(e){if(e)await this.loadNodeDetailsForModel(e);else{const t=Object.keys(this.hasSelectedFeaturesMap);t.length>0&&await Promise.all(t.map(i=>{try{return this.loadNodeDetailsForModel(i)}catch(s){return console.error(`Error loading node details for model ${i}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(i=>{try{i(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[i]=o,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}async clearAllHaveSelected(){this.getTargetModelIds().forEach(t=>{this.hasSelectedFeaturesMap[t]&&(delete this.hasSelectedFeaturesMap[t],this.applyShowStyleOnly(t))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange()}async loadAllNodeDetailsForModel(){for(const e of Object.keys(this.tilesetMap))await this.loadNodeDetailsForModel(e)}getSelected(e){const t=e&&typeof e=="object"&&"rank"in e?e.rank:e,i=qu(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(a=>{if(a.rank!==i)return;const l=hw(a.selectedColor);let c=this.getBatchIdToElementIdSync(a.batchId,o);c===null&&(c=a.batchId),a.isTrigger&&s.push({elementId:c,modelId:o,rgba:l||void 0,point:a?.point||void 0})});return s}getBatchIdToElementIdSync(e,t){if(this.batchIdToElementIdMap[t])return this.batchIdToElementIdMap[t].get(e)??null;const s=this.tilesetMap[t]?.leiting?.node?.batchIdEIDInfos;if(s&&Array.isArray(s)){const o=new Map;return s.forEach(r=>{r&&r.elementID&&o.set(`${r.batchId}`,`${r.elementID}`)}),this.batchIdToElementIdMap[t]=o,o.get(e)??null}return null}setAllConstructionProgressTracking(e){this.animationModule.setAllConstructionProgressTracking(e)}initTime(){this.animationModule.initTime()}processAnimation(e,t,i,s=null){this.animationModule.processAnimation(e,t,i,s)}onTick=e=>{this.animationModule.onTick(e)};enableConstructionProgressTracking(){this.animationModule.enableConstructionProgressTracking()}disableConstructionProgressTracking(){this.animationModule.disableConstructionProgressTracking()}freshConstructionProgressTracking(){this.animationModule.freshConstructionProgressTracking()}reStartAnimation(){this.animationModule.reStartAnimation()}setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t}){const i=this.tilesetMap[e];if(!i)return;const s=i?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?i.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):i.style=new this.cesium.Cesium3DTileStyle({color:{conditions:t}}):this.applyShowStyleOnly(e),this.viewer.scene.requestRender()}resumeFlyTo(){this.viewer.clock.shouldAnimate=!0}pauseFlyTo(){this.viewer.clock.shouldAnimate=!1}async flyToObjects({selectCpts:e,options:t}){if(!Array.isArray(e)||e.length===0)return;await this.clearSelection(),await this.setSelectColorUserModelCpt(e,{rank:0});const i=this.cesium,s=t?.scale??1,o=[];for(const r of e){const a=r?.modelId;if(a==null)continue;await this.loadNodeDetailsForModel(a);const l=r?.elementId,c=this.tilesetMap[`${a}`];if(!c)continue;const u=pw(c,l)||mw(c);if(!u)continue;const p=new i.Cartesian3(u.min.x,u.min.y,u.min.z),f=new i.Cartesian3(u.max.x,u.max.y,u.max.z),m=c?.root?.computedTransform??c?.modelMatrix;if(m){const y=i.Matrix4.multiplyByPoint(m,p,new i.Cartesian3),g=i.Matrix4.multiplyByPoint(m,f,new i.Cartesian3);o.push(y,g)}else o.push(p,f)}if(o.length){const r=i.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const a=this.viewer.scene.camera,l=new i.HeadingPitchRange(a.heading,a.pitch,0);a.flyToBoundingSphere(r,{duration:t?.duration??0,complete:t?.complete,offset:l})}else{const r=e[0]?.modelId,a=r?this.tilesetMap[`${r}`]:null;a&&this.viewer.flyTo(a,{duration:t?.duration??0,complete:t?.complete})}}setBaseStyle(e){this.getTargetModelIds(e).forEach(i=>{this.setColorStyle(i)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],i=this.hasSelectedFeaturesMap[e];if(!t||!i?.length)return;const s=new Map;i.forEach(l=>{const c=s.get(l.batchId);(!c||l.rank>=c.rank)&&s.set(l.batchId,l)});const o=new Map;if(s.forEach(({batchId:l,selectedColor:c})=>{o.has(c)||o.set(c,new Set),o.get(c)?.add(l)}),this.colorRankColor.length){const l=new Set;this.colorRankColor.forEach(c=>{const h=o.get(c);h&&h.forEach(u=>l.add(u))}),o.forEach((c,h)=>{if(this.colorRankColor.includes(h))return;const u=new Set;c.forEach(p=>{l.has(p)||u.add(p)}),o.set(h,u)})}const r=[...this.colorRankColor.filter(l=>o.has(l)),...Array.from(o.keys()).filter(l=>!this.colorRankColor.includes(l))],a=[];return r.forEach(l=>{const c=o.get(l);if(!c||!c.size)return;const h=Array.from(c).join("|");h&&a.push([`(regExp('^(${h})$').test(\${id}))`,l])}),a.length?a:void 0}updateTilesetStyle(e){const t=this.tilesetMap[e];if(!t)return;t.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0,o=this.buildColorConditions(e);s||o?t.style=new this.cesium.Cesium3DTileStyle({show:s?{conditions:s}:void 0,color:o?{conditions:o}:void 0}):t.style=void 0,this.viewer.scene.requestRender()}setShowStyle(e){this.getTargetModelIds(e?.modelId).forEach(i=>{const s=this.showStateMap[i]||{batchIds:[],mode:"include"};this.showStateMap[i]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(i)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=_i(Number(e.r)),i=_i(Number(e.g)),s=_i(Number(e.b)),o=Ku(e.a===void 0?1:Number(e.a));return vl({r:t,g:i,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(i=>{const s=i?.modelId,o=i?.elementId;if(s==null||o===void 0||o===null)return;const r=i?.color??i?.rgba,a=this.setColor(r??{r:.4,g:.4,b:.4,a:.1}),l=`${s}-${a}`;t[l]||(t[l]=[]),t[l].push(`${o}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const i=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[i]){const l=this.eidToBatchIdMap[i].get(s);if(l!==void 0)return l}const r=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(r&&Array.isArray(r)){const l=new Map;r.forEach(h=>{const u=`${h.elementID}`,p=`${h.batchId}`;l.has(u)||l.set(u,[]),l.get(u).push(p)}),this.eidToBatchIdMap[i]=l;const c=l.get(s);if(c!==void 0)return c}const a=uw(e);return a!=null?[String(a)]:[]}async setComponentVisibility(e){if(Array.isArray(e)){Object.keys(this.showStateMap).forEach(t=>{this.showStateMap[t]={batchIds:[],mode:"exclude"}});for(const t of e){const i=`${t.modelId}`;this.showStateMap[i]||(this.showStateMap[i]={batchIds:[],mode:"exclude"});const s=this.showStateMap[i];if(!t.show){const o=this.getBatchIds(t.elementId,i);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(i=>{const s=`${i.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${i.elementId}`)});for(const i of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(i);const o=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[i]={batchIds:[],mode:"exclude"};const r=t[i];if(r&&r.size>0){const a=[];for(const l of o)r.has(`${l.elementID}`)||a.push(`${l.batchId}`);this.showStateMap[i].batchIds=a;continue}this.showStateMap[i].batchIds=o.map(a=>a.batchId)}Object.keys(this.showStateMap).forEach(i=>{this.updateTilesetStyle(i)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const i of t)await this.loadNodeDetailsForModel(i),e?this.setShowStyle({modelId:i,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:i,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),i=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const a=r.leiting.node.batchIdEIDInfos,l=new Set(o?.batchIds??[]),c=o?.mode??"exclude",h=new Set;a.forEach(u=>{const p=l.has(`${u.batchId}`);if((c==="include"?p:!p)===e){const m=`${u.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const i=[];return t.forEach(s=>{const o=this.showStateMap[s],r=this.tilesetMap[s];if(!r?.leiting?.node?.batchIdEIDInfos)return;const a=r.leiting.node.batchIdEIDInfos,l=new Set(o?.batchIds??[]),c=o?.mode??"exclude",h=new Set;a.forEach(u=>{const p=l.has(`${u.batchId}`);if((c==="include"?p:!p)===e){const m=`${u.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:i,colorRank:s,show:o,selectionRank:r}){const a=this.tilesetMap[t];if(!Array.isArray(e))return[];const l=a.leiting.node,c=new Set(e),h=l.batchIdEIDInfos.filter(p=>c.has(`${p.elementID}`)).map(p=>String(p.batchId));return h.length?(s===Wu.normal&&!this.colorRankColor.includes(i)&&(this.colorRankColor=[i]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,i]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const i=new Map,s=t?.rank===void 0?"exist":t?.rank,o=qu(s),r=t?.isTrigger??!0;for(const a of e){const l=a?.modelId;if(l==null)continue;const c=`${l}`;await this.loadNodeDetailsForModel(c);const h=Array.isArray(a?.elementIds)?a.elementIds:a?.elementId?[a.elementId]:[];if(!h.length)continue;const u=vl(a?.rgba)||this.selectedColor;for(const p of h){const f=this.getBatchIds(p,c);if(f.length!==0){i.has(c)||i.set(c,[]);for(const m of f)i.get(c)?.push({batchId:m,selectedColor:u,rank:o,isTrigger:r})}}}for(const[a,l]of i){const c=this.mergeSelections(a,l);this.hasSelectedFeaturesMap[a]=c,this.setBaseStyle(a)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:i,rgba:s}=e,o=t?.isTrigger??!0;if(!i)return;await this.loadNodeDetailsForModel(i);const r=String(i),a=this.tilesetMap[r];if(!a)return;const l=a?.leiting?.node?.batchIdEIDInfos;if(!l||!Array.isArray(l))return;const c=[];l.forEach(h=>{h&&h.elementID!==void 0&&c.push(h.elementID)}),c.length!==0&&await this.setSelectColorUserModelCpt([{modelId:r,elementIds:c,rgba:s}],{rank:0,isTrigger:o})}getFeatureId(e){if(this.cesium.defined(e)&&this.cesium.defined(e.getProperty)){const t=e.getProperty("id");return t!=null?String(t):"-1"}return"-1"}getTargetModelIds(e){return e?[e]:Object.keys(this.tilesetMap)}buildShowConditions(e,t){const i=e.join("|");return i?t==="include"?[[`(regExp('^(${i})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${i})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,i,s=1){const o=_i(e),r=_i(t),a=_i(i),l=Ku(s),c=vl({r:o,g:r,b:a,a:l});c&&(this.selectedColor=c)}mergeSelections(e,t){const i=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>i.set(o.batchId,o)),t.forEach(o=>{const r=i.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&i.set(o.batchId,o)}),Array.from(i.values())}async toggleMultiSelect(e,t,i,s){const o=this.hasSelectedFeaturesMap[e]||[],r=o.filter(u=>u.rank!==0),a=o.filter(u=>u.rank===0),c=a.some(u=>u.batchId===t)?a.filter(u=>u.batchId!==t):[...a,{batchId:t,selectedColor:i,rank:0,point:s,isTrigger:!0}],h=[...r,...c];h.length?(this.hasSelectedFeaturesMap[e]=h,this.setBaseStyle(e)):(delete this.hasSelectedFeaturesMap[e],this.applyShowStyleOnly(e)),await this.triggerSelectionChange(e)}ensureSelectionDiv(){if(this.selectionDiv)return;const e=document.createElement("div");e.style.display="none",e.style.pointerEvents="none",e.style.border="1px solid rgba(0, 255, 255, 0.8)",this.viewer.container.appendChild(e),this.selectionDiv=e}isRepeatedClick(e){const t=e?.position;return!t||typeof t.x!="number"||typeof t.y!="number"?!1:this.selectedPosition.x===t.x&&this.selectedPosition.y===t.y?!0:(this.selectedPosition.x=t.x,this.selectedPosition.y=t.y,!1)}async selectTilesInRectangle(e,t,i){const s=Math.min(e.x,t.x),o=Math.max(e.x,t.x),r=Math.min(e.y,t.y),a=Math.max(e.y,t.y),l=o-s,c=a-r;if(Math.abs(l)<15||Math.abs(c)<15)return;const h=s+l/2,u=r+c/2,p=new this.cesium.Cartesian2(h,u),f=this.viewer.scene.drillPick(p,void 0,l,c);if(!Array.isArray(f))return;const m=new Map;f.forEach(y=>{if(!(y instanceof this.cesium.Cesium3DTileFeature))return;const g=ks(y.tileset);if(!g||!this.tilesetMap[g])return;const A=this.getFeatureId(y);A!=="-1"&&(m.has(g)||m.set(g,new Set),m.get(g)?.add(A))}),m.forEach((y,g)=>{const A=this.hasSelectedFeaturesMap[g]||[],v=A.filter(x=>x.rank!==0),C=new Set(A.filter(x=>x.rank===0).map(x=>x.batchId)),w=[];y.forEach(x=>{C.has(x)||w.push({batchId:x,selectedColor:i,rank:0,isTrigger:!0})});const S=A.filter(x=>x.rank===0);this.hasSelectedFeaturesMap[g]=[...v,...S,...w],this.setBaseStyle(g)}),await this.triggerSelectionChange()}}class vw{cesium;viewer;tilesetMap={};planeEntities=[];clippingPlanesMap={};activeModelIds=new Set;boxMatrix=null;boxInverseMatrix=null;boxCenter=null;boxOrientation=null;targetZPlus=0;targetZMinus=0;targetXPlus=0;targetXMinus=0;targetYPlus=0;targetYMinus=0;currentPlaneType="";selectedPlane=null;hoveredPlane=null;dragStartPoint=null;moveCallBack=null;downHandler=null;upHandler=null;moveHandler=null;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}attachTileset(e,t){this.tilesetMap[t]=e}open(e,t){!this.tilesetMap[e]||this.activeModelIds.has(e)||(this.activeModelIds.add(e),this.moveCallBack=t?.moveCallBack,this.fitToModels(),this.activeModelIds.size===1&&(this.createPlaneEntities(),this.initEventHandlers()))}setupClippingPlanes(e){const t=this.cesium,i=this.tilesetMap[e];if(!i||!this.boxMatrix)return;const s=new t.ClippingPlaneCollection({planes:[new t.ClippingPlane(new t.Cartesian3(1,0,0),this.targetXMinus),new t.ClippingPlane(new t.Cartesian3(-1,0,0),this.targetXPlus),new t.ClippingPlane(new t.Cartesian3(0,1,0),this.targetYMinus),new t.ClippingPlane(new t.Cartesian3(0,-1,0),this.targetYPlus),new t.ClippingPlane(new t.Cartesian3(0,0,1),this.targetZMinus),new t.ClippingPlane(new t.Cartesian3(0,0,-1),this.targetZPlus)],edgeWidth:2,edgeColor:t.Color.WHITE,enabled:!0,unionClippingRegions:!0}),o=t.Matrix4.inverse(i.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),i.clippingPlanes=s,this.clippingPlanesMap[e]=s}createPlaneEntities(){const e=this.cesium,t=this.viewer;this.planeEntities.forEach(s=>t.entities.remove(s)),this.planeEntities=[];const i=["left","right","behind","front","top","down"];for(const s of i){const o=t.entities.add({name:s,position:new e.CallbackProperty(()=>{if(!this.boxMatrix)return e.Cartesian3.ZERO;const r=this.getPlaneOffsetCartesian(s);return e.Matrix4.multiplyByPoint(this.boxMatrix,r,new e.Cartesian3)},!1),orientation:new e.CallbackProperty(()=>this.boxOrientation||e.Quaternion.IDENTITY,!1),plane:{dimensions:new e.CallbackProperty(()=>{if(this.activeModelIds.size===0)return new e.Cartesian2(0,0);const r=.1,a=Math.max(r,this.targetXMinus+this.targetXPlus),l=Math.max(r,this.targetYPlus+this.targetYMinus),c=Math.max(r,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(a,l):s==="left"||s==="right"?new e.Cartesian2(l,c):new e.Cartesian2(a,c)},!1),material:e.Color.WHITE.withAlpha(.1),outline:!0,outlineColor:e.Color.YELLOW,plane:new e.CallbackProperty(()=>new e.Plane(this.getNormalByType(s),0),!1)}});this.planeEntities.push(o)}}getPlaneOffsetCartesian(e){const t=(this.targetXPlus-this.targetXMinus)/2,i=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,i,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,i,s);case"behind":return new this.cesium.Cartesian3(t,-this.targetYMinus,s);case"front":return new this.cesium.Cartesian3(t,this.targetYPlus,s);case"top":return new this.cesium.Cartesian3(t,i,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,i,-this.targetZMinus);default:return this.cesium.Cartesian3.ZERO}}getNormalByType(e){const t=this.cesium;switch(e){case"left":return new t.Cartesian3(1,0,0);case"right":return new t.Cartesian3(-1,0,0);case"behind":return new t.Cartesian3(0,1,0);case"front":return new t.Cartesian3(0,-1,0);case"top":return new t.Cartesian3(0,0,-1);case"down":return new t.Cartesian3(0,0,1);default:return t.Cartesian3.UNIT_X}}getPlaneByType(e){const t=this.cesium,i=this.getNormalByType(e),s=t.Cartesian3.negate(i,new t.Cartesian3);let o=0;switch(e){case"left":o=this.targetXMinus;break;case"right":o=this.targetXPlus;break;case"behind":o=this.targetYMinus;break;case"front":o=this.targetYPlus;break;case"top":o=this.targetZPlus;break;case"down":o=this.targetZMinus;break}return new t.Plane(s,-o)}initEventHandlers(){const e=this.cesium,t=this.viewer.scene.canvas,i=this.viewer.scene;this.downHandler=new e.ScreenSpaceEventHandler(t),this.upHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler.setInputAction(s=>{if(this.selectedPlane)return;let o;try{o=i.pick(s.endPosition)}catch{}e.defined(o)&&o.id&&o.id.plane?this.hoveredPlane!==o.id.plane&&(this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1)),this.hoveredPlane=o.id.plane,this.hoveredPlane.material=e.Color.YELLOW.withAlpha(.3),t.style.cursor="pointer"):this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1),this.hoveredPlane=null,t.style.cursor="default")},e.ScreenSpaceEventType.MOUSE_MOVE),this.downHandler.setInputAction(s=>{let o;try{o=i.pick(s.position)}catch{}if(e.defined(o)&&o.id&&o.id.plane){this.currentPlaneType=o.id.name,this.selectedPlane=o.id.plane,this.selectedPlane.material=e.Color.RED.withAlpha(.4),i.screenSpaceCameraController.enableInputs=!1;const r=i.camera.getPickRay(s.position),a=this.boxInverseMatrix,l=e.Matrix4.multiplyByPoint(a,r.origin,new e.Cartesian3),c=e.Matrix4.multiplyByPointAsVector(a,r.direction,new e.Cartesian3);e.Cartesian3.normalize(c,c);const h=new e.Ray(l,c),u=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,u,new e.Cartesian3),this.dragStartPoint||(this.dragStartPoint=this.getPlaneOffsetCartesian(this.currentPlaneType))}},e.ScreenSpaceEventType.LEFT_DOWN),this.moveHandler.setInputAction(s=>{if(!this.selectedPlane||!this.dragStartPoint)return;const o=i.camera.getPickRay(s.endPosition),r=this.boxInverseMatrix,a=e.Matrix4.multiplyByPoint(r,o.origin,new e.Cartesian3),l=e.Matrix4.multiplyByPointAsVector(r,o.direction,new e.Cartesian3);e.Cartesian3.normalize(l,l);const c=new e.Ray(a,l);let h=new e.Cartesian3;this.currentPlaneType==="top"||this.currentPlaneType==="down"?h=Math.abs(l.x)>Math.abs(l.y)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Y:this.currentPlaneType==="left"||this.currentPlaneType==="right"?h=Math.abs(l.y)>Math.abs(l.z)?e.Cartesian3.UNIT_Y:e.Cartesian3.UNIT_Z:h=Math.abs(l.x)>Math.abs(l.z)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z;const u=-e.Cartesian3.dot(this.dragStartPoint,h),p=new e.Plane(h,u);let f=e.IntersectionTests.rayPlane(c,p,new e.Cartesian3);if(!f){const y=h===e.Cartesian3.UNIT_X?e.Cartesian3.UNIT_Y:h===e.Cartesian3.UNIT_Y&&(this.currentPlaneType==="top"||this.currentPlaneType==="down")?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z,g=-e.Cartesian3.dot(this.dragStartPoint,y);f=e.IntersectionTests.rayPlane(c,new e.Plane(y,g),new e.Cartesian3)}if(!f)return;const m=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+m,-f.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+m,f.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+m,-f.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+m,f.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+m,f.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+m,-f.z);break}this.syncClippingPlanes(),this.moveCallBack&&this.moveCallBack(this.getRangeParams())},e.ScreenSpaceEventType.MOUSE_MOVE),this.upHandler.setInputAction(()=>{this.selectedPlane&&(this.selectedPlane.material=e.Color.WHITE.withAlpha(.1),this.selectedPlane=null,this.currentPlaneType="",this.dragStartPoint=null),i.screenSpaceCameraController.enableInputs=!0,t.style.cursor="default"},e.ScreenSpaceEventType.LEFT_UP)}syncClippingPlanes(){this.activeModelIds.size!==0&&Object.keys(this.clippingPlanesMap).forEach(e=>{const t=this.clippingPlanesMap[e],i=this.tilesetMap[e];if(t&&i&&!t.isDestroyed()){const s=this.cesium;t.get(0).distance=this.targetXMinus,t.get(1).distance=this.targetXPlus,t.get(2).distance=this.targetYMinus,t.get(3).distance=this.targetYPlus,t.get(4).distance=this.targetZMinus,t.get(5).distance=this.targetZPlus;const o=s.Matrix4.inverse(i.root.transform,new s.Matrix4);t.modelMatrix=s.Matrix4.multiply(o,this.boxMatrix,new s.Matrix4)}})}fitToModels(){const e=this.cesium;if(this.activeModelIds.size===0)return;let t=[];if(this.activeModelIds.forEach(u=>{const p=this.tilesetMap[u];p&&p.boundingSphere&&t.push(p.boundingSphere.center)}),t.length===0)return;const i=new e.Cartesian3;t.forEach(u=>e.Cartesian3.add(i,u,i)),this.boxCenter=e.Cartesian3.divideByScalar(i,t.length,new e.Cartesian3),this.boxMatrix=e.Transforms.eastNorthUpToFixedFrame(this.boxCenter),this.boxInverseMatrix=e.Matrix4.inverse(this.boxMatrix,new e.Matrix4),this.boxOrientation=e.Quaternion.fromRotationMatrix(e.Matrix4.getMatrix3(this.boxMatrix,new e.Matrix3));let s=1/0,o=-1/0,r=1/0,a=-1/0,l=1/0,c=-1/0;this.activeModelIds.forEach(u=>{const p=this.tilesetMap[u];if(!p)return;const f=[],m=p.leiting?.box,y=p.root?.boundingVolume?.boundingVolume;if(m&&m.min&&m.max){const{min:g,max:A}=m,v=[new e.Cartesian3(g.x,g.y,g.z),new e.Cartesian3(A.x,g.y,g.z),new e.Cartesian3(g.x,A.y,g.z),new e.Cartesian3(A.x,A.y,g.z),new e.Cartesian3(g.x,g.y,A.z),new e.Cartesian3(A.x,g.y,A.z),new e.Cartesian3(g.x,A.y,A.z),new e.Cartesian3(A.x,A.y,A.z)],C=p.root.transform;v.forEach(w=>{f.push(e.Matrix4.multiplyByPoint(C,w,new e.Cartesian3))})}else if(y&&y.halfAxes){const g=y.center,A=y.halfAxes,v=e.Matrix3.getColumn(A,0,new e.Cartesian3),C=e.Matrix3.getColumn(A,1,new e.Cartesian3),w=e.Matrix3.getColumn(A,2,new e.Cartesian3);for(let S=0;S<8;S++){const x=e.Cartesian3.clone(g,new e.Cartesian3);e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(v,S&1?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(C,S&2?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(w,S&4?1:-1,new e.Cartesian3),x),f.push(x)}}else if(p.boundingSphere){const g=p.boundingSphere,A=g.center,v=g.radius,C=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,A,new e.Cartesian3);s=Math.min(s,C.x-v),o=Math.max(o,C.x+v),r=Math.min(r,C.y-v),a=Math.max(a,C.y+v),l=Math.min(l,C.z-v),c=Math.max(c,C.z+v)}f.forEach(g=>{const A=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,g,new e.Cartesian3);s=Math.min(s,A.x),o=Math.max(o,A.x),r=Math.min(r,A.y),a=Math.max(a,A.y),l=Math.min(l,A.z),c=Math.max(c,A.z)})});const h=1.01;this.targetXMinus=Math.abs(s)*h,this.targetXPlus=Math.abs(o)*h,this.targetYMinus=Math.abs(r)*h,this.targetYPlus=Math.abs(a)*h,this.targetZMinus=Math.abs(l)*h,this.targetZPlus=Math.abs(c)*h,this.activeModelIds.forEach(u=>{this.setupClippingPlanes(u)}),this.viewer.scene.requestRender()}getRangeParams(){const e=this.cesium;return{targetZPlus:this.targetZPlus,targetZMinus:this.targetZMinus,targetXPlus:this.targetXPlus,targetXMinus:this.targetXMinus,targetYPlus:this.targetYPlus,targetYMinus:this.targetYMinus,maxBox:new e.Cartesian3(this.targetXPlus,this.targetYPlus,this.targetZPlus),minBox:new e.Cartesian3(-this.targetXMinus,-this.targetYMinus,-this.targetZMinus)}}updateRange(e){if(!this.boxMatrix)return;e.targetXMinus!==void 0&&(this.targetXMinus=e.targetXMinus),e.targetXPlus!==void 0&&(this.targetXPlus=e.targetXPlus),e.targetYMinus!==void 0&&(this.targetYMinus=e.targetYMinus),e.targetYPlus!==void 0&&(this.targetYPlus=e.targetYPlus),e.targetZPlus!==void 0&&(this.targetZPlus=e.targetZPlus),e.targetZMinus!==void 0&&(this.targetZMinus=e.targetZMinus);const t=.1;this.targetXMinus+this.targetXPlus<t&&(this.targetXPlus=t-this.targetXMinus),this.targetYPlus+this.targetYMinus<t&&(this.targetYPlus=t-this.targetYMinus),this.targetZPlus+this.targetZMinus<t&&(this.targetZPlus=t-this.targetZMinus),this.syncClippingPlanes(),this.viewer.scene.requestRender()}getRange(){return this.getRangeParams()}setBoxVisibility(e){this.planeEntities.forEach(t=>{t.show=e}),this.viewer.scene.requestRender()}close(e){if(e){const t=this.tilesetMap[e];t&&(t.clippingPlanes&&(t.clippingPlanes.enabled=!1),t.clippingPlanes=void 0),delete this.clippingPlanesMap[e],this.activeModelIds.delete(e),this.activeModelIds.size>0&&this.fitToModels()}else Object.keys(this.clippingPlanesMap).forEach(t=>{const i=this.tilesetMap[t];i&&(i.clippingPlanes&&(i.clippingPlanes.enabled=!1),i.clippingPlanes=void 0)}),this.clippingPlanesMap={},this.activeModelIds.clear();this.activeModelIds.size===0&&(this.planeEntities.forEach(t=>{this.viewer.entities.remove(t)}),this.planeEntities=[],this.destroyEventHandlers(),this.boxMatrix=null,this.boxInverseMatrix=null),this.viewer.scene.requestRender()}destroyEventHandlers(){this.downHandler?.destroy(),this.upHandler?.destroy(),this.moveHandler?.destroy(),this.downHandler=this.upHandler=this.moveHandler=null}}let Cl=performance.now();const bw=10;class Cw{cesium;viewer;modelInfo={modelName:"Person",modelId:"player_111",url:"person/model.glb",scale:.0032};startTime=0;radian=0;speed=.1;speedVector;position;hpRoll;cameralHpRoll;fixedFrameTransforms;model;transparentTest=!0;gravityTestByMove=!1;gravityTest=!0;lastMoveTime=0;moveInterval=.01;collisionTest=!0;wheelCount=2;isLeftDragging=!1;lastScreenY=0;lastScreenX=0;pauseAnimationFn;resumeAnimationFn;selectedColor;selectedColorRecover;handler;moveState={moveFront:!1,moveBack:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1};onLoading=null;onSuccess=null;onError=null;constructor({cesium:e,viewer:t,modelInfo:i,callbacks:s}){this.cesium=e,this.viewer=t,this.radian=this.cesium.Math.toRadians(4),this.speedVector=new this.cesium.Cartesian3,this.position=new this.cesium.Cartesian3,this.hpRoll=new this.cesium.HeadingPitchRoll,this.cameralHpRoll=new this.cesium.HeadingPitchRoll,this.fixedFrameTransforms=new this.cesium.Transforms.localFrameToFixedFrameGenerator("north","west"),i&&(this.modelInfo=Object.assign(this.modelInfo,i)),s&&(this.onLoading=s.onLoading||null,this.onSuccess=s.onSuccess||null,this.onError=s.onError||null),this.selectedColor=new this.cesium.Color(1,1,1,.4),this.selectedColorRecover=new this.cesium.Color(1,1,1,1);const o=this.viewer.scene.canvas;this.handler=new this.cesium.ScreenSpaceEventHandler(o)}getModel(){return this.model}setPauseAnimation(e){this.pauseAnimationFn=e}setResumeAnimationFn(e){this.resumeAnimationFn=e}async setPersonPosition(e){e&&(this.position=e),this.getModel()?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(e,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.model.show=!0,this.initKeyBoard()):await this.openPlayer(),this.setCameralDefault(!1)}setModelInfo(e){e&&(this.modelInfo=Object.assign(this.modelInfo,e))}async openPlayer(){if(this.enablePositionSelection(),this.model){this.model.show=!0,this.initKeyBoard(),this.setCameralDefault(!1);return}this.position&&!(this.position.x===0&&this.position.y===0&&this.position.z===0)?(await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)):this.onLoading&&this.onLoading("请按住 Ctrl + 左键点击场景选择初始位置...")}enablePositionSelection(){this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null);const e=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);e.setInputAction(async t=>{const i=this.viewer.scene;let s;try{s=i.pickPosition(t.position)}catch(o){console.warn("pickPosition failed:",o)}s&&(this.position=s,this.model?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.updatedCamera(),this.onSuccess&&this.onSuccess("已更新漫游位置")):(this.onSuccess&&this.onSuccess("位置已选择,正在加载模型..."),await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)))},this.cesium.ScreenSpaceEventType.LEFT_CLICK,this.cesium.KeyboardEventModifier.CTRL),this._positionHandler=e}_positionHandler;setDefaultPosition(){const e=this.viewer.scene,t=this.viewer.camera,i=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(i)}catch(o){console.warn("pickPosition failed:",o)}if(s)this.position=s;else{const o=t.direction,a=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(o,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=a}}async loadModel(){let e;try{this.onLoading&&this.onLoading("正在加载漫游人物...");const t=await this.cesium.Model.fromGltfAsync({id:this.modelInfo.modelId,url:this.modelInfo.url,modelMatrix:this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),scale:this.modelInfo.scale,allowPicking:!1,debugShowBoundingVolume:!1,debugWireframe:!1,cull:!1,gltfCallback:s=>{e=s.animations},backFaceCulling:!1}),i=()=>{if(e&&e.length>0){console.log("Model has animations:",e.length);try{t.activeAnimations.add({index:0,loop:this.cesium.ModelAnimationLoop.REPEAT,multiplier:1})}catch(s){console.error("Failed to add animation:",s)}this.pauseAnimationFn=()=>{this.viewer.clock.shouldAnimate=!1},this.resumeAnimationFn=()=>{this.viewer.clock.shouldAnimate=!0},this.viewer.clock.shouldAnimate=!1}else console.warn("No animations found in the model.")};t.ready?i():t.readyEvent.addEventListener(i),this.model=await this.viewer.scene.primitives.add(t),this.updatedCamera(),this.onLoading&&this.onLoading(""),this.onSuccess&&this.onSuccess("漫游模型加载完成")}catch(t){console.error("Failed to load model:",t),this.onLoading&&this.onLoading(""),this.onError&&this.onError("漫游模型加载失败")}}initKeyBoard(){const e=this.handler,t=this.cesium;Cl=performance.now();const i=(o,r)=>{const a=o.code,l=o.keyCode;a==="KeyA"||l===65?this.moveState.moveLeft=r:a==="KeyW"||l===87?this.moveState.moveFront=r:a==="KeyD"||l===68?this.moveState.moveRight=r:a==="KeyS"||l===83?this.moveState.moveBack=r:a==="KeyQ"||l===81?this.moveState.moveUp=r:(a==="KeyE"||l===69)&&(this.moveState.moveDown=r)};e.setInputAction(o=>{this.wheelCount-=o*.001,this.wheelCount<.1&&(this.wheelCount=.1),this.updatedCamera()},t.ScreenSpaceEventType.WHEEL),this._keydownHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(i(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(i(o,!1),Object.keys(this.moveState).every(r=>this.moveState[r]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())},document.addEventListener("keydown",this._keydownHandler),document.addEventListener("keyup",this._keyupHandler),e.setInputAction(o=>{this.isLeftDragging=!0,this.lastScreenY=o.position.y,this.lastScreenX=o.position.x},this.cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(o=>{if(!this.isLeftDragging)return;const r=o.endPosition.x,a=o.endPosition.y,l=a-this.lastScreenY,c=r-this.lastScreenX;Math.abs(l)<Math.abs(c)&&(c>0?(this.cameralHpRoll.heading+=this.radian,this.hpRoll.heading+=this.radian):(this.cameralHpRoll.heading-=this.radian,this.hpRoll.heading-=this.radian),s(0),this.lastScreenX=r),this.lastScreenY=a;const h=this.viewer.camera;this.cameralHpRoll.pitch=h.pitch+this.cesium.Math.toRadians(-l*.1),this.updatedCamera()},t.ScreenSpaceEventType.MOUSE_MOVE),e.setInputAction(()=>{this.isLeftDragging&&(this.isLeftDragging=!1)},t.ScreenSpaceEventType.LEFT_UP);const s=o=>{const r=performance.now();if(r-Cl<bw)return;Cl=r;const a=1.75;if(o===1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,-this.speed,this.speedVector),this.gravityTestByMove=!0):o===0?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,0,this.speedVector),this.gravityTestByMove=!1):o===2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,.05,this.speedVector),this.gravityTestByMove=!1):o===-2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,-.05,this.speedVector),this.gravityTestByMove=!1):o===3?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,this.speed,this.speedVector),this.gravityTestByMove=!0):o===-3&&(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,-this.speed,this.speedVector),this.gravityTestByMove=!0),!this.viewer||!this.model)return;const l=(u,p)=>new this.cesium.Ray(u,p),c=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,c),this.cesium.Cartesian3.normalize(c,c);const h=new this.cesium.Cartesian3;if(this.cesium.Matrix4.getColumn(this.model.modelMatrix,1,h),this.cesium.Cartesian3.normalize(h,h),Math.abs(o)!=2&&this.collisionTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,a),u);let f=c;o===-1?f=this.cesium.Cartesian3.multiplyByScalar(c,-1,new this.cesium.Cartesian3):o===3?f=h:o===-3&&(f=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const m=l(p,f),y=this.viewer.scene.pickFromRay(m,[this.model],1);if(y&&y.position&&this.cesium.Cartesian3.distance(p,y.position)<.9&&o!==0)return}if(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,this.speedVector,this.position),this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.gravityTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=.5,f=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),u),m=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,f,m),this.cesium.Cartesian3.normalize(m,m);const y=l(f,m),g=this.viewer.scene.pickFromRay(y,[this.model],1),A=a,v=this.cesium.Cartesian3.add(f,this.cesium.Cartesian3.multiplyByScalar(c,A,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(g)){const C=t.Cartesian3.distance(f,g.position);C-p>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),C-p<-.1&&C<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!g&&this.gravityTestByMove){const C=l(this.position,m),w=this.viewer.scene.pickFromRay(C,[this.model],1);if(w){const S=this.cesium.Cartesian3.distance(this.position,w.position);Math.abs(S-1)>.05&&S<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(g&&this.gravityTestByMove&&this.gravityTest){const C=this.cesium.Cartesian3.distance(v,g.position);Math.abs(C-a)>.1&&(this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,(a-C)/Math.abs(a-C)*.05),this.position))}}if(this.transparentTest){const u=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=1.75,f=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),u),m=this.viewer.camera.positionWC,y=f,g=t.Cartesian3.subtract(y,m,new t.Cartesian3),A=t.Cartesian3.distance(f,m),v=t.Cartesian3.normalize(g,new t.Cartesian3),C=new t.Ray(m,v);let w;try{w=this.viewer.scene.pickFromRay(C,void 0,1)}catch{}t.defined(w)&&w.primitive!==this.model&&w.position&&t.Cartesian3.distance(m,w.position)<A&&(this.wheelCount-=.1,this.wheelCount<.1&&(this.wheelCount=.1))}this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms,this.model.modelMatrix),this.updatedCamera()};this._tickHandler=()=>{const o=performance.now()/1e3;(o-this.lastMoveTime>=this.moveInterval||this.lastMoveTime==0)&&(this.moveState.moveFront?s(1):this.moveState.moveBack?s(-1):this.moveState.moveLeft?s(3):this.moveState.moveRight?s(-3):this.moveState.moveUp?s(2):this.moveState.moveDown&&s(-2),this.lastMoveTime=o)},this.viewer.clock.onTick.addEventListener(this._tickHandler)}updatedCamera(){if(!this.model)return;const e=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),t=1.75,i=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(i,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,i])=>{if(!i)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);i.addEventListener("mousedown",s),i.addEventListener("mouseup",o),i.addEventListener("mouseleave",o),i.addEventListener("touchstart",r=>{r.preventDefault(),s()}),i.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{i.removeEventListener("mousedown",s),i.removeEventListener("mouseup",o),i.removeEventListener("mouseleave",o),i.removeEventListener("touchstart",s),i.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,i=t.camera;this.setDefaultPosition(),this.setCameralDefault(!1);const s=this.handler;let o=!1,r=0,a=0;s.setInputAction(l=>{o=!0,r=l.position.x,a=l.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(l=>{if(!o)return;const c=l.endPosition.x,h=l.endPosition.y,u=c-r,p=h-a;Math.abs(u)>Math.abs(p)&&(i.heading-=u*.003),i.pitch+=p*.003,r=c,a=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{o=!1},e.ScreenSpaceEventType.LEFT_UP),s.setInputAction(l=>{this.wheelCount-=l*.001,this.wheelCount<.1&&(this.wheelCount=.1)},e.ScreenSpaceEventType.WHEEL),this._tickHandler=()=>{if(!this.moveState.moveFront&&!this.moveState.moveBack&&!this.moveState.moveLeft&&!this.moveState.moveRight&&!this.moveState.moveUp&&!this.moveState.moveDown)return;const l=(this.speed||.02)*12,c=i.direction,h=i.right,u=i.up;let p=0,f=0,m=0;this.moveState.moveFront&&(p+=c.x*l,f+=c.y*l,m+=c.z*l),this.moveState.moveBack&&(p-=c.x*l,f-=c.y*l,m-=c.z*l),this.moveState.moveRight&&(p+=h.x*l,f+=h.y*l,m+=h.z*l),this.moveState.moveLeft&&(p-=h.x*l,f-=h.y*l,m-=h.z*l),this.moveState.moveUp&&(p+=u.x*l,f+=u.y*l,m+=u.z*l),this.moveState.moveDown&&(p-=u.x*l,f-=u.y*l,m-=u.z*l),i.position=new e.Cartesian3(i.position.x+p,i.position.y+f,i.position.z+m)},t.clock.onTick.addEventListener(this._tickHandler),this.onSuccess&&this.onSuccess("视角漫游已启动")}closePlayer(){const e=this.cesium;this.model&&(this.model.show=!1),this.setCameralDefault(!0),this.handler&&(this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(e.ScreenSpaceEventType.WHEEL)),this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._keyupHandler&&document.removeEventListener("keyup",this._keyupHandler),this._tickHandler&&this.viewer.clock.onTick.removeEventListener(this._tickHandler),this.unbindUiKeys(),this.viewer.camera.lookAtTransform(e.Matrix4.IDENTITY),this.onLoading&&this.onLoading("")}setSpeed({speed:e}){this.speed=e/50}setParams({gravityTest:e,collisionTest:t,transparentTest:i}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),i!==void 0&&(this.transparentTest=i)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(i=>this.moveState[i]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())}setCameralDefault(e){const t=this.viewer;t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableLook=e,t.scene.screenSpaceCameraController.enableTilt=e}}class ww{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Wy(e),this.baseTiles=new ju(e),this.baseCompt=new Aw(e),this.baseSection=new vw(e),this.basePlayer=new Cw({cesium:e.cesium,viewer:e.viewer,modelInfo:{url:e.options?.playerUrl,modelName:e.options?.playerModelName,modelId:e.options?.playerModelId,scale:e.options?.playerScale},callbacks:e.callbacks})}getCesium(){return this.cesium}getViewer(){return this.viewer}setSceneOptions(...e){this.baseCesium.setSceneOptions(...e)}getSnapDomSImageBase64(...e){return this.baseCesium.getSnapDomSImageBase64(...e)}clearBackground(){this.baseCesium.clearBackground()}enableTestLabel(){this.baseCesium.enableTestLabel()}enableCesiumFXAA(e){this.baseCesium.enableCesiumFXAA(e)}updateModelEffect(e){this.baseCesium.updateModelEffect(e)}addModels(...e){return this.baseTiles.addModels(...e)}}class Ew{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new _s;showGlobal=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}flyToCadModel(e={}){const t=e.modelId||this.modelId,i=this.dxfModelsList.find(s=>s.modelId===t);i&&this.flyToBounds(i)}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.dxfModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.dxfModelsList.find(i=>i.modelId===t):this.dxfModelsList}showJson({modelId:e,show:t}){this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})});const i=this.dxfModelsList.find(s=>s.modelId===e);i&&(i.show=t)}showJsonByLayer({modelId:e,show:t,layers:i}){const s=this.dxfModelsList.find(r=>r.modelId===e);if(!s){console.error("Tileset not found for modelId:",e);return}s.hiddenBatchIds||(s.hiddenBatchIds=new Set),s.layerMap&&Array.isArray(i)&&i.forEach(r=>{const a=s.layerMap[r];a!==void 0&&(t?s.hiddenBatchIds.delete(a):s.hiddenBatchIds.add(a))});const o=Array.from(s.hiddenBatchIds);if(o.length>0){const r=o.map(a=>`\${_BATCHID} !== ${a}`).join(" && ");s.style=new this.cesium.Cesium3DTileStyle({show:r})}else s.style=new this.cesium.Cesium3DTileStyle({show:!0});s.hasVisibilityListener||(s.hasVisibilityListener=!0,s.tileVisible.addEventListener(r=>{const a=r.content,l=a.featuresLength;if(l>0&&s.hiddenBatchIds)for(let c=0;c<l;c++)s.hiddenBatchIds.has(c)?a.getFeature(c).show=!1:a.getFeature(c).show=!0}))}flyToBounds(e,t){const i=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new i.HeadingPitchRange(0,i.Math.toRadians(-90),s*2),...t},r=o.duration??0;e&&this.viewer.flyTo(e,{duration:r,offset:o.offset})}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const i=await t.blob(),s=new ml(new tr(i),{password:Hu,useWebWorkers:!1}),r=(await s.getEntries()).find(c=>!c.directory&&c.filename.endsWith(".json"));if(!r)return console.error("未找到 JSON 文件"),await s.close(),!1;const a=await r.arrayBuffer({useWebWorkers:!1});await s.close();const l=new TextDecoder().decode(a);return JSON.parse(l.trim())}catch(t){return console.error("解压或获取失败:",t),!1}}getBaseUrlPath(e){const t=e.lastIndexOf("/");return t===-1?".":e.substring(0,t)}async loadTilesetWithZipSupport(e,t){const i=this.getBaseUrlPath(e),s=encodeURI(`${i}/tileset.zip`);try{if((await fetch(s,{method:"HEAD"})).status===200){const r=await this.loadModelFile(s);if(r){const a=h=>{!h||typeof h!="object"||(typeof h.uri=="string"&&!/^(data:|https?:|atom:)\/\//i.test(h.uri)&&(h.uri=encodeURI(`${i}/${h.uri.replace(/^\.?\//,"")}`)),Object.values(h).forEach(u=>{if(Array.isArray(u)){u.forEach(p=>a(p));return}u&&typeof u=="object"&&a(u)}))};a(r);const l=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(r))))}`,c=new this.cesium.Resource({url:l});try{return await this.cesium.Cesium3DTileset.fromUrl(c,t)}catch{return await this.cesium.Cesium3DTileset.fromUrl(e,t)}}}}catch{}return await this.cesium.Cesium3DTileset.fromUrl(e,t)}async addDxfModel({fileNames:e,options:t}){const i=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==i)return;const o=this.renderGenByModel[s.modelId]||0;if((this.renderGenByModel[s.modelId]||0)!==o||~this.dxfModelsList.findIndex(c=>c.modelId===s.modelId))return;/^(https?|atom):\/\//i.test(s.outPutPath)||(s.outPutPath=`${window.location.origin}${s.outPutPath}`);const a=`${s.outPutPath}${s.dbName}/tileset.json`,l={...this.options,...t};try{const c=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(c);if(this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;const u=await this.loadTilesetWithZipSupport(a,{allowPicking:!1,clampToTerrain:!0});if(u.maximumScreenSpaceError=0,this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;if(Object.assign(u,{modelId:s.modelId,modelName:s.modelName,deltaLatitude:s.deltaLatitude||0,deltaLongitude:s.deltaLongitude||0,relocated:!0,dbName:s.dbName,outPutPath:s.outPutPath,totalRotation:s.totalRotation||0,layerInfo:h}),s.formData?u.formData=s.formData:u.formData={modelId:u.modelId,longitude:u.deltaLongitude,latitude:u.deltaLatitude,distance:1e-6,rotation:0,totalRotation:u.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:u.modelId,label:u.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...u.formData,tileset:u}),Array.isArray(h)){const p=h;u.layerMap={};let f=this.mapLayers[s.modelId];f||(f={},this.mapLayers[s.modelId]=f),p.forEach(m=>{u.layerMap[m.layerName]=m.batchId,f[m.layerName]||(f[m.layerName]=[]),f[m.layerName].push({batchId:m.batchId,color:m.layerColor})})}if(this.dxfModelsList.push(u),this.setModelId(s.modelId),this.viewer.scene.primitives.add(u),this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==o)return;l.flyTo&&this.flyToBounds(u),l.onSuccess&&l.onSuccess(u)}catch(c){console.error(`Failed to load tileset or layer info: ${a}`,c)}}this.events.emit("mountAllCad",this.dxfModelsList)}}adjustingModelByCad(e){const t=this.cesium,i=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(i),new t.Cartesian3(0,0,0)),o=t.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),r=t.Transforms.eastNorthUpToFixedFrame(o);t.Matrix4.multiply(r,s,r),e.tileset?._root&&(e.tileset._root.transform=r)}deleteCad({modelId:e}){this.mapLayers[e]&&(Object.values(this.mapLayers[e]).forEach(i=>{i.forEach(s=>{this.viewer.scene.primitives.remove(s.primitive),s.primitive?.destroy()})}),delete this.mapLayers[e]),this.renderGen[e]=(this.renderGen[e]||0)+1,this.renderGenByModel[e]=(this.renderGenByModel[e]||0)+1;const t=this.dxfModelsList.findIndex(i=>i.modelId===e);if(t>-1){const i=this.dxfModelsList[t];this.viewer.scene.primitives.remove(i),i.destroy&&!i.isDestroyed()&&i.destroy(),this.dxfModelsList.splice(t,1)}}deleteAllCad(){Object.keys(this.mapLayers).forEach(e=>{this.deleteCad({modelId:e})}),[...this.dxfModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}function xw(n){n("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),n("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),n("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)n("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),n("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");n("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),n.WGS84=n["EPSG:4326"],n["EPSG:3785"]=n["EPSG:3857"],n.GOOGLE=n["EPSG:3857"],n["EPSG:900913"]=n["EPSG:3857"],n["EPSG:102113"]=n["EPSG:3857"]}var ei=1,ti=2,ki=3,Iw=4,wl=5,Xu=6378137,Sw=6356752314e-3,Ju=.0066943799901413165,Ps=484813681109536e-20,$=Math.PI/2,Mw=.16666666666666666,Tw=.04722222222222222,Bw=.022156084656084655,X=1e-10,Oe=.017453292519943295,bt=57.29577951308232,ve=Math.PI/4,Ds=Math.PI*2,Ge=3.14159265359,Ct={};Ct.greenwich=0,Ct.lisbon=-9.131906111111,Ct.paris=2.337229166667,Ct.bogota=-74.080916666667,Ct.madrid=-3.687938888889,Ct.rome=12.452333333333,Ct.bern=7.439583333333,Ct.jakarta=106.807719444444,Ct.ferro=-17.666666666667,Ct.brussels=4.367975,Ct.stockholm=18.058277777778,Ct.athens=23.7163375,Ct.oslo=10.722916666667;const _w={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var Zu=/[\s_\-\/\(\)]/g;function Mn(n,e){if(n[e])return n[e];for(var t=Object.keys(n),i=e.toLowerCase().replace(Zu,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(Zu,""),r===i)return n[o]}function El(n){var e={},t=n.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,l){var c=l.split("=");return c.push(!0),a[c[0].toLowerCase()]=c[1],a},{}),i,s,o,r={proj:"projName",datum:"datumCode",rf:function(a){e.rf=parseFloat(a)},lat_0:function(a){e.lat0=a*Oe},lat_1:function(a){e.lat1=a*Oe},lat_2:function(a){e.lat2=a*Oe},lat_ts:function(a){e.lat_ts=a*Oe},lon_0:function(a){e.long0=a*Oe},lon_1:function(a){e.long1=a*Oe},lon_2:function(a){e.long2=a*Oe},alpha:function(a){e.alpha=parseFloat(a)*Oe},gamma:function(a){e.rectified_grid_angle=parseFloat(a)*Oe},lonc:function(a){e.longc=a*Oe},x_0:function(a){e.x0=parseFloat(a)},y_0:function(a){e.y0=parseFloat(a)},k_0:function(a){e.k0=parseFloat(a)},k:function(a){e.k0=parseFloat(a)},a:function(a){e.a=parseFloat(a)},b:function(a){e.b=parseFloat(a)},r:function(a){e.a=e.b=parseFloat(a)},r_a:function(){e.R_A=!0},zone:function(a){e.zone=parseInt(a,10)},south:function(){e.utmSouth=!0},towgs84:function(a){e.datum_params=a.split(",").map(function(l){return parseFloat(l)})},to_meter:function(a){e.to_meter=parseFloat(a)},units:function(a){e.units=a;var l=Mn(_w,a);l&&(e.to_meter=l.to_meter)},from_greenwich:function(a){e.from_greenwich=a*Oe},pm:function(a){var l=Mn(Ct,a);e.from_greenwich=(l||parseFloat(a))*Oe},nadgrids:function(a){a==="@null"?e.datumCode="none":e.nadgrids=a},axis:function(a){var l="ewnsud";a.length===3&&l.indexOf(a.substr(0,1))!==-1&&l.indexOf(a.substr(1,1))!==-1&&l.indexOf(a.substr(2,1))!==-1&&(e.axis=a)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(i in t)s=t[i],i in r?(o=r[i],typeof o=="function"?o(s):e[o]=s):e[i]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=n,e}class ef{static getId(e){const t=e.find(i=>Array.isArray(i)&&i[0]==="ID");return t&&t.length>=3?{authority:t[1],code:parseInt(t[2],10)}:null}static convertUnit(e,t="unit"){if(!e||e.length<3)return{type:t,name:"unknown",conversion_factor:null};const i=e[1],s=parseFloat(e[2])||null,o=e.find(a=>Array.isArray(a)&&a[0]==="ID"),r=o?{authority:o[1],code:parseInt(o[2],10)}:null;return{type:t,name:i,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let i;const s=t.match(/^\((.)\)$/);if(s){const c=s[1].toUpperCase();if(c==="E")i="east";else if(c==="N")i="north";else if(c==="U")i="up";else throw new Error(`Unknown axis abbreviation: ${c}`)}else i=e[2]?e[2].toLowerCase():"unknown";const o=e.find(c=>Array.isArray(c)&&c[0]==="ORDER"),r=o?parseInt(o[1],10):null,a=e.find(c=>Array.isArray(c)&&(c[0]==="LENGTHUNIT"||c[0]==="ANGLEUNIT"||c[0]==="SCALEUNIT")),l=this.convertUnit(a);return{name:t,direction:i,unit:l,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,i)=>(t.order||0)-(i.order||0))}static convert(e,t={}){switch(e[0]){case"PROJCRS":t.type="ProjectedCRS",t.name=e[1],t.base_crs=e.find(p=>Array.isArray(p)&&p[0]==="BASEGEOGCRS")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="BASEGEOGCRS")):null,t.conversion=e.find(p=>Array.isArray(p)&&p[0]==="CONVERSION")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="CONVERSION")):null;const i=e.find(p=>Array.isArray(p)&&p[0]==="CS");i&&(t.coordinate_system={type:i[1],axis:this.extractAxes(e)});const s=e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT");if(s){const p=this.convertUnit(s);t.coordinate_system.unit=p}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const o=e.find(p=>Array.isArray(p)&&(p[0]==="DATUM"||p[0]==="ENSEMBLE"));if(o){const p=this.convert(o);o[0]==="ENSEMBLE"?t.datum_ensemble=p:t.datum=p;const f=e.find(m=>Array.isArray(m)&&m[0]==="PRIMEM");f&&f[1]!=="Greenwich"&&(p.prime_meridian={name:f[1],longitude:parseFloat(f[2])})}t.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},t.id=this.getId(e);break;case"DATUM":t.type="GeodeticReferenceFrame",t.name=e[1],t.ellipsoid=e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(p=>Array.isArray(p)&&p[0]==="MEMBER").map(p=>({type:"DatumEnsembleMember",name:p[1],id:this.getId(p)}));const r=e.find(p=>Array.isArray(p)&&p[0]==="ENSEMBLEACCURACY");r&&(t.accuracy=parseFloat(r[1]));const a=e.find(p=>Array.isArray(p)&&p[0]==="ELLIPSOID");a&&(t.ellipsoid=this.convert(a)),t.id=this.getId(e);break;case"ELLIPSOID":t.type="Ellipsoid",t.name=e[1],t.semi_major_axis=parseFloat(e[2]),t.inverse_flattening=parseFloat(e[3]),e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT")&&this.convert(e.find(p=>Array.isArray(p)&&p[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(p=>Array.isArray(p)&&p[0]==="METHOD")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="METHOD")):null,t.parameters=e.filter(p=>Array.isArray(p)&&p[0]==="PARAMETER").map(p=>this.convert(p));break;case"METHOD":t.type="Method",t.name=e[1],t.id=this.getId(e);break;case"PARAMETER":t.type="Parameter",t.name=e[1],t.value=parseFloat(e[2]),t.unit=this.convertUnit(e.find(p=>Array.isArray(p)&&(p[0]==="LENGTHUNIT"||p[0]==="ANGLEUNIT"||p[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const l=e.find(p=>Array.isArray(p)&&p[0]==="SOURCECRS");if(l){const p=l.find(f=>Array.isArray(f));t.source_crs=p?this.convert(p):null}const c=e.find(p=>Array.isArray(p)&&p[0]==="TARGETCRS");if(c){const p=c.find(f=>Array.isArray(f));t.target_crs=p?this.convert(p):null}const h=e.find(p=>Array.isArray(p)&&p[0]==="ABRIDGEDTRANSFORMATION");h?t.transformation=this.convert(h):t.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(t.type="Transformation",t.name=e[1],t.method=e.find(p=>Array.isArray(p)&&p[0]==="METHOD")?this.convert(e.find(p=>Array.isArray(p)&&p[0]==="METHOD")):null,t.parameters=e.filter(p=>Array.isArray(p)&&(p[0]==="PARAMETER"||p[0]==="PARAMETERFILE")).map(p=>{if(p[0]==="PARAMETER")return this.convert(p);if(p[0]==="PARAMETERFILE")return{name:p[1],value:p[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const p=t.parameters[6];p.name==="Scale difference"&&(p.value=Math.round((p.value-1)*1e12)/1e6)}t.id=this.getId(e);break;case"AXIS":t.coordinate_system||(t.coordinate_system={type:"unspecified",axis:[]}),t.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const u=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(p=>{p.unit||(p.unit=u)}),u.conversion_factor&&u.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:u});break;default:t.keyword=e[0];break}return t}}class kw extends ef{static convert(e,t={}){return super.convert(e,t),t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"&&delete t.coordinate_system,t.usage&&delete t.usage,t}}class Pw extends ef{static convert(e,t={}){super.convert(e,t);const i=e.find(o=>Array.isArray(o)&&o[0]==="CS");i&&(t.coordinate_system={subtype:i[1],axis:this.extractAxes(e)});const s=e.find(o=>Array.isArray(o)&&o[0]==="USAGE");if(s){const o=s.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),r=s.find(l=>Array.isArray(l)&&l[0]==="AREA"),a=s.find(l=>Array.isArray(l)&&l[0]==="BBOX");t.usage={},o&&(t.usage.scope=o[1]),r&&(t.usage.area=r[1]),a&&(t.usage.bbox=a.slice(1))}return t}}function Dw(n){return n.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(n.find(e=>Array.isArray(e)&&e[0]==="CS")||n[0]==="BOUNDCRS"||n[0]==="PROJCRS"||n[0]==="GEOGCRS","2015")}function Nw(n){return(Dw(n)==="2019"?Pw:kw).convert(n)}function Lw(n){const e=n.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Ns=1,tf=2,nf=3,sr=4,sf=5,xl=-1,Rw=/\s/,Fw=/[A-Za-z]/,Ow=/[A-Za-z84_]/,or=/[,\]]/,of=/[\d\.E\-\+]/;function un(n){if(typeof n!="string")throw new Error("not a string");this.text=n.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ns}un.prototype.readCharicter=function(){var n=this.text[this.place++];if(this.state!==sr)for(;Rw.test(n);){if(this.place>=this.text.length)return;n=this.text[this.place++]}switch(this.state){case Ns:return this.neutral(n);case tf:return this.keyword(n);case sr:return this.quoted(n);case sf:return this.afterquote(n);case nf:return this.number(n);case xl:return}},un.prototype.afterquote=function(n){if(n==='"'){this.word+='"',this.state=sr;return}if(or.test(n)){this.word=this.word.trim(),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in afterquote yet, index '+this.place)},un.prototype.afterItem=function(n){if(n===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ns;return}if(n==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ns,this.currentObject=this.stack.pop(),this.currentObject||(this.state=xl);return}},un.prototype.number=function(n){if(of.test(n)){this.word+=n;return}if(or.test(n)){this.word=parseFloat(this.word),this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in number yet, index '+this.place)},un.prototype.quoted=function(n){if(n==='"'){this.state=sf;return}this.word+=n},un.prototype.keyword=function(n){if(Ow.test(n)){this.word+=n;return}if(n==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Ns;return}if(or.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in keyword yet, index '+this.place)},un.prototype.neutral=function(n){if(Fw.test(n)){this.word=n,this.state=tf;return}if(n==='"'){this.word="",this.state=sr;return}if(of.test(n)){this.word=n,this.state=nf;return}if(or.test(n)){this.afterItem(n);return}throw new Error(`havn't handled "`+n+'" in neutral yet, index '+this.place)},un.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===xl)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function Gw(n){var e=new un(n);return e.output()}function Il(n,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var i=e?{}:n,s=t.reduce(function(o,r){return Pi(r,o),o},i);e&&(n[e]=s)}function Pi(n,e){if(!Array.isArray(n)){e[n]=!0;return}var t=n.shift();if(t==="PARAMETER"&&(t=n.shift()),n.length===1){if(Array.isArray(n[0])){e[t]={},Pi(n[0],e[t]);return}e[t]=n[0];return}if(!n.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=n;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(n);return}Array.isArray(t)||(e[t]={});var i;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:n[0].toLowerCase(),convert:n[1]},n.length===3&&Pi(n[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:n[0],a:n[1],rf:n[2]},n.length===4&&Pi(n[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":n[0]=["name",n[0]],Il(e,t,n);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":n[0]=["name",n[0]],Il(e,t,n),e[t].type=t;return;default:for(i=-1;++i<n.length;)if(!Array.isArray(n[i]))return Pi(n,e[t]);return Il(e,t,n)}}var Uw=.017453292519943295;function Rt(n){return n*Uw}function rf(n){const e=(n.projName||"").toLowerCase().replace(/_/g," ");!n.long0&&n.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(n.long0=n.longc),!n.lat_ts&&n.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(n.lat0=Rt(n.lat1>0?90:-90),n.lat_ts=n.lat1,delete n.lat1):!n.lat_ts&&n.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(n.lat_ts=n.lat0,n.lat0=Rt(n.lat0>0?90:-90),delete n.lat1)}function af(n){let e={units:null,to_meter:void 0};return typeof n=="string"?(e.units=n.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):n&&n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=n.conversion_factor),e}function lf(n){return typeof n=="object"?n.value*n.unit.conversion_factor:n}function cf(n,e){n.ellipsoid.radius?(e.a=n.ellipsoid.radius,e.rf=0):(e.a=lf(n.ellipsoid.semi_major_axis),n.ellipsoid.inverse_flattening!==void 0?e.rf=n.ellipsoid.inverse_flattening:n.ellipsoid.semi_major_axis!==void 0&&n.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-lf(n.ellipsoid.semi_minor_axis))))}function rr(n,e={}){return!n||typeof n!="object"?n:n.type==="BoundCRS"?(rr(n.source_crs,e),n.transformation&&(n.transformation.method&&n.transformation.method.name==="NTv2"?e.nadgrids=n.transformation.parameters[0].value:e.datum_params=n.transformation.parameters.map(t=>t.value)),e):(Object.keys(n).forEach(t=>{const i=n[t];if(i!==null)switch(t){case"name":if(e.srsCode)break;e.name=i,e.srsCode=i;break;case"type":i==="GeographicCRS"?e.projName="longlat":i==="ProjectedCRS"&&n.conversion&&n.conversion.method&&(e.projName=n.conversion.method.name);break;case"datum":case"datum_ensemble":i.ellipsoid&&(e.ellps=i.ellipsoid.name,cf(i,e)),i.prime_meridian&&(e.from_greenwich=i.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=i.name,cf(i,e);break;case"prime_meridian":e.long0=(i.longitude||0)*Math.PI/180;break;case"coordinate_system":if(i.axis){if(e.axis=i.axis.map(s=>{const o=s.direction;if(o==="east")return"e";if(o==="north")return"n";if(o==="west")return"w";if(o==="south")return"s";throw new Error(`Unknown axis direction: ${o}`)}).join("")+"u",i.unit){const{units:s,to_meter:o}=af(i.unit);e.units=s,e.to_meter=o}else if(i.axis[0]&&i.axis[0].unit){const{units:s,to_meter:o}=af(i.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":i.authority&&i.code&&(e.title=i.authority+":"+i.code);break;case"conversion":i.method&&i.method.name&&(e.projName=i.method.name),i.parameters&&i.parameters.forEach(s=>{const o=s.name.toLowerCase().replace(/\s+/g,"_"),r=s.value;s.unit&&s.unit.conversion_factor?e[o]=r*s.unit.conversion_factor:s.unit==="degree"?e[o]=r*Math.PI/180:e[o]=r});break;case"unit":i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),i.conversion_factor&&(e.to_meter=i.conversion_factor);break;case"base_crs":rr(i,e),e.datumCode=i.id?i.id.authority+"_"+i.id.code:i.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),rf(e),e)}var Vw=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Qw(n,e){var t=e[0],i=e[1];!(t in n)&&i in n&&(n[t]=n[i],e.length===3&&(n[t]=e[2](n[t])))}function df(n){for(var e=Object.keys(n),t=0,i=e.length;t<i;++t){var s=e[t];Vw.indexOf(s)!==-1&&zw(n[s]),typeof n[s]=="object"&&df(n[s])}}function zw(n){if(n.AUTHORITY){var e=Object.keys(n.AUTHORITY)[0];e&&e in n.AUTHORITY&&(n.title=e+":"+n.AUTHORITY[e])}if(n.type==="GEOGCS"?n.projName="longlat":n.type==="LOCAL_CS"?(n.projName="identity",n.local=!0):typeof n.PROJECTION=="object"?n.projName=Object.keys(n.PROJECTION)[0]:n.projName=n.PROJECTION,n.AXIS){for(var t="",i=0,s=n.AXIS.length;i<s;++i){var o=[n.AXIS[i][0].toLowerCase(),n.AXIS[i][1].toLowerCase()];o[0].indexOf("north")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="north"?t+="n":o[0].indexOf("south")!==-1||(o[0]==="y"||o[0]==="lat")&&o[1]==="south"?t+="s":o[0].indexOf("east")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="east"?t+="e":(o[0].indexOf("west")!==-1||(o[0]==="x"||o[0]==="lon")&&o[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(n.axis=t)}n.UNIT&&(n.units=n.UNIT.name.toLowerCase(),n.units==="metre"&&(n.units="meter"),n.UNIT.convert&&(n.type==="GEOGCS"?n.DATUM&&n.DATUM.SPHEROID&&(n.to_meter=n.UNIT.convert*n.DATUM.SPHEROID.a):n.to_meter=n.UNIT.convert));var r=n.GEOGCS;n.type==="GEOGCS"&&(r=n),r&&(r.DATUM?n.datumCode=r.DATUM.name.toLowerCase():n.datumCode=r.name.toLowerCase(),n.datumCode.slice(0,2)==="d_"&&(n.datumCode=n.datumCode.slice(2)),n.datumCode==="new_zealand_1949"&&(n.datumCode="nzgd49"),(n.datumCode==="wgs_1984"||n.datumCode==="world_geodetic_system_1984")&&(n.PROJECTION==="Mercator_Auxiliary_Sphere"&&(n.sphere=!0),n.datumCode="wgs84"),n.datumCode==="belge_1972"&&(n.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(n.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),n.ellps.toLowerCase().slice(0,13)==="international"&&(n.ellps="intl"),n.a=r.DATUM.SPHEROID.a,n.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(n.datum_params=r.DATUM.TOWGS84),~n.datumCode.indexOf("osgb_1936")&&(n.datumCode="osgb36"),~n.datumCode.indexOf("osni_1952")&&(n.datumCode="osni52"),(~n.datumCode.indexOf("tm65")||~n.datumCode.indexOf("geodetic_datum_of_1965"))&&(n.datumCode="ire65"),n.datumCode==="ch1903+"&&(n.datumCode="ch1903"),~n.datumCode.indexOf("israel")&&(n.datumCode="isr93")),n.b&&!isFinite(n.b)&&(n.b=n.a),n.rectified_grid_angle&&(n.rectified_grid_angle=Rt(n.rectified_grid_angle));function a(h){var u=n.to_meter||1;return h*u}var l=function(h){return Qw(n,h)},c=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Rt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Rt],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Rt],["lat0","latitude_of_origin",Rt],["lat0","standard_parallel_1",Rt],["lat1","standard_parallel_1",Rt],["lat2","standard_parallel_2",Rt],["azimuth","Azimuth"],["alpha","azimuth",Rt],["srsCode","name"]];c.forEach(l),rf(n)}function ar(n){if(typeof n=="object")return rr(n);const e=Lw(n);var t=Gw(n);if(e==="WKT2"){const o=Nw(t);return rr(o)}var i=t[0],s={};return Pi(t,s),df(s),s[i]}function it(n){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?it[n]=El(arguments[1]):it[n]=ar(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?it[n]=ar(arguments[1]):(it[n]=t,t||delete it[n])}else if(arguments.length===1){if(Array.isArray(n))return n.map(function(i){return Array.isArray(i)?it.apply(e,i):it(i)});if(typeof n=="string"){if(n in it)return it[n]}else"EPSG"in n?it["EPSG:"+n.EPSG]=n:"ESRI"in n?it["ESRI:"+n.ESRI]=n:"IAU2000"in n?it["IAU2000:"+n.IAU2000]=n:console.log(n);return}}xw(it);function Hw(n){return typeof n=="string"}function Yw(n){return n in it}function $w(n){return n.indexOf("+")!==0&&n.indexOf("[")!==-1||typeof n=="object"&&!("srsCode"in n)}var jw=["3857","900913","3785","102113"];function Ww(n){var e=Mn(n,"authority");if(e){var t=Mn(e,"epsg");return t&&jw.indexOf(t)>-1}}function qw(n){var e=Mn(n,"extension");if(e)return Mn(e,"proj4")}function Kw(n){return n[0]==="+"}function Xw(n){if(Hw(n)){if(Yw(n))return it[n];if($w(n)){var e=ar(n);if(Ww(e))return it["EPSG:3857"];var t=qw(e);return t?El(t):e}if(Kw(n))return El(n)}else return"projName"in n?n:ar(n)}function hf(n,e){n=n||{};var t,i;if(!e)return n;for(i in e)t=e[i],t!==void 0&&(n[i]=t);return n}function Jt(n,e,t){var i=n*e;return t/Math.sqrt(1-i*i)}function Ls(n){return n<0?-1:1}function J(n,e){return e||Math.abs(n)<=Ge?n:n-Ls(n)*Ds}function Ft(n,e,t){var i=n*t,s=.5*n;return i=Math.pow((1-i)/(1+i),s),Math.tan(.5*($-e))/i}function Rs(n,e){for(var t=.5*n,i,s,o=$-2*Math.atan(e),r=0;r<=15;r++)if(i=n*Math.sin(o),s=$-2*Math.atan(e*Math.pow((1-i)/(1+i),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function Jw(){var n=this.b/this.a;this.es=1-n*n,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Zw(n){var e=n.x,t=n.y;if(t*bt>90&&t*bt<-90&&e*bt>180&&e*bt<-180)return null;var i,s;if(Math.abs(Math.abs(t)-$)<=X)return null;if(this.sphere)i=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(ve+.5*t));else{var o=Math.sin(t),r=Ft(this.e,t,o);i=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return n.x=i,n.y=s,n}function eE(n){var e=n.x-this.x0,t=n.y-this.y0,i,s;if(this.sphere)s=$-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var o=Math.exp(-t/(this.a*this.k0));if(s=Rs(this.e,o),s===-9999)return null}return i=J(this.long0+e/(this.a*this.k0),this.over),n.x=i,n.y=s,n}var tE=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const nE={init:Jw,forward:Zw,inverse:eE,names:tE};function iE(){}function uf(n){return n}var ff=["longlat","identity"],sE=[nE,{init:iE,forward:uf,inverse:uf,names:ff}],ni={},Di=[];function pf(n,e){var t=Di.length;return n.names?(Di[t]=n,n.names.forEach(function(i){ni[i.toLowerCase()]=t}),this):(console.log(e),!0)}function mf(n){return n.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function oE(n){if(!n)return!1;var e=n.toLowerCase();if(typeof ni[e]<"u"&&Di[ni[e]]||(e=mf(e),e in ni&&Di[ni[e]]))return Di[ni[e]]}function rE(){sE.forEach(pf)}const aE={start:rE,add:pf,get:oE};var gf={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const lE=gf.WGS84;function cE(n,e,t,i){var s=n*n,o=e*e,r=(s-o)/s,a=0;i?(n*=1-r*(Mw+r*(Tw+r*Bw)),s=n*n,r=0):a=Math.sqrt(r);var l=(s-o)/o;return{es:r,e:a,ep2:l}}function dE(n,e,t,i,s){if(!n){var o=Mn(gf,i);o||(o=lE),n=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*n),(t===0||Math.abs(n-e)<X)&&(s=!0,e=n),{a:n,b:e,rf:t,sphere:s}}var lr={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var hE in lr){var Sl=lr[hE];Sl.datumName&&(lr[Sl.datumName]=Sl)}function uE(n,e,t,i,s,o,r){var a={};return n===void 0||n==="none"?a.datum_type=wl:a.datum_type=Iw,e&&(a.datum_params=e.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=ei),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=ti,a.datum_params[3]*=Ps,a.datum_params[4]*=Ps,a.datum_params[5]*=Ps,a.datum_params[6]=a.datum_params[6]/1e6+1)),r&&(a.datum_type=ki,a.grids=r),a.a=t,a.b=i,a.es=s,a.ep2=o,a}var Ml={};function fE(n,e,t){return e instanceof ArrayBuffer?pE(n,e,t):{ready:mE(n,e)}}function pE(n,e,t){var i=!0;t!==void 0&&t.includeErrorFields===!1&&(i=!1);var s=new DataView(e),o=AE(s),r=vE(s,o),a=bE(s,r,o,i),l={header:r,subgrids:a};return Ml[n]=l,l}async function mE(n,e){for(var t=[],i=await e.getImageCount(),s=i-1;s>=0;s--){var o=await e.getImage(s),r=await o.readRasters(),a=r,l=[o.getWidth(),o.getHeight()],c=o.getBoundingBox().map(yf),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(yf),u=c[0]+(l[0]-1)*h[0],p=c[3]-(l[1]-1)*h[1],f=a[0],m=a[1],y=[];for(let v=l[1]-1;v>=0;v--)for(let C=l[0]-1;C>=0;C--){var g=v*l[0]+C;y.push([-Tn(m[g]),Tn(f[g])])}t.push({del:h,lim:l,ll:[-u,p],cvs:y})}var A={header:{nSubgrids:i},subgrids:t};return Ml[n]=A,A}function gE(n){if(n===void 0)return null;var e=n.split(",");return e.map(yE)}function yE(n){if(n.length===0)return null;var e=n[0]==="@";return e&&(n=n.slice(1)),n==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:n,mandatory:!e,grid:Ml[n]||null,isNull:!1}}function yf(n){return n*Math.PI/180}function Tn(n){return n/3600*Math.PI/180}function AE(n){var e=n.getInt32(8,!1);return e===11?!1:(e=n.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function vE(n,e){return{nFields:n.getInt32(8,e),nSubgridFields:n.getInt32(24,e),nSubgrids:n.getInt32(40,e),shiftType:Tl(n,56,64).trim(),fromSemiMajorAxis:n.getFloat64(120,e),fromSemiMinorAxis:n.getFloat64(136,e),toSemiMajorAxis:n.getFloat64(152,e),toSemiMinorAxis:n.getFloat64(168,e)}}function Tl(n,e,t){return String.fromCharCode.apply(null,new Uint8Array(n.buffer.slice(e,t)))}function bE(n,e,t,i){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var a=wE(n,s,t),l=EE(n,s,a,t,i),c=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);o.push({ll:[Tn(a.lowerLongitude),Tn(a.lowerLatitude)],del:[Tn(a.longitudeInterval),Tn(a.latitudeInterval)],lim:[c,h],count:a.gridNodeCount,cvs:CE(l)});var u=16;i===!1&&(u=8),s+=176+a.gridNodeCount*u}return o}function CE(n){return n.map(function(e){return[Tn(e.longitudeShift),Tn(e.latitudeShift)]})}function wE(n,e,t){return{name:Tl(n,e+8,e+16).trim(),parent:Tl(n,e+24,e+24+8).trim(),lowerLatitude:n.getFloat64(e+72,t),upperLatitude:n.getFloat64(e+88,t),lowerLongitude:n.getFloat64(e+104,t),upperLongitude:n.getFloat64(e+120,t),latitudeInterval:n.getFloat64(e+136,t),longitudeInterval:n.getFloat64(e+152,t),gridNodeCount:n.getInt32(e+168,t)}}function EE(n,e,t,i,s){var o=e+176,r=16;s===!1&&(r=8);for(var a=[],l=0;l<t.gridNodeCount;l++){var c={latitudeShift:n.getFloat32(o+l*r,i),longitudeShift:n.getFloat32(o+l*r+4,i)};s!==!1&&(c.latitudeAccuracy=n.getFloat32(o+l*r+8,i),c.longitudeAccuracy=n.getFloat32(o+l*r+12,i)),a.push(c)}return a}function Pt(n,e){if(!(this instanceof Pt))return new Pt(n);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(c){if(c)throw c};var t=Xw(n);if(typeof t!="object"){e("Could not parse to valid json: "+n);return}var i=Pt.projections.get(t.projName);if(!i){e("Could not get projection name from: "+n);return}if(t.datumCode&&t.datumCode!=="none"){var s=Mn(lr,t.datumCode);s&&(t.datum_params=t.datum_params||(s.towgs84?s.towgs84.split(","):null),t.ellps=s.ellipse,t.datumName=s.datumName?s.datumName:t.datumCode)}t.k0=t.k0||1,t.axis=t.axis||"enu",t.ellps=t.ellps||"wgs84",t.lat1=t.lat1||t.lat0;var o=dE(t.a,t.b,t.rf,t.ellps,t.sphere),r=cE(o.a,o.b,o.rf,t.R_A),a=gE(t.nadgrids),l=t.datum||uE(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,a);hf(this,t),hf(this,i),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=r.es,this.e=r.e,this.ep2=r.ep2,this.datum=l,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}Pt.projections=aE,Pt.projections.start();function xE(n,e){return n.datum_type!==e.datum_type||n.a!==e.a||Math.abs(n.es-e.es)>5e-11?!1:n.datum_type===ei?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]:n.datum_type===ti?n.datum_params[0]===e.datum_params[0]&&n.datum_params[1]===e.datum_params[1]&&n.datum_params[2]===e.datum_params[2]&&n.datum_params[3]===e.datum_params[3]&&n.datum_params[4]===e.datum_params[4]&&n.datum_params[5]===e.datum_params[5]&&n.datum_params[6]===e.datum_params[6]:!0}function Af(n,e,t){var i=n.x,s=n.y,o=n.z?n.z:0,r,a,l,c;if(s<-$&&s>-1.001*$)s=-$;else if(s>$&&s<1.001*$)s=$;else{if(s<-$)return{x:-1/0,y:-1/0,z:n.z};if(s>$)return{x:1/0,y:1/0,z:n.z}}return i>Math.PI&&(i-=2*Math.PI),a=Math.sin(s),c=Math.cos(s),l=a*a,r=t/Math.sqrt(1-e*l),{x:(r+o)*c*Math.cos(i),y:(r+o)*c*Math.sin(i),z:(r*(1-e)+o)*a}}function vf(n,e,t,i){var s=1e-12,o=s*s,r=30,a,l,c,h,u,p,f,m,y,g,A,v,C,w=n.x,S=n.y,x=n.z?n.z:0,I,B,R;if(a=Math.sqrt(w*w+S*S),l=Math.sqrt(w*w+S*S+x*x),a/t<s){if(I=0,l/t<s)return B=$,R=-i,{x:n.x,y:n.y,z:n.z}}else I=Math.atan2(S,w);c=x/l,h=a/l,u=1/Math.sqrt(1-e*(2-e)*h*h),m=h*(1-e)*u,y=c*u,C=0;do C++,f=t/Math.sqrt(1-e*y*y),R=a*m+x*y-f*(1-e*y*y),p=e*f/(f+R),u=1/Math.sqrt(1-p*(2-p)*h*h),g=h*(1-p)*u,A=c*u,v=A*m-g*y,m=g,y=A;while(v*v>o&&C<r);return B=Math.atan(A/Math.abs(g)),{x:I,y:B,z:R}}function IE(n,e,t){if(e===ei)return{x:n.x+t[0],y:n.y+t[1],z:n.z+t[2]};if(e===ti){var i=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6];return{x:c*(n.x-l*n.y+a*n.z)+i,y:c*(l*n.x+n.y-r*n.z)+s,z:c*(-a*n.x+r*n.y+n.z)+o}}}function SE(n,e,t){if(e===ei)return{x:n.x-t[0],y:n.y-t[1],z:n.z-t[2]};if(e===ti){var i=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6],h=(n.x-i)/c,u=(n.y-s)/c,p=(n.z-o)/c;return{x:h+l*u-a*p,y:-l*h+u+r*p,z:a*h-r*u+p}}}function cr(n){return n===ei||n===ti}function ME(n,e,t){if(xE(n,e)||n.datum_type===wl||e.datum_type===wl)return t;var i=n.a,s=n.es;if(n.datum_type===ki){var o=bf(n,!1,t);if(o!==0)return;i=Xu,s=Ju}var r=e.a,a=e.b,l=e.es;if(e.datum_type===ki&&(r=Xu,a=Sw,l=Ju),s===l&&i===r&&!cr(n.datum_type)&&!cr(e.datum_type))return t;if(t=Af(t,s,i),cr(n.datum_type)&&(t=IE(t,n.datum_type,n.datum_params)),cr(e.datum_type)&&(t=SE(t,e.datum_type,e.datum_params)),t=vf(t,l,r,a),e.datum_type===ki){var c=bf(e,!0,t);if(c!==0)return}return t}function bf(n,e,t){if(n.grids===null||n.grids.length===0)return console.log("Grid shift grids not found"),-1;var i={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<n.grids.length;r++){var a=n.grids[r];if(o.push(a.name),a.isNull){s=i;break}if(a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var l=a.grid.subgrids,c=0,h=l.length;c<h;c++){var u=l[c],p=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,f=u.ll[0]-p,m=u.ll[1]-p,y=u.ll[0]+(u.lim[0]-1)*u.del[0]+p,g=u.ll[1]+(u.lim[1]-1)*u.del[1]+p;if(!(m>i.y||f>i.x||g<i.y||y<i.x)&&(s=TE(i,e,u),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*bt+" "+i.y*bt+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function TE(n,e,t){var i={x:Number.NaN,y:Number.NaN};if(isNaN(n.x))return i;var s={x:n.x,y:n.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=J(s.x-Math.PI)+Math.PI;var o=Cf(s,t);if(e){if(isNaN(o.x))return i;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,a=1e-12,l,c;do{if(c=Cf(o,t),isNaN(c.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:s.x-(c.x+o.x),y:s.y-(c.y+o.y)},o.x+=l.x,o.y+=l.y}while(r--&&Math.abs(l.x)>a&&Math.abs(l.y)>a);if(r<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=J(o.x+t.ll[0]),i.y=o.y+t.ll[1]}else isNaN(o.x)||(i.x=n.x+o.x,i.y=n.y+o.y);return i}function Cf(n,e){var t={x:n.x/e.del[0],y:n.y/e.del[1]},i={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*i.x,y:t.y-1*i.y},o={x:Number.NaN,y:Number.NaN},r;if(i.x<0||i.x>=e.lim[0]||i.y<0||i.y>=e.lim[1])return o;r=i.y*e.lim[0]+i.x;var a={x:e.cvs[r][0],y:e.cvs[r][1]};r++;var l={x:e.cvs[r][0],y:e.cvs[r][1]};r+=e.lim[0];var c={x:e.cvs[r][0],y:e.cvs[r][1]};r--;var h={x:e.cvs[r][0],y:e.cvs[r][1]},u=s.x*s.y,p=s.x*(1-s.y),f=(1-s.x)*(1-s.y),m=(1-s.x)*s.y;return o.x=f*a.x+p*l.x+m*h.x+u*c.x,o.y=f*a.y+p*l.y+m*h.y+u*c.y,o}function wf(n,e,t){var i=t.x,s=t.y,o=t.z||0,r,a,l,c={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(r=i,"ew".indexOf(n.axis[l])!==-1?a="x":a="y"):l===1?(r=s,"ns".indexOf(n.axis[l])!==-1?a="y":a="x"):(r=o,a="z"),n.axis[l]){case"e":c[a]=r;break;case"w":c[a]=-r;break;case"n":c[a]=r;break;case"s":c[a]=-r;break;case"u":t[a]!==void 0&&(c.z=r);break;case"d":t[a]!==void 0&&(c.z=-r);break;default:return null}return c}function Ef(n){var e={x:n[0],y:n[1]};return n.length>2&&(e.z=n[2]),n.length>3&&(e.m=n[3]),e}function BE(n){xf(n.x),xf(n.y)}function xf(n){if(typeof Number.isFinite=="function"){if(Number.isFinite(n))return;throw new TypeError("coordinates must be finite numbers")}if(typeof n!="number"||n!==n||!isFinite(n))throw new TypeError("coordinates must be finite numbers")}function _E(n,e){return(n.datum.datum_type===ei||n.datum.datum_type===ti||n.datum.datum_type===ki)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ei||e.datum.datum_type===ti||e.datum.datum_type===ki)&&n.datumCode!=="WGS84"}function dr(n,e,t,i){var s;Array.isArray(t)?t=Ef(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(BE(t),n.datum&&e.datum&&_E(n,e)&&(s=new Pt("WGS84"),t=dr(n,s,t,i),n=s),i&&n.axis!=="enu"&&(t=wf(n,!1,t)),n.projName==="longlat")t={x:t.x*Oe,y:t.y*Oe,z:t.z||0};else if(n.to_meter&&(t={x:t.x*n.to_meter,y:t.y*n.to_meter,z:t.z||0}),t=n.inverse(t),!t)return;if(n.from_greenwich&&(t.x+=n.from_greenwich),t=ME(n.datum,e.datum,t),!!t)return t=t,e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*bt,y:t.y*bt,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),i&&e.axis!=="enu"?wf(e,!0,t):(t&&!o&&delete t.z,t)}var If=Pt("WGS84");function Bl(n,e,t,i){var s,o,r;return Array.isArray(t)?(s=dr(n,e,t,i)||{x:NaN,y:NaN},t.length>2?typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(t.slice(3)):[s.x,s.y,t[2]].concat(t.slice(3)):[s.x,s.y].concat(t.slice(2)):[s.x,s.y]):(o=dr(n,e,t,i),r=Object.keys(t),r.length===2||r.forEach(function(a){if(typeof n.name<"u"&&n.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;o[a]=t[a]}),o)}function hr(n){return n instanceof Pt?n:typeof n=="object"&&"oProj"in n?n.oProj:Pt(n)}function kE(n,e,t){var i,s,o=!1,r;return typeof e>"u"?(s=hr(n),i=If,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=hr(n),i=If,o=!0),i||(i=hr(n)),s||(s=hr(e)),t?Bl(i,s,t):(r={forward:function(a,l){return Bl(i,s,a,l)},inverse:function(a,l){return Bl(s,i,a,l)}},o&&(r.oProj=s),r)}var Sf=6,Mf="AJSAJS",Tf="AFAFAF",Ni=65,wt=73,Dt=79,Fs=86,Os=90;const PE={forward:Bf,inverse:DE,toPoint:_f};function Bf(n,e){return e=e||5,RE(NE({lat:n[1],lon:n[0]}),e)}function DE(n){var e=kl(Df(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function _f(n){var e=kl(Df(n.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function _l(n){return n*(Math.PI/180)}function kf(n){return 180*(n/Math.PI)}function NE(n){var e=n.lat,t=n.lon,i=6378137,s=.00669438,o=.9996,r,a,l,c,h,u,p,f=_l(e),m=_l(t),y,g;g=Math.floor((t+180)/6)+1,t===180&&(g=60),e>=56&&e<64&&t>=3&&t<12&&(g=32),e>=72&&e<84&&(t>=0&&t<9?g=31:t>=9&&t<21?g=33:t>=21&&t<33?g=35:t>=33&&t<42&&(g=37)),r=(g-1)*6-180+3,y=_l(r),a=s/(1-s),l=i/Math.sqrt(1-s*Math.sin(f)*Math.sin(f)),c=Math.tan(f)*Math.tan(f),h=a*Math.cos(f)*Math.cos(f),u=Math.cos(f)*(m-y),p=i*((1-s/4-3*s*s/64-5*s*s*s/256)*f-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*f)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*f)-35*s*s*s/3072*Math.sin(6*f));var A=o*l*(u+(1-c+h)*u*u*u/6+(5-18*c+c*c+72*h-58*a)*u*u*u*u*u/120)+5e5,v=o*(p+l*Math.tan(f)*(u*u/2+(5-c+9*h+4*h*h)*u*u*u*u/24+(61-58*c+c*c+600*h-330*a)*u*u*u*u*u*u/720));return e<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(A),zoneNumber:g,zoneLetter:LE(e)}}function kl(n){var e=n.northing,t=n.easting,i=n.zoneLetter,s=n.zoneNumber;if(s<0||s>60)return null;var o=.9996,r=6378137,a=.00669438,l,c=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),h,u,p,f,m,y,g,A,v,C=t-5e5,w=e;i<"N"&&(w-=1e7),g=(s-1)*6-180+3,l=a/(1-a),y=w/o,A=y/(r*(1-a/4-3*a*a/64-5*a*a*a/256)),v=A+(3*c/2-27*c*c*c/32)*Math.sin(2*A)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*A)+151*c*c*c/96*Math.sin(6*A),h=r/Math.sqrt(1-a*Math.sin(v)*Math.sin(v)),u=Math.tan(v)*Math.tan(v),p=l*Math.cos(v)*Math.cos(v),f=r*(1-a)/Math.pow(1-a*Math.sin(v)*Math.sin(v),1.5),m=C/(h*o);var S=v-h*Math.tan(v)/f*(m*m/2-(5+3*u+10*p-4*p*p-9*l)*m*m*m*m/24+(61+90*u+298*p+45*u*u-252*l-3*p*p)*m*m*m*m*m*m/720);S=kf(S);var x=(m-(1+2*u+p)*m*m*m/6+(5-2*p+28*u-3*p*p+8*l+24*u*u)*m*m*m*m*m/120)/Math.cos(v);x=g+kf(x);var I;if(n.accuracy){var B=kl({northing:n.northing+n.accuracy,easting:n.easting+n.accuracy,zoneLetter:n.zoneLetter,zoneNumber:n.zoneNumber});I={top:B.lat,right:B.lon,bottom:S,left:x}}else I={lat:S,lon:x};return I}function LE(n){var e="Z";return 84>=n&&n>=72?e="X":72>n&&n>=64?e="W":64>n&&n>=56?e="V":56>n&&n>=48?e="U":48>n&&n>=40?e="T":40>n&&n>=32?e="S":32>n&&n>=24?e="R":24>n&&n>=16?e="Q":16>n&&n>=8?e="P":8>n&&n>=0?e="N":0>n&&n>=-8?e="M":-8>n&&n>=-16?e="L":-16>n&&n>=-24?e="K":-24>n&&n>=-32?e="J":-32>n&&n>=-40?e="H":-40>n&&n>=-48?e="G":-48>n&&n>=-56?e="F":-56>n&&n>=-64?e="E":-64>n&&n>=-72?e="D":-72>n&&n>=-80&&(e="C"),e}function RE(n,e){var t="00000"+n.easting,i="00000"+n.northing;return n.zoneNumber+n.zoneLetter+FE(n.easting,n.northing,n.zoneNumber)+t.substr(t.length-5,e)+i.substr(i.length-5,e)}function FE(n,e,t){var i=Pf(t),s=Math.floor(n/1e5),o=Math.floor(e/1e5)%20;return OE(s,o,i)}function Pf(n){var e=n%Sf;return e===0&&(e=Sf),e}function OE(n,e,t){var i=t-1,s=Mf.charCodeAt(i),o=Tf.charCodeAt(i),r=s+n-1,a=o+e,l=!1;r>Os&&(r=r-Os+Ni-1,l=!0),(r===wt||s<wt&&r>wt||(r>wt||s<wt)&&l)&&r++,(r===Dt||s<Dt&&r>Dt||(r>Dt||s<Dt)&&l)&&(r++,r===wt&&r++),r>Os&&(r=r-Os+Ni-1),a>Fs?(a=a-Fs+Ni-1,l=!0):l=!1,(a===wt||o<wt&&a>wt||(a>wt||o<wt)&&l)&&a++,(a===Dt||o<Dt&&a>Dt||(a>Dt||o<Dt)&&l)&&(a++,a===wt&&a++),a>Fs&&(a=a-Fs+Ni-1);var c=String.fromCharCode(r)+String.fromCharCode(a);return c}function Df(n){if(n&&n.length===0)throw"MGRSPoint coverting from nothing";for(var e=n.length,t=null,i="",s,o=0;!/[A-Z]/.test(s=n.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+n;i+=s,o++}var r=parseInt(i,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+n;var a=n.charAt(o++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+n;t=n.substring(o,o+=2);for(var l=Pf(r),c=GE(t.charAt(0),l),h=UE(t.charAt(1),l);h<VE(a);)h+=2e6;var u=e-o;if(u%2!==0)throw`MGRSPoint has to have an even number
|
|
14
14
|
of digits after the zone letter and two 100km letters - front
|
|
15
15
|
half for easting meters, second half for
|
|
16
|
-
northing meters`+n;var p=u/2,f=0,m=0,y,g,A,v,C;return p>0&&(y=1e5/Math.pow(10,p),g=n.substring(o,o+p),f=parseFloat(g)*y,A=n.substring(o+p),m=parseFloat(A)*y),v=f+c,C=m+h,{easting:v,northing:C,zoneLetter:a,zoneNumber:r,accuracy:y}}function GE(n,e){for(var t=Mf.charCodeAt(e-1),i=1e5,s=!1;t!==n.charCodeAt(0);){if(t++,t===wt&&t++,t===Dt&&t++,t>Os){if(s)throw"Bad character: "+n;t=Ni,s=!0}i+=1e5}return i}function UE(n,e){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var t=Tf.charCodeAt(e-1),i=0,s=!1;t!==n.charCodeAt(0);){if(t++,t===wt&&t++,t===Dt&&t++,t>Fs){if(s)throw"Bad character: "+n;t=Ni,s=!0}i+=1e5}return i}function VE(n){var e;switch(n){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+n}function Li(n,e,t){if(!(this instanceof Li))return new Li(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e>"u"){var i=n.split(",");this.x=parseFloat(i[0]),this.y=parseFloat(i[1]),this.z=parseFloat(i[2])||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Li.fromMGRS=function(n){return new Li(_f(n))},Li.prototype.toMGRS=function(n){return Bf([this.x,this.y],n)};var QE=1,zE=.25,Nf=.046875,Lf=.01953125,Rf=.01068115234375,HE=.75,YE=.46875,$E=.013020833333333334,jE=.007120768229166667,WE=.3645833333333333,qE=.005696614583333333,KE=.3076171875;function Pl(n){var e=[];e[0]=QE-n*(zE+n*(Nf+n*(Lf+n*Rf))),e[1]=n*(HE-n*(Nf+n*(Lf+n*Rf)));var t=n*n;return e[2]=t*(YE-n*($E+n*jE)),t*=n,e[3]=t*(WE-n*qE),e[4]=t*n*KE,e}function Ri(n,e,t,i){return t*=e,e*=e,i[0]*n-t*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}var XE=20;function Dl(n,e,t){for(var i=1/(1-e),s=n,o=XE;o;--o){var r=Math.sin(s),a=1-e*r*r;if(a=(Ri(s,r,Math.cos(s),t)-n)*(a*Math.sqrt(a))*i,s-=a,Math.abs(a)<X)return s}return s}function JE(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Pl(this.es),this.ml0=Ri(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function ZE(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s,o,r,a=Math.sin(t),l=Math.cos(t);if(this.es){var h=l*i,u=Math.pow(h,2),p=this.ep2*Math.pow(l,2),f=Math.pow(p,2),m=Math.abs(l)>X?Math.tan(t):0,y=Math.pow(m,2),g=Math.pow(y,2);s=1-this.es*Math.pow(a,2),h=h/Math.sqrt(s);var A=Ri(t,a,l,this.en);o=this.a*(this.k0*h*(1+u/6*(1-y+p+u/20*(5-18*y+g+14*p-58*y*p+u/42*(61+179*g-g*y-479*y)))))+this.x0,r=this.a*(this.k0*(A-this.ml0+a*i*h/2*(1+u/12*(5-y+9*p+4*f+u/30*(61+g-58*y+270*p-330*y*p+u/56*(1385+543*g-g*y-3111*y))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)<X)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,r=l*Math.cos(i)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(r),c>=1){if(c-1>X)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return n.x=o,n.y=r,n}function ex(n){var e,t,i,s,o=(n.x-this.x0)*(1/this.a),r=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Dl(e,this.es,this.en),Math.abs(t)<$){var u=Math.sin(t),p=Math.cos(t),f=Math.abs(p)>X?Math.tan(t):0,m=this.ep2*Math.pow(p,2),y=Math.pow(m,2),g=Math.pow(f,2),A=Math.pow(g,2);e=1-this.es*Math.pow(u,2);var v=o*Math.sqrt(e)/this.k0,C=Math.pow(v,2);e=e*f,i=t-e*C/(1-this.es)*.5*(1-C/12*(5+3*g-9*m*g+m-4*y-C/30*(61+90*g-252*m*g+45*A+46*m-C/56*(1385+3633*g+4095*A+1574*A*g)))),s=J(this.long0+v*(1-C/6*(1+2*g+m-C/20*(5+28*g+24*A+8*m*g+6*m-C/42*(61+662*g+1320*A+720*A*g))))/p,this.over)}else i=$*Ls(r),s=0;else{var a=Math.exp(o/this.k0),l=.5*(a-1/a),c=this.lat0+r/this.k0,h=Math.cos(c);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(e),r<0&&(i=-i),l===0&&h===0?s=0:s=J(Math.atan2(l,h)+this.long0,this.over)}return n.x=s,n.y=i,n}var tx=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ur={init:JE,forward:ZE,inverse:ex,names:tx};function Ff(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function Et(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),i=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(i,2))}function nx(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function ix(n){var e=Math.abs(n);return e=nx(e*(1+e/(Et(1,e)+1))),n<0?-e:e}function Nl(n,e){for(var t=2*Math.cos(2*e),i=n.length-1,s=n[i],o=0,r;--i>=0;)r=-o+t*s+n[i],o=s,s=r;return e+r*Math.sin(2*e)}function sx(n,e){for(var t=2*Math.cos(e),i=n.length-1,s=n[i],o=0,r;--i>=0;)r=-o+t*s+n[i],o=s,s=r;return Math.sin(e)*r}function ox(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function Of(n,e,t){for(var i=Math.sin(e),s=Math.cos(e),o=Ff(t),r=ox(t),a=2*s*r,l=-2*i*o,c=n.length-1,h=n[c],u=0,p=0,f=0,m,y;--c>=0;)m=p,y=u,p=h,u=f,h=-m+a*p-l*u+n[c],f=-y+l*p+a*u;return a=i*r,l=s*o,[a*h-l*f,a*f+l*h]}function rx(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ur.init.apply(this),this.forward=ur.forward,this.inverse=ur.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var i=Nl(this.cbg,this.lat0);this.Zb=-this.Qn*(i+sx(this.gtu,2*i))}function ax(n){var e=J(n.x-this.long0,this.over),t=n.y;t=Nl(this.cbg,t);var i=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(i,r*s),e=Math.atan2(o*s,Et(i,s*r)),e=ix(Math.tan(e));var a=Of(this.gtu,2*t,2*e);t=t+a[0],e=e+a[1];var l,c;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,c=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,c=1/0),n.x=l,n.y=c,n}function lx(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var i,s;if(Math.abs(e)<=2.623395162778){var o=Of(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(Ff(e));var r=Math.sin(t),a=Math.cos(t),l=Math.sin(e),c=Math.cos(e);t=Math.atan2(r*c,Et(l,c*a)),e=Math.atan2(l,c*a),i=J(e+this.long0,this.over),s=Nl(this.cgb,t)}else i=1/0,s=1/0;return n.x=i,n.y=s,n}var cx=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const fr={init:rx,forward:ax,inverse:lx,names:cx};function dx(n,e){if(n===void 0){if(n=Math.floor((J(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var hx="etmerc";function ux(){var n=dx(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*Oe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,fr.init.apply(this),this.forward=fr.forward,this.inverse=fr.inverse}var fx=["Universal Transverse Mercator System","utm"];const px={init:ux,names:fx,dependsOn:hx};function Ll(n,e){return Math.pow((1-n)/(1+n),e)}var mx=20;function gx(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ve)/(Math.pow(Math.tan(.5*this.lat0+ve),this.C)*Ll(this.e*n,this.ratexp))}function yx(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ve),this.C)*Ll(this.e*Math.sin(t),this.ratexp))-$,n.x=this.C*e,n}function Ax(n){for(var e=1e-14,t=n.x/this.C,i=n.y,s=Math.pow(Math.tan(.5*i+ve)/this.K,1/this.C),o=mx;o>0&&(i=2*Math.atan(s*Ll(this.e*Math.sin(n.y),-.5*this.e))-$,!(Math.abs(i-n.y)<e));--o)n.y=i;return o?(n.x=t,n.y=i,n):null}const Rl={init:gx,forward:yx,inverse:Ax};function vx(){Rl.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function bx(n){var e,t,i,s;return n.x=J(n.x-this.long0,this.over),Rl.forward.apply(this,[n]),e=Math.sin(n.y),t=Math.cos(n.y),i=Math.cos(n.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*i),n.x=s*t*Math.sin(n.x),n.y=s*(this.cosc0*e-this.sinc0*t*i),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function Cx(n){var e,t,i,s,o;if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,o=Et(n.x,n.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+n.y*e*this.cosc0/o),i=Math.atan2(n.x*e,o*this.cosc0*t-n.y*this.sinc0*e)}else s=this.phic0,i=0;return n.x=i,n.y=s,Rl.inverse.apply(this,[n]),n.x=J(n.x+this.long0,this.over),n}var wx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Ex={init:vx,forward:bx,inverse:Cx,names:wx};function Fl(n,e,t){return e*=t,Math.tan(.5*($+n))*Math.pow((1-e)/(1+e),.5*t)}function xx(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&(this.k0=.5*(1+Ls(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=X&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&Math.abs(Math.cos(this.lat_ts))>X&&(this.k0=.5*this.cons*Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ft(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Jt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Fl(this.lat0,this.sinlat0,this.e))-$,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Ix(n){var e=n.x,t=n.y,i=Math.sin(t),s=Math.cos(t),o,r,a,l,c,h,u=J(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=X&&Math.abs(t+this.lat0)<=X?(n.x=NaN,n.y=NaN,n):this.sphere?(o=2*this.k0/(1+this.sinlat0*i+this.coslat0*s*Math.cos(u)),n.x=this.a*o*s*Math.sin(u)+this.x0,n.y=this.a*o*(this.coslat0*i-this.sinlat0*s*Math.cos(u))+this.y0,n):(r=2*Math.atan(Fl(t,i,this.e))-$,l=Math.cos(r),a=Math.sin(r),Math.abs(this.coslat0)<=X?(c=Ft(this.e,t*this.con,this.con*i),h=2*this.a*this.k0*c/this.cons,n.x=this.x0+h*Math.sin(e-this.long0),n.y=this.y0-this.con*h*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)<X?(o=2*this.a*this.k0/(1+l*Math.cos(u)),n.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),n.y=o*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),n.x=o*l*Math.sin(u)+this.x0,n))}function Sx(n){n.x-=this.x0,n.y-=this.y0;var e,t,i,s,o,r=Math.sqrt(n.x*n.x+n.y*n.y);if(this.sphere){var a=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=X?(n.x=e,n.y=t,n):(t=Math.asin(Math.cos(a)*this.sinlat0+n.y*Math.sin(a)*this.coslat0/r),Math.abs(this.coslat0)<X?this.lat0>0?e=J(this.long0+Math.atan2(n.x,-1*n.y),this.over):e=J(this.long0+Math.atan2(n.x,n.y),this.over):e=J(this.long0+Math.atan2(n.x*Math.sin(a),r*this.coslat0*Math.cos(a)-n.y*this.sinlat0*Math.sin(a)),this.over),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=X){if(r<=X)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,i=r*this.cons/(2*this.a*this.k0),t=this.con*Rs(this.e,i),e=this.con*J(this.con*this.long0+Math.atan2(n.x,-1*n.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=X?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+n.y*Math.sin(s)*this.cosX0/r),e=J(this.long0+Math.atan2(n.x*Math.sin(s),r*this.cosX0*Math.cos(s)-n.y*this.sinX0*Math.sin(s)),this.over)),t=-1*Rs(this.e,Math.tan(.5*($+o)));return n.x=e,n.y=t,n}var Mx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Tx={init:xx,forward:Ix,inverse:Sx,names:Mx,ssfn_:Fl};function Bx(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,i=this.rf,s=1/i,o=2*s-Math.pow(s,2),r=this.e=Math.sqrt(o);this.R=this.k0*t*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),c=Math.log((1+r*e)/(1-r*e));this.K=a-this.alpha*l+this.alpha*r/2*c}function _x(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),i=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(i))-Math.PI/4),o=this.alpha*(n.x-this.lambda0),r=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(o));return n.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,n.x=this.R*r+this.x0,n}function kx(n){for(var e=n.x-this.x0,t=n.y-this.y0,i=e/this.R,s=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),r=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),a=this.lambda0+r/this.alpha,l=0,c=o,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=a,n.y=c,n}var Px=["somerc"];const Dx={init:Bx,forward:_x,inverse:kx,names:Px};var Fi=1e-7;function Nx(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.projName=="object"?Object.keys(n.projName)[0]:n.projName;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1||e.indexOf(mf(t))!==-1}function Lx(){var n,e,t,i,s,o,r,a,l,c,h=0,u,p=0,f=0,m=0,y=0,g=0,A=0;this.no_off=Nx(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),v&&(A=this.alpha),C&&(h=this.rectified_grid_angle),v||C)p=this.longc;else if(f=this.long1,y=this.lat1,m=this.long2,g=this.lat2,Math.abs(y-g)<=Fi||(n=Math.abs(y))<=Fi||Math.abs(n-$)<=Fi||Math.abs(Math.abs(this.lat0)-$)<=Fi||Math.abs(Math.abs(g)-$)<=Fi)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>X?(a=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*a*a,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/n,i=this.B*e/(t*Math.sqrt(n)),s=i*i-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=i,this.E*=Math.pow(Ft(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=s=1),v||C?(v?(u=Math.asin(Math.sin(A)/i),C||(h=A)):(u=h,A=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(o=Math.pow(Ft(this.e,y,Math.sin(y)),this.B),r=Math.pow(Ft(this.e,g,Math.sin(g)),this.B),s=this.E/o,l=(r-o)/(r+o),c=this.E*this.E,c=(c-r*o)/(c+r*o),n=f-m,n<-Math.PI?m-=Ds:n>Math.PI&&(m+=Ds),this.lam0=J(.5*(f+m)-Math.atan(c*Math.tan(.5*this.B*(f-m))/l)/this.B,this.over),u=Math.atan(2*Math.sin(this.B*J(f-this.lam0,this.over))/(s-1/s)),h=A=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(A))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(ve-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ve+s))}function Rx(n){var e={},t,i,s,o,r,a,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-$)>X){if(r=this.E/Math.pow(Ft(this.e,n.y,Math.sin(n.y)),this.B),a=1/r,t=.5*(r-a),i=.5*(r+a),o=Math.sin(this.B*n.x),s=(t*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(s)-1)<X)throw new Error;c=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*n.x),Math.abs(a)<Fi?l=this.A*n.x:l=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else c=n.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=c):(l-=this.u_0,e.x=c*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-c*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Fx(n){var e,t,i,s,o,r,a,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*t),s=.5*(i-1/i),o=.5*(i+1/i),r=Math.sin(this.BrA*e),a=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(a)-1)<X)l.x=0,l.y=a<0?-$:$;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Rs(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(s*this.cosgam-r*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l}var Ox=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Gx={init:Lx,forward:Rx,inverse:Fx,names:Ox};function Ux(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<X)){var n=this.b/this.a;this.e=Math.sqrt(1-n*n);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),i=Jt(this.e,e,t),s=Ft(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),a=Jt(this.e,o,r),l=Ft(this.e,this.lat2,o),c=Math.abs(Math.abs(this.lat0)-$)<X?0:Ft(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>X?this.ns=Math.log(i/a)/Math.log(s/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Vx(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=X&&(t=Ls(t)*($-2*X));var i=Math.abs(Math.abs(t)-$),s,o;if(i>X)s=Ft(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(i=t*this.ns,i<=0)return null;o=0}var r=this.ns*J(e-this.long0,this.over);return n.x=this.k0*(o*Math.sin(r))+this.x0,n.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,n}function Qx(n){var e,t,i,s,o,r=(n.x-this.x0)/this.k0,a=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(r*r+a*a),t=1):(e=-Math.sqrt(r*r+a*a),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*r,t*a)),e!==0||this.ns>0){if(t=1/this.ns,i=Math.pow(e/(this.a*this.f0),t),s=Rs(this.e,i),s===-9999)return null}else s=-$;return o=J(l/this.ns+this.long0,this.over),n.x=o,n.y=s,n}var zx=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Hx={init:Ux,forward:Vx,inverse:Qx,names:zx};function Yx(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function $x(n){var e,t,i,s,o,r,a,l=n.x,c=n.y,h=J(l-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(i)),o=Math.asin(Math.cos(t)*Math.sin(i)/Math.cos(s)),r=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),n.y=a*Math.cos(r)/1,n.x=a*Math.sin(r)/1,this.czech||(n.y*=-1,n.x*=-1),n}function jx(n){var e,t,i,s,o,r,a,l,c=n.x;n.x=n.y,n.y=c,this.czech||(n.y*=-1,n.x*=-1),r=Math.sqrt(n.x*n.x+n.y*n.y),o=Math.atan2(n.y,n.x),s=o/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),t=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(e)),n.x=this.long0-t/this.alfa,a=e,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-n.y)<1e-10&&(l=1),a=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var Wx=["Krovak","krovak"];const qx={init:Yx,forward:$x,inverse:jx,names:Wx};function mt(n,e,t,i,s){return n*s-e*Math.sin(2*s)+t*Math.sin(4*s)-i*Math.sin(6*s)}function Gs(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function Us(n){return .375*n*(1+.25*n*(1+.46875*n))}function Vs(n){return .05859375*n*n*(1+.75*n)}function Qs(n){return n*n*n*(35/3072)}function Ol(n,e,t){var i=e*t;return n/Math.sqrt(1-i*i)}function Bn(n){return Math.abs(n)<$?n:n-Ls(n)*Math.PI}function pr(n,e,t,i,s){var o,r;o=n/e;for(var a=0;a<15;a++)if(r=(n-(e*o-t*Math.sin(2*o)+i*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*i*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Kx(){this.sphere||(this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.ml0=this.a*mt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Xx(n){var e,t,i=n.x,s=n.y;if(i=J(i-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(i)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(i))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),a=Ol(this.a,this.e,o),l=Math.tan(s)*Math.tan(s),c=i*Math.cos(s),h=c*c,u=this.es*r*r/(1-this.es),p=this.a*mt(this.e0,this.e1,this.e2,this.e3,s);e=a*c*(1-h*l*(1/6-(8-l+8*u)*h/120)),t=p-this.ml0+a*o/r*h*(.5+(5-l+6*u)*h/24)}return n.x=e+this.x0,n.y=t+this.y0,n}function Jx(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,i,s;if(this.sphere){var o=t+this.lat0;i=Math.asin(Math.sin(o)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(o))}else{var r=this.ml0/this.a+t,a=pr(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-$)<=X)return n.x=this.long0,n.y=$,t<0&&(n.y*=-1),n;var l=Ol(this.a,this.e,Math.sin(a)),c=l*l*l/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),u=e*this.a/l,p=u*u;i=a-l*Math.tan(a)/c*u*u*(.5-(1+3*h)*u*u/24),s=u*(1-p*(h/3+(1+3*h)*h*p/15))/Math.cos(a)}return n.x=J(s+this.long0,this.over),n.y=Bn(i),n}var Zx=["Cassini","Cassini_Soldner","cass"];const e2={init:Kx,forward:Xx,inverse:Jx,names:Zx};function _n(n,e){var t;return n>1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var Gl=1,Ul=2,Vl=3,mr=4;function t2(){var n=Math.abs(this.lat0);if(Math.abs(n-$)<X?this.mode=this.lat0<0?Gl:Ul:Math.abs(n)<X?this.mode=Vl:this.mode=mr,this.es>0){var e;switch(this.qp=_n(this.e,1),this.mmf=.5/(1-this.es),this.apa=d2(this.es),this.mode){case Ul:this.dd=1;break;case Gl:this.dd=1;break;case Vl:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case mr:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=_n(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===mr&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function n2(n){var e,t,i,s,o,r,a,l,c,h,u=n.x,p=n.y;if(u=J(u-this.long0,this.over),this.sphere){if(o=Math.sin(p),h=Math.cos(p),i=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*i:1+this.sinph0*o+this.cosph0*h*i,t<=X)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(u),t*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(p+this.lat0)<X)return null;t=ve-p*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(u),t*=i}}else{switch(a=0,l=0,c=0,i=Math.cos(u),s=Math.sin(u),o=Math.sin(p),r=_n(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=r/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:c=1+this.sinb1*a+this.cosb1*l*i;break;case this.EQUIT:c=1+l*i;break;case this.N_POLE:c=$+p,r=this.qp-r;break;case this.S_POLE:c=p-$,r=this.qp+r;break}if(Math.abs(c)<X)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),this.mode===this.OBLIQ?t=this.ymf*c*(this.cosb1*a-this.sinb1*l*i):t=(c=Math.sqrt(2/(1+l*i)))*a*this.ymf,e=this.xmf*c*l*s;break;case this.N_POLE:case this.S_POLE:r>=0?(e=(c=Math.sqrt(r))*s,t=i*(this.mode===this.S_POLE?c:-c)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function i2(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,i,s,o,r,a,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(e*e+t*t),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=X?0:Math.asin(t*p/u),e*=p,t=h*u;break;case this.OBLIQ:s=Math.abs(u)<=X?this.lat0:Math.asin(h*this.sinph0+t*p*this.cosph0/u),e*=p*this.cosph0,t=(h-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:t=-t,s=$-s;break;case this.S_POLE:s-=$;break}i=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l<X)return n.x=this.long0,n.y=this.lat0,n;r=2*Math.asin(.5*l/this.rq),o=Math.cos(r),e*=r=Math.sin(r),this.mode===this.OBLIQ?(c=o*this.sinb1+t*r*this.cosb1/l,a=this.qp*c,t=l*this.cosb1*o-t*this.sinb1*r):(c=t*r/l,a=this.qp*c,t=l*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),a=e*e+t*t,!a)return n.x=this.long0,n.y=this.lat0,n;c=1-a/this.qp,this.mode===this.S_POLE&&(c=-c)}i=Math.atan2(e,t),s=h2(Math.asin(c),this.apa)}return n.x=J(this.long0+i,this.over),n.y=s,n}var s2=.3333333333333333,o2=.17222222222222222,r2=.10257936507936508,a2=.06388888888888888,l2=.0664021164021164,c2=.016415012942191543;function d2(n){var e,t=[];return t[0]=n*s2,e=n*n,t[0]+=e*o2,t[1]=e*a2,e*=n,t[0]+=e*r2,t[1]+=e*l2,t[2]=e*c2,t}function h2(n,e){var t=n+n;return n+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var u2=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const f2={init:t2,forward:n2,inverse:i2,names:u2,S_POLE:Gl,N_POLE:Ul,EQUIT:Vl,OBLIQ:mr};function kn(n){return Math.abs(n)>1&&(n=n>1?1:-1),Math.asin(n)}function p2(){Math.abs(this.lat1+this.lat2)<X||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Jt(this.e3,this.sin_po,this.cos_po),this.qs1=_n(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Jt(this.e3,this.sin_po,this.cos_po),this.qs2=_n(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=_n(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>X?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function m2(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var i=_n(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,o=this.ns0*J(e-this.long0,this.over),r=s*Math.sin(o)+this.x0,a=this.rh-s*Math.cos(o)+this.y0;return n.x=r,n.y=a,n}function g2(n){var e,t,i,s,o,r;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),i=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),i=-1),s=0,e!==0&&(s=Math.atan2(i*n.x,i*n.y)),i=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-i*i)/(2*this.ns0)):(t=(this.c-i*i)/this.ns0,r=this.phi1z(this.e3,t)),o=J(s/this.ns0+this.long0,this.over),n.x=o,n.y=r,n}function y2(n,e){var t,i,s,o,r,a=kn(.5*e);if(n<X)return a;for(var l=n*n,c=1;c<=25;c++)if(t=Math.sin(a),i=Math.cos(a),s=n*t,o=1-s*s,r=.5*o*o/i*(e/(1-l)-t/o+.5/n*Math.log((1-s)/(1+s))),a=a+r,Math.abs(r)<=1e-7)return a;return null}var A2=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const v2={init:p2,forward:m2,inverse:g2,names:A2,phi1z:y2};function b2(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function C2(n){var e,t,i,s,o,r,a,l,c=n.x,h=n.y;return i=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(i),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=X?(a=this.x0+this.a*o*t*Math.sin(i)/r,l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/r):(a=this.x0+this.infinity_dist*t*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),n.x=a,n.y=l,n}function w2(n){var e,t,i,s,o,r;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),i=Math.cos(s),r=kn(i*this.sin_p14+n.y*t*this.cos_p14/e),o=Math.atan2(n.x*t,e*this.cos_p14*i-n.y*this.sin_p14*t),o=J(this.long0+o,this.over)):(r=this.phic0,o=0),n.x=o,n.y=r,n}var E2=["gnom"];const x2={init:b2,forward:C2,inverse:w2,names:E2};function I2(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*$:$;for(var i=Math.asin(.5*e),s,o,r,a,l=0;l<30;l++)if(o=Math.sin(i),r=Math.cos(i),a=n*o,s=Math.pow(1-a*a,2)/(2*r)*(e/(1-n*n)-o/(1-a*a)+.5/n*Math.log((1-a)/(1+a))),i+=s,Math.abs(s)<=1e-10)return i;return NaN}function S2(){this.sphere||(this.k0=Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function M2(n){var e=n.x,t=n.y,i,s,o=J(e-this.long0,this.over);if(this.sphere)i=this.x0+this.a*o*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var r=_n(this.e,Math.sin(t));i=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return n.x=i,n.y=s,n}function T2(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=J(this.long0+n.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=I2(this.e,2*n.y*this.k0/this.a),e=J(this.long0+n.x/(this.a*this.k0),this.over)),n.x=e,n.y=t,n}var B2=["cea"];const _2={init:S2,forward:M2,inverse:T2,names:B2};function k2(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function P2(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=Bn(t-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*s,n}function D2(n){var e=n.x,t=n.y;return n.x=J(this.long0+(e-this.x0)/(this.a*this.rc),this.over),n.y=Bn(this.lat0+(t-this.y0)/this.a),n}var N2=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const L2={init:k2,forward:P2,inverse:D2,names:N2};var Gf=20;function R2(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.ml0=this.a*mt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function F2(n){var e=n.x,t=n.y,i,s,o,r=J(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=X?(i=this.a*r,s=-1*this.a*this.lat0):(i=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Bn(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=X)i=this.a*r,s=-1*this.ml0;else{var a=Ol(this.a,this.e,Math.sin(t))/Math.tan(t);i=a*Math.sin(o),s=this.a*mt(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+a*(1-Math.cos(o))}return n.x=i+this.x0,n.y=s+this.y0,n}function O2(n){var e,t,i,s,o,r,a,l,c;if(i=n.x-this.x0,s=n.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=X)e=J(i/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,a=i*i/this.a/this.a+r*r,l=r;var h;for(o=Gf;o;--o)if(h=Math.tan(l),c=-1*(r*(l*h+1)-l-.5*(l*l+a)*h)/((l-r)/h-1),l+=c,Math.abs(c)<=X){t=l;break}e=J(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=X)t=0,e=J(this.long0+i/this.a,this.over);else{r=(this.ml0+s)/this.a,a=i*i/this.a/this.a+r*r,l=r;var u,p,f,m,y;for(o=Gf;o;--o)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*mt(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=p/this.a,c=(r*(u*m+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*r*m)/(4*u)+(r-m)*(u*f-2/Math.sin(2*l))-f),l-=c,Math.abs(c)<=X){t=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=J(this.long0+Math.asin(i*u/this.a)/Math.sin(t),this.over)}return n.x=e,n.y=t,n}var G2=["Polyconic","American_Polyconic","poly"];const U2={init:R2,forward:F2,inverse:O2,names:G2};function V2(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Q2(n){var e,t=n.x,i=n.y,s=i-this.lat0,o=t-this.long0,r=s/Ps*1e-5,a=o,l=1,c=0;for(e=1;e<=10;e++)l=l*r,c=c+this.A[e]*l;var h=c,u=a,p=1,f=0,m,y,g=0,A=0;for(e=1;e<=6;e++)m=p*h-f*u,y=f*h+p*u,p=m,f=y,g=g+this.B_re[e]*p-this.B_im[e]*f,A=A+this.B_im[e]*p+this.B_re[e]*f;return n.x=A*this.a+this.x0,n.y=g*this.a+this.y0,n}function z2(n){var e,t=n.x,i=n.y,s=t-this.x0,o=i-this.y0,r=o/this.a,a=s/this.a,l=1,c=0,h,u,p=0,f=0;for(e=1;e<=6;e++)h=l*r-c*a,u=c*r+l*a,l=h,c=u,p=p+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var m=0;m<this.iterations;m++){var y=p,g=f,A,v,C=r,w=a;for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,C=C+(e-1)*(this.B_re[e]*y-this.B_im[e]*g),w=w+(e-1)*(this.B_im[e]*y+this.B_re[e]*g);y=1,g=0;var S=this.B_re[1],x=this.B_im[1];for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,S=S+e*(this.B_re[e]*y-this.B_im[e]*g),x=x+e*(this.B_im[e]*y+this.B_re[e]*g);var I=S*S+x*x;p=(C*S+w*x)/I,f=(w*S-C*x)/I}var B=p,R=f,b=1,T=0;for(e=1;e<=9;e++)b=b*B,T=T+this.D[e]*b;var L=this.lat0+T*Ps*1e5,O=this.long0+R;return n.x=O,n.y=L,n}var H2=["New_Zealand_Map_Grid","nzmg"];const Y2={init:V2,forward:Q2,inverse:z2,names:H2};function $2(){}function j2(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=this.x0+this.a*i,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return n.x=s,n.y=o,n}function W2(n){n.x-=this.x0,n.y-=this.y0;var e=J(this.long0+n.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*n.y/this.a))-Math.PI/4);return n.x=e,n.y=t,n}var q2=["Miller_Cylindrical","mill"];const K2={init:$2,forward:j2,inverse:W2,names:q2};var X2=20;function J2(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Pl(this.es)}function Z2(n){var e,t,i=n.x,s=n.y;if(i=J(i-this.long0,this.over),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var o=this.n*Math.sin(s),r=X2;r;--r){var a=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<X)break}e=this.a*this.C_x*i*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var l=Math.sin(s),c=Math.cos(s);t=this.a*Ri(s,l,c,this.en),e=this.a*i*c/Math.sqrt(1-this.es*l*l)}return n.x=e,n.y=t,n}function eI(n){var e,t,i,s;return n.x-=this.x0,i=n.x/this.a,n.y-=this.y0,e=n.y/this.a,this.sphere?(e/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(e))),this.m?e=kn((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=kn(Math.sin(e)/this.n)),i=J(i+this.long0,this.over),e=Bn(e)):(e=Dl(n.y/this.a,this.es,this.en),s=Math.abs(e),s<$?(s=Math.sin(e),t=this.long0+n.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),i=J(t,this.over)):s-X<$&&(i=this.long0)),n.x=i,n.y=e,n}var tI=["Sinusoidal","sinu"];const nI={init:J2,forward:Z2,inverse:eI,names:tI};function iI(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function sI(n){for(var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=t,o=Math.PI*Math.sin(t);;){var r=-(s+Math.sin(s)-o)/(1+Math.cos(s));if(s+=r,Math.abs(r)<X)break}s/=2,Math.PI/2-Math.abs(t)<X&&(i=0);var a=.900316316158*this.a*i*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return n.x=a,n.y=l,n}function oI(n){var e,t;n.x-=this.x0,n.y-=this.y0,t=n.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var i=J(this.long0+n.x/(.900316316158*this.a*Math.cos(e)),this.over);i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return n.x=i,n.y=s,n}var rI=["Mollweide","moll"];const aI={init:iI,forward:sI,inverse:oI,names:rI};function lI(){Math.abs(this.lat1+this.lat2)<X||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Jt(this.e,this.sin_phi,this.cos_phi),this.ml1=mt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<X?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Jt(this.e,this.sin_phi,this.cos_phi),this.ml2=mt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function cI(n){var e=n.x,t=n.y,i;if(this.sphere)i=this.a*(this.g-t);else{var s=mt(this.e0,this.e1,this.e2,this.e3,t);i=this.a*(this.g-s)}var o=this.ns*J(e-this.long0,this.over),r=this.x0+i*Math.sin(o),a=this.y0+this.rh-i*Math.cos(o);return n.x=r,n.y=a,n}function dI(n){n.x-=this.x0,n.y=this.rh-n.y+this.y0;var e,t,i,s;this.ns>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*n.x,e*n.y)),this.sphere)return s=J(this.long0+o/this.ns,this.over),i=Bn(this.g-t/this.a),n.x=s,n.y=i,n;var r=this.g-t/this.a;return i=pr(r,this.e0,this.e1,this.e2,this.e3),s=J(this.long0+o/this.ns,this.over),n.x=s,n.y=i,n}var hI=["Equidistant_Conic","eqdc"];const uI={init:lI,forward:cI,inverse:dI,names:hI};function fI(){this.R=this.a}function pI(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s,o;Math.abs(t)<=X&&(s=this.x0+this.R*i,o=this.y0);var r=kn(2*Math.abs(t/Math.PI));(Math.abs(i)<=X||Math.abs(Math.abs(t)-$)<=X)&&(s=this.x0,t>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*r):o=this.y0+Math.PI*this.R*-Math.tan(.5*r));var a=.5*Math.abs(Math.PI/i-i/Math.PI),l=a*a,c=Math.sin(r),h=Math.cos(r),u=h/(c+h-1),p=u*u,f=u*(2/c-1),m=f*f,y=Math.PI*this.R*(a*(u-m)+Math.sqrt(l*(u-m)*(u-m)-(m+l)*(p-m)))/(m+l);i<0&&(y=-y),s=this.x0+y;var g=l+u;return y=Math.PI*this.R*(f*g-a*Math.sqrt((m+l)*(l+1)-g*g))/(m+l),t>=0?o=this.y0+y:o=this.y0-y,n.x=s,n.y=o,n}function mI(n){var e,t,i,s,o,r,a,l,c,h,u,p,f;return n.x-=this.x0,n.y-=this.y0,u=Math.PI*this.R,i=n.x/u,s=n.y/u,o=i*i+s*s,r=-Math.abs(s)*(1+o),a=r-2*s*s+i*i,l=-2*r+1+2*s*s+o*o,f=s*s/l+(2*a*a*a/l/l/l-9*r*a/l/l)/27,c=(r-a*a/3/l)/l,h=2*Math.sqrt(-c/3),u=3*f/c/h,Math.abs(u)>1&&(u>=0?u=1:u=-1),p=Math.acos(u)/3,n.y>=0?t=(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:t=-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,Math.abs(i)<X?e=this.long0:e=J(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(i*i-s*s)+o*o))/2/i,this.over),n.x=e,n.y=t,n}var gI=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const yI={init:fI,forward:pI,inverse:mI,names:gI};function AI(n,e,t,i,s,o){const r=i-e,a=Math.atan((1-o)*Math.tan(n)),l=Math.atan((1-o)*Math.tan(t)),c=Math.sin(a),h=Math.cos(a),u=Math.sin(l),p=Math.cos(l);let f=r,m,y=100,g,A,v,C,w,S,x,I,B,R,b,T,L,O;do{if(g=Math.sin(f),A=Math.cos(f),v=Math.sqrt(p*g*(p*g)+(h*u-c*p*A)*(h*u-c*p*A)),v===0)return{azi1:0,s12:0};C=c*u+h*p*A,w=Math.atan2(v,C),S=h*p*g/v,x=1-S*S,I=x!==0?C-2*c*u/x:0,B=o/16*x*(4+o*(4-3*x)),m=f,f=r+(1-B)*o*S*(w+B*v*(I+B*C*(-1+2*I*I)))}while(Math.abs(f-m)>1e-12&&--y>0);return y===0?{azi1:NaN,s12:NaN}:(R=x*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),b=1+R/16384*(4096+R*(-768+R*(320-175*R))),T=R/1024*(256+R*(-128+R*(74-47*R))),L=T*v*(I+T/4*(C*(-1+2*I*I)-T/6*I*(-3+4*v*v)*(-3+4*I*I))),O=s*(1-o)*b*(w-L),{azi1:Math.atan2(p*g,h*u-c*p*A),s12:O})}function vI(n,e,t,i,s,o){const r=Math.atan((1-o)*Math.tan(n)),a=Math.sin(r),l=Math.cos(r),c=Math.sin(t),h=Math.cos(t),u=Math.atan2(a,l*h),p=l*c,f=1-p*p,m=f*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),y=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m)));let A=i/(s*(1-o)*y),v,C=100,w,S,x,I;do w=Math.cos(2*u+A),S=Math.sin(A),x=Math.cos(A),I=g*S*(w+g/4*(x*(-1+2*w*w)-g/6*w*(-3+4*S*S)*(-3+4*w*w))),v=A,A=i/(s*(1-o)*y)+I;while(Math.abs(A-v)>1e-12&&--C>0);if(C===0)return{lat2:NaN,lon2:NaN};const B=a*S-l*x*h,R=Math.atan2(a*x+l*S*h,(1-o)*Math.sqrt(p*p+B*B)),b=Math.atan2(S*c,l*x-a*S*h),T=o/16*f*(4+o*(4-3*f)),L=b-(1-T)*o*p*(A+T*S*(w+T*x*(-1+2*w*w))),O=e+L;return{lat2:R,lon2:O}}function bI(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function CI(n){var e=n.x,t=n.y,i=Math.sin(n.y),s=Math.cos(n.y),o=J(e-this.long0,this.over),r,a,l,c,h,u,p,f,m,y,g;return this.sphere?Math.abs(this.sin_p12-1)<=X?(n.x=this.x0+this.a*($-t)*Math.sin(o),n.y=this.y0-this.a*($-t)*Math.cos(o),n):Math.abs(this.sin_p12+1)<=X?(n.x=this.x0+this.a*($+t)*Math.sin(o),n.y=this.y0+this.a*($+t)*Math.cos(o),n):(m=this.sin_p12*i+this.cos_p12*s*Math.cos(o),p=Math.acos(m),f=p?p/Math.sin(p):1,n.x=this.x0+this.a*f*s*Math.sin(o),n.y=this.y0+this.a*f*(this.cos_p12*i-this.sin_p12*s*Math.cos(o)),n):(r=Gs(this.es),a=Us(this.es),l=Vs(this.es),c=Qs(this.es),Math.abs(this.sin_p12-1)<=X?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),n.x=this.x0+(h-u)*Math.sin(o),n.y=this.y0-(h-u)*Math.cos(o),n):Math.abs(this.sin_p12+1)<=X?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),n.x=this.x0+(h+u)*Math.sin(o),n.y=this.y0+(h+u)*Math.cos(o),n):Math.abs(e)<X&&Math.abs(t-this.lat0)<X?(n.x=n.y=0,n):(y=AI(this.lat0,this.long0,t,e,this.a,this.f),g=y.azi1,n.x=y.s12*Math.sin(g),n.y=y.s12*Math.cos(g),n))}function wI(n){n.x-=this.x0,n.y-=this.y0;var e,t,i,s,o,r,a,l,c,h,u,p,f,m,y,g;return this.sphere?(e=Math.sqrt(n.x*n.x+n.y*n.y),e>2*$*this.a?void 0:(t=e/this.a,i=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=X?r=this.lat0:(r=kn(s*this.sin_p12+n.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-$,Math.abs(a)<=X?this.lat0>=0?o=J(this.long0+Math.atan2(n.x,-n.y),this.over):o=J(this.long0-Math.atan2(-n.x,n.y),this.over):o=J(this.long0+Math.atan2(n.x*i,e*this.cos_p12*s-n.y*this.sin_p12*i),this.over)),n.x=o,n.y=r,n)):(l=Gs(this.es),c=Us(this.es),h=Vs(this.es),u=Qs(this.es),Math.abs(this.sin_p12-1)<=X?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(n.x*n.x+n.y*n.y),f=p-e,r=pr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(n.x,-1*n.y),this.over),n.x=o,n.y=r,n):Math.abs(this.sin_p12+1)<=X?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(n.x*n.x+n.y*n.y),f=e-p,r=pr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(n.x,n.y),this.over),n.x=o,n.y=r,n):(m=Math.atan2(n.x,n.y),y=Math.sqrt(n.x*n.x+n.y*n.y),g=vI(this.lat0,this.long0,m,y,this.a,this.f),n.x=g.lon2,n.y=g.lat2,n))}var EI=["Azimuthal_Equidistant","aeqd"];const xI={init:bI,forward:CI,inverse:wI,names:EI};function II(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function SI(n){var e,t,i,s,o,r,a,l,c=n.x,h=n.y;return i=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(i),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=X)&&(a=this.a*o*t*Math.sin(i),l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),n.x=a,n.y=l,n}function MI(n){var e,t,i,s,o,r,a;return n.x-=this.x0,n.y-=this.y0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=kn(e/this.a),i=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=X?(a=this.lat0,n.x=r,n.y=a,n):(a=kn(s*this.sin_p14+n.y*i*this.cos_p14/e),o=Math.abs(this.lat0)-$,Math.abs(o)<=X?(this.lat0>=0?r=J(this.long0+Math.atan2(n.x,-n.y),this.over):r=J(this.long0-Math.atan2(-n.x,n.y),this.over),n.x=r,n.y=a,n):(r=J(this.long0+Math.atan2(n.x*i,e*this.cos_p14*s-n.y*this.sin_p14*i),this.over),n.x=r,n.y=a,n))}var TI=["ortho"];const BI={init:II,forward:SI,inverse:MI,names:TI};var De={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},be={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function _I(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=$-ve/2?this.face=De.TOP:this.lat0<=-($-ve/2)?this.face=De.BOTTOM:Math.abs(this.long0)<=ve?this.face=De.FRONT:Math.abs(this.long0)<=$+ve?this.face=this.long0>0?De.RIGHT:De.LEFT:this.face=De.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function kI(n){var e={x:0,y:0},t,i,s,o,r,a,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,i=n.x,this.face===De.TOP)o=$-t,i>=ve&&i<=$+ve?(l.value=be.AREA_0,s=i-$):i>$+ve||i<=-($+ve)?(l.value=be.AREA_1,s=i>0?i-Ge:i+Ge):i>-($+ve)&&i<=-ve?(l.value=be.AREA_2,s=i+$):(l.value=be.AREA_3,s=i);else if(this.face===De.BOTTOM)o=$+t,i>=ve&&i<=$+ve?(l.value=be.AREA_0,s=-i+$):i<ve&&i>=-ve?(l.value=be.AREA_1,s=-i):i<-ve&&i>=-($+ve)?(l.value=be.AREA_2,s=-i-$):(l.value=be.AREA_3,s=i>0?-i+Ge:-i-Ge);else{var c,h,u,p,f,m,y;this.face===De.RIGHT?i=Oi(i,+$):this.face===De.BACK?i=Oi(i,+Ge):this.face===De.LEFT&&(i=Oi(i,-$)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),y=Math.cos(i),c=f*y,h=f*m,u=p,this.face===De.FRONT?(o=Math.acos(c),s=gr(o,u,h,l)):this.face===De.RIGHT?(o=Math.acos(h),s=gr(o,u,-c,l)):this.face===De.BACK?(o=Math.acos(-c),s=gr(o,u,-h,l)):this.face===De.LEFT?(o=Math.acos(-h),s=gr(o,u,c,l)):(o=s=0,l.value=be.AREA_0)}return a=Math.atan(12/Ge*(s+Math.acos(Math.sin(s)*Math.cos(ve))-$)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===be.AREA_1?a+=$:l.value===be.AREA_2?a+=Ge:l.value===be.AREA_3&&(a+=1.5*Ge),e.x=r*Math.cos(a),e.y=r*Math.sin(a),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function PI(n){var e={lam:0,phi:0},t,i,s,o,r,a,l,c,h,u={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,i=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?u.value=be.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=be.AREA_1,t-=$):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=be.AREA_2,t=t<0?t+Ge:t-Ge):(u.value=be.AREA_3,t+=$),h=Ge/12*Math.tan(t),r=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(r),s=Math.cos(t),o=Math.tan(i),l=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===De.TOP)c=Math.acos(l),e.phi=$-c,u.value===be.AREA_0?e.lam=a+$:u.value===be.AREA_1?e.lam=a<0?a+Ge:a-Ge:u.value===be.AREA_2?e.lam=a-$:e.lam=a;else if(this.face===De.BOTTOM)c=Math.acos(l),e.phi=c-$,u.value===be.AREA_0?e.lam=-a+$:u.value===be.AREA_1?e.lam=-a:u.value===be.AREA_2?e.lam=-a-$:e.lam=a<0?-a-Ge:-a+Ge;else{var p,f,m;p=l,h=p*p,h>=1?m=0:m=Math.sqrt(1-h)*Math.sin(a),h+=m*m,h>=1?f=0:f=Math.sqrt(1-h),u.value===be.AREA_1?(h=f,f=-m,m=h):u.value===be.AREA_2?(f=-f,m=-m):u.value===be.AREA_3&&(h=f,f=m,m=-h),this.face===De.RIGHT?(h=p,p=-f,f=h):this.face===De.BACK?(p=-p,f=-f):this.face===De.LEFT&&(h=p,p=f,f=-h),e.phi=Math.acos(-m)-$,e.lam=Math.atan2(f,p),this.face===De.RIGHT?e.lam=Oi(e.lam,-$):this.face===De.BACK?e.lam=Oi(e.lam,-Ge):this.face===De.LEFT&&(e.lam=Oi(e.lam,+$))}if(this.es!==0){var y,g,A;y=e.phi<0?1:0,g=Math.tan(e.phi),A=this.b/Math.sqrt(g*g+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-A*A)/(this.one_minus_f*A)),y&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function gr(n,e,t,i){var s;return n<X?(i.value=be.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ve?i.value=be.AREA_0:s>ve&&s<=$+ve?(i.value=be.AREA_1,s-=$):s>$+ve||s<=-($+ve)?(i.value=be.AREA_2,s=s>=0?s-Ge:s+Ge):(i.value=be.AREA_3,s+=$)),s}function Oi(n,e){var t=n+e;return t<-Ge?t+=Ds:t>+Ge&&(t-=Ds),t}var DI=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const NI={init:_I,forward:kI,inverse:PI,names:DI};var Ql=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],zs=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Uf=.8487,Vf=1.3523,Qf=bt/5,LI=1/Qf,Gi=18,yr=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},RI=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function FI(n,e,t,i){for(var s=e;i;--i){var o=n(s);if(s-=o,Math.abs(o)<t)break}return s}function OI(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function GI(n){var e=J(n.x-this.long0,this.over),t=Math.abs(n.y),i=Math.floor(t*Qf);i<0?i=0:i>=Gi&&(i=Gi-1),t=bt*(t-LI*i);var s={x:yr(Ql[i],t)*e,y:yr(zs[i],t)};return n.y<0&&(s.y=-s.y),s.x=s.x*this.a*Uf+this.x0,s.y=s.y*this.a*Vf+this.y0,s}function UI(n){var e={x:(n.x-this.x0)/(this.a*Uf),y:Math.abs(n.y-this.y0)/(this.a*Vf)};if(e.y>=1)e.x/=Ql[Gi][0],e.y=n.y<0?-$:$;else{var t=Math.floor(e.y*Gi);for(t<0?t=0:t>=Gi&&(t=Gi-1);;)if(zs[t][0]>e.y)--t;else if(zs[t+1][0]<=e.y)++t;else break;var i=zs[t],s=5*(e.y-i[0])/(zs[t+1][0]-i[0]);s=FI(function(o){return(yr(i,o)-e.y)/RI(i,o)},s,X,100),e.x/=yr(Ql[t],s),e.y=(5*t+s)*Oe,n.y<0&&(e.y=-e.y)}return e.x=J(e.x+this.long0,this.over),e}var VI=["Robinson","robin"];const QI={init:OI,forward:GI,inverse:UI,names:VI};function zI(){this.name="geocent"}function HI(n){var e=Af(n,this.es,this.a);return e}function YI(n){var e=vf(n,this.es,this.a,this.b);return e}var $I=["Geocentric","geocentric","geocent","Geocent"];const jI={init:zI,forward:HI,inverse:YI,names:$I};var dt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Hs={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function WI(){if(Object.keys(Hs).forEach((function(t){if(typeof this[t]>"u")this[t]=Hs[t].def;else{if(Hs[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Hs[t].num&&(this[t]=parseFloat(this[t]))}Hs[t].degrees&&(this[t]=this[t]*Oe)}).bind(this)),Math.abs(Math.abs(this.lat0)-$)<X?this.mode=this.lat0<0?dt.S_POLE:dt.N_POLE:Math.abs(this.lat0)<X?this.mode=dt.EQUIT:(this.mode=dt.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function qI(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),i=Math.cos(n.x),s,o;switch(this.mode){case dt.OBLIQ:o=this.sinph0*e+this.cosph0*t*i;break;case dt.EQUIT:o=t*i;break;case dt.S_POLE:o=-e;break;case dt.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(n.x),this.mode){case dt.OBLIQ:o*=this.cosph0*e-this.sinph0*t*i;break;case dt.EQUIT:o*=e;break;case dt.N_POLE:o*=-(t*i);break;case dt.S_POLE:o*=t*i;break}var r,a;return r=o*this.cg+s*this.sg,a=1/(r*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*a,o=r*a,n.x=s*this.a,n.y=o*this.a,n}function KI(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,i,s;s=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*s,i=this.pn1*n.y*this.cw*s,n.x=t*this.cg+i*this.sg,n.y=i*this.cg-t*this.sg;var o=Et(n.x,n.y);if(Math.abs(o)<X)e.x=0,e.y=n.y;else{var r,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),r=Math.sqrt(1-a*a),this.mode){case dt.OBLIQ:e.y=Math.asin(r*this.sinph0+n.y*a*this.cosph0/o),n.y=(r-this.sinph0*Math.sin(e.y))*o,n.x*=a*this.cosph0;break;case dt.EQUIT:e.y=Math.asin(n.y*a/o),n.y=r*o,n.x*=a;break;case dt.N_POLE:e.y=Math.asin(r),n.y=-n.y;break;case dt.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(n.x,n.y)}return n.x=e.x+this.long0,n.y=e.y,n}var XI=["Tilted_Perspective","tpers"];const JI={init:WI,forward:qI,inverse:KI,names:XI};function ZI(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function eS(n){var e=n.x,t=n.y,i,s,o,r;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var a=this.radius_p/Et(this.radius_p*Math.cos(t),Math.sin(t));if(s=a*Math.cos(e)*Math.cos(t),o=a*Math.sin(e)*Math.cos(t),r=a*Math.sin(t),(this.radius_g-s)*s-o*o-r*r*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(o/Et(r,i)),n.y=this.radius_g_1*Math.atan(r/i)):(n.x=this.radius_g_1*Math.atan(o/i),n.y=this.radius_g_1*Math.atan(r/Et(o,i)))}else this.shape==="sphere"&&(i=Math.cos(t),s=Math.cos(e)*i,o=Math.sin(e)*i,r=Math.sin(t),i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(o/Et(r,i)),n.y=this.radius_g_1*Math.atan(r/i)):(n.x=this.radius_g_1*Math.atan(o/i),n.y=this.radius_g_1*Math.atan(r/Et(o,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function tS(n){var e=-1,t=0,i=0,s,o,r,a;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Et(1,i)):(t=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Et(1,t));var l=i/this.radius_p;if(s=t*t+l*l+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return n.x=Number.NaN,n.y=Number.NaN,n;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,i*=a,n.x=Math.atan2(t,e),n.y=Math.atan(i*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+i*i)):(t=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+i*i+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return n.x=Number.NaN,n.y=Number.NaN,n;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,i*=a,n.x=Math.atan2(t,e),n.y=Math.atan(i*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var nS=["Geostationary Satellite View","Geostationary_Satellite","geos"];const iS={init:ZI,forward:eS,inverse:tS,names:nS};var Ys=1.340264,$s=-.081106,js=893e-6,Ws=.003796,Ar=Math.sqrt(3)/2;function sS(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function oS(n){var e=J(n.x-this.long0,this.over),t=n.y,i=Math.asin(Ar*Math.sin(t)),s=i*i,o=s*s*s;return n.x=e*Math.cos(i)/(Ar*(Ys+3*$s*s+o*(7*js+9*Ws*s))),n.y=i*(Ys+$s*s+o*(js+Ws*s)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function rS(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a;var e=1e-9,t=12,i=n.y,s,o,r,a,l,c;for(c=0;c<t&&(s=i*i,o=s*s*s,r=i*(Ys+$s*s+o*(js+Ws*s))-n.y,a=Ys+3*$s*s+o*(7*js+9*Ws*s),i-=l=r/a,!(Math.abs(l)<e));++c);return s=i*i,o=s*s*s,n.x=Ar*n.x*(Ys+3*$s*s+o*(7*js+9*Ws*s))/Math.cos(i),n.y=Math.asin(Math.sin(i)/Ar),n.x=J(n.x+this.long0,this.over),n}var aS=["eqearth","Equal Earth","Equal_Earth"];const lS={init:sS,forward:oS,inverse:rS,names:aS};var qs=1e-10;function cS(){var n;if(this.phi1=this.lat1,Math.abs(this.phi1)<qs)throw new Error;this.es?(this.en=Pl(this.es),this.m1=Ri(this.phi1,this.am1=Math.sin(this.phi1),n=Math.cos(this.phi1),this.en),this.am1=n/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=hS,this.forward=dS):(Math.abs(this.phi1)+qs>=$?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=fS,this.forward=uS)}function dS(n){var e=J(n.x-(this.long0||0),this.over),t=n.y,i,s,o;return i=this.am1+this.m1-Ri(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(i*Math.sqrt(1-this.es*s*s)),n.x=i*Math.sin(s),n.y=this.am1-i*Math.cos(s),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function hS(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,i,s;if(t=Et(n.x,n.y=this.am1-n.y),s=Dl(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<$)e=Math.sin(s),i=t*Math.atan2(n.x,n.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-$)<=qs)i=0;else throw new Error;return n.x=J(i+(this.long0||0),this.over),n.y=Bn(s),n}function uS(n){var e=J(n.x-(this.long0||0),this.over),t=n.y,i,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>qs?(n.x=s*Math.sin(i=e*Math.cos(t)/s),n.y=this.cphi1-s*Math.cos(i)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function fS(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,i=Et(n.x,n.y=this.cphi1-n.y);if(t=this.cphi1+this.phi1-i,Math.abs(t)>$)throw new Error;return Math.abs(Math.abs(t)-$)<=qs?e=0:e=i*Math.atan2(n.x,n.y)/Math.cos(t),n.x=J(e+(this.long0||0),this.over),n.y=Bn(t),n}var pS=["bonne","Bonne (Werner lat_1=90)"];const mS={init:cS,names:pS},zf={OBLIQUE:{forward:bS,inverse:wS},TRANSVERSE:{forward:CS,inverse:ES}},vr={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function gS(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=ff.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const n=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Pt(n);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const i=Object.keys(vr),s=a=>{if(typeof this[a]>"u")return;const l=parseFloat(this[a])*Oe;if(isNaN(l))throw new Error("Invalid value for "+a+": "+this[a]);return l};for(let a=0;a<i.length;a++){const l=i[a],c=vr[l],h=Object.entries(c);if(h.some(([p])=>typeof this[p]<"u")){t=c;for(let p=0;p<h.length;p++){const[f,m]=h[p],y=s(f);if(typeof y>"u")throw new Error("Missing parameter: "+f+".");this[m]=y}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:r}=vS(this,t);this.lamp=o,Math.abs(r)>X?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=zf.OBLIQUE):this.projectionType=zf.TRANSVERSE}function yS(n){return this.projectionType.forward(this,n)}function AS(n){return this.projectionType.inverse(this,n)}function vS(n,e){let t,i;if(e===vr.ROTATE){let s=n.oLongC,o=n.oLatC,r=n.oAlpha;if(Math.abs(Math.abs(o)-$)<=X)throw new Error("Invalid value for o_lat_c: "+n.o_lat_c+" should be < 90°");i=s+Math.atan2(-1*Math.cos(r),-1*Math.sin(r)*Math.sin(o)),t=Math.asin(Math.cos(o)*Math.sin(r))}else if(e===vr.NEW_POLE)i=n.oLongP,t=n.oLatP;else{let s=n.oLong1,o=n.oLat1,r=n.oLong2,a=n.oLat2,l=Math.abs(o);if(Math.abs(o)>$-X)throw new Error("Invalid value for o_lat_1: "+n.o_lat_1+" should be < 90°");if(Math.abs(a)>$-X)throw new Error("Invalid value for o_lat_2: "+n.o_lat_2+" should be < 90°");if(Math.abs(o-a)<X)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(l<X)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");i=Math.atan2(Math.cos(o)*Math.sin(a)*Math.cos(s)-Math.sin(o)*Math.cos(a)*Math.cos(r),Math.sin(o)*Math.cos(a)*Math.sin(r)-Math.cos(o)*Math.sin(a)*Math.sin(s)),t=Math.atan(-1*Math.cos(i-s)/Math.tan(o))}return{lamp:i,phip:t}}function bS(n,e){let{x:t,y:i}=e;t+=n.long0;const s=Math.cos(t),o=Math.sin(i),r=Math.cos(i);e.x=J(Math.atan2(r*Math.sin(t),n.sphip*r*s+n.cphip*o)+n.lamp),e.y=Math.asin(n.sphip*o-n.cphip*r*s);const a=n.obliqueProjection.forward(e);return n.isIdentity&&(a.x*=bt,a.y*=bt),a}function CS(n,e){let{x:t,y:i}=e;t+=n.long0;const s=Math.cos(i),o=Math.cos(t);e.x=J(Math.atan2(s*Math.sin(t),Math.sin(i))+n.lamp),e.y=Math.asin(-1*s*o);const r=n.obliqueProjection.forward(e);return n.isIdentity&&(r.x*=bt,r.y*=bt),r}function wS(n,e){n.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=n.obliqueProjection.inverse(e);let{x:i,y:s}=t;if(i<Number.MAX_VALUE){i-=n.lamp;const o=Math.cos(i),r=Math.sin(s),a=Math.cos(s);e.x=Math.atan2(a*Math.sin(i),n.sphip*a*o-n.cphip*r),e.y=Math.asin(n.sphip*r+n.cphip*a*o)}return e.x=J(e.x+n.long0),e}function ES(n,e){n.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=n.obliqueProjection.inverse(e);let{x:i,y:s}=t;if(i<Number.MAX_VALUE){const o=Math.cos(s);i-=n.lamp,e.x=Math.atan2(o*Math.sin(i),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(i))}return e.x=J(e.x+n.long0),e}var xS=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const IS={init:gS,forward:yS,inverse:AS,names:xS};function SS(n){n.Proj.projections.add(ur),n.Proj.projections.add(fr),n.Proj.projections.add(px),n.Proj.projections.add(Ex),n.Proj.projections.add(Tx),n.Proj.projections.add(Dx),n.Proj.projections.add(Gx),n.Proj.projections.add(Hx),n.Proj.projections.add(qx),n.Proj.projections.add(e2),n.Proj.projections.add(f2),n.Proj.projections.add(v2),n.Proj.projections.add(x2),n.Proj.projections.add(_2),n.Proj.projections.add(L2),n.Proj.projections.add(U2),n.Proj.projections.add(Y2),n.Proj.projections.add(K2),n.Proj.projections.add(nI),n.Proj.projections.add(aI),n.Proj.projections.add(uI),n.Proj.projections.add(yI),n.Proj.projections.add(xI),n.Proj.projections.add(BI),n.Proj.projections.add(NI),n.Proj.projections.add(QI),n.Proj.projections.add(jI),n.Proj.projections.add(JI),n.Proj.projections.add(iS),n.Proj.projections.add(lS),n.Proj.projections.add(mS),n.Proj.projections.add(IS)}const Ks=Object.assign(kE,{defaultDatum:"WGS84",Proj:Pt,WGS84:new Pt("WGS84"),Point:Li,toPoint:Ef,defs:it,nadgrid:fE,transform:dr,mgrs:PE,version:"__VERSION__"});SS(Ks);class MS{cesium;viewer;watermarkEnabled=!0;mapLayers={};modelId="default";options={flyTo:!0};gisCadModelsList=[];open=!1;events=new _s;heightLodThresholds={full:2e3,medium:8e3,far:3e4};heightLodEnabled=!1;heightLodHandler=null;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.gisCadModelsList}async addVectorTileByUrlTemplate(e){let t=window?.VectorTileLayer||window?.CesiumVectorTileGL?.VectorTileLayer||this.cesium?.VectorTileLayer;if(!t)try{const s=await Promise.resolve().then(()=>Vd),o=s?.VectorTileLayer||s?.CesiumVectorTileGL?.VectorTileLayer||s?.default?.VectorTileLayer||s?.default;if(o)window.VectorTileLayer=o,s?.CesiumVectorTileGL&&(window.CesiumVectorTileGL=s.CesiumVectorTileGL),t=o;else{const r=s?.VectorTileset||s?.CesiumVectorTileGL?.VectorTileset||s?.default?.VectorTileset;r&&(window.VectorTileset=r)}}catch{}if(t){const s=new t(this.viewer,{urlTemplate:e.urlTemplate,minZoom:e.minZoom??0,maxZoom:e.maxZoom??24,style:e.style||{},terrain:!0,tms:e.tms??e.scheme==="tms"});try{const o=s;o?.readyEvent?.addEventListener&&o.readyEvent.addEventListener(()=>{try{console.log("VectorTileLayer ready")}catch{}}),o?.errorEvent?.addEventListener&&o.errorEvent.addEventListener(r=>{console.error("VectorTileLayer error:",r)})}catch{}return s}const i=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(i){const s=[],o=Array.isArray(e.sourceLayer)?e.sourceLayer:e.sourceLayer?[e.sourceLayer]:["layer","lines","line","roads","road","default","vt","g"],r=c=>[{id:`vt-fill-${c}`,type:"fill",source:"vt","source-layer":c,paint:{"fill-color":e.style?.polygon?.fill??"#00ffff66","fill-opacity":e.style?.polygon?.opacity??.4}},{id:`vt-line-${c}`,type:"line",source:"vt","source-layer":c,paint:{"line-color":e.style?.line?.color??"#ff0000","line-width":e.style?.line?.width??3}}];o.forEach(c=>s.push(...r(c)));const a={version:8,sources:{vt:{type:"vector",tiles:[e.urlTemplate],minzoom:e.minZoom??0,maxzoom:e.maxZoom??24,scheme:e.scheme??(e.tms?"tms":"xyz")}},layers:s},l=new i({style:a,terrain:e.terrain??e.clampToGround??!0});return this.viewer.scene.primitives.add(l),l?.readyEvent?.addEventListener&&l.readyEvent.addEventListener(()=>{try{console.log("VectorTileset ready:",{sources:Object.keys(l?.sources||{}),layers:a?.layers?.map(c=>c?.["source-layer"]).filter((c,h,u)=>c&&u.indexOf(c)===h)})}catch{}}),l?.errorEvent?.addEventListener&&l.errorEvent.addEventListener(c=>{console.error("VectorTileset error:",c)}),l}return console.error("Vector tile renderer not found. Please include cesium-vectortile-gl (or compatible) and ensure VectorTileLayer/VectorTileset is available globally."),null}async addGeoJsonLayer(e){let t=window?.VectorTileLayer||window?.CesiumVectorTileGL?.VectorTileLayer||this.cesium?.VectorTileLayer;if(!t)try{const l=await Promise.resolve().then(()=>Vd),c=l?.VectorTileLayer||l?.CesiumVectorTileGL?.VectorTileLayer||l?.default?.VectorTileLayer||l?.default;c&&(window.VectorTileLayer=c,l?.CesiumVectorTileGL&&(window.CesiumVectorTileGL=l.CesiumVectorTileGL),t=c)}catch{}if(!(window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset))try{const l=await Promise.resolve().then(()=>Vd),c=l?.VectorTileset||l?.CesiumVectorTileGL?.VectorTileset||l?.default?.VectorTileset;c&&(window.VectorTileset=c)}catch{}const s={type:"geojson"};if(e.dataUrl)s.data=e.dataUrl;else if(e.data)s.data=e.data;else return null;if(e.minZoom!==void 0&&(s.minzoom=e.minZoom),e.maxZoom!==void 0&&(s.maxzoom=e.maxZoom),e.vtOptions&&typeof e.vtOptions=="object"){const l=e.vtOptions;l.maxZoom!==void 0&&(s.maxzoom=l.maxZoom),l.indexMaxZoom!==void 0&&(s.indexMaxZoom=l.indexMaxZoom),l.indexMaxPoints!==void 0&&(s.indexMaxPoints=l.indexMaxPoints),l.tolerance!==void 0&&(s.tolerance=l.tolerance),l.extent!==void 0&&(s.extent=l.extent),l.buffer!==void 0&&(s.buffer=l.buffer),l.lineMetrics!==void 0&&(s.lineMetrics=l.lineMetrics),l.promoteId!==void 0&&(s.promoteId=l.promoteId),l.generateId!==void 0&&(s.generateId=l.generateId)}const o={version:8,sources:{g:s},layers:[{id:"g-fill",type:"fill",source:"g",paint:{"fill-color":e.style?.polygon?.fill??"#00ffff66","fill-opacity":e.style?.polygon?.opacity??.4}},{id:"g-line",type:"line",source:"g",paint:{"line-color":e.style?.line?.color??"#ff0000","line-width":e.style?.line?.width??1.5}},{id:"g-point",type:"symbol",source:"g",layout:{"icon-image":void 0,"text-field":""},paint:{}}]};if(t){const l=new t(this.viewer,{style:o,terrain:e.terrain??e.clampToGround??!0});try{const c=l;c?.readyEvent?.addEventListener&&c.readyEvent.addEventListener(()=>{try{console.log("VectorTileLayer ready (geojson)")}catch{}}),c?.errorEvent?.addEventListener&&c.errorEvent.addEventListener(h=>{console.error("VectorTileLayer error (geojson):",h)})}catch{}try{const h=await(async()=>{if(e.data&&e.data.type==="FeatureCollection")return e.data;if(e.dataUrl){const u=await fetch(e.dataUrl,{cache:"no-store"});if(u.ok){const p=await u.json();if(p&&p.type==="FeatureCollection")return p}}return null})();if(h&&Array.isArray(h.features)&&h.features.length){let u=180,p=90,f=-180,m=-90;const y=(A,v)=>{!Number.isFinite(A)||!Number.isFinite(v)||(A<u&&(u=A),A>f&&(f=A),v<p&&(p=v),v>m&&(m=v))},g=A=>{if(Array.isArray(A)&&typeof A[0]=="number")y(Number(A[0]),Number(A[1]));else if(Array.isArray(A))for(const v of A)g(v)};for(const A of h.features){const v=A?.geometry;v?.coordinates&&g(v.coordinates)}if(u<=f&&p<=m){const A=this.cesium.Rectangle.fromDegrees(u,p,f,m);this.viewer.camera.flyTo({destination:A,duration:.6})}}}catch{}return l}const r=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(!r)return null;const a=new r({style:o,terrain:e.terrain??e.clampToGround??!0});this.viewer.scene.primitives.add(a);try{const c=await(async()=>{if(e.data&&e.data.type==="FeatureCollection")return e.data;if(e.dataUrl){const h=await fetch(e.dataUrl,{cache:"no-store"});if(h.ok){const u=await h.json();if(u&&u.type==="FeatureCollection")return u}}return null})();if(c&&Array.isArray(c.features)&&c.features.length){let h=180,u=90,p=-180,f=-90;const m=(g,A)=>{!Number.isFinite(g)||!Number.isFinite(A)||(g<h&&(h=g),g>p&&(p=g),A<u&&(u=A),A>f&&(f=A))},y=g=>{if(Array.isArray(g)&&typeof g[0]=="number")m(Number(g[0]),Number(g[1]));else if(Array.isArray(g))for(const A of g)y(A)};for(const g of c.features){const A=g?.geometry;A?.coordinates&&y(A.coordinates)}if(h<=p&&u<=f){const g=this.cesium.Rectangle.fromDegrees(h,u,p,f);this.viewer.camera.flyTo({destination:g,duration:.6})}}}catch{}return a}async addVectorTileByTilesManifest(e){try{const t=await fetch(e.manifestUrl,{cache:"no-store"});if(!t.ok)return null;const i=await t.json();let s=null;const o=Array.isArray(i?.items)?i.items[0]:null;if(o?.url&&typeof o.url=="string"&&(s=String(o.url).replace(/\\/g,"/").replace(/\/\d+\/\d+\/\d+\.pbf$/i,"")),!s){const h=new URL(e.manifestUrl,window.location.href).href.replace(/\\/g,"/");s=h.slice(0,h.lastIndexOf("/"))}let r=e.minZoom,a=e.maxZoom;if((r===void 0||a===void 0)&&Array.isArray(i?.items)&&i.items.length){const c=i.items.map(h=>Number(h?.z)).filter(h=>Number.isFinite(h));c.length&&(r===void 0&&(r=Math.min(...c)),a===void 0&&(a=Math.max(...c)))}try{const c=Array.isArray(i?.items)?i.items:[],h=r??c[0]?.z??0,u=c.filter(p=>Number(p?.z)===h);if(u.length){let p=1/0,f=-1/0,m=1/0,y=-1/0;for(const g of u){const A=Number(g.x),v=Number(g.y);!Number.isFinite(A)||!Number.isFinite(v)||(A<p&&(p=A),A>f&&(f=A),v<m&&(m=v),v>y&&(y=v))}if(Number.isFinite(p)&&Number.isFinite(f)&&Number.isFinite(m)&&Number.isFinite(y)){const g=Math.pow(2,h),A=B=>B/g*360-180,v=B=>{const R=Math.PI-2*Math.PI*B/g;return 180/Math.PI*Math.atan(Math.sinh(R))},C=A(p),w=A(f+1),S=v(m),x=v(y+1),I=this.cesium.Rectangle.fromDegrees(C,x,w,S);this.viewer.camera.flyTo({destination:I,duration:.6})}}}catch{}const l=`${s}/{z}/{x}/{y}.pbf`;return this.addVectorTileByUrlTemplate({modelId:e.modelId,urlTemplate:l,sourceLayer:e.sourceLayer,minZoom:r,maxZoom:a,style:e.style})}catch{return null}}enableHeightLod(e=!0){this.heightLodEnabled=e,e&&!this.heightLodHandler?(this.heightLodHandler=this.viewer.camera.changed.addEventListener(()=>{this.applyHeightLod()}),this.viewer.camera.percentageChanged=.05,this.applyHeightLod()):!e&&this.heightLodHandler&&(this.heightLodHandler(),this.heightLodHandler=null,this.gisCadModelsList.forEach(t=>{const i=this.mapLayers[t.modelId];i&&Object.values(i).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t.show!==!1)})})}),this.viewer.scene.requestRender())}applyHeightLod(){if(!this.heightLodEnabled)return;const e=this.viewer.camera.positionCartographic?.height??0,{full:t,medium:i,far:s}=this.heightLodThresholds;this.gisCadModelsList.forEach(o=>{const r=this.mapLayers[o.modelId];!r||o.show===!1||Object.values(r).forEach(a=>{a.forEach(l=>{if(!l.primitive)return;let c=!0;e>s?c=l.type==="polygon":e>i?c=l.type!=="point":e>t&&(c=!0),l.primitive.show=c})})}),this.viewer.scene.requestRender()}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.gisCadModelsList.find(i=>i.modelId===t):this.gisCadModelsList}getDefaultCoordinateTransformConfig(){return{centralMeridian:118.5,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"}}buildLongLatProj4Def(e){return`+proj=longlat +ellps=${e?.ellipsoid||this.getDefaultCoordinateTransformConfig().ellipsoid} +no_defs`}buildProjectedProj4Def(e){const t={...this.getDefaultCoordinateTransformConfig(),...e};return["+proj=tmerc",`+lat_0=${t.latOrigin}`,`+lon_0=${t.centralMeridian}`,`+k=${t.scaleFactor}`,`+x_0=${t.falseEasting}`,`+y_0=${t.falseNorthing}`,`+ellps=${t.ellipsoid||"GRS80"}`,"+units=m","+no_defs"].join(" ")}transformCoordinate(e){const t={...this.getDefaultCoordinateTransformConfig(),...e.config},i=this.buildLongLatProj4Def(t),s=this.buildProjectedProj4Def(t);if(e.direction==="lonlatToProjected"){const c=Number(e.longitude),h=Number(e.latitude);if([c,h].some(f=>Number.isNaN(f)))throw new Error("经纬度参数无效");const[u,p]=Ks(i,s,[c,h]);return{direction:e.direction,x:u,y:p,config:t}}const o=Number(e.x),r=Number(e.y);if([o,r].some(c=>Number.isNaN(c)))throw new Error("投影坐标参数无效");const[a,l]=Ks(s,i,[o,r]);return{direction:e.direction,longitude:a,latitude:l,config:t}}showJson({modelId:e,show:t}){const i=this.getRuntimeModel(e);i?.root&&(i.show=t,i.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})})}showJsonByLayer({modelId:e,show:t,layers:i}){const s=this.mapLayers[e];!s||!Array.isArray(i)||i.forEach(o=>{const r=s[o];r&&r.forEach(a=>{a.primitive&&(a.primitive.show=t)})})}flyToCadModel(e={}){const t=e.modelId||this.modelId,i=this.gisCadModelsList.find(s=>s.modelId===t);i&&this.flyToBounds(i,{duration:e.duration})}flyToBounds(e,t){if(!e)return;const i=t?.duration??0,s=this.computeRealRectangleDegrees(e);if(s){const o=this.cesium.Rectangle.fromDegrees(s.west,s.south,s.east,s.north);this.viewer.camera.flyTo({destination:o,duration:i});return}e.root&&this.viewer.flyTo(e.root,{duration:i})}computeRealRectangleDegrees(e){const t=e?.formData||{},i=e?.bounds,s=i?.min,o=i?.max;if(t.transformConfig&&t.transformDirection==="projectedToLonlat"&&s&&o&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(o.x)&&Number.isFinite(o.y))try{const r=this.buildLongLatProj4Def(t.transformConfig),a=this.buildProjectedProj4Def(t.transformConfig),l=Ks(a,r),[c,h]=l.forward([s.x,s.y]),[u,p]=l.forward([o.x,o.y]);return{west:Math.min(c,u),south:Math.min(h,p),east:Math.max(c,u),north:Math.max(h,p)}}catch(r){console.warn("Failed to compute projected rectangle",r)}if(t.longitude!==void 0&&t.latitude!==void 0){const r=Number(t.longitude),a=Number(t.latitude),l=Math.max(1e-6,Number(t.scale??1)),c=Math.max(.001,l*.001);return{west:r-c,south:a-c,east:r+c,north:a+c}}return null}parseColor(e,t=1){const i=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return i;const s=e.trim(),o=[s];if(s.startsWith("#")){const r=s.slice(1).replace(/[^0-9a-fA-F]/g,"");[3,4,6,8].includes(r.length)&&o.push(`#${r}`)}for(const r of Array.from(new Set(o)))try{const a=this.cesium.Color.fromCssColorString(r);if(a)return a.withAlpha(t)}catch(a){console.warn("Failed to parse CAD color candidate:",r,a)}return console.warn("Failed to parse CAD color, fallback to white:",e),i}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1:Math.max(1,Math.min(4,Math.round(e*4)))}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),i=Number(e[1]),s=Number(e[2]||0);return[t,i,s].some(o=>Number.isNaN(o))?null:[t,i,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([i,s])=>{e[i]||(e[i]=[]),e[i].push(...s)})}buildDefaultFormData(e,t){return{modelId:e.modelId,longitude:t.originLongitude,latitude:t.originLatitude,height:t.originHeight,scaleToMeter:t.scaleToMeter,scale:t.scale,localOriginX:t.localOriginX,localOriginY:t.localOriginY,totalRotation:e.totalRotation||0,distance:1e-6,heightDistance:1,rotation:1,scaleStep:.1,clampToGround:!1}}normalizeFormData(e,t,i=!1){const s=e.formData||{},o=this.buildDefaultFormData(e,t);return{...o,...s,modelId:e.modelId,longitude:Number(s.longitude??o.longitude),latitude:Number(s.latitude??o.latitude),height:Number(s.height??o.height),scaleToMeter:Number(s.scaleToMeter??o.scaleToMeter),scale:Math.max(1e-6,Number(s.scale??o.scale)),localOriginX:Number(s.localOriginX??o.localOriginX),localOriginY:Number(s.localOriginY??o.localOriginY),totalRotation:Number(s.totalRotation??o.totalRotation),distance:Number(s.distance??o.distance),heightDistance:Number(s.heightDistance??o.heightDistance),rotation:Number(s.rotation??o.rotation),scaleStep:Number(s.scaleStep??o.scaleStep),transformConfig:s.transformConfig,transformDirection:s.transformDirection,clampToGround:s.clampToGround??i}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const i=this.cesium,s=t.formData||{};let o=s.longitude??t.deltaLongitude??e.longitude??e.result?.origin?.longitude??0,r=s.latitude??t.deltaLatitude??e.latitude??e.result?.origin?.latitude??0,a=s.height??0;const l=e.result?.extMin?.x??0,c=e.result?.extMin?.y??0,h=e.result?.realUnits??e.unit??1,u=Math.max(1e-6,Number(s.scale??1)),p=h*u;let f=null,m=null,y=null;if(s.transformConfig&&s.transformDirection==="projectedToLonlat"){const w=this.buildLongLatProj4Def(s.transformConfig),S=this.buildProjectedProj4Def(s.transformConfig);f=Ks(S,w);try{const[x,I]=f.forward([l*h,c*h]);o=x,r=I,a=0,m=i.Cartesian3.fromDegrees(x,I,0);const B=i.Transforms.eastNorthUpToFixedFrame(m);y=i.Matrix4.inverseTransformation(B,new i.Matrix4)}catch(x){console.warn("Failed to calculate projection base",x),f=null}}const g=i.Cartesian3.fromDegrees(o,r,a),A=i.Transforms.eastNorthUpToFixedFrame(g),v=s.totalRotation??t.totalRotation??0;if(v){const w=i.Quaternion.fromAxisAngle(i.Cartesian3.UNIT_Z,i.Math.toRadians(v)),S=i.Matrix4.fromRotationTranslation(i.Matrix3.fromQuaternion(w),new i.Cartesian3(0,0,0));i.Matrix4.multiply(A,S,A)}return{originLongitude:o,originLatitude:r,originHeight:a,localOriginX:l,localOriginY:c,scaleToMeter:h,scale:u,totalScaleToMeter:p,toWorld:w=>{const S=this.normalizePoint(w);if(!S)return null;if(f&&m&&y)try{const I=S[0]*h,B=S[1]*h,[R,b]=f.forward([I,B]),T=i.Cartesian3.fromDegrees(R,b,S[2]*h),L=i.Matrix4.multiplyByPoint(y,T,new i.Cartesian3);return L.x*=u,L.y*=u,L.z*=u,i.Matrix4.multiplyByPoint(A,L,new i.Cartesian3)}catch{}const x=new i.Cartesian3((S[0]-l)*p,(S[1]-c)*p,S[2]*p);return i.Matrix4.multiplyByPoint(A,x,new i.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):null}createPolygonPrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPrimitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):null}createPointPrimitive(e){if(!e.length)return null;const t=new this.cesium.PointPrimitiveCollection;return e.forEach(i=>{t.add(i)}),t}buildModelPrimitives(e,t,i){const s=this.cesium,o=new s.PrimitiveCollection,r={},a={},l=this.buildTransform(t,e),c=new Map,h=new Map,u=new Map,p=Array.isArray(t.result?.lines)?t.result?.lines||[]:[],f=Array.isArray(t.result?.polygons)?t.result?.polygons||[]:[],m=Array.isArray(t.result?.points)?t.result?.points||[]:[];p.forEach(g=>{const v=(Array.isArray(g?.positions)?g.positions:[]).map(I=>l.toWorld(I)).filter(Boolean);if(v.length<2)return;const C=g.layer||"default",w=g.color||"#ffffff",S=this.uniqueKey([C,"line",this.getLineWidth(g.lineWeight)]),x=c.get(S)||[];x.push(new s.GeometryInstance({geometry:i.clampToGround?new s.GroundPolylineGeometry({positions:v,width:this.getLineWidth(g.lineWeight)}):new s.PolylineGeometry({positions:v,width:this.getLineWidth(g.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(w,1))},id:{modelId:e.modelId,layer:C,batchId:g.batchId,type:"line"}})),c.set(S,x)}),f.forEach(g=>{const v=(Array.isArray(g?.outerPositions)?g.outerPositions:[]).map(B=>l.toWorld(B)).filter(Boolean);if(v.length<3)return;const C=Array.isArray(g?.holes)?g.holes.map(B=>{const R=Array.isArray(B)?B.map(b=>l.toWorld(b)).filter(Boolean):[];return R.length<3?null:new s.PolygonHierarchy(R)}).filter(Boolean):[],w=g.layer||"default",S=g.color||"#ffffff",x=this.uniqueKey([w,"polygon"]),I=h.get(x)||[];I.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(v,C),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(S,.45))},id:{modelId:e.modelId,layer:w,batchId:g.batchId,type:"polygon"}})),h.set(x,I)}),m.forEach(g=>{const A=g?.position||g?.positions?.[0]||g,v=l.toWorld(A);if(!v)return;const C=g.layer||"default",w=g.color||"#ffffff",S=this.uniqueKey([C,"point"]),x=u.get(S)||[];x.push({position:v,color:this.parseColor(w,1),pixelSize:Math.max(4,Number(g.pixelSize||6)),id:{modelId:e.modelId,layer:C,batchId:g.batchId,type:"point"}}),u.set(S,x)});const y=(g,A,v)=>{A&&(o.add(A),i.recordLayers!==!1&&(a[g]||(a[g]=[]),a[g].push({primitive:A,color:v.color,batchId:v.batchId,type:v.type})),r[g]||(r[g]={}),r[g][v.type]=A)};return c.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createLinePrimitive(g,i),{color:void 0,batchId:g[0]?.id?.batchId,type:"line"})}),h.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createPolygonPrimitive(g,i),{color:void 0,batchId:g[0]?.id?.batchId,type:"polygon"})}),u.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createPointPrimitive(g),{color:void 0,batchId:g[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:a,transform:l}}buildModelRoot(e,t,i){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(a=>{const l=this.buildModelPrimitives(e,a,i);r||(r=l),s.add(l.root),this.mergeLayerItemsMap(o,l.layerItemsMap)}),{root:s,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(i=>i.modelId===t)||null}rebuildPreviewRoot(e){if(!e.editingFormData)return;e.previewRoot&&(this.removeModelNode(e.root,e.previewRoot),e.previewRoot=null);const t=this.buildModelRoot({...e,formData:e.editingFormData},e.sourceDataList,{clampToGround:e.editingFormData.clampToGround??!1,recordLayers:!1});e.previewRoot=t.root,e.root.add(e.previewRoot),e.groundRoot&&(e.groundRoot.show=!1)}replaceGroundRoot(e,t){t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround);const i=this.buildModelRoot({...e,formData:t},e.sourceDataList,e.buildOptions);e.groundRoot&&this.removeModelNode(e.root,e.groundRoot),e.groundRoot=i.root,e.root.add(e.groundRoot),e.groundRoot.show=e.show!==!1,e.transform=i.transform,this.mapLayers[e.modelId]=i.layerItemsMap}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const i=await t.blob(),s=new ml(new tr(i),{password:Hu,useWebWorkers:!1}),r=(await s.getEntries()).find(c=>!c.directory&&c.filename.endsWith(".json"));if(!r)return await s.close(),!1;const a=await r.arrayBuffer({useWebWorkers:!1});await s.close();const l=new TextDecoder().decode(a);return JSON.parse(l.trim())}catch(t){return console.error("Failed to load GIS CAD source:",e,t),!1}}getCandidateUrls(e){const t=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,i=[e.sourceUrl,`${t}${e.dbName}/cad.zip`].filter(Boolean);return Array.from(new Set(i))}getChunkCandidateUrls(e,t,i){const o=[`${e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`}${e.dbName}/cad_${i}.zip`];try{const r=new URL(t),a=r.pathname,l=a.lastIndexOf("/"),c=l>=0?a.slice(0,l+1):"/",h=a.lastIndexOf("."),u=h>=0?a.slice(h):".zip",p=l>=0?a.slice(l+1,h>=0?h:void 0):a.slice(0,h>=0?h:void 0),f=p===e.dbName?e.dbName:p;o.unshift(`${r.origin}${c}${f}_${i}${u}`,`${r.origin}${c}${f}${i}${u}`)}catch(r){console.warn("Failed to resolve chunk urls from primary source:",t,r)}return Array.from(new Set(o))}async loadSourceData(e){const t=this.getCandidateUrls(e);for(const i of t){const s=await this.loadModelFile(i);if(s)return{url:i,data:s}}return{url:t[0]||"",data:!1}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const i={...this.options,...t},s={clampToGround:i.clampToGround??i.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(f=>f.modelId===o.modelId))continue;/^https?:\/\//i.test(o.outPutPath)||(o.outPutPath=`${window.location.origin}${o.outPutPath}`);const l=`${o.outPutPath.endsWith("/")?o.outPutPath:`${o.outPutPath}/`}${o.dbName}/region.zip`,c=await this.loadModelFile(l);c&&typeof c=="object"&&(["longitude","latitude","scale","totalRotation","height"].some(y=>c[y]!==void 0)&&(o.formData={...o.formData||{},longitude:c.longitude,latitude:c.latitude,scale:c.scale,totalRotation:c.totalRotation,height:c.height}),c.centralMeridian!==void 0&&(o.formData={...o.formData||{},transformConfig:{centralMeridian:c.centralMeridian,latOrigin:c.latOrigin??0,scaleFactor:c.scaleFactor??1,falseEasting:c.falseEasting??5e5,falseNorthing:c.falseNorthing??0,ellipsoid:c.ellipsoid??"GRS80"},transformDirection:"projectedToLonlat"}));const h=await this.loadSourceData(o);if(!h.data){console.error("Failed to resolve GIS CAD primary source for model:",o);continue}const u=h.data,p=Math.max(1,Number(u.numbersOfFile||1));try{const f=this.buildTransform(u,o),m=this.normalizeFormData(o,f,s.clampToGround),y=this.buildModelRoot({...o,formData:m},[u],s),g=new this.cesium.PrimitiveCollection;g.add(y.root);const A=u.bounds||null,v={...o,type:"gis-cad",sourceUrl:h.url,sourceData:u,sourceDataList:[u],root:g,groundRoot:y.root,previewRoot:null,bounds:A,transform:y.transform,show:!0,formData:m,editingFormData:null,isEditing:!1,buildOptions:s,totalChunks:p,loadedChunks:1,chunkLoadingComplete:p<=1};this.mapLayers[o.modelId]=y.layerItemsMap,this.viewer.scene.primitives.add(v.root),this.gisCadModelsList.push(v),this.setModelId(o.modelId),i.flyTo&&this.flyToBounds(v),i.onSuccess&&i.onSuccess(v),p>1&&this.loadRemainingChunksAsync(o,h.url,p,v)}catch(f){console.error("Failed to build GIS CAD model:",o,f)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}async loadRemainingChunksAsync(e,t,i,s){for(let o=1;o<i;o++){await new Promise(l=>setTimeout(l,0));const r=this.getChunkCandidateUrls(e,t,o);let a=!1;for(const l of r)try{const c=await this.loadModelFile(l);if(c?.watermark&&this.watermarkEnabled&&$u(c.watermark,this.viewer?.container),c){const h=this.buildModelPrimitives({...s,formData:s.formData},c,s.buildOptions);s.groundRoot.add(h.root),s.sourceDataList.push(c),this.mapLayers[s.modelId]||(this.mapLayers[s.modelId]={}),this.mergeLayerItemsMap(this.mapLayers[s.modelId],h.layerItemsMap),s.loadedChunks=(s.loadedChunks||1)+1,this.events.emit("chunkProgress",{modelId:s.modelId,loaded:s.loadedChunks,total:i}),this.viewer.scene.requestRender(),a=!0;break}}catch(c){console.error("Failed to append GIS CAD chunk:",l,c)}a||console.warn(`Failed to load GIS CAD chunk ${o} for ${e.modelId}`)}s.chunkLoadingComplete=!0,this.events.emit("chunkLoadingComplete",s)}beginEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.isEditing||(t.isEditing=!0,t.editingFormData={...t.formData},this.rebuildPreviewRoot(t)),t):null}adjustGISCadModel(e){const t=this.getRuntimeModel(e.modelId);return t?(t.isEditing||this.beginEditGISCad({modelId:e.modelId}),t.editingFormData={...t.editingFormData||t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.editingFormData?.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.rebuildPreviewRoot(t),t.editingFormData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return!t||!t.isEditing||!t.editingFormData||(t.formData={...t.editingFormData},this.replaceGroundRoot(t,t.formData),t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.isEditing=!1,t.editingFormData=null),t}cancelEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.groundRoot&&(t.groundRoot.show=t.show!==!1),t.isEditing=!1,t.editingFormData=null,t):null}deleteCad({modelId:e}){this.mapLayers[e]&&delete this.mapLayers[e];const t=this.gisCadModelsList.findIndex(i=>i.modelId===e);if(t>-1){const i=this.gisCadModelsList[t];this.viewer.scene.primitives.remove(i.root),i.root?.destroy&&!i.root.isDestroyed?.()&&i.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class Pn{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const i=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:i,anchor:i==2,closeBtn:i==2,offset:i==2?{x:0,y:-20}:{x:10,y:10},content:"",show:!0,style:{background:"rgba(0,0,0,0.5)",color:"white"}};this.opt=Object.assign(s,t),this.attr=this.opt;const o=this.viewer.container.id;this.isShow=this.opt.show==null?!0:this.opt.show;let r="",a="";const l=this.opt.style.background,c=this.opt.style.color;this.opt.anchor&&(r+=`
|
|
16
|
+
northing meters`+n;var p=u/2,f=0,m=0,y,g,A,v,C;return p>0&&(y=1e5/Math.pow(10,p),g=n.substring(o,o+p),f=parseFloat(g)*y,A=n.substring(o+p),m=parseFloat(A)*y),v=f+c,C=m+h,{easting:v,northing:C,zoneLetter:a,zoneNumber:r,accuracy:y}}function GE(n,e){for(var t=Mf.charCodeAt(e-1),i=1e5,s=!1;t!==n.charCodeAt(0);){if(t++,t===wt&&t++,t===Dt&&t++,t>Os){if(s)throw"Bad character: "+n;t=Ni,s=!0}i+=1e5}return i}function UE(n,e){if(n>"V")throw"MGRSPoint given invalid Northing "+n;for(var t=Tf.charCodeAt(e-1),i=0,s=!1;t!==n.charCodeAt(0);){if(t++,t===wt&&t++,t===Dt&&t++,t>Fs){if(s)throw"Bad character: "+n;t=Ni,s=!0}i+=1e5}return i}function VE(n){var e;switch(n){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+n}function Li(n,e,t){if(!(this instanceof Li))return new Li(n,e,t);if(Array.isArray(n))this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="object")this.x=n.x,this.y=n.y,this.z=n.z||0;else if(typeof n=="string"&&typeof e>"u"){var i=n.split(",");this.x=parseFloat(i[0]),this.y=parseFloat(i[1]),this.z=parseFloat(i[2])||0}else this.x=n,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Li.fromMGRS=function(n){return new Li(_f(n))},Li.prototype.toMGRS=function(n){return Bf([this.x,this.y],n)};var QE=1,zE=.25,Nf=.046875,Lf=.01953125,Rf=.01068115234375,HE=.75,YE=.46875,$E=.013020833333333334,jE=.007120768229166667,WE=.3645833333333333,qE=.005696614583333333,KE=.3076171875;function Pl(n){var e=[];e[0]=QE-n*(zE+n*(Nf+n*(Lf+n*Rf))),e[1]=n*(HE-n*(Nf+n*(Lf+n*Rf)));var t=n*n;return e[2]=t*(YE-n*($E+n*jE)),t*=n,e[3]=t*(WE-n*qE),e[4]=t*n*KE,e}function Ri(n,e,t,i){return t*=e,e*=e,i[0]*n-t*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}var XE=20;function Dl(n,e,t){for(var i=1/(1-e),s=n,o=XE;o;--o){var r=Math.sin(s),a=1-e*r*r;if(a=(Ri(s,r,Math.cos(s),t)-n)*(a*Math.sqrt(a))*i,s-=a,Math.abs(a)<X)return s}return s}function JE(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Pl(this.es),this.ml0=Ri(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function ZE(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s,o,r,a=Math.sin(t),l=Math.cos(t);if(this.es){var h=l*i,u=Math.pow(h,2),p=this.ep2*Math.pow(l,2),f=Math.pow(p,2),m=Math.abs(l)>X?Math.tan(t):0,y=Math.pow(m,2),g=Math.pow(y,2);s=1-this.es*Math.pow(a,2),h=h/Math.sqrt(s);var A=Ri(t,a,l,this.en);o=this.a*(this.k0*h*(1+u/6*(1-y+p+u/20*(5-18*y+g+14*p-58*y*p+u/42*(61+179*g-g*y-479*y)))))+this.x0,r=this.a*(this.k0*(A-this.ml0+a*i*h/2*(1+u/12*(5-y+9*p+4*f+u/30*(61+g-58*y+270*p-330*y*p+u/56*(1385+543*g-g*y-3111*y))))))+this.y0}else{var c=l*Math.sin(i);if(Math.abs(Math.abs(c)-1)<X)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,r=l*Math.cos(i)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(r),c>=1){if(c-1>X)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return n.x=o,n.y=r,n}function ex(n){var e,t,i,s,o=(n.x-this.x0)*(1/this.a),r=(n.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Dl(e,this.es,this.en),Math.abs(t)<$){var u=Math.sin(t),p=Math.cos(t),f=Math.abs(p)>X?Math.tan(t):0,m=this.ep2*Math.pow(p,2),y=Math.pow(m,2),g=Math.pow(f,2),A=Math.pow(g,2);e=1-this.es*Math.pow(u,2);var v=o*Math.sqrt(e)/this.k0,C=Math.pow(v,2);e=e*f,i=t-e*C/(1-this.es)*.5*(1-C/12*(5+3*g-9*m*g+m-4*y-C/30*(61+90*g-252*m*g+45*A+46*m-C/56*(1385+3633*g+4095*A+1574*A*g)))),s=J(this.long0+v*(1-C/6*(1+2*g+m-C/20*(5+28*g+24*A+8*m*g+6*m-C/42*(61+662*g+1320*A+720*A*g))))/p,this.over)}else i=$*Ls(r),s=0;else{var a=Math.exp(o/this.k0),l=.5*(a-1/a),c=this.lat0+r/this.k0,h=Math.cos(c);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(l,2))),i=Math.asin(e),r<0&&(i=-i),l===0&&h===0?s=0:s=J(Math.atan2(l,h)+this.long0,this.over)}return n.x=s,n.y=i,n}var tx=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ur={init:JE,forward:ZE,inverse:ex,names:tx};function Ff(n){var e=Math.exp(n);return e=(e-1/e)/2,e}function Et(n,e){n=Math.abs(n),e=Math.abs(e);var t=Math.max(n,e),i=Math.min(n,e)/(t||1);return t*Math.sqrt(1+Math.pow(i,2))}function nx(n){var e=1+n,t=e-1;return t===0?n:n*Math.log(e)/t}function ix(n){var e=Math.abs(n);return e=nx(e*(1+e/(Et(1,e)+1))),n<0?-e:e}function Nl(n,e){for(var t=2*Math.cos(2*e),i=n.length-1,s=n[i],o=0,r;--i>=0;)r=-o+t*s+n[i],o=s,s=r;return e+r*Math.sin(2*e)}function sx(n,e){for(var t=2*Math.cos(e),i=n.length-1,s=n[i],o=0,r;--i>=0;)r=-o+t*s+n[i],o=s,s=r;return Math.sin(e)*r}function ox(n){var e=Math.exp(n);return e=(e+1/e)/2,e}function Of(n,e,t){for(var i=Math.sin(e),s=Math.cos(e),o=Ff(t),r=ox(t),a=2*s*r,l=-2*i*o,c=n.length-1,h=n[c],u=0,p=0,f=0,m,y;--c>=0;)m=p,y=u,p=h,u=f,h=-m+a*p-l*u+n[c],f=-y+l*p+a*u;return a=i*r,l=s*o,[a*h-l*f,a*f+l*h]}function rx(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ur.init.apply(this),this.forward=ur.forward,this.inverse=ur.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var n=this.es/(1+Math.sqrt(1-this.es)),e=n/(2-n),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var i=Nl(this.cbg,this.lat0);this.Zb=-this.Qn*(i+sx(this.gtu,2*i))}function ax(n){var e=J(n.x-this.long0,this.over),t=n.y;t=Nl(this.cbg,t);var i=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(i,r*s),e=Math.atan2(o*s,Et(i,s*r)),e=ix(Math.tan(e));var a=Of(this.gtu,2*t,2*e);t=t+a[0],e=e+a[1];var l,c;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,c=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,c=1/0),n.x=l,n.y=c,n}function lx(n){var e=(n.x-this.x0)*(1/this.a),t=(n.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var i,s;if(Math.abs(e)<=2.623395162778){var o=Of(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(Ff(e));var r=Math.sin(t),a=Math.cos(t),l=Math.sin(e),c=Math.cos(e);t=Math.atan2(r*c,Et(l,c*a)),e=Math.atan2(l,c*a),i=J(e+this.long0,this.over),s=Nl(this.cgb,t)}else i=1/0,s=1/0;return n.x=i,n.y=s,n}var cx=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const fr={init:rx,forward:ax,inverse:lx,names:cx};function dx(n,e){if(n===void 0){if(n=Math.floor((J(e)+Math.PI)*30/Math.PI)+1,n<0)return 0;if(n>60)return 60}return n}var hx="etmerc";function ux(){var n=dx(this.zone,this.long0);if(n===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(n)-183)*Oe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,fr.init.apply(this),this.forward=fr.forward,this.inverse=fr.inverse}var fx=["Universal Transverse Mercator System","utm"];const px={init:ux,names:fx,dependsOn:hx};function Ll(n,e){return Math.pow((1-n)/(1+n),e)}var mx=20;function gx(){var n=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(n/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ve)/(Math.pow(Math.tan(.5*this.lat0+ve),this.C)*Ll(this.e*n,this.ratexp))}function yx(n){var e=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ve),this.C)*Ll(this.e*Math.sin(t),this.ratexp))-$,n.x=this.C*e,n}function Ax(n){for(var e=1e-14,t=n.x/this.C,i=n.y,s=Math.pow(Math.tan(.5*i+ve)/this.K,1/this.C),o=mx;o>0&&(i=2*Math.atan(s*Ll(this.e*Math.sin(n.y),-.5*this.e))-$,!(Math.abs(i-n.y)<e));--o)n.y=i;return o?(n.x=t,n.y=i,n):null}const Rl={init:gx,forward:yx,inverse:Ax};function vx(){Rl.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function bx(n){var e,t,i,s;return n.x=J(n.x-this.long0,this.over),Rl.forward.apply(this,[n]),e=Math.sin(n.y),t=Math.cos(n.y),i=Math.cos(n.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*i),n.x=s*t*Math.sin(n.x),n.y=s*(this.cosc0*e-this.sinc0*t*i),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function Cx(n){var e,t,i,s,o;if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,o=Et(n.x,n.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+n.y*e*this.cosc0/o),i=Math.atan2(n.x*e,o*this.cosc0*t-n.y*this.sinc0*e)}else s=this.phic0,i=0;return n.x=i,n.y=s,Rl.inverse.apply(this,[n]),n.x=J(n.x+this.long0,this.over),n}var wx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Ex={init:vx,forward:bx,inverse:Cx,names:wx};function Fl(n,e,t){return e*=t,Math.tan(.5*($+n))*Math.pow((1-e)/(1+e),.5*t)}function xx(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&(this.k0=.5*(1+Ls(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=X&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=X&&Math.abs(Math.cos(this.lat_ts))>X&&(this.k0=.5*this.cons*Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ft(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Jt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Fl(this.lat0,this.sinlat0,this.e))-$,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Ix(n){var e=n.x,t=n.y,i=Math.sin(t),s=Math.cos(t),o,r,a,l,c,h,u=J(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=X&&Math.abs(t+this.lat0)<=X?(n.x=NaN,n.y=NaN,n):this.sphere?(o=2*this.k0/(1+this.sinlat0*i+this.coslat0*s*Math.cos(u)),n.x=this.a*o*s*Math.sin(u)+this.x0,n.y=this.a*o*(this.coslat0*i-this.sinlat0*s*Math.cos(u))+this.y0,n):(r=2*Math.atan(Fl(t,i,this.e))-$,l=Math.cos(r),a=Math.sin(r),Math.abs(this.coslat0)<=X?(c=Ft(this.e,t*this.con,this.con*i),h=2*this.a*this.k0*c/this.cons,n.x=this.x0+h*Math.sin(e-this.long0),n.y=this.y0-this.con*h*Math.cos(e-this.long0),n):(Math.abs(this.sinlat0)<X?(o=2*this.a*this.k0/(1+l*Math.cos(u)),n.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),n.y=o*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),n.x=o*l*Math.sin(u)+this.x0,n))}function Sx(n){n.x-=this.x0,n.y-=this.y0;var e,t,i,s,o,r=Math.sqrt(n.x*n.x+n.y*n.y);if(this.sphere){var a=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=X?(n.x=e,n.y=t,n):(t=Math.asin(Math.cos(a)*this.sinlat0+n.y*Math.sin(a)*this.coslat0/r),Math.abs(this.coslat0)<X?this.lat0>0?e=J(this.long0+Math.atan2(n.x,-1*n.y),this.over):e=J(this.long0+Math.atan2(n.x,n.y),this.over):e=J(this.long0+Math.atan2(n.x*Math.sin(a),r*this.coslat0*Math.cos(a)-n.y*this.sinlat0*Math.sin(a)),this.over),n.x=e,n.y=t,n)}else if(Math.abs(this.coslat0)<=X){if(r<=X)return t=this.lat0,e=this.long0,n.x=e,n.y=t,n;n.x*=this.con,n.y*=this.con,i=r*this.cons/(2*this.a*this.k0),t=this.con*Rs(this.e,i),e=this.con*J(this.con*this.long0+Math.atan2(n.x,-1*n.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=X?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+n.y*Math.sin(s)*this.cosX0/r),e=J(this.long0+Math.atan2(n.x*Math.sin(s),r*this.cosX0*Math.cos(s)-n.y*this.sinX0*Math.sin(s)),this.over)),t=-1*Rs(this.e,Math.tan(.5*($+o)));return n.x=e,n.y=t,n}var Mx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Tx={init:xx,forward:Ix,inverse:Sx,names:Mx,ssfn_:Fl};function Bx(){var n=this.lat0;this.lambda0=this.long0;var e=Math.sin(n),t=this.a,i=this.rf,s=1/i,o=2*s-Math.pow(s,2),r=this.e=Math.sqrt(o);this.R=this.k0*t*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(n),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+n/2)),c=Math.log((1+r*e)/(1-r*e));this.K=a-this.alpha*l+this.alpha*r/2*c}function _x(n){var e=Math.log(Math.tan(Math.PI/4-n.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),i=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(i))-Math.PI/4),o=this.alpha*(n.x-this.lambda0),r=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(o));return n.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,n.x=this.R*r+this.x0,n}function kx(n){for(var e=n.x-this.x0,t=n.y-this.y0,i=e/this.R,s=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),r=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),a=this.lambda0+r/this.alpha,l=0,c=o,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return n.x=a,n.y=c,n}var Px=["somerc"];const Dx={init:Bx,forward:_x,inverse:kx,names:Px};var Fi=1e-7;function Nx(n){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof n.projName=="object"?Object.keys(n.projName)[0]:n.projName;return"no_uoff"in n||"no_off"in n||e.indexOf(t)!==-1||e.indexOf(mf(t))!==-1}function Lx(){var n,e,t,i,s,o,r,a,l,c,h=0,u,p=0,f=0,m=0,y=0,g=0,A=0;this.no_off=Nx(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var C=!1;if("rectified_grid_angle"in this&&(C=!0),v&&(A=this.alpha),C&&(h=this.rectified_grid_angle),v||C)p=this.longc;else if(f=this.long1,y=this.lat1,m=this.long2,g=this.lat2,Math.abs(y-g)<=Fi||(n=Math.abs(y))<=Fi||Math.abs(n-$)<=Fi||Math.abs(Math.abs(this.lat0)-$)<=Fi||Math.abs(Math.abs(g)-$)<=Fi)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>X?(a=Math.sin(this.lat0),t=Math.cos(this.lat0),n=1-this.es*a*a,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/n,i=this.B*e/(t*Math.sqrt(n)),s=i*i-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=i,this.E*=Math.pow(Ft(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=s=1),v||C?(v?(u=Math.asin(Math.sin(A)/i),C||(h=A)):(u=h,A=Math.asin(i*Math.sin(u))),this.lam0=p-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(o=Math.pow(Ft(this.e,y,Math.sin(y)),this.B),r=Math.pow(Ft(this.e,g,Math.sin(g)),this.B),s=this.E/o,l=(r-o)/(r+o),c=this.E*this.E,c=(c-r*o)/(c+r*o),n=f-m,n<-Math.PI?m-=Ds:n>Math.PI&&(m+=Ds),this.lam0=J(.5*(f+m)-Math.atan(c*Math.tan(.5*this.B*(f-m))/l)/this.B,this.over),u=Math.atan(2*Math.sin(this.B*J(f-this.lam0,this.over))/(s-1/s)),h=A=Math.asin(i*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(A))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(ve-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ve+s))}function Rx(n){var e={},t,i,s,o,r,a,l,c;if(n.x=n.x-this.lam0,Math.abs(Math.abs(n.y)-$)>X){if(r=this.E/Math.pow(Ft(this.e,n.y,Math.sin(n.y)),this.B),a=1/r,t=.5*(r-a),i=.5*(r+a),o=Math.sin(this.B*n.x),s=(t*this.singam-o*this.cosgam)/i,Math.abs(Math.abs(s)-1)<X)throw new Error;c=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*n.x),Math.abs(a)<Fi?l=this.A*n.x:l=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else c=n.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*n.y;return this.no_rot?(e.x=l,e.y=c):(l-=this.u_0,e.x=c*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-c*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Fx(n){var e,t,i,s,o,r,a,l={};if(n.x=(n.x-this.x0)*(1/this.a),n.y=(n.y-this.y0)*(1/this.a),this.no_rot?(t=n.y,e=n.x):(t=n.x*this.cosrot-n.y*this.sinrot,e=n.y*this.cosrot+n.x*this.sinrot+this.u_0),i=Math.exp(-this.BrA*t),s=.5*(i-1/i),o=.5*(i+1/i),r=Math.sin(this.BrA*e),a=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(a)-1)<X)l.x=0,l.y=a<0?-$:$;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Rs(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(s*this.cosgam-r*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l}var Ox=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Gx={init:Lx,forward:Rx,inverse:Fx,names:Ox};function Ux(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<X)){var n=this.b/this.a;this.e=Math.sqrt(1-n*n);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),i=Jt(this.e,e,t),s=Ft(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),a=Jt(this.e,o,r),l=Ft(this.e,this.lat2,o),c=Math.abs(Math.abs(this.lat0)-$)<X?0:Ft(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>X?this.ns=Math.log(i/a)/Math.log(s/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Vx(n){var e=n.x,t=n.y;Math.abs(2*Math.abs(t)-Math.PI)<=X&&(t=Ls(t)*($-2*X));var i=Math.abs(Math.abs(t)-$),s,o;if(i>X)s=Ft(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(i=t*this.ns,i<=0)return null;o=0}var r=this.ns*J(e-this.long0,this.over);return n.x=this.k0*(o*Math.sin(r))+this.x0,n.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,n}function Qx(n){var e,t,i,s,o,r=(n.x-this.x0)/this.k0,a=this.rh-(n.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(r*r+a*a),t=1):(e=-Math.sqrt(r*r+a*a),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*r,t*a)),e!==0||this.ns>0){if(t=1/this.ns,i=Math.pow(e/(this.a*this.f0),t),s=Rs(this.e,i),s===-9999)return null}else s=-$;return o=J(l/this.ns+this.long0,this.over),n.x=o,n.y=s,n}var zx=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Hx={init:Ux,forward:Vx,inverse:Qx,names:zx};function Yx(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function $x(n){var e,t,i,s,o,r,a,l=n.x,c=n.y,h=J(l-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(i)),o=Math.asin(Math.cos(t)*Math.sin(i)/Math.cos(s)),r=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),n.y=a*Math.cos(r)/1,n.x=a*Math.sin(r)/1,this.czech||(n.y*=-1,n.x*=-1),n}function jx(n){var e,t,i,s,o,r,a,l,c=n.x;n.x=n.y,n.y=c,this.czech||(n.y*=-1,n.x*=-1),r=Math.sqrt(n.x*n.x+n.y*n.y),o=Math.atan2(n.y,n.x),s=o/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/r,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),t=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(e)),n.x=this.long0-t/this.alfa,a=e,l=0;var h=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-n.y)<1e-10&&(l=1),a=n.y,h+=1;while(l===0&&h<15);return h>=15?null:n}var Wx=["Krovak","krovak"];const qx={init:Yx,forward:$x,inverse:jx,names:Wx};function mt(n,e,t,i,s){return n*s-e*Math.sin(2*s)+t*Math.sin(4*s)-i*Math.sin(6*s)}function Gs(n){return 1-.25*n*(1+n/16*(3+1.25*n))}function Us(n){return .375*n*(1+.25*n*(1+.46875*n))}function Vs(n){return .05859375*n*n*(1+.75*n)}function Qs(n){return n*n*n*(35/3072)}function Ol(n,e,t){var i=e*t;return n/Math.sqrt(1-i*i)}function Bn(n){return Math.abs(n)<$?n:n-Ls(n)*Math.PI}function pr(n,e,t,i,s){var o,r;o=n/e;for(var a=0;a<15;a++)if(r=(n-(e*o-t*Math.sin(2*o)+i*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*i*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Kx(){this.sphere||(this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.ml0=this.a*mt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Xx(n){var e,t,i=n.x,s=n.y;if(i=J(i-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(i)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(i))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),a=Ol(this.a,this.e,o),l=Math.tan(s)*Math.tan(s),c=i*Math.cos(s),h=c*c,u=this.es*r*r/(1-this.es),p=this.a*mt(this.e0,this.e1,this.e2,this.e3,s);e=a*c*(1-h*l*(1/6-(8-l+8*u)*h/120)),t=p-this.ml0+a*o/r*h*(.5+(5-l+6*u)*h/24)}return n.x=e+this.x0,n.y=t+this.y0,n}function Jx(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,i,s;if(this.sphere){var o=t+this.lat0;i=Math.asin(Math.sin(o)*Math.cos(e)),s=Math.atan2(Math.tan(e),Math.cos(o))}else{var r=this.ml0/this.a+t,a=pr(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-$)<=X)return n.x=this.long0,n.y=$,t<0&&(n.y*=-1),n;var l=Ol(this.a,this.e,Math.sin(a)),c=l*l*l/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(a),2),u=e*this.a/l,p=u*u;i=a-l*Math.tan(a)/c*u*u*(.5-(1+3*h)*u*u/24),s=u*(1-p*(h/3+(1+3*h)*h*p/15))/Math.cos(a)}return n.x=J(s+this.long0,this.over),n.y=Bn(i),n}var Zx=["Cassini","Cassini_Soldner","cass"];const e2={init:Kx,forward:Xx,inverse:Jx,names:Zx};function _n(n,e){var t;return n>1e-7?(t=n*e,(1-n*n)*(e/(1-t*t)-.5/n*Math.log((1-t)/(1+t)))):2*e}var Gl=1,Ul=2,Vl=3,mr=4;function t2(){var n=Math.abs(this.lat0);if(Math.abs(n-$)<X?this.mode=this.lat0<0?Gl:Ul:Math.abs(n)<X?this.mode=Vl:this.mode=mr,this.es>0){var e;switch(this.qp=_n(this.e,1),this.mmf=.5/(1-this.es),this.apa=d2(this.es),this.mode){case Ul:this.dd=1;break;case Gl:this.dd=1;break;case Vl:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case mr:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=_n(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===mr&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function n2(n){var e,t,i,s,o,r,a,l,c,h,u=n.x,p=n.y;if(u=J(u-this.long0,this.over),this.sphere){if(o=Math.sin(p),h=Math.cos(p),i=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*i:1+this.sinph0*o+this.cosph0*h*i,t<=X)return null;t=Math.sqrt(2/t),e=t*h*Math.sin(u),t*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(p+this.lat0)<X)return null;t=ve-p*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(u),t*=i}}else{switch(a=0,l=0,c=0,i=Math.cos(u),s=Math.sin(u),o=Math.sin(p),r=_n(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=r/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:c=1+this.sinb1*a+this.cosb1*l*i;break;case this.EQUIT:c=1+l*i;break;case this.N_POLE:c=$+p,r=this.qp-r;break;case this.S_POLE:c=p-$,r=this.qp+r;break}if(Math.abs(c)<X)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),this.mode===this.OBLIQ?t=this.ymf*c*(this.cosb1*a-this.sinb1*l*i):t=(c=Math.sqrt(2/(1+l*i)))*a*this.ymf,e=this.xmf*c*l*s;break;case this.N_POLE:case this.S_POLE:r>=0?(e=(c=Math.sqrt(r))*s,t=i*(this.mode===this.S_POLE?c:-c)):e=t=0;break}}return n.x=this.a*e+this.x0,n.y=this.a*t+this.y0,n}function i2(n){n.x-=this.x0,n.y-=this.y0;var e=n.x/this.a,t=n.y/this.a,i,s,o,r,a,l,c;if(this.sphere){var h=0,u,p=0;if(u=Math.sqrt(e*e+t*t),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=X?0:Math.asin(t*p/u),e*=p,t=h*u;break;case this.OBLIQ:s=Math.abs(u)<=X?this.lat0:Math.asin(h*this.sinph0+t*p*this.cosph0/u),e*=p*this.cosph0,t=(h-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:t=-t,s=$-s;break;case this.S_POLE:s-=$;break}i=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l<X)return n.x=this.long0,n.y=this.lat0,n;r=2*Math.asin(.5*l/this.rq),o=Math.cos(r),e*=r=Math.sin(r),this.mode===this.OBLIQ?(c=o*this.sinb1+t*r*this.cosb1/l,a=this.qp*c,t=l*this.cosb1*o-t*this.sinb1*r):(c=t*r/l,a=this.qp*c,t=l*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),a=e*e+t*t,!a)return n.x=this.long0,n.y=this.lat0,n;c=1-a/this.qp,this.mode===this.S_POLE&&(c=-c)}i=Math.atan2(e,t),s=h2(Math.asin(c),this.apa)}return n.x=J(this.long0+i,this.over),n.y=s,n}var s2=.3333333333333333,o2=.17222222222222222,r2=.10257936507936508,a2=.06388888888888888,l2=.0664021164021164,c2=.016415012942191543;function d2(n){var e,t=[];return t[0]=n*s2,e=n*n,t[0]+=e*o2,t[1]=e*a2,e*=n,t[0]+=e*r2,t[1]+=e*l2,t[2]=e*c2,t}function h2(n,e){var t=n+n;return n+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var u2=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const f2={init:t2,forward:n2,inverse:i2,names:u2,S_POLE:Gl,N_POLE:Ul,EQUIT:Vl,OBLIQ:mr};function kn(n){return Math.abs(n)>1&&(n=n>1?1:-1),Math.asin(n)}function p2(){Math.abs(this.lat1+this.lat2)<X||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Jt(this.e3,this.sin_po,this.cos_po),this.qs1=_n(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Jt(this.e3,this.sin_po,this.cos_po),this.qs2=_n(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=_n(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>X?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function m2(n){var e=n.x,t=n.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var i=_n(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,o=this.ns0*J(e-this.long0,this.over),r=s*Math.sin(o)+this.x0,a=this.rh-s*Math.cos(o)+this.y0;return n.x=r,n.y=a,n}function g2(n){var e,t,i,s,o,r;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(e=Math.sqrt(n.x*n.x+n.y*n.y),i=1):(e=-Math.sqrt(n.x*n.x+n.y*n.y),i=-1),s=0,e!==0&&(s=Math.atan2(i*n.x,i*n.y)),i=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-i*i)/(2*this.ns0)):(t=(this.c-i*i)/this.ns0,r=this.phi1z(this.e3,t)),o=J(s/this.ns0+this.long0,this.over),n.x=o,n.y=r,n}function y2(n,e){var t,i,s,o,r,a=kn(.5*e);if(n<X)return a;for(var l=n*n,c=1;c<=25;c++)if(t=Math.sin(a),i=Math.cos(a),s=n*t,o=1-s*s,r=.5*o*o/i*(e/(1-l)-t/o+.5/n*Math.log((1-s)/(1+s))),a=a+r,Math.abs(r)<=1e-7)return a;return null}var A2=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const v2={init:p2,forward:m2,inverse:g2,names:A2,phi1z:y2};function b2(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function C2(n){var e,t,i,s,o,r,a,l,c=n.x,h=n.y;return i=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(i),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=X?(a=this.x0+this.a*o*t*Math.sin(i)/r,l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/r):(a=this.x0+this.infinity_dist*t*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),n.x=a,n.y=l,n}function w2(n){var e,t,i,s,o,r;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(e=Math.sqrt(n.x*n.x+n.y*n.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),i=Math.cos(s),r=kn(i*this.sin_p14+n.y*t*this.cos_p14/e),o=Math.atan2(n.x*t,e*this.cos_p14*i-n.y*this.sin_p14*t),o=J(this.long0+o,this.over)):(r=this.phic0,o=0),n.x=o,n.y=r,n}var E2=["gnom"];const x2={init:b2,forward:C2,inverse:w2,names:E2};function I2(n,e){var t=1-(1-n*n)/(2*n)*Math.log((1-n)/(1+n));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*$:$;for(var i=Math.asin(.5*e),s,o,r,a,l=0;l<30;l++)if(o=Math.sin(i),r=Math.cos(i),a=n*o,s=Math.pow(1-a*a,2)/(2*r)*(e/(1-n*n)-o/(1-a*a)+.5/n*Math.log((1-a)/(1+a))),i+=s,Math.abs(s)<=1e-10)return i;return NaN}function S2(){this.sphere||(this.k0=Jt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function M2(n){var e=n.x,t=n.y,i,s,o=J(e-this.long0,this.over);if(this.sphere)i=this.x0+this.a*o*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var r=_n(this.e,Math.sin(t));i=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return n.x=i,n.y=s,n}function T2(n){n.x-=this.x0,n.y-=this.y0;var e,t;return this.sphere?(e=J(this.long0+n.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(n.y/this.a*Math.cos(this.lat_ts))):(t=I2(this.e,2*n.y*this.k0/this.a),e=J(this.long0+n.x/(this.a*this.k0),this.over)),n.x=e,n.y=t,n}var B2=["cea"];const _2={init:S2,forward:M2,inverse:T2,names:B2};function k2(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function P2(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=Bn(t-this.lat0);return n.x=this.x0+this.a*i*this.rc,n.y=this.y0+this.a*s,n}function D2(n){var e=n.x,t=n.y;return n.x=J(this.long0+(e-this.x0)/(this.a*this.rc),this.over),n.y=Bn(this.lat0+(t-this.y0)/this.a),n}var N2=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const L2={init:k2,forward:P2,inverse:D2,names:N2};var Gf=20;function R2(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.ml0=this.a*mt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function F2(n){var e=n.x,t=n.y,i,s,o,r=J(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=X?(i=this.a*r,s=-1*this.a*this.lat0):(i=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Bn(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=X)i=this.a*r,s=-1*this.ml0;else{var a=Ol(this.a,this.e,Math.sin(t))/Math.tan(t);i=a*Math.sin(o),s=this.a*mt(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+a*(1-Math.cos(o))}return n.x=i+this.x0,n.y=s+this.y0,n}function O2(n){var e,t,i,s,o,r,a,l,c;if(i=n.x-this.x0,s=n.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=X)e=J(i/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,a=i*i/this.a/this.a+r*r,l=r;var h;for(o=Gf;o;--o)if(h=Math.tan(l),c=-1*(r*(l*h+1)-l-.5*(l*l+a)*h)/((l-r)/h-1),l+=c,Math.abs(c)<=X){t=l;break}e=J(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=X)t=0,e=J(this.long0+i/this.a,this.over);else{r=(this.ml0+s)/this.a,a=i*i/this.a/this.a+r*r,l=r;var u,p,f,m,y;for(o=Gf;o;--o)if(y=this.e*Math.sin(l),u=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*mt(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=p/this.a,c=(r*(u*m+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*r*m)/(4*u)+(r-m)*(u*f-2/Math.sin(2*l))-f),l-=c,Math.abs(c)<=X){t=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=J(this.long0+Math.asin(i*u/this.a)/Math.sin(t),this.over)}return n.x=e,n.y=t,n}var G2=["Polyconic","American_Polyconic","poly"];const U2={init:R2,forward:F2,inverse:O2,names:G2};function V2(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Q2(n){var e,t=n.x,i=n.y,s=i-this.lat0,o=t-this.long0,r=s/Ps*1e-5,a=o,l=1,c=0;for(e=1;e<=10;e++)l=l*r,c=c+this.A[e]*l;var h=c,u=a,p=1,f=0,m,y,g=0,A=0;for(e=1;e<=6;e++)m=p*h-f*u,y=f*h+p*u,p=m,f=y,g=g+this.B_re[e]*p-this.B_im[e]*f,A=A+this.B_im[e]*p+this.B_re[e]*f;return n.x=A*this.a+this.x0,n.y=g*this.a+this.y0,n}function z2(n){var e,t=n.x,i=n.y,s=t-this.x0,o=i-this.y0,r=o/this.a,a=s/this.a,l=1,c=0,h,u,p=0,f=0;for(e=1;e<=6;e++)h=l*r-c*a,u=c*r+l*a,l=h,c=u,p=p+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var m=0;m<this.iterations;m++){var y=p,g=f,A,v,C=r,w=a;for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,C=C+(e-1)*(this.B_re[e]*y-this.B_im[e]*g),w=w+(e-1)*(this.B_im[e]*y+this.B_re[e]*g);y=1,g=0;var S=this.B_re[1],x=this.B_im[1];for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,S=S+e*(this.B_re[e]*y-this.B_im[e]*g),x=x+e*(this.B_im[e]*y+this.B_re[e]*g);var I=S*S+x*x;p=(C*S+w*x)/I,f=(w*S-C*x)/I}var B=p,R=f,b=1,T=0;for(e=1;e<=9;e++)b=b*B,T=T+this.D[e]*b;var L=this.lat0+T*Ps*1e5,O=this.long0+R;return n.x=O,n.y=L,n}var H2=["New_Zealand_Map_Grid","nzmg"];const Y2={init:V2,forward:Q2,inverse:z2,names:H2};function $2(){}function j2(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=this.x0+this.a*i,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return n.x=s,n.y=o,n}function W2(n){n.x-=this.x0,n.y-=this.y0;var e=J(this.long0+n.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*n.y/this.a))-Math.PI/4);return n.x=e,n.y=t,n}var q2=["Miller_Cylindrical","mill"];const K2={init:$2,forward:j2,inverse:W2,names:q2};var X2=20;function J2(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Pl(this.es)}function Z2(n){var e,t,i=n.x,s=n.y;if(i=J(i-this.long0,this.over),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var o=this.n*Math.sin(s),r=X2;r;--r){var a=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<X)break}e=this.a*this.C_x*i*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var l=Math.sin(s),c=Math.cos(s);t=this.a*Ri(s,l,c,this.en),e=this.a*i*c/Math.sqrt(1-this.es*l*l)}return n.x=e,n.y=t,n}function eI(n){var e,t,i,s;return n.x-=this.x0,i=n.x/this.a,n.y-=this.y0,e=n.y/this.a,this.sphere?(e/=this.C_y,i=i/(this.C_x*(this.m+Math.cos(e))),this.m?e=kn((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=kn(Math.sin(e)/this.n)),i=J(i+this.long0,this.over),e=Bn(e)):(e=Dl(n.y/this.a,this.es,this.en),s=Math.abs(e),s<$?(s=Math.sin(e),t=this.long0+n.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),i=J(t,this.over)):s-X<$&&(i=this.long0)),n.x=i,n.y=e,n}var tI=["Sinusoidal","sinu"];const nI={init:J2,forward:Z2,inverse:eI,names:tI};function iI(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function sI(n){for(var e=n.x,t=n.y,i=J(e-this.long0,this.over),s=t,o=Math.PI*Math.sin(t);;){var r=-(s+Math.sin(s)-o)/(1+Math.cos(s));if(s+=r,Math.abs(r)<X)break}s/=2,Math.PI/2-Math.abs(t)<X&&(i=0);var a=.900316316158*this.a*i*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return n.x=a,n.y=l,n}function oI(n){var e,t;n.x-=this.x0,n.y-=this.y0,t=n.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var i=J(this.long0+n.x/(.900316316158*this.a*Math.cos(e)),this.over);i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return n.x=i,n.y=s,n}var rI=["Mollweide","moll"];const aI={init:iI,forward:sI,inverse:oI,names:rI};function lI(){Math.abs(this.lat1+this.lat2)<X||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Gs(this.es),this.e1=Us(this.es),this.e2=Vs(this.es),this.e3=Qs(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Jt(this.e,this.sin_phi,this.cos_phi),this.ml1=mt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<X?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Jt(this.e,this.sin_phi,this.cos_phi),this.ml2=mt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=mt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function cI(n){var e=n.x,t=n.y,i;if(this.sphere)i=this.a*(this.g-t);else{var s=mt(this.e0,this.e1,this.e2,this.e3,t);i=this.a*(this.g-s)}var o=this.ns*J(e-this.long0,this.over),r=this.x0+i*Math.sin(o),a=this.y0+this.rh-i*Math.cos(o);return n.x=r,n.y=a,n}function dI(n){n.x-=this.x0,n.y=this.rh-n.y+this.y0;var e,t,i,s;this.ns>=0?(t=Math.sqrt(n.x*n.x+n.y*n.y),e=1):(t=-Math.sqrt(n.x*n.x+n.y*n.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*n.x,e*n.y)),this.sphere)return s=J(this.long0+o/this.ns,this.over),i=Bn(this.g-t/this.a),n.x=s,n.y=i,n;var r=this.g-t/this.a;return i=pr(r,this.e0,this.e1,this.e2,this.e3),s=J(this.long0+o/this.ns,this.over),n.x=s,n.y=i,n}var hI=["Equidistant_Conic","eqdc"];const uI={init:lI,forward:cI,inverse:dI,names:hI};function fI(){this.R=this.a}function pI(n){var e=n.x,t=n.y,i=J(e-this.long0,this.over),s,o;Math.abs(t)<=X&&(s=this.x0+this.R*i,o=this.y0);var r=kn(2*Math.abs(t/Math.PI));(Math.abs(i)<=X||Math.abs(Math.abs(t)-$)<=X)&&(s=this.x0,t>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*r):o=this.y0+Math.PI*this.R*-Math.tan(.5*r));var a=.5*Math.abs(Math.PI/i-i/Math.PI),l=a*a,c=Math.sin(r),h=Math.cos(r),u=h/(c+h-1),p=u*u,f=u*(2/c-1),m=f*f,y=Math.PI*this.R*(a*(u-m)+Math.sqrt(l*(u-m)*(u-m)-(m+l)*(p-m)))/(m+l);i<0&&(y=-y),s=this.x0+y;var g=l+u;return y=Math.PI*this.R*(f*g-a*Math.sqrt((m+l)*(l+1)-g*g))/(m+l),t>=0?o=this.y0+y:o=this.y0-y,n.x=s,n.y=o,n}function mI(n){var e,t,i,s,o,r,a,l,c,h,u,p,f;return n.x-=this.x0,n.y-=this.y0,u=Math.PI*this.R,i=n.x/u,s=n.y/u,o=i*i+s*s,r=-Math.abs(s)*(1+o),a=r-2*s*s+i*i,l=-2*r+1+2*s*s+o*o,f=s*s/l+(2*a*a*a/l/l/l-9*r*a/l/l)/27,c=(r-a*a/3/l)/l,h=2*Math.sqrt(-c/3),u=3*f/c/h,Math.abs(u)>1&&(u>=0?u=1:u=-1),p=Math.acos(u)/3,n.y>=0?t=(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:t=-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,Math.abs(i)<X?e=this.long0:e=J(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(i*i-s*s)+o*o))/2/i,this.over),n.x=e,n.y=t,n}var gI=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const yI={init:fI,forward:pI,inverse:mI,names:gI};function AI(n,e,t,i,s,o){const r=i-e,a=Math.atan((1-o)*Math.tan(n)),l=Math.atan((1-o)*Math.tan(t)),c=Math.sin(a),h=Math.cos(a),u=Math.sin(l),p=Math.cos(l);let f=r,m,y=100,g,A,v,C,w,S,x,I,B,R,b,T,L,O;do{if(g=Math.sin(f),A=Math.cos(f),v=Math.sqrt(p*g*(p*g)+(h*u-c*p*A)*(h*u-c*p*A)),v===0)return{azi1:0,s12:0};C=c*u+h*p*A,w=Math.atan2(v,C),S=h*p*g/v,x=1-S*S,I=x!==0?C-2*c*u/x:0,B=o/16*x*(4+o*(4-3*x)),m=f,f=r+(1-B)*o*S*(w+B*v*(I+B*C*(-1+2*I*I)))}while(Math.abs(f-m)>1e-12&&--y>0);return y===0?{azi1:NaN,s12:NaN}:(R=x*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),b=1+R/16384*(4096+R*(-768+R*(320-175*R))),T=R/1024*(256+R*(-128+R*(74-47*R))),L=T*v*(I+T/4*(C*(-1+2*I*I)-T/6*I*(-3+4*v*v)*(-3+4*I*I))),O=s*(1-o)*b*(w-L),{azi1:Math.atan2(p*g,h*u-c*p*A),s12:O})}function vI(n,e,t,i,s,o){const r=Math.atan((1-o)*Math.tan(n)),a=Math.sin(r),l=Math.cos(r),c=Math.sin(t),h=Math.cos(t),u=Math.atan2(a,l*h),p=l*c,f=1-p*p,m=f*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),y=1+m/16384*(4096+m*(-768+m*(320-175*m))),g=m/1024*(256+m*(-128+m*(74-47*m)));let A=i/(s*(1-o)*y),v,C=100,w,S,x,I;do w=Math.cos(2*u+A),S=Math.sin(A),x=Math.cos(A),I=g*S*(w+g/4*(x*(-1+2*w*w)-g/6*w*(-3+4*S*S)*(-3+4*w*w))),v=A,A=i/(s*(1-o)*y)+I;while(Math.abs(A-v)>1e-12&&--C>0);if(C===0)return{lat2:NaN,lon2:NaN};const B=a*S-l*x*h,R=Math.atan2(a*x+l*S*h,(1-o)*Math.sqrt(p*p+B*B)),b=Math.atan2(S*c,l*x-a*S*h),T=o/16*f*(4+o*(4-3*f)),L=b-(1-T)*o*p*(A+T*S*(w+T*x*(-1+2*w*w))),O=e+L;return{lat2:R,lon2:O}}function bI(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function CI(n){var e=n.x,t=n.y,i=Math.sin(n.y),s=Math.cos(n.y),o=J(e-this.long0,this.over),r,a,l,c,h,u,p,f,m,y,g;return this.sphere?Math.abs(this.sin_p12-1)<=X?(n.x=this.x0+this.a*($-t)*Math.sin(o),n.y=this.y0-this.a*($-t)*Math.cos(o),n):Math.abs(this.sin_p12+1)<=X?(n.x=this.x0+this.a*($+t)*Math.sin(o),n.y=this.y0+this.a*($+t)*Math.cos(o),n):(m=this.sin_p12*i+this.cos_p12*s*Math.cos(o),p=Math.acos(m),f=p?p/Math.sin(p):1,n.x=this.x0+this.a*f*s*Math.sin(o),n.y=this.y0+this.a*f*(this.cos_p12*i-this.sin_p12*s*Math.cos(o)),n):(r=Gs(this.es),a=Us(this.es),l=Vs(this.es),c=Qs(this.es),Math.abs(this.sin_p12-1)<=X?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),n.x=this.x0+(h-u)*Math.sin(o),n.y=this.y0-(h-u)*Math.cos(o),n):Math.abs(this.sin_p12+1)<=X?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),n.x=this.x0+(h+u)*Math.sin(o),n.y=this.y0+(h+u)*Math.cos(o),n):Math.abs(e)<X&&Math.abs(t-this.lat0)<X?(n.x=n.y=0,n):(y=AI(this.lat0,this.long0,t,e,this.a,this.f),g=y.azi1,n.x=y.s12*Math.sin(g),n.y=y.s12*Math.cos(g),n))}function wI(n){n.x-=this.x0,n.y-=this.y0;var e,t,i,s,o,r,a,l,c,h,u,p,f,m,y,g;return this.sphere?(e=Math.sqrt(n.x*n.x+n.y*n.y),e>2*$*this.a?void 0:(t=e/this.a,i=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=X?r=this.lat0:(r=kn(s*this.sin_p12+n.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-$,Math.abs(a)<=X?this.lat0>=0?o=J(this.long0+Math.atan2(n.x,-n.y),this.over):o=J(this.long0-Math.atan2(-n.x,n.y),this.over):o=J(this.long0+Math.atan2(n.x*i,e*this.cos_p12*s-n.y*this.sin_p12*i),this.over)),n.x=o,n.y=r,n)):(l=Gs(this.es),c=Us(this.es),h=Vs(this.es),u=Qs(this.es),Math.abs(this.sin_p12-1)<=X?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(n.x*n.x+n.y*n.y),f=p-e,r=pr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(n.x,-1*n.y),this.over),n.x=o,n.y=r,n):Math.abs(this.sin_p12+1)<=X?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(n.x*n.x+n.y*n.y),f=e-p,r=pr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(n.x,n.y),this.over),n.x=o,n.y=r,n):(m=Math.atan2(n.x,n.y),y=Math.sqrt(n.x*n.x+n.y*n.y),g=vI(this.lat0,this.long0,m,y,this.a,this.f),n.x=g.lon2,n.y=g.lat2,n))}var EI=["Azimuthal_Equidistant","aeqd"];const xI={init:bI,forward:CI,inverse:wI,names:EI};function II(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function SI(n){var e,t,i,s,o,r,a,l,c=n.x,h=n.y;return i=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(i),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=X)&&(a=this.a*o*t*Math.sin(i),l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),n.x=a,n.y=l,n}function MI(n){var e,t,i,s,o,r,a;return n.x-=this.x0,n.y-=this.y0,e=Math.sqrt(n.x*n.x+n.y*n.y),t=kn(e/this.a),i=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=X?(a=this.lat0,n.x=r,n.y=a,n):(a=kn(s*this.sin_p14+n.y*i*this.cos_p14/e),o=Math.abs(this.lat0)-$,Math.abs(o)<=X?(this.lat0>=0?r=J(this.long0+Math.atan2(n.x,-n.y),this.over):r=J(this.long0-Math.atan2(-n.x,n.y),this.over),n.x=r,n.y=a,n):(r=J(this.long0+Math.atan2(n.x*i,e*this.cos_p14*s-n.y*this.sin_p14*i),this.over),n.x=r,n.y=a,n))}var TI=["ortho"];const BI={init:II,forward:SI,inverse:MI,names:TI};var De={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},be={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function _I(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=$-ve/2?this.face=De.TOP:this.lat0<=-($-ve/2)?this.face=De.BOTTOM:Math.abs(this.long0)<=ve?this.face=De.FRONT:Math.abs(this.long0)<=$+ve?this.face=this.long0>0?De.RIGHT:De.LEFT:this.face=De.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function kI(n){var e={x:0,y:0},t,i,s,o,r,a,l={value:0};if(n.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(n.y)):t=n.y,i=n.x,this.face===De.TOP)o=$-t,i>=ve&&i<=$+ve?(l.value=be.AREA_0,s=i-$):i>$+ve||i<=-($+ve)?(l.value=be.AREA_1,s=i>0?i-Ge:i+Ge):i>-($+ve)&&i<=-ve?(l.value=be.AREA_2,s=i+$):(l.value=be.AREA_3,s=i);else if(this.face===De.BOTTOM)o=$+t,i>=ve&&i<=$+ve?(l.value=be.AREA_0,s=-i+$):i<ve&&i>=-ve?(l.value=be.AREA_1,s=-i):i<-ve&&i>=-($+ve)?(l.value=be.AREA_2,s=-i-$):(l.value=be.AREA_3,s=i>0?-i+Ge:-i-Ge);else{var c,h,u,p,f,m,y;this.face===De.RIGHT?i=Oi(i,+$):this.face===De.BACK?i=Oi(i,+Ge):this.face===De.LEFT&&(i=Oi(i,-$)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(i),y=Math.cos(i),c=f*y,h=f*m,u=p,this.face===De.FRONT?(o=Math.acos(c),s=gr(o,u,h,l)):this.face===De.RIGHT?(o=Math.acos(h),s=gr(o,u,-c,l)):this.face===De.BACK?(o=Math.acos(-c),s=gr(o,u,-h,l)):this.face===De.LEFT?(o=Math.acos(-h),s=gr(o,u,c,l)):(o=s=0,l.value=be.AREA_0)}return a=Math.atan(12/Ge*(s+Math.acos(Math.sin(s)*Math.cos(ve))-$)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===be.AREA_1?a+=$:l.value===be.AREA_2?a+=Ge:l.value===be.AREA_3&&(a+=1.5*Ge),e.x=r*Math.cos(a),e.y=r*Math.sin(a),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,n.x=e.x,n.y=e.y,n}function PI(n){var e={lam:0,phi:0},t,i,s,o,r,a,l,c,h,u={value:0};if(n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,i=Math.atan(Math.sqrt(n.x*n.x+n.y*n.y)),t=Math.atan2(n.y,n.x),n.x>=0&&n.x>=Math.abs(n.y)?u.value=be.AREA_0:n.y>=0&&n.y>=Math.abs(n.x)?(u.value=be.AREA_1,t-=$):n.x<0&&-n.x>=Math.abs(n.y)?(u.value=be.AREA_2,t=t<0?t+Ge:t-Ge):(u.value=be.AREA_3,t+=$),h=Ge/12*Math.tan(t),r=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(r),s=Math.cos(t),o=Math.tan(i),l=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===De.TOP)c=Math.acos(l),e.phi=$-c,u.value===be.AREA_0?e.lam=a+$:u.value===be.AREA_1?e.lam=a<0?a+Ge:a-Ge:u.value===be.AREA_2?e.lam=a-$:e.lam=a;else if(this.face===De.BOTTOM)c=Math.acos(l),e.phi=c-$,u.value===be.AREA_0?e.lam=-a+$:u.value===be.AREA_1?e.lam=-a:u.value===be.AREA_2?e.lam=-a-$:e.lam=a<0?-a-Ge:-a+Ge;else{var p,f,m;p=l,h=p*p,h>=1?m=0:m=Math.sqrt(1-h)*Math.sin(a),h+=m*m,h>=1?f=0:f=Math.sqrt(1-h),u.value===be.AREA_1?(h=f,f=-m,m=h):u.value===be.AREA_2?(f=-f,m=-m):u.value===be.AREA_3&&(h=f,f=m,m=-h),this.face===De.RIGHT?(h=p,p=-f,f=h):this.face===De.BACK?(p=-p,f=-f):this.face===De.LEFT&&(h=p,p=f,f=-h),e.phi=Math.acos(-m)-$,e.lam=Math.atan2(f,p),this.face===De.RIGHT?e.lam=Oi(e.lam,-$):this.face===De.BACK?e.lam=Oi(e.lam,-Ge):this.face===De.LEFT&&(e.lam=Oi(e.lam,+$))}if(this.es!==0){var y,g,A;y=e.phi<0?1:0,g=Math.tan(e.phi),A=this.b/Math.sqrt(g*g+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-A*A)/(this.one_minus_f*A)),y&&(e.phi=-e.phi)}return e.lam+=this.long0,n.x=e.lam,n.y=e.phi,n}function gr(n,e,t,i){var s;return n<X?(i.value=be.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ve?i.value=be.AREA_0:s>ve&&s<=$+ve?(i.value=be.AREA_1,s-=$):s>$+ve||s<=-($+ve)?(i.value=be.AREA_2,s=s>=0?s-Ge:s+Ge):(i.value=be.AREA_3,s+=$)),s}function Oi(n,e){var t=n+e;return t<-Ge?t+=Ds:t>+Ge&&(t-=Ds),t}var DI=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const NI={init:_I,forward:kI,inverse:PI,names:DI};var Ql=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],zs=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Uf=.8487,Vf=1.3523,Qf=bt/5,LI=1/Qf,Gi=18,yr=function(n,e){return n[0]+e*(n[1]+e*(n[2]+e*n[3]))},RI=function(n,e){return n[1]+e*(2*n[2]+e*3*n[3])};function FI(n,e,t,i){for(var s=e;i;--i){var o=n(s);if(s-=o,Math.abs(o)<t)break}return s}function OI(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function GI(n){var e=J(n.x-this.long0,this.over),t=Math.abs(n.y),i=Math.floor(t*Qf);i<0?i=0:i>=Gi&&(i=Gi-1),t=bt*(t-LI*i);var s={x:yr(Ql[i],t)*e,y:yr(zs[i],t)};return n.y<0&&(s.y=-s.y),s.x=s.x*this.a*Uf+this.x0,s.y=s.y*this.a*Vf+this.y0,s}function UI(n){var e={x:(n.x-this.x0)/(this.a*Uf),y:Math.abs(n.y-this.y0)/(this.a*Vf)};if(e.y>=1)e.x/=Ql[Gi][0],e.y=n.y<0?-$:$;else{var t=Math.floor(e.y*Gi);for(t<0?t=0:t>=Gi&&(t=Gi-1);;)if(zs[t][0]>e.y)--t;else if(zs[t+1][0]<=e.y)++t;else break;var i=zs[t],s=5*(e.y-i[0])/(zs[t+1][0]-i[0]);s=FI(function(o){return(yr(i,o)-e.y)/RI(i,o)},s,X,100),e.x/=yr(Ql[t],s),e.y=(5*t+s)*Oe,n.y<0&&(e.y=-e.y)}return e.x=J(e.x+this.long0,this.over),e}var VI=["Robinson","robin"];const QI={init:OI,forward:GI,inverse:UI,names:VI};function zI(){this.name="geocent"}function HI(n){var e=Af(n,this.es,this.a);return e}function YI(n){var e=vf(n,this.es,this.a,this.b);return e}var $I=["Geocentric","geocentric","geocent","Geocent"];const jI={init:zI,forward:HI,inverse:YI,names:$I};var dt={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},Hs={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function WI(){if(Object.keys(Hs).forEach((function(t){if(typeof this[t]>"u")this[t]=Hs[t].def;else{if(Hs[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Hs[t].num&&(this[t]=parseFloat(this[t]))}Hs[t].degrees&&(this[t]=this[t]*Oe)}).bind(this)),Math.abs(Math.abs(this.lat0)-$)<X?this.mode=this.lat0<0?dt.S_POLE:dt.N_POLE:Math.abs(this.lat0)<X?this.mode=dt.EQUIT:(this.mode=dt.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var n=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(n),this.sw=Math.sin(n)}function qI(n){n.x-=this.long0;var e=Math.sin(n.y),t=Math.cos(n.y),i=Math.cos(n.x),s,o;switch(this.mode){case dt.OBLIQ:o=this.sinph0*e+this.cosph0*t*i;break;case dt.EQUIT:o=t*i;break;case dt.S_POLE:o=-e;break;case dt.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(n.x),this.mode){case dt.OBLIQ:o*=this.cosph0*e-this.sinph0*t*i;break;case dt.EQUIT:o*=e;break;case dt.N_POLE:o*=-(t*i);break;case dt.S_POLE:o*=t*i;break}var r,a;return r=o*this.cg+s*this.sg,a=1/(r*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*a,o=r*a,n.x=s*this.a,n.y=o*this.a,n}function KI(n){n.x/=this.a,n.y/=this.a;var e={x:n.x,y:n.y},t,i,s;s=1/(this.pn1-n.y*this.sw),t=this.pn1*n.x*s,i=this.pn1*n.y*this.cw*s,n.x=t*this.cg+i*this.sg,n.y=i*this.cg-t*this.sg;var o=Et(n.x,n.y);if(Math.abs(o)<X)e.x=0,e.y=n.y;else{var r,a;switch(a=1-o*o*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/o+o/this.pn1),r=Math.sqrt(1-a*a),this.mode){case dt.OBLIQ:e.y=Math.asin(r*this.sinph0+n.y*a*this.cosph0/o),n.y=(r-this.sinph0*Math.sin(e.y))*o,n.x*=a*this.cosph0;break;case dt.EQUIT:e.y=Math.asin(n.y*a/o),n.y=r*o,n.x*=a;break;case dt.N_POLE:e.y=Math.asin(r),n.y=-n.y;break;case dt.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(n.x,n.y)}return n.x=e.x+this.long0,n.y=e.y,n}var XI=["Tilted_Perspective","tpers"];const JI={init:WI,forward:qI,inverse:KI,names:XI};function ZI(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var n=1-this.es,e=1/n;this.radius_p=Math.sqrt(n),this.radius_p2=n,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function eS(n){var e=n.x,t=n.y,i,s,o,r;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var a=this.radius_p/Et(this.radius_p*Math.cos(t),Math.sin(t));if(s=a*Math.cos(e)*Math.cos(t),o=a*Math.sin(e)*Math.cos(t),r=a*Math.sin(t),(this.radius_g-s)*s-o*o-r*r*this.radius_p_inv2<0)return n.x=Number.NaN,n.y=Number.NaN,n;i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(o/Et(r,i)),n.y=this.radius_g_1*Math.atan(r/i)):(n.x=this.radius_g_1*Math.atan(o/i),n.y=this.radius_g_1*Math.atan(r/Et(o,i)))}else this.shape==="sphere"&&(i=Math.cos(t),s=Math.cos(e)*i,o=Math.sin(e)*i,r=Math.sin(t),i=this.radius_g-s,this.flip_axis?(n.x=this.radius_g_1*Math.atan(o/Et(r,i)),n.y=this.radius_g_1*Math.atan(r/i)):(n.x=this.radius_g_1*Math.atan(o/i),n.y=this.radius_g_1*Math.atan(r/Et(o,i))));return n.x=n.x*this.a,n.y=n.y*this.a,n}function tS(n){var e=-1,t=0,i=0,s,o,r,a;if(n.x=n.x/this.a,n.y=n.y/this.a,this.shape==="ellipse"){this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Et(1,i)):(t=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Et(1,t));var l=i/this.radius_p;if(s=t*t+l*l+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return n.x=Number.NaN,n.y=Number.NaN,n;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,i*=a,n.x=Math.atan2(t,e),n.y=Math.atan(i*Math.cos(n.x)/e),n.y=Math.atan(this.radius_p_inv2*Math.tan(n.y))}else if(this.shape==="sphere"){if(this.flip_axis?(i=Math.tan(n.y/this.radius_g_1),t=Math.tan(n.x/this.radius_g_1)*Math.sqrt(1+i*i)):(t=Math.tan(n.x/this.radius_g_1),i=Math.tan(n.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+i*i+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return n.x=Number.NaN,n.y=Number.NaN,n;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,i*=a,n.x=Math.atan2(t,e),n.y=Math.atan(i*Math.cos(n.x)/e)}return n.x=n.x+this.long0,n}var nS=["Geostationary Satellite View","Geostationary_Satellite","geos"];const iS={init:ZI,forward:eS,inverse:tS,names:nS};var Ys=1.340264,$s=-.081106,js=893e-6,Ws=.003796,Ar=Math.sqrt(3)/2;function sS(){this.es=0,this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0}function oS(n){var e=J(n.x-this.long0,this.over),t=n.y,i=Math.asin(Ar*Math.sin(t)),s=i*i,o=s*s*s;return n.x=e*Math.cos(i)/(Ar*(Ys+3*$s*s+o*(7*js+9*Ws*s))),n.y=i*(Ys+$s*s+o*(js+Ws*s)),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n}function rS(n){n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a;var e=1e-9,t=12,i=n.y,s,o,r,a,l,c;for(c=0;c<t&&(s=i*i,o=s*s*s,r=i*(Ys+$s*s+o*(js+Ws*s))-n.y,a=Ys+3*$s*s+o*(7*js+9*Ws*s),i-=l=r/a,!(Math.abs(l)<e));++c);return s=i*i,o=s*s*s,n.x=Ar*n.x*(Ys+3*$s*s+o*(7*js+9*Ws*s))/Math.cos(i),n.y=Math.asin(Math.sin(i)/Ar),n.x=J(n.x+this.long0,this.over),n}var aS=["eqearth","Equal Earth","Equal_Earth"];const lS={init:sS,forward:oS,inverse:rS,names:aS};var qs=1e-10;function cS(){var n;if(this.phi1=this.lat1,Math.abs(this.phi1)<qs)throw new Error;this.es?(this.en=Pl(this.es),this.m1=Ri(this.phi1,this.am1=Math.sin(this.phi1),n=Math.cos(this.phi1),this.en),this.am1=n/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=hS,this.forward=dS):(Math.abs(this.phi1)+qs>=$?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=fS,this.forward=uS)}function dS(n){var e=J(n.x-(this.long0||0),this.over),t=n.y,i,s,o;return i=this.am1+this.m1-Ri(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(i*Math.sqrt(1-this.es*s*s)),n.x=i*Math.sin(s),n.y=this.am1-i*Math.cos(s),n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function hS(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,i,s;if(t=Et(n.x,n.y=this.am1-n.y),s=Dl(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<$)e=Math.sin(s),i=t*Math.atan2(n.x,n.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-$)<=qs)i=0;else throw new Error;return n.x=J(i+(this.long0||0),this.over),n.y=Bn(s),n}function uS(n){var e=J(n.x-(this.long0||0),this.over),t=n.y,i,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>qs?(n.x=s*Math.sin(i=e*Math.cos(t)/s),n.y=this.cphi1-s*Math.cos(i)):n.x=n.y=0,n.x=this.a*n.x+(this.x0||0),n.y=this.a*n.y+(this.y0||0),n}function fS(n){n.x=(n.x-(this.x0||0))/this.a,n.y=(n.y-(this.y0||0))/this.a;var e,t,i=Et(n.x,n.y=this.cphi1-n.y);if(t=this.cphi1+this.phi1-i,Math.abs(t)>$)throw new Error;return Math.abs(Math.abs(t)-$)<=qs?e=0:e=i*Math.atan2(n.x,n.y)/Math.cos(t),n.x=J(e+(this.long0||0),this.over),n.y=Bn(t),n}var pS=["bonne","Bonne (Werner lat_1=90)"];const mS={init:cS,names:pS},zf={OBLIQUE:{forward:bS,inverse:wS},TRANSVERSE:{forward:CS,inverse:ES}},vr={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function gS(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=ff.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const n=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Pt(n);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const i=Object.keys(vr),s=a=>{if(typeof this[a]>"u")return;const l=parseFloat(this[a])*Oe;if(isNaN(l))throw new Error("Invalid value for "+a+": "+this[a]);return l};for(let a=0;a<i.length;a++){const l=i[a],c=vr[l],h=Object.entries(c);if(h.some(([p])=>typeof this[p]<"u")){t=c;for(let p=0;p<h.length;p++){const[f,m]=h[p],y=s(f);if(typeof y>"u")throw new Error("Missing parameter: "+f+".");this[m]=y}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:r}=vS(this,t);this.lamp=o,Math.abs(r)>X?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=zf.OBLIQUE):this.projectionType=zf.TRANSVERSE}function yS(n){return this.projectionType.forward(this,n)}function AS(n){return this.projectionType.inverse(this,n)}function vS(n,e){let t,i;if(e===vr.ROTATE){let s=n.oLongC,o=n.oLatC,r=n.oAlpha;if(Math.abs(Math.abs(o)-$)<=X)throw new Error("Invalid value for o_lat_c: "+n.o_lat_c+" should be < 90°");i=s+Math.atan2(-1*Math.cos(r),-1*Math.sin(r)*Math.sin(o)),t=Math.asin(Math.cos(o)*Math.sin(r))}else if(e===vr.NEW_POLE)i=n.oLongP,t=n.oLatP;else{let s=n.oLong1,o=n.oLat1,r=n.oLong2,a=n.oLat2,l=Math.abs(o);if(Math.abs(o)>$-X)throw new Error("Invalid value for o_lat_1: "+n.o_lat_1+" should be < 90°");if(Math.abs(a)>$-X)throw new Error("Invalid value for o_lat_2: "+n.o_lat_2+" should be < 90°");if(Math.abs(o-a)<X)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(l<X)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");i=Math.atan2(Math.cos(o)*Math.sin(a)*Math.cos(s)-Math.sin(o)*Math.cos(a)*Math.cos(r),Math.sin(o)*Math.cos(a)*Math.sin(r)-Math.cos(o)*Math.sin(a)*Math.sin(s)),t=Math.atan(-1*Math.cos(i-s)/Math.tan(o))}return{lamp:i,phip:t}}function bS(n,e){let{x:t,y:i}=e;t+=n.long0;const s=Math.cos(t),o=Math.sin(i),r=Math.cos(i);e.x=J(Math.atan2(r*Math.sin(t),n.sphip*r*s+n.cphip*o)+n.lamp),e.y=Math.asin(n.sphip*o-n.cphip*r*s);const a=n.obliqueProjection.forward(e);return n.isIdentity&&(a.x*=bt,a.y*=bt),a}function CS(n,e){let{x:t,y:i}=e;t+=n.long0;const s=Math.cos(i),o=Math.cos(t);e.x=J(Math.atan2(s*Math.sin(t),Math.sin(i))+n.lamp),e.y=Math.asin(-1*s*o);const r=n.obliqueProjection.forward(e);return n.isIdentity&&(r.x*=bt,r.y*=bt),r}function wS(n,e){n.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=n.obliqueProjection.inverse(e);let{x:i,y:s}=t;if(i<Number.MAX_VALUE){i-=n.lamp;const o=Math.cos(i),r=Math.sin(s),a=Math.cos(s);e.x=Math.atan2(a*Math.sin(i),n.sphip*a*o-n.cphip*r),e.y=Math.asin(n.sphip*r+n.cphip*a*o)}return e.x=J(e.x+n.long0),e}function ES(n,e){n.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=n.obliqueProjection.inverse(e);let{x:i,y:s}=t;if(i<Number.MAX_VALUE){const o=Math.cos(s);i-=n.lamp,e.x=Math.atan2(o*Math.sin(i),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(i))}return e.x=J(e.x+n.long0),e}var xS=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const IS={init:gS,forward:yS,inverse:AS,names:xS};function SS(n){n.Proj.projections.add(ur),n.Proj.projections.add(fr),n.Proj.projections.add(px),n.Proj.projections.add(Ex),n.Proj.projections.add(Tx),n.Proj.projections.add(Dx),n.Proj.projections.add(Gx),n.Proj.projections.add(Hx),n.Proj.projections.add(qx),n.Proj.projections.add(e2),n.Proj.projections.add(f2),n.Proj.projections.add(v2),n.Proj.projections.add(x2),n.Proj.projections.add(_2),n.Proj.projections.add(L2),n.Proj.projections.add(U2),n.Proj.projections.add(Y2),n.Proj.projections.add(K2),n.Proj.projections.add(nI),n.Proj.projections.add(aI),n.Proj.projections.add(uI),n.Proj.projections.add(yI),n.Proj.projections.add(xI),n.Proj.projections.add(BI),n.Proj.projections.add(NI),n.Proj.projections.add(QI),n.Proj.projections.add(jI),n.Proj.projections.add(JI),n.Proj.projections.add(iS),n.Proj.projections.add(lS),n.Proj.projections.add(mS),n.Proj.projections.add(IS)}const Ks=Object.assign(kE,{defaultDatum:"WGS84",Proj:Pt,WGS84:new Pt("WGS84"),Point:Li,toPoint:Ef,defs:it,nadgrid:fE,transform:dr,mgrs:PE,version:"__VERSION__"});SS(Ks);class MS{cesium;viewer;watermarkEnabled=!0;mapLayers={};modelId="default";options={flyTo:!0};gisCadModelsList=[];open=!1;events=new _s;heightLodThresholds={full:2e3,medium:8e3,far:3e4};heightLodEnabled=!1;heightLodHandler=null;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.gisCadModelsList}async addVectorTileByUrlTemplate(e){let t=window?.VectorTileLayer||window?.CesiumVectorTileGL?.VectorTileLayer||this.cesium?.VectorTileLayer;if(!t)try{const s=await Promise.resolve().then(()=>Vd),o=s?.VectorTileLayer||s?.CesiumVectorTileGL?.VectorTileLayer||s?.default?.VectorTileLayer||s?.default;if(o)window.VectorTileLayer=o,s?.CesiumVectorTileGL&&(window.CesiumVectorTileGL=s.CesiumVectorTileGL),t=o;else{const r=s?.VectorTileset||s?.CesiumVectorTileGL?.VectorTileset||s?.default?.VectorTileset;r&&(window.VectorTileset=r)}}catch{}if(t){const s=new t(this.viewer,{urlTemplate:e.urlTemplate,minZoom:e.minZoom??0,maxZoom:e.maxZoom??24,style:e.style||{},terrain:!0,tms:e.tms??e.scheme==="tms"});try{const o=s;o?.readyEvent?.addEventListener&&o.readyEvent.addEventListener(()=>{try{console.log("VectorTileLayer ready")}catch{}}),o?.errorEvent?.addEventListener&&o.errorEvent.addEventListener(r=>{console.error("VectorTileLayer error:",r)})}catch{}return s}const i=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(i){const s=[],o=Array.isArray(e.sourceLayer)?e.sourceLayer:e.sourceLayer?[e.sourceLayer]:["layer","lines","line","roads","road","default","vt","g"],r=c=>[{id:`vt-fill-${c}`,type:"fill",source:"vt","source-layer":c,paint:{"fill-color":e.style?.polygon?.fill??"#00ffff66","fill-opacity":e.style?.polygon?.opacity??.4}},{id:`vt-line-${c}`,type:"line",source:"vt","source-layer":c,paint:{"line-color":e.style?.line?.color??"#ff0000","line-width":e.style?.line?.width??3}}];o.forEach(c=>s.push(...r(c)));const a={version:8,sources:{vt:{type:"vector",tiles:[e.urlTemplate],minzoom:e.minZoom??0,maxzoom:e.maxZoom??24,scheme:e.scheme??(e.tms?"tms":"xyz")}},layers:s},l=new i({style:a,terrain:e.terrain??e.clampToGround??!0});return this.viewer.scene.primitives.add(l),l?.readyEvent?.addEventListener&&l.readyEvent.addEventListener(()=>{try{console.log("VectorTileset ready:",{sources:Object.keys(l?.sources||{}),layers:a?.layers?.map(c=>c?.["source-layer"]).filter((c,h,u)=>c&&u.indexOf(c)===h)})}catch{}}),l?.errorEvent?.addEventListener&&l.errorEvent.addEventListener(c=>{console.error("VectorTileset error:",c)}),l}return console.error("Vector tile renderer not found. Please include cesium-vectortile-gl (or compatible) and ensure VectorTileLayer/VectorTileset is available globally."),null}async addGeoJsonLayer(e){let t=window?.VectorTileLayer||window?.CesiumVectorTileGL?.VectorTileLayer||this.cesium?.VectorTileLayer;if(!t)try{const l=await Promise.resolve().then(()=>Vd),c=l?.VectorTileLayer||l?.CesiumVectorTileGL?.VectorTileLayer||l?.default?.VectorTileLayer||l?.default;c&&(window.VectorTileLayer=c,l?.CesiumVectorTileGL&&(window.CesiumVectorTileGL=l.CesiumVectorTileGL),t=c)}catch{}if(!(window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset))try{const l=await Promise.resolve().then(()=>Vd),c=l?.VectorTileset||l?.CesiumVectorTileGL?.VectorTileset||l?.default?.VectorTileset;c&&(window.VectorTileset=c)}catch{}const s={type:"geojson"};if(e.dataUrl)s.data=e.dataUrl;else if(e.data)s.data=e.data;else return null;if(e.minZoom!==void 0&&(s.minzoom=e.minZoom),e.maxZoom!==void 0&&(s.maxzoom=e.maxZoom),e.vtOptions&&typeof e.vtOptions=="object"){const l=e.vtOptions;l.maxZoom!==void 0&&(s.maxzoom=l.maxZoom),l.indexMaxZoom!==void 0&&(s.indexMaxZoom=l.indexMaxZoom),l.indexMaxPoints!==void 0&&(s.indexMaxPoints=l.indexMaxPoints),l.tolerance!==void 0&&(s.tolerance=l.tolerance),l.extent!==void 0&&(s.extent=l.extent),l.buffer!==void 0&&(s.buffer=l.buffer),l.lineMetrics!==void 0&&(s.lineMetrics=l.lineMetrics),l.promoteId!==void 0&&(s.promoteId=l.promoteId),l.generateId!==void 0&&(s.generateId=l.generateId)}const o={version:8,sources:{g:s},layers:[{id:"g-fill",type:"fill",source:"g",paint:{"fill-color":e.style?.polygon?.fill??"#00ffff66","fill-opacity":e.style?.polygon?.opacity??.4}},{id:"g-line",type:"line",source:"g",paint:{"line-color":e.style?.line?.color??"#ff0000","line-width":e.style?.line?.width??1.5}},{id:"g-point",type:"symbol",source:"g",layout:{"icon-image":void 0,"text-field":""},paint:{}}]};if(t){const l=new t(this.viewer,{style:o,terrain:e.terrain??e.clampToGround??!0});try{const c=l;c?.readyEvent?.addEventListener&&c.readyEvent.addEventListener(()=>{try{console.log("VectorTileLayer ready (geojson)")}catch{}}),c?.errorEvent?.addEventListener&&c.errorEvent.addEventListener(h=>{console.error("VectorTileLayer error (geojson):",h)})}catch{}try{const h=await(async()=>{if(e.data&&e.data.type==="FeatureCollection")return e.data;if(e.dataUrl){const u=await fetch(e.dataUrl,{cache:"no-store"});if(u.ok){const p=await u.json();if(p&&p.type==="FeatureCollection")return p}}return null})();if(h&&Array.isArray(h.features)&&h.features.length){let u=180,p=90,f=-180,m=-90;const y=(A,v)=>{!Number.isFinite(A)||!Number.isFinite(v)||(A<u&&(u=A),A>f&&(f=A),v<p&&(p=v),v>m&&(m=v))},g=A=>{if(Array.isArray(A)&&typeof A[0]=="number")y(Number(A[0]),Number(A[1]));else if(Array.isArray(A))for(const v of A)g(v)};for(const A of h.features){const v=A?.geometry;v?.coordinates&&g(v.coordinates)}if(u<=f&&p<=m){const A=this.cesium.Rectangle.fromDegrees(u,p,f,m);this.viewer.camera.flyTo({destination:A,duration:.6})}}}catch{}return l}const r=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(!r)return null;const a=new r({style:o,terrain:e.terrain??e.clampToGround??!0});this.viewer.scene.primitives.add(a);try{const c=await(async()=>{if(e.data&&e.data.type==="FeatureCollection")return e.data;if(e.dataUrl){const h=await fetch(e.dataUrl,{cache:"no-store"});if(h.ok){const u=await h.json();if(u&&u.type==="FeatureCollection")return u}}return null})();if(c&&Array.isArray(c.features)&&c.features.length){let h=180,u=90,p=-180,f=-90;const m=(g,A)=>{!Number.isFinite(g)||!Number.isFinite(A)||(g<h&&(h=g),g>p&&(p=g),A<u&&(u=A),A>f&&(f=A))},y=g=>{if(Array.isArray(g)&&typeof g[0]=="number")m(Number(g[0]),Number(g[1]));else if(Array.isArray(g))for(const A of g)y(A)};for(const g of c.features){const A=g?.geometry;A?.coordinates&&y(A.coordinates)}if(h<=p&&u<=f){const g=this.cesium.Rectangle.fromDegrees(h,u,p,f);this.viewer.camera.flyTo({destination:g,duration:.6})}}}catch{}return a}async addVectorTileByTilesManifest(e){try{const t=await fetch(e.manifestUrl,{cache:"no-store"});if(!t.ok)return null;const i=await t.json();let s=null;const o=Array.isArray(i?.items)?i.items[0]:null;if(o?.url&&typeof o.url=="string"&&(s=String(o.url).replace(/\\/g,"/").replace(/\/\d+\/\d+\/\d+\.pbf$/i,"")),!s){const h=new URL(e.manifestUrl,window.location.href).href.replace(/\\/g,"/");s=h.slice(0,h.lastIndexOf("/"))}let r=e.minZoom,a=e.maxZoom;if((r===void 0||a===void 0)&&Array.isArray(i?.items)&&i.items.length){const c=i.items.map(h=>Number(h?.z)).filter(h=>Number.isFinite(h));c.length&&(r===void 0&&(r=Math.min(...c)),a===void 0&&(a=Math.max(...c)))}try{const c=Array.isArray(i?.items)?i.items:[],h=r??c[0]?.z??0,u=c.filter(p=>Number(p?.z)===h);if(u.length){let p=1/0,f=-1/0,m=1/0,y=-1/0;for(const g of u){const A=Number(g.x),v=Number(g.y);!Number.isFinite(A)||!Number.isFinite(v)||(A<p&&(p=A),A>f&&(f=A),v<m&&(m=v),v>y&&(y=v))}if(Number.isFinite(p)&&Number.isFinite(f)&&Number.isFinite(m)&&Number.isFinite(y)){const g=Math.pow(2,h),A=B=>B/g*360-180,v=B=>{const R=Math.PI-2*Math.PI*B/g;return 180/Math.PI*Math.atan(Math.sinh(R))},C=A(p),w=A(f+1),S=v(m),x=v(y+1),I=this.cesium.Rectangle.fromDegrees(C,x,w,S);this.viewer.camera.flyTo({destination:I,duration:.6})}}}catch{}const l=`${s}/{z}/{x}/{y}.pbf`;return this.addVectorTileByUrlTemplate({modelId:e.modelId,urlTemplate:l,sourceLayer:e.sourceLayer,minZoom:r,maxZoom:a,style:e.style})}catch{return null}}enableHeightLod(e=!0){this.heightLodEnabled=e,e&&!this.heightLodHandler?(this.heightLodHandler=this.viewer.camera.changed.addEventListener(()=>{this.applyHeightLod()}),this.viewer.camera.percentageChanged=.05,this.applyHeightLod()):!e&&this.heightLodHandler&&(this.heightLodHandler(),this.heightLodHandler=null,this.gisCadModelsList.forEach(t=>{const i=this.mapLayers[t.modelId];i&&Object.values(i).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t.show!==!1)})})}),this.viewer.scene.requestRender())}applyHeightLod(){if(!this.heightLodEnabled)return;const e=this.viewer.camera.positionCartographic?.height??0,{full:t,medium:i,far:s}=this.heightLodThresholds;this.gisCadModelsList.forEach(o=>{const r=this.mapLayers[o.modelId];!r||o.show===!1||Object.values(r).forEach(a=>{a.forEach(l=>{if(!l.primitive)return;let c=!0;e>s?c=l.type==="polygon":e>i?c=l.type!=="point":e>t&&(c=!0),l.primitive.show=c})})}),this.viewer.scene.requestRender()}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.gisCadModelsList.find(i=>i.modelId===t):this.gisCadModelsList}getDefaultCoordinateTransformConfig(){return{centralMeridian:118.5,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"}}buildLongLatProj4Def(e){return`+proj=longlat +ellps=${e?.ellipsoid||this.getDefaultCoordinateTransformConfig().ellipsoid} +no_defs`}buildProjectedProj4Def(e){const t={...this.getDefaultCoordinateTransformConfig(),...e};return["+proj=tmerc",`+lat_0=${t.latOrigin}`,`+lon_0=${t.centralMeridian}`,`+k=${t.scaleFactor}`,`+x_0=${t.falseEasting}`,`+y_0=${t.falseNorthing}`,`+ellps=${t.ellipsoid||"GRS80"}`,"+units=m","+no_defs"].join(" ")}transformCoordinate(e){const t={...this.getDefaultCoordinateTransformConfig(),...e.config},i=this.buildLongLatProj4Def(t),s=this.buildProjectedProj4Def(t);if(e.direction==="lonlatToProjected"){const c=Number(e.longitude),h=Number(e.latitude);if([c,h].some(f=>Number.isNaN(f)))throw new Error("经纬度参数无效");const[u,p]=Ks(i,s,[c,h]);return{direction:e.direction,x:u,y:p,config:t}}const o=Number(e.x),r=Number(e.y);if([o,r].some(c=>Number.isNaN(c)))throw new Error("投影坐标参数无效");const[a,l]=Ks(s,i,[o,r]);return{direction:e.direction,longitude:a,latitude:l,config:t}}showJson({modelId:e,show:t}){const i=this.getRuntimeModel(e);i?.root&&(i.show=t,i.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})})}showJsonByLayer({modelId:e,show:t,layers:i}){const s=this.mapLayers[e];!s||!Array.isArray(i)||i.forEach(o=>{const r=s[o];r&&r.forEach(a=>{a.primitive&&(a.primitive.show=t)})})}flyToCadModel(e={}){const t=e.modelId||this.modelId,i=this.gisCadModelsList.find(s=>s.modelId===t);i&&this.flyToBounds(i,{duration:e.duration})}flyToBounds(e,t){if(!e)return;const i=t?.duration??0,s=this.computeRealRectangleDegrees(e);if(s){const o=this.cesium.Rectangle.fromDegrees(s.west,s.south,s.east,s.north);this.viewer.camera.flyTo({destination:o,duration:i});return}e.root&&this.viewer.flyTo(e.root,{duration:i})}computeRealRectangleDegrees(e){const t=e?.formData||{},i=e?.bounds,s=i?.min,o=i?.max;if(t.transformConfig&&t.transformDirection==="projectedToLonlat"&&s&&o&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(o.x)&&Number.isFinite(o.y))try{const r=this.buildLongLatProj4Def(t.transformConfig),a=this.buildProjectedProj4Def(t.transformConfig),l=Ks(a,r),[c,h]=l.forward([s.x,s.y]),[u,p]=l.forward([o.x,o.y]);return{west:Math.min(c,u),south:Math.min(h,p),east:Math.max(c,u),north:Math.max(h,p)}}catch(r){console.warn("Failed to compute projected rectangle",r)}if(t.longitude!==void 0&&t.latitude!==void 0){const r=Number(t.longitude),a=Number(t.latitude),l=Math.max(1e-6,Number(t.scale??1)),c=Math.max(.001,l*.001);return{west:r-c,south:a-c,east:r+c,north:a+c}}return null}parseColor(e,t=1){const i=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return i;const s=e.trim(),o=[s];if(s.startsWith("#")){const r=s.slice(1).replace(/[^0-9a-fA-F]/g,"");[3,4,6,8].includes(r.length)&&o.push(`#${r}`)}for(const r of Array.from(new Set(o)))try{const a=this.cesium.Color.fromCssColorString(r);if(a)return a.withAlpha(t)}catch(a){console.warn("Failed to parse CAD color candidate:",r,a)}return console.warn("Failed to parse CAD color, fallback to white:",e),i}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1:Math.max(1,Math.min(4,Math.round(e*4)))}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),i=Number(e[1]),s=Number(e[2]||0);return[t,i,s].some(o=>Number.isNaN(o))?null:[t,i,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([i,s])=>{e[i]||(e[i]=[]),e[i].push(...s)})}buildDefaultFormData(e,t){return{modelId:e.modelId,longitude:t.originLongitude,latitude:t.originLatitude,height:t.originHeight,scaleToMeter:t.scaleToMeter,scale:t.scale,localOriginX:t.localOriginX,localOriginY:t.localOriginY,totalRotation:e.totalRotation||0,distance:1e-6,heightDistance:1,rotation:1,scaleStep:.1,clampToGround:!1}}normalizeFormData(e,t,i=!1){const s=e.formData||{},o=this.buildDefaultFormData(e,t);return{...o,...s,modelId:e.modelId,longitude:Number(s.longitude??o.longitude),latitude:Number(s.latitude??o.latitude),height:Number(s.height??o.height),scaleToMeter:Number(s.scaleToMeter??o.scaleToMeter),scale:Math.max(1e-6,Number(s.scale??o.scale)),localOriginX:Number(s.localOriginX??o.localOriginX),localOriginY:Number(s.localOriginY??o.localOriginY),totalRotation:Number(s.totalRotation??o.totalRotation),distance:Number(s.distance??o.distance),heightDistance:Number(s.heightDistance??o.heightDistance),rotation:Number(s.rotation??o.rotation),scaleStep:Number(s.scaleStep??o.scaleStep),transformConfig:s.transformConfig,transformDirection:s.transformDirection,clampToGround:s.clampToGround??i}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const i=this.cesium,s=t.formData||{};let o=s.longitude??t.deltaLongitude??e.longitude??e.result?.origin?.longitude??0,r=s.latitude??t.deltaLatitude??e.latitude??e.result?.origin?.latitude??0,a=s.height??0;const l=e.result?.extMin?.x??0,c=e.result?.extMin?.y??0,h=e.result?.realUnits??e.unit??1,u=Math.max(1e-6,Number(s.scale??1)),p=h*u;let f=null,m=null,y=null;if(s.transformConfig&&s.transformDirection==="projectedToLonlat"){const w=this.buildLongLatProj4Def(s.transformConfig),S=this.buildProjectedProj4Def(s.transformConfig);f=Ks(S,w);try{const[x,I]=f.forward([l*h,c*h]);o=x,r=I,a=0,m=i.Cartesian3.fromDegrees(x,I,0);const B=i.Transforms.eastNorthUpToFixedFrame(m);y=i.Matrix4.inverseTransformation(B,new i.Matrix4)}catch(x){console.warn("Failed to calculate projection base",x),f=null}}const g=i.Cartesian3.fromDegrees(o,r,a),A=i.Transforms.eastNorthUpToFixedFrame(g),v=s.totalRotation??t.totalRotation??0;if(v){const w=i.Quaternion.fromAxisAngle(i.Cartesian3.UNIT_Z,i.Math.toRadians(v)),S=i.Matrix4.fromRotationTranslation(i.Matrix3.fromQuaternion(w),new i.Cartesian3(0,0,0));i.Matrix4.multiply(A,S,A)}return{originLongitude:o,originLatitude:r,originHeight:a,localOriginX:l,localOriginY:c,scaleToMeter:h,scale:u,totalScaleToMeter:p,toWorld:w=>{const S=this.normalizePoint(w);if(!S)return null;if(f&&m&&y)try{const I=S[0]*h,B=S[1]*h,[R,b]=f.forward([I,B]),T=i.Cartesian3.fromDegrees(R,b,S[2]*h),L=i.Matrix4.multiplyByPoint(y,T,new i.Cartesian3);return L.x*=u,L.y*=u,L.z*=u,i.Matrix4.multiplyByPoint(A,L,new i.Cartesian3)}catch{}const x=new i.Cartesian3((S[0]-l)*p,(S[1]-c)*p,S[2]*p);return i.Matrix4.multiplyByPoint(A,x,new i.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):null}createPolygonPrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPrimitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):null}createPointPrimitive(e){if(!e.length)return null;const t=new this.cesium.PointPrimitiveCollection;return e.forEach(i=>{t.add(i)}),t}buildModelPrimitives(e,t,i){const s=this.cesium,o=new s.PrimitiveCollection,r={},a={},l=this.buildTransform(t,e),c=new Map,h=new Map,u=new Map,p=Array.isArray(t.result?.lines)?t.result?.lines||[]:[],f=Array.isArray(t.result?.polygons)?t.result?.polygons||[]:[],m=Array.isArray(t.result?.points)?t.result?.points||[]:[];p.forEach(g=>{const v=(Array.isArray(g?.positions)?g.positions:[]).map(I=>l.toWorld(I)).filter(Boolean);if(v.length<2)return;const C=g.layer||"default",w=g.color||"#ffffff",S=this.uniqueKey([C,"line",this.getLineWidth(g.lineWeight)]),x=c.get(S)||[];x.push(new s.GeometryInstance({geometry:i.clampToGround?new s.GroundPolylineGeometry({positions:v,width:this.getLineWidth(g.lineWeight)}):new s.PolylineGeometry({positions:v,width:this.getLineWidth(g.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(w,1))},id:{modelId:e.modelId,layer:C,batchId:g.batchId,type:"line"}})),c.set(S,x)}),f.forEach(g=>{const v=(Array.isArray(g?.outerPositions)?g.outerPositions:[]).map(B=>l.toWorld(B)).filter(Boolean);if(v.length<3)return;const C=Array.isArray(g?.holes)?g.holes.map(B=>{const R=Array.isArray(B)?B.map(b=>l.toWorld(b)).filter(Boolean):[];return R.length<3?null:new s.PolygonHierarchy(R)}).filter(Boolean):[],w=g.layer||"default",S=g.color||"#ffffff",x=this.uniqueKey([w,"polygon"]),I=h.get(x)||[];I.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(v,C),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(S,.45))},id:{modelId:e.modelId,layer:w,batchId:g.batchId,type:"polygon"}})),h.set(x,I)}),m.forEach(g=>{const A=g?.position||g?.positions?.[0]||g,v=l.toWorld(A);if(!v)return;const C=g.layer||"default",w=g.color||"#ffffff",S=this.uniqueKey([C,"point"]),x=u.get(S)||[];x.push({position:v,color:this.parseColor(w,1),pixelSize:Math.max(4,Number(g.pixelSize||6)),id:{modelId:e.modelId,layer:C,batchId:g.batchId,type:"point"}}),u.set(S,x)});const y=(g,A,v)=>{A&&(o.add(A),i.recordLayers!==!1&&(a[g]||(a[g]=[]),a[g].push({primitive:A,color:v.color,batchId:v.batchId,type:v.type})),r[g]||(r[g]={}),r[g][v.type]=A)};return c.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createLinePrimitive(g,i),{color:void 0,batchId:g[0]?.id?.batchId,type:"line"})}),h.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createPolygonPrimitive(g,i),{color:void 0,batchId:g[0]?.id?.batchId,type:"polygon"})}),u.forEach((g,A)=>{const[v="default"]=A.split("::");y(v,this.createPointPrimitive(g),{color:void 0,batchId:g[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:a,transform:l}}buildModelRoot(e,t,i){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(a=>{const l=this.buildModelPrimitives(e,a,i);r||(r=l),s.add(l.root),this.mergeLayerItemsMap(o,l.layerItemsMap)}),{root:s,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(i=>i.modelId===t)||null}rebuildPreviewRoot(e){if(!e.editingFormData)return;e.previewRoot&&(this.removeModelNode(e.root,e.previewRoot),e.previewRoot=null);const t=this.buildModelRoot({...e,formData:e.editingFormData},e.sourceDataList,{clampToGround:e.editingFormData.clampToGround??!1,recordLayers:!1});e.previewRoot=t.root,e.root.add(e.previewRoot),e.groundRoot&&(e.groundRoot.show=!1)}replaceGroundRoot(e,t){t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround);const i=this.buildModelRoot({...e,formData:t},e.sourceDataList,e.buildOptions);e.groundRoot&&this.removeModelNode(e.root,e.groundRoot),e.groundRoot=i.root,e.root.add(e.groundRoot),e.groundRoot.show=e.show!==!1,e.transform=i.transform,this.mapLayers[e.modelId]=i.layerItemsMap}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const i=await t.blob(),s=new ml(new tr(i),{password:Hu,useWebWorkers:!1}),r=(await s.getEntries()).find(c=>!c.directory&&c.filename.endsWith(".json"));if(!r)return await s.close(),!1;const a=await r.arrayBuffer({useWebWorkers:!1});await s.close();const l=new TextDecoder().decode(a);return JSON.parse(l.trim())}catch(t){return console.error("Failed to load GIS CAD source:",e,t),!1}}getCandidateUrls(e){const t=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,i=[e.sourceUrl,`${t}${e.dbName}/cad.zip`].filter(Boolean);return Array.from(new Set(i))}getChunkCandidateUrls(e,t,i){const o=[`${e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`}${e.dbName}/cad_${i}.zip`];try{const r=new URL(t),a=r.pathname,l=a.lastIndexOf("/"),c=l>=0?a.slice(0,l+1):"/",h=a.lastIndexOf("."),u=h>=0?a.slice(h):".zip",p=l>=0?a.slice(l+1,h>=0?h:void 0):a.slice(0,h>=0?h:void 0),f=p===e.dbName?e.dbName:p;o.unshift(`${r.origin}${c}${f}_${i}${u}`,`${r.origin}${c}${f}${i}${u}`)}catch(r){console.warn("Failed to resolve chunk urls from primary source:",t,r)}return Array.from(new Set(o))}async loadSourceData(e){const t=this.getCandidateUrls(e);for(const i of t){const s=await this.loadModelFile(i);if(s)return{url:i,data:s}}return{url:t[0]||"",data:!1}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const i={...this.options,...t},s={clampToGround:i.clampToGround??i.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(f=>f.modelId===o.modelId))continue;/^(https?|atom):\/\//i.test(o.outPutPath)||(o.outPutPath=`${window.location.origin}${o.outPutPath}`);const l=`${o.outPutPath.endsWith("/")?o.outPutPath:`${o.outPutPath}/`}${o.dbName}/region.zip`,c=await this.loadModelFile(l);c&&typeof c=="object"&&(["longitude","latitude","scale","totalRotation","height"].some(y=>c[y]!==void 0)&&(o.formData={...o.formData||{},longitude:c.longitude,latitude:c.latitude,scale:c.scale,totalRotation:c.totalRotation,height:c.height}),c.centralMeridian!==void 0&&(o.formData={...o.formData||{},transformConfig:{centralMeridian:c.centralMeridian,latOrigin:c.latOrigin??0,scaleFactor:c.scaleFactor??1,falseEasting:c.falseEasting??5e5,falseNorthing:c.falseNorthing??0,ellipsoid:c.ellipsoid??"GRS80"},transformDirection:"projectedToLonlat"}));const h=await this.loadSourceData(o);if(!h.data){console.error("Failed to resolve GIS CAD primary source for model:",o);continue}const u=h.data,p=Math.max(1,Number(u.numbersOfFile||1));try{const f=this.buildTransform(u,o),m=this.normalizeFormData(o,f,s.clampToGround),y=this.buildModelRoot({...o,formData:m},[u],s),g=new this.cesium.PrimitiveCollection;g.add(y.root);const A=u.bounds||null,v={...o,type:"gis-cad",sourceUrl:h.url,sourceData:u,sourceDataList:[u],root:g,groundRoot:y.root,previewRoot:null,bounds:A,transform:y.transform,show:!0,formData:m,editingFormData:null,isEditing:!1,buildOptions:s,totalChunks:p,loadedChunks:1,chunkLoadingComplete:p<=1};this.mapLayers[o.modelId]=y.layerItemsMap,this.viewer.scene.primitives.add(v.root),this.gisCadModelsList.push(v),this.setModelId(o.modelId),i.flyTo&&this.flyToBounds(v),i.onSuccess&&i.onSuccess(v),p>1&&this.loadRemainingChunksAsync(o,h.url,p,v)}catch(f){console.error("Failed to build GIS CAD model:",o,f)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}async loadRemainingChunksAsync(e,t,i,s){for(let o=1;o<i;o++){await new Promise(l=>setTimeout(l,0));const r=this.getChunkCandidateUrls(e,t,o);let a=!1;for(const l of r)try{const c=await this.loadModelFile(l);if(c?.watermark&&this.watermarkEnabled&&$u(c.watermark,this.viewer?.container),c){const h=this.buildModelPrimitives({...s,formData:s.formData},c,s.buildOptions);s.groundRoot.add(h.root),s.sourceDataList.push(c),this.mapLayers[s.modelId]||(this.mapLayers[s.modelId]={}),this.mergeLayerItemsMap(this.mapLayers[s.modelId],h.layerItemsMap),s.loadedChunks=(s.loadedChunks||1)+1,this.events.emit("chunkProgress",{modelId:s.modelId,loaded:s.loadedChunks,total:i}),this.viewer.scene.requestRender(),a=!0;break}}catch(c){console.error("Failed to append GIS CAD chunk:",l,c)}a||console.warn(`Failed to load GIS CAD chunk ${o} for ${e.modelId}`)}s.chunkLoadingComplete=!0,this.events.emit("chunkLoadingComplete",s)}beginEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.isEditing||(t.isEditing=!0,t.editingFormData={...t.formData},this.rebuildPreviewRoot(t)),t):null}adjustGISCadModel(e){const t=this.getRuntimeModel(e.modelId);return t?(t.isEditing||this.beginEditGISCad({modelId:e.modelId}),t.editingFormData={...t.editingFormData||t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.editingFormData?.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.rebuildPreviewRoot(t),t.editingFormData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return!t||!t.isEditing||!t.editingFormData||(t.formData={...t.editingFormData},this.replaceGroundRoot(t,t.formData),t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.isEditing=!1,t.editingFormData=null),t}cancelEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.groundRoot&&(t.groundRoot.show=t.show!==!1),t.isEditing=!1,t.editingFormData=null,t):null}deleteCad({modelId:e}){this.mapLayers[e]&&delete this.mapLayers[e];const t=this.gisCadModelsList.findIndex(i=>i.modelId===e);if(t>-1){const i=this.gisCadModelsList[t];this.viewer.scene.primitives.remove(i.root),i.root?.destroy&&!i.root.isDestroyed?.()&&i.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class Pn{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const i=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:i,anchor:i==2,closeBtn:i==2,offset:i==2?{x:0,y:-20}:{x:10,y:10},content:"",show:!0,style:{background:"rgba(0,0,0,0.5)",color:"white"}};this.opt=Object.assign(s,t),this.attr=this.opt;const o=this.viewer.container.id;this.isShow=this.opt.show==null?!0:this.opt.show;let r="",a="";const l=this.opt.style.background,c=this.opt.style.color;this.opt.anchor&&(r+=`
|
|
17
17
|
<div class="prompt-anchor-container">
|
|
18
18
|
<div class="prompt-anchor" style="background:${l} !important;">
|
|
19
19
|
</div>
|