leiting-bim 2.2.10 → 2.2.11

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.
@@ -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 n.Cesium3DTileStyle({color:c})}}}}var Jd=typeof global=="object"&&global&&global.Object===Object&&global,Xy=typeof self=="object"&&self&&self.Object===Object&&self,ji=Jd||Xy||Function("return this")(),zo=ji.Symbol,Zd=Object.prototype,Jy=Zd.hasOwnProperty,Zy=Zd.toString,vs=zo?zo.toStringTag:void 0;function eA(i){var e=Jy.call(i,vs),t=i[vs];try{i[vs]=void 0;var n=!0}catch{}var s=Zy.call(i);return n&&(e?i[vs]=t:delete i[vs]),s}var tA=Object.prototype,iA=tA.toString;function nA(i){return iA.call(i)}var sA="[object Null]",oA="[object Undefined]",eh=zo?zo.toStringTag:void 0;function bs(i){return i==null?i===void 0?oA:sA:eh&&eh in Object(i)?eA(i):nA(i)}function Cn(i){return i!=null&&typeof i=="object"}var rA="[object Symbol]";function aA(i){return typeof i=="symbol"||Cn(i)&&bs(i)==rA}var Ho=Array.isArray,lA=/\s/;function cA(i){for(var e=i.length;e--&&lA.test(i.charAt(e)););return e}var dA=/^\s+/;function hA(i){return i&&i.slice(0,cA(i)+1).replace(dA,"")}function jt(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var th=NaN,uA=/^[-+]0x[0-9a-f]+$/i,fA=/^0b[01]+$/i,pA=/^0o[0-7]+$/i,mA=parseInt;function ih(i){if(typeof i=="number")return i;if(aA(i))return th;if(jt(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=jt(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=hA(i);var t=fA.test(i);return t||pA.test(i)?mA(i.slice(2),t?2:8):uA.test(i)?th:+i}function nh(i){return i}var gA="[object AsyncFunction]",yA="[object Function]",AA="[object GeneratorFunction]",vA="[object Proxy]";function Qa(i){if(!jt(i))return!1;var e=bs(i);return e==yA||e==AA||e==gA||e==vA}var za=ji["__core-js_shared__"],sh=(function(){var i=/[^.]+$/.exec(za&&za.keys&&za.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function bA(i){return!!sh&&sh in i}var wA=Function.prototype,CA=wA.toString;function EA(i){if(i!=null){try{return CA.call(i)}catch{}try{return i+""}catch{}}return""}var xA=/[\\^$.*+?()[\]{}|]/g,IA=/^\[object .+?Constructor\]$/,SA=Function.prototype,MA=Object.prototype,TA=SA.toString,BA=MA.hasOwnProperty,_A=RegExp("^"+TA.call(BA).replace(xA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kA(i){if(!jt(i)||bA(i))return!1;var e=Qa(i)?_A:IA;return e.test(EA(i))}function PA(i,e){return i?.[e]}function Ha(i,e){var t=PA(i,e);return kA(t)?t:void 0}var oh=Object.create,DA=(function(){function i(){}return function(e){if(!jt(e))return{};if(oh)return oh(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}})();function NA(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}function LA(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e}var RA=800,FA=16,OA=Date.now;function GA(i){var e=0,t=0;return function(){var n=OA(),s=FA-(n-t);if(t=n,s>0){if(++e>=RA)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}function UA(i){return function(){return i}}var Yo=(function(){try{var i=Ha(Object,"defineProperty");return i({},"",{}),i}catch{}})(),VA=Yo?function(i,e){return Yo(i,"toString",{configurable:!0,enumerable:!1,value:UA(e),writable:!0})}:nh,QA=GA(VA),zA=9007199254740991,HA=/^(?:0|[1-9]\d*)$/;function rh(i,e){var t=typeof i;return e=e??zA,!!e&&(t=="number"||t!="symbol"&&HA.test(i))&&i>-1&&i%1==0&&i<e}function Ya(i,e,t){e=="__proto__"&&Yo?Yo(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}function $o(i,e){return i===e||i!==i&&e!==e}var YA=Object.prototype,$A=YA.hasOwnProperty;function jA(i,e,t){var n=i[e];(!($A.call(i,e)&&$o(n,t))||t===void 0&&!(e in i))&&Ya(i,e,t)}function WA(i,e,t,n){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=i[a]),s?Ya(t,a,l):jA(t,a,l)}return t}var ah=Math.max;function qA(i,e,t){return e=ah(e===void 0?i.length-1:e,0),function(){for(var n=arguments,s=-1,o=ah(n.length-e,0),r=Array(o);++s<o;)r[s]=n[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=n[s];return a[e]=t(r),NA(i,this,a)}}function KA(i,e){return QA(qA(i,e,nh),i+"")}var XA=9007199254740991;function lh(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=XA}function $a(i){return i!=null&&lh(i.length)&&!Qa(i)}function JA(i,e,t){if(!jt(t))return!1;var n=typeof e;return(n=="number"?$a(t)&&rh(e,t.length):n=="string"&&e in t)?$o(t[e],i):!1}function ZA(i){return KA(function(e,t){var n=-1,s=t.length,o=s>1?t[s-1]:void 0,r=s>2?t[2]:void 0;for(o=i.length>3&&typeof o=="function"?(s--,o):void 0,r&&JA(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n<s;){var a=t[n];a&&i(e,a,n,o)}return e})}var e1=Object.prototype;function ch(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||e1;return i===t}function t1(i,e){for(var t=-1,n=Array(i);++t<i;)n[t]=e(t);return n}var i1="[object Arguments]";function dh(i){return Cn(i)&&bs(i)==i1}var hh=Object.prototype,n1=hh.hasOwnProperty,s1=hh.propertyIsEnumerable,ja=dh((function(){return arguments})())?dh:function(i){return Cn(i)&&n1.call(i,"callee")&&!s1.call(i,"callee")};function o1(){return!1}var uh=typeof Q=="object"&&Q&&!Q.nodeType&&Q,fh=uh&&typeof module=="object"&&module&&!module.nodeType&&module,r1=fh&&fh.exports===uh,ph=r1?ji.Buffer:void 0,a1=ph?ph.isBuffer:void 0,mh=a1||o1,l1="[object Arguments]",c1="[object Array]",d1="[object Boolean]",h1="[object Date]",u1="[object Error]",f1="[object Function]",p1="[object Map]",m1="[object Number]",g1="[object Object]",y1="[object RegExp]",A1="[object Set]",v1="[object String]",b1="[object WeakMap]",w1="[object ArrayBuffer]",C1="[object DataView]",E1="[object Float32Array]",x1="[object Float64Array]",I1="[object Int8Array]",S1="[object Int16Array]",M1="[object Int32Array]",T1="[object Uint8Array]",B1="[object Uint8ClampedArray]",_1="[object Uint16Array]",k1="[object Uint32Array]",Ie={};Ie[E1]=Ie[x1]=Ie[I1]=Ie[S1]=Ie[M1]=Ie[T1]=Ie[B1]=Ie[_1]=Ie[k1]=!0,Ie[l1]=Ie[c1]=Ie[w1]=Ie[d1]=Ie[C1]=Ie[h1]=Ie[u1]=Ie[f1]=Ie[p1]=Ie[m1]=Ie[g1]=Ie[y1]=Ie[A1]=Ie[v1]=Ie[b1]=!1;function P1(i){return Cn(i)&&lh(i.length)&&!!Ie[bs(i)]}function D1(i){return function(e){return i(e)}}var gh=typeof Q=="object"&&Q&&!Q.nodeType&&Q,ws=gh&&typeof module=="object"&&module&&!module.nodeType&&module,N1=ws&&ws.exports===gh,Wa=N1&&Jd.process,yh=(function(){try{var i=ws&&ws.require&&ws.require("util").types;return i||Wa&&Wa.binding&&Wa.binding("util")}catch{}})(),Ah=yh&&yh.isTypedArray,vh=Ah?D1(Ah):P1;function L1(i,e){var t=Ho(i),n=!t&&ja(i),s=!t&&!n&&mh(i),o=!t&&!n&&!s&&vh(i),r=t||n||s||o,a=r?t1(i.length,String):[],l=a.length;for(var c in i)r&&(c=="length"||s&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||rh(c,l))||a.push(c);return a}function R1(i,e){return function(t){return i(e(t))}}function F1(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e}var O1=Object.prototype,G1=O1.hasOwnProperty;function U1(i){if(!jt(i))return F1(i);var e=ch(i),t=[];for(var n in i)n=="constructor"&&(e||!G1.call(i,n))||t.push(n);return t}function bh(i){return $a(i)?L1(i):U1(i)}var Cs=Ha(Object,"create");function V1(){this.__data__=Cs?Cs(null):{},this.size=0}function Q1(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var z1="__lodash_hash_undefined__",H1=Object.prototype,Y1=H1.hasOwnProperty;function $1(i){var e=this.__data__;if(Cs){var t=e[i];return t===z1?void 0:t}return Y1.call(e,i)?e[i]:void 0}var j1=Object.prototype,W1=j1.hasOwnProperty;function q1(i){var e=this.__data__;return Cs?e[i]!==void 0:W1.call(e,i)}var K1="__lodash_hash_undefined__";function X1(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=Cs&&e===void 0?K1:e,this}function Wi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Wi.prototype.clear=V1,Wi.prototype.delete=Q1,Wi.prototype.get=$1,Wi.prototype.has=q1,Wi.prototype.set=X1;function J1(){this.__data__=[],this.size=0}function jo(i,e){for(var t=i.length;t--;)if($o(i[t][0],e))return t;return-1}var Z1=Array.prototype,ev=Z1.splice;function tv(i){var e=this.__data__,t=jo(e,i);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():ev.call(e,t,1),--this.size,!0}function iv(i){var e=this.__data__,t=jo(e,i);return t<0?void 0:e[t][1]}function nv(i){return jo(this.__data__,i)>-1}function sv(i,e){var t=this.__data__,n=jo(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this}function di(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}di.prototype.clear=J1,di.prototype.delete=tv,di.prototype.get=iv,di.prototype.has=nv,di.prototype.set=sv;var wh=Ha(ji,"Map");function ov(){this.size=0,this.__data__={hash:new Wi,map:new(wh||di),string:new Wi}}function rv(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}function Wo(i,e){var t=i.__data__;return rv(e)?t[typeof e=="string"?"string":"hash"]:t.map}function av(i){var e=Wo(this,i).delete(i);return this.size-=e?1:0,e}function lv(i){return Wo(this,i).get(i)}function cv(i){return Wo(this,i).has(i)}function dv(i,e){var t=Wo(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this}function En(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}En.prototype.clear=ov,En.prototype.delete=av,En.prototype.get=lv,En.prototype.has=cv,En.prototype.set=dv;var Ch=R1(Object.getPrototypeOf,Object),hv="[object Object]",uv=Function.prototype,fv=Object.prototype,Eh=uv.toString,pv=fv.hasOwnProperty,mv=Eh.call(Object);function gv(i){if(!Cn(i)||bs(i)!=hv)return!1;var e=Ch(i);if(e===null)return!0;var t=pv.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Eh.call(t)==mv}function yv(){this.__data__=new di,this.size=0}function Av(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t}function vv(i){return this.__data__.get(i)}function bv(i){return this.__data__.has(i)}var wv=200;function Cv(i,e){var t=this.__data__;if(t instanceof di){var n=t.__data__;if(!wh||n.length<wv-1)return n.push([i,e]),this.size=++t.size,this;t=this.__data__=new En(n)}return t.set(i,e),this.size=t.size,this}function xn(i){var e=this.__data__=new di(i);this.size=e.size}xn.prototype.clear=yv,xn.prototype.delete=Av,xn.prototype.get=vv,xn.prototype.has=bv,xn.prototype.set=Cv;var xh=typeof Q=="object"&&Q&&!Q.nodeType&&Q,Ih=xh&&typeof module=="object"&&module&&!module.nodeType&&module,Ev=Ih&&Ih.exports===xh,Sh=Ev?ji.Buffer:void 0;Sh&&Sh.allocUnsafe;function xv(i,e){return i.slice()}var Mh=ji.Uint8Array;function Iv(i){var e=new i.constructor(i.byteLength);return new Mh(e).set(new Mh(i)),e}function Sv(i,e){var t=Iv(i.buffer);return new i.constructor(t,i.byteOffset,i.length)}function Mv(i){return typeof i.constructor=="function"&&!ch(i)?DA(Ch(i)):{}}function Tv(i){return function(e,t,n){for(var s=-1,o=Object(e),r=n(e),a=r.length;a--;){var l=r[++s];if(t(o[l],l,o)===!1)break}return e}}var Bv=Tv(),qa=function(){return ji.Date.now()},_v="Expected a function",kv=Math.max,Pv=Math.min;function qo(i,e,t){var n,s,o,r,a,l,c=0,h=!1,u=!1,p=!0;if(typeof i!="function")throw new TypeError(_v);e=ih(e)||0,jt(t)&&(h=!!t.leading,u="maxWait"in t,o=u?kv(ih(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function f(x){var I=n,M=s;return n=s=void 0,c=x,r=i.apply(M,I),r}function m(x){return c=x,a=setTimeout(A,e),h?f(x):r}function y(x){var I=x-l,M=x-c,w=e-I;return u?Pv(w,o-M):w}function g(x){var I=x-l,M=x-c;return l===void 0||I>=e||I<0||u&&M>=o}function A(){var x=qa();if(g(x))return v(x);a=setTimeout(A,y(x))}function v(x){return a=void 0,p&&n?f(x):(n=s=void 0,r)}function b(){a!==void 0&&clearTimeout(a),c=0,n=l=s=a=void 0}function C(){return a===void 0?r:v(qa())}function S(){var x=qa(),I=g(x);if(n=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=b,S.flush=C,S}function Ka(i,e,t){(t!==void 0&&!$o(i[e],t)||t===void 0&&!(e in i))&&Ya(i,e,t)}function Dv(i){return Cn(i)&&$a(i)}function Xa(i,e){if(!(e==="constructor"&&typeof i[e]=="function")&&e!="__proto__")return i[e]}function Nv(i){return WA(i,bh(i))}function Lv(i,e,t,n,s,o,r){var a=Xa(i,t),l=Xa(e,t),c=r.get(l);if(c){Ka(i,t,c);return}var h=o?o(a,l,t+"",i,e,r):void 0,u=h===void 0;if(u){var p=Ho(l),f=!p&&mh(l),m=!p&&!f&&vh(l);h=l,p||f||m?Ho(a)?h=a:Dv(a)?h=LA(a):f?(u=!1,h=xv(l)):m?(u=!1,h=Sv(l)):h=[]:gv(l)||ja(l)?(h=a,ja(a)?h=Nv(a):(!jt(a)||Qa(a))&&(h=Mv(l))):u=!1}u&&(r.set(l,h),s(h,l,n,o,r),r.delete(l)),Ka(i,t,h)}function Th(i,e,t,n,s){i!==e&&Bv(e,function(o,r){if(s||(s=new xn),jt(o))Lv(i,e,r,t,Th,n,s);else{var a=n?n(Xa(i,r),o,r+"",i,e,s):void 0;a===void 0&&(a=o),Ka(i,r,a)}},bh)}var Rv=ZA(function(i,e,t){Th(i,e,t)});function Ja({Cesium:i,tileset:e}){const t=e.leiting;if(!t||!t.model||!t.model.formData)return;const n=t.model.formData,s=t.box,o=i.Quaternion.fromAxisAngle(i.Cartesian3.UNIT_Z,i.Math.toRadians(n.totalRotation||0)),r=i.Matrix4.fromRotationTranslation(i.Matrix3.fromQuaternion(o),i.Cartesian3.ZERO),a=i.Cartesian3.fromDegrees(n.longitude,n.latitude,n.height),l=i.Transforms.eastNorthUpToFixedFrame(a),c=i.Matrix4.multiply(l,r,new i.Matrix4);if(e._root){if(!s){e._root.transform=c;return}try{const{center:h}=s,u=e.root.boundingVolume.boundingSphere,p=new i.Cartesian3(h.x,h.y,0),f=i.Matrix4.multiplyByPoint(c,p,new i.Cartesian3),m=i.Cartographic.fromCartesian(f),y=u.center,g=i.Transforms.eastNorthUpToFixedFrame(new i.Cartesian3(y.x,y.y,y.z)),A=new i.Cartesian3(-h.x+(n.X||0),-h.y+(n.Y||0),n.Z||0),v=i.Matrix4.fromTranslation(A),b=i.Matrix4.multiply(r,v,new i.Matrix4),C=i.Cartesian3.fromDegrees(m.longitude/Math.PI*180,m.latitude/Math.PI*180,n.height),S=i.Transforms.eastNorthUpToFixedFrame(C),x=i.Matrix4.multiply(S,b,new i.Matrix4);i.Matrix4.multiply(g,b,g),e._root.transform=x}catch(h){console.error("Update model position failed:",h)}}}const In={NotLoaded:0,Loading:1,Loaded:2,Error:3},qi=4294967295,Wt=65535,Za=255,Fv=8,Bh=9,Ov=0,Gv=99,Uv=67324752,_h=134695760,Vv=_h,kh=33639248,Qv=101010256,Ph=101075792,zv=117853008,Sn=22,el=20,tl=56,Hv=12,Yv=20,Dh=4,$v=1,jv=39169,Wv=10,qv=1,Kv=21589,Xv=28789,Jv=25461,Zv=6534,eb=30837,tb=30805,Nh=1,ib=6,Lh=8,Rh=2048,nb=16,sb=1,ob=2,rb=4,ab=32,Fh=61440,il=16384,nl=73,lb=420,cb=2048,db=1024,hb=512,ub="/",sl=30,fb=10,pb=14,mb=18,Se=void 0,Ei="undefined",Ki="function",gb=64;let Oh=2;try{typeof navigator!=Ei&&navigator.hardwareConcurrency&&(Oh=navigator.hardwareConcurrency)}catch{}const yb={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:Oh,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=Ei&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Ei&&DecompressionStream},Gh=Object.assign({},yb);function Ab(){return Gh}function vb(i){return Math.max(i.chunkSize,gb)}function Ko(i){const{baseURI:e,chunkSize:t,maxWorkers:n,terminateWorkerTimeout:s,useCompressionStream:o,useWebWorkers:r,CompressionStream:a,DecompressionStream:l,CompressionStreamZlib:c,DecompressionStreamZlib:h,workerURI:u,wasmURI:p}=i;_t("baseURI",e),_t("wasmURI",p),_t("workerURI",u),_t("chunkSize",t),_t("maxWorkers",n),_t("terminateWorkerTimeout",s),_t("useCompressionStream",o),_t("useWebWorkers",r),_t("CompressionStream",a),_t("DecompressionStream",l),_t("CompressionStreamZlib",c),_t("DecompressionStreamZlib",h)}function _t(i,e){e!==Se&&(Gh[i]=e)}function bb(i){let e;i({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 Uh=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;Uh[i]=e}class Xo{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let n=0,s=e.length|0;n<s;n++)t=t>>>8^Uh[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Vh extends TransformStream{constructor(){let e;const t=new Xo;super({transform(n,s){t.append(n),s.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function wb(i){if(typeof TextEncoder==Ei){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const pt={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=pt.getPartial(t);return n===32?i.concat(e):pt._shiftRight(e,n,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+pt.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=pt.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,n){for(n===void 0&&(n=[]);e>=32;e-=32)n.push(t),t=0;if(e===0)return n.concat(i);for(let r=0;r<i.length;r++)n.push(t|i[r]>>>e),t=i[r]<<32-e;const s=i.length?i[i.length-1]:0,o=pt.getPartial(s);return n.push(pt.partial(e+o&31,e+o>32?t:n.pop(),1)),n}},Jo={bytes:{fromBits(i){const t=pt.bitLength(i)/8,n=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=i[o/4]),n[o]=s>>>24,s<<=8;return n},toBits(i){const e=[];let t,n=0;for(t=0;t<i.length;t++)n=n<<8|i[t],(t&3)===3&&(e.push(n),n=0);return t&3&&e.push(pt.partial(8*(t&3),n)),e}}},Qh={};Qh.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=Jo.utf8String.toBits(i));const t=e._buffer=pt.concat(e._buffer,i),n=e._length,s=e._length=n+pt.bitLength(i);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+n-(e.blockSize+n&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 i=this;let e=i._buffer;const t=i._h;e=pt.concat(e,[pt.partial(1,1)]);for(let n=e.length+2;n&15;n++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,n){if(i<=19)return e&t|~e&n;if(i<=39)return e^t^n;if(i<=59)return e&t|e&n|t&n;if(i<=79)return e^t^n}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,n=Array(80);for(let c=0;c<16;c++)n[c]=i[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&&(n[c]=e._S(1,n[c-3]^n[c-8]^n[c-14]^n[c-16]));const h=e._S(5,s)+e._f(c,o,r,a)+l+n[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 zh={};zh.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],n=e._tables[1],s=i.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=i.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]=n[0][t[h>>>24]]^n[1][t[h>>16&255]]^n[2][t[h>>8&255]]^n[3][t[h&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],n=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,n[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++)i[m][h]=f=f<<24^f>>>8,e[m][u]=p=p<<24^p>>>8}for(let h=0;h<5;h++)i[h]=i[h].slice(0),e[h]=e[h].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],n=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=i[0]^t[0],p=i[e?3:1]^t[1],f=i[2]^t[2],m=i[e?1:3]^t[3],y=4,g,A,v;for(let b=0;b<n;b++)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 b=0;b<4;b++)s[e?3&-b:b]=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 Cb={getRandomValues(i){const e=new Uint32Array(i.buffer),t=n=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,n=18e3*(n&65535)+(n>>16)&o,(((s<<16)+n&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,s;n<i.length;n+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[n/4]=o()*4294967296|0}return i}},Hh={};Hh.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,n=i&255;e===255?(e=0,t===255?(t=0,n===255?n=0:++n):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=n}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let n;if(!(n=e.length))return[];const s=pt.bitLength(e);for(let o=0;o<n;o+=4){this.incCounter(t);const r=i.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 Xi={importKey(i){return new Xi.hmacSha1(Jo.bytes.toBits(i))},pbkdf2(i,e,t,n){if(t=t||1e4,n<0||t<0)throw new Error("invalid params to pbkdf2");const s=(n>>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=i.encrypt(f.concat(e,[c])),a=1;a<t;a++)for(r=i.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,n/8)}};Xi.hmacSha1=class{constructor(i){const e=this,t=e._hash=Qh.sha1,n=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;i.length>s&&(i=new t().update(i).finalize());for(let o=0;o<s;o++)n[0][o]=i[o]^909522486,n[1][o]=i[o]^1549556828;e._baseHash[0].update(n[0]),e._baseHash[1].update(n[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const Eb=typeof crypto!=Ei&&typeof crypto.getRandomValues==Ki,Yh="Invalid password",$h="Invalid signature",ol="zipjs-abort-check-password";function jh(i){return Eb?crypto.getRandomValues(i):Cb.getRandomValues(i)}const Mn=16,xb="raw",Wh={name:"PBKDF2"},Ib={name:"HMAC"},Sb="SHA-1",Mb=Object.assign({hash:Ib},Wh),rl=Object.assign({iterations:1e3,hash:{name:Sb}},Wh),Tb=["deriveBits"],Es=[8,12,16],xs=[16,24,32],xi=10,Bb=[0,0,0,0],Zo=typeof crypto!=Ei,Is=Zo&&crypto.subtle,qh=Zo&&typeof Is!=Ei,qt=Jo.bytes,_b=zh.aes,kb=Hh.ctrGladman,Pb=Xi.hmacSha1;let Kh=Zo&&qh&&typeof Is.importKey==Ki,Xh=Zo&&qh&&typeof Is.deriveBits==Ki;class Db extends TransformStream{constructor({password:e,rawPassword:t,signed:n,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:eu(e,t),signed:n,strength:s-1,pending:new Uint8Array})},async transform(r,a){const l=this,{password:c,strength:h,resolveReady:u,ready:p}=l;c?(await Lb(l,h,c,kt(r,0,Es[h]+2)),r=kt(r,Es[h]+2),o?a.error(new Error(ol)):u()):await p;const f=new Uint8Array(r.length-xi-(r.length-xi)%Mn);a.enqueue(Jh(l,r,f,0,xi,!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-xi),f=kt(h,h.length-xi);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,xi);for(let g=0;g<xi;g++)if(y[g]!=f[g])throw new Error($h)}r.enqueue(m)}}})}}class Nb extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:eu(e,t),strength:n-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 Rb(a,c,l),h()):await u;const f=new Uint8Array(p.length+o.length-o.length%Mn);f.set(p,0),r.enqueue(Jh(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,xi),o.enqueue(al(h,s.signature))}}}),s=this}}function Jh(i,e,t,n,s,o){const{ctr:r,hmac:a,pending:l}=i,c=e.length-s;l.length&&(e=al(l,e),t=Gb(t,c-c%Mn));let h;for(h=0;h<=c-Mn;h+=Mn){const u=Ms(qt,kt(e,h,h+Mn));o&&a.update(u);const p=r.update(u);o||a.update(p),t.set(Ss(qt,p),h+n)}return i.pending=kt(e,h),t}async function Lb(i,e,t,n){const s=await Zh(i,e,t,kt(n,0,Es[e])),o=kt(n,Es[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(Yh)}async function Rb(i,e,t){const n=jh(new Uint8Array(Es[e])),s=await Zh(i,e,t,n);return al(n,s)}async function Zh(i,e,t,n){i.password=null;const s=await Fb(xb,t,Mb,!1,Tb),o=await Ob(Object.assign({salt:n},rl),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(i,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new kb(new _b(a),Array.from(Bb)),hmac:new Pb(l)}),c}async function Fb(i,e,t,n,s){if(Kh)try{return await Is.importKey(i,e,t,n,s)}catch{return Kh=!1,Xi.importKey(e)}else return Xi.importKey(e)}async function Ob(i,e,t){if(Xh)try{return await Is.deriveBits(i,e,t)}catch{return Xh=!1,Xi.pbkdf2(e,i.salt,rl.iterations,t)}else return Xi.pbkdf2(e,i.salt,rl.iterations,t)}function eu(i,e){return e===Se?wb(i):e}function al(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function Gb(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function kt(i,e,t){return i.subarray(e,t)}function Ss(i,e){return i.fromBits(e)}function Ms(i,e){return i.toBits(e)}const Ts=12;class Ub extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),nu(this,e)},transform(s,o){const r=this;if(r.password){const a=tu(r,s.subarray(0,Ts));if(r.password=null,a.at(-1)!=r.passwordVerification)throw new Error(Yh);s=s.subarray(Ts)}n?o.error(new Error(ol)):o.enqueue(tu(r,s))}})}}class Vb extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),nu(this,e)},transform(n,s){const o=this;let r,a;if(o.password){o.password=null;const l=jh(new Uint8Array(Ts));l[Ts-1]=o.passwordVerification,r=new Uint8Array(n.length+l.length),r.set(iu(o,l),0),a=Ts}else r=new Uint8Array(n.length),a=0;r.set(iu(o,n),a),s.enqueue(r)}})}}function tu(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=su(i)^e[n],ll(i,t[n]);return t}function iu(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=su(i)^e[n],ll(i,e[n]);return t}function nu(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new Xo(t[0]),crcKey2:new Xo(t[2])});for(let n=0;n<e.length;n++)ll(i,e.charCodeAt(n))}function ll(i,e){let[t,n,s]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=ru(Math.imul(ru(n+ou(t)),134775813)+1),i.crcKey2.append([n>>>24]),s=~i.crcKey2.get(),i.keys=[t,n,s]}function su(i){const e=i.keys[2]|2;return ou(Math.imul(e,e^1)>>>8)}function ou(i){return i&255}function ru(i){return i&4294967295}const au="Invalid uncompressed size",Qb="deflate-raw",zb="deflate64-raw";class Hb extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:n,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 Vh,m=Kt(m,p)),o&&(m=cu(m,a,{level:h,chunkSize:t},s,n,s)),r&&(l?m=Kt(m,new Vb(e)):(f=new Nb(e),m=Kt(m,f))),lu(u,m,()=>{let y;r&&!l&&(y=f.signature),(!r||l)&&c&&(y=new DataView(p.value.buffer).getUint32(0)),u.signature=y})}}class Yb extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:n,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 Ub(e)):(f=new Db(e),m=Kt(m,f))),c&&(m=cu(m,h,{chunkSize:t,deflate64:u},s,n,s)),(!r||o)&&a&&(p=new Vh,m=Kt(m,p)),lu(this,m,()=>{if((!r||o)&&a){const y=new DataView(p.value.buffer);if(l!=y.getUint32(0,!1))throw new Error($h)}})}}function lu(i,e,t){e=Kt(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function cu(i,e,t,n,s,o){const r=e&&n?n:s||o,a=t.deflate64?zb:Qb;try{i=Kt(i,new r(a,t))}catch(l){if(e)if(s)i=Kt(i,new s(a,t));else if(o)i=Kt(i,new o(a,t));else throw l;else throw l}return i}function Kt(i,e){return i.pipeThrough(e)}const $b="message",jb="start",Wb="pull",du="data",qb="ack",hu="close",Kb="deflate",uu="inflate";class Xb extends TransformStream{constructor(e,t){super({});const n=this,{codecType:s}=e;let o;s.startsWith(Kb)?o=Hb:s.startsWith(uu)&&(o=Yb),n.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(n,{inputSize:r})}}),h=new TransformStream({transform(u,p){if(u&&u.length&&(p.enqueue(u),n.outputSize+=u.length,e.outputSize!==Se&&n.outputSize>e.outputSize))throw new Error(au)},flush(){const{signature:u}=a;Object.assign(n,{signature:u,inputSize:r})}});Object.defineProperty(n,"readable",{get(){return l.pipeThrough(c).pipeThrough(a).pipeThrough(h)}})}}class Jb extends TransformStream{constructor(e){let t;super({transform:n,flush(s){t&&t.length&&s.enqueue(t)}});function n(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)),n(s.slice(e),o)):t=s}}}let fu=typeof Worker!=Ei,pu=()=>{};function Zb({initModule:i}){pu=i}class cl{constructor(e,{readable:t,writable:n},{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 Jb(o.chunkSize)).pipeThrough(new ew(r),{signal:u}),writable:n,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&&fu?tw:mu)(e,o)}}class ew extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:s}){let o=0;super({async start(){e&&await dl(e,n)},async transform(r,a){o+=r.length,t&&await dl(t,o,n),a.enqueue(r)},async flush(){s&&await dl(s,o)}})}}async function dl(i,...e){try{await i(...e)}catch{}}function mu(i,e){return{run:()=>iw(i,e)}}function tw(i,e){const{baseURI:t,chunkSize:n}=e;let{wasmURI:s}=e;if(!i.interface){typeof s==Ki&&(s=s());let o;try{o=ow(i.workerURI,t,i)}catch{return fu=!1,mu(i,e)}Object.assign(i,{worker:o,interface:{run:()=>nw(i,{chunkSize:n,wasmURI:s,baseURI:t})}})}return i.interface}async function iw({options:i,readable:e,writable:t,onTaskFinished:n},s){let o;try{if(!i.useCompressionStream)try{await pu(s)}catch{i.useCompressionStream=!0}o=new Xb(i,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{n()}}async function nw(i,e){let t,n;const s=new Promise((u,p)=>{t=u,n=p});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:s});const{readable:o,options:r}=i,{writable:a,closed:l}=sw(i.writable),c=er({type:jb,options:r,config:e,readable:o,writable:a},i);c||Object.assign(i,{reader:o.getReader(),writer:a.getWriter()});const h=await s;return c||await a.getWriter().close(),await l,h}function sw(i){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=i.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return i.getWriter().abort(s)}}),closed:t}}let gu=!0;function ow(i,e,t){const n={type:"module"};let s,o;if(typeof i==Ki&&(i=i()),i.startsWith("data:")||i.startsWith("blob:"))try{o=new Worker(i)}catch{o=new Worker(i,n)}else{try{s=new URL(i,e)}catch{s=i}o=new Worker(s,n)}return o.addEventListener($b,r=>rw(r,t)),o}function er(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:s}){try{const{value:o,readable:r,writable:a}=i,l=[];if(o&&(i.value=o,l.push(i.value.buffer)),s&&gu?(r&&l.push(r),a&&l.push(a)):i.readable=i.writable=null,l.length)try{return e.postMessage(i,l),!0}catch{gu=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(o){throw t&&t.releaseLock(),n(),o}}async function rw({data:i},e){const{type:t,value:n,messageId:s,result:o,error:r}=i,{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==Wb){const{value:f,done:m}=await a.read();er({type:du,value:f,done:m,messageId:s},e)}t==du&&(await l.ready,await l.write(new Uint8Array(n)),er({type:qb,messageId:s},e)),t==hu&&p(null,o)}}catch(f){er({type:hu,messageId:s},e),p(f)}function p(f,m){f?h(f):c(m),l&&l.releaseLock(),u()}}let Ji=[];const hl=[];let yu=0;async function aw(i,e){const{options:t,config:n}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:a,signed:l,encrypted:c}=t,{workerURI:h,maxWorkers:u}=n;e.transferStreams=s||s===Se;const p=!a&&!l&&!c&&!e.transferStreams;return e.useWebWorkers=!p&&(o||o===Se&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Se,t.useCompressionStream=r||r===Se&&n.useCompressionStream,(await f()).run();async function f(){const y=Ji.find(g=>!g.busy);if(y)return Au(y),new cl(y,i,e,m);if(Ji.length<u){const g={indexWorker:yu};return yu++,Ji.push(g),new cl(g,i,e,m)}else return new Promise(g=>hl.push({resolve:g,stream:i,workerOptions:e}))}function m(y){if(hl.length){const[{resolve:g,stream:A,workerOptions:v}]=hl.splice(0,1);g(new cl(y,A,v,m))}else y.worker?(Au(y),lw(y,e)):Ji=Ji.filter(g=>g!=y)}}function lw(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Ji=Ji.filter(s=>s!=i);try{await i.terminate()}catch{}},n))}function Au(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}const cw="Writer iterator completed too soon",dw="Content-Type",hw=64*1024,vu="writable";class ul{constructor(){this.size=0}init(){this.initialized=!0}}class bu extends ul{get readable(){const e=this,{chunkSize:t=hw}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:a}=n,{chunkOffset:l}=this,c=r===Se?t:Math.min(t,r-l),h=await it(e,o+l,c,a);s.enqueue(h),l+t>r||r===Se&&!h.length&&c?s.close():this.chunkOffset+=t}});return n}}class tr extends bu{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,s=e+t;let r=await(e||s<n.size?n.blob.slice(e,s):n.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class uw extends ul{constructor(e){super();const t=this,n=new TransformStream,s=[];e&&s.push([dw,e]),Object.defineProperty(t,vu,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:s}).blob()}getData(){return this.blob}}class fw extends uw{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.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(n,e)})}}}class pw extends bu{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(n,s)=>{await n.init(),s!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const s=this,{readers:o}=this;let r,a=n;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 it(c,l,t);else{const u=h-l;r=new Uint8Array(t);const p=await it(c,l,u);r.set(p,0);const f=await s.readUint8Array(e+u,t-u,n);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 wu extends ul{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const a=new WritableStream({async write(h){const{availableSize:u}=n;if(r)h.length>=u?(await l(h.subarray(0,u)),await c(),n.diskOffset+=s.size,n.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(cw);s=p,s.size=0,s.maxSize&&(n.maxSize=s.maxSize),n.availableSize=n.maxSize,await ir(s),o=p.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await c()}});Object.defineProperty(n,vu,{get(){return a}});async function l(h){const u=h.length;u&&(await r.ready,await r.write(h),s.size+=u,n.size+=u,n.availableSize-=u)}async function c(){await r.close()}}}class mw{constructor(e){return Array.isArray(e)&&(e=new pw(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class gw{constructor(e){return e.writable===Se&&typeof e.next==Ki&&(e=new wu(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Se&&(e.size=0),e instanceof wu||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function ir(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function it(i,e,t,n){return i.readUint8Array(e,t,n)}const Cu="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),yw=Cu.length==256;function Aw(i){if(yw){let e="";for(let t=0;t<i.length;t++)e+=Cu[i[t]];return e}else return new TextDecoder().decode(i)}function nr(i,e){return e&&e.trim().toLowerCase()=="cp437"?Aw(i):new TextDecoder(e).decode(i)}const Eu="filename",xu="rawFilename",Iu="comment",Su="rawComment",Mu="uncompressedSize",Tu="compressedSize",Bu="offset",_u="diskNumberStart",fl="lastModDate",pl="rawLastModDate",ku="lastAccessDate",vw="rawLastAccessDate",Pu="creationDate",Du="rawCreationDate",bw=[Eu,xu,Mu,Tu,fl,pl,Iu,Su,ku,Pu,Du,Bu,_u,"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 Nu{constructor(e){bw.forEach(t=>this[t]=e[t])}}const ww="filenameEncoding",Cw="commentEncoding",Ew="decodeText",xw="extractPrependedData",Iw="extractAppendedData",Sw="password",Mw="rawPassword",Tw="passThrough",Bw="signal",_w="checkPasswordOnly",kw="checkOverlappingEntryOnly",Pw="checkOverlappingEntry",Dw="checkSignature",Nw="useWebWorkers",Lw="useCompressionStream",Rw="transferStreams",Fw="preventClose",ml="File format is not recognized",Ow="End of central directory not found",Gw="End of Zip64 central directory locator not found",Uw="Central directory header not found",Vw="Local file header not found",Qw="Zip64 extra field not found",zw="File contains encrypted entry",Hw="Encryption method not supported",Lu="Compression method not supported",Ru="Split zip file",Yw="Overlapping entry found",Fu="utf-8",$w="UTF8",Ou="cp437",jw=[[Mu,qi],[Tu,qi],[Bu,qi],[_u,Wt]],Ww={[Wt]:{getValue:Me,bytes:4},[qi]:{getValue:Tn,bytes:8}};class gl{constructor(e,t={}){Object.assign(this,{reader:new mw(e),options:t,config:Ab(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:s}=t;if(await ir(n),(n.size===Se||!n.readUint8Array)&&(n=new tr(await new Response(n.readable).blob()),await ir(n)),n.size<Sn)throw new Error(ml);n.chunkSize=vb(s);const o=await tC(n,Qv,n.size,Sn,Wt*16);if(!o){const T=await it(n,0,4),k=Te(T);throw Me(k)==_h?new Error(Ru):new Error(Ow)}const r=Te(o);let a=Me(r,12),l=Me(r,16);const c=o.offset,h=Ze(r,20),u=c+Sn+h;let p=Ze(r,4);const f=n.lastDiskNumber||0;let m=Ze(r,6),y=Ze(r,8),g=0,A=0;if(l==qi||a==qi||y==Wt||m==Wt){const T=await it(n,o.offset-el,el),k=Te(T);if(Me(k,0)==zv){l=Tn(k,8);let R=await it(n,l,tl,-1),G=Te(R);const L=o.offset-el-tl;if(Me(G,0)!=Ph&&l!=L){const N=l;l=L,l>N&&(g=l-N),R=await it(n,l,tl,-1),G=Te(R)}if(Me(G,0)!=Ph)throw new Error(Gw);p==Wt&&(p=Me(G,16)),m==Wt&&(m=Me(G,20)),y==Wt&&(y=Tn(G,32)),a==qi&&(a=Tn(G,40)),l-=a}}if(l>=n.size&&(g=n.size-l-a-Sn,l=n.size-a-Sn),f!=p)throw new Error(Ru);if(l<0)throw new Error(ml);let v=0,b=await it(n,l,a,m),C=Te(b);if(a){const T=o.offset-a;if(Me(C,v)!=kh&&l!=T){const k=l;l=T,l>k&&(g+=l-k),b=await it(n,l,a,m),C=Te(b)}}const S=o.offset-l-(n.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,b=await it(n,l,a,m),C=Te(b)),l<0||l>=n.size)throw new Error(ml);const x=nt(t,e,ww),I=nt(t,e,Cw);for(let T=0;T<y;T++){const k=new qw(n,s,t.options);if(Me(C,v)!=kh)throw new Error(Uw);Gu(k,C,v+6);const R=!!k.bitFlag.languageEncodingFlag,G=v+46,L=G+k.filenameLength,N=L+k.extraFieldLength,E=Ze(C,v+4),B=E>>8==0,D=E>>8==3,F=b.subarray(G,L),V=Ze(C,v+32),O=N+V,P=b.subarray(N,O),_=R,U=R,H=Me(C,v+38),X=H&Za,q={readOnly:!!(X&sb),hidden:!!(X&ob),system:!!(X&rb),directory:!!(X&nb),archive:!!(X&ab)},fe=Me(C,v+42)+g,de=nt(t,e,Ew)||nr,ge=_?Fu:x||Ou,be=U?Fu:I||Ou;let _e=de(F,ge);_e===Se&&(_e=nr(F,ge));let tt=de(P,be);tt===Se&&(tt=nr(P,be)),Object.assign(k,{versionMadeBy:E,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:V,offset:fe,diskNumberStart:Ze(C,v+34),internalFileAttributes:Ze(C,v+36),externalFileAttributes:H,msdosAttributesRaw:X,msdosAttributes:q,rawFilename:F,filenameUTF8:_,commentUTF8:U,rawExtraField:b.subarray(L,N),rawComment:P,filename:_e,comment:tt}),A=Math.max(fe,A),Uu(k,k,C,v+6);const Xe=k.externalFileAttributes>>16&Wt;k.unixMode===Se&&(Xe&(lb|nl|il))!=0&&(k.unixMode=Xe);const vt=!!(k.unixMode&cb),ct=!!(k.unixMode&db),Bt=!!(k.unixMode&hb),j=k.unixMode!==Se?(k.unixMode&nl)!=0:D&&(Xe&nl)!=0,Y=k.unixMode!==Se&&(k.unixMode&Fh)==il,ee=(Xe&Fh)==il;Object.assign(k,{setuid:vt,setgid:ct,sticky:Bt,unixExternalUpper:Xe,internalFileAttribute:k.internalFileAttributes,externalFileAttribute:k.externalFileAttributes,executable:j,directory:Y||ee||B&&q.directory||_e.endsWith(ub)&&!k.uncompressedSize,zipCrypto:k.encrypted&&!k.extraFieldAES});const Je=new Nu(k);Je.getData=(Yt,yn)=>k.getData(Yt,Je,t.readRanges,yn),Je.arrayBuffer=async Yt=>{const yn=new TransformStream,[Yi]=await Promise.all([new Response(yn.readable).arrayBuffer(),k.getData(yn,Je,t.readRanges,Yt)]);return Yi},v=O;const{onprogress:li}=e;if(li)try{await li(T+1,y,new Nu(k))}catch{}yield Je}const M=nt(t,e,xw),w=nt(t,e,Iw);return M&&(t.prependedData=A>0?await it(n,0,A):new Uint8Array),t.comment=h?await it(n,c+Sn,h):new Uint8Array,w&&(t.appendedData=u<n.size?await it(n,u,n.size-u):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class qw{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n,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,b=t.localDirectory={},C=await it(r,a,sl,l),S=Te(C);let x=nt(o,s,Sw),I=nt(o,s,Mw);const M=nt(o,s,Tw);if(x=x&&x.length&&x,I=I&&I.length&&I,c&&c.originalCompressionMethod!=Gv)throw new Error(Lu);if(u!=Ov&&u!=Fv&&u!=Bh&&!M)throw new Error(Lu);if(Me(S,0)!=Uv)throw new Error(Vw);Gu(b,S,4);const{extraFieldLength:w,filenameLength:T,lastAccessDate:k,creationDate:R}=b;b.rawExtraField=w?await it(r,a+sl+T,w,l):new Uint8Array,Uu(o,b,S,4,!0),Object.assign(t,{lastAccessDate:k,creationDate:R});const G=o.encrypted&&b.encrypted&&!M,L=G&&!c;if(M||(t.zipCrypto=L),G){if(!L&&c.strength===Se)throw new Error(Hw);if(!x&&!I)throw new Error(zw)}const N=a+sl+T+w,E=A,B=r.readable;Object.assign(B,{diskNumberStart:l,offset:N,size:E});const D=nt(o,s,Bw),F=nt(o,s,_w);let V=nt(o,s,Pw);const O=nt(o,s,kw);O&&(V=!0);const{onstart:P,onprogress:_,onend:U}=s,H=u==Bh;let X=nt(o,s,Lw);H&&(X=!1);const q={options:{codecType:uu,password:x,rawPassword:I,zipCrypto:L,encryptionStrength:c&&c.strength,signed:nt(o,s,Dw)&&!M,passwordVerification:L&&(v?y>>>8&Za:m>>>24&Za),outputSize:M?A:g,signature:m,compressed:u!=0&&!M,encrypted:o.encrypted&&!M,useWebWorkers:nt(o,s,Nw),useCompressionStream:X,transferStreams:nt(o,s,Rw),deflate64:H,checkPasswordOnly:F},config:p,streamOptions:{signal:D,size:E,onstart:P,onprogress:_,onend:U}};V&&await eC({reader:r,fileEntry:t,offset:a,diskNumberStart:l,signature:m,compressedSize:A,uncompressedSize:g,dataOffset:N,dataDescriptor:v||b.bitFlag.dataDescriptor,extraFieldZip64:h||b.extraFieldZip64,readRanges:n});let fe;try{if(!O){F&&(e=new WritableStream),e=new gw(e),await ir(e,M?A:g),{writable:fe}=e;const{outputSize:de}=await aw({readable:B,writable:fe},q);if(e.size+=de,de!=(M?A:g))throw new Error(au)}}catch(de){if(de.outputSize!==Se&&(e.size+=de.outputSize),!F||de.message!=ol)throw de}finally{!nt(o,s,Fw)&&fe&&!fe.locked&&await fe.getWriter().close()}return F||O?Se:e.getData?e.getData():fe}}function Gu(i,e,t){const n=i.rawBitFlag=Ze(e,t+2),s=(n&Nh)==Nh,o=Me(e,t+6);Object.assign(i,{encrypted:s,version:Ze(e,t),bitFlag:{level:(n&ib)>>1,dataDescriptor:(n&Lh)==Lh,languageEncodingFlag:(n&Rh)==Rh},rawLastModDate:o,lastModDate:iC(o),filenameLength:Ze(e,t+22),extraFieldLength:Ze(e,t+24)})}function Uu(i,e,t,n,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),b=Ze(a,l+2);r.set(v,{type:v,data:o.slice(l+4,l+4+b)}),l+=4+b}}catch{}const c=Ze(t,n+4);Object.assign(e,{signature:Me(t,n+fb),compressedSize:Me(t,n+pb),uncompressedSize:Me(t,n+mb)});const h=r.get($v);h&&(Kw(h,e),e.extraFieldZip64=h);const u=r.get(Xv);u&&(Vu(u,Eu,xu,e,i),e.extraFieldUnicodePath=u);const p=r.get(Jv);p&&(Vu(p,Iu,Su,e,i),e.extraFieldUnicodeComment=p);const f=r.get(jv);f?(Xw(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const m=r.get(Wv);m&&(Jw(m,e),e.extraFieldNTFS=m);const y=r.get(tb);if(y)Qu(y,e,!1),e.extraFieldUnix=y;else{const v=r.get(eb);v&&(Qu(v,e,!0),e.extraFieldInfoZip=v)}const g=r.get(Kv);g&&(Zw(g,e,s),e.extraFieldExtendedTimestamp=g);const A=r.get(Zv);A&&(e.extraFieldUSDZ=A)}function Kw(i,e){e.zip64=!0;const t=Te(i.data),n=jw.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<n.length;s++){const[r,a]=n[s];if(e[r]==a){const l=Ww[a];e[r]=i[r]=l.getValue(t,o),o+=l.bytes}else if(i[r])throw new Error(Qw)}}function Vu(i,e,t,n,s){const o=Te(i.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(i,{version:Ii(o,0),[e]:nr(i.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&l==Me(a,0)}),i.valid&&(n[e]=i[e],n[e+$w]=!0)}function Xw(i,e,t){const n=Te(i.data),s=Ii(n,4);Object.assign(i,{vendorVersion:Ii(n,0),vendorId:Ii(n,2),strength:s,originalCompressionMethod:t,compressionMethod:Ze(n,5)}),e.compressionMethod=i.compressionMethod}function Jw(i,e){const t=Te(i.data);let n=4,s;try{for(;n<i.data.length&&!s;){const o=Ze(t,n),r=Ze(t,n+2);o==qv&&(s=i.data.slice(n+4,n+4+r)),n+=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(i,{rawLastModDate:r,rawLastAccessDate:a,rawCreationDate:l});const c=yl(r),h=yl(a),u=yl(l),p={lastModDate:c,lastAccessDate:h,creationDate:u};Object.assign(i,p),Object.assign(e,p)}}catch{}}function Qu(i,e,t){try{const n=Te(new Uint8Array(i.data));let s=0;const o=Ii(n,s++),r=Ii(n,s++),a=i.data.subarray(s,s+r);s+=r;const l=zu(a),c=Ii(n,s++),h=i.data.subarray(s,s+c);s+=c;const u=zu(h);let p=Se;if(!t&&s+2<=i.data.length){const f=i.data;p=new DataView(f.buffer,f.byteOffset+s,2).getUint16(0,!0)}Object.assign(i,{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 zu(i){const e=new Uint8Array(4);return e.set(i,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Zw(i,e,t){const n=Te(i.data),s=Ii(n,0),o=[],r=[];t?((s&1)==1&&(o.push(fl),r.push(pl)),(s&2)==2&&(o.push(ku),r.push(vw)),(s&4)==4&&(o.push(Pu),r.push(Du))):i.data.length>=5&&(o.push(fl),r.push(pl));let a=1;o.forEach((l,c)=>{if(i.data.length>=a+4){const h=Me(n,a);e[l]=i[l]=new Date(h*1e3);const u=r[c];i[u]=h}a+=4})}async function eC({reader:i,fileEntry:e,offset:t,diskNumberStart:n,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:a,dataDescriptor:l,extraFieldZip64:c,readRanges:h}){let u=0;if(n)for(let m=0;m<n;m++){const y=i.readers[m];u+=y.size}let p=0;if(l&&(c?p=Yv:p=Hv),p){const m=await it(i,a+o,p+Dh,n);if(Me(Te(m),0)==Vv){const g=Me(Te(m),4);let A,v;c?(A=Tn(Te(m),8),v=Tn(Te(m),16)):(A=Me(Te(m),8),v=Me(Te(m),12)),(e.encrypted&&!e.zipCrypto||g==s)&&A==o&&v==r&&(p+=Dh)}}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(Yw);throw y.overlappingEntry=m.fileEntry,y}h.push(f)}async function tC(i,e,t,n,s){const o=new Uint8Array(4),r=Te(o);nC(r,0,e);const a=n+s;return await l(n)||await l(Math.min(a,t));async function l(c){const h=t-c,u=await it(i,h,c);for(let p=u.length-n;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+n).buffer}}}function nt(i,e,t){return e[t]===Se?i.options[t]:e[t]}function iC(i){const e=(i&4294901760)>>16,t=i&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 yl(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function Ii(i,e){return i.getUint8(e)}function Ze(i,e){return i.getUint16(e,!0)}function Me(i,e){return i.getUint32(e,!0)}function Tn(i,e){return Number(i.getBigUint64(e,!0))}function nC(i,e,t){i.setUint32(e,t,!0)}function Te(i){return new DataView(i.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 It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function sC(i){let e;i({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=It.indexOf(r[c])<<18|It.indexOf(r[c+1])<<12|(63&It.indexOf(r[c+2]))<<6|63&It.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 n=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++)n[s++]=n[h+u]}else{const l=a;o(s+l);for(let c=0;l>c&&r<t.length;c++)n[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+=It[u>>18&63]+It[u>>12&63]+It[u>>6&63]+It[63&u]}const h=l-c;if(h===1){const u=r[c]<<16;a+=It[u>>18&63]+It[u>>12&63]+"=="}else if(h===2){const u=r[c]<<16|r[c+1]<<8;a+=It[u>>18&63]+It[u>>12&63]+It[u>>6&63]+"="}return a})(new Uint8Array(n.buffer.slice(0,s)));function o(r){if(n.length<r){let a=2*n.length;for(;r>a;)a*=2;const l=new Uint8Array(a);l.set(n.subarray(0,s)),n=l}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdiIAdiIBQQNxBIEAMgYBQX9zQQGAAB8GaiICQQN0gAAZDMwnaiIAIAEoAtQnIoAABgQIIgVGggBSCSADQX4gAndxNoACphEBCyAFIAA2AgwgACAFNgIIC4AASAMIaiGAADcBIIIARoAABQR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AABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Fe,Bn,St,Bs;function oC(i){if(Fe=i,{malloc:Bn,free:St,memory:Bs}=Fe,typeof Bn!="function"||typeof St!="function"||!Bs)throw Fe=Bn=St=Bs=null,new Error("Invalid WASM module")}function Hu(i,e,t={}){const n=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=Bn(s),this.in=Bn(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),i?(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,n):e==="deflate-raw"?r=Fe.deflate_init_raw(this.streamHandle,n):r=Fe.deflate_init(this.streamHandle,n)):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&&St&&St(this.in),this.in=Bn(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))),!i){const b=g>>24&255,C=b&128?b-256:b;if(C<0)throw new Error("process error:"+C)}const v=u(this.streamHandle);if(v===0)break;m+=v}}catch(l){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&St&&St(this.in),this.out&&St&&St(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(!i){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&&St&&St(this.in),this.out&&St&&St(this.out)}}})}class rC{constructor(e="deflate",t){return Hu(!0,e,t)}}class aC{constructor(e="deflate",t){return Hu(!1,e,t)}}let Yu=!1;async function lC(i,{baseURI:e}){if(!Yu){let t,n;try{try{n=new URL(i,e)}catch{}t=await(await fetch(n)).arrayBuffer()}catch(o){if(i.startsWith("data:application/wasm;base64,"))t=cC(i);else throw o}const s=await WebAssembly.instantiate(t);oC(s.instance.exports),Yu=!0}}function cC(i){const e=i.split(",")[1],t=atob(e),n=t.length,s=new Uint8Array(n);for(let o=0;o<n;++o)s[o]=t.charCodeAt(o);return s.buffer}let Al;sC(Ko),Zb({initModule:i=>{if(!Al){let{wasmURI:e}=i;typeof e==Ki&&(e=e()),Al=lC(e,i)}return Al}}),Ko({CompressionStreamZlib:rC,DecompressionStreamZlib:aC});const vl={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 i={};for(const e of Object.keys(vl))for(const t of Object.keys(vl[e])){const n=vl[e][t];if(typeof n=="string")i[n]=e+"/"+t;else for(let s=0;s<n.length;s++)i[n[s]]=e+"/"+t}return i})(),bb(Ko);const dC="E84#E3C4!8C4&A1",$u=["E84#E3C4!8C4&A1123*@!"];async function Mt(i){try{const e=await fetch(i);if(!e.ok)return!1;const t=await e.blob();try{const n=new gl(new tr(t),{password:dC}),o=(await n.getEntries()).find(a=>!a.directory&&a.filename.endsWith(".json"));if(!o)return await n.close(),!1;const r=await o.getData(new fw);return await n.close(),JSON.parse(r.trim())}catch{const n=await t.text();try{return JSON.parse(n.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${i}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${i} ${e}`),!1}}function hC(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i==="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(n=>n(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(n=>n!==t))}}const ju="35aa3175ce8b1a55331e.64c93d5e3268979d98c900",bl=new Map;function sr(i){let e=null;if(typeof i=="string")e=document.querySelector(i);else if(i instanceof HTMLElement)e=i;else if(i&&typeof i=="object"){const n=i.container??i;n instanceof HTMLElement&&(e=n)}if(!e)return;const t=bl.get(e);if(t){try{t.destroy?.()}catch{}bl.delete(e)}}async function Wu(i,e){if(i)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}sr(t);const{Watermark:n}=await Promise.resolve().then(()=>wR),s=new n({content:i.content||"晨曦雷霆BIM",fontFamily:i.font||"Arial, sans-serif",fontSize:i.fontSize?`${i.fontSize}px`:"25px",fontWeight:i.fontWeight||"bold",rotate:i.rotate??0,fontColor:i.color||"rgba(225, 225, 225, 1.0)",zIndex:i.zIndex??99999,parent:t,backgroundRepeat:"no-repeat",backgroundPosition:"center"});await s.create(),bl.set(t,s),console.log("水印已添加")}catch(t){console.error("添加水印出错:",t)}}class qu{cesium;viewer;watermarkEnabled="";setWatermarkEnabled(e){this.watermarkEnabled=e}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 n=this.mapTileset[t];n&&(this.viewer.scene.primitives.remove(n),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:n})=>{const s=this.mapTileset[n];s&&(this.viewer.scene.primitives.remove(s),t.push(n)),delete this.mapTileset[n],delete this.hasLoaded3dTiles[n],delete this.mapRecordModelId[n]}),this.modelList=this.modelList.filter(n=>!t.includes(n.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(n=>{const s=`${n.modelId}`,o=this.mapTileset[s];o&&(o.show=!!n.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:n}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,n)}async add3DTilesModel(e,t){const n=t?Rv({},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:In.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(n)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===In.NotLoaded);if(!t.length)return;const n=t.length;this.events.emit("loadingStatus",`正在加载 ${n} 个模型`);let s=0,o=!1;if(t.length>0){const r=t[0],a=`${r.outPutPath}${r.dbName}/config.zip`;try{const l=await Mt(a);l&&typeof l=="object"&&this.events.emit("configureLoaded",l)}catch{}}for(const r of t){s++;try{r.state=In.Loading;const a=r.url,l=this.getBaseUrlPath(a);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}构件信息`);let c=e.loadTreeNodeDetails?await Mt(`${l}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await Mt(`${l}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}模型数据`);const u=e.boxRegionUrl?await Mt(`${l}${e.boxRegionUrl}`):!1,p=e.batchIDInfoUrl?await Mt(`${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 Mt(`${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,Ja({Cesium:this.cesium,tileset:f}),r.state=In.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=In.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 n=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,h=/^(https?|atom):\/\//i.test(a)?a:`${window.location.origin}${a}`,u=`${h}${l}/tileset.json`,p=await n.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=await Mt(`${h}${l}${this.options.regionUrl}`);if(f)r.formData={modelId:r.modelId.toString(),longitude:f.Longitude??f.longitude,latitude:f.Latitude??f.latitude,distance:1e-5,rotation:0,totalRotation:f.DAngle??f.totalRotation??0,heightDistance:1,height:f.MinHeight??f.height??0,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:f?.X||0,Y:f?.Y||0,Z:f?.Z||0};else{const m=p.root.computedTransform;if(m){const y=n.Matrix4.fromColumnMajorArray(m),g=n.Matrix4.getTranslation(y,new n.Cartesian3),A=n.Ellipsoid.WGS84.cartesianToCartographic(g),v=n.Math.toDegrees(A.longitude),b=n.Math.toDegrees(A.latitude),C=A.height;r.formData={modelId:r.modelId.toString(),longitude:v,latitude:b,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},Ja({Cesium:this.cesium,tileset:p}),this.modelList.push({...r,url:u,state:In.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:n,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=n||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)}async 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=this.modelList.find(h=>h.modelId===e);if(l)try{const h=`${l.outPutPath}${l.dbName}/cameraView.zip`,u=await Mt(h);if(u&&u.position&&u.orientation){const p=new this.cesium.Cartesian3(u.position.x,u.position.y,u.position.z),f=new this.cesium.HeadingPitchRoll(u.orientation.heading,u.orientation.pitch,u.orientation.roll);this.viewer.camera.flyTo({destination:p,orientation:f,duration:u.duration??1}),o&&o();return}}catch(h){console.warn("[flyToTileset] 读取 cameraView.zip 失败,回退到默认视角",h)}const c={duration:0,...a};this.viewer.flyTo(s,c).then(h=>{h?o&&o():r&&r()}).catch(h=>{r&&r(),console.error("FlyTo error",h)})}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}`,n=t.lastIndexOf("/");return n===-1?".":t.substr(0,n)}async loadTilesetWithZipSupport(e,t,n,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`),a=(await fetch(o,{method:"HEAD"})).status===200;if(sr(this.viewer?.container),a){const l=await Mt(o);if(l){l?.asset?.watermark&&Wu(l.asset.watermark,this.viewer?.container),$u.includes(this.watermarkEnabled)&&sr(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,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const n=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${n} 目录树...`);try{if(s){const r=await Mt(s);if(Ho(r)&&r[0].name&&(r[0].name=n),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 n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Mt(n);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 n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Mt(n);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 Ku={normal:0,process:2},uC={color:1};function Xu(i){return i===1||i==="exist"?1:i===2||i==="process"?2:0}function _n(i){return Number.isNaN(i)?0:i<=1?Math.min(Math.max(i,0),1):Math.min(Math.max(i/255,0),1)}function Ju(i){return Number.isNaN(i)?1:i<=1?Math.min(Math.max(i,0),1):1}function wl(i){if(!i)return null;const e=Number(i.r),t=Number(i.g),n=Number(i.b),s=i.a===void 0?1:Number(i.a);if([e,t,n,s].some(l=>Number.isNaN(l)))return null;const o=Math.round(e*255),r=Math.round(t*255),a=Math.round(n*255);return`rgba(${o},${r},${a},${s})`}function fC(i){if(!i||typeof i!="string")return null;const t=i.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const n=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[n,s,o,r].some(a=>Number.isNaN(a))?null:{r:Math.min(Math.max(n/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 pC(i){if(i==null)return null;const e=Number(i);return Number.isNaN(e)?null:e}function mC(i){const e=i.lastIndexOf("-"),t=i.substring(0,e),n=i.substring(e+1);return[t,n]}function Cl(i){if(!i)return null;const e=i.Min??i.min,t=i.Max??i.max;if(!e||!t)return null;const n=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[n,s,o,r,a,l].some(c=>Number.isNaN(c))?null:{min:{x:n,y:s,z:o},max:{x:r,y:a,z:l}}}function ks(i,e){if(e)return`${e}`;const t=i?.leiting?.model?.modelId??i?.modelId??i?.id;return t==null?null:`${t}`}function gC(i,e){if(e==null)return null;const t=i?.leiting?.node;if(!t)return null;const n=`${e}`,s=t?.[n],o=Cl(s?.box3??s?.box);if(o)return o;const r=t?.element?.[n]??t?.elements?.[n]??t?.nodeExtras?.element?.[n]??t?.nodeExtras?.elements?.[n];return Cl(r?.box3??r?.box)}function yC(i){const e=i?.leiting?.box;return e?Cl({min:e.min,max:e.max}):null}class AC{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,n,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=n[c];u?u.push(l[0]):n[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=n[h];u?u.push(l[0]):n[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,n={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,n,.1)});const s=Object.entries(n);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:n,modelId:s,rgba:o}=t;if(Array.isArray(n)&&n[0]){n[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(n[0]):this.base.groupBatchIds[s]=[n[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:n}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:n,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 n=Object.entries(t);n.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),n.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(n=>{const{batchIds:s,modelId:o,rgba:r}=n;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,n])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:n})}),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(n=>{const s=[];n.cpts.forEach(l=>{s.push({dbName:n.linkModelId,modelId:n.modelId,elementId:`${l}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=Ku.process,r=uC.color,{allElements:a}=this.base.groupByModelId(s);this.base.mapAnimations[n.modelId]=this.base.mapAnimations[n.modelId]||[],this.base.mapAnimations[n.modelId].push(t),Object.entries(a).forEach(([l,c])=>{const[h,u]=mC(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 vC{base;constructor(e){this.base=e}attachTileset(e,t,n){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=ks(e,n);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 n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=ks(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);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),n.tileset.leiting?.selectedFn)if(n.tileset.leiting.node){const h=n.tileset.leiting.node.batchIdEIDInfos[o].elementID,u=n.tileset.leiting.node.nodeExtras.element[h];u.elementId=h,u.modelId=n.tileset.leiting.model.modelId,n.tileset.leiting.selectedFn({elementInfo:u,elementId:h,point:r,modelId:n.tileset.leiting.model.modelId,_propsData:u})}else n.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){const s=ks(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);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 n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:n.enableRotate,enableTilt:n.enableTilt,enableLook:n.enableLook},n.enableRotate=!1,n.enableTilt=!1,n.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 n=performance.now();if(n-this.base.lastDrawTime<20)return;this.base.lastDrawTime=n,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 n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState!==null&&(n.enableRotate=this.base.cameraControllerState.enableRotate,n.enableTilt=this.base.cameraControllerState.enableTilt,n.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 bC{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 AC(this),this.selectionModule=new vC(this)}attachTileset(e,t,n){this.selectionModule.attachTileset(e,t,n)}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(n=>{try{return this.loadNodeDetailsForModel(n)}catch(s){return console.error(`Error loading node details for model ${n}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(n=>{try{n(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),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,n=Xu(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(a=>{if(a.rank!==n)return;const l=fC(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,n,s=null){this.animationModule.processAnimation(e,t,n,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 n=this.tilesetMap[e];if(!n)return;const s=n?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?n.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):n.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 n=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=gC(c,l)||yC(c);if(!u)continue;const p=new n.Cartesian3(u.min.x,u.min.y,u.min.z),f=new n.Cartesian3(u.max.x,u.max.y,u.max.z),m=c?.root?.computedTransform??c?.modelMatrix;if(m){const y=n.Matrix4.multiplyByPoint(m,p,new n.Cartesian3),g=n.Matrix4.multiplyByPoint(m,f,new n.Cartesian3);o.push(y,g)}else o.push(p,f)}if(o.length){const r=n.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const a=this.viewer.scene.camera,l=new n.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(n=>{this.setColorStyle(n)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],n=this.hasSelectedFeaturesMap[e];if(!t||!n?.length)return;const s=new Map;n.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 n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.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(n=>{const s=this.showStateMap[n]||{batchIds:[],mode:"include"};this.showStateMap[n]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(n)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=_n(Number(e.r)),n=_n(Number(e.g)),s=_n(Number(e.b)),o=Ju(e.a===void 0?1:Number(e.a));return wl({r:t,g:n,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(n=>{const s=n?.modelId,o=n?.elementId;if(s==null||o===void 0||o===null)return;const r=n?.color??n?.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 n=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[n]){const l=this.eidToBatchIdMap[n].get(s);if(l!==void 0)return l}const r=this.tilesetMap[n]?.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[n]=l;const c=l.get(s);if(c!==void 0)return c}const a=pC(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 n=`${t.modelId}`;this.showStateMap[n]||(this.showStateMap[n]={batchIds:[],mode:"exclude"});const s=this.showStateMap[n];if(!t.show){const o=this.getBatchIds(t.elementId,n);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(n=>{const s=`${n.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${n.elementId}`)});for(const n of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(n);const o=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[n]={batchIds:[],mode:"exclude"};const r=t[n];if(r&&r.size>0){const a=[];for(const l of o)r.has(`${l.elementID}`)||a.push(`${l.batchId}`);this.showStateMap[n].batchIds=a;continue}this.showStateMap[n].batchIds=o.map(a=>a.batchId)}Object.keys(this.showStateMap).forEach(n=>{this.updateTilesetStyle(n)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const n of t)await this.loadNodeDetailsForModel(n),e?this.setShowStyle({modelId:n,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:n,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),n=[];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)||(n.push({elementId:m,modelId:s}),h.add(m))}})}),n}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const n=[];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)||(n.push({elementId:m,modelId:s}),h.add(m))}})}),n}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:n,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===Ku.normal&&!this.colorRankColor.includes(n)&&(this.colorRankColor=[n]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,n]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const n=new Map,s=t?.rank===void 0?"exist":t?.rank,o=Xu(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=wl(a?.rgba)||this.selectedColor;for(const p of h){const f=this.getBatchIds(p,c);if(f.length!==0){n.has(c)||n.set(c,[]);for(const m of f)n.get(c)?.push({batchId:m,selectedColor:u,rank:o,isTrigger:r})}}}for(const[a,l]of n){const c=this.mergeSelections(a,l);this.hasSelectedFeaturesMap[a]=c,this.setBaseStyle(a)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:n,rgba:s}=e,o=t?.isTrigger??!0;if(!n)return;await this.loadNodeDetailsForModel(n);const r=String(n),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 n=e.join("|");return n?t==="include"?[[`(regExp('^(${n})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${n})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,n,s=1){const o=_n(e),r=_n(t),a=_n(n),l=Ju(s),c=wl({r:o,g:r,b:a,a:l});c&&(this.selectedColor=c)}mergeSelections(e,t){const n=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>n.set(o.batchId,o)),t.forEach(o=>{const r=n.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&n.set(o.batchId,o)}),Array.from(n.values())}async toggleMultiSelect(e,t,n,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:n,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,n){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),b=new Set(A.filter(x=>x.rank===0).map(x=>x.batchId)),C=[];y.forEach(x=>{b.has(x)||C.push({batchId:x,selectedColor:n,rank:0,isTrigger:!0})});const S=A.filter(x=>x.rank===0);this.hasSelectedFeaturesMap[g]=[...v,...S,...C],this.setBaseStyle(g)}),await this.triggerSelectionChange()}}class wC{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,n=this.tilesetMap[e];if(!n||!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(n.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),n.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 n=["left","right","behind","front","top","down"];for(const s of n){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,n=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,n,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,n,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,n,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,n,-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,n=this.getNormalByType(e),s=t.Cartesian3.negate(n,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,n=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=n.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=n.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),n.screenSpaceCameraController.enableInputs=!1;const r=n.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=n.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),n.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],n=this.tilesetMap[e];if(t&&n&&!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(n.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 n=new e.Cartesian3;t.forEach(u=>e.Cartesian3.add(n,u,n)),this.boxCenter=e.Cartesian3.divideByScalar(n,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)],b=p.root.transform;v.forEach(C=>{f.push(e.Matrix4.multiplyByPoint(b,C,new e.Cartesian3))})}else if(y&&y.halfAxes){const g=y.center,A=y.halfAxes,v=e.Matrix3.getColumn(A,0,new e.Cartesian3),b=e.Matrix3.getColumn(A,1,new e.Cartesian3),C=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(b,S&2?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(C,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,b=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,A,new e.Cartesian3);s=Math.min(s,b.x-v),o=Math.max(o,b.x+v),r=Math.min(r,b.y-v),a=Math.max(a,b.y+v),l=Math.min(l,b.z-v),c=Math.max(c,b.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 n=this.tilesetMap[t];n&&(n.clippingPlanes&&(n.clippingPlanes.enabled=!1),n.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 El=performance.now();const CC=10;class EC{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:n,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"),n&&(this.modelInfo=Object.assign(this.modelInfo,n)),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 n=this.viewer.scene;let s;try{s=n.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,n=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(n)}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}),n=()=>{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?n():t.readyEvent.addEventListener(n),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;El=performance.now();const n=(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"||(n(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(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-El<CC)return;El=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 b=t.Cartesian3.distance(f,g.position);b-p>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),b-p<-.1&&b<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!g&&this.gravityTestByMove){const b=l(this.position,m),C=this.viewer.scene.pickFromRay(b,[this.model],1);if(C){const S=this.cesium.Cartesian3.distance(this.position,C.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 b=this.cesium.Cartesian3.distance(v,g.position);Math.abs(b-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-b)/Math.abs(a-b)*.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),b=new t.Ray(m,v);let C;try{C=this.viewer.scene.pickFromRay(b,void 0,1)}catch{}t.defined(C)&&C.primitive!==this.model&&C.position&&t.Cartesian3.distance(m,C.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,n=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(n,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,n])=>{if(!n)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);n.addEventListener("mousedown",s),n.addEventListener("mouseup",o),n.addEventListener("mouseleave",o),n.addEventListener("touchstart",r=>{r.preventDefault(),s()}),n.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{n.removeEventListener("mousedown",s),n.removeEventListener("mouseup",o),n.removeEventListener("mouseleave",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,n=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)&&(n.heading-=u*.003),n.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=n.direction,h=n.right,u=n.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),n.position=new e.Cartesian3(n.position.x+p,n.position.y+f,n.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:n}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),n!==void 0&&(this.transparentTest=n)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(n=>this.moveState[n]==!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 xC{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Ky(e),this.baseTiles=new qu(e),this.baseCompt=new bC(e),this.baseSection=new wC(e),this.basePlayer=new EC({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 IC{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,n=this.dxfModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n)}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(n=>n.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 n=this.dxfModelsList.find(s=>s.modelId===e);n&&(n.show=t)}showJsonByLayer({modelId:e,show:t,layers:n}){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(n)&&n.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 n=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new n.HeadingPitchRange(0,n.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 n=await t.blob(),s=new gl(new tr(n),{password:ju,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 n=this.getBaseUrlPath(e),s=encodeURI(`${n}/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(`${n}/${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 n=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==n)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!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;const u=await this.loadTilesetWithZipSupport(a,{allowPicking:!1,clampToTerrain:!0});if(u.maximumScreenSpaceError=0,this.renderGenAll!==n||(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!==n||(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,n=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(n),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(n=>{n.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(n=>n.modelId===e);if(t>-1){const n=this.dxfModelsList[t];this.viewer.scene.primitives.remove(n),n.destroy&&!n.isDestroyed()&&n.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 SC(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("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"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var Zi=1,en=2,kn=3,MC=4,xl=5,Zu=6378137,TC=6356752314e-3,ef=.0066943799901413165,Ps=484813681109536e-20,$=Math.PI/2,BC=.16666666666666666,_C=.04722222222222222,kC=.022156084656084655,K=1e-10,Oe=.017453292519943295,bt=57.29577951308232,Ae=Math.PI/4,Ds=Math.PI*2,Ge=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const PC={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 tf=/[\s_\-\/\(\)]/g;function Si(i,e){if(i[e])return i[e];for(var t=Object.keys(i),n=e.toLowerCase().replace(tf,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(tf,""),r===n)return i[o]}function Il(i){var e={},t=i.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},{}),n,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=Si(PC,a);l&&(e.to_meter=l.to_meter)},from_greenwich:function(a){e.from_greenwich=a*Oe},pm:function(a){var l=Si(wt,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(n in t)s=t[n],n in r?(o=r[n],typeof o=="function"?o(s):e[o]=s):e[n]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=i,e}class nf{static getId(e){const t=e.find(n=>Array.isArray(n)&&n[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 n=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:n,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let n;const s=t.match(/^\((.)\)$/);if(s){const c=s[1].toUpperCase();if(c==="E")n="east";else if(c==="N")n="north";else if(c==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${c}`)}else n=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:n,unit:l,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,n)=>(t.order||0)-(n.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 n=e.find(p=>Array.isArray(p)&&p[0]==="CS");n&&(t.coordinate_system={type:n[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 DC extends nf{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 NC extends nf{static convert(e,t={}){super.convert(e,t);const n=e.find(o=>Array.isArray(o)&&o[0]==="CS");n&&(t.coordinate_system={subtype:n[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 LC(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function RC(i){return(LC(i)==="2019"?NC:DC).convert(i)}function FC(i){const e=i.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,sf=2,of=3,or=4,rf=5,Sl=-1,OC=/\s/,GC=/[A-Za-z]/,UC=/[A-Za-z84_]/,rr=/[,\]]/,af=/[\d\.E\-\+]/;function hi(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ns}hi.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==or)for(;OC.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Ns:return this.neutral(i);case sf:return this.keyword(i);case or:return this.quoted(i);case rf:return this.afterquote(i);case of:return this.number(i);case Sl:return}},hi.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=or;return}if(rr.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},hi.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ns;return}if(i==="]"){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=Sl);return}},hi.prototype.number=function(i){if(af.test(i)){this.word+=i;return}if(rr.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},hi.prototype.quoted=function(i){if(i==='"'){this.state=rf;return}this.word+=i},hi.prototype.keyword=function(i){if(UC.test(i)){this.word+=i;return}if(i==="["){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(rr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},hi.prototype.neutral=function(i){if(GC.test(i)){this.word=i,this.state=sf;return}if(i==='"'){this.word="",this.state=or;return}if(af.test(i)){this.word=i,this.state=of;return}if(rr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},hi.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Sl)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function VC(i){var e=new hi(i);return e.output()}function Ml(i,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var n=e?{}:i,s=t.reduce(function(o,r){return Pn(r,o),o},n);e&&(i[e]=s)}function Pn(i,e){if(!Array.isArray(i)){e[i]=!0;return}var t=i.shift();if(t==="PARAMETER"&&(t=i.shift()),i.length===1){if(Array.isArray(i[0])){e[t]={},Pn(i[0],e[t]);return}e[t]=i[0];return}if(!i.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=i;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(i);return}Array.isArray(t)||(e[t]={});var n;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&Pn(i[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:i[0],a:i[1],rf:i[2]},i.length===4&&Pn(i[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":i[0]=["name",i[0]],Ml(e,t,i);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":i[0]=["name",i[0]],Ml(e,t,i),e[t].type=t;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return Pn(i,e[t]);return Ml(e,t,i)}}var QC=.017453292519943295;function Rt(i){return i*QC}function lf(i){const e=(i.projName||"").toLowerCase().replace(/_/g," ");!i.long0&&i.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(i.lat0=Rt(i.lat1>0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=Rt(i.lat0>0?90:-90),delete i.lat1)}function cf(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function df(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function hf(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=df(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-df(i.ellipsoid.semi_minor_axis))))}function ar(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(ar(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(t=>t.value)),e):(Object.keys(i).forEach(t=>{const n=i[t];if(n!==null)switch(t){case"name":if(e.srsCode)break;e.name=n,e.srsCode=n;break;case"type":n==="GeographicCRS"?e.projName="longlat":n==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(e.ellps=n.ellipsoid.name,hf(n,e)),n.prime_meridian&&(e.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=n.name,hf(n,e);break;case"prime_meridian":e.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(e.axis=n.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",n.unit){const{units:s,to_meter:o}=cf(n.unit);e.units=s,e.to_meter=o}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:o}=cf(n.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":n.authority&&n.code&&(e.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(e.projName=n.method.name),n.parameters&&n.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":n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),n.conversion_factor&&(e.to_meter=n.conversion_factor);break;case"base_crs":ar(n,e),e.datumCode=n.id?n.id.authority+"_"+n.id.code:n.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),lf(e),e)}var zC=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function HC(i,e){var t=e[0],n=e[1];!(t in i)&&n in i&&(i[t]=i[n],e.length===3&&(i[t]=e[2](i[t])))}function uf(i){for(var e=Object.keys(i),t=0,n=e.length;t<n;++t){var s=e[t];zC.indexOf(s)!==-1&&YC(i[s]),typeof i[s]=="object"&&uf(i[s])}}function YC(i){if(i.AUTHORITY){var e=Object.keys(i.AUTHORITY)[0];e&&e in i.AUTHORITY&&(i.title=e+":"+i.AUTHORITY[e])}if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var t="",n=0,s=i.AXIS.length;n<s;++n){var o=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][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&&(i.axis=t)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var r=i.GEOGCS;i.type==="GEOGCS"&&(r=i),r&&(r.DATUM?i.datumCode=r.DATUM.name.toLowerCase():i.datumCode=r.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),i.datumCode==="new_zealand_1949"&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode==="belge_1972"&&(i.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(i.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=r.DATUM.SPHEROID.a,i.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(i.datum_params=r.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a),i.rectified_grid_angle&&(i.rectified_grid_angle=Rt(i.rectified_grid_angle));function a(h){var u=i.to_meter||1;return h*u}var l=function(h){return HC(i,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),lf(i)}function lr(i){if(typeof i=="object")return ar(i);const e=FC(i);var t=VC(i);if(e==="WKT2"){const o=RC(t);return ar(o)}var n=t[0],s={};return Pn(t,s),uf(s),s[n]}function st(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?st[i]=Il(arguments[1]):st[i]=lr(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?st[i]=lr(arguments[1]):(st[i]=t,t||delete st[i])}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?st.apply(e,n):st(n)});if(typeof i=="string"){if(i in st)return st[i]}else"EPSG"in i?st["EPSG:"+i.EPSG]=i:"ESRI"in i?st["ESRI:"+i.ESRI]=i:"IAU2000"in i?st["IAU2000:"+i.IAU2000]=i:console.log(i);return}}SC(st);function $C(i){return typeof i=="string"}function jC(i){return i in st}function WC(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var qC=["3857","900913","3785","102113"];function KC(i){var e=Si(i,"authority");if(e){var t=Si(e,"epsg");return t&&qC.indexOf(t)>-1}}function XC(i){var e=Si(i,"extension");if(e)return Si(e,"proj4")}function JC(i){return i[0]==="+"}function ZC(i){if($C(i)){if(jC(i))return st[i];if(WC(i)){var e=lr(i);if(KC(e))return st["EPSG:3857"];var t=XC(e);return t?Il(t):e}if(JC(i))return Il(i)}else return"projName"in i?i:lr(i)}function ff(i,e){i=i||{};var t,n;if(!e)return i;for(n in e)t=e[n],t!==void 0&&(i[n]=t);return i}function Xt(i,e,t){var n=i*e;return t/Math.sqrt(1-n*n)}function Ls(i){return i<0?-1:1}function J(i,e){return e||Math.abs(i)<=Ge?i:i-Ls(i)*Ds}function Ft(i,e,t){var n=i*t,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*($-e))/n}function Rs(i,e){for(var t=.5*i,n,s,o=$-2*Math.atan(e),r=0;r<=15;r++)if(n=i*Math.sin(o),s=$-2*Math.atan(e*Math.pow((1-n)/(1+n),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function eE(){var i=this.b/this.a;this.es=1-i*i,"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=Xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function tE(i){var e=i.x,t=i.y;if(t*bt>90&&t*bt<-90&&e*bt>180&&e*bt<-180)return null;var n,s;if(Math.abs(Math.abs(t)-$)<=K)return null;if(this.sphere)n=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(Ae+.5*t));else{var o=Math.sin(t),r=Ft(this.e,t,o);n=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return i.x=n,i.y=s,i}function iE(i){var e=i.x-this.x0,t=i.y-this.y0,n,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 n=J(this.long0+e/(this.a*this.k0),this.over),i.x=n,i.y=s,i}var nE=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const sE={init:eE,forward:tE,inverse:iE,names:nE};function oE(){}function pf(i){return i}var mf=["longlat","identity"],rE=[sE,{init:oE,forward:pf,inverse:pf,names:mf}],tn={},Dn=[];function gf(i,e){var t=Dn.length;return i.names?(Dn[t]=i,i.names.forEach(function(n){tn[n.toLowerCase()]=t}),this):(console.log(e),!0)}function yf(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function aE(i){if(!i)return!1;var e=i.toLowerCase();if(typeof tn[e]<"u"&&Dn[tn[e]]||(e=yf(e),e in tn&&Dn[tn[e]]))return Dn[tn[e]]}function lE(){rE.forEach(gf)}const cE={start:lE,add:gf,get:aE};var Af={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 dE=Af.WGS84;function hE(i,e,t,n){var s=i*i,o=e*e,r=(s-o)/s,a=0;n?(i*=1-r*(BC+r*(_C+r*kC)),s=i*i,r=0):a=Math.sqrt(r);var l=(s-o)/o;return{es:r,e:a,ep2:l}}function uE(i,e,t,n,s){if(!i){var o=Si(Af,n);o||(o=dE),i=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)<K)&&(s=!0,e=i),{a:i,b:e,rf:t,sphere:s}}var cr={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 fE in cr){var Tl=cr[fE];Tl.datumName&&(cr[Tl.datumName]=Tl)}function pE(i,e,t,n,s,o,r){var a={};return i===void 0||i==="none"?a.datum_type=xl:a.datum_type=MC,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=Zi),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=en,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=kn,a.grids=r),a.a=t,a.b=n,a.es=s,a.ep2=o,a}var Bl={};function mE(i,e,t){return e instanceof ArrayBuffer?gE(i,e,t):{ready:yE(i,e)}}function gE(i,e,t){var n=!0;t!==void 0&&t.includeErrorFields===!1&&(n=!1);var s=new DataView(e),o=bE(s),r=wE(s,o),a=CE(s,r,o,n),l={header:r,subgrids:a};return Bl[i]=l,l}async function yE(i,e){for(var t=[],n=await e.getImageCount(),s=n-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(vf),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(vf),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 b=l[0]-1;b>=0;b--){var g=v*l[0]+b;y.push([-Mi(m[g]),Mi(f[g])])}t.push({del:h,lim:l,ll:[-u,p],cvs:y})}var A={header:{nSubgrids:n},subgrids:t};return Bl[i]=A,A}function AE(i){if(i===void 0)return null;var e=i.split(",");return e.map(vE)}function vE(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:Bl[i]||null,isNull:!1}}function vf(i){return i*Math.PI/180}function Mi(i){return i/3600*Math.PI/180}function bE(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function wE(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:_l(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function _l(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function CE(i,e,t,n){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var a=xE(i,s,t),l=IE(i,s,a,t,n),c=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);o.push({ll:[Mi(a.lowerLongitude),Mi(a.lowerLatitude)],del:[Mi(a.longitudeInterval),Mi(a.latitudeInterval)],lim:[c,h],count:a.gridNodeCount,cvs:EE(l)});var u=16;n===!1&&(u=8),s+=176+a.gridNodeCount*u}return o}function EE(i){return i.map(function(e){return[Mi(e.longitudeShift),Mi(e.latitudeShift)]})}function xE(i,e,t){return{name:_l(i,e+8,e+16).trim(),parent:_l(i,e+24,e+24+8).trim(),lowerLatitude:i.getFloat64(e+72,t),upperLatitude:i.getFloat64(e+88,t),lowerLongitude:i.getFloat64(e+104,t),upperLongitude:i.getFloat64(e+120,t),latitudeInterval:i.getFloat64(e+136,t),longitudeInterval:i.getFloat64(e+152,t),gridNodeCount:i.getInt32(e+168,t)}}function IE(i,e,t,n,s){var o=e+176,r=16;s===!1&&(r=8);for(var a=[],l=0;l<t.gridNodeCount;l++){var c={latitudeShift:i.getFloat32(o+l*r,n),longitudeShift:i.getFloat32(o+l*r+4,n)};s!==!1&&(c.latitudeAccuracy=i.getFloat32(o+l*r+8,n),c.longitudeAccuracy=i.getFloat32(o+l*r+12,n)),a.push(c)}return a}function Pt(i,e){if(!(this instanceof Pt))return new Pt(i);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=ZC(i);if(typeof t!="object"){e("Could not parse to valid json: "+i);return}var n=Pt.projections.get(t.projName);if(!n){e("Could not get projection name from: "+i);return}if(t.datumCode&&t.datumCode!=="none"){var s=Si(cr,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=uE(t.a,t.b,t.rf,t.ellps,t.sphere),r=hE(o.a,o.b,o.rf,t.R_A),a=AE(t.nadgrids),l=t.datum||pE(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,a);ff(this,t),ff(this,n),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=cE,Pt.projections.start();function SE(i,e){return i.datum_type!==e.datum_type||i.a!==e.a||Math.abs(i.es-e.es)>5e-11?!1:i.datum_type===Zi?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===en?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function bf(i,e,t){var n=i.x,s=i.y,o=i.z?i.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:i.z};if(s>$)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=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(n),y:(r+o)*c*Math.sin(n),z:(r*(1-e)+o)*a}}function wf(i,e,t,n){var s=1e-12,o=s*s,r=30,a,l,c,h,u,p,f,m,y,g,A,v,b,C=i.x,S=i.y,x=i.z?i.z:0,I,M,w;if(a=Math.sqrt(C*C+S*S),l=Math.sqrt(C*C+S*S+x*x),a/t<s){if(I=0,l/t<s)return M=$,w=-n,{x:i.x,y:i.y,z:i.z}}else I=Math.atan2(S,C);c=x/l,h=a/l,u=1/Math.sqrt(1-e*(2-e)*h*h),m=h*(1-e)*u,y=c*u,b=0;do b++,f=t/Math.sqrt(1-e*y*y),w=a*m+x*y-f*(1-e*y*y),p=e*f/(f+w),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&&b<r);return M=Math.atan(A/Math.abs(g)),{x:I,y:M,z:w}}function ME(i,e,t){if(e===Zi)return{x:i.x+t[0],y:i.y+t[1],z:i.z+t[2]};if(e===en){var n=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6];return{x:c*(i.x-l*i.y+a*i.z)+n,y:c*(l*i.x+i.y-r*i.z)+s,z:c*(-a*i.x+r*i.y+i.z)+o}}}function TE(i,e,t){if(e===Zi)return{x:i.x-t[0],y:i.y-t[1],z:i.z-t[2]};if(e===en){var n=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6],h=(i.x-n)/c,u=(i.y-s)/c,p=(i.z-o)/c;return{x:h+l*u-a*p,y:-l*h+u+r*p,z:a*h-r*u+p}}}function dr(i){return i===Zi||i===en}function BE(i,e,t){if(SE(i,e)||i.datum_type===xl||e.datum_type===xl)return t;var n=i.a,s=i.es;if(i.datum_type===kn){var o=Cf(i,!1,t);if(o!==0)return;n=Zu,s=ef}var r=e.a,a=e.b,l=e.es;if(e.datum_type===kn&&(r=Zu,a=TC,l=ef),s===l&&n===r&&!dr(i.datum_type)&&!dr(e.datum_type))return t;if(t=bf(t,s,n),dr(i.datum_type)&&(t=ME(t,i.datum_type,i.datum_params)),dr(e.datum_type)&&(t=TE(t,e.datum_type,e.datum_params)),t=wf(t,l,r,a),e.datum_type===kn){var c=Cf(e,!0,t);if(c!==0)return}return t}function Cf(i,e,t){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<i.grids.length;r++){var a=i.grids[r];if(o.push(a.name),a.isNull){s=n;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>n.y||f>n.x||g<n.y||y<n.x)&&(s=_E(n,e,u),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*bt+" "+n.y*bt+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function _E(i,e,t){var n={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return n;var s={x:i.x,y:i.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=J(s.x-Math.PI)+Math.PI;var o=Ef(s,t);if(e){if(isNaN(o.x))return n;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,a=1e-12,l,c;do{if(c=Ef(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."),n;n.x=J(o.x+t.ll[0]),n.y=o.y+t.ll[1]}else isNaN(o.x)||(n.x=i.x+o.x,n.y=i.y+o.y);return n}function Ef(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},n={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*n.x,y:t.y-1*n.y},o={x:Number.NaN,y:Number.NaN},r;if(n.x<0||n.x>=e.lim[0]||n.y<0||n.y>=e.lim[1])return o;r=n.y*e.lim[0]+n.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 xf(i,e,t){var n=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=n,"ew".indexOf(i.axis[l])!==-1?a="x":a="y"):l===1?(r=s,"ns".indexOf(i.axis[l])!==-1?a="y":a="x"):(r=o,a="z"),i.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 If(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function kE(i){Sf(i.x),Sf(i.y)}function Sf(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function PE(i,e){return(i.datum.datum_type===Zi||i.datum.datum_type===en||i.datum.datum_type===kn)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Zi||e.datum.datum_type===en||e.datum.datum_type===kn)&&i.datumCode!=="WGS84"}function hr(i,e,t,n){var s;Array.isArray(t)?t=If(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(kE(t),i.datum&&e.datum&&PE(i,e)&&(s=new Pt("WGS84"),t=hr(i,s,t,n),i=s),n&&i.axis!=="enu"&&(t=xf(i,!1,t)),i.projName==="longlat")t={x:t.x*Oe,y:t.y*Oe,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=BE(i.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})),n&&e.axis!=="enu"?xf(e,!0,t):(t&&!o&&delete t.z,t)}var Mf=Pt("WGS84");function kl(i,e,t,n){var s,o,r;return Array.isArray(t)?(s=hr(i,e,t,n)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.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=hr(i,e,t,n),r=Object.keys(t),r.length===2||r.forEach(function(a){if(typeof i.name<"u"&&i.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 ur(i){return i instanceof Pt?i:typeof i=="object"&&"oProj"in i?i.oProj:Pt(i)}function DE(i,e,t){var n,s,o=!1,r;return typeof e>"u"?(s=ur(i),n=Mf,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=ur(i),n=Mf,o=!0),n||(n=ur(i)),s||(s=ur(e)),t?kl(n,s,t):(r={forward:function(a,l){return kl(n,s,a,l)},inverse:function(a,l){return kl(s,n,a,l)}},o&&(r.oProj=s),r)}var Tf=6,Bf="AJSAJS",_f="AFAFAF",Nn=65,Ct=73,Dt=79,Fs=86,Os=90;const NE={forward:kf,inverse:LE,toPoint:Pf};function kf(i,e){return e=e||5,OE(RE({lat:i[1],lon:i[0]}),e)}function LE(i){var e=Dl(Lf(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Pf(i){var e=Dl(Lf(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Pl(i){return i*(Math.PI/180)}function Df(i){return 180*(i/Math.PI)}function RE(i){var e=i.lat,t=i.lon,n=6378137,s=.00669438,o=.9996,r,a,l,c,h,u,p,f=Pl(e),m=Pl(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=Pl(r),a=s/(1-s),l=n/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=n*((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:FE(e)}}function Dl(i){var e=i.northing,t=i.easting,n=i.zoneLetter,s=i.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,b=t-5e5,C=e;n<"N"&&(C-=1e7),g=(s-1)*6-180+3,l=a/(1-a),y=C/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=b/(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=Df(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+Df(x);var I;if(i.accuracy){var M=Dl({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});I={top:M.lat,right:M.lon,bottom:S,left:x}}else I={lat:S,lon:x};return I}function FE(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function OE(i,e){var t="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+GE(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+n.substr(n.length-5,e)}function GE(i,e,t){var n=Nf(t),s=Math.floor(i/1e5),o=Math.floor(e/1e5)%20;return UE(s,o,n)}function Nf(i){var e=i%Tf;return e===0&&(e=Tf),e}function UE(i,e,t){var n=t-1,s=Bf.charCodeAt(n),o=_f.charCodeAt(n),r=s+i-1,a=o+e,l=!1;r>Os&&(r=r-Os+Nn-1,l=!0),(r===Ct||s<Ct&&r>Ct||(r>Ct||s<Ct)&&l)&&r++,(r===Dt||s<Dt&&r>Dt||(r>Dt||s<Dt)&&l)&&(r++,r===Ct&&r++),r>Os&&(r=r-Os+Nn-1),a>Fs?(a=a-Fs+Nn-1,l=!0):l=!1,(a===Ct||o<Ct&&a>Ct||(a>Ct||o<Ct)&&l)&&a++,(a===Dt||o<Dt&&a>Dt||(a>Dt||o<Dt)&&l)&&(a++,a===Ct&&a++),a>Fs&&(a=a-Fs+Nn-1);var c=String.fromCharCode(r)+String.fromCharCode(a);return c}function Lf(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,n="",s,o=0;!/[A-Z]/.test(s=i.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,o++}var r=parseInt(n,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+i;var a=i.charAt(o++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+i;t=i.substring(o,o+=2);for(var l=Nf(r),c=VE(t.charAt(0),l),h=QE(t.charAt(1),l);h<zE(a);)h+=2e6;var u=e-o;if(u%2!==0)throw`MGRSPoint has to have an even number
13
+ `)),e)})}const Uh=[];for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;Uh[i]=e}class Xo{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let n=0,s=e.length|0;n<s;n++)t=t>>>8^Uh[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Vh extends TransformStream{constructor(){let e;const t=new Xo;super({transform(n,s){t.append(n),s.enqueue(n)},flush(){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}function wb(i){if(typeof TextEncoder==Ei){i=unescape(encodeURIComponent(i));const e=new Uint8Array(i.length);for(let t=0;t<e.length;t++)e[t]=i.charCodeAt(t);return e}else return new TextEncoder().encode(i)}const pt={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=pt.getPartial(t);return n===32?i.concat(e):pt._shiftRight(e,n,t|0,i.slice(0,i.length-1))},bitLength(i){const e=i.length;if(e===0)return 0;const t=i[e-1];return(e-1)*32+pt.getPartial(t)},clamp(i,e){if(i.length*32<e)return i;i=i.slice(0,Math.ceil(e/32));const t=i.length;return e=e&31,t>0&&e&&(i[t-1]=pt.partial(e,i[t-1]&2147483648>>e-1,1)),i},partial(i,e,t){return i===32?e:(t?e|0:e<<32-i)+i*1099511627776},getPartial(i){return Math.round(i/1099511627776)||32},_shiftRight(i,e,t,n){for(n===void 0&&(n=[]);e>=32;e-=32)n.push(t),t=0;if(e===0)return n.concat(i);for(let r=0;r<i.length;r++)n.push(t|i[r]>>>e),t=i[r]<<32-e;const s=i.length?i[i.length-1]:0,o=pt.getPartial(s);return n.push(pt.partial(e+o&31,e+o>32?t:n.pop(),1)),n}},Jo={bytes:{fromBits(i){const t=pt.bitLength(i)/8,n=new Uint8Array(t);let s;for(let o=0;o<t;o++)(o&3)===0&&(s=i[o/4]),n[o]=s>>>24,s<<=8;return n},toBits(i){const e=[];let t,n=0;for(t=0;t<i.length;t++)n=n<<8|i[t],(t&3)===3&&(e.push(n),n=0);return t&3&&e.push(pt.partial(8*(t&3),n)),e}}},Qh={};Qh.sha1=class{constructor(i){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],i?(e._h=i._h.slice(0),e._buffer=i._buffer.slice(0),e._length=i._length):e.reset()}reset(){const i=this;return i._h=i._init.slice(0),i._buffer=[],i._length=0,i}update(i){const e=this;typeof i=="string"&&(i=Jo.utf8String.toBits(i));const t=e._buffer=pt.concat(e._buffer,i),n=e._length,s=e._length=n+pt.bitLength(i);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+n-(e.blockSize+n&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 i=this;let e=i._buffer;const t=i._h;e=pt.concat(e,[pt.partial(1,1)]);for(let n=e.length+2;n&15;n++)e.push(0);for(e.push(Math.floor(i._length/4294967296)),e.push(i._length|0);e.length;)i._block(e.splice(0,16));return i.reset(),t}_f(i,e,t,n){if(i<=19)return e&t|~e&n;if(i<=39)return e^t^n;if(i<=59)return e&t|e&n|t&n;if(i<=79)return e^t^n}_S(i,e){return e<<i|e>>>32-i}_block(i){const e=this,t=e._h,n=Array(80);for(let c=0;c<16;c++)n[c]=i[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&&(n[c]=e._S(1,n[c-3]^n[c-8]^n[c-14]^n[c-16]));const h=e._S(5,s)+e._f(c,o,r,a)+l+n[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 zh={};zh.aes=class{constructor(i){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],n=e._tables[1],s=i.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=i.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]=n[0][t[h>>>24]]^n[1][t[h>>16&255]]^n[2][t[h>>8&255]]^n[3][t[h&255]]}}encrypt(i){return this._crypt(i,0)}decrypt(i){return this._crypt(i,1)}_precompute(){const i=this._tables[0],e=this._tables[1],t=i[4],n=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,n[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++)i[m][h]=f=f<<24^f>>>8,e[m][u]=p=p<<24^p>>>8}for(let h=0;h<5;h++)i[h]=i[h].slice(0),e[h]=e[h].slice(0)}_crypt(i,e){if(i.length!==4)throw new Error("invalid aes block size");const t=this._key[e],n=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=i[0]^t[0],p=i[e?3:1]^t[1],f=i[2]^t[2],m=i[e?1:3]^t[3],y=4,g,A,v;for(let b=0;b<n;b++)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 b=0;b<4;b++)s[e?3&-b:b]=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 Cb={getRandomValues(i){const e=new Uint32Array(i.buffer),t=n=>{let s=987654321;const o=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&o,n=18e3*(n&65535)+(n>>16)&o,(((s<<16)+n&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,s;n<i.length;n+=4){const o=t((s||Math.random())*4294967296);s=o()*987654071,e[n/4]=o()*4294967296|0}return i}},Hh={};Hh.ctrGladman=class{constructor(i,e){this._prf=i,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(i){return this.calculate(this._prf,i,this._iv)}incWord(i){if((i>>24&255)===255){let e=i>>16&255,t=i>>8&255,n=i&255;e===255?(e=0,t===255?(t=0,n===255?n=0:++n):++t):++e,i=0,i+=e<<16,i+=t<<8,i+=n}else i+=1<<24;return i}incCounter(i){(i[0]=this.incWord(i[0]))===0&&(i[1]=this.incWord(i[1]))}calculate(i,e,t){let n;if(!(n=e.length))return[];const s=pt.bitLength(e);for(let o=0;o<n;o+=4){this.incCounter(t);const r=i.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 Xi={importKey(i){return new Xi.hmacSha1(Jo.bytes.toBits(i))},pbkdf2(i,e,t,n){if(t=t||1e4,n<0||t<0)throw new Error("invalid params to pbkdf2");const s=(n>>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=i.encrypt(f.concat(e,[c])),a=1;a<t;a++)for(r=i.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,n/8)}};Xi.hmacSha1=class{constructor(i){const e=this,t=e._hash=Qh.sha1,n=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;i.length>s&&(i=new t().update(i).finalize());for(let o=0;o<s;o++)n[0][o]=i[o]^909522486,n[1][o]=i[o]^1549556828;e._baseHash[0].update(n[0]),e._baseHash[1].update(n[1]),e._resultHash=new t(e._baseHash[0])}reset(){const i=this;i._resultHash=new i._hash(i._baseHash[0]),i._updated=!1}update(i){const e=this;e._updated=!0,e._resultHash.update(i)}digest(){const i=this,e=i._resultHash.finalize(),t=new i._hash(i._baseHash[1]).update(e).finalize();return i.reset(),t}encrypt(i){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(i),this.digest(i)}};const Eb=typeof crypto!=Ei&&typeof crypto.getRandomValues==Ki,Yh="Invalid password",$h="Invalid signature",ol="zipjs-abort-check-password";function jh(i){return Eb?crypto.getRandomValues(i):Cb.getRandomValues(i)}const Mn=16,xb="raw",Wh={name:"PBKDF2"},Ib={name:"HMAC"},Sb="SHA-1",Mb=Object.assign({hash:Ib},Wh),rl=Object.assign({iterations:1e3,hash:{name:Sb}},Wh),Tb=["deriveBits"],Es=[8,12,16],xs=[16,24,32],xi=10,Bb=[0,0,0,0],Zo=typeof crypto!=Ei,Is=Zo&&crypto.subtle,qh=Zo&&typeof Is!=Ei,qt=Jo.bytes,_b=zh.aes,kb=Hh.ctrGladman,Pb=Xi.hmacSha1;let Kh=Zo&&qh&&typeof Is.importKey==Ki,Xh=Zo&&qh&&typeof Is.deriveBits==Ki;class Db extends TransformStream{constructor({password:e,rawPassword:t,signed:n,encryptionStrength:s,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:eu(e,t),signed:n,strength:s-1,pending:new Uint8Array})},async transform(r,a){const l=this,{password:c,strength:h,resolveReady:u,ready:p}=l;c?(await Lb(l,h,c,kt(r,0,Es[h]+2)),r=kt(r,Es[h]+2),o?a.error(new Error(ol)):u()):await p;const f=new Uint8Array(r.length-xi-(r.length-xi)%Mn);a.enqueue(Jh(l,r,f,0,xi,!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-xi),f=kt(h,h.length-xi);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,xi);for(let g=0;g<xi;g++)if(y[g]!=f[g])throw new Error($h)}r.enqueue(m)}}})}}class Nb extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:eu(e,t),strength:n-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 Rb(a,c,l),h()):await u;const f=new Uint8Array(p.length+o.length-o.length%Mn);f.set(p,0),r.enqueue(Jh(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,xi),o.enqueue(al(h,s.signature))}}}),s=this}}function Jh(i,e,t,n,s,o){const{ctr:r,hmac:a,pending:l}=i,c=e.length-s;l.length&&(e=al(l,e),t=Gb(t,c-c%Mn));let h;for(h=0;h<=c-Mn;h+=Mn){const u=Ms(qt,kt(e,h,h+Mn));o&&a.update(u);const p=r.update(u);o||a.update(p),t.set(Ss(qt,p),h+n)}return i.pending=kt(e,h),t}async function Lb(i,e,t,n){const s=await Zh(i,e,t,kt(n,0,Es[e])),o=kt(n,Es[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(Yh)}async function Rb(i,e,t){const n=jh(new Uint8Array(Es[e])),s=await Zh(i,e,t,n);return al(n,s)}async function Zh(i,e,t,n){i.password=null;const s=await Fb(xb,t,Mb,!1,Tb),o=await Ob(Object.assign({salt:n},rl),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(i,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new kb(new _b(a),Array.from(Bb)),hmac:new Pb(l)}),c}async function Fb(i,e,t,n,s){if(Kh)try{return await Is.importKey(i,e,t,n,s)}catch{return Kh=!1,Xi.importKey(e)}else return Xi.importKey(e)}async function Ob(i,e,t){if(Xh)try{return await Is.deriveBits(i,e,t)}catch{return Xh=!1,Xi.pbkdf2(e,i.salt,rl.iterations,t)}else return Xi.pbkdf2(e,i.salt,rl.iterations,t)}function eu(i,e){return e===Se?wb(i):e}function al(i,e){let t=i;return i.length+e.length&&(t=new Uint8Array(i.length+e.length),t.set(i,0),t.set(e,i.length)),t}function Gb(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function kt(i,e,t){return i.subarray(e,t)}function Ss(i,e){return i.fromBits(e)}function Ms(i,e){return i.toBits(e)}const Ts=12;class Ub extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),nu(this,e)},transform(s,o){const r=this;if(r.password){const a=tu(r,s.subarray(0,Ts));if(r.password=null,a.at(-1)!=r.passwordVerification)throw new Error(Yh);s=s.subarray(Ts)}n?o.error(new Error(ol)):o.enqueue(tu(r,s))}})}}class Vb extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),nu(this,e)},transform(n,s){const o=this;let r,a;if(o.password){o.password=null;const l=jh(new Uint8Array(Ts));l[Ts-1]=o.passwordVerification,r=new Uint8Array(n.length+l.length),r.set(iu(o,l),0),a=Ts}else r=new Uint8Array(n.length),a=0;r.set(iu(o,n),a),s.enqueue(r)}})}}function tu(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=su(i)^e[n],ll(i,t[n]);return t}function iu(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=su(i)^e[n],ll(i,e[n]);return t}function nu(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new Xo(t[0]),crcKey2:new Xo(t[2])});for(let n=0;n<e.length;n++)ll(i,e.charCodeAt(n))}function ll(i,e){let[t,n,s]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=ru(Math.imul(ru(n+ou(t)),134775813)+1),i.crcKey2.append([n>>>24]),s=~i.crcKey2.get(),i.keys=[t,n,s]}function su(i){const e=i.keys[2]|2;return ou(Math.imul(e,e^1)>>>8)}function ou(i){return i&255}function ru(i){return i&4294967295}const au="Invalid uncompressed size",Qb="deflate-raw",zb="deflate64-raw";class Hb extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:n,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 Vh,m=Kt(m,p)),o&&(m=cu(m,a,{level:h,chunkSize:t},s,n,s)),r&&(l?m=Kt(m,new Vb(e)):(f=new Nb(e),m=Kt(m,f))),lu(u,m,()=>{let y;r&&!l&&(y=f.signature),(!r||l)&&c&&(y=new DataView(p.value.buffer).getUint32(0)),u.signature=y})}}class Yb extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:n,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 Ub(e)):(f=new Db(e),m=Kt(m,f))),c&&(m=cu(m,h,{chunkSize:t,deflate64:u},s,n,s)),(!r||o)&&a&&(p=new Vh,m=Kt(m,p)),lu(this,m,()=>{if((!r||o)&&a){const y=new DataView(p.value.buffer);if(l!=y.getUint32(0,!1))throw new Error($h)}})}}function lu(i,e,t){e=Kt(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function cu(i,e,t,n,s,o){const r=e&&n?n:s||o,a=t.deflate64?zb:Qb;try{i=Kt(i,new r(a,t))}catch(l){if(e)if(s)i=Kt(i,new s(a,t));else if(o)i=Kt(i,new o(a,t));else throw l;else throw l}return i}function Kt(i,e){return i.pipeThrough(e)}const $b="message",jb="start",Wb="pull",du="data",qb="ack",hu="close",Kb="deflate",uu="inflate";class Xb extends TransformStream{constructor(e,t){super({});const n=this,{codecType:s}=e;let o;s.startsWith(Kb)?o=Hb:s.startsWith(uu)&&(o=Yb),n.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(n,{inputSize:r})}}),h=new TransformStream({transform(u,p){if(u&&u.length&&(p.enqueue(u),n.outputSize+=u.length,e.outputSize!==Se&&n.outputSize>e.outputSize))throw new Error(au)},flush(){const{signature:u}=a;Object.assign(n,{signature:u,inputSize:r})}});Object.defineProperty(n,"readable",{get(){return l.pipeThrough(c).pipeThrough(a).pipeThrough(h)}})}}class Jb extends TransformStream{constructor(e){let t;super({transform:n,flush(s){t&&t.length&&s.enqueue(t)}});function n(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)),n(s.slice(e),o)):t=s}}}let fu=typeof Worker!=Ei,pu=()=>{};function Zb({initModule:i}){pu=i}class cl{constructor(e,{readable:t,writable:n},{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 Jb(o.chunkSize)).pipeThrough(new ew(r),{signal:u}),writable:n,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&&fu?tw:mu)(e,o)}}class ew extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:s}){let o=0;super({async start(){e&&await dl(e,n)},async transform(r,a){o+=r.length,t&&await dl(t,o,n),a.enqueue(r)},async flush(){s&&await dl(s,o)}})}}async function dl(i,...e){try{await i(...e)}catch{}}function mu(i,e){return{run:()=>iw(i,e)}}function tw(i,e){const{baseURI:t,chunkSize:n}=e;let{wasmURI:s}=e;if(!i.interface){typeof s==Ki&&(s=s());let o;try{o=ow(i.workerURI,t,i)}catch{return fu=!1,mu(i,e)}Object.assign(i,{worker:o,interface:{run:()=>nw(i,{chunkSize:n,wasmURI:s,baseURI:t})}})}return i.interface}async function iw({options:i,readable:e,writable:t,onTaskFinished:n},s){let o;try{if(!i.useCompressionStream)try{await pu(s)}catch{i.useCompressionStream=!0}o=new Xb(i,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{n()}}async function nw(i,e){let t,n;const s=new Promise((u,p)=>{t=u,n=p});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:s});const{readable:o,options:r}=i,{writable:a,closed:l}=sw(i.writable),c=er({type:jb,options:r,config:e,readable:o,writable:a},i);c||Object.assign(i,{reader:o.getReader(),writer:a.getWriter()});const h=await s;return c||await a.getWriter().close(),await l,h}function sw(i){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const o=i.getWriter();await o.ready,await o.write(s),o.releaseLock()},close(){e()},abort(s){return i.getWriter().abort(s)}}),closed:t}}let gu=!0;function ow(i,e,t){const n={type:"module"};let s,o;if(typeof i==Ki&&(i=i()),i.startsWith("data:")||i.startsWith("blob:"))try{o=new Worker(i)}catch{o=new Worker(i,n)}else{try{s=new URL(i,e)}catch{s=i}o=new Worker(s,n)}return o.addEventListener($b,r=>rw(r,t)),o}function er(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:s}){try{const{value:o,readable:r,writable:a}=i,l=[];if(o&&(i.value=o,l.push(i.value.buffer)),s&&gu?(r&&l.push(r),a&&l.push(a)):i.readable=i.writable=null,l.length)try{return e.postMessage(i,l),!0}catch{gu=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(o){throw t&&t.releaseLock(),n(),o}}async function rw({data:i},e){const{type:t,value:n,messageId:s,result:o,error:r}=i,{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==Wb){const{value:f,done:m}=await a.read();er({type:du,value:f,done:m,messageId:s},e)}t==du&&(await l.ready,await l.write(new Uint8Array(n)),er({type:qb,messageId:s},e)),t==hu&&p(null,o)}}catch(f){er({type:hu,messageId:s},e),p(f)}function p(f,m){f?h(f):c(m),l&&l.releaseLock(),u()}}let Ji=[];const hl=[];let yu=0;async function aw(i,e){const{options:t,config:n}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:a,signed:l,encrypted:c}=t,{workerURI:h,maxWorkers:u}=n;e.transferStreams=s||s===Se;const p=!a&&!l&&!c&&!e.transferStreams;return e.useWebWorkers=!p&&(o||o===Se&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Se,t.useCompressionStream=r||r===Se&&n.useCompressionStream,(await f()).run();async function f(){const y=Ji.find(g=>!g.busy);if(y)return Au(y),new cl(y,i,e,m);if(Ji.length<u){const g={indexWorker:yu};return yu++,Ji.push(g),new cl(g,i,e,m)}else return new Promise(g=>hl.push({resolve:g,stream:i,workerOptions:e}))}function m(y){if(hl.length){const[{resolve:g,stream:A,workerOptions:v}]=hl.splice(0,1);g(new cl(y,A,v,m))}else y.worker?(Au(y),lw(y,e)):Ji=Ji.filter(g=>g!=y)}}function lw(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Ji=Ji.filter(s=>s!=i);try{await i.terminate()}catch{}},n))}function Au(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}const cw="Writer iterator completed too soon",dw="Content-Type",hw=64*1024,vu="writable";class ul{constructor(){this.size=0}init(){this.initialized=!0}}class bu extends ul{get readable(){const e=this,{chunkSize:t=hw}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:a}=n,{chunkOffset:l}=this,c=r===Se?t:Math.min(t,r-l),h=await it(e,o+l,c,a);s.enqueue(h),l+t>r||r===Se&&!h.length&&c?s.close():this.chunkOffset+=t}});return n}}class tr extends bu{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const n=this,s=e+t;let r=await(e||s<n.size?n.blob.slice(e,s):n.blob).arrayBuffer();return r.byteLength>t&&(r=r.slice(e,s)),new Uint8Array(r)}}class uw extends ul{constructor(e){super();const t=this,n=new TransformStream,s=[];e&&s.push([dw,e]),Object.defineProperty(t,vu,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:s}).blob()}getData(){return this.blob}}class fw extends uw{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,n=await super.getData();if(n.text&&t)return n.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(n,e)})}}}class pw extends bu{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(n,s)=>{await n.init(),s!=t.length-1&&(e.lastDiskOffset+=n.size),e.size+=n.size})),super.init()}async readUint8Array(e,t,n=0){const s=this,{readers:o}=this;let r,a=n;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 it(c,l,t);else{const u=h-l;r=new Uint8Array(t);const p=await it(c,l,u);r.set(p,0);const f=await s.readUint8Array(e+u,t-u,n);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 wu extends ul{constructor(e,t=4294967295){super();const n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,o,r;const a=new WritableStream({async write(h){const{availableSize:u}=n;if(r)h.length>=u?(await l(h.subarray(0,u)),await c(),n.diskOffset+=s.size,n.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(cw);s=p,s.size=0,s.maxSize&&(n.maxSize=s.maxSize),n.availableSize=n.maxSize,await ir(s),o=p.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await c()}});Object.defineProperty(n,vu,{get(){return a}});async function l(h){const u=h.length;u&&(await r.ready,await r.write(h),s.size+=u,n.size+=u,n.availableSize-=u)}async function c(){await r.close()}}}class mw{constructor(e){return Array.isArray(e)&&(e=new pw(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class gw{constructor(e){return e.writable===Se&&typeof e.next==Ki&&(e=new wu(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Se&&(e.size=0),e instanceof wu||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function ir(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function it(i,e,t,n){return i.readUint8Array(e,t,n)}const Cu="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),yw=Cu.length==256;function Aw(i){if(yw){let e="";for(let t=0;t<i.length;t++)e+=Cu[i[t]];return e}else return new TextDecoder().decode(i)}function nr(i,e){return e&&e.trim().toLowerCase()=="cp437"?Aw(i):new TextDecoder(e).decode(i)}const Eu="filename",xu="rawFilename",Iu="comment",Su="rawComment",Mu="uncompressedSize",Tu="compressedSize",Bu="offset",_u="diskNumberStart",fl="lastModDate",pl="rawLastModDate",ku="lastAccessDate",vw="rawLastAccessDate",Pu="creationDate",Du="rawCreationDate",bw=[Eu,xu,Mu,Tu,fl,pl,Iu,Su,ku,Pu,Du,Bu,_u,"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 Nu{constructor(e){bw.forEach(t=>this[t]=e[t])}}const ww="filenameEncoding",Cw="commentEncoding",Ew="decodeText",xw="extractPrependedData",Iw="extractAppendedData",Sw="password",Mw="rawPassword",Tw="passThrough",Bw="signal",_w="checkPasswordOnly",kw="checkOverlappingEntryOnly",Pw="checkOverlappingEntry",Dw="checkSignature",Nw="useWebWorkers",Lw="useCompressionStream",Rw="transferStreams",Fw="preventClose",ml="File format is not recognized",Ow="End of central directory not found",Gw="End of Zip64 central directory locator not found",Uw="Central directory header not found",Vw="Local file header not found",Qw="Zip64 extra field not found",zw="File contains encrypted entry",Hw="Encryption method not supported",Lu="Compression method not supported",Ru="Split zip file",Yw="Overlapping entry found",Fu="utf-8",$w="UTF8",Ou="cp437",jw=[[Mu,qi],[Tu,qi],[Bu,qi],[_u,Wt]],Ww={[Wt]:{getValue:Me,bytes:4},[qi]:{getValue:Tn,bytes:8}};class gl{constructor(e,t={}){Object.assign(this,{reader:new mw(e),options:t,config:Ab(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:s}=t;if(await ir(n),(n.size===Se||!n.readUint8Array)&&(n=new tr(await new Response(n.readable).blob()),await ir(n)),n.size<Sn)throw new Error(ml);n.chunkSize=vb(s);const o=await tC(n,Qv,n.size,Sn,Wt*16);if(!o){const T=await it(n,0,4),k=Te(T);throw Me(k)==_h?new Error(Ru):new Error(Ow)}const r=Te(o);let a=Me(r,12),l=Me(r,16);const c=o.offset,h=Ze(r,20),u=c+Sn+h;let p=Ze(r,4);const f=n.lastDiskNumber||0;let m=Ze(r,6),y=Ze(r,8),g=0,A=0;if(l==qi||a==qi||y==Wt||m==Wt){const T=await it(n,o.offset-el,el),k=Te(T);if(Me(k,0)==zv){l=Tn(k,8);let R=await it(n,l,tl,-1),G=Te(R);const L=o.offset-el-tl;if(Me(G,0)!=Ph&&l!=L){const N=l;l=L,l>N&&(g=l-N),R=await it(n,l,tl,-1),G=Te(R)}if(Me(G,0)!=Ph)throw new Error(Gw);p==Wt&&(p=Me(G,16)),m==Wt&&(m=Me(G,20)),y==Wt&&(y=Tn(G,32)),a==qi&&(a=Tn(G,40)),l-=a}}if(l>=n.size&&(g=n.size-l-a-Sn,l=n.size-a-Sn),f!=p)throw new Error(Ru);if(l<0)throw new Error(ml);let v=0,b=await it(n,l,a,m),C=Te(b);if(a){const T=o.offset-a;if(Me(C,v)!=kh&&l!=T){const k=l;l=T,l>k&&(g+=l-k),b=await it(n,l,a,m),C=Te(b)}}const S=o.offset-l-(n.lastDiskOffset||0);if(a!=S&&S>=0&&(a=S,b=await it(n,l,a,m),C=Te(b)),l<0||l>=n.size)throw new Error(ml);const x=nt(t,e,ww),I=nt(t,e,Cw);for(let T=0;T<y;T++){const k=new qw(n,s,t.options);if(Me(C,v)!=kh)throw new Error(Uw);Gu(k,C,v+6);const R=!!k.bitFlag.languageEncodingFlag,G=v+46,L=G+k.filenameLength,N=L+k.extraFieldLength,E=Ze(C,v+4),B=E>>8==0,D=E>>8==3,F=b.subarray(G,L),V=Ze(C,v+32),O=N+V,P=b.subarray(N,O),_=R,U=R,H=Me(C,v+38),X=H&Za,q={readOnly:!!(X&sb),hidden:!!(X&ob),system:!!(X&rb),directory:!!(X&nb),archive:!!(X&ab)},fe=Me(C,v+42)+g,de=nt(t,e,Ew)||nr,ge=_?Fu:x||Ou,be=U?Fu:I||Ou;let _e=de(F,ge);_e===Se&&(_e=nr(F,ge));let tt=de(P,be);tt===Se&&(tt=nr(P,be)),Object.assign(k,{versionMadeBy:E,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:V,offset:fe,diskNumberStart:Ze(C,v+34),internalFileAttributes:Ze(C,v+36),externalFileAttributes:H,msdosAttributesRaw:X,msdosAttributes:q,rawFilename:F,filenameUTF8:_,commentUTF8:U,rawExtraField:b.subarray(L,N),rawComment:P,filename:_e,comment:tt}),A=Math.max(fe,A),Uu(k,k,C,v+6);const Xe=k.externalFileAttributes>>16&Wt;k.unixMode===Se&&(Xe&(lb|nl|il))!=0&&(k.unixMode=Xe);const vt=!!(k.unixMode&cb),ct=!!(k.unixMode&db),Bt=!!(k.unixMode&hb),j=k.unixMode!==Se?(k.unixMode&nl)!=0:D&&(Xe&nl)!=0,Y=k.unixMode!==Se&&(k.unixMode&Fh)==il,ee=(Xe&Fh)==il;Object.assign(k,{setuid:vt,setgid:ct,sticky:Bt,unixExternalUpper:Xe,internalFileAttribute:k.internalFileAttributes,externalFileAttribute:k.externalFileAttributes,executable:j,directory:Y||ee||B&&q.directory||_e.endsWith(ub)&&!k.uncompressedSize,zipCrypto:k.encrypted&&!k.extraFieldAES});const Je=new Nu(k);Je.getData=(Yt,yn)=>k.getData(Yt,Je,t.readRanges,yn),Je.arrayBuffer=async Yt=>{const yn=new TransformStream,[Yi]=await Promise.all([new Response(yn.readable).arrayBuffer(),k.getData(yn,Je,t.readRanges,Yt)]);return Yi},v=O;const{onprogress:li}=e;if(li)try{await li(T+1,y,new Nu(k))}catch{}yield Je}const M=nt(t,e,xw),w=nt(t,e,Iw);return M&&(t.prependedData=A>0?await it(n,0,A):new Uint8Array),t.comment=h?await it(n,c+Sn,h):new Uint8Array,w&&(t.appendedData=u<n.size?await it(n,u,n.size-u):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class qw{constructor(e,t,n){Object.assign(this,{reader:e,config:t,options:n})}async getData(e,t,n,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,b=t.localDirectory={},C=await it(r,a,sl,l),S=Te(C);let x=nt(o,s,Sw),I=nt(o,s,Mw);const M=nt(o,s,Tw);if(x=x&&x.length&&x,I=I&&I.length&&I,c&&c.originalCompressionMethod!=Gv)throw new Error(Lu);if(u!=Ov&&u!=Fv&&u!=Bh&&!M)throw new Error(Lu);if(Me(S,0)!=Uv)throw new Error(Vw);Gu(b,S,4);const{extraFieldLength:w,filenameLength:T,lastAccessDate:k,creationDate:R}=b;b.rawExtraField=w?await it(r,a+sl+T,w,l):new Uint8Array,Uu(o,b,S,4,!0),Object.assign(t,{lastAccessDate:k,creationDate:R});const G=o.encrypted&&b.encrypted&&!M,L=G&&!c;if(M||(t.zipCrypto=L),G){if(!L&&c.strength===Se)throw new Error(Hw);if(!x&&!I)throw new Error(zw)}const N=a+sl+T+w,E=A,B=r.readable;Object.assign(B,{diskNumberStart:l,offset:N,size:E});const D=nt(o,s,Bw),F=nt(o,s,_w);let V=nt(o,s,Pw);const O=nt(o,s,kw);O&&(V=!0);const{onstart:P,onprogress:_,onend:U}=s,H=u==Bh;let X=nt(o,s,Lw);H&&(X=!1);const q={options:{codecType:uu,password:x,rawPassword:I,zipCrypto:L,encryptionStrength:c&&c.strength,signed:nt(o,s,Dw)&&!M,passwordVerification:L&&(v?y>>>8&Za:m>>>24&Za),outputSize:M?A:g,signature:m,compressed:u!=0&&!M,encrypted:o.encrypted&&!M,useWebWorkers:nt(o,s,Nw),useCompressionStream:X,transferStreams:nt(o,s,Rw),deflate64:H,checkPasswordOnly:F},config:p,streamOptions:{signal:D,size:E,onstart:P,onprogress:_,onend:U}};V&&await eC({reader:r,fileEntry:t,offset:a,diskNumberStart:l,signature:m,compressedSize:A,uncompressedSize:g,dataOffset:N,dataDescriptor:v||b.bitFlag.dataDescriptor,extraFieldZip64:h||b.extraFieldZip64,readRanges:n});let fe;try{if(!O){F&&(e=new WritableStream),e=new gw(e),await ir(e,M?A:g),{writable:fe}=e;const{outputSize:de}=await aw({readable:B,writable:fe},q);if(e.size+=de,de!=(M?A:g))throw new Error(au)}}catch(de){if(de.outputSize!==Se&&(e.size+=de.outputSize),!F||de.message!=ol)throw de}finally{!nt(o,s,Fw)&&fe&&!fe.locked&&await fe.getWriter().close()}return F||O?Se:e.getData?e.getData():fe}}function Gu(i,e,t){const n=i.rawBitFlag=Ze(e,t+2),s=(n&Nh)==Nh,o=Me(e,t+6);Object.assign(i,{encrypted:s,version:Ze(e,t),bitFlag:{level:(n&ib)>>1,dataDescriptor:(n&Lh)==Lh,languageEncodingFlag:(n&Rh)==Rh},rawLastModDate:o,lastModDate:iC(o),filenameLength:Ze(e,t+22),extraFieldLength:Ze(e,t+24)})}function Uu(i,e,t,n,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),b=Ze(a,l+2);r.set(v,{type:v,data:o.slice(l+4,l+4+b)}),l+=4+b}}catch{}const c=Ze(t,n+4);Object.assign(e,{signature:Me(t,n+fb),compressedSize:Me(t,n+pb),uncompressedSize:Me(t,n+mb)});const h=r.get($v);h&&(Kw(h,e),e.extraFieldZip64=h);const u=r.get(Xv);u&&(Vu(u,Eu,xu,e,i),e.extraFieldUnicodePath=u);const p=r.get(Jv);p&&(Vu(p,Iu,Su,e,i),e.extraFieldUnicodeComment=p);const f=r.get(jv);f?(Xw(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const m=r.get(Wv);m&&(Jw(m,e),e.extraFieldNTFS=m);const y=r.get(tb);if(y)Qu(y,e,!1),e.extraFieldUnix=y;else{const v=r.get(eb);v&&(Qu(v,e,!0),e.extraFieldInfoZip=v)}const g=r.get(Kv);g&&(Zw(g,e,s),e.extraFieldExtendedTimestamp=g);const A=r.get(Zv);A&&(e.extraFieldUSDZ=A)}function Kw(i,e){e.zip64=!0;const t=Te(i.data),n=jw.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<n.length;s++){const[r,a]=n[s];if(e[r]==a){const l=Ww[a];e[r]=i[r]=l.getValue(t,o),o+=l.bytes}else if(i[r])throw new Error(Qw)}}function Vu(i,e,t,n,s){const o=Te(i.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(i,{version:Ii(o,0),[e]:nr(i.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&l==Me(a,0)}),i.valid&&(n[e]=i[e],n[e+$w]=!0)}function Xw(i,e,t){const n=Te(i.data),s=Ii(n,4);Object.assign(i,{vendorVersion:Ii(n,0),vendorId:Ii(n,2),strength:s,originalCompressionMethod:t,compressionMethod:Ze(n,5)}),e.compressionMethod=i.compressionMethod}function Jw(i,e){const t=Te(i.data);let n=4,s;try{for(;n<i.data.length&&!s;){const o=Ze(t,n),r=Ze(t,n+2);o==qv&&(s=i.data.slice(n+4,n+4+r)),n+=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(i,{rawLastModDate:r,rawLastAccessDate:a,rawCreationDate:l});const c=yl(r),h=yl(a),u=yl(l),p={lastModDate:c,lastAccessDate:h,creationDate:u};Object.assign(i,p),Object.assign(e,p)}}catch{}}function Qu(i,e,t){try{const n=Te(new Uint8Array(i.data));let s=0;const o=Ii(n,s++),r=Ii(n,s++),a=i.data.subarray(s,s+r);s+=r;const l=zu(a),c=Ii(n,s++),h=i.data.subarray(s,s+c);s+=c;const u=zu(h);let p=Se;if(!t&&s+2<=i.data.length){const f=i.data;p=new DataView(f.buffer,f.byteOffset+s,2).getUint16(0,!0)}Object.assign(i,{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 zu(i){const e=new Uint8Array(4);return e.set(i,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Zw(i,e,t){const n=Te(i.data),s=Ii(n,0),o=[],r=[];t?((s&1)==1&&(o.push(fl),r.push(pl)),(s&2)==2&&(o.push(ku),r.push(vw)),(s&4)==4&&(o.push(Pu),r.push(Du))):i.data.length>=5&&(o.push(fl),r.push(pl));let a=1;o.forEach((l,c)=>{if(i.data.length>=a+4){const h=Me(n,a);e[l]=i[l]=new Date(h*1e3);const u=r[c];i[u]=h}a+=4})}async function eC({reader:i,fileEntry:e,offset:t,diskNumberStart:n,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:a,dataDescriptor:l,extraFieldZip64:c,readRanges:h}){let u=0;if(n)for(let m=0;m<n;m++){const y=i.readers[m];u+=y.size}let p=0;if(l&&(c?p=Yv:p=Hv),p){const m=await it(i,a+o,p+Dh,n);if(Me(Te(m),0)==Vv){const g=Me(Te(m),4);let A,v;c?(A=Tn(Te(m),8),v=Tn(Te(m),16)):(A=Me(Te(m),8),v=Me(Te(m),12)),(e.encrypted&&!e.zipCrypto||g==s)&&A==o&&v==r&&(p+=Dh)}}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(Yw);throw y.overlappingEntry=m.fileEntry,y}h.push(f)}async function tC(i,e,t,n,s){const o=new Uint8Array(4),r=Te(o);nC(r,0,e);const a=n+s;return await l(n)||await l(Math.min(a,t));async function l(c){const h=t-c,u=await it(i,h,c);for(let p=u.length-n;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+n).buffer}}}function nt(i,e,t){return e[t]===Se?i.options[t]:e[t]}function iC(i){const e=(i&4294901760)>>16,t=i&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 yl(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function Ii(i,e){return i.getUint8(e)}function Ze(i,e){return i.getUint16(e,!0)}function Me(i,e){return i.getUint32(e,!0)}function Tn(i,e){return Number(i.getBigUint64(e,!0))}function nC(i,e,t){i.setUint32(e,t,!0)}function Te(i){return new DataView(i.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 It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function sC(i){let e;i({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=It.indexOf(r[c])<<18|It.indexOf(r[c+1])<<12|(63&It.indexOf(r[c+2]))<<6|63&It.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 n=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++)n[s++]=n[h+u]}else{const l=a;o(s+l);for(let c=0;l>c&&r<t.length;c++)n[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+=It[u>>18&63]+It[u>>12&63]+It[u>>6&63]+It[63&u]}const h=l-c;if(h===1){const u=r[c]<<16;a+=It[u>>18&63]+It[u>>12&63]+"=="}else if(h===2){const u=r[c]<<16|r[c+1]<<8;a+=It[u>>18&63]+It[u>>12&63]+It[u>>6&63]+"="}return a})(new Uint8Array(n.buffer.slice(0,s)));function o(r){if(n.length<r){let a=2*n.length;for(;r>a;)a*=2;const l=new Uint8Array(a);l.set(n.subarray(0,s)),n=l}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZj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AABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Fe,Bn,St,Bs;function oC(i){if(Fe=i,{malloc:Bn,free:St,memory:Bs}=Fe,typeof Bn!="function"||typeof St!="function"||!Bs)throw Fe=Bn=St=Bs=null,new Error("Invalid WASM module")}function Hu(i,e,t={}){const n=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=Bn(s),this.in=Bn(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),i?(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,n):e==="deflate-raw"?r=Fe.deflate_init_raw(this.streamHandle,n):r=Fe.deflate_init(this.streamHandle,n)):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&&St&&St(this.in),this.in=Bn(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))),!i){const b=g>>24&255,C=b&128?b-256:b;if(C<0)throw new Error("process error:"+C)}const v=u(this.streamHandle);if(v===0)break;m+=v}}catch(l){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&St&&St(this.in),this.out&&St&&St(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(!i){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&&St&&St(this.in),this.out&&St&&St(this.out)}}})}class rC{constructor(e="deflate",t){return Hu(!0,e,t)}}class aC{constructor(e="deflate",t){return Hu(!1,e,t)}}let Yu=!1;async function lC(i,{baseURI:e}){if(!Yu){let t,n;try{try{n=new URL(i,e)}catch{}t=await(await fetch(n)).arrayBuffer()}catch(o){if(i.startsWith("data:application/wasm;base64,"))t=cC(i);else throw o}const s=await WebAssembly.instantiate(t);oC(s.instance.exports),Yu=!0}}function cC(i){const e=i.split(",")[1],t=atob(e),n=t.length,s=new Uint8Array(n);for(let o=0;o<n;++o)s[o]=t.charCodeAt(o);return s.buffer}let Al;sC(Ko),Zb({initModule:i=>{if(!Al){let{wasmURI:e}=i;typeof e==Ki&&(e=e()),Al=lC(e,i)}return Al}}),Ko({CompressionStreamZlib:rC,DecompressionStreamZlib:aC});const vl={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 i={};for(const e of Object.keys(vl))for(const t of Object.keys(vl[e])){const n=vl[e][t];if(typeof n=="string")i[n]=e+"/"+t;else for(let s=0;s<n.length;s++)i[n[s]]=e+"/"+t}return i})(),bb(Ko);const dC="E84#E3C4!8C4&A1",$u=["E84#E3C4!8C4&A1123*@!"];async function Mt(i){try{const e=await fetch(i);if(!e.ok)return!1;const t=await e.blob();try{const n=new gl(new tr(t),{password:dC}),o=(await n.getEntries()).find(a=>!a.directory&&a.filename.endsWith(".json"));if(!o)return await n.close(),!1;const r=await o.getData(new fw);return await n.close(),JSON.parse(r.trim())}catch{const n=await t.text();try{return JSON.parse(n.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${i}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${i} ${e}`),!1}}function hC(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i==="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(n=>n(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(n=>n!==t))}}const ju="35aa3175ce8b1a55331e.64c93d5e3268979d98c900",bl=new Map;function sr(i){let e=null;if(typeof i=="string")e=document.querySelector(i);else if(i instanceof HTMLElement)e=i;else if(i&&typeof i=="object"){const n=i.container??i;n instanceof HTMLElement&&(e=n)}if(!e)return;const t=bl.get(e);if(t){try{t.destroy?.()}catch{}bl.delete(e)}}async function Wu(i,e){if(i)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}sr(t);const{Watermark:n}=await Promise.resolve().then(()=>wR),s=new n({content:i.content||"晨曦雷霆BIM",fontFamily:i.font||"Arial, sans-serif",fontSize:i.fontSize?`${i.fontSize}px`:"25px",fontWeight:i.fontWeight||"bold",rotate:i.rotate??0,fontColor:i.color||"rgba(225, 225, 225, 1.0)",zIndex:i.zIndex??99999,parent:t,backgroundRepeat:"no-repeat",backgroundPosition:"center"});await s.create(),bl.set(t,s),console.log("水印已添加")}catch(t){console.error("添加水印出错:",t)}}class qu{cesium;viewer;watermarkEnabled="";setWatermarkEnabled(e){this.watermarkEnabled=e}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 n=this.mapTileset[t];n&&(this.viewer.scene.primitives.remove(n),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:n})=>{const s=this.mapTileset[n];s&&(this.viewer.scene.primitives.remove(s),t.push(n)),delete this.mapTileset[n],delete this.hasLoaded3dTiles[n],delete this.mapRecordModelId[n]}),this.modelList=this.modelList.filter(n=>!t.includes(n.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(n=>{const s=`${n.modelId}`,o=this.mapTileset[s];o&&(o.show=!!n.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:n}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,n)}async add3DTilesModel(e,t){const n=t?Rv({},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:In.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(n)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===In.NotLoaded);if(!t.length)return;const n=t.length;this.events.emit("loadingStatus",`正在加载 ${n} 个模型`);let s=0,o=!1;if(t.length>0){const r=t[0],a=`${r.outPutPath}${r.dbName}/config.zip`;try{const l=await Mt(a);l&&typeof l=="object"&&this.events.emit("configureLoaded",l)}catch{}}for(const r of t){s++;try{r.state=In.Loading;const a=r.url,l=this.getBaseUrlPath(a);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}构件信息`);let c=e.loadTreeNodeDetails?await Mt(`${l}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await Mt(`${l}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}模型数据`);const u=e.boxRegionUrl?await Mt(`${l}${e.boxRegionUrl}`):!1,p=e.batchIDInfoUrl?await Mt(`${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 Mt(`${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,Ja({Cesium:this.cesium,tileset:f}),r.state=In.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=In.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 n=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,h=/^(https?|atom):\/\//i.test(a)?a:`${window.location.origin}${a}`,u=`${h}${l}/tileset.json`,p=await n.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=await Mt(`${h}${l}${this.options.regionUrl}`);if(f)r.formData={modelId:r.modelId.toString(),longitude:f.Longitude??f.longitude,latitude:f.Latitude??f.latitude,distance:1e-5,rotation:0,totalRotation:f.DAngle??f.totalRotation??0,heightDistance:1,height:f.MinHeight??f.height??0,lonlat:1e-5,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:f?.X||0,Y:f?.Y||0,Z:f?.Z||0};else{const m=p.root.computedTransform;if(m){const y=n.Matrix4.fromColumnMajorArray(m),g=n.Matrix4.getTranslation(y,new n.Cartesian3),A=n.Ellipsoid.WGS84.cartesianToCartographic(g),v=n.Math.toDegrees(A.longitude),b=n.Math.toDegrees(A.latitude),C=A.height;r.formData={modelId:r.modelId.toString(),longitude:v,latitude:b,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},Ja({Cesium:this.cesium,tileset:p}),this.modelList.push({...r,url:u,state:In.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:n,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=n||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)}async 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=this.modelList.find(h=>h.modelId===e);if(l)try{const h=`${l.outPutPath}${l.dbName}/cameraView.zip`,u=await Mt(h);if(u&&u.position&&u.orientation){const p=new this.cesium.Cartesian3(u.position.x,u.position.y,u.position.z),f=new this.cesium.HeadingPitchRoll(u.orientation.heading,u.orientation.pitch,u.orientation.roll);this.viewer.camera.flyTo({destination:p,orientation:f,duration:u.duration??1}),o&&o();return}}catch(h){console.warn("[flyToTileset] 读取 cameraView.zip 失败,回退到默认视角",h)}const c={duration:0,...a};this.viewer.flyTo(s,c).then(h=>{h?o&&o():r&&r()}).catch(h=>{r&&r(),console.error("FlyTo error",h)})}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}`,n=t.lastIndexOf("/");return n===-1?".":t.substr(0,n)}async loadTilesetWithZipSupport(e,t,n,s){try{const o=encodeURI(`${this.getBaseUrlPath(e)}/tileset.zip`),a=(await fetch(o,{method:"HEAD"})).status===200;if(sr(this.viewer?.container),a){const l=await Mt(o);if(l){l?.asset?.watermark&&await Wu(l.asset.watermark,this.viewer?.container),$u.includes(this.watermarkEnabled)&&sr(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,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...n})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const n=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${n} 目录树...`);try{if(s){const r=await Mt(s);if(Ho(r)&&r[0].name&&(r[0].name=n),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 n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Mt(n);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 n=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!n)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const o=await Mt(n);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 Ku={normal:0,process:2},uC={color:1};function Xu(i){return i===1||i==="exist"?1:i===2||i==="process"?2:0}function _n(i){return Number.isNaN(i)?0:i<=1?Math.min(Math.max(i,0),1):Math.min(Math.max(i/255,0),1)}function Ju(i){return Number.isNaN(i)?1:i<=1?Math.min(Math.max(i,0),1):1}function wl(i){if(!i)return null;const e=Number(i.r),t=Number(i.g),n=Number(i.b),s=i.a===void 0?1:Number(i.a);if([e,t,n,s].some(l=>Number.isNaN(l)))return null;const o=Math.round(e*255),r=Math.round(t*255),a=Math.round(n*255);return`rgba(${o},${r},${a},${s})`}function fC(i){if(!i||typeof i!="string")return null;const t=i.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const n=Number(t[1]),s=Number(t[2]),o=Number(t[3]),r=t[4]===void 0?1:Number(t[4]);return[n,s,o,r].some(a=>Number.isNaN(a))?null:{r:Math.min(Math.max(n/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 pC(i){if(i==null)return null;const e=Number(i);return Number.isNaN(e)?null:e}function mC(i){const e=i.lastIndexOf("-"),t=i.substring(0,e),n=i.substring(e+1);return[t,n]}function Cl(i){if(!i)return null;const e=i.Min??i.min,t=i.Max??i.max;if(!e||!t)return null;const n=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[n,s,o,r,a,l].some(c=>Number.isNaN(c))?null:{min:{x:n,y:s,z:o},max:{x:r,y:a,z:l}}}function ks(i,e){if(e)return`${e}`;const t=i?.leiting?.model?.modelId??i?.modelId??i?.id;return t==null?null:`${t}`}function gC(i,e){if(e==null)return null;const t=i?.leiting?.node;if(!t)return null;const n=`${e}`,s=t?.[n],o=Cl(s?.box3??s?.box);if(o)return o;const r=t?.element?.[n]??t?.elements?.[n]??t?.nodeExtras?.element?.[n]??t?.nodeExtras?.elements?.[n];return Cl(r?.box3??r?.box)}function yC(i){const e=i?.leiting?.box;return e?Cl({min:e.min,max:e.max}):null}class AC{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,n,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=n[c];u?u.push(l[0]):n[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=n[h];u?u.push(l[0]):n[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,n={};Array.isArray(this.base.data)&&this.base.data.forEach(o=>{this.processAnimation(o,t,n,.1)});const s=Object.entries(n);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:n,modelId:s,rgba:o}=t;if(Array.isArray(n)&&n[0]){n[0][1]=o;const r=this.base.groupBatchIds[s];r?r.push(n[0]):this.base.groupBatchIds[s]=[n[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:n}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:n,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 n=Object.entries(t);n.forEach(([s,o])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:o})}),n.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(n=>{const{batchIds:s,modelId:o,rgba:r}=n;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,n])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:n})}),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(n=>{const s=[];n.cpts.forEach(l=>{s.push({dbName:n.linkModelId,modelId:n.modelId,elementId:`${l}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=Ku.process,r=uC.color,{allElements:a}=this.base.groupByModelId(s);this.base.mapAnimations[n.modelId]=this.base.mapAnimations[n.modelId]||[],this.base.mapAnimations[n.modelId].push(t),Object.entries(a).forEach(([l,c])=>{const[h,u]=mC(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 vC{base;constructor(e){this.base=e}attachTileset(e,t,n){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const o=ks(e,n);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 n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=ks(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);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),n.tileset.leiting?.selectedFn)if(n.tileset.leiting.node){const h=n.tileset.leiting.node.batchIdEIDInfos[o].elementID,u=n.tileset.leiting.node.nodeExtras.element[h];u.elementId=h,u.modelId=n.tileset.leiting.model.modelId,n.tileset.leiting.selectedFn({elementInfo:u,elementId:h,point:r,modelId:n.tileset.leiting.model.modelId,_propsData:u})}else n.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let n;try{n=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(n)&&n instanceof e.Cesium3DTileFeature){const s=ks(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);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 n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:n.enableRotate,enableTilt:n.enableTilt,enableLook:n.enableLook},n.enableRotate=!1,n.enableTilt=!1,n.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 n=performance.now();if(n-this.base.lastDrawTime<20)return;this.base.lastDrawTime=n,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 n=this.base.viewer?.scene?.screenSpaceCameraController;n&&this.base.cameraControllerState!==null&&(n.enableRotate=this.base.cameraControllerState.enableRotate,n.enableTilt=this.base.cameraControllerState.enableTilt,n.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 bC{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 AC(this),this.selectionModule=new vC(this)}attachTileset(e,t,n){this.selectionModule.attachTileset(e,t,n)}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(n=>{try{return this.loadNodeDetailsForModel(n)}catch(s){return console.error(`Error loading node details for model ${n}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(n=>{try{n(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==0);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==1);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(n=>{const s=this.hasSelectedFeaturesMap[n];if(!s?.length)return;const o=s.filter(r=>r.rank!==2);o.length?(this.hasSelectedFeaturesMap[n]=o,this.setBaseStyle(n)):(delete this.hasSelectedFeaturesMap[n],this.applyShowStyleOnly(n))}),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,n=Xu(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(a=>{if(a.rank!==n)return;const l=fC(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,n,s=null){this.animationModule.processAnimation(e,t,n,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 n=this.tilesetMap[e];if(!n)return;const s=n?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?n.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):n.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 n=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=gC(c,l)||yC(c);if(!u)continue;const p=new n.Cartesian3(u.min.x,u.min.y,u.min.z),f=new n.Cartesian3(u.max.x,u.max.y,u.max.z),m=c?.root?.computedTransform??c?.modelMatrix;if(m){const y=n.Matrix4.multiplyByPoint(m,p,new n.Cartesian3),g=n.Matrix4.multiplyByPoint(m,f,new n.Cartesian3);o.push(y,g)}else o.push(p,f)}if(o.length){const r=n.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const a=this.viewer.scene.camera,l=new n.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(n=>{this.setColorStyle(n)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],n=this.hasSelectedFeaturesMap[e];if(!t||!n?.length)return;const s=new Map;n.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 n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.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(n=>{const s=this.showStateMap[n]||{batchIds:[],mode:"include"};this.showStateMap[n]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(n)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=_n(Number(e.r)),n=_n(Number(e.g)),s=_n(Number(e.b)),o=Ju(e.a===void 0?1:Number(e.a));return wl({r:t,g:n,b:s,a:o})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(n=>{const s=n?.modelId,o=n?.elementId;if(s==null||o===void 0||o===null)return;const r=n?.color??n?.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 n=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[n]){const l=this.eidToBatchIdMap[n].get(s);if(l!==void 0)return l}const r=this.tilesetMap[n]?.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[n]=l;const c=l.get(s);if(c!==void 0)return c}const a=pC(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 n=`${t.modelId}`;this.showStateMap[n]||(this.showStateMap[n]={batchIds:[],mode:"exclude"});const s=this.showStateMap[n];if(!t.show){const o=this.getBatchIds(t.elementId,n);s.batchIds.push(...o)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(n=>{const s=`${n.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${n.elementId}`)});for(const n of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(n);const o=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(!o)continue;this.showStateMap[n]={batchIds:[],mode:"exclude"};const r=t[n];if(r&&r.size>0){const a=[];for(const l of o)r.has(`${l.elementID}`)||a.push(`${l.batchId}`);this.showStateMap[n].batchIds=a;continue}this.showStateMap[n].batchIds=o.map(a=>a.batchId)}Object.keys(this.showStateMap).forEach(n=>{this.updateTilesetStyle(n)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const n of t)await this.loadNodeDetailsForModel(n),e?this.setShowStyle({modelId:n,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:n,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),n=[];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)||(n.push({elementId:m,modelId:s}),h.add(m))}})}),n}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const n=[];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)||(n.push({elementId:m,modelId:s}),h.add(m))}})}),n}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:n,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===Ku.normal&&!this.colorRankColor.includes(n)&&(this.colorRankColor=[n]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,n]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const n=new Map,s=t?.rank===void 0?"exist":t?.rank,o=Xu(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=wl(a?.rgba)||this.selectedColor;for(const p of h){const f=this.getBatchIds(p,c);if(f.length!==0){n.has(c)||n.set(c,[]);for(const m of f)n.get(c)?.push({batchId:m,selectedColor:u,rank:o,isTrigger:r})}}}for(const[a,l]of n){const c=this.mergeSelections(a,l);this.hasSelectedFeaturesMap[a]=c,this.setBaseStyle(a)}r&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:n,rgba:s}=e,o=t?.isTrigger??!0;if(!n)return;await this.loadNodeDetailsForModel(n);const r=String(n),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 n=e.join("|");return n?t==="include"?[[`(regExp('^(${n})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${n})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const n=this.showStateMap[e],s=n?this.buildShowConditions(n.batchIds,n.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,n,s=1){const o=_n(e),r=_n(t),a=_n(n),l=Ju(s),c=wl({r:o,g:r,b:a,a:l});c&&(this.selectedColor=c)}mergeSelections(e,t){const n=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(o=>n.set(o.batchId,o)),t.forEach(o=>{const r=n.get(o.batchId);(!r||o.rank>r.rank||o.rank===r.rank)&&n.set(o.batchId,o)}),Array.from(n.values())}async toggleMultiSelect(e,t,n,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:n,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,n){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),b=new Set(A.filter(x=>x.rank===0).map(x=>x.batchId)),C=[];y.forEach(x=>{b.has(x)||C.push({batchId:x,selectedColor:n,rank:0,isTrigger:!0})});const S=A.filter(x=>x.rank===0);this.hasSelectedFeaturesMap[g]=[...v,...S,...C],this.setBaseStyle(g)}),await this.triggerSelectionChange()}}class wC{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,n=this.tilesetMap[e];if(!n||!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(n.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(o,this.boxMatrix,new t.Matrix4),n.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 n=["left","right","behind","front","top","down"];for(const s of n){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,n=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,n,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,n,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,n,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,n,-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,n=this.getNormalByType(e),s=t.Cartesian3.negate(n,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,n=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=n.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=n.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),n.screenSpaceCameraController.enableInputs=!1;const r=n.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=n.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),n.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],n=this.tilesetMap[e];if(t&&n&&!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(n.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 n=new e.Cartesian3;t.forEach(u=>e.Cartesian3.add(n,u,n)),this.boxCenter=e.Cartesian3.divideByScalar(n,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)],b=p.root.transform;v.forEach(C=>{f.push(e.Matrix4.multiplyByPoint(b,C,new e.Cartesian3))})}else if(y&&y.halfAxes){const g=y.center,A=y.halfAxes,v=e.Matrix3.getColumn(A,0,new e.Cartesian3),b=e.Matrix3.getColumn(A,1,new e.Cartesian3),C=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(b,S&2?1:-1,new e.Cartesian3),x),e.Cartesian3.add(x,e.Cartesian3.multiplyByScalar(C,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,b=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,A,new e.Cartesian3);s=Math.min(s,b.x-v),o=Math.max(o,b.x+v),r=Math.min(r,b.y-v),a=Math.max(a,b.y+v),l=Math.min(l,b.z-v),c=Math.max(c,b.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 n=this.tilesetMap[t];n&&(n.clippingPlanes&&(n.clippingPlanes.enabled=!1),n.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 El=performance.now();const CC=10;class EC{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:n,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"),n&&(this.modelInfo=Object.assign(this.modelInfo,n)),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 n=this.viewer.scene;let s;try{s=n.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,n=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(n)}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}),n=()=>{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?n():t.readyEvent.addEventListener(n),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;El=performance.now();const n=(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"||(n(o,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=o=>{o.target.tagName==="INPUT"||o.target.tagName==="TEXTAREA"||(n(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-El<CC)return;El=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 b=t.Cartesian3.distance(f,g.position);b-p>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),b-p<-.1&&b<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!g&&this.gravityTestByMove){const b=l(this.position,m),C=this.viewer.scene.pickFromRay(b,[this.model],1);if(C){const S=this.cesium.Cartesian3.distance(this.position,C.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 b=this.cesium.Cartesian3.distance(v,g.position);Math.abs(b-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-b)/Math.abs(a-b)*.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),b=new t.Ray(m,v);let C;try{C=this.viewer.scene.pickFromRay(b,void 0,1)}catch{}t.defined(C)&&C.primitive!==this.model&&C.position&&t.Cartesian3.distance(m,C.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,n=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(n,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,n])=>{if(!n)return;const s=()=>this.setMoveState(t,!0),o=()=>this.setMoveState(t,!1);n.addEventListener("mousedown",s),n.addEventListener("mouseup",o),n.addEventListener("mouseleave",o),n.addEventListener("touchstart",r=>{r.preventDefault(),s()}),n.addEventListener("touchend",r=>{r.preventDefault(),o()}),this._uiEventListeners.push(()=>{n.removeEventListener("mousedown",s),n.removeEventListener("mouseup",o),n.removeEventListener("mouseleave",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchend",o)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,n=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)&&(n.heading-=u*.003),n.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=n.direction,h=n.right,u=n.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),n.position=new e.Cartesian3(n.position.x+p,n.position.y+f,n.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:n}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),n!==void 0&&(this.transparentTest=n)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(n=>this.moveState[n]==!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 xC{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Ky(e),this.baseTiles=new qu(e),this.baseCompt=new bC(e),this.baseSection=new wC(e),this.basePlayer=new EC({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 IC{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,n=this.dxfModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n)}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(n=>n.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 n=this.dxfModelsList.find(s=>s.modelId===e);n&&(n.show=t)}showJsonByLayer({modelId:e,show:t,layers:n}){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(n)&&n.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 n=this.cesium,s=e.boundingSphere?.radius||1e3,o={offset:new n.HeadingPitchRange(0,n.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 n=await t.blob(),s=new gl(new tr(n),{password:ju,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 n=this.getBaseUrlPath(e),s=encodeURI(`${n}/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(`${n}/${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 n=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==n)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!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;const u=await this.loadTilesetWithZipSupport(a,{allowPicking:!1,clampToTerrain:!0});if(u.maximumScreenSpaceError=0,this.renderGenAll!==n||(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!==n||(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,n=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(n),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(n=>{n.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(n=>n.modelId===e);if(t>-1){const n=this.dxfModelsList[t];this.viewer.scene.primitives.remove(n),n.destroy&&!n.isDestroyed()&&n.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 SC(i){i("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),i("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),i("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)i("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),i("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");i("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"),i("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"),i.WGS84=i["EPSG:4326"],i["EPSG:3785"]=i["EPSG:3857"],i.GOOGLE=i["EPSG:3857"],i["EPSG:900913"]=i["EPSG:3857"],i["EPSG:102113"]=i["EPSG:3857"]}var Zi=1,en=2,kn=3,MC=4,xl=5,Zu=6378137,TC=6356752314e-3,ef=.0066943799901413165,Ps=484813681109536e-20,$=Math.PI/2,BC=.16666666666666666,_C=.04722222222222222,kC=.022156084656084655,K=1e-10,Oe=.017453292519943295,bt=57.29577951308232,Ae=Math.PI/4,Ds=Math.PI*2,Ge=3.14159265359,wt={};wt.greenwich=0,wt.lisbon=-9.131906111111,wt.paris=2.337229166667,wt.bogota=-74.080916666667,wt.madrid=-3.687938888889,wt.rome=12.452333333333,wt.bern=7.439583333333,wt.jakarta=106.807719444444,wt.ferro=-17.666666666667,wt.brussels=4.367975,wt.stockholm=18.058277777778,wt.athens=23.7163375,wt.oslo=10.722916666667;const PC={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 tf=/[\s_\-\/\(\)]/g;function Si(i,e){if(i[e])return i[e];for(var t=Object.keys(i),n=e.toLowerCase().replace(tf,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(tf,""),r===n)return i[o]}function Il(i){var e={},t=i.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},{}),n,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=Si(PC,a);l&&(e.to_meter=l.to_meter)},from_greenwich:function(a){e.from_greenwich=a*Oe},pm:function(a){var l=Si(wt,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(n in t)s=t[n],n in r?(o=r[n],typeof o=="function"?o(s):e[o]=s):e[n]=s;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=i,e}class nf{static getId(e){const t=e.find(n=>Array.isArray(n)&&n[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 n=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:n,conversion_factor:s,id:r}}static convertAxis(e){const t=e[1]||"Unknown";let n;const s=t.match(/^\((.)\)$/);if(s){const c=s[1].toUpperCase();if(c==="E")n="east";else if(c==="N")n="north";else if(c==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${c}`)}else n=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:n,unit:l,order:r}}static extractAxes(e){return e.filter(t=>Array.isArray(t)&&t[0]==="AXIS").map(t=>this.convertAxis(t)).sort((t,n)=>(t.order||0)-(n.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 n=e.find(p=>Array.isArray(p)&&p[0]==="CS");n&&(t.coordinate_system={type:n[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 DC extends nf{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 NC extends nf{static convert(e,t={}){super.convert(e,t);const n=e.find(o=>Array.isArray(o)&&o[0]==="CS");n&&(t.coordinate_system={subtype:n[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 LC(i){return i.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(i.find(e=>Array.isArray(e)&&e[0]==="CS")||i[0]==="BOUNDCRS"||i[0]==="PROJCRS"||i[0]==="GEOGCRS","2015")}function RC(i){return(LC(i)==="2019"?NC:DC).convert(i)}function FC(i){const e=i.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,sf=2,of=3,or=4,rf=5,Sl=-1,OC=/\s/,GC=/[A-Za-z]/,UC=/[A-Za-z84_]/,rr=/[,\]]/,af=/[\d\.E\-\+]/;function hi(i){if(typeof i!="string")throw new Error("not a string");this.text=i.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ns}hi.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==or)for(;OC.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Ns:return this.neutral(i);case sf:return this.keyword(i);case or:return this.quoted(i);case rf:return this.afterquote(i);case of:return this.number(i);case Sl:return}},hi.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=or;return}if(rr.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},hi.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ns;return}if(i==="]"){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=Sl);return}},hi.prototype.number=function(i){if(af.test(i)){this.word+=i;return}if(rr.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},hi.prototype.quoted=function(i){if(i==='"'){this.state=rf;return}this.word+=i},hi.prototype.keyword=function(i){if(UC.test(i)){this.word+=i;return}if(i==="["){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(rr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},hi.prototype.neutral=function(i){if(GC.test(i)){this.word=i,this.state=sf;return}if(i==='"'){this.word="",this.state=or;return}if(af.test(i)){this.word=i,this.state=of;return}if(rr.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},hi.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Sl)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function VC(i){var e=new hi(i);return e.output()}function Ml(i,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var n=e?{}:i,s=t.reduce(function(o,r){return Pn(r,o),o},n);e&&(i[e]=s)}function Pn(i,e){if(!Array.isArray(i)){e[i]=!0;return}var t=i.shift();if(t==="PARAMETER"&&(t=i.shift()),i.length===1){if(Array.isArray(i[0])){e[t]={},Pn(i[0],e[t]);return}e[t]=i[0];return}if(!i.length){e[t]=!0;return}if(t==="TOWGS84"){e[t]=i;return}if(t==="AXIS"){t in e||(e[t]=[]),e[t].push(i);return}Array.isArray(t)||(e[t]={});var n;switch(t){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[t]={name:i[0].toLowerCase(),convert:i[1]},i.length===3&&Pn(i[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:i[0],a:i[1],rf:i[2]},i.length===4&&Pn(i[3],e[t]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":i[0]=["name",i[0]],Ml(e,t,i);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":i[0]=["name",i[0]],Ml(e,t,i),e[t].type=t;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return Pn(i,e[t]);return Ml(e,t,i)}}var QC=.017453292519943295;function Rt(i){return i*QC}function lf(i){const e=(i.projName||"").toLowerCase().replace(/_/g," ");!i.long0&&i.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(i.long0=i.longc),!i.lat_ts&&i.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(i.lat0=Rt(i.lat1>0?90:-90),i.lat_ts=i.lat1,delete i.lat1):!i.lat_ts&&i.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(i.lat_ts=i.lat0,i.lat0=Rt(i.lat0>0?90:-90),delete i.lat1)}function cf(i){let e={units:null,to_meter:void 0};return typeof i=="string"?(e.units=i.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):i&&i.name&&(e.units=i.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=i.conversion_factor),e}function df(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function hf(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=df(i.ellipsoid.semi_major_axis),i.ellipsoid.inverse_flattening!==void 0?e.rf=i.ellipsoid.inverse_flattening:i.ellipsoid.semi_major_axis!==void 0&&i.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-df(i.ellipsoid.semi_minor_axis))))}function ar(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(ar(i.source_crs,e),i.transformation&&(i.transformation.method&&i.transformation.method.name==="NTv2"?e.nadgrids=i.transformation.parameters[0].value:e.datum_params=i.transformation.parameters.map(t=>t.value)),e):(Object.keys(i).forEach(t=>{const n=i[t];if(n!==null)switch(t){case"name":if(e.srsCode)break;e.name=n,e.srsCode=n;break;case"type":n==="GeographicCRS"?e.projName="longlat":n==="ProjectedCRS"&&i.conversion&&i.conversion.method&&(e.projName=i.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(e.ellps=n.ellipsoid.name,hf(n,e)),n.prime_meridian&&(e.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=n.name,hf(n,e);break;case"prime_meridian":e.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(e.axis=n.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",n.unit){const{units:s,to_meter:o}=cf(n.unit);e.units=s,e.to_meter=o}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:o}=cf(n.axis[0].unit);e.units=s,e.to_meter=o}}break;case"id":n.authority&&n.code&&(e.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(e.projName=n.method.name),n.parameters&&n.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":n.name&&(e.units=n.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),n.conversion_factor&&(e.to_meter=n.conversion_factor);break;case"base_crs":ar(n,e),e.datumCode=n.id?n.id.authority+"_"+n.id.code:n.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),lf(e),e)}var zC=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function HC(i,e){var t=e[0],n=e[1];!(t in i)&&n in i&&(i[t]=i[n],e.length===3&&(i[t]=e[2](i[t])))}function uf(i){for(var e=Object.keys(i),t=0,n=e.length;t<n;++t){var s=e[t];zC.indexOf(s)!==-1&&YC(i[s]),typeof i[s]=="object"&&uf(i[s])}}function YC(i){if(i.AUTHORITY){var e=Object.keys(i.AUTHORITY)[0];e&&e in i.AUTHORITY&&(i.title=e+":"+i.AUTHORITY[e])}if(i.type==="GEOGCS"?i.projName="longlat":i.type==="LOCAL_CS"?(i.projName="identity",i.local=!0):typeof i.PROJECTION=="object"?i.projName=Object.keys(i.PROJECTION)[0]:i.projName=i.PROJECTION,i.AXIS){for(var t="",n=0,s=i.AXIS.length;n<s;++n){var o=[i.AXIS[n][0].toLowerCase(),i.AXIS[n][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&&(i.axis=t)}i.UNIT&&(i.units=i.UNIT.name.toLowerCase(),i.units==="metre"&&(i.units="meter"),i.UNIT.convert&&(i.type==="GEOGCS"?i.DATUM&&i.DATUM.SPHEROID&&(i.to_meter=i.UNIT.convert*i.DATUM.SPHEROID.a):i.to_meter=i.UNIT.convert));var r=i.GEOGCS;i.type==="GEOGCS"&&(r=i),r&&(r.DATUM?i.datumCode=r.DATUM.name.toLowerCase():i.datumCode=r.name.toLowerCase(),i.datumCode.slice(0,2)==="d_"&&(i.datumCode=i.datumCode.slice(2)),i.datumCode==="new_zealand_1949"&&(i.datumCode="nzgd49"),(i.datumCode==="wgs_1984"||i.datumCode==="world_geodetic_system_1984")&&(i.PROJECTION==="Mercator_Auxiliary_Sphere"&&(i.sphere=!0),i.datumCode="wgs84"),i.datumCode==="belge_1972"&&(i.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(i.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),i.ellps.toLowerCase().slice(0,13)==="international"&&(i.ellps="intl"),i.a=r.DATUM.SPHEROID.a,i.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(i.datum_params=r.DATUM.TOWGS84),~i.datumCode.indexOf("osgb_1936")&&(i.datumCode="osgb36"),~i.datumCode.indexOf("osni_1952")&&(i.datumCode="osni52"),(~i.datumCode.indexOf("tm65")||~i.datumCode.indexOf("geodetic_datum_of_1965"))&&(i.datumCode="ire65"),i.datumCode==="ch1903+"&&(i.datumCode="ch1903"),~i.datumCode.indexOf("israel")&&(i.datumCode="isr93")),i.b&&!isFinite(i.b)&&(i.b=i.a),i.rectified_grid_angle&&(i.rectified_grid_angle=Rt(i.rectified_grid_angle));function a(h){var u=i.to_meter||1;return h*u}var l=function(h){return HC(i,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),lf(i)}function lr(i){if(typeof i=="object")return ar(i);const e=FC(i);var t=VC(i);if(e==="WKT2"){const o=RC(t);return ar(o)}var n=t[0],s={};return Pn(t,s),uf(s),s[n]}function st(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?st[i]=Il(arguments[1]):st[i]=lr(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?st[i]=lr(arguments[1]):(st[i]=t,t||delete st[i])}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?st.apply(e,n):st(n)});if(typeof i=="string"){if(i in st)return st[i]}else"EPSG"in i?st["EPSG:"+i.EPSG]=i:"ESRI"in i?st["ESRI:"+i.ESRI]=i:"IAU2000"in i?st["IAU2000:"+i.IAU2000]=i:console.log(i);return}}SC(st);function $C(i){return typeof i=="string"}function jC(i){return i in st}function WC(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var qC=["3857","900913","3785","102113"];function KC(i){var e=Si(i,"authority");if(e){var t=Si(e,"epsg");return t&&qC.indexOf(t)>-1}}function XC(i){var e=Si(i,"extension");if(e)return Si(e,"proj4")}function JC(i){return i[0]==="+"}function ZC(i){if($C(i)){if(jC(i))return st[i];if(WC(i)){var e=lr(i);if(KC(e))return st["EPSG:3857"];var t=XC(e);return t?Il(t):e}if(JC(i))return Il(i)}else return"projName"in i?i:lr(i)}function ff(i,e){i=i||{};var t,n;if(!e)return i;for(n in e)t=e[n],t!==void 0&&(i[n]=t);return i}function Xt(i,e,t){var n=i*e;return t/Math.sqrt(1-n*n)}function Ls(i){return i<0?-1:1}function J(i,e){return e||Math.abs(i)<=Ge?i:i-Ls(i)*Ds}function Ft(i,e,t){var n=i*t,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*($-e))/n}function Rs(i,e){for(var t=.5*i,n,s,o=$-2*Math.atan(e),r=0;r<=15;r++)if(n=i*Math.sin(o),s=$-2*Math.atan(e*Math.pow((1-n)/(1+n),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function eE(){var i=this.b/this.a;this.es=1-i*i,"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=Xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function tE(i){var e=i.x,t=i.y;if(t*bt>90&&t*bt<-90&&e*bt>180&&e*bt<-180)return null;var n,s;if(Math.abs(Math.abs(t)-$)<=K)return null;if(this.sphere)n=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(Ae+.5*t));else{var o=Math.sin(t),r=Ft(this.e,t,o);n=this.x0+this.a*this.k0*J(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return i.x=n,i.y=s,i}function iE(i){var e=i.x-this.x0,t=i.y-this.y0,n,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 n=J(this.long0+e/(this.a*this.k0),this.over),i.x=n,i.y=s,i}var nE=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const sE={init:eE,forward:tE,inverse:iE,names:nE};function oE(){}function pf(i){return i}var mf=["longlat","identity"],rE=[sE,{init:oE,forward:pf,inverse:pf,names:mf}],tn={},Dn=[];function gf(i,e){var t=Dn.length;return i.names?(Dn[t]=i,i.names.forEach(function(n){tn[n.toLowerCase()]=t}),this):(console.log(e),!0)}function yf(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function aE(i){if(!i)return!1;var e=i.toLowerCase();if(typeof tn[e]<"u"&&Dn[tn[e]]||(e=yf(e),e in tn&&Dn[tn[e]]))return Dn[tn[e]]}function lE(){rE.forEach(gf)}const cE={start:lE,add:gf,get:aE};var Af={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 dE=Af.WGS84;function hE(i,e,t,n){var s=i*i,o=e*e,r=(s-o)/s,a=0;n?(i*=1-r*(BC+r*(_C+r*kC)),s=i*i,r=0):a=Math.sqrt(r);var l=(s-o)/o;return{es:r,e:a,ep2:l}}function uE(i,e,t,n,s){if(!i){var o=Si(Af,n);o||(o=dE),i=o.a,e=o.b,t=o.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)<K)&&(s=!0,e=i),{a:i,b:e,rf:t,sphere:s}}var cr={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 fE in cr){var Tl=cr[fE];Tl.datumName&&(cr[Tl.datumName]=Tl)}function pE(i,e,t,n,s,o,r){var a={};return i===void 0||i==="none"?a.datum_type=xl:a.datum_type=MC,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=Zi),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=en,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=kn,a.grids=r),a.a=t,a.b=n,a.es=s,a.ep2=o,a}var Bl={};function mE(i,e,t){return e instanceof ArrayBuffer?gE(i,e,t):{ready:yE(i,e)}}function gE(i,e,t){var n=!0;t!==void 0&&t.includeErrorFields===!1&&(n=!1);var s=new DataView(e),o=bE(s),r=wE(s,o),a=CE(s,r,o,n),l={header:r,subgrids:a};return Bl[i]=l,l}async function yE(i,e){for(var t=[],n=await e.getImageCount(),s=n-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(vf),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(vf),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 b=l[0]-1;b>=0;b--){var g=v*l[0]+b;y.push([-Mi(m[g]),Mi(f[g])])}t.push({del:h,lim:l,ll:[-u,p],cvs:y})}var A={header:{nSubgrids:n},subgrids:t};return Bl[i]=A,A}function AE(i){if(i===void 0)return null;var e=i.split(",");return e.map(vE)}function vE(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:Bl[i]||null,isNull:!1}}function vf(i){return i*Math.PI/180}function Mi(i){return i/3600*Math.PI/180}function bE(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function wE(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:_l(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function _l(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function CE(i,e,t,n){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var a=xE(i,s,t),l=IE(i,s,a,t,n),c=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),h=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);o.push({ll:[Mi(a.lowerLongitude),Mi(a.lowerLatitude)],del:[Mi(a.longitudeInterval),Mi(a.latitudeInterval)],lim:[c,h],count:a.gridNodeCount,cvs:EE(l)});var u=16;n===!1&&(u=8),s+=176+a.gridNodeCount*u}return o}function EE(i){return i.map(function(e){return[Mi(e.longitudeShift),Mi(e.latitudeShift)]})}function xE(i,e,t){return{name:_l(i,e+8,e+16).trim(),parent:_l(i,e+24,e+24+8).trim(),lowerLatitude:i.getFloat64(e+72,t),upperLatitude:i.getFloat64(e+88,t),lowerLongitude:i.getFloat64(e+104,t),upperLongitude:i.getFloat64(e+120,t),latitudeInterval:i.getFloat64(e+136,t),longitudeInterval:i.getFloat64(e+152,t),gridNodeCount:i.getInt32(e+168,t)}}function IE(i,e,t,n,s){var o=e+176,r=16;s===!1&&(r=8);for(var a=[],l=0;l<t.gridNodeCount;l++){var c={latitudeShift:i.getFloat32(o+l*r,n),longitudeShift:i.getFloat32(o+l*r+4,n)};s!==!1&&(c.latitudeAccuracy=i.getFloat32(o+l*r+8,n),c.longitudeAccuracy=i.getFloat32(o+l*r+12,n)),a.push(c)}return a}function Pt(i,e){if(!(this instanceof Pt))return new Pt(i);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=ZC(i);if(typeof t!="object"){e("Could not parse to valid json: "+i);return}var n=Pt.projections.get(t.projName);if(!n){e("Could not get projection name from: "+i);return}if(t.datumCode&&t.datumCode!=="none"){var s=Si(cr,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=uE(t.a,t.b,t.rf,t.ellps,t.sphere),r=hE(o.a,o.b,o.rf,t.R_A),a=AE(t.nadgrids),l=t.datum||pE(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,a);ff(this,t),ff(this,n),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=cE,Pt.projections.start();function SE(i,e){return i.datum_type!==e.datum_type||i.a!==e.a||Math.abs(i.es-e.es)>5e-11?!1:i.datum_type===Zi?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===en?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function bf(i,e,t){var n=i.x,s=i.y,o=i.z?i.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:i.z};if(s>$)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=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(n),y:(r+o)*c*Math.sin(n),z:(r*(1-e)+o)*a}}function wf(i,e,t,n){var s=1e-12,o=s*s,r=30,a,l,c,h,u,p,f,m,y,g,A,v,b,C=i.x,S=i.y,x=i.z?i.z:0,I,M,w;if(a=Math.sqrt(C*C+S*S),l=Math.sqrt(C*C+S*S+x*x),a/t<s){if(I=0,l/t<s)return M=$,w=-n,{x:i.x,y:i.y,z:i.z}}else I=Math.atan2(S,C);c=x/l,h=a/l,u=1/Math.sqrt(1-e*(2-e)*h*h),m=h*(1-e)*u,y=c*u,b=0;do b++,f=t/Math.sqrt(1-e*y*y),w=a*m+x*y-f*(1-e*y*y),p=e*f/(f+w),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&&b<r);return M=Math.atan(A/Math.abs(g)),{x:I,y:M,z:w}}function ME(i,e,t){if(e===Zi)return{x:i.x+t[0],y:i.y+t[1],z:i.z+t[2]};if(e===en){var n=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6];return{x:c*(i.x-l*i.y+a*i.z)+n,y:c*(l*i.x+i.y-r*i.z)+s,z:c*(-a*i.x+r*i.y+i.z)+o}}}function TE(i,e,t){if(e===Zi)return{x:i.x-t[0],y:i.y-t[1],z:i.z-t[2]};if(e===en){var n=t[0],s=t[1],o=t[2],r=t[3],a=t[4],l=t[5],c=t[6],h=(i.x-n)/c,u=(i.y-s)/c,p=(i.z-o)/c;return{x:h+l*u-a*p,y:-l*h+u+r*p,z:a*h-r*u+p}}}function dr(i){return i===Zi||i===en}function BE(i,e,t){if(SE(i,e)||i.datum_type===xl||e.datum_type===xl)return t;var n=i.a,s=i.es;if(i.datum_type===kn){var o=Cf(i,!1,t);if(o!==0)return;n=Zu,s=ef}var r=e.a,a=e.b,l=e.es;if(e.datum_type===kn&&(r=Zu,a=TC,l=ef),s===l&&n===r&&!dr(i.datum_type)&&!dr(e.datum_type))return t;if(t=bf(t,s,n),dr(i.datum_type)&&(t=ME(t,i.datum_type,i.datum_params)),dr(e.datum_type)&&(t=TE(t,e.datum_type,e.datum_params)),t=wf(t,l,r,a),e.datum_type===kn){var c=Cf(e,!0,t);if(c!==0)return}return t}function Cf(i,e,t){if(i.grids===null||i.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-t.x,y:t.y},s={x:Number.NaN,y:Number.NaN},o=[];e:for(var r=0;r<i.grids.length;r++){var a=i.grids[r];if(o.push(a.name),a.isNull){s=n;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>n.y||f>n.x||g<n.y||y<n.x)&&(s=_E(n,e,u),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*bt+" "+n.y*bt+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function _E(i,e,t){var n={x:Number.NaN,y:Number.NaN};if(isNaN(i.x))return n;var s={x:i.x,y:i.y};s.x-=t.ll[0],s.y-=t.ll[1],s.x=J(s.x-Math.PI)+Math.PI;var o=Ef(s,t);if(e){if(isNaN(o.x))return n;o.x=s.x-o.x,o.y=s.y-o.y;var r=9,a=1e-12,l,c;do{if(c=Ef(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."),n;n.x=J(o.x+t.ll[0]),n.y=o.y+t.ll[1]}else isNaN(o.x)||(n.x=i.x+o.x,n.y=i.y+o.y);return n}function Ef(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},n={x:Math.floor(t.x),y:Math.floor(t.y)},s={x:t.x-1*n.x,y:t.y-1*n.y},o={x:Number.NaN,y:Number.NaN},r;if(n.x<0||n.x>=e.lim[0]||n.y<0||n.y>=e.lim[1])return o;r=n.y*e.lim[0]+n.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 xf(i,e,t){var n=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=n,"ew".indexOf(i.axis[l])!==-1?a="x":a="y"):l===1?(r=s,"ns".indexOf(i.axis[l])!==-1?a="y":a="x"):(r=o,a="z"),i.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 If(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function kE(i){Sf(i.x),Sf(i.y)}function Sf(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function PE(i,e){return(i.datum.datum_type===Zi||i.datum.datum_type===en||i.datum.datum_type===kn)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Zi||e.datum.datum_type===en||e.datum.datum_type===kn)&&i.datumCode!=="WGS84"}function hr(i,e,t,n){var s;Array.isArray(t)?t=If(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(kE(t),i.datum&&e.datum&&PE(i,e)&&(s=new Pt("WGS84"),t=hr(i,s,t,n),i=s),n&&i.axis!=="enu"&&(t=xf(i,!1,t)),i.projName==="longlat")t={x:t.x*Oe,y:t.y*Oe,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=BE(i.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})),n&&e.axis!=="enu"?xf(e,!0,t):(t&&!o&&delete t.z,t)}var Mf=Pt("WGS84");function kl(i,e,t,n){var s,o,r;return Array.isArray(t)?(s=hr(i,e,t,n)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.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=hr(i,e,t,n),r=Object.keys(t),r.length===2||r.forEach(function(a){if(typeof i.name<"u"&&i.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 ur(i){return i instanceof Pt?i:typeof i=="object"&&"oProj"in i?i.oProj:Pt(i)}function DE(i,e,t){var n,s,o=!1,r;return typeof e>"u"?(s=ur(i),n=Mf,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=ur(i),n=Mf,o=!0),n||(n=ur(i)),s||(s=ur(e)),t?kl(n,s,t):(r={forward:function(a,l){return kl(n,s,a,l)},inverse:function(a,l){return kl(s,n,a,l)}},o&&(r.oProj=s),r)}var Tf=6,Bf="AJSAJS",_f="AFAFAF",Nn=65,Ct=73,Dt=79,Fs=86,Os=90;const NE={forward:kf,inverse:LE,toPoint:Pf};function kf(i,e){return e=e||5,OE(RE({lat:i[1],lon:i[0]}),e)}function LE(i){var e=Dl(Lf(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function Pf(i){var e=Dl(Lf(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Pl(i){return i*(Math.PI/180)}function Df(i){return 180*(i/Math.PI)}function RE(i){var e=i.lat,t=i.lon,n=6378137,s=.00669438,o=.9996,r,a,l,c,h,u,p,f=Pl(e),m=Pl(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=Pl(r),a=s/(1-s),l=n/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=n*((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:FE(e)}}function Dl(i){var e=i.northing,t=i.easting,n=i.zoneLetter,s=i.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,b=t-5e5,C=e;n<"N"&&(C-=1e7),g=(s-1)*6-180+3,l=a/(1-a),y=C/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=b/(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=Df(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+Df(x);var I;if(i.accuracy){var M=Dl({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});I={top:M.lat,right:M.lon,bottom:S,left:x}}else I={lat:S,lon:x};return I}function FE(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function OE(i,e){var t="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+GE(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+n.substr(n.length-5,e)}function GE(i,e,t){var n=Nf(t),s=Math.floor(i/1e5),o=Math.floor(e/1e5)%20;return UE(s,o,n)}function Nf(i){var e=i%Tf;return e===0&&(e=Tf),e}function UE(i,e,t){var n=t-1,s=Bf.charCodeAt(n),o=_f.charCodeAt(n),r=s+i-1,a=o+e,l=!1;r>Os&&(r=r-Os+Nn-1,l=!0),(r===Ct||s<Ct&&r>Ct||(r>Ct||s<Ct)&&l)&&r++,(r===Dt||s<Dt&&r>Dt||(r>Dt||s<Dt)&&l)&&(r++,r===Ct&&r++),r>Os&&(r=r-Os+Nn-1),a>Fs?(a=a-Fs+Nn-1,l=!0):l=!1,(a===Ct||o<Ct&&a>Ct||(a>Ct||o<Ct)&&l)&&a++,(a===Dt||o<Dt&&a>Dt||(a>Dt||o<Dt)&&l)&&(a++,a===Ct&&a++),a>Fs&&(a=a-Fs+Nn-1);var c=String.fromCharCode(r)+String.fromCharCode(a);return c}function Lf(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,n="",s,o=0;!/[A-Z]/.test(s=i.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+i;n+=s,o++}var r=parseInt(n,10);if(o===0||o+3>e)throw"MGRSPoint bad conversion from: "+i;var a=i.charAt(o++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+i;t=i.substring(o,o+=2);for(var l=Nf(r),c=VE(t.charAt(0),l),h=QE(t.charAt(1),l);h<zE(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`+i;var p=u/2,f=0,m=0,y,g,A,v,b;return p>0&&(y=1e5/Math.pow(10,p),g=i.substring(o,o+p),f=parseFloat(g)*y,A=i.substring(o+p),m=parseFloat(A)*y),v=f+c,b=m+h,{easting:v,northing:b,zoneLetter:a,zoneNumber:r,accuracy:y}}function VE(i,e){for(var t=Bf.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===Ct&&t++,t===Dt&&t++,t>Os){if(s)throw"Bad character: "+i;t=Nn,s=!0}n+=1e5}return n}function QE(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=_f.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===Ct&&t++,t===Dt&&t++,t>Fs){if(s)throw"Bad character: "+i;t=Nn,s=!0}n+=1e5}return n}function zE(i){var e;switch(i){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: "+i}function Ln(i,e,t){if(!(this instanceof Ln))return new Ln(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ln.fromMGRS=function(i){return new Ln(Pf(i))},Ln.prototype.toMGRS=function(i){return kf([this.x,this.y],i)};var HE=1,YE=.25,Rf=.046875,Ff=.01953125,Of=.01068115234375,$E=.75,jE=.46875,WE=.013020833333333334,qE=.007120768229166667,KE=.3645833333333333,XE=.005696614583333333,JE=.3076171875;function Nl(i){var e=[];e[0]=HE-i*(YE+i*(Rf+i*(Ff+i*Of))),e[1]=i*($E-i*(Rf+i*(Ff+i*Of)));var t=i*i;return e[2]=t*(jE-i*(WE+i*qE)),t*=i,e[3]=t*(KE-i*XE),e[4]=t*i*JE,e}function Rn(i,e,t,n){return t*=e,e*=e,n[0]*i-t*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var ZE=20;function Ll(i,e,t){for(var n=1/(1-e),s=i,o=ZE;o;--o){var r=Math.sin(s),a=1-e*r*r;if(a=(Rn(s,r,Math.cos(s),t)-i)*(a*Math.sqrt(a))*n,s-=a,Math.abs(a)<K)return s}return s}function ex(){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=Nl(this.es),this.ml0=Rn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function tx(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s,o,r,a=Math.sin(t),l=Math.cos(t);if(this.es){var h=l*n,u=Math.pow(h,2),p=this.ep2*Math.pow(l,2),f=Math.pow(p,2),m=Math.abs(l)>K?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=Rn(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*n*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(n);if(Math.abs(Math.abs(c)-1)<K)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,r=l*Math.cos(n)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(r),c>=1){if(c-1>K)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return i.x=o,i.y=r,i}function ix(i){var e,t,n,s,o=(i.x-this.x0)*(1/this.a),r=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Ll(e,this.es,this.en),Math.abs(t)<$){var u=Math.sin(t),p=Math.cos(t),f=Math.abs(p)>K?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,b=Math.pow(v,2);e=e*f,n=t-e*b/(1-this.es)*.5*(1-b/12*(5+3*g-9*m*g+m-4*y-b/30*(61+90*g-252*m*g+45*A+46*m-b/56*(1385+3633*g+4095*A+1574*A*g)))),s=J(this.long0+v*(1-b/6*(1+2*g+m-b/20*(5+28*g+24*A+8*m*g+6*m-b/42*(61+662*g+1320*A+720*A*g))))/p,this.over)}else n=$*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))),n=Math.asin(e),r<0&&(n=-n),l===0&&h===0?s=0:s=J(Math.atan2(l,h)+this.long0,this.over)}return i.x=s,i.y=n,i}var nx=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const fr={init:ex,forward:tx,inverse:ix,names:nx};function Gf(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Et(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),n=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(n,2))}function sx(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function ox(i){var e=Math.abs(i);return e=sx(e*(1+e/(Et(1,e)+1))),i<0?-e:e}function Rl(i,e){for(var t=2*Math.cos(2*e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return e+r*Math.sin(2*e)}function rx(i,e){for(var t=2*Math.cos(e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return Math.sin(e)*r}function ax(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function Uf(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=Gf(t),r=ax(t),a=2*s*r,l=-2*n*o,c=i.length-1,h=i[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+i[c],f=-y+l*p+a*u;return a=n*r,l=s*o,[a*h-l*f,a*f+l*h]}function lx(){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&&(fr.init.apply(this),this.forward=fr.forward,this.inverse=fr.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 i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),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 n=Rl(this.cbg,this.lat0);this.Zb=-this.Qn*(n+rx(this.gtu,2*n))}function cx(i){var e=J(i.x-this.long0,this.over),t=i.y;t=Rl(this.cbg,t);var n=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(n,r*s),e=Math.atan2(o*s,Et(n,s*r)),e=ox(Math.tan(e));var a=Uf(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),i.x=l,i.y=c,i}function dx(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var n,s;if(Math.abs(e)<=2.623395162778){var o=Uf(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(Gf(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),n=J(e+this.long0,this.over),s=Rl(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var hx=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const pr={init:lx,forward:cx,inverse:dx,names:hx};function ux(i,e){if(i===void 0){if(i=Math.floor((J(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var fx="etmerc";function px(){var i=ux(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Oe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,pr.init.apply(this),this.forward=pr.forward,this.inverse=pr.inverse}var mx=["Universal Transverse Mercator System","utm"];const gx={init:px,names:mx,dependsOn:fx};function Fl(i,e){return Math.pow((1-i)/(1+i),e)}var yx=20;function Ax(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ae)/(Math.pow(Math.tan(.5*this.lat0+Ae),this.C)*Fl(this.e*i,this.ratexp))}function vx(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+Ae),this.C)*Fl(this.e*Math.sin(t),this.ratexp))-$,i.x=this.C*e,i}function bx(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+Ae)/this.K,1/this.C),o=yx;o>0&&(n=2*Math.atan(s*Fl(this.e*Math.sin(i.y),-.5*this.e))-$,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const Ol={init:Ax,forward:vx,inverse:bx};function wx(){Ol.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 Cx(i){var e,t,n,s;return i.x=J(i.x-this.long0,this.over),Ol.forward.apply(this,[i]),e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*n),i.x=s*t*Math.sin(i.x),i.y=s*(this.cosc0*e-this.sinc0*t*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Ex(i){var e,t,n,s,o;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,o=Et(i.x,i.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+i.y*e*this.cosc0/o),n=Math.atan2(i.x*e,o*this.cosc0*t-i.y*this.sinc0*e)}else s=this.phic0,n=0;return i.x=n,i.y=s,Ol.inverse.apply(this,[i]),i.x=J(i.x+this.long0,this.over),i}var xx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Ix={init:wx,forward:Cx,inverse:Ex,names:xx};function Gl(i,e,t){return e*=t,Math.tan(.5*($+i))*Math.pow((1-e)/(1+e),.5*t)}function Sx(){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)<=K&&(this.k0=.5*(1+Ls(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=K&&(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)<=K&&Math.abs(Math.cos(this.lat_ts))>K&&(this.k0=.5*this.cons*Xt(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=Xt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Gl(this.lat0,this.sinlat0,this.e))-$,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Mx(i){var e=i.x,t=i.y,n=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)<=K&&Math.abs(t+this.lat0)<=K?(i.x=NaN,i.y=NaN,i):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),i.x=this.a*o*s*Math.sin(u)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,i):(r=2*Math.atan(Gl(t,n,this.e))-$,l=Math.cos(r),a=Math.sin(r),Math.abs(this.coslat0)<=K?(c=Ft(this.e,t*this.con,this.con*n),h=2*this.a*this.k0*c/this.cons,i.x=this.x0+h*Math.sin(e-this.long0),i.y=this.y0-this.con*h*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)<K?(o=2*this.a*this.k0/(1+l*Math.cos(u)),i.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),i.y=o*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),i.x=o*l*Math.sin(u)+this.x0,i))}function Tx(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var a=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=K?(i.x=e,i.y=t,i):(t=Math.asin(Math.cos(a)*this.sinlat0+i.y*Math.sin(a)*this.coslat0/r),Math.abs(this.coslat0)<K?this.lat0>0?e=J(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=J(this.long0+Math.atan2(i.x,i.y),this.over):e=J(this.long0+Math.atan2(i.x*Math.sin(a),r*this.coslat0*Math.cos(a)-i.y*this.sinlat0*Math.sin(a)),this.over),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=K){if(r<=K)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,n=r*this.cons/(2*this.a*this.k0),t=this.con*Rs(this.e,n),e=this.con*J(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=K?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/r),e=J(this.long0+Math.atan2(i.x*Math.sin(s),r*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)),this.over)),t=-1*Rs(this.e,Math.tan(.5*($+o)));return i.x=e,i.y=t,i}var Bx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const _x={init:Sx,forward:Mx,inverse:Tx,names:Bx,ssfn_:Gl};function kx(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,n=this.rf,s=1/n,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(i),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+i/2)),c=Math.log((1+r*e)/(1-r*e));this.K=a-this.alpha*l+this.alpha*r/2*c}function Px(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(i.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 i.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,i.x=this.R*r+this.x0,i}function Dx(i){for(var e=i.x-this.x0,t=i.y-this.y0,n=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(n)),r=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-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 i.x=a,i.y=c,i}var Nx=["somerc"];const Lx={init:kx,forward:Px,inverse:Dx,names:Nx};var Fn=1e-7;function Rx(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1||e.indexOf(yf(t))!==-1}function Fx(){var i,e,t,n,s,o,r,a,l,c,h=0,u,p=0,f=0,m=0,y=0,g=0,A=0;this.no_off=Rx(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),v&&(A=this.alpha),b&&(h=this.rectified_grid_angle),v||b)p=this.longc;else if(f=this.long1,y=this.lat1,m=this.long2,g=this.lat2,Math.abs(y-g)<=Fn||(i=Math.abs(y))<=Fn||Math.abs(i-$)<=Fn||Math.abs(Math.abs(this.lat0)-$)<=Fn||Math.abs(Math.abs(g)-$)<=Fn)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>K?(a=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*a*a,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/i,n=this.B*e/(t*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(Ft(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),v||b?(v?(u=Math.asin(Math.sin(A)/n),b||(h=A)):(u=h,A=Math.asin(n*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),i=f-m,i<-Math.PI?m-=Ds:i>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(n*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(n*n-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(Ae-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ae+s))}function Ox(i){var e={},t,n,s,o,r,a,l,c;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-$)>K){if(r=this.E/Math.pow(Ft(this.e,i.y,Math.sin(i.y)),this.B),a=1/r,t=.5*(r-a),n=.5*(r+a),o=Math.sin(this.B*i.x),s=(t*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(s)-1)<K)throw new Error;c=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*i.x),Math.abs(a)<Fn?l=this.A*i.x:l=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else c=i.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.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 Gx(i){var e,t,n,s,o,r,a,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*t),s=.5*(n-1/n),o=.5*(n+1/n),r=Math.sin(this.BrA*e),a=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(a)-1)<K)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 Ux=["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 Vx={init:Fx,forward:Ox,inverse:Gx,names:Ux};function Qx(){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)<K)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),n=Xt(this.e,e,t),s=Ft(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),a=Xt(this.e,o,r),l=Ft(this.e,this.lat2,o),c=Math.abs(Math.abs(this.lat0)-$)<K?0:Ft(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>K?this.ns=Math.log(n/a)/Math.log(s/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(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 zx(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=K&&(t=Ls(t)*($-2*K));var n=Math.abs(Math.abs(t)-$),s,o;if(n>K)s=Ft(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(n=t*this.ns,n<=0)return null;o=0}var r=this.ns*J(e-this.long0,this.over);return i.x=this.k0*(o*Math.sin(r))+this.x0,i.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,i}function Hx(i){var e,t,n,s,o,r=(i.x-this.x0)/this.k0,a=this.rh-(i.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,n=Math.pow(e/(this.a*this.f0),t),s=Rs(this.e,n),s===-9999)return null}else s=-$;return o=J(l/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Yx=["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 $x={init:Qx,forward:zx,inverse:Hx,names:Yx};function jx(){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 Wx(i){var e,t,n,s,o,r,a,l=i.x,c=i.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),n=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(n)),o=Math.asin(Math.cos(t)*Math.sin(n)/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),i.y=a*Math.cos(r)/1,i.x=a*Math.sin(r)/1,this.czech||(i.y*=-1,i.x*=-1),i}function qx(i){var e,t,n,s,o,r,a,l,c=i.x;i.x=i.y,i.y=c,this.czech||(i.y*=-1,i.x*=-1),r=Math.sqrt(i.x*i.x+i.y*i.y),o=Math.atan2(i.y,i.x),s=o/Math.sin(this.s0),n=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(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),t=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(e)),i.x=this.long0-t/this.alfa,a=e,l=0;var h=0;do i.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-i.y)<1e-10&&(l=1),a=i.y,h+=1;while(l===0&&h<15);return h>=15?null:i}var Kx=["Krovak","krovak"];const Xx={init:jx,forward:Wx,inverse:qx,names:Kx};function mt(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function Gs(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Us(i){return .375*i*(1+.25*i*(1+.46875*i))}function Vs(i){return .05859375*i*i*(1+.75*i)}function Qs(i){return i*i*i*(35/3072)}function Ul(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function Ti(i){return Math.abs(i)<$?i:i-Ls(i)*Math.PI}function mr(i,e,t,n,s){var o,r;o=i/e;for(var a=0;a<15;a++)if(r=(i-(e*o-t*Math.sin(2*o)+n*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*n*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Jx(){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 Zx(i){var e,t,n=i.x,s=i.y;if(n=J(n-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(n)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),a=Ul(this.a,this.e,o),l=Math.tan(s)*Math.tan(s),c=n*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 i.x=e+this.x0,i.y=t+this.y0,i}function e2(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s;if(this.sphere){var o=t+this.lat0;n=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=mr(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-$)<=K)return i.x=this.long0,i.y=$,t<0&&(i.y*=-1),i;var l=Ul(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;n=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 i.x=J(s+this.long0,this.over),i.y=Ti(n),i}var t2=["Cassini","Cassini_Soldner","cass"];const i2={init:Jx,forward:Zx,inverse:e2,names:t2};function Bi(i,e){var t;return i>1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var Vl=1,Ql=2,zl=3,gr=4;function n2(){var i=Math.abs(this.lat0);if(Math.abs(i-$)<K?this.mode=this.lat0<0?Vl:Ql:Math.abs(i)<K?this.mode=zl:this.mode=gr,this.es>0){var e;switch(this.qp=Bi(this.e,1),this.mmf=.5/(1-this.es),this.apa=u2(this.es),this.mode){case Ql:this.dd=1;break;case Vl:this.dd=1;break;case zl:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case gr:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Bi(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===gr&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function s2(i){var e,t,n,s,o,r,a,l,c,h,u=i.x,p=i.y;if(u=J(u-this.long0,this.over),this.sphere){if(o=Math.sin(p),h=Math.cos(p),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n,t<=K)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*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(p+this.lat0)<K)return null;t=Ae-p*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(u),t*=n}}else{switch(a=0,l=0,c=0,n=Math.cos(u),s=Math.sin(u),o=Math.sin(p),r=Bi(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*n;break;case this.EQUIT:c=1+l*n;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)<K)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*n):t=(c=Math.sqrt(2/(1+l*n)))*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=n*(this.mode===this.S_POLE?c:-c)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function o2(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,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)<=K?0:Math.asin(t*p/u),e*=p,t=h*u;break;case this.OBLIQ:s=Math.abs(u)<=K?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}n=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<K)return i.x=this.long0,i.y=this.lat0,i;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 i.x=this.long0,i.y=this.lat0,i;c=1-a/this.qp,this.mode===this.S_POLE&&(c=-c)}n=Math.atan2(e,t),s=f2(Math.asin(c),this.apa)}return i.x=J(this.long0+n,this.over),i.y=s,i}var r2=.3333333333333333,a2=.17222222222222222,l2=.10257936507936508,c2=.06388888888888888,d2=.0664021164021164,h2=.016415012942191543;function u2(i){var e,t=[];return t[0]=i*r2,e=i*i,t[0]+=e*a2,t[1]=e*c2,e*=i,t[0]+=e*l2,t[1]+=e*d2,t[2]=e*h2,t}function f2(i,e){var t=i+i;return i+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var p2=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const m2={init:n2,forward:s2,inverse:o2,names:p2,S_POLE:Vl,N_POLE:Ql,EQUIT:zl,OBLIQ:gr};function _i(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function g2(){Math.abs(this.lat1+this.lat2)<K||(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=Xt(this.e3,this.sin_po,this.cos_po),this.qs1=Bi(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=Xt(this.e3,this.sin_po,this.cos_po),this.qs2=Bi(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=Bi(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>K?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 y2(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Bi(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/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 i.x=r,i.y=a,i}function A2(i){var e,t,n,s,o,r;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,e!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-n*n)/(2*this.ns0)):(t=(this.c-n*n)/this.ns0,r=this.phi1z(this.e3,t)),o=J(s/this.ns0+this.long0,this.over),i.x=o,i.y=r,i}function v2(i,e){var t,n,s,o,r,a=_i(.5*e);if(i<K)return a;for(var l=i*i,c=1;c<=25;c++)if(t=Math.sin(a),n=Math.cos(a),s=i*t,o=1-s*s,r=.5*o*o/n*(e/(1-l)-t/o+.5/i*Math.log((1-s)/(1+s))),a=a+r,Math.abs(r)<=1e-7)return a;return null}var b2=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const w2={init:g2,forward:y2,inverse:A2,names:b2,phi1z:v2};function C2(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function E2(i){var e,t,n,s,o,r,a,l,c=i.x,h=i.y;return n=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=K?(a=this.x0+this.a*o*t*Math.sin(n)/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(n),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=a,i.y=l,i}function x2(i){var e,t,n,s,o,r;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),n=Math.cos(s),r=_i(n*this.sin_p14+i.y*t*this.cos_p14/e),o=Math.atan2(i.x*t,e*this.cos_p14*n-i.y*this.sin_p14*t),o=J(this.long0+o,this.over)):(r=this.phic0,o=0),i.x=o,i.y=r,i}var I2=["gnom"];const S2={init:C2,forward:E2,inverse:x2,names:I2};function M2(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*$:$;for(var n=Math.asin(.5*e),s,o,r,a,l=0;l<30;l++)if(o=Math.sin(n),r=Math.cos(n),a=i*o,s=Math.pow(1-a*a,2)/(2*r)*(e/(1-i*i)-o/(1-a*a)+.5/i*Math.log((1-a)/(1+a))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function T2(){this.sphere||(this.k0=Xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function B2(i){var e=i.x,t=i.y,n,s,o=J(e-this.long0,this.over);if(this.sphere)n=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=Bi(this.e,Math.sin(t));n=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return i.x=n,i.y=s,i}function _2(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=J(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=M2(this.e,2*i.y*this.k0/this.a),e=J(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var k2=["cea"];const P2={init:T2,forward:B2,inverse:_2,names:k2};function D2(){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 N2(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s=Ti(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function L2(i){var e=i.x,t=i.y;return i.x=J(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Ti(this.lat0+(t-this.y0)/this.a),i}var R2=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const F2={init:D2,forward:N2,inverse:L2,names:R2};var Vf=20;function O2(){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 G2(i){var e=i.x,t=i.y,n,s,o,r=J(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=K?(n=this.a*r,s=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Ti(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=K)n=this.a*r,s=-1*this.ml0;else{var a=Ul(this.a,this.e,Math.sin(t))/Math.tan(t);n=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 i.x=n+this.x0,i.y=s+this.y0,i}function U2(i){var e,t,n,s,o,r,a,l,c;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=K)e=J(n/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,a=n*n/this.a/this.a+r*r,l=r;var h;for(o=Vf;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)<=K){t=l;break}e=J(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=K)t=0,e=J(this.long0+n/this.a,this.over);else{r=(this.ml0+s)/this.a,a=n*n/this.a/this.a+r*r,l=r;var u,p,f,m,y;for(o=Vf;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)<=K){t=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=J(this.long0+Math.asin(n*u/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var V2=["Polyconic","American_Polyconic","poly"];const Q2={init:O2,forward:G2,inverse:U2,names:V2};function z2(){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 H2(i){var e,t=i.x,n=i.y,s=n-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 i.x=A*this.a+this.x0,i.y=g*this.a+this.y0,i}function Y2(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-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,b=r,C=a;for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,b=b+(e-1)*(this.B_re[e]*y-this.B_im[e]*g),C=C+(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=(b*S+C*x)/I,f=(C*S-b*x)/I}var M=p,w=f,T=1,k=0;for(e=1;e<=9;e++)T=T*M,k=k+this.D[e]*T;var R=this.lat0+k*Ps*1e5,G=this.long0+w;return i.x=G,i.y=R,i}var $2=["New_Zealand_Map_Grid","nzmg"];const j2={init:z2,forward:H2,inverse:Y2,names:$2};function W2(){}function q2(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return i.x=s,i.y=o,i}function K2(i){i.x-=this.x0,i.y-=this.y0;var e=J(this.long0+i.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=e,i.y=t,i}var X2=["Miller_Cylindrical","mill"];const J2={init:W2,forward:q2,inverse:K2,names:X2};var Z2=20;function eI(){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=Nl(this.es)}function tI(i){var e,t,n=i.x,s=i.y;if(n=J(n-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=Z2;r;--r){var a=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<K)break}e=this.a*this.C_x*n*(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*Rn(s,l,c,this.en),e=this.a*n*c/Math.sqrt(1-this.es*l*l)}return i.x=e,i.y=t,i}function iI(i){var e,t,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,e=i.y/this.a,this.sphere?(e/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(e))),this.m?e=_i((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=_i(Math.sin(e)/this.n)),n=J(n+this.long0,this.over),e=Ti(e)):(e=Ll(i.y/this.a,this.es,this.en),s=Math.abs(e),s<$?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=J(t,this.over)):s-K<$&&(n=this.long0)),i.x=n,i.y=e,i}var nI=["Sinusoidal","sinu"];const sI={init:eI,forward:tI,inverse:iI,names:nI};function oI(){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 rI(i){for(var e=i.x,t=i.y,n=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)<K)break}s/=2,Math.PI/2-Math.abs(t)<K&&(n=0);var a=.900316316158*this.a*n*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=a,i.y=l,i}function aI(i){var e,t;i.x-=this.x0,i.y-=this.y0,t=i.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var n=J(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return i.x=n,i.y=s,i}var lI=["Mollweide","moll"];const cI={init:oI,forward:rI,inverse:aI,names:lI};function dI(){Math.abs(this.lat1+this.lat2)<K||(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=Xt(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)<K?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Xt(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 hI(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=mt(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*J(e-this.long0,this.over),r=this.x0+n*Math.sin(o),a=this.y0+this.rh-n*Math.cos(o);return i.x=r,i.y=a,i}function uI(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var e,t,n,s;this.ns>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*i.x,e*i.y)),this.sphere)return s=J(this.long0+o/this.ns,this.over),n=Ti(this.g-t/this.a),i.x=s,i.y=n,i;var r=this.g-t/this.a;return n=mr(r,this.e0,this.e1,this.e2,this.e3),s=J(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var fI=["Equidistant_Conic","eqdc"];const pI={init:dI,forward:hI,inverse:uI,names:fI};function mI(){this.R=this.a}function gI(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s,o;Math.abs(t)<=K&&(s=this.x0+this.R*n,o=this.y0);var r=_i(2*Math.abs(t/Math.PI));(Math.abs(n)<=K||Math.abs(Math.abs(t)-$)<=K)&&(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/n-n/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);n<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,i.x=s,i.y=o,i}function yI(i){var e,t,n,s,o,r,a,l,c,h,u,p,f;return i.x-=this.x0,i.y-=this.y0,u=Math.PI*this.R,n=i.x/u,s=i.y/u,o=n*n+s*s,r=-Math.abs(s)*(1+o),a=r-2*s*s+n*n,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,i.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(n)<K?e=this.long0:e=J(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-s*s)+o*o))/2/n,this.over),i.x=e,i.y=t,i}var AI=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const vI={init:mI,forward:gI,inverse:yI,names:AI};function bI(i,e,t,n,s,o){const r=n-e,a=Math.atan((1-o)*Math.tan(i)),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,b,C,S,x,I,M,w,T,k,R,G;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};b=c*u+h*p*A,C=Math.atan2(v,b),S=h*p*g/v,x=1-S*S,I=x!==0?b-2*c*u/x:0,M=o/16*x*(4+o*(4-3*x)),m=f,f=r+(1-M)*o*S*(C+M*v*(I+M*b*(-1+2*I*I)))}while(Math.abs(f-m)>1e-12&&--y>0);return y===0?{azi1:NaN,s12:NaN}:(w=x*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),k=w/1024*(256+w*(-128+w*(74-47*w))),R=k*v*(I+k/4*(b*(-1+2*I*I)-k/6*I*(-3+4*v*v)*(-3+4*I*I))),G=s*(1-o)*T*(C-R),{azi1:Math.atan2(p*g,h*u-c*p*A),s12:G})}function wI(i,e,t,n,s,o){const r=Math.atan((1-o)*Math.tan(i)),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=n/(s*(1-o)*y),v,b=100,C,S,x,I;do C=Math.cos(2*u+A),S=Math.sin(A),x=Math.cos(A),I=g*S*(C+g/4*(x*(-1+2*C*C)-g/6*C*(-3+4*S*S)*(-3+4*C*C))),v=A,A=n/(s*(1-o)*y)+I;while(Math.abs(A-v)>1e-12&&--b>0);if(b===0)return{lat2:NaN,lon2:NaN};const M=a*S-l*x*h,w=Math.atan2(a*x+l*S*h,(1-o)*Math.sqrt(p*p+M*M)),T=Math.atan2(S*c,l*x-a*S*h),k=o/16*f*(4+o*(4-3*f)),R=T-(1-k)*o*p*(A+k*S*(C+k*x*(-1+2*C*C))),G=e+R;return{lat2:w,lon2:G}}function CI(){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 EI(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.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)<=K?(i.x=this.x0+this.a*($-t)*Math.sin(o),i.y=this.y0-this.a*($-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(i.x=this.x0+this.a*($+t)*Math.sin(o),i.y=this.y0+this.a*($+t)*Math.cos(o),i):(m=this.sin_p12*n+this.cos_p12*s*Math.cos(o),p=Math.acos(m),f=p?p/Math.sin(p):1,i.x=this.x0+this.a*f*s*Math.sin(o),i.y=this.y0+this.a*f*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(r=Gs(this.es),a=Us(this.es),l=Vs(this.es),c=Qs(this.es),Math.abs(this.sin_p12-1)<=K?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),i.x=this.x0+(h-u)*Math.sin(o),i.y=this.y0-(h-u)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),i.x=this.x0+(h+u)*Math.sin(o),i.y=this.y0+(h+u)*Math.cos(o),i):Math.abs(e)<K&&Math.abs(t-this.lat0)<K?(i.x=i.y=0,i):(y=bI(this.lat0,this.long0,t,e,this.a,this.f),g=y.azi1,i.x=y.s12*Math.sin(g),i.y=y.s12*Math.cos(g),i))}function xI(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r,a,l,c,h,u,p,f,m,y,g;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*$*this.a?void 0:(t=e/this.a,n=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=K?r=this.lat0:(r=_i(s*this.sin_p12+i.y*n*this.cos_p12/e),a=Math.abs(this.lat0)-$,Math.abs(a)<=K?this.lat0>=0?o=J(this.long0+Math.atan2(i.x,-i.y),this.over):o=J(this.long0-Math.atan2(-i.x,i.y),this.over):o=J(this.long0+Math.atan2(i.x*n,e*this.cos_p12*s-i.y*this.sin_p12*n),this.over)),i.x=o,i.y=r,i)):(l=Gs(this.es),c=Us(this.es),h=Vs(this.es),u=Qs(this.es),Math.abs(this.sin_p12-1)<=K?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(i.x*i.x+i.y*i.y),f=p-e,r=mr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=o,i.y=r,i):Math.abs(this.sin_p12+1)<=K?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(i.x*i.x+i.y*i.y),f=e-p,r=mr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=r,i):(m=Math.atan2(i.x,i.y),y=Math.sqrt(i.x*i.x+i.y*i.y),g=wI(this.lat0,this.long0,m,y,this.a,this.f),i.x=g.lon2,i.y=g.lat2,i))}var II=["Azimuthal_Equidistant","aeqd"];const SI={init:CI,forward:EI,inverse:xI,names:II};function MI(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function TI(i){var e,t,n,s,o,r,a,l,c=i.x,h=i.y;return n=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=K)&&(a=this.a*o*t*Math.sin(n),l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=a,i.y=l,i}function BI(i){var e,t,n,s,o,r,a;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=_i(e/this.a),n=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=K?(a=this.lat0,i.x=r,i.y=a,i):(a=_i(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-$,Math.abs(o)<=K?(this.lat0>=0?r=J(this.long0+Math.atan2(i.x,-i.y),this.over):r=J(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=r,i.y=a,i):(r=J(this.long0+Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),this.over),i.x=r,i.y=a,i))}var _I=["ortho"];const kI={init:MI,forward:TI,inverse:BI,names:_I};var De={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ve={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function PI(){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>=$-Ae/2?this.face=De.TOP:this.lat0<=-($-Ae/2)?this.face=De.BOTTOM:Math.abs(this.long0)<=Ae?this.face=De.FRONT:Math.abs(this.long0)<=$+Ae?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 DI(i){var e={x:0,y:0},t,n,s,o,r,a,l={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,n=i.x,this.face===De.TOP)o=$-t,n>=Ae&&n<=$+Ae?(l.value=ve.AREA_0,s=n-$):n>$+Ae||n<=-($+Ae)?(l.value=ve.AREA_1,s=n>0?n-Ge:n+Ge):n>-($+Ae)&&n<=-Ae?(l.value=ve.AREA_2,s=n+$):(l.value=ve.AREA_3,s=n);else if(this.face===De.BOTTOM)o=$+t,n>=Ae&&n<=$+Ae?(l.value=ve.AREA_0,s=-n+$):n<Ae&&n>=-Ae?(l.value=ve.AREA_1,s=-n):n<-Ae&&n>=-($+Ae)?(l.value=ve.AREA_2,s=-n-$):(l.value=ve.AREA_3,s=n>0?-n+Ge:-n-Ge);else{var c,h,u,p,f,m,y;this.face===De.RIGHT?n=On(n,+$):this.face===De.BACK?n=On(n,+Ge):this.face===De.LEFT&&(n=On(n,-$)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(n),y=Math.cos(n),c=f*y,h=f*m,u=p,this.face===De.FRONT?(o=Math.acos(c),s=yr(o,u,h,l)):this.face===De.RIGHT?(o=Math.acos(h),s=yr(o,u,-c,l)):this.face===De.BACK?(o=Math.acos(-c),s=yr(o,u,-h,l)):this.face===De.LEFT?(o=Math.acos(-h),s=yr(o,u,c,l)):(o=s=0,l.value=ve.AREA_0)}return a=Math.atan(12/Ge*(s+Math.acos(Math.sin(s)*Math.cos(Ae))-$)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===ve.AREA_1?a+=$:l.value===ve.AREA_2?a+=Ge:l.value===ve.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,i.x=e.x,i.y=e.y,i}function NI(i){var e={lam:0,phi:0},t,n,s,o,r,a,l,c,h,u={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?u.value=ve.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(u.value=ve.AREA_1,t-=$):i.x<0&&-i.x>=Math.abs(i.y)?(u.value=ve.AREA_2,t=t<0?t+Ge:t-Ge):(u.value=ve.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(n),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===ve.AREA_0?e.lam=a+$:u.value===ve.AREA_1?e.lam=a<0?a+Ge:a-Ge:u.value===ve.AREA_2?e.lam=a-$:e.lam=a;else if(this.face===De.BOTTOM)c=Math.acos(l),e.phi=c-$,u.value===ve.AREA_0?e.lam=-a+$:u.value===ve.AREA_1?e.lam=-a:u.value===ve.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===ve.AREA_1?(h=f,f=-m,m=h):u.value===ve.AREA_2?(f=-f,m=-m):u.value===ve.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=On(e.lam,-$):this.face===De.BACK?e.lam=On(e.lam,-Ge):this.face===De.LEFT&&(e.lam=On(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,i.x=e.lam,i.y=e.phi,i}function yr(i,e,t,n){var s;return i<K?(n.value=ve.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=Ae?n.value=ve.AREA_0:s>Ae&&s<=$+Ae?(n.value=ve.AREA_1,s-=$):s>$+Ae||s<=-($+Ae)?(n.value=ve.AREA_2,s=s>=0?s-Ge:s+Ge):(n.value=ve.AREA_3,s+=$)),s}function On(i,e){var t=i+e;return t<-Ge?t+=Ds:t>+Ge&&(t-=Ds),t}var LI=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const RI={init:PI,forward:DI,inverse:NI,names:LI};var Hl=[[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]],Qf=.8487,zf=1.3523,Hf=bt/5,FI=1/Hf,Gn=18,Ar=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},OI=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function GI(i,e,t,n){for(var s=e;n;--n){var o=i(s);if(s-=o,Math.abs(o)<t)break}return s}function UI(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function VI(i){var e=J(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*Hf);n<0?n=0:n>=Gn&&(n=Gn-1),t=bt*(t-FI*n);var s={x:Ar(Hl[n],t)*e,y:Ar(zs[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Qf+this.x0,s.y=s.y*this.a*zf+this.y0,s}function QI(i){var e={x:(i.x-this.x0)/(this.a*Qf),y:Math.abs(i.y-this.y0)/(this.a*zf)};if(e.y>=1)e.x/=Hl[Gn][0],e.y=i.y<0?-$:$;else{var t=Math.floor(e.y*Gn);for(t<0?t=0:t>=Gn&&(t=Gn-1);;)if(zs[t][0]>e.y)--t;else if(zs[t+1][0]<=e.y)++t;else break;var n=zs[t],s=5*(e.y-n[0])/(zs[t+1][0]-n[0]);s=GI(function(o){return(Ar(n,o)-e.y)/OI(n,o)},s,K,100),e.x/=Ar(Hl[t],s),e.y=(5*t+s)*Oe,i.y<0&&(e.y=-e.y)}return e.x=J(e.x+this.long0,this.over),e}var zI=["Robinson","robin"];const HI={init:UI,forward:VI,inverse:QI,names:zI};function YI(){this.name="geocent"}function $I(i){var e=bf(i,this.es,this.a);return e}function jI(i){var e=wf(i,this.es,this.a,this.b);return e}var WI=["Geocentric","geocentric","geocent","Geocent"];const qI={init:YI,forward:$I,inverse:jI,names:WI};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 KI(){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)-$)<K?this.mode=this.lat0<0?dt.S_POLE:dt.N_POLE:Math.abs(this.lat0)<K?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 i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function XI(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s,o;switch(this.mode){case dt.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case dt.EQUIT:o=t*n;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(i.x),this.mode){case dt.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case dt.EQUIT:o*=e;break;case dt.N_POLE:o*=-(t*n);break;case dt.S_POLE:o*=t*n;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,i.x=s*this.a,i.y=o*this.a,i}function JI(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,n,s;s=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=t*this.cg+n*this.sg,i.y=n*this.cg-t*this.sg;var o=Et(i.x,i.y);if(Math.abs(o)<K)e.x=0,e.y=i.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+i.y*a*this.cosph0/o),i.y=(r-this.sinph0*Math.sin(e.y))*o,i.x*=a*this.cosph0;break;case dt.EQUIT:e.y=Math.asin(i.y*a/o),i.y=r*o,i.x*=a;break;case dt.N_POLE:e.y=Math.asin(r),i.y=-i.y;break;case dt.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(i.x,i.y)}return i.x=e.x+this.long0,i.y=e.y,i}var ZI=["Tilted_Perspective","tpers"];const eS={init:KI,forward:XI,inverse:JI,names:ZI};function tS(){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 i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,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 iS(i){var e=i.x,t=i.y,n,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 i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Et(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Et(o,n)))}else this.shape==="sphere"&&(n=Math.cos(t),s=Math.cos(e)*n,o=Math.sin(e)*n,r=Math.sin(t),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Et(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Et(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function nS(i){var e=-1,t=0,n=0,s,o,r,a;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Et(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Et(1,t));var l=n/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 i.x=Number.NaN,i.y=Number.NaN,i;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,n*=a,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+n*n+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,n*=a,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var sS=["Geostationary Satellite View","Geostationary_Satellite","geos"];const oS={init:tS,forward:iS,inverse:nS,names:sS};var Ys=1.340264,$s=-.081106,js=893e-6,Ws=.003796,vr=Math.sqrt(3)/2;function rS(){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 aS(i){var e=J(i.x-this.long0,this.over),t=i.y,n=Math.asin(vr*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(vr*(Ys+3*$s*s+o*(7*js+9*Ws*s))),i.y=n*(Ys+$s*s+o*(js+Ws*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function lS(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,t=12,n=i.y,s,o,r,a,l,c;for(c=0;c<t&&(s=n*n,o=s*s*s,r=n*(Ys+$s*s+o*(js+Ws*s))-i.y,a=Ys+3*$s*s+o*(7*js+9*Ws*s),n-=l=r/a,!(Math.abs(l)<e));++c);return s=n*n,o=s*s*s,i.x=vr*i.x*(Ys+3*$s*s+o*(7*js+9*Ws*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/vr),i.x=J(i.x+this.long0,this.over),i}var cS=["eqearth","Equal Earth","Equal_Earth"];const dS={init:rS,forward:aS,inverse:lS,names:cS};var qs=1e-10;function hS(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<qs)throw new Error;this.es?(this.en=Nl(this.es),this.m1=Rn(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=fS,this.forward=uS):(Math.abs(this.phi1)+qs>=$?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=mS,this.forward=pS)}function uS(i){var e=J(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-Rn(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function fS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n,s;if(t=Et(i.x,i.y=this.am1-i.y),s=Ll(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<$)e=Math.sin(s),n=t*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-$)<=qs)n=0;else throw new Error;return i.x=J(n+(this.long0||0),this.over),i.y=Ti(s),i}function pS(i){var e=J(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>qs?(i.x=s*Math.sin(n=e*Math.cos(t)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function mS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=Et(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>$)throw new Error;return Math.abs(Math.abs(t)-$)<=qs?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=J(e+(this.long0||0),this.over),i.y=Ti(t),i}var gS=["bonne","Bonne (Werner lat_1=90)"];const yS={init:hS,names:gS},Yf={OBLIQUE:{forward:CS,inverse:xS},TRANSVERSE:{forward:ES,inverse:IS}},br={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 AS(){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=mf.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 i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Pt(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const n=Object.keys(br),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<n.length;a++){const l=n[a],c=br[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}=wS(this,t);this.lamp=o,Math.abs(r)>K?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=Yf.OBLIQUE):this.projectionType=Yf.TRANSVERSE}function vS(i){return this.projectionType.forward(this,i)}function bS(i){return this.projectionType.inverse(this,i)}function wS(i,e){let t,n;if(e===br.ROTATE){let s=i.oLongC,o=i.oLatC,r=i.oAlpha;if(Math.abs(Math.abs(o)-$)<=K)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=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===br.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,r=i.oLong2,a=i.oLat2,l=Math.abs(o);if(Math.abs(o)>$-K)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(a)>$-K)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-a)<K)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<K)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=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(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function CS(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(t),o=Math.sin(n),r=Math.cos(n);e.x=J(Math.atan2(r*Math.sin(t),i.sphip*r*s+i.cphip*o)+i.lamp),e.y=Math.asin(i.sphip*o-i.cphip*r*s);const a=i.obliqueProjection.forward(e);return i.isIdentity&&(a.x*=bt,a.y*=bt),a}function ES(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=J(Math.atan2(s*Math.sin(t),Math.sin(n))+i.lamp),e.y=Math.asin(-1*s*o);const r=i.obliqueProjection.forward(e);return i.isIdentity&&(r.x*=bt,r.y*=bt),r}function xS(i,e){i.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){n-=i.lamp;const o=Math.cos(n),r=Math.sin(s),a=Math.cos(s);e.x=Math.atan2(a*Math.sin(n),i.sphip*a*o-i.cphip*r),e.y=Math.asin(i.sphip*r+i.cphip*a*o)}return e.x=J(e.x+i.long0),e}function IS(i,e){i.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){const o=Math.cos(s);n-=i.lamp,e.x=Math.atan2(o*Math.sin(n),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(n))}return e.x=J(e.x+i.long0),e}var SS=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const MS={init:AS,forward:vS,inverse:bS,names:SS};function TS(i){i.Proj.projections.add(fr),i.Proj.projections.add(pr),i.Proj.projections.add(gx),i.Proj.projections.add(Ix),i.Proj.projections.add(_x),i.Proj.projections.add(Lx),i.Proj.projections.add(Vx),i.Proj.projections.add($x),i.Proj.projections.add(Xx),i.Proj.projections.add(i2),i.Proj.projections.add(m2),i.Proj.projections.add(w2),i.Proj.projections.add(S2),i.Proj.projections.add(P2),i.Proj.projections.add(F2),i.Proj.projections.add(Q2),i.Proj.projections.add(j2),i.Proj.projections.add(J2),i.Proj.projections.add(sI),i.Proj.projections.add(cI),i.Proj.projections.add(pI),i.Proj.projections.add(vI),i.Proj.projections.add(SI),i.Proj.projections.add(kI),i.Proj.projections.add(RI),i.Proj.projections.add(HI),i.Proj.projections.add(qI),i.Proj.projections.add(eS),i.Proj.projections.add(oS),i.Proj.projections.add(dS),i.Proj.projections.add(yS),i.Proj.projections.add(MS)}const Ks=Object.assign(DE,{defaultDatum:"WGS84",Proj:Pt,WGS84:new Pt("WGS84"),Point:Ln,toPoint:If,defs:st,nadgrid:mE,transform:hr,mgrs:NE,version:"__VERSION__"});TS(Ks);class BS{cesium;viewer;watermarkEnabled="";setWatermarkEnabled(e){this.watermarkEnabled=e}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(()=>zd),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 n=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(n){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 n({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(()=>zd),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(()=>zd),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 n=await t.json();let s=null;const o=Array.isArray(n?.items)?n.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(n?.items)&&n.items.length){const c=n.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(n?.items)?n.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=M=>M/g*360-180,v=M=>{const w=Math.PI-2*Math.PI*M/g;return 180/Math.PI*Math.atan(Math.sinh(w))},b=A(p),C=A(f+1),S=v(m),x=v(y+1),I=this.cesium.Rectangle.fromDegrees(b,x,C,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 n=this.mapLayers[t.modelId];n&&Object.values(n).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t.show!==!1)})})}),this.viewer.scene.requestRender())}getCameraHeightAboveGround(e){const t=this.viewer?.camera?.positionCartographic;if(!t)return 1/0;const n=t.height,s=e?.buildOptions?.clampToGround??e?.formData?.clampToGround??!1;let o=0;if(s)try{const r=this.viewer?.scene?.globe;if(r){const a=r.getHeight(t);a!==void 0&&Number.isFinite(a)&&(o=a)}}catch{}else o=e?.transform?.originHeight??e?.formData?.height??0;return n-o}applyHeightLod(){if(!this.heightLodEnabled)return;const{full:e,medium:t,far:n}=this.heightLodThresholds;this.gisCadModelsList.forEach(s=>{const o=this.mapLayers[s.modelId];if(!o||s.show===!1)return;const r=this.getCameraHeightAboveGround(s);Object.values(o).forEach(a=>{a.forEach(l=>{if(!l.primitive)return;let c=!0;r>n?c=l.type==="polygon":r>t?c=l.type!=="point":r>e&&(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(n=>n.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},n=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(n,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,n,[o,r]);return{direction:e.direction,longitude:a,latitude:l,config:t}}showJson({modelId:e,show:t}){const n=this.getRuntimeModel(e);n?.root&&(n.show=t,n.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})}),n&&(t?n._overviewLODCheck?.():(n.overviewL0Roots?.forEach(s=>{s.show=!1}),n.overviewL1Roots?.forEach(s=>{s.show=!1})))}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.mapLayers[e];!s||!Array.isArray(n)||n.forEach(o=>{const r=s[o];r&&r.forEach(a=>{a.primitive&&(a.primitive.show=t)})})}async flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.gisCadModelsList.find(o=>o.modelId===t);if(!n)return;try{const r=`${n.outPutPath?.endsWith("/")?n.outPutPath:`${n.outPutPath}/`}${n.dbName}/cameraView.zip`,a=await Mt(r);if(a&&a.position&&a.orientation){const l=new this.cesium.Cartesian3(a.position.x,a.position.y,a.position.z),c=new this.cesium.HeadingPitchRoll(a.orientation.heading,a.orientation.pitch,a.orientation.roll);this.viewer.camera.flyTo({destination:l,orientation:c,duration:a.duration??1});return}}catch(o){console.warn("[flyToCadModel] 读取 cameraView.zip 失败,回退到默认视角",o)}const s=e.minHeight??n._rebuildContext?.overviewL1Height;this.flyToBounds(n,{duration:e.duration,minHeight:s})}flyToBounds(e,t){if(!e)return;const n=t?.duration??0,s=t?.minHeight,o=this.cesium,r=(l,c,h,u)=>{let p=l,f=c,m=h,y=u;if(s){const A=(p+m)/2,v=(f+y)/2,b=s/111e3,C=Math.max((m-p)/2,b),S=Math.max((y-f)/2,b);p=A-C,m=A+C,f=v-S,y=v+S}const g=o.Rectangle.fromDegrees(p,f,m,y);this.viewer.camera.flyTo({destination:g,duration:n})};{const l=e.overviewL0Tiles;if(l?.length){let c=1/0,h=1/0,u=-1/0,p=-1/0,f=0;for(const m of l){if(!m.lonLatBounds)continue;const y=m.lonLatBounds;y.west<c&&(c=y.west),y.south<h&&(h=y.south),y.east>u&&(u=y.east),y.north>p&&(p=y.north),f++}if(f>0&&Number.isFinite(c)&&Number.isFinite(u)){r(c,h,u,p);return}}}const a=this.computeRealRectangleDegrees(e);if(a){r(a.west,a.south,a.east,a.north);return}e.root&&this.viewer.flyTo(e.root,{duration:n})}computeRealRectangleDegrees(e){const t=e?.formData||{},n=e?.bounds,s=n?.min,o=n?.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 n=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return n;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),n}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1.25:Math.max(2.5,e*5)}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),n=Number(e[1]),s=Number(e[2]||0);return[t,n,s].some(o=>Number.isNaN(o))?null:[t,n,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([n,s])=>{e[n]||(e[n]=[]),e[n].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,n=!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??n}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const n=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=s.scaleToMeter??e.result?.scaleToMeter??e.result?.realUnits??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 C=this.buildLongLatProj4Def(s.transformConfig),S=this.buildProjectedProj4Def(s.transformConfig);f=Ks(S,C),console.log("[buildTransform] proj4 mode:",{projectedDef:S,localOriginX:l,localOriginY:c});try{const[x,I]=f.forward([l,c]);if(!Number.isFinite(x)||!Number.isFinite(I))console.warn("proj4 returned NaN for base point",{localOriginX:l,localOriginY:c,blon:x,blat:I}),f=null;else{o=x,r=I,console.log("[buildTransform] proj4 base:",{blon:x,blat:I}),a=0,m=n.Cartesian3.fromDegrees(x,I,0);const M=n.Transforms.eastNorthUpToFixedFrame(m);y=n.Matrix4.inverseTransformation(M,new n.Matrix4)}}catch(x){console.warn("Failed to calculate projection base",x),f=null}}const g=n.Cartesian3.fromDegrees(o,r,a),A=n.Transforms.eastNorthUpToFixedFrame(g),v=s.totalRotation??t.totalRotation??0;if(v){const C=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(v)),S=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(C),new n.Cartesian3(0,0,0));n.Matrix4.multiply(A,S,A)}return{originLongitude:o,originLatitude:r,originHeight:a,localOriginX:l,localOriginY:c,scaleToMeter:h,scale:u,totalScaleToMeter:p,toWorld:C=>{const S=this.normalizePoint(C);if(!S)return null;if(f&&m&&y)try{const[I,M]=f.forward([S[0],S[1]]);if(!(!Number.isFinite(I)||!Number.isFinite(M))){const w=n.Cartesian3.fromDegrees(I,M,S[2]),T=n.Matrix4.multiplyByPoint(y,w,new n.Cartesian3);return T.x*=u,T.y*=u,T.z*=u,n.Matrix4.multiplyByPoint(A,T,new n.Cartesian3)}}catch{}const x=new n.Cartesian3((S[0]-l)*p,(S[1]-c)*p,S[2]*p);return n.Matrix4.multiplyByPoint(A,x,new n.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,releaseGeometryInstances:!1,classificationType:this.cesium.ClassificationType.TERRAIN,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,releaseGeometryInstances:!1,classificationType:this.cesium.ClassificationType.TERRAIN,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(n=>{t.add(n)}),t}buildModelPrimitives(e,t,n){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(A=>{const b=(Array.isArray(A?.positions)?A.positions:[]).map(M=>l.toWorld(M)).filter(Boolean);if(b.length<2)return;const C=A.layer||"default",S=A.color||"#ffffff",x=this.uniqueKey([C,"line",this.getLineWidth(A.lineWeight)]),I=c.get(x)||[];I.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:b,width:this.getLineWidth(A.lineWeight)}):new s.PolylineGeometry({positions:b,width:this.getLineWidth(A.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(S,1))},id:{modelId:e.modelId,layer:C,batchId:A.batchId,type:"line"}})),c.set(x,I)}),f.forEach(A=>{const b=(Array.isArray(A?.outerPositions)?A.outerPositions:[]).map(w=>l.toWorld(w)).filter(Boolean);if(b.length<3)return;const C=Array.isArray(A?.holes)?A.holes.map(w=>{const T=Array.isArray(w)?w.map(k=>l.toWorld(k)).filter(Boolean):[];return T.length<3?null:new s.PolygonHierarchy(T)}).filter(Boolean):[],S=A.layer||"default",x=A.color||"#ffffff",I=this.uniqueKey([S,"polygon"]),M=h.get(I)||[];M.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(b,C),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(x,.45))},id:{modelId:e.modelId,layer:S,batchId:A.batchId,type:"polygon"}})),h.set(I,M)});const y=1;m.forEach(A=>{const v=A?.position||A?.positions?.[0]||A,b=this.normalizePoint(v);if(!b)return;const C=b[0],S=b[1],x=b[2]||0,I=A.layer||"default",M=A.color||"#ffffff",w=this.uniqueKey([I,"line",this.getLineWidth(A.lineWeight)]),T=c.get(w)||[],k=[l.toWorld([C-y,S,x]),l.toWorld([C+y,S,x])].filter(Boolean);k.length>=2&&T.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:k,width:this.getLineWidth(A.lineWeight)}):new s.PolylineGeometry({positions:k,width:this.getLineWidth(A.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(M,1))},id:{modelId:e.modelId,layer:I,batchId:A.batchId,type:"point"}})),c.set(w,T)});const g=(A,v,b)=>{v&&(o.add(v),n.recordLayers!==!1&&(a[A]||(a[A]=[]),a[A].push({primitive:v,color:b.color,batchId:b.batchId,type:b.type})),r[A]||(r[A]={}),r[A][b.type]=v)};return c.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createLinePrimitive(A,n),{color:void 0,batchId:A[0]?.id?.batchId,type:"line"})}),h.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createPolygonPrimitive(A,n),{color:void 0,batchId:A[0]?.id?.batchId,type:"polygon"})}),u.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createPointPrimitive(A),{color:void 0,batchId:A[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:a,transform:l}}buildModelRoot(e,t,n){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(a=>{const l=this.buildModelPrimitives(e,a,n);r||(r=l),s.add(l.root),this.mergeLayerItemsMap(o,l.layerItemsMap)}),{root:s,primaryRoot:r?.root??null,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(n=>n.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){const n=this.cesium;t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround),e.tileCameraListenerRemove?.(),e.overviewLODListenerRemove?.(),e.tileCameraListenerRemove=void 0,e.overviewLODListenerRemove=void 0,e._overviewLODCheck=void 0,e._tileLODCheck=void 0,e.root&&(this.viewer.scene.primitives.remove(e.root),e.root.destroy&&!e.root.isDestroyed?.()&&e.root.destroy()),e.root=null,e.groundRoot=null,e.previewRoot=null,e.tileRoots?.clear(),e.overviewL0Roots?.clear(),e.overviewL1Roots?.clear(),e.formData=t;const s=e.sourceDataList?.[0];if(!s)return;const o=this.buildModelRoot({...e,formData:t},[s],e.buildOptions),r=new n.PrimitiveCollection;r.add(o.root),e.root=r,e.groundRoot=o.root,e.primaryRoot=o.primaryRoot,e.groundRoot.show=e.show!==!1,e.transform=o.transform,e.sourceDataList=[s],e.loadedChunks=1,e.tileRoots=e.manifestTiles?new Map:void 0,e.overviewL0Roots=new Map,e.overviewL1Roots=new Map,this.mapLayers[e.modelId]=o.layerItemsMap,this.viewer.scene.primitives.add(e.root),e.manifestTiles&&this.computeManifestTileLonLatBounds(e.manifestTiles,e.transform),e.overviewL0Tiles&&this.computeManifestTileLonLatBounds(e.overviewL0Tiles,e.transform),e.overviewL1Tiles&&this.computeManifestTileLonLatBounds(e.overviewL1Tiles,e.transform);const a=e._rebuildContext;a&&((e.overviewL0Tiles?.length||e.overviewL1Tiles?.length)&&this.setupOverviewLOD(e,e,a.normalizedBase,e.overviewL0Tiles||[],e.overviewL1Tiles||[],a.overviewL1Height),e.manifestTiles&&this.setupManifestTileLoading(e,e,a.normalizedBase)),this.viewer.scene.requestRender()}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 n=await t.blob(),s=new gl(new tr(n),{password:ju,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}/`,n=[e.sourceUrl,`${t}${e.dbName}/cad.zip`].filter(Boolean);return Array.from(new Set(n))}getChunkCandidateUrls(e,t,n){const o=[`${e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`}${e.dbName}/cad_${n}.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}_${n}${u}`,`${r.origin}${c}${f}${n}${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 n of t){const s=await this.loadModelFile(n);if(s)return{url:n,data:s}}return{url:t[0]||"",data:!1}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const n={...this.options,...t},s={clampToGround:n.clampToGround??n.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(v=>v.modelId===o.modelId))continue;/^(https?|atom):\/\//i.test(o.outPutPath)||(o.outPutPath=`${window.location.origin}${o.outPutPath}`);const a=o.outPutPath.endsWith("/")?o.outPutPath:`${o.outPutPath}/`,l=`${a}${o.dbName}/region.zip`;let c=!1;try{(await fetch(l,{method:"HEAD",cache:"no-store"})).ok&&(c=await this.loadModelFile(l))}catch{}c&&typeof c=="object"&&(["longitude","latitude","scale","totalRotation","height","scaleToMeter"].some(C=>c[C]!==void 0)&&(o.formData={longitude:c.longitude,latitude:c.latitude,scale:c.scale,totalRotation:c.totalRotation,height:c.height,scaleToMeter:c.scale,...o.formData||{}}),c.centralMeridian!==void 0&&(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",...o.formData||{}}));const h=`${a}${o.dbName}/manifest.zip`;let u=null,p=null,f=null,m=6e3;try{const v=await this.loadModelFile(h);v?.watermark&&Wu(v.watermark,this.viewer?.container),v&&typeof v=="object"&&($u.includes(this.watermarkEnabled)&&sr(this.viewer?.container),v?.tiles&&Array.isArray(v.tiles)&&(u=v.tiles),Array.isArray(v?.overviewL0)&&(p=v.overviewL0),Array.isArray(v?.overviewL1)&&(f=v.overviewL1,m=Number(v.overviewL1Height)||6e3))}catch{}console.log("[addGISCadModel] formData:",JSON.stringify(o.formData)),console.log("[addGISCadModel] manifestTiles:",u?.length,"L0:",p?.length,"L1:",f?.length);const y=await this.loadSourceData(o);if(!y.data){console.error("Failed to resolve GIS CAD primary source for model:",o);continue}const g=y.data,A=Math.max(1,Number(g.numbersOfFile||1));try{const v=this.buildTransform(g,o),b=this.normalizeFormData(o,v,s.clampToGround),C=this.buildModelRoot({...o,formData:b},[g],s),S=new this.cesium.PrimitiveCollection;S.add(C.root);const x=g.bounds||null,I={...o,type:"gis-cad",sourceUrl:y.url,sourceData:g,sourceDataList:[g],root:S,groundRoot:C.root,primaryRoot:C.primaryRoot,previewRoot:null,bounds:x,transform:C.transform,show:!0,formData:b,editingFormData:null,isEditing:!1,buildOptions:s,totalChunks:u?u.length:A,loadedChunks:1,chunkLoadingComplete:!u&&A<=1,manifestTiles:u||void 0,tileRoots:u?new Map:void 0,pendingFontTiles:u?u.filter(M=>M.isFont&&M.file!=="cad.zip").map(M=>M.file):[],_rebuildContext:{normalizedBase:a,overviewL1Height:m}};this.mapLayers[o.modelId]=C.layerItemsMap,this.viewer.scene.primitives.add(I.root),this.gisCadModelsList.push(I),this.setModelId(o.modelId),p&&(this.computeManifestTileLonLatBounds(p,I.transform),I.overviewL0Tiles=p),n.flyTo&&this.flyToBounds(I),n.onSuccess&&n.onSuccess(I),(p||f)&&(f&&(this.computeManifestTileLonLatBounds(f,I.transform),I.overviewL1Tiles=f),this.setupOverviewLOD(o,I,a,p||[],f||[],m)),u?(this.computeManifestTileLonLatBounds(u,I.transform),this.setupManifestTileLoading(o,I,a)):A>1&&this.loadRemainingChunksAsync(o,y.url,A,I)}catch(v){console.error("Failed to build GIS CAD model:",o,v)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}async loadRemainingChunksAsync(e,t,n,s){for(let o=1;o<n;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,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:n}),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)}setupOverviewLOD(e,t,n,s,o,r=6e3){const a=this.cesium;t.overviewL0Roots=new Map,t.overviewL1Roots=new Map;const l=C=>{if(!C.lonLatBounds)return!1;let S=null;try{S=this.viewer?.camera?.computeViewRectangle?.()??null}catch{S=null}if(!S)return!0;const x=a.Rectangle.fromDegrees(C.lonLatBounds.west,C.lonLatBounds.south,C.lonLatBounds.east,C.lonLatBounds.north);return a.Rectangle.intersection(S,x)!==void 0},c=async(C,S)=>{if(S.has(C.file))return;const x=`${n}${e.dbName}/${C.file}`;try{const I=await this.loadModelFile(x);if(!I)return;const M=this.buildModelPrimitives({...t,formData:t.formData},I,t.buildOptions);t.groundRoot.add(M.root),S.set(C.file,M.root),this.viewer.scene.requestRender()}catch(I){console.warn(`Failed to load overview chunk ${C.file}:`,I)}},h=(C,S)=>{const x=S.get(C);if(x){try{t.groundRoot.remove(x),x.destroy&&x.destroy()}catch{}S.delete(C)}};let u=0;const p=3,f=[],m=()=>{for(;u<p&&f.length>0;){const{tile:C,rootMap:S}=f.shift();S.has(C.file)||(u++,c(C,S).finally(()=>{u--,m()}))}},y=(C,S)=>{S.has(C.file)||f.some(x=>x.tile.file===C.file)||f.push({tile:C,rootMap:S})},g=()=>{if(!t.overviewL0Roots||!t.overviewL1Roots)return;const C=this.getCameraHeightAboveGround(t),S=1500;for(const w of s)l(w)?y(w,t.overviewL0Roots):h(w.file,t.overviewL0Roots);for(const w of o)l(w)&&C>=S&&C<r?y(w,t.overviewL1Roots):h(w.file,t.overviewL1Roots);const x=(t.tileRoots?.size||0)>0,I=C>=S&&!x&&(C>=r||C<r&&t.overviewL1Roots.size===0);t.overviewL0Roots.forEach(w=>{w.show=I});const M=C>=S&&!x&&t.overviewL1Roots.size>0&&C<r;t.overviewL1Roots.forEach(w=>{w.show=M}),t.primaryRoot&&(t.primaryRoot.show=C>=S),m(),this.viewer.scene.requestRender()};t._overviewLODCheck=g;let A=null;const v=()=>{A&&clearTimeout(A),A=setTimeout(()=>{A=null,g()},200)},b=this.viewer?.camera?.moveEnd?.addEventListener?.(v);typeof b=="function"&&(t.overviewLODListenerRemove=()=>{A&&clearTimeout(A),b()}),g()}computeManifestTileLonLatBounds(e,t){if(!t?.toWorld){console.warn("[computeManifestTileLonLatBounds] modelTransform.toWorld 不存在,跳过");return}const n=this.cesium;console.log("[computeManifestTileLonLatBounds] transform 参数:",{originLongitude:t.originLongitude,originLatitude:t.originLatitude,localOriginX:t.localOriginX,localOriginY:t.localOriginY,scaleToMeter:t.scaleToMeter,scale:t.scale,totalScaleToMeter:t.totalScaleToMeter});let s=0,o=0;const r=(a,l)=>{try{const c=t.toWorld([a,l,0]);if(!c)return null;const h=n.Cartographic.fromCartesian(c);return[n.Math.toDegrees(h.longitude),n.Math.toDegrees(h.latitude)]}catch{return null}};for(const a of e){if(!a.bounds)continue;const{minX:l,minY:c,maxX:h,maxY:u}=a.bounds,p=r(l,c),f=r(h,u);p&&f?(a.lonLatBounds={west:Math.min(p[0],f[0]),south:Math.min(p[1],f[1]),east:Math.max(p[0],f[0]),north:Math.max(p[1],f[1])},s++):o++}if(console.log(`[computeManifestTileLonLatBounds] 成功=${s} 失败=${o} 总共=${e.length}`),s>0){const a=e.find(l=>l.lonLatBounds);console.log("[computeManifestTileLonLatBounds] 示例:",a?.file,a?.lonLatBounds)}}setupManifestTileLoading(e,t,n){const a=this.cesium,l=t.manifestTiles||[];if(l.length===0)return;const c=x=>{if(!x.lonLatBounds)return!1;let I=null;try{I=this.viewer?.camera?.computeViewRectangle?.()??null}catch{I=null}if(!I)return!0;const M=a.Rectangle.fromDegrees(x.lonLatBounds.west,x.lonLatBounds.south,x.lonLatBounds.east,x.lonLatBounds.north);return a.Rectangle.intersection(I,M)!==void 0},h=x=>{const I=t.tileRoots?.get(x);if(I){try{t.groundRoot.remove(I),I.destroy&&I.destroy()}catch{}t.tileRoots?.delete(x),t.loadedChunks=Math.max(1,(t.loadedChunks||1)-1),this.events.emit("chunkProgress",{modelId:t.modelId,loaded:t.loadedChunks,total:t.totalChunks}),t._overviewLODCheck?.(),this.viewer.scene.requestRender()}},u=new Map,p=3;let f=0;const m=[],y=x=>{const I=u.get(x);I&&(clearTimeout(I),u.delete(x));const M=m.indexOf(x);M>=0&&m.splice(M,1)},g=()=>{for(;f<p&&m.length>0;){const x=m.shift(),I=l.find(M=>M.file===x);!I||t.tileRoots?.has(x)||!c(I)||(f++,A(x).finally(()=>{f--,g()}))}},A=async x=>{if(t.tileRoots?.has(x))return;const I=`${n}${e.dbName}/${x}`;try{const M=await this.loadModelFile(I);if(M?.watermark&&this.watermarkEnabled,!M)return;const w=this.buildModelPrimitives({...t,formData:t.formData},M,t.buildOptions);t.groundRoot.add(w.root),t.tileRoots?.set(x,w.root),t.sourceDataList.push(M),this.mapLayers[t.modelId]||(this.mapLayers[t.modelId]={}),this.mergeLayerItemsMap(this.mapLayers[t.modelId],w.layerItemsMap),t.loadedChunks=(t.loadedChunks||1)+1,this.events.emit("chunkProgress",{modelId:t.modelId,loaded:t.loadedChunks,total:t.totalChunks}),t._overviewLODCheck?.(),this.viewer.scene.requestRender()}catch(M){console.error("Failed to load CAD tile:",I,M)}},v=()=>{if(!t.tileRoots)return;const x=this.getCameraHeightAboveGround(t);console.log("cameraHeight",x);const I=x<1e3;for(const M of l){if(M.file==="cad.zip"||!t.tileRoots.has(M.file))continue;let w=!1;M.isFont?I&&c(M)||(w=!0):c(M)?x>=1500&&(w=!0):w=!0,w&&(y(M.file),h(M.file),M.isFont&&!t.pendingFontTiles?.includes(M.file)&&t.pendingFontTiles?.push(M.file))}for(const M of l)if(M.file!=="cad.zip"&&!t.tileRoots.has(M.file)&&!u.has(M.file)&&!m.includes(M.file)&&!(M.isFont&&!I)&&!(!M.isFont&&x>=1500)&&c(M)){const w=M.file,T=setTimeout(()=>{u.delete(w),!t.tileRoots?.has(w)&&c(M)&&!m.includes(w)&&(m.push(w),g())},20);u.set(M.file,T)}t.primaryRoot&&(t.primaryRoot.show=x>=1500)};let b=null;const C=()=>{b&&clearTimeout(b),b=setTimeout(()=>{b=null,v()},20)},S=this.viewer?.camera?.moveEnd?.addEventListener?.(C);typeof S=="function"&&(t.tileCameraListenerRemove=()=>{b&&clearTimeout(b),S()}),t._tileLODCheck=v,v()}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.formData={...t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.replaceGroundRoot(t,t.formData),this.flyToBounds(t,{duration:0,minHeight:t._rebuildContext?.overviewL1Height}),t.formData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t&&(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(n=>n.modelId===e);if(t>-1){const n=this.gisCadModelsList[t];n.tileCameraListenerRemove?.(),n.overviewLODListenerRemove?.(),this.viewer.scene.primitives.remove(n.root),n.root?.destroy&&!n.root.isDestroyed?.()&&n.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class ki{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const n=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:n,anchor:n==2,closeBtn:n==2,offset:n==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`+i;var p=u/2,f=0,m=0,y,g,A,v,b;return p>0&&(y=1e5/Math.pow(10,p),g=i.substring(o,o+p),f=parseFloat(g)*y,A=i.substring(o+p),m=parseFloat(A)*y),v=f+c,b=m+h,{easting:v,northing:b,zoneLetter:a,zoneNumber:r,accuracy:y}}function VE(i,e){for(var t=Bf.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===Ct&&t++,t===Dt&&t++,t>Os){if(s)throw"Bad character: "+i;t=Nn,s=!0}n+=1e5}return n}function QE(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=_f.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===Ct&&t++,t===Dt&&t++,t>Fs){if(s)throw"Bad character: "+i;t=Nn,s=!0}n+=1e5}return n}function zE(i){var e;switch(i){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: "+i}function Ln(i,e,t){if(!(this instanceof Ln))return new Ln(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var n=i.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ln.fromMGRS=function(i){return new Ln(Pf(i))},Ln.prototype.toMGRS=function(i){return kf([this.x,this.y],i)};var HE=1,YE=.25,Rf=.046875,Ff=.01953125,Of=.01068115234375,$E=.75,jE=.46875,WE=.013020833333333334,qE=.007120768229166667,KE=.3645833333333333,XE=.005696614583333333,JE=.3076171875;function Nl(i){var e=[];e[0]=HE-i*(YE+i*(Rf+i*(Ff+i*Of))),e[1]=i*($E-i*(Rf+i*(Ff+i*Of)));var t=i*i;return e[2]=t*(jE-i*(WE+i*qE)),t*=i,e[3]=t*(KE-i*XE),e[4]=t*i*JE,e}function Rn(i,e,t,n){return t*=e,e*=e,n[0]*i-t*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var ZE=20;function Ll(i,e,t){for(var n=1/(1-e),s=i,o=ZE;o;--o){var r=Math.sin(s),a=1-e*r*r;if(a=(Rn(s,r,Math.cos(s),t)-i)*(a*Math.sqrt(a))*n,s-=a,Math.abs(a)<K)return s}return s}function ex(){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=Nl(this.es),this.ml0=Rn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function tx(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s,o,r,a=Math.sin(t),l=Math.cos(t);if(this.es){var h=l*n,u=Math.pow(h,2),p=this.ep2*Math.pow(l,2),f=Math.pow(p,2),m=Math.abs(l)>K?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=Rn(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*n*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(n);if(Math.abs(Math.abs(c)-1)<K)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,r=l*Math.cos(n)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(r),c>=1){if(c-1>K)return 93;r=0}else r=Math.acos(r);t<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return i.x=o,i.y=r,i}function ix(i){var e,t,n,s,o=(i.x-this.x0)*(1/this.a),r=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+r/this.k0,t=Ll(e,this.es,this.en),Math.abs(t)<$){var u=Math.sin(t),p=Math.cos(t),f=Math.abs(p)>K?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,b=Math.pow(v,2);e=e*f,n=t-e*b/(1-this.es)*.5*(1-b/12*(5+3*g-9*m*g+m-4*y-b/30*(61+90*g-252*m*g+45*A+46*m-b/56*(1385+3633*g+4095*A+1574*A*g)))),s=J(this.long0+v*(1-b/6*(1+2*g+m-b/20*(5+28*g+24*A+8*m*g+6*m-b/42*(61+662*g+1320*A+720*A*g))))/p,this.over)}else n=$*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))),n=Math.asin(e),r<0&&(n=-n),l===0&&h===0?s=0:s=J(Math.atan2(l,h)+this.long0,this.over)}return i.x=s,i.y=n,i}var nx=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const fr={init:ex,forward:tx,inverse:ix,names:nx};function Gf(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Et(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),n=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(n,2))}function sx(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function ox(i){var e=Math.abs(i);return e=sx(e*(1+e/(Et(1,e)+1))),i<0?-e:e}function Rl(i,e){for(var t=2*Math.cos(2*e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return e+r*Math.sin(2*e)}function rx(i,e){for(var t=2*Math.cos(e),n=i.length-1,s=i[n],o=0,r;--n>=0;)r=-o+t*s+i[n],o=s,s=r;return Math.sin(e)*r}function ax(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function Uf(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=Gf(t),r=ax(t),a=2*s*r,l=-2*n*o,c=i.length-1,h=i[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+i[c],f=-y+l*p+a*u;return a=n*r,l=s*o,[a*h-l*f,a*f+l*h]}function lx(){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&&(fr.init.apply(this),this.forward=fr.forward,this.inverse=fr.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 i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),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 n=Rl(this.cbg,this.lat0);this.Zb=-this.Qn*(n+rx(this.gtu,2*n))}function cx(i){var e=J(i.x-this.long0,this.over),t=i.y;t=Rl(this.cbg,t);var n=Math.sin(t),s=Math.cos(t),o=Math.sin(e),r=Math.cos(e);t=Math.atan2(n,r*s),e=Math.atan2(o*s,Et(n,s*r)),e=ox(Math.tan(e));var a=Uf(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),i.x=l,i.y=c,i}function dx(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var n,s;if(Math.abs(e)<=2.623395162778){var o=Uf(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(Gf(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),n=J(e+this.long0,this.over),s=Rl(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var hx=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const pr={init:lx,forward:cx,inverse:dx,names:hx};function ux(i,e){if(i===void 0){if(i=Math.floor((J(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var fx="etmerc";function px(){var i=ux(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Oe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,pr.init.apply(this),this.forward=pr.forward,this.inverse=pr.inverse}var mx=["Universal Transverse Mercator System","utm"];const gx={init:px,names:mx,dependsOn:fx};function Fl(i,e){return Math.pow((1-i)/(1+i),e)}var yx=20;function Ax(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Ae)/(Math.pow(Math.tan(.5*this.lat0+Ae),this.C)*Fl(this.e*i,this.ratexp))}function vx(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+Ae),this.C)*Fl(this.e*Math.sin(t),this.ratexp))-$,i.x=this.C*e,i}function bx(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+Ae)/this.K,1/this.C),o=yx;o>0&&(n=2*Math.atan(s*Fl(this.e*Math.sin(i.y),-.5*this.e))-$,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const Ol={init:Ax,forward:vx,inverse:bx};function wx(){Ol.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 Cx(i){var e,t,n,s;return i.x=J(i.x-this.long0,this.over),Ol.forward.apply(this,[i]),e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*t*n),i.x=s*t*Math.sin(i.x),i.y=s*(this.cosc0*e-this.sinc0*t*n),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function Ex(i){var e,t,n,s,o;if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,o=Et(i.x,i.y)){var r=2*Math.atan2(o,this.R2);e=Math.sin(r),t=Math.cos(r),s=Math.asin(t*this.sinc0+i.y*e*this.cosc0/o),n=Math.atan2(i.x*e,o*this.cosc0*t-i.y*this.sinc0*e)}else s=this.phic0,n=0;return i.x=n,i.y=s,Ol.inverse.apply(this,[i]),i.x=J(i.x+this.long0,this.over),i}var xx=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const Ix={init:wx,forward:Cx,inverse:Ex,names:xx};function Gl(i,e,t){return e*=t,Math.tan(.5*($+i))*Math.pow((1-e)/(1+e),.5*t)}function Sx(){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)<=K&&(this.k0=.5*(1+Ls(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=K&&(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)<=K&&Math.abs(Math.cos(this.lat_ts))>K&&(this.k0=.5*this.cons*Xt(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=Xt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Gl(this.lat0,this.sinlat0,this.e))-$,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function Mx(i){var e=i.x,t=i.y,n=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)<=K&&Math.abs(t+this.lat0)<=K?(i.x=NaN,i.y=NaN,i):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),i.x=this.a*o*s*Math.sin(u)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,i):(r=2*Math.atan(Gl(t,n,this.e))-$,l=Math.cos(r),a=Math.sin(r),Math.abs(this.coslat0)<=K?(c=Ft(this.e,t*this.con,this.con*n),h=2*this.a*this.k0*c/this.cons,i.x=this.x0+h*Math.sin(e-this.long0),i.y=this.y0-this.con*h*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)<K?(o=2*this.a*this.k0/(1+l*Math.cos(u)),i.y=o*a):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),i.y=o*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),i.x=o*l*Math.sin(u)+this.x0,i))}function Tx(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r=Math.sqrt(i.x*i.x+i.y*i.y);if(this.sphere){var a=2*Math.atan(r/(2*this.a*this.k0));return e=this.long0,t=this.lat0,r<=K?(i.x=e,i.y=t,i):(t=Math.asin(Math.cos(a)*this.sinlat0+i.y*Math.sin(a)*this.coslat0/r),Math.abs(this.coslat0)<K?this.lat0>0?e=J(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=J(this.long0+Math.atan2(i.x,i.y),this.over):e=J(this.long0+Math.atan2(i.x*Math.sin(a),r*this.coslat0*Math.cos(a)-i.y*this.sinlat0*Math.sin(a)),this.over),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=K){if(r<=K)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,n=r*this.cons/(2*this.a*this.k0),t=this.con*Rs(this.e,n),e=this.con*J(this.con*this.long0+Math.atan2(i.x,-1*i.y),this.over)}else s=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,r<=K?o=this.X0:(o=Math.asin(Math.cos(s)*this.sinX0+i.y*Math.sin(s)*this.cosX0/r),e=J(this.long0+Math.atan2(i.x*Math.sin(s),r*this.cosX0*Math.cos(s)-i.y*this.sinX0*Math.sin(s)),this.over)),t=-1*Rs(this.e,Math.tan(.5*($+o)));return i.x=e,i.y=t,i}var Bx=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const _x={init:Sx,forward:Mx,inverse:Tx,names:Bx,ssfn_:Gl};function kx(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,n=this.rf,s=1/n,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(i),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+i/2)),c=Math.log((1+r*e)/(1-r*e));this.K=a-this.alpha*l+this.alpha*r/2*c}function Px(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),n=-this.alpha*(e+t)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(i.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 i.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,i.x=this.R*r+this.x0,i}function Dx(i){for(var e=i.x-this.x0,t=i.y-this.y0,n=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(n)),r=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-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 i.x=a,i.y=c,i}var Nx=["somerc"];const Lx={init:kx,forward:Px,inverse:Dx,names:Nx};var Fn=1e-7;function Rx(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.projName=="object"?Object.keys(i.projName)[0]:i.projName;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1||e.indexOf(yf(t))!==-1}function Fx(){var i,e,t,n,s,o,r,a,l,c,h=0,u,p=0,f=0,m=0,y=0,g=0,A=0;this.no_off=Rx(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),v&&(A=this.alpha),b&&(h=this.rectified_grid_angle),v||b)p=this.longc;else if(f=this.long1,y=this.lat1,m=this.long2,g=this.lat2,Math.abs(y-g)<=Fn||(i=Math.abs(y))<=Fn||Math.abs(i-$)<=Fn||Math.abs(Math.abs(this.lat0)-$)<=Fn||Math.abs(Math.abs(g)-$)<=Fn)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>K?(a=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*a*a,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/i,n=this.B*e/(t*Math.sqrt(i)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(Ft(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),v||b?(v?(u=Math.asin(Math.sin(A)/n),b||(h=A)):(u=h,A=Math.asin(n*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),i=f-m,i<-Math.PI?m-=Ds:i>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(n*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(n*n-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(Ae-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(Ae+s))}function Ox(i){var e={},t,n,s,o,r,a,l,c;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-$)>K){if(r=this.E/Math.pow(Ft(this.e,i.y,Math.sin(i.y)),this.B),a=1/r,t=.5*(r-a),n=.5*(r+a),o=Math.sin(this.B*i.x),s=(t*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(s)-1)<K)throw new Error;c=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*i.x),Math.abs(a)<Fn?l=this.A*i.x:l=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,a)}else c=i.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.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 Gx(i){var e,t,n,s,o,r,a,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*t),s=.5*(n-1/n),o=.5*(n+1/n),r=Math.sin(this.BrA*e),a=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(a)-1)<K)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 Ux=["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 Vx={init:Fx,forward:Ox,inverse:Gx,names:Ux};function Qx(){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)<K)){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);var e=Math.sin(this.lat1),t=Math.cos(this.lat1),n=Xt(this.e,e,t),s=Ft(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),a=Xt(this.e,o,r),l=Ft(this.e,this.lat2,o),c=Math.abs(Math.abs(this.lat0)-$)<K?0:Ft(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>K?this.ns=Math.log(n/a)/Math.log(s/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(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 zx(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=K&&(t=Ls(t)*($-2*K));var n=Math.abs(Math.abs(t)-$),s,o;if(n>K)s=Ft(this.e,t,Math.sin(t)),o=this.a*this.f0*Math.pow(s,this.ns);else{if(n=t*this.ns,n<=0)return null;o=0}var r=this.ns*J(e-this.long0,this.over);return i.x=this.k0*(o*Math.sin(r))+this.x0,i.y=this.k0*(this.rh-o*Math.cos(r))+this.y0,i}function Hx(i){var e,t,n,s,o,r=(i.x-this.x0)/this.k0,a=this.rh-(i.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,n=Math.pow(e/(this.a*this.f0),t),s=Rs(this.e,n),s===-9999)return null}else s=-$;return o=J(l/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Yx=["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 $x={init:Qx,forward:zx,inverse:Hx,names:Yx};function jx(){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 Wx(i){var e,t,n,s,o,r,a,l=i.x,c=i.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),n=-h*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(n)),o=Math.asin(Math.cos(t)*Math.sin(n)/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),i.y=a*Math.cos(r)/1,i.x=a*Math.sin(r)/1,this.czech||(i.y*=-1,i.x*=-1),i}function qx(i){var e,t,n,s,o,r,a,l,c=i.x;i.x=i.y,i.y=c,this.czech||(i.y*=-1,i.x*=-1),r=Math.sqrt(i.x*i.x+i.y*i.y),o=Math.atan2(i.y,i.x),s=o/Math.sin(this.s0),n=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(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),t=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(e)),i.x=this.long0-t/this.alfa,a=e,l=0;var h=0;do i.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-i.y)<1e-10&&(l=1),a=i.y,h+=1;while(l===0&&h<15);return h>=15?null:i}var Kx=["Krovak","krovak"];const Xx={init:jx,forward:Wx,inverse:qx,names:Kx};function mt(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function Gs(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function Us(i){return .375*i*(1+.25*i*(1+.46875*i))}function Vs(i){return .05859375*i*i*(1+.75*i)}function Qs(i){return i*i*i*(35/3072)}function Ul(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function Ti(i){return Math.abs(i)<$?i:i-Ls(i)*Math.PI}function mr(i,e,t,n,s){var o,r;o=i/e;for(var a=0;a<15;a++)if(r=(i-(e*o-t*Math.sin(2*o)+n*Math.sin(4*o)-s*Math.sin(6*o)))/(e-2*t*Math.cos(2*o)+4*n*Math.cos(4*o)-6*s*Math.cos(6*o)),o+=r,Math.abs(r)<=1e-10)return o;return NaN}function Jx(){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 Zx(i){var e,t,n=i.x,s=i.y;if(n=J(n-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(s)*Math.sin(n)),t=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var o=Math.sin(s),r=Math.cos(s),a=Ul(this.a,this.e,o),l=Math.tan(s)*Math.tan(s),c=n*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 i.x=e+this.x0,i.y=t+this.y0,i}function e2(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s;if(this.sphere){var o=t+this.lat0;n=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=mr(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-$)<=K)return i.x=this.long0,i.y=$,t<0&&(i.y*=-1),i;var l=Ul(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;n=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 i.x=J(s+this.long0,this.over),i.y=Ti(n),i}var t2=["Cassini","Cassini_Soldner","cass"];const i2={init:Jx,forward:Zx,inverse:e2,names:t2};function Bi(i,e){var t;return i>1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var Vl=1,Ql=2,zl=3,gr=4;function n2(){var i=Math.abs(this.lat0);if(Math.abs(i-$)<K?this.mode=this.lat0<0?Vl:Ql:Math.abs(i)<K?this.mode=zl:this.mode=gr,this.es>0){var e;switch(this.qp=Bi(this.e,1),this.mmf=.5/(1-this.es),this.apa=u2(this.es),this.mode){case Ql:this.dd=1;break;case Vl:this.dd=1;break;case zl:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case gr:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Bi(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===gr&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function s2(i){var e,t,n,s,o,r,a,l,c,h,u=i.x,p=i.y;if(u=J(u-this.long0,this.over),this.sphere){if(o=Math.sin(p),h=Math.cos(p),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+h*n:1+this.sinph0*o+this.cosph0*h*n,t<=K)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*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(p+this.lat0)<K)return null;t=Ae-p*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(u),t*=n}}else{switch(a=0,l=0,c=0,n=Math.cos(u),s=Math.sin(u),o=Math.sin(p),r=Bi(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*n;break;case this.EQUIT:c=1+l*n;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)<K)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*n):t=(c=Math.sqrt(2/(1+l*n)))*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=n*(this.mode===this.S_POLE?c:-c)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function o2(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,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)<=K?0:Math.asin(t*p/u),e*=p,t=h*u;break;case this.OBLIQ:s=Math.abs(u)<=K?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}n=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<K)return i.x=this.long0,i.y=this.lat0,i;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 i.x=this.long0,i.y=this.lat0,i;c=1-a/this.qp,this.mode===this.S_POLE&&(c=-c)}n=Math.atan2(e,t),s=f2(Math.asin(c),this.apa)}return i.x=J(this.long0+n,this.over),i.y=s,i}var r2=.3333333333333333,a2=.17222222222222222,l2=.10257936507936508,c2=.06388888888888888,d2=.0664021164021164,h2=.016415012942191543;function u2(i){var e,t=[];return t[0]=i*r2,e=i*i,t[0]+=e*a2,t[1]=e*c2,e*=i,t[0]+=e*l2,t[1]+=e*d2,t[2]=e*h2,t}function f2(i,e){var t=i+i;return i+e[0]*Math.sin(t)+e[1]*Math.sin(t+t)+e[2]*Math.sin(t+t+t)}var p2=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const m2={init:n2,forward:s2,inverse:o2,names:p2,S_POLE:Vl,N_POLE:Ql,EQUIT:zl,OBLIQ:gr};function _i(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function g2(){Math.abs(this.lat1+this.lat2)<K||(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=Xt(this.e3,this.sin_po,this.cos_po),this.qs1=Bi(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=Xt(this.e3,this.sin_po,this.cos_po),this.qs2=Bi(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=Bi(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>K?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 y2(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Bi(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/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 i.x=r,i.y=a,i}function A2(i){var e,t,n,s,o,r;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),n=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),n=-1),s=0,e!==0&&(s=Math.atan2(n*i.x,n*i.y)),n=e*this.ns0/this.a,this.sphere?r=Math.asin((this.c-n*n)/(2*this.ns0)):(t=(this.c-n*n)/this.ns0,r=this.phi1z(this.e3,t)),o=J(s/this.ns0+this.long0,this.over),i.x=o,i.y=r,i}function v2(i,e){var t,n,s,o,r,a=_i(.5*e);if(i<K)return a;for(var l=i*i,c=1;c<=25;c++)if(t=Math.sin(a),n=Math.cos(a),s=i*t,o=1-s*s,r=.5*o*o/n*(e/(1-l)-t/o+.5/i*Math.log((1-s)/(1+s))),a=a+r,Math.abs(r)<=1e-7)return a;return null}var b2=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const w2={init:g2,forward:y2,inverse:A2,names:b2,phi1z:v2};function C2(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function E2(i){var e,t,n,s,o,r,a,l,c=i.x,h=i.y;return n=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,r>0||Math.abs(r)<=K?(a=this.x0+this.a*o*t*Math.sin(n)/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(n),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=a,i.y=l,i}function x2(i){var e,t,n,s,o,r;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(s=Math.atan2(e,this.rc),t=Math.sin(s),n=Math.cos(s),r=_i(n*this.sin_p14+i.y*t*this.cos_p14/e),o=Math.atan2(i.x*t,e*this.cos_p14*n-i.y*this.sin_p14*t),o=J(this.long0+o,this.over)):(r=this.phic0,o=0),i.x=o,i.y=r,i}var I2=["gnom"];const S2={init:C2,forward:E2,inverse:x2,names:I2};function M2(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*$:$;for(var n=Math.asin(.5*e),s,o,r,a,l=0;l<30;l++)if(o=Math.sin(n),r=Math.cos(n),a=i*o,s=Math.pow(1-a*a,2)/(2*r)*(e/(1-i*i)-o/(1-a*a)+.5/i*Math.log((1-a)/(1+a))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function T2(){this.sphere||(this.k0=Xt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function B2(i){var e=i.x,t=i.y,n,s,o=J(e-this.long0,this.over);if(this.sphere)n=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=Bi(this.e,Math.sin(t));n=this.x0+this.a*this.k0*o,s=this.y0+this.a*r*.5/this.k0}return i.x=n,i.y=s,i}function _2(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=J(this.long0+i.x/this.a/Math.cos(this.lat_ts),this.over),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=M2(this.e,2*i.y*this.k0/this.a),e=J(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var k2=["cea"];const P2={init:T2,forward:B2,inverse:_2,names:k2};function D2(){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 N2(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s=Ti(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function L2(i){var e=i.x,t=i.y;return i.x=J(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Ti(this.lat0+(t-this.y0)/this.a),i}var R2=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const F2={init:D2,forward:N2,inverse:L2,names:R2};var Vf=20;function O2(){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 G2(i){var e=i.x,t=i.y,n,s,o,r=J(e-this.long0,this.over);if(o=r*Math.sin(t),this.sphere)Math.abs(t)<=K?(n=this.a*r,s=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(t),s=this.a*(Ti(t-this.lat0)+(1-Math.cos(o))/Math.tan(t)));else if(Math.abs(t)<=K)n=this.a*r,s=-1*this.ml0;else{var a=Ul(this.a,this.e,Math.sin(t))/Math.tan(t);n=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 i.x=n+this.x0,i.y=s+this.y0,i}function U2(i){var e,t,n,s,o,r,a,l,c;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=K)e=J(n/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,a=n*n/this.a/this.a+r*r,l=r;var h;for(o=Vf;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)<=K){t=l;break}e=J(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=K)t=0,e=J(this.long0+n/this.a,this.over);else{r=(this.ml0+s)/this.a,a=n*n/this.a/this.a+r*r,l=r;var u,p,f,m,y;for(o=Vf;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)<=K){t=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=J(this.long0+Math.asin(n*u/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var V2=["Polyconic","American_Polyconic","poly"];const Q2={init:O2,forward:G2,inverse:U2,names:V2};function z2(){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 H2(i){var e,t=i.x,n=i.y,s=n-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 i.x=A*this.a+this.x0,i.y=g*this.a+this.y0,i}function Y2(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-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,b=r,C=a;for(e=2;e<=6;e++)A=y*p-g*f,v=g*p+y*f,y=A,g=v,b=b+(e-1)*(this.B_re[e]*y-this.B_im[e]*g),C=C+(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=(b*S+C*x)/I,f=(C*S-b*x)/I}var M=p,w=f,T=1,k=0;for(e=1;e<=9;e++)T=T*M,k=k+this.D[e]*T;var R=this.lat0+k*Ps*1e5,G=this.long0+w;return i.x=G,i.y=R,i}var $2=["New_Zealand_Map_Grid","nzmg"];const j2={init:z2,forward:H2,inverse:Y2,names:$2};function W2(){}function q2(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+t/2.5))*1.25;return i.x=s,i.y=o,i}function K2(i){i.x-=this.x0,i.y-=this.y0;var e=J(this.long0+i.x/this.a,this.over),t=2.5*(Math.atan(Math.exp(.8*i.y/this.a))-Math.PI/4);return i.x=e,i.y=t,i}var X2=["Miller_Cylindrical","mill"];const J2={init:W2,forward:q2,inverse:K2,names:X2};var Z2=20;function eI(){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=Nl(this.es)}function tI(i){var e,t,n=i.x,s=i.y;if(n=J(n-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=Z2;r;--r){var a=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<K)break}e=this.a*this.C_x*n*(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*Rn(s,l,c,this.en),e=this.a*n*c/Math.sqrt(1-this.es*l*l)}return i.x=e,i.y=t,i}function iI(i){var e,t,n,s;return i.x-=this.x0,n=i.x/this.a,i.y-=this.y0,e=i.y/this.a,this.sphere?(e/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(e))),this.m?e=_i((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=_i(Math.sin(e)/this.n)),n=J(n+this.long0,this.over),e=Ti(e)):(e=Ll(i.y/this.a,this.es,this.en),s=Math.abs(e),s<$?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=J(t,this.over)):s-K<$&&(n=this.long0)),i.x=n,i.y=e,i}var nI=["Sinusoidal","sinu"];const sI={init:eI,forward:tI,inverse:iI,names:nI};function oI(){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 rI(i){for(var e=i.x,t=i.y,n=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)<K)break}s/=2,Math.PI/2-Math.abs(t)<K&&(n=0);var a=.900316316158*this.a*n*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=a,i.y=l,i}function aI(i){var e,t;i.x-=this.x0,i.y-=this.y0,t=i.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),e=Math.asin(t);var n=J(this.long0+i.x/(.900316316158*this.a*Math.cos(e)),this.over);n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var s=Math.asin(t);return i.x=n,i.y=s,i}var lI=["Mollweide","moll"];const cI={init:oI,forward:rI,inverse:aI,names:lI};function dI(){Math.abs(this.lat1+this.lat2)<K||(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=Xt(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)<K?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Xt(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 hI(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=mt(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*J(e-this.long0,this.over),r=this.x0+n*Math.sin(o),a=this.y0+this.rh-n*Math.cos(o);return i.x=r,i.y=a,i}function uI(i){i.x-=this.x0,i.y=this.rh-i.y+this.y0;var e,t,n,s;this.ns>=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var o=0;if(t!==0&&(o=Math.atan2(e*i.x,e*i.y)),this.sphere)return s=J(this.long0+o/this.ns,this.over),n=Ti(this.g-t/this.a),i.x=s,i.y=n,i;var r=this.g-t/this.a;return n=mr(r,this.e0,this.e1,this.e2,this.e3),s=J(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var fI=["Equidistant_Conic","eqdc"];const pI={init:dI,forward:hI,inverse:uI,names:fI};function mI(){this.R=this.a}function gI(i){var e=i.x,t=i.y,n=J(e-this.long0,this.over),s,o;Math.abs(t)<=K&&(s=this.x0+this.R*n,o=this.y0);var r=_i(2*Math.abs(t/Math.PI));(Math.abs(n)<=K||Math.abs(Math.abs(t)-$)<=K)&&(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/n-n/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);n<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,i.x=s,i.y=o,i}function yI(i){var e,t,n,s,o,r,a,l,c,h,u,p,f;return i.x-=this.x0,i.y-=this.y0,u=Math.PI*this.R,n=i.x/u,s=i.y/u,o=n*n+s*s,r=-Math.abs(s)*(1+o),a=r-2*s*s+n*n,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,i.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(n)<K?e=this.long0:e=J(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-s*s)+o*o))/2/n,this.over),i.x=e,i.y=t,i}var AI=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const vI={init:mI,forward:gI,inverse:yI,names:AI};function bI(i,e,t,n,s,o){const r=n-e,a=Math.atan((1-o)*Math.tan(i)),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,b,C,S,x,I,M,w,T,k,R,G;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};b=c*u+h*p*A,C=Math.atan2(v,b),S=h*p*g/v,x=1-S*S,I=x!==0?b-2*c*u/x:0,M=o/16*x*(4+o*(4-3*x)),m=f,f=r+(1-M)*o*S*(C+M*v*(I+M*b*(-1+2*I*I)))}while(Math.abs(f-m)>1e-12&&--y>0);return y===0?{azi1:NaN,s12:NaN}:(w=x*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),T=1+w/16384*(4096+w*(-768+w*(320-175*w))),k=w/1024*(256+w*(-128+w*(74-47*w))),R=k*v*(I+k/4*(b*(-1+2*I*I)-k/6*I*(-3+4*v*v)*(-3+4*I*I))),G=s*(1-o)*T*(C-R),{azi1:Math.atan2(p*g,h*u-c*p*A),s12:G})}function wI(i,e,t,n,s,o){const r=Math.atan((1-o)*Math.tan(i)),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=n/(s*(1-o)*y),v,b=100,C,S,x,I;do C=Math.cos(2*u+A),S=Math.sin(A),x=Math.cos(A),I=g*S*(C+g/4*(x*(-1+2*C*C)-g/6*C*(-3+4*S*S)*(-3+4*C*C))),v=A,A=n/(s*(1-o)*y)+I;while(Math.abs(A-v)>1e-12&&--b>0);if(b===0)return{lat2:NaN,lon2:NaN};const M=a*S-l*x*h,w=Math.atan2(a*x+l*S*h,(1-o)*Math.sqrt(p*p+M*M)),T=Math.atan2(S*c,l*x-a*S*h),k=o/16*f*(4+o*(4-3*f)),R=T-(1-k)*o*p*(A+k*S*(C+k*x*(-1+2*C*C))),G=e+R;return{lat2:w,lon2:G}}function CI(){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 EI(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.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)<=K?(i.x=this.x0+this.a*($-t)*Math.sin(o),i.y=this.y0-this.a*($-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(i.x=this.x0+this.a*($+t)*Math.sin(o),i.y=this.y0+this.a*($+t)*Math.cos(o),i):(m=this.sin_p12*n+this.cos_p12*s*Math.cos(o),p=Math.acos(m),f=p?p/Math.sin(p):1,i.x=this.x0+this.a*f*s*Math.sin(o),i.y=this.y0+this.a*f*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(r=Gs(this.es),a=Us(this.es),l=Vs(this.es),c=Qs(this.es),Math.abs(this.sin_p12-1)<=K?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),i.x=this.x0+(h-u)*Math.sin(o),i.y=this.y0-(h-u)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(h=this.a*mt(r,a,l,c,$),u=this.a*mt(r,a,l,c,t),i.x=this.x0+(h+u)*Math.sin(o),i.y=this.y0+(h+u)*Math.cos(o),i):Math.abs(e)<K&&Math.abs(t-this.lat0)<K?(i.x=i.y=0,i):(y=bI(this.lat0,this.long0,t,e,this.a,this.f),g=y.azi1,i.x=y.s12*Math.sin(g),i.y=y.s12*Math.cos(g),i))}function xI(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r,a,l,c,h,u,p,f,m,y,g;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*$*this.a?void 0:(t=e/this.a,n=Math.sin(t),s=Math.cos(t),o=this.long0,Math.abs(e)<=K?r=this.lat0:(r=_i(s*this.sin_p12+i.y*n*this.cos_p12/e),a=Math.abs(this.lat0)-$,Math.abs(a)<=K?this.lat0>=0?o=J(this.long0+Math.atan2(i.x,-i.y),this.over):o=J(this.long0-Math.atan2(-i.x,i.y),this.over):o=J(this.long0+Math.atan2(i.x*n,e*this.cos_p12*s-i.y*this.sin_p12*n),this.over)),i.x=o,i.y=r,i)):(l=Gs(this.es),c=Us(this.es),h=Vs(this.es),u=Qs(this.es),Math.abs(this.sin_p12-1)<=K?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(i.x*i.x+i.y*i.y),f=p-e,r=mr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(i.x,-1*i.y),this.over),i.x=o,i.y=r,i):Math.abs(this.sin_p12+1)<=K?(p=this.a*mt(l,c,h,u,$),e=Math.sqrt(i.x*i.x+i.y*i.y),f=e-p,r=mr(f/this.a,l,c,h,u),o=J(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=r,i):(m=Math.atan2(i.x,i.y),y=Math.sqrt(i.x*i.x+i.y*i.y),g=wI(this.lat0,this.long0,m,y,this.a,this.f),i.x=g.lon2,i.y=g.lat2,i))}var II=["Azimuthal_Equidistant","aeqd"];const SI={init:CI,forward:EI,inverse:xI,names:II};function MI(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function TI(i){var e,t,n,s,o,r,a,l,c=i.x,h=i.y;return n=J(c-this.long0,this.over),e=Math.sin(h),t=Math.cos(h),s=Math.cos(n),r=this.sin_p14*e+this.cos_p14*t*s,o=1,(r>0||Math.abs(r)<=K)&&(a=this.a*o*t*Math.sin(n),l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=a,i.y=l,i}function BI(i){var e,t,n,s,o,r,a;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=_i(e/this.a),n=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=K?(a=this.lat0,i.x=r,i.y=a,i):(a=_i(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-$,Math.abs(o)<=K?(this.lat0>=0?r=J(this.long0+Math.atan2(i.x,-i.y),this.over):r=J(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=r,i.y=a,i):(r=J(this.long0+Math.atan2(i.x*n,e*this.cos_p14*s-i.y*this.sin_p14*n),this.over),i.x=r,i.y=a,i))}var _I=["ortho"];const kI={init:MI,forward:TI,inverse:BI,names:_I};var De={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ve={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function PI(){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>=$-Ae/2?this.face=De.TOP:this.lat0<=-($-Ae/2)?this.face=De.BOTTOM:Math.abs(this.long0)<=Ae?this.face=De.FRONT:Math.abs(this.long0)<=$+Ae?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 DI(i){var e={x:0,y:0},t,n,s,o,r,a,l={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,n=i.x,this.face===De.TOP)o=$-t,n>=Ae&&n<=$+Ae?(l.value=ve.AREA_0,s=n-$):n>$+Ae||n<=-($+Ae)?(l.value=ve.AREA_1,s=n>0?n-Ge:n+Ge):n>-($+Ae)&&n<=-Ae?(l.value=ve.AREA_2,s=n+$):(l.value=ve.AREA_3,s=n);else if(this.face===De.BOTTOM)o=$+t,n>=Ae&&n<=$+Ae?(l.value=ve.AREA_0,s=-n+$):n<Ae&&n>=-Ae?(l.value=ve.AREA_1,s=-n):n<-Ae&&n>=-($+Ae)?(l.value=ve.AREA_2,s=-n-$):(l.value=ve.AREA_3,s=n>0?-n+Ge:-n-Ge);else{var c,h,u,p,f,m,y;this.face===De.RIGHT?n=On(n,+$):this.face===De.BACK?n=On(n,+Ge):this.face===De.LEFT&&(n=On(n,-$)),p=Math.sin(t),f=Math.cos(t),m=Math.sin(n),y=Math.cos(n),c=f*y,h=f*m,u=p,this.face===De.FRONT?(o=Math.acos(c),s=yr(o,u,h,l)):this.face===De.RIGHT?(o=Math.acos(h),s=yr(o,u,-c,l)):this.face===De.BACK?(o=Math.acos(-c),s=yr(o,u,-h,l)):this.face===De.LEFT?(o=Math.acos(-h),s=yr(o,u,c,l)):(o=s=0,l.value=ve.AREA_0)}return a=Math.atan(12/Ge*(s+Math.acos(Math.sin(s)*Math.cos(Ae))-$)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===ve.AREA_1?a+=$:l.value===ve.AREA_2?a+=Ge:l.value===ve.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,i.x=e.x,i.y=e.y,i}function NI(i){var e={lam:0,phi:0},t,n,s,o,r,a,l,c,h,u={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,n=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?u.value=ve.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(u.value=ve.AREA_1,t-=$):i.x<0&&-i.x>=Math.abs(i.y)?(u.value=ve.AREA_2,t=t<0?t+Ge:t-Ge):(u.value=ve.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(n),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===ve.AREA_0?e.lam=a+$:u.value===ve.AREA_1?e.lam=a<0?a+Ge:a-Ge:u.value===ve.AREA_2?e.lam=a-$:e.lam=a;else if(this.face===De.BOTTOM)c=Math.acos(l),e.phi=c-$,u.value===ve.AREA_0?e.lam=-a+$:u.value===ve.AREA_1?e.lam=-a:u.value===ve.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===ve.AREA_1?(h=f,f=-m,m=h):u.value===ve.AREA_2?(f=-f,m=-m):u.value===ve.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=On(e.lam,-$):this.face===De.BACK?e.lam=On(e.lam,-Ge):this.face===De.LEFT&&(e.lam=On(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,i.x=e.lam,i.y=e.phi,i}function yr(i,e,t,n){var s;return i<K?(n.value=ve.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=Ae?n.value=ve.AREA_0:s>Ae&&s<=$+Ae?(n.value=ve.AREA_1,s-=$):s>$+Ae||s<=-($+Ae)?(n.value=ve.AREA_2,s=s>=0?s-Ge:s+Ge):(n.value=ve.AREA_3,s+=$)),s}function On(i,e){var t=i+e;return t<-Ge?t+=Ds:t>+Ge&&(t-=Ds),t}var LI=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const RI={init:PI,forward:DI,inverse:NI,names:LI};var Hl=[[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]],Qf=.8487,zf=1.3523,Hf=bt/5,FI=1/Hf,Gn=18,Ar=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},OI=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function GI(i,e,t,n){for(var s=e;n;--n){var o=i(s);if(s-=o,Math.abs(o)<t)break}return s}function UI(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function VI(i){var e=J(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*Hf);n<0?n=0:n>=Gn&&(n=Gn-1),t=bt*(t-FI*n);var s={x:Ar(Hl[n],t)*e,y:Ar(zs[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Qf+this.x0,s.y=s.y*this.a*zf+this.y0,s}function QI(i){var e={x:(i.x-this.x0)/(this.a*Qf),y:Math.abs(i.y-this.y0)/(this.a*zf)};if(e.y>=1)e.x/=Hl[Gn][0],e.y=i.y<0?-$:$;else{var t=Math.floor(e.y*Gn);for(t<0?t=0:t>=Gn&&(t=Gn-1);;)if(zs[t][0]>e.y)--t;else if(zs[t+1][0]<=e.y)++t;else break;var n=zs[t],s=5*(e.y-n[0])/(zs[t+1][0]-n[0]);s=GI(function(o){return(Ar(n,o)-e.y)/OI(n,o)},s,K,100),e.x/=Ar(Hl[t],s),e.y=(5*t+s)*Oe,i.y<0&&(e.y=-e.y)}return e.x=J(e.x+this.long0,this.over),e}var zI=["Robinson","robin"];const HI={init:UI,forward:VI,inverse:QI,names:zI};function YI(){this.name="geocent"}function $I(i){var e=bf(i,this.es,this.a);return e}function jI(i){var e=wf(i,this.es,this.a,this.b);return e}var WI=["Geocentric","geocentric","geocent","Geocent"];const qI={init:YI,forward:$I,inverse:jI,names:WI};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 KI(){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)-$)<K?this.mode=this.lat0<0?dt.S_POLE:dt.N_POLE:Math.abs(this.lat0)<K?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 i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function XI(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),n=Math.cos(i.x),s,o;switch(this.mode){case dt.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case dt.EQUIT:o=t*n;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(i.x),this.mode){case dt.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case dt.EQUIT:o*=e;break;case dt.N_POLE:o*=-(t*n);break;case dt.S_POLE:o*=t*n;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,i.x=s*this.a,i.y=o*this.a,i}function JI(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,n,s;s=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*s,n=this.pn1*i.y*this.cw*s,i.x=t*this.cg+n*this.sg,i.y=n*this.cg-t*this.sg;var o=Et(i.x,i.y);if(Math.abs(o)<K)e.x=0,e.y=i.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+i.y*a*this.cosph0/o),i.y=(r-this.sinph0*Math.sin(e.y))*o,i.x*=a*this.cosph0;break;case dt.EQUIT:e.y=Math.asin(i.y*a/o),i.y=r*o,i.x*=a;break;case dt.N_POLE:e.y=Math.asin(r),i.y=-i.y;break;case dt.S_POLE:e.y=-Math.asin(r);break}e.x=Math.atan2(i.x,i.y)}return i.x=e.x+this.long0,i.y=e.y,i}var ZI=["Tilted_Perspective","tpers"];const eS={init:KI,forward:XI,inverse:JI,names:ZI};function tS(){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 i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,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 iS(i){var e=i.x,t=i.y,n,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 i.x=Number.NaN,i.y=Number.NaN,i;n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Et(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Et(o,n)))}else this.shape==="sphere"&&(n=Math.cos(t),s=Math.cos(e)*n,o=Math.sin(e)*n,r=Math.sin(t),n=this.radius_g-s,this.flip_axis?(i.x=this.radius_g_1*Math.atan(o/Et(r,n)),i.y=this.radius_g_1*Math.atan(r/n)):(i.x=this.radius_g_1*Math.atan(o/n),i.y=this.radius_g_1*Math.atan(r/Et(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function nS(i){var e=-1,t=0,n=0,s,o,r,a;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Et(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Et(1,t));var l=n/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 i.x=Number.NaN,i.y=Number.NaN,i;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,n*=a,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+n*n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),s=t*t+n*n+e*e,o=2*this.radius_g*e,r=o*o-4*s*this.C,r<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+a*e,t*=a,n*=a,i.x=Math.atan2(t,e),i.y=Math.atan(n*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var sS=["Geostationary Satellite View","Geostationary_Satellite","geos"];const oS={init:tS,forward:iS,inverse:nS,names:sS};var Ys=1.340264,$s=-.081106,js=893e-6,Ws=.003796,vr=Math.sqrt(3)/2;function rS(){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 aS(i){var e=J(i.x-this.long0,this.over),t=i.y,n=Math.asin(vr*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(vr*(Ys+3*$s*s+o*(7*js+9*Ws*s))),i.y=n*(Ys+$s*s+o*(js+Ws*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function lS(i){i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a;var e=1e-9,t=12,n=i.y,s,o,r,a,l,c;for(c=0;c<t&&(s=n*n,o=s*s*s,r=n*(Ys+$s*s+o*(js+Ws*s))-i.y,a=Ys+3*$s*s+o*(7*js+9*Ws*s),n-=l=r/a,!(Math.abs(l)<e));++c);return s=n*n,o=s*s*s,i.x=vr*i.x*(Ys+3*$s*s+o*(7*js+9*Ws*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/vr),i.x=J(i.x+this.long0,this.over),i}var cS=["eqearth","Equal Earth","Equal_Earth"];const dS={init:rS,forward:aS,inverse:lS,names:cS};var qs=1e-10;function hS(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<qs)throw new Error;this.es?(this.en=Nl(this.es),this.m1=Rn(this.phi1,this.am1=Math.sin(this.phi1),i=Math.cos(this.phi1),this.en),this.am1=i/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=fS,this.forward=uS):(Math.abs(this.phi1)+qs>=$?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=mS,this.forward=pS)}function uS(i){var e=J(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-Rn(t,s=Math.sin(t),o=Math.cos(t),this.en),s=o*e/(n*Math.sqrt(1-this.es*s*s)),i.x=n*Math.sin(s),i.y=this.am1-n*Math.cos(s),i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function fS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n,s;if(t=Et(i.x,i.y=this.am1-i.y),s=Ll(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<$)e=Math.sin(s),n=t*Math.atan2(i.x,i.y)*Math.sqrt(1-this.es*e*e)/Math.cos(s);else if(Math.abs(e-$)<=qs)n=0;else throw new Error;return i.x=J(n+(this.long0||0),this.over),i.y=Ti(s),i}function pS(i){var e=J(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>qs?(i.x=s*Math.sin(n=e*Math.cos(t)/s),i.y=this.cphi1-s*Math.cos(n)):i.x=i.y=0,i.x=this.a*i.x+(this.x0||0),i.y=this.a*i.y+(this.y0||0),i}function mS(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=Et(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>$)throw new Error;return Math.abs(Math.abs(t)-$)<=qs?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=J(e+(this.long0||0),this.over),i.y=Ti(t),i}var gS=["bonne","Bonne (Werner lat_1=90)"];const yS={init:hS,names:gS},Yf={OBLIQUE:{forward:CS,inverse:xS},TRANSVERSE:{forward:ES,inverse:IS}},br={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 AS(){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=mf.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 i=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=Pt(i);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let t;const n=Object.keys(br),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<n.length;a++){const l=n[a],c=br[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}=wS(this,t);this.lamp=o,Math.abs(r)>K?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=Yf.OBLIQUE):this.projectionType=Yf.TRANSVERSE}function vS(i){return this.projectionType.forward(this,i)}function bS(i){return this.projectionType.inverse(this,i)}function wS(i,e){let t,n;if(e===br.ROTATE){let s=i.oLongC,o=i.oLatC,r=i.oAlpha;if(Math.abs(Math.abs(o)-$)<=K)throw new Error("Invalid value for o_lat_c: "+i.o_lat_c+" should be < 90°");n=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===br.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,r=i.oLong2,a=i.oLat2,l=Math.abs(o);if(Math.abs(o)>$-K)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(a)>$-K)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-a)<K)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<K)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");n=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(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function CS(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(t),o=Math.sin(n),r=Math.cos(n);e.x=J(Math.atan2(r*Math.sin(t),i.sphip*r*s+i.cphip*o)+i.lamp),e.y=Math.asin(i.sphip*o-i.cphip*r*s);const a=i.obliqueProjection.forward(e);return i.isIdentity&&(a.x*=bt,a.y*=bt),a}function ES(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=J(Math.atan2(s*Math.sin(t),Math.sin(n))+i.lamp),e.y=Math.asin(-1*s*o);const r=i.obliqueProjection.forward(e);return i.isIdentity&&(r.x*=bt,r.y*=bt),r}function xS(i,e){i.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){n-=i.lamp;const o=Math.cos(n),r=Math.sin(s),a=Math.cos(s);e.x=Math.atan2(a*Math.sin(n),i.sphip*a*o-i.cphip*r),e.y=Math.asin(i.sphip*r+i.cphip*a*o)}return e.x=J(e.x+i.long0),e}function IS(i,e){i.isIdentity&&(e.x*=Oe,e.y*=Oe);const t=i.obliqueProjection.inverse(e);let{x:n,y:s}=t;if(n<Number.MAX_VALUE){const o=Math.cos(s);n-=i.lamp,e.x=Math.atan2(o*Math.sin(n),-1*Math.sin(s)),e.y=Math.asin(o*Math.cos(n))}return e.x=J(e.x+i.long0),e}var SS=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const MS={init:AS,forward:vS,inverse:bS,names:SS};function TS(i){i.Proj.projections.add(fr),i.Proj.projections.add(pr),i.Proj.projections.add(gx),i.Proj.projections.add(Ix),i.Proj.projections.add(_x),i.Proj.projections.add(Lx),i.Proj.projections.add(Vx),i.Proj.projections.add($x),i.Proj.projections.add(Xx),i.Proj.projections.add(i2),i.Proj.projections.add(m2),i.Proj.projections.add(w2),i.Proj.projections.add(S2),i.Proj.projections.add(P2),i.Proj.projections.add(F2),i.Proj.projections.add(Q2),i.Proj.projections.add(j2),i.Proj.projections.add(J2),i.Proj.projections.add(sI),i.Proj.projections.add(cI),i.Proj.projections.add(pI),i.Proj.projections.add(vI),i.Proj.projections.add(SI),i.Proj.projections.add(kI),i.Proj.projections.add(RI),i.Proj.projections.add(HI),i.Proj.projections.add(qI),i.Proj.projections.add(eS),i.Proj.projections.add(oS),i.Proj.projections.add(dS),i.Proj.projections.add(yS),i.Proj.projections.add(MS)}const Ks=Object.assign(DE,{defaultDatum:"WGS84",Proj:Pt,WGS84:new Pt("WGS84"),Point:Ln,toPoint:If,defs:st,nadgrid:mE,transform:hr,mgrs:NE,version:"__VERSION__"});TS(Ks);class BS{cesium;viewer;watermarkEnabled="";setWatermarkEnabled(e){this.watermarkEnabled=e}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(()=>zd),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 n=window?.CesiumVectorTileGL?.VectorTileset||window?.VectorTileset;if(n){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 n({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(()=>zd),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(()=>zd),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 n=await t.json();let s=null;const o=Array.isArray(n?.items)?n.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(n?.items)&&n.items.length){const c=n.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(n?.items)?n.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=M=>M/g*360-180,v=M=>{const w=Math.PI-2*Math.PI*M/g;return 180/Math.PI*Math.atan(Math.sinh(w))},b=A(p),C=A(f+1),S=v(m),x=v(y+1),I=this.cesium.Rectangle.fromDegrees(b,x,C,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 n=this.mapLayers[t.modelId];n&&Object.values(n).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t.show!==!1)})})}),this.viewer.scene.requestRender())}getCameraHeightAboveGround(e){const t=this.viewer?.camera?.positionCartographic;if(!t)return 1/0;const n=t.height,s=e?.buildOptions?.clampToGround??e?.formData?.clampToGround??!1;let o=0;if(s)try{const r=this.viewer?.scene?.globe;if(r){const a=r.getHeight(t);a!==void 0&&Number.isFinite(a)&&(o=a)}}catch{}else o=e?.transform?.originHeight??e?.formData?.height??0;return n-o}applyHeightLod(){if(!this.heightLodEnabled)return;const{full:e,medium:t,far:n}=this.heightLodThresholds;this.gisCadModelsList.forEach(s=>{const o=this.mapLayers[s.modelId];if(!o||s.show===!1)return;const r=this.getCameraHeightAboveGround(s);Object.values(o).forEach(a=>{a.forEach(l=>{if(!l.primitive)return;let c=!0;r>n?c=l.type==="polygon":r>t?c=l.type!=="point":r>e&&(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(n=>n.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},n=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(n,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,n,[o,r]);return{direction:e.direction,longitude:a,latitude:l,config:t}}showJson({modelId:e,show:t}){const n=this.getRuntimeModel(e);n?.root&&(n.show=t,n.root.show=t),this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(o=>{o.primitive&&(o.primitive.show=t)})}),n&&(t?n._overviewLODCheck?.():(n.overviewL0Roots?.forEach(s=>{s.show=!1}),n.overviewL1Roots?.forEach(s=>{s.show=!1})))}showJsonByLayer({modelId:e,show:t,layers:n}){const s=this.mapLayers[e];!s||!Array.isArray(n)||n.forEach(o=>{const r=s[o];r&&r.forEach(a=>{a.primitive&&(a.primitive.show=t)})})}async flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.gisCadModelsList.find(o=>o.modelId===t);if(!n)return;try{const r=`${n.outPutPath?.endsWith("/")?n.outPutPath:`${n.outPutPath}/`}${n.dbName}/cameraView.zip`,a=await Mt(r);if(a&&a.position&&a.orientation){const l=new this.cesium.Cartesian3(a.position.x,a.position.y,a.position.z),c=new this.cesium.HeadingPitchRoll(a.orientation.heading,a.orientation.pitch,a.orientation.roll);this.viewer.camera.flyTo({destination:l,orientation:c,duration:a.duration??1});return}}catch(o){console.warn("[flyToCadModel] 读取 cameraView.zip 失败,回退到默认视角",o)}const s=e.minHeight??n._rebuildContext?.overviewL1Height;this.flyToBounds(n,{duration:e.duration,minHeight:s})}flyToBounds(e,t){if(!e)return;const n=t?.duration??0,s=t?.minHeight,o=this.cesium,r=(l,c,h,u)=>{let p=l,f=c,m=h,y=u;if(s){const A=(p+m)/2,v=(f+y)/2,b=s/111e3,C=Math.max((m-p)/2,b),S=Math.max((y-f)/2,b);p=A-C,m=A+C,f=v-S,y=v+S}const g=o.Rectangle.fromDegrees(p,f,m,y);this.viewer.camera.flyTo({destination:g,duration:n})};{const l=e.overviewL0Tiles;if(l?.length){let c=1/0,h=1/0,u=-1/0,p=-1/0,f=0;for(const m of l){if(!m.lonLatBounds)continue;const y=m.lonLatBounds;y.west<c&&(c=y.west),y.south<h&&(h=y.south),y.east>u&&(u=y.east),y.north>p&&(p=y.north),f++}if(f>0&&Number.isFinite(c)&&Number.isFinite(u)){r(c,h,u,p);return}}}const a=this.computeRealRectangleDegrees(e);if(a){r(a.west,a.south,a.east,a.north);return}e.root&&this.viewer.flyTo(e.root,{duration:n})}computeRealRectangleDegrees(e){const t=e?.formData||{},n=e?.bounds,s=n?.min,o=n?.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 n=this.cesium.Color.WHITE.withAlpha(t);if(!e||typeof e!="string")return n;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),n}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1.25:Math.max(2.5,e*5)}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),n=Number(e[1]),s=Number(e[2]||0);return[t,n,s].some(o=>Number.isNaN(o))?null:[t,n,s]}mergeLayerItemsMap(e,t){Object.entries(t).forEach(([n,s])=>{e[n]||(e[n]=[]),e[n].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,n=!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??n}}removeModelNode(e,t){!e||!t||(e.remove(t),t.destroy&&!t.isDestroyed?.()&&t.destroy())}buildTransform(e,t){const n=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=s.scaleToMeter??e.result?.scaleToMeter??e.result?.realUnits??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 C=this.buildLongLatProj4Def(s.transformConfig),S=this.buildProjectedProj4Def(s.transformConfig);f=Ks(S,C),console.log("[buildTransform] proj4 mode:",{projectedDef:S,localOriginX:l,localOriginY:c});try{const[x,I]=f.forward([l,c]);if(!Number.isFinite(x)||!Number.isFinite(I))console.warn("proj4 returned NaN for base point",{localOriginX:l,localOriginY:c,blon:x,blat:I}),f=null;else{o=x,r=I,console.log("[buildTransform] proj4 base:",{blon:x,blat:I}),a=0,m=n.Cartesian3.fromDegrees(x,I,0);const M=n.Transforms.eastNorthUpToFixedFrame(m);y=n.Matrix4.inverseTransformation(M,new n.Matrix4)}}catch(x){console.warn("Failed to calculate projection base",x),f=null}}const g=n.Cartesian3.fromDegrees(o,r,a),A=n.Transforms.eastNorthUpToFixedFrame(g),v=s.totalRotation??t.totalRotation??0;if(v){const C=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(v)),S=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(C),new n.Cartesian3(0,0,0));n.Matrix4.multiply(A,S,A)}return{originLongitude:o,originLatitude:r,originHeight:a,localOriginX:l,localOriginY:c,scaleToMeter:h,scale:u,totalScaleToMeter:p,toWorld:C=>{const S=this.normalizePoint(C);if(!S)return null;if(f&&m&&y)try{const[I,M]=f.forward([S[0],S[1]]);if(!(!Number.isFinite(I)||!Number.isFinite(M))){const w=n.Cartesian3.fromDegrees(I,M,S[2]),T=n.Matrix4.multiplyByPoint(y,w,new n.Cartesian3);return T.x*=u,T.y*=u,T.z*=u,n.Matrix4.multiplyByPoint(A,T,new n.Cartesian3)}}catch{}const x=new n.Cartesian3((S[0]-l)*p,(S[1]-c)*p,S[2]*p);return n.Matrix4.multiplyByPoint(A,x,new n.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,releaseGeometryInstances:!1,classificationType:this.cesium.ClassificationType.TERRAIN,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,releaseGeometryInstances:!1,classificationType:this.cesium.ClassificationType.TERRAIN,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(n=>{t.add(n)}),t}buildModelPrimitives(e,t,n){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(A=>{const b=(Array.isArray(A?.positions)?A.positions:[]).map(M=>l.toWorld(M)).filter(Boolean);if(b.length<2)return;const C=A.layer||"default",S=A.color||"#ffffff",x=this.uniqueKey([C,"line",this.getLineWidth(A.lineWeight)]),I=c.get(x)||[];I.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:b,width:this.getLineWidth(A.lineWeight)}):new s.PolylineGeometry({positions:b,width:this.getLineWidth(A.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(S,1))},id:{modelId:e.modelId,layer:C,batchId:A.batchId,type:"line"}})),c.set(x,I)}),f.forEach(A=>{const b=(Array.isArray(A?.outerPositions)?A.outerPositions:[]).map(w=>l.toWorld(w)).filter(Boolean);if(b.length<3)return;const C=Array.isArray(A?.holes)?A.holes.map(w=>{const T=Array.isArray(w)?w.map(k=>l.toWorld(k)).filter(Boolean):[];return T.length<3?null:new s.PolygonHierarchy(T)}).filter(Boolean):[],S=A.layer||"default",x=A.color||"#ffffff",I=this.uniqueKey([S,"polygon"]),M=h.get(I)||[];M.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(b,C),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(x,.45))},id:{modelId:e.modelId,layer:S,batchId:A.batchId,type:"polygon"}})),h.set(I,M)});const y=1;m.forEach(A=>{const v=A?.position||A?.positions?.[0]||A,b=this.normalizePoint(v);if(!b)return;const C=b[0],S=b[1],x=b[2]||0,I=A.layer||"default",M=A.color||"#ffffff",w=this.uniqueKey([I,"line",this.getLineWidth(A.lineWeight)]),T=c.get(w)||[],k=[l.toWorld([C-y,S,x]),l.toWorld([C+y,S,x])].filter(Boolean);k.length>=2&&T.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:k,width:this.getLineWidth(A.lineWeight)}):new s.PolylineGeometry({positions:k,width:this.getLineWidth(A.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(M,1))},id:{modelId:e.modelId,layer:I,batchId:A.batchId,type:"point"}})),c.set(w,T)});const g=(A,v,b)=>{v&&(o.add(v),n.recordLayers!==!1&&(a[A]||(a[A]=[]),a[A].push({primitive:v,color:b.color,batchId:b.batchId,type:b.type})),r[A]||(r[A]={}),r[A][b.type]=v)};return c.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createLinePrimitive(A,n),{color:void 0,batchId:A[0]?.id?.batchId,type:"line"})}),h.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createPolygonPrimitive(A,n),{color:void 0,batchId:A[0]?.id?.batchId,type:"polygon"})}),u.forEach((A,v)=>{const[b="default"]=v.split("::");g(b,this.createPointPrimitive(A),{color:void 0,batchId:A[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:a,transform:l}}buildModelRoot(e,t,n){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(a=>{const l=this.buildModelPrimitives(e,a,n);r||(r=l),s.add(l.root),this.mergeLayerItemsMap(o,l.layerItemsMap)}),{root:s,primaryRoot:r?.root??null,transform:r.transform,layerItemsMap:o}}getRuntimeModel(e){const t=e||this.modelId;return this.gisCadModelsList.find(n=>n.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){const n=this.cesium;t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround),e.tileCameraListenerRemove?.(),e.overviewLODListenerRemove?.(),e.tileCameraListenerRemove=void 0,e.overviewLODListenerRemove=void 0,e._overviewLODCheck=void 0,e._tileLODCheck=void 0,e.root&&(this.viewer.scene.primitives.remove(e.root),e.root.destroy&&!e.root.isDestroyed?.()&&e.root.destroy()),e.root=null,e.groundRoot=null,e.previewRoot=null,e.tileRoots?.clear(),e.overviewL0Roots?.clear(),e.overviewL1Roots?.clear(),e.formData=t;const s=e.sourceDataList?.[0];if(!s)return;const o=this.buildModelRoot({...e,formData:t},[s],e.buildOptions),r=new n.PrimitiveCollection;r.add(o.root),e.root=r,e.groundRoot=o.root,e.primaryRoot=o.primaryRoot,e.groundRoot.show=e.show!==!1,e.transform=o.transform,e.sourceDataList=[s],e.loadedChunks=1,e.tileRoots=e.manifestTiles?new Map:void 0,e.overviewL0Roots=new Map,e.overviewL1Roots=new Map,this.mapLayers[e.modelId]=o.layerItemsMap,this.viewer.scene.primitives.add(e.root),e.manifestTiles&&this.computeManifestTileLonLatBounds(e.manifestTiles,e.transform),e.overviewL0Tiles&&this.computeManifestTileLonLatBounds(e.overviewL0Tiles,e.transform),e.overviewL1Tiles&&this.computeManifestTileLonLatBounds(e.overviewL1Tiles,e.transform);const a=e._rebuildContext;a&&((e.overviewL0Tiles?.length||e.overviewL1Tiles?.length)&&this.setupOverviewLOD(e,e,a.normalizedBase,e.overviewL0Tiles||[],e.overviewL1Tiles||[],a.overviewL1Height),e.manifestTiles&&this.setupManifestTileLoading(e,e,a.normalizedBase)),this.viewer.scene.requestRender()}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 n=await t.blob(),s=new gl(new tr(n),{password:ju,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}/`,n=[e.sourceUrl,`${t}${e.dbName}/cad.zip`].filter(Boolean);return Array.from(new Set(n))}getChunkCandidateUrls(e,t,n){const o=[`${e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`}${e.dbName}/cad_${n}.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}_${n}${u}`,`${r.origin}${c}${f}${n}${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 n of t){const s=await this.loadModelFile(n);if(s)return{url:n,data:s}}return{url:t[0]||"",data:!1}}async addGISCadModel({fileNames:e,options:t}){if(!e?.length)return;const n={...this.options,...t},s={clampToGround:n.clampToGround??n.mode!=="2d"};for(const o of e){if(this.gisCadModelsList.find(v=>v.modelId===o.modelId))continue;/^(https?|atom):\/\//i.test(o.outPutPath)||(o.outPutPath=`${window.location.origin}${o.outPutPath}`);const a=o.outPutPath.endsWith("/")?o.outPutPath:`${o.outPutPath}/`,l=`${a}${o.dbName}/region.zip`;let c=!1;try{(await fetch(l,{method:"HEAD",cache:"no-store"})).ok&&(c=await this.loadModelFile(l))}catch{}c&&typeof c=="object"&&(["longitude","latitude","scale","totalRotation","height","scaleToMeter"].some(C=>c[C]!==void 0)&&(o.formData={longitude:c.longitude,latitude:c.latitude,scale:c.scale,totalRotation:c.totalRotation,height:c.height,scaleToMeter:c.scale,...o.formData||{}}),c.centralMeridian!==void 0&&(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",...o.formData||{}}));const h=`${a}${o.dbName}/manifest.zip`;let u=null,p=null,f=null,m=6e3;try{const v=await this.loadModelFile(h);v?.watermark&&await Wu(v.watermark,this.viewer?.container),v&&typeof v=="object"&&($u.includes(this.watermarkEnabled)&&sr(this.viewer?.container),v?.tiles&&Array.isArray(v.tiles)&&(u=v.tiles),Array.isArray(v?.overviewL0)&&(p=v.overviewL0),Array.isArray(v?.overviewL1)&&(f=v.overviewL1,m=Number(v.overviewL1Height)||6e3))}catch{}console.log("[addGISCadModel] formData:",JSON.stringify(o.formData)),console.log("[addGISCadModel] manifestTiles:",u?.length,"L0:",p?.length,"L1:",f?.length);const y=await this.loadSourceData(o);if(!y.data){console.error("Failed to resolve GIS CAD primary source for model:",o);continue}const g=y.data,A=Math.max(1,Number(g.numbersOfFile||1));try{const v=this.buildTransform(g,o),b=this.normalizeFormData(o,v,s.clampToGround),C=this.buildModelRoot({...o,formData:b},[g],s),S=new this.cesium.PrimitiveCollection;S.add(C.root);const x=g.bounds||null,I={...o,type:"gis-cad",sourceUrl:y.url,sourceData:g,sourceDataList:[g],root:S,groundRoot:C.root,primaryRoot:C.primaryRoot,previewRoot:null,bounds:x,transform:C.transform,show:!0,formData:b,editingFormData:null,isEditing:!1,buildOptions:s,totalChunks:u?u.length:A,loadedChunks:1,chunkLoadingComplete:!u&&A<=1,manifestTiles:u||void 0,tileRoots:u?new Map:void 0,pendingFontTiles:u?u.filter(M=>M.isFont&&M.file!=="cad.zip").map(M=>M.file):[],_rebuildContext:{normalizedBase:a,overviewL1Height:m}};this.mapLayers[o.modelId]=C.layerItemsMap,this.viewer.scene.primitives.add(I.root),this.gisCadModelsList.push(I),this.setModelId(o.modelId),p&&(this.computeManifestTileLonLatBounds(p,I.transform),I.overviewL0Tiles=p),n.flyTo&&this.flyToBounds(I),n.onSuccess&&n.onSuccess(I),(p||f)&&(f&&(this.computeManifestTileLonLatBounds(f,I.transform),I.overviewL1Tiles=f),this.setupOverviewLOD(o,I,a,p||[],f||[],m)),u?(this.computeManifestTileLonLatBounds(u,I.transform),this.setupManifestTileLoading(o,I,a)):A>1&&this.loadRemainingChunksAsync(o,y.url,A,I)}catch(v){console.error("Failed to build GIS CAD model:",o,v)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}async loadRemainingChunksAsync(e,t,n,s){for(let o=1;o<n;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,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:n}),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)}setupOverviewLOD(e,t,n,s,o,r=6e3){const a=this.cesium;t.overviewL0Roots=new Map,t.overviewL1Roots=new Map;const l=C=>{if(!C.lonLatBounds)return!1;let S=null;try{S=this.viewer?.camera?.computeViewRectangle?.()??null}catch{S=null}if(!S)return!0;const x=a.Rectangle.fromDegrees(C.lonLatBounds.west,C.lonLatBounds.south,C.lonLatBounds.east,C.lonLatBounds.north);return a.Rectangle.intersection(S,x)!==void 0},c=async(C,S)=>{if(S.has(C.file))return;const x=`${n}${e.dbName}/${C.file}`;try{const I=await this.loadModelFile(x);if(!I)return;const M=this.buildModelPrimitives({...t,formData:t.formData},I,t.buildOptions);t.groundRoot.add(M.root),S.set(C.file,M.root),this.viewer.scene.requestRender()}catch(I){console.warn(`Failed to load overview chunk ${C.file}:`,I)}},h=(C,S)=>{const x=S.get(C);if(x){try{t.groundRoot.remove(x),x.destroy&&x.destroy()}catch{}S.delete(C)}};let u=0;const p=3,f=[],m=()=>{for(;u<p&&f.length>0;){const{tile:C,rootMap:S}=f.shift();S.has(C.file)||(u++,c(C,S).finally(()=>{u--,m()}))}},y=(C,S)=>{S.has(C.file)||f.some(x=>x.tile.file===C.file)||f.push({tile:C,rootMap:S})},g=()=>{if(!t.overviewL0Roots||!t.overviewL1Roots)return;const C=this.getCameraHeightAboveGround(t),S=1500;for(const w of s)l(w)?y(w,t.overviewL0Roots):h(w.file,t.overviewL0Roots);for(const w of o)l(w)&&C>=S&&C<r?y(w,t.overviewL1Roots):h(w.file,t.overviewL1Roots);const x=(t.tileRoots?.size||0)>0,I=C>=S&&!x&&(C>=r||C<r&&t.overviewL1Roots.size===0);t.overviewL0Roots.forEach(w=>{w.show=I});const M=C>=S&&!x&&t.overviewL1Roots.size>0&&C<r;t.overviewL1Roots.forEach(w=>{w.show=M}),t.primaryRoot&&(t.primaryRoot.show=C>=S),m(),this.viewer.scene.requestRender()};t._overviewLODCheck=g;let A=null;const v=()=>{A&&clearTimeout(A),A=setTimeout(()=>{A=null,g()},200)},b=this.viewer?.camera?.moveEnd?.addEventListener?.(v);typeof b=="function"&&(t.overviewLODListenerRemove=()=>{A&&clearTimeout(A),b()}),g()}computeManifestTileLonLatBounds(e,t){if(!t?.toWorld){console.warn("[computeManifestTileLonLatBounds] modelTransform.toWorld 不存在,跳过");return}const n=this.cesium;console.log("[computeManifestTileLonLatBounds] transform 参数:",{originLongitude:t.originLongitude,originLatitude:t.originLatitude,localOriginX:t.localOriginX,localOriginY:t.localOriginY,scaleToMeter:t.scaleToMeter,scale:t.scale,totalScaleToMeter:t.totalScaleToMeter});let s=0,o=0;const r=(a,l)=>{try{const c=t.toWorld([a,l,0]);if(!c)return null;const h=n.Cartographic.fromCartesian(c);return[n.Math.toDegrees(h.longitude),n.Math.toDegrees(h.latitude)]}catch{return null}};for(const a of e){if(!a.bounds)continue;const{minX:l,minY:c,maxX:h,maxY:u}=a.bounds,p=r(l,c),f=r(h,u);p&&f?(a.lonLatBounds={west:Math.min(p[0],f[0]),south:Math.min(p[1],f[1]),east:Math.max(p[0],f[0]),north:Math.max(p[1],f[1])},s++):o++}if(console.log(`[computeManifestTileLonLatBounds] 成功=${s} 失败=${o} 总共=${e.length}`),s>0){const a=e.find(l=>l.lonLatBounds);console.log("[computeManifestTileLonLatBounds] 示例:",a?.file,a?.lonLatBounds)}}setupManifestTileLoading(e,t,n){const a=this.cesium,l=t.manifestTiles||[];if(l.length===0)return;const c=x=>{if(!x.lonLatBounds)return!1;let I=null;try{I=this.viewer?.camera?.computeViewRectangle?.()??null}catch{I=null}if(!I)return!0;const M=a.Rectangle.fromDegrees(x.lonLatBounds.west,x.lonLatBounds.south,x.lonLatBounds.east,x.lonLatBounds.north);return a.Rectangle.intersection(I,M)!==void 0},h=x=>{const I=t.tileRoots?.get(x);if(I){try{t.groundRoot.remove(I),I.destroy&&I.destroy()}catch{}t.tileRoots?.delete(x),t.loadedChunks=Math.max(1,(t.loadedChunks||1)-1),this.events.emit("chunkProgress",{modelId:t.modelId,loaded:t.loadedChunks,total:t.totalChunks}),t._overviewLODCheck?.(),this.viewer.scene.requestRender()}},u=new Map,p=3;let f=0;const m=[],y=x=>{const I=u.get(x);I&&(clearTimeout(I),u.delete(x));const M=m.indexOf(x);M>=0&&m.splice(M,1)},g=()=>{for(;f<p&&m.length>0;){const x=m.shift(),I=l.find(M=>M.file===x);!I||t.tileRoots?.has(x)||!c(I)||(f++,A(x).finally(()=>{f--,g()}))}},A=async x=>{if(t.tileRoots?.has(x))return;const I=`${n}${e.dbName}/${x}`;try{const M=await this.loadModelFile(I);if(M?.watermark&&this.watermarkEnabled,!M)return;const w=this.buildModelPrimitives({...t,formData:t.formData},M,t.buildOptions);t.groundRoot.add(w.root),t.tileRoots?.set(x,w.root),t.sourceDataList.push(M),this.mapLayers[t.modelId]||(this.mapLayers[t.modelId]={}),this.mergeLayerItemsMap(this.mapLayers[t.modelId],w.layerItemsMap),t.loadedChunks=(t.loadedChunks||1)+1,this.events.emit("chunkProgress",{modelId:t.modelId,loaded:t.loadedChunks,total:t.totalChunks}),t._overviewLODCheck?.(),this.viewer.scene.requestRender()}catch(M){console.error("Failed to load CAD tile:",I,M)}},v=()=>{if(!t.tileRoots)return;const x=this.getCameraHeightAboveGround(t);console.log("cameraHeight",x);const I=x<1e3;for(const M of l){if(M.file==="cad.zip"||!t.tileRoots.has(M.file))continue;let w=!1;M.isFont?I&&c(M)||(w=!0):c(M)?x>=1500&&(w=!0):w=!0,w&&(y(M.file),h(M.file),M.isFont&&!t.pendingFontTiles?.includes(M.file)&&t.pendingFontTiles?.push(M.file))}for(const M of l)if(M.file!=="cad.zip"&&!t.tileRoots.has(M.file)&&!u.has(M.file)&&!m.includes(M.file)&&!(M.isFont&&!I)&&!(!M.isFont&&x>=1500)&&c(M)){const w=M.file,T=setTimeout(()=>{u.delete(w),!t.tileRoots?.has(w)&&c(M)&&!m.includes(w)&&(m.push(w),g())},20);u.set(M.file,T)}t.primaryRoot&&(t.primaryRoot.show=x>=1500)};let b=null;const C=()=>{b&&clearTimeout(b),b=setTimeout(()=>{b=null,v()},20)},S=this.viewer?.camera?.moveEnd?.addEventListener?.(C);typeof S=="function"&&(t.tileCameraListenerRemove=()=>{b&&clearTimeout(b),S()}),t._tileLODCheck=v,v()}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.formData={...t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.replaceGroundRoot(t,t.formData),this.flyToBounds(t,{duration:0,minHeight:t._rebuildContext?.overviewL1Height}),t.formData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t&&(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(n=>n.modelId===e);if(t>-1){const n=this.gisCadModelsList[t];n.tileCameraListenerRemove?.(),n.overviewLODListenerRemove?.(),this.viewer.scene.primitives.remove(n.root),n.root?.destroy&&!n.root.isDestroyed?.()&&n.root.destroy(),this.gisCadModelsList.splice(t,1)}}deleteAllCad(){[...this.gisCadModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class ki{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const n=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:n,anchor:n==2,closeBtn:n==2,offset:n==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>