leiting-bim 2.1.165 → 2.1.184

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.
@@ -1,32 +1,35 @@
1
- (function(Q,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@zumer/snapdom"),require("ant-design-vue"),require("@ant-design/icons-vue")):typeof define=="function"&&define.amd?define(["exports","vue","@zumer/snapdom","ant-design-vue","@ant-design/icons-vue"],o):(Q=typeof globalThis<"u"?globalThis:Q||self,o(Q.LeitingBim={},Q.Vue,Q.snapdom,Q.antd,Q.iconsVue))})(this,(function(Q,o,ql,ie,qt){"use strict";var me=typeof document<"u"?document.currentScript:null;function Jl(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const Zl=Jl(ql),Ct={cesiumUrl:"https://leiting.chenxisoft.com/resource/js/cesiumjs/Cesium1.140/Cesium.js",cesiumCssUrl:"https://leiting.chenxisoft.com/resource/js/cesiumjs/Cesium1.140/Widgets/widgets.css",accessToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjZGI0MzM1ZS1hMjY4LTRlYzgtYjg1MC03NmI2ZjUxMmM5ZTUiLCJpZCI6OTUzODIsImlhdCI6MTY1MzYyMTM4OX0.ygoPAb1FvQkQGtziq5nTsWT-u7dCheu5hcG0p9TQFpU"};let Et=null,Ft;function xi(n){return n.accessToken&&(Ft=n.accessToken),Et||(Et=new Promise((e,t)=>{if(window.Cesium){Ft&&(window.Cesium.Ion.defaultAccessToken=Ft),e();return}const{cesiumUrl:i,cesiumCssUrl:s}=n;if(s){const a=document.createElement("link");a.rel="stylesheet",a.href=s,document.head.appendChild(a)}const r=document.createElement("script");r.src=i,r.async=!0,r.onload=()=>{Ft&&window.Cesium&&(window.Cesium.Ion.defaultAccessToken=Ft),e()},r.onerror=a=>{console.error("Failed to load Cesium script",a),Et=null,t(a)},document.head.appendChild(r)}),Et)}function ec(){return window.Cesium?Promise.resolve():Et||Promise.reject(new Error("Cesium loading has not been initiated."))}function Si(){return Ft}class tc{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}setSceneOptions(e){if(!this.viewer||!this.viewer.scene)return;const t=this.viewer.scene;typeof e.showGlobe=="boolean"&&t.globe&&(t.globe.show=e.showGlobe),typeof e.showSkyAtmosphere=="boolean"&&t.skyAtmosphere&&(t.skyAtmosphere.show=e.showSkyAtmosphere),typeof e.showSkyBox=="boolean"&&t.skyBox&&(t.skyBox.show=e.showSkyBox)}clearBackground(){!this.viewer||!this.viewer.scene||(this.viewer.scene.backgroundColor=new this.cesium.Color(0,0,0,0))}enableTestLabel(){this.viewer&&(this.viewer.extend(this.cesium.viewerCesium3DTilesInspectorMixin),this.viewer.cesium3DTilesInspector.viewModel)}enableCesiumFXAA(e){if(!this.viewer||!this.viewer.scene)return;let t=window.devicePixelRatio;for(;t>=2;)t/=2;this.viewer.resolutionScale=t,this.viewer.scene.postProcessStages.fxaa.enabled=e,this.viewer.scene.highDynamicRange=!0,this.viewer.scene.postProcessStages.tonemapper=this.cesium.Tonemapper.PBR_NEUTRAL,this.viewer.scene.postProcessStages.exposure=1}async getSnapDomSImageBase64(e="base-cx-BIM-gis",t={}){const{format:i="png",quality:s=.8,scale:r=1,returnDataUrl:a=!1}=t;try{const c=Zl,l=this.viewer&&this.viewer.container&&this.viewer.container.id;let d=null;if(l&&(d=document.getElementById(l)),!d&&this.viewer&&this.viewer.container&&(d=this.viewer.container),!d)return null;document.fonts&&document.fonts.ready&&await document.fonts.ready;let h=null;const f=c.snapdom||c.default||c;let p=null;if(i==="webp"&&f.toWebp)p=await f.toWebp(d,{quality:s,pixelRatio:r,embedFonts:!0,className:e});else if(f.toPng)p=await f.toPng(d,{quality:s,pixelRatio:r,embedFonts:!0,className:e});else if(f.toBlob){const m=await f.toBlob(d,{type:i==="webp"?"image/webp":"image/png",quality:s,pixelRatio:r,embedFonts:!0,className:e});p=await this.blobToDataURL(m)}else console.warn("snapdom methods not found on:",f);if(p&&typeof p!="string")p instanceof Blob?h=await this.blobToDataURL(p):p.src&&typeof p.src=="string"?h=p.src:(console.warn("getSnapDomSImageBase64 returned non-string:",p),p.data&&typeof p.data=="string"?h=p.data:h=String(p));else{const m=String(p);h=m.startsWith("data:")?m:`data:image/${i};base64,${m}`}return h?a?h:String(h):null}catch(c){return console.error("getSnapDomSImageBase64 failed",c),null}}async blobToDataURL(e){return new Promise((t,i)=>{const s=new FileReader;s.onload=()=>t(String(s.result)),s.onerror=r=>i(r),s.readAsDataURL(e)})}viewBase64Image(e,t="png"){if(!e){console.warn("viewBase64Image: No base64 data provided");return}const i=`data:image/${t};base64,`,s=e.startsWith("data:")?e:i+e,r=window.open();r?(r.document.write(`
1
+ (function(V,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@zumer/snapdom"),require("ant-design-vue"),require("@ant-design/icons-vue")):typeof define=="function"&&define.amd?define(["exports","vue","@zumer/snapdom","ant-design-vue","@ant-design/icons-vue"],a):(V=typeof globalThis<"u"?globalThis:V||self,a(V.LeitingBim={},V.Vue,V.snapdom,V.antd,V.iconsVue))})(this,(function(V,a,Dh,se,Li){"use strict";var we=typeof document<"u"?document.currentScript:null;function kh(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const Nh=kh(Dh),jt={cesiumUrl:"https://leiting.chenxisoft.com/resource/js/cesiumjs/Cesium1.140/Cesium.js",cesiumCssUrl:"https://leiting.chenxisoft.com/resource/js/cesiumjs/Cesium1.140/Widgets/widgets.css",accessToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjZGI0MzM1ZS1hMjY4LTRlYzgtYjg1MC03NmI2ZjUxMmM5ZTUiLCJpZCI6OTUzODIsImlhdCI6MTY1MzYyMTM4OX0.ygoPAb1FvQkQGtziq5nTsWT-u7dCheu5hcG0p9TQFpU"};let Wt=null,di;function js(i){return i.accessToken&&(di=i.accessToken),Wt||(Wt=new Promise((e,t)=>{if(window.Cesium){di&&(window.Cesium.Ion.defaultAccessToken=di),e();return}const{cesiumUrl:n,cesiumCssUrl:s}=i;if(s){const r=document.createElement("link");r.rel="stylesheet",r.href=s,document.head.appendChild(r)}const o=document.createElement("script");o.src=n,o.async=!0,o.onload=()=>{di&&window.Cesium&&(window.Cesium.Ion.defaultAccessToken=di),e()},o.onerror=r=>{console.error("Failed to load Cesium script",r),Wt=null,t(r)},document.head.appendChild(o)}),Wt)}function Rh(){return window.Cesium?Promise.resolve():Wt||Promise.reject(new Error("Cesium loading has not been initiated."))}function Ws(){return di}class Fh{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}setSceneOptions(e){if(!this.viewer||!this.viewer.scene)return;const t=this.viewer.scene;typeof e.showGlobe=="boolean"&&t.globe&&(t.globe.show=e.showGlobe),typeof e.showSkyAtmosphere=="boolean"&&t.skyAtmosphere&&(t.skyAtmosphere.show=e.showSkyAtmosphere),typeof e.showSkyBox=="boolean"&&t.skyBox&&(t.skyBox.show=e.showSkyBox)}clearBackground(){!this.viewer||!this.viewer.scene||(this.viewer.scene.backgroundColor=new this.cesium.Color(0,0,0,0))}enableTestLabel(){this.viewer&&(this.viewer.extend(this.cesium.viewerCesium3DTilesInspectorMixin),this.viewer.cesium3DTilesInspector.viewModel)}enableCesiumFXAA(e){if(!this.viewer||!this.viewer.scene)return;let t=window.devicePixelRatio;for(;t>=2;)t/=2;this.viewer.resolutionScale=t,this.viewer.scene.postProcessStages.fxaa.enabled=e,this.viewer.scene.highDynamicRange=!0,this.viewer.scene.postProcessStages.tonemapper=this.cesium.Tonemapper.PBR_NEUTRAL,this.viewer.scene.postProcessStages.exposure=1}async getSnapDomSImageBase64(e="base-cx-BIM-gis",t={}){const{format:n="png",quality:s=.8,scale:o=1,returnDataUrl:r=!1}=t;try{const l=Nh,c=this.viewer&&this.viewer.container&&this.viewer.container.id;let d=null;if(c&&(d=document.getElementById(c)),!d&&this.viewer&&this.viewer.container&&(d=this.viewer.container),!d)return null;document.fonts&&document.fonts.ready&&await document.fonts.ready;let h=null;const f=l.snapdom||l.default||l;let m=null;if(n==="webp"&&f.toWebp)m=await f.toWebp(d,{quality:s,pixelRatio:o,embedFonts:!0,className:e});else if(f.toPng)m=await f.toPng(d,{quality:s,pixelRatio:o,embedFonts:!0,className:e});else if(f.toBlob){const g=await f.toBlob(d,{type:n==="webp"?"image/webp":"image/png",quality:s,pixelRatio:o,embedFonts:!0,className:e});m=await this.blobToDataURL(g)}else console.warn("snapdom methods not found on:",f);if(m&&typeof m!="string")m instanceof Blob?h=await this.blobToDataURL(m):m.src&&typeof m.src=="string"?h=m.src:(console.warn("getSnapDomSImageBase64 returned non-string:",m),m.data&&typeof m.data=="string"?h=m.data:h=String(m));else{const g=String(m);h=g.startsWith("data:")?g:`data:image/${n};base64,${g}`}return h?r?h:String(h):null}catch(l){return console.error("getSnapDomSImageBase64 failed",l),null}}async blobToDataURL(e){return new Promise((t,n)=>{const s=new FileReader;s.onload=()=>t(String(s.result)),s.onerror=o=>n(o),s.readAsDataURL(e)})}viewBase64Image(e,t="png"){if(!e){console.warn("viewBase64Image: No base64 data provided");return}const n=`data:image/${t};base64,`,s=e.startsWith("data:")?e:n+e,o=window.open();o?(o.document.write(`
2
2
  <html>
3
3
  <head><title>Snapshot Preview</title></head>
4
4
  <body style="margin:0; display:flex; justify-content:center; align-items:center; height:100vh; background:#333;">
5
5
  <img src="${s}" style="max-width:90%; max-height:90%; border:2px solid #fff; box-shadow:0 0 10px rgba(0,0,0,0.5);"/>
6
6
  </body>
7
7
  </html>
8
- `),r.document.close()):(console.warn("viewBase64Image: Failed to open new window. Please check popup blocker."),console.log("Snapshot DataURL:",s))}updateModelEffect(e){const t=this.viewer,i=this.cesium;if(!t||!t.scene)return;const s=t.scene.primitives,r=s.length,a=!!i.CustomShader;for(let c=0;c<r;c++){const l=s.get(c);if(i.Cesium3DTileset&&l instanceof i.Cesium3DTileset)if(a)if(l.customShader&&l.customShader.isModelAdjustment)l.customShader.setUniform("u_tilesBrightness",e);else{const d=new i.CustomShader({uniforms:{u_tilesBrightness:{type:i.UniformType.FLOAT,value:e}},fragmentShaderText:`
8
+ `),o.document.close()):(console.warn("viewBase64Image: Failed to open new window. Please check popup blocker."),console.log("Snapshot DataURL:",s))}updateModelEffect(e){const t=this.viewer,n=this.cesium;if(!t||!t.scene)return;const s=t.scene.primitives,o=s.length,r=!!n.CustomShader;for(let l=0;l<o;l++){const c=s.get(l);if(n.Cesium3DTileset&&c instanceof n.Cesium3DTileset)if(r)if(c.customShader&&c.customShader.isModelAdjustment)c.customShader.setUniform("u_tilesBrightness",e);else{const d=new n.CustomShader({uniforms:{u_tilesBrightness:{type:n.UniformType.FLOAT,value:e}},fragmentShaderText:`
9
9
  void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
10
10
  material.diffuse *= u_tilesBrightness;
11
11
  }
12
- `});d.isModelAdjustment=!0,l.customShader=d}else{let d="color('white')";e!==1&&(d=`${d} * ${e}`),l.style=new i.Cesium3DTileStyle({color:d})}}}}var Qs=typeof global=="object"&&global&&global.Object===Object&&global,nc=typeof self=="object"&&self&&self.Object===Object&&self,bt=Qs||nc||Function("return this")(),Fn=bt.Symbol,Vs=Object.prototype,ic=Vs.hasOwnProperty,sc=Vs.toString,Jt=Fn?Fn.toStringTag:void 0;function oc(n){var e=ic.call(n,Jt),t=n[Jt];try{n[Jt]=void 0;var i=!0}catch{}var s=sc.call(n);return i&&(e?n[Jt]=t:delete n[Jt]),s}var rc=Object.prototype,ac=rc.toString;function lc(n){return ac.call(n)}var cc="[object Null]",dc="[object Undefined]",Gs=Fn?Fn.toStringTag:void 0;function Zt(n){return n==null?n===void 0?dc:cc:Gs&&Gs in Object(n)?oc(n):lc(n)}function Rt(n){return n!=null&&typeof n=="object"}var uc="[object Symbol]";function hc(n){return typeof n=="symbol"||Rt(n)&&Zt(n)==uc}var Ti=Array.isArray,fc=/\s/;function pc(n){for(var e=n.length;e--&&fc.test(n.charAt(e)););return e}var mc=/^\s+/;function gc(n){return n&&n.slice(0,pc(n)+1).replace(mc,"")}function qe(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Hs=NaN,Ac=/^[-+]0x[0-9a-f]+$/i,yc=/^0b[01]+$/i,Cc=/^0o[0-7]+$/i,Ec=parseInt;function Ys(n){if(typeof n=="number")return n;if(hc(n))return Hs;if(qe(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=qe(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=gc(n);var t=yc.test(n);return t||Cc.test(n)?Ec(n.slice(2),t?2:8):Ac.test(n)?Hs:+n}function zs(n){return n}var bc="[object AsyncFunction]",wc="[object Function]",vc="[object GeneratorFunction]",Ic="[object Proxy]";function Mi(n){if(!qe(n))return!1;var e=Zt(n);return e==wc||e==vc||e==bc||e==Ic}var Di=bt["__core-js_shared__"],Ws=(function(){var n=/[^.]+$/.exec(Di&&Di.keys&&Di.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function Bc(n){return!!Ws&&Ws in n}var xc=Function.prototype,Sc=xc.toString;function Tc(n){if(n!=null){try{return Sc.call(n)}catch{}try{return n+""}catch{}}return""}var Mc=/[\\^$.*+?()[\]{}|]/g,Dc=/^\[object .+?Constructor\]$/,kc=Function.prototype,Pc=Object.prototype,Nc=kc.toString,Fc=Pc.hasOwnProperty,Rc=RegExp("^"+Nc.call(Fc).replace(Mc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Lc(n){if(!qe(n)||Bc(n))return!1;var e=Mi(n)?Rc:Dc;return e.test(Tc(n))}function Oc(n,e){return n?.[e]}function ki(n,e){var t=Oc(n,e);return Lc(t)?t:void 0}var js=Object.create,Uc=(function(){function n(){}return function(e){if(!qe(e))return{};if(js)return js(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function _c(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Qc(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}var Vc=800,Gc=16,Hc=Date.now;function Yc(n){var e=0,t=0;return function(){var i=Hc(),s=Gc-(i-t);if(t=i,s>0){if(++e>=Vc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function zc(n){return function(){return n}}var Rn=(function(){try{var n=ki(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Wc=Rn?function(n,e){return Rn(n,"toString",{configurable:!0,enumerable:!1,value:zc(e),writable:!0})}:zs,jc=Yc(Wc),Kc=9007199254740991,$c=/^(?:0|[1-9]\d*)$/;function Ks(n,e){var t=typeof n;return e=e??Kc,!!e&&(t=="number"||t!="symbol"&&$c.test(n))&&n>-1&&n%1==0&&n<e}function Pi(n,e,t){e=="__proto__"&&Rn?Rn(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Ln(n,e){return n===e||n!==n&&e!==e}var Xc=Object.prototype,qc=Xc.hasOwnProperty;function Jc(n,e,t){var i=n[e];(!(qc.call(n,e)&&Ln(i,t))||t===void 0&&!(e in n))&&Pi(n,e,t)}function Zc(n,e,t,i){var s=!t;t||(t={});for(var r=-1,a=e.length;++r<a;){var c=e[r],l=void 0;l===void 0&&(l=n[c]),s?Pi(t,c,l):Jc(t,c,l)}return t}var $s=Math.max;function ed(n,e,t){return e=$s(e===void 0?n.length-1:e,0),function(){for(var i=arguments,s=-1,r=$s(i.length-e,0),a=Array(r);++s<r;)a[s]=i[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=i[s];return c[e]=t(a),_c(n,this,c)}}function td(n,e){return jc(ed(n,e,zs),n+"")}var nd=9007199254740991;function Xs(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=nd}function Ni(n){return n!=null&&Xs(n.length)&&!Mi(n)}function id(n,e,t){if(!qe(t))return!1;var i=typeof e;return(i=="number"?Ni(t)&&Ks(e,t.length):i=="string"&&e in t)?Ln(t[e],n):!1}function sd(n){return td(function(e,t){var i=-1,s=t.length,r=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(r=n.length>3&&typeof r=="function"?(s--,r):void 0,a&&id(t[0],t[1],a)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var c=t[i];c&&n(e,c,i,r)}return e})}var od=Object.prototype;function qs(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||od;return n===t}function rd(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var ad="[object Arguments]";function Js(n){return Rt(n)&&Zt(n)==ad}var Zs=Object.prototype,ld=Zs.hasOwnProperty,cd=Zs.propertyIsEnumerable,Fi=Js((function(){return arguments})())?Js:function(n){return Rt(n)&&ld.call(n,"callee")&&!cd.call(n,"callee")};function dd(){return!1}var eo=typeof Q=="object"&&Q&&!Q.nodeType&&Q,to=eo&&typeof module=="object"&&module&&!module.nodeType&&module,ud=to&&to.exports===eo,no=ud?bt.Buffer:void 0,hd=no?no.isBuffer:void 0,io=hd||dd,fd="[object Arguments]",pd="[object Array]",md="[object Boolean]",gd="[object Date]",Ad="[object Error]",yd="[object Function]",Cd="[object Map]",Ed="[object Number]",bd="[object Object]",wd="[object RegExp]",vd="[object Set]",Id="[object String]",Bd="[object WeakMap]",xd="[object ArrayBuffer]",Sd="[object DataView]",Td="[object Float32Array]",Md="[object Float64Array]",Dd="[object Int8Array]",kd="[object Int16Array]",Pd="[object Int32Array]",Nd="[object Uint8Array]",Fd="[object Uint8ClampedArray]",Rd="[object Uint16Array]",Ld="[object Uint32Array]",ue={};ue[Td]=ue[Md]=ue[Dd]=ue[kd]=ue[Pd]=ue[Nd]=ue[Fd]=ue[Rd]=ue[Ld]=!0,ue[fd]=ue[pd]=ue[xd]=ue[md]=ue[Sd]=ue[gd]=ue[Ad]=ue[yd]=ue[Cd]=ue[Ed]=ue[bd]=ue[wd]=ue[vd]=ue[Id]=ue[Bd]=!1;function Od(n){return Rt(n)&&Xs(n.length)&&!!ue[Zt(n)]}function Ud(n){return function(e){return n(e)}}var so=typeof Q=="object"&&Q&&!Q.nodeType&&Q,en=so&&typeof module=="object"&&module&&!module.nodeType&&module,_d=en&&en.exports===so,Ri=_d&&Qs.process,oo=(function(){try{var n=en&&en.require&&en.require("util").types;return n||Ri&&Ri.binding&&Ri.binding("util")}catch{}})(),ro=oo&&oo.isTypedArray,ao=ro?Ud(ro):Od;function Qd(n,e){var t=Ti(n),i=!t&&Fi(n),s=!t&&!i&&io(n),r=!t&&!i&&!s&&ao(n),a=t||i||s||r,c=a?rd(n.length,String):[],l=c.length;for(var d in n)a&&(d=="length"||s&&(d=="offset"||d=="parent")||r&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ks(d,l))||c.push(d);return c}function Vd(n,e){return function(t){return n(e(t))}}function Gd(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var Hd=Object.prototype,Yd=Hd.hasOwnProperty;function zd(n){if(!qe(n))return Gd(n);var e=qs(n),t=[];for(var i in n)i=="constructor"&&(e||!Yd.call(n,i))||t.push(i);return t}function lo(n){return Ni(n)?Qd(n):zd(n)}var tn=ki(Object,"create");function Wd(){this.__data__=tn?tn(null):{},this.size=0}function jd(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Kd="__lodash_hash_undefined__",$d=Object.prototype,Xd=$d.hasOwnProperty;function qd(n){var e=this.__data__;if(tn){var t=e[n];return t===Kd?void 0:t}return Xd.call(e,n)?e[n]:void 0}var Jd=Object.prototype,Zd=Jd.hasOwnProperty;function eu(n){var e=this.__data__;return tn?e[n]!==void 0:Zd.call(e,n)}var tu="__lodash_hash_undefined__";function nu(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=tn&&e===void 0?tu:e,this}function wt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}wt.prototype.clear=Wd,wt.prototype.delete=jd,wt.prototype.get=qd,wt.prototype.has=eu,wt.prototype.set=nu;function iu(){this.__data__=[],this.size=0}function On(n,e){for(var t=n.length;t--;)if(Ln(n[t][0],e))return t;return-1}var su=Array.prototype,ou=su.splice;function ru(n){var e=this.__data__,t=On(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():ou.call(e,t,1),--this.size,!0}function au(n){var e=this.__data__,t=On(e,n);return t<0?void 0:e[t][1]}function lu(n){return On(this.__data__,n)>-1}function cu(n,e){var t=this.__data__,i=On(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function st(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}st.prototype.clear=iu,st.prototype.delete=ru,st.prototype.get=au,st.prototype.has=lu,st.prototype.set=cu;var co=ki(bt,"Map");function du(){this.size=0,this.__data__={hash:new wt,map:new(co||st),string:new wt}}function uu(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Un(n,e){var t=n.__data__;return uu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function hu(n){var e=Un(this,n).delete(n);return this.size-=e?1:0,e}function fu(n){return Un(this,n).get(n)}function pu(n){return Un(this,n).has(n)}function mu(n,e){var t=Un(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function Lt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Lt.prototype.clear=du,Lt.prototype.delete=hu,Lt.prototype.get=fu,Lt.prototype.has=pu,Lt.prototype.set=mu;var uo=Vd(Object.getPrototypeOf,Object),gu="[object Object]",Au=Function.prototype,yu=Object.prototype,ho=Au.toString,Cu=yu.hasOwnProperty,Eu=ho.call(Object);function bu(n){if(!Rt(n)||Zt(n)!=gu)return!1;var e=uo(n);if(e===null)return!0;var t=Cu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ho.call(t)==Eu}function wu(){this.__data__=new st,this.size=0}function vu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Iu(n){return this.__data__.get(n)}function Bu(n){return this.__data__.has(n)}var xu=200;function Su(n,e){var t=this.__data__;if(t instanceof st){var i=t.__data__;if(!co||i.length<xu-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new Lt(i)}return t.set(n,e),this.size=t.size,this}function Ot(n){var e=this.__data__=new st(n);this.size=e.size}Ot.prototype.clear=wu,Ot.prototype.delete=vu,Ot.prototype.get=Iu,Ot.prototype.has=Bu,Ot.prototype.set=Su;var fo=typeof Q=="object"&&Q&&!Q.nodeType&&Q,po=fo&&typeof module=="object"&&module&&!module.nodeType&&module,Tu=po&&po.exports===fo,mo=Tu?bt.Buffer:void 0;mo&&mo.allocUnsafe;function Mu(n,e){return n.slice()}var go=bt.Uint8Array;function Du(n){var e=new n.constructor(n.byteLength);return new go(e).set(new go(n)),e}function ku(n,e){var t=Du(n.buffer);return new n.constructor(t,n.byteOffset,n.length)}function Pu(n){return typeof n.constructor=="function"&&!qs(n)?Uc(uo(n)):{}}function Nu(n){return function(e,t,i){for(var s=-1,r=Object(e),a=i(e),c=a.length;c--;){var l=a[++s];if(t(r[l],l,r)===!1)break}return e}}var Fu=Nu(),Li=function(){return bt.Date.now()},Ru="Expected a function",Lu=Math.max,Ou=Math.min;function _n(n,e,t){var i,s,r,a,c,l,d=0,h=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError(Ru);e=Ys(e)||0,qe(t)&&(h=!!t.leading,f="maxWait"in t,r=f?Lu(Ys(t.maxWait)||0,e):r,p="trailing"in t?!!t.trailing:p);function u(S){var B=i,g=s;return i=s=void 0,d=S,a=n.apply(g,B),a}function m(S){return d=S,c=setTimeout(b,e),h?u(S):a}function E(S){var B=S-l,g=S-d,R=e-B;return f?Ou(R,r-g):R}function A(S){var B=S-l,g=S-d;return l===void 0||B>=e||B<0||f&&g>=r}function b(){var S=Li();if(A(S))return w(S);c=setTimeout(b,E(S))}function w(S){return c=void 0,p&&i?u(S):(i=s=void 0,a)}function I(){c!==void 0&&clearTimeout(c),d=0,i=l=s=c=void 0}function D(){return c===void 0?a:w(Li())}function N(){var S=Li(),B=A(S);if(i=arguments,s=this,l=S,B){if(c===void 0)return m(l);if(f)return clearTimeout(c),c=setTimeout(b,e),u(l)}return c===void 0&&(c=setTimeout(b,e)),a}return N.cancel=I,N.flush=D,N}function Oi(n,e,t){(t!==void 0&&!Ln(n[e],t)||t===void 0&&!(e in n))&&Pi(n,e,t)}function Uu(n){return Rt(n)&&Ni(n)}function Ui(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function _u(n){return Zc(n,lo(n))}function Qu(n,e,t,i,s,r,a){var c=Ui(n,t),l=Ui(e,t),d=a.get(l);if(d){Oi(n,t,d);return}var h=r?r(c,l,t+"",n,e,a):void 0,f=h===void 0;if(f){var p=Ti(l),u=!p&&io(l),m=!p&&!u&&ao(l);h=l,p||u||m?Ti(c)?h=c:Uu(c)?h=Qc(c):u?(f=!1,h=Mu(l)):m?(f=!1,h=ku(l)):h=[]:bu(l)||Fi(l)?(h=c,Fi(c)?h=_u(c):(!qe(c)||Mi(c))&&(h=Pu(l))):f=!1}f&&(a.set(l,h),s(h,l,i,r,a),a.delete(l)),Oi(n,t,h)}function Ao(n,e,t,i,s){n!==e&&Fu(e,function(r,a){if(s||(s=new Ot),qe(r))Qu(n,e,a,t,Ao,i,s);else{var c=i?i(Ui(n,a),r,a+"",n,e,s):void 0;c===void 0&&(c=r),Oi(n,a,c)}},lo)}var Vu=sd(function(n,e,t){Ao(n,e,t)});function _i({Cesium:n,tileset:e}){const t=e.leiting;if(!t||!t.model||!t.model.formData)return;const i=t.model.formData,s=t.box,r=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(i.totalRotation||0)),a=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(r),n.Cartesian3.ZERO),c=n.Cartesian3.fromDegrees(i.longitude,i.latitude,i.height),l=n.Transforms.eastNorthUpToFixedFrame(c),d=n.Matrix4.multiply(l,a,new n.Matrix4);if(e._root){if(!s){e._root.transform=d;return}try{const{center:h}=s,f=e.root.boundingVolume.boundingSphere,p=new n.Cartesian3(h.x,h.y,0),u=n.Matrix4.multiplyByPoint(d,p,new n.Cartesian3),m=n.Cartographic.fromCartesian(u),E=f.center,A=n.Transforms.eastNorthUpToFixedFrame(new n.Cartesian3(E.x,E.y,E.z)),b=new n.Cartesian3(-h.x+(i.X||0),-h.y+(i.Y||0),i.Z||0),w=n.Matrix4.fromTranslation(b),I=n.Matrix4.multiply(a,w,new n.Matrix4),D=n.Cartesian3.fromDegrees(m.longitude/Math.PI*180,m.latitude/Math.PI*180,i.height),N=n.Transforms.eastNorthUpToFixedFrame(D),S=n.Matrix4.multiply(N,I,new n.Matrix4);n.Matrix4.multiply(A,I,A),e._root.transform=S}catch(h){console.error("Update model position failed:",h)}}}const Ut={NotLoaded:0,Loading:1,Loaded:2,Error:3},vt=4294967295,Je=65535,Qi=255,Gu=8,yo=9,Hu=0,Yu=99,zu=67324752,Co=134695760,Wu=Co,Eo=33639248,ju=101010256,bo=101075792,Ku=117853008,_t=22,Vi=20,Gi=56,$u=12,Xu=20,wo=4,qu=1,Ju=39169,Zu=10,eh=1,th=21589,nh=28789,ih=25461,sh=6534,oh=30837,rh=30805,vo=1,ah=6,Io=8,Bo=2048,lh=16,ch=1,dh=2,uh=4,hh=32,xo=61440,Hi=16384,Yi=73,fh=420,ph=2048,mh=1024,gh=512,Ah="/",zi=30,yh=10,Ch=14,Eh=18,he=void 0,dt="undefined",It="function",bh=64;let So=2;try{typeof navigator!=dt&&navigator.hardwareConcurrency&&(So=navigator.hardwareConcurrency)}catch{}const wh={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:So,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=dt&&CompressionStream,DecompressionStream:typeof DecompressionStream!=dt&&DecompressionStream},To=Object.assign({},wh);function vh(){return To}function Ih(n){return Math.max(n.chunkSize,bh)}function Qn(n){const{baseURI:e,chunkSize:t,maxWorkers:i,terminateWorkerTimeout:s,useCompressionStream:r,useWebWorkers:a,CompressionStream:c,DecompressionStream:l,CompressionStreamZlib:d,DecompressionStreamZlib:h,workerURI:f,wasmURI:p}=n;Qe("baseURI",e),Qe("wasmURI",p),Qe("workerURI",f),Qe("chunkSize",t),Qe("maxWorkers",i),Qe("terminateWorkerTimeout",s),Qe("useCompressionStream",r),Qe("useWebWorkers",a),Qe("CompressionStream",c),Qe("DecompressionStream",l),Qe("CompressionStreamZlib",d),Qe("DecompressionStreamZlib",h)}function Qe(n,e){e!==he&&(To[n]=e)}function Bh(n){let e;n({workerURI:()=>(e||(e="data:text/javascript,"+encodeURIComponent(`(t=>{"function"==typeof define&&define.amd?define(t):t()})(function(){"use strict";const{Array:t,Object:e,Number:n,Math:s,Error:r,Uint8Array:o,Uint16Array:i,Uint32Array:c,Int32Array:a,Map:h,DataView:f,Promise:l,TextEncoder:u,crypto:w,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:g,DecompressionStream:S}=self,b=void 0,v="undefined",k="function",z=[];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)1&e?e=e>>>1^3988292384:e>>>=1;z[t]=e}class C{constructor(t){this.t=t||-1}append(t){let e=0|this.t;for(let n=0,s=0|t.length;s>n;n++)e=e>>>8^z[255&(e^t[n])];this.t=e}get(){return~this.t}}class A extends d{constructor(){let t;const e=new C;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new o(4);new f(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}const x={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],s=x.o(n);return 32===s?t.concat(e):x.i(e,s,0|n,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+x.o(n)},l(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=x.u(e,t[n-1]&2147483648>>e-1,1)),t},u:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,o:t=>s.round(t/1099511627776)||32,i(t,e,n,s){for(void 0===s&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(0===e)return s.concat(t);for(let r=0;r<t.length;r++)s.push(n|t[r]>>>e),n=t[r]<<32-e;const r=t.length?t[t.length-1]:0,o=x.o(r);return s.push(x.u(e+o&31,e+o>32?n:s.pop(),1)),s}},I={bytes:{p(t){const e=x.h(t)/8,n=new o(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},m(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(x.u(8*(3&n),s)),e}}},R=class{constructor(t){const e=this;e.blockSize=512,e.S=[1732584193,4023233417,2562383102,271733878,3285377520],e.v=[1518500249,1859775393,2400959708,3395469782],t?(e.k=t.k.slice(0),e.C=t.C.slice(0),e.A=t.A):e.reset()}reset(){const t=this;return t.k=t.S.slice(0),t.C=[],t.A=0,t}update(t){const e=this;"string"==typeof t&&(t=I.I.m(t));const n=e.C=x.concat(e.C,t),s=e.A,o=e.A=s+x.h(t);if(o>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const i=new c(n);let a=0;for(let t=e.blockSize+s-(e.blockSize+s&e.blockSize-1);o>=t;t+=e.blockSize)e.R(i.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),e}P(){const t=this;let e=t.C;const n=t.k;e=x.concat(e,[x.u(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.A/4294967296)),e.push(0|t.A);e.length;)t.R(e.splice(0,16));return t.reset(),n}U(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}V(t,e){return e<<t|e>>>32-t}R(e){const n=this,r=n.k,o=t(80);for(let t=0;16>t;t++)o[t]=e[t];let i=r[0],c=r[1],a=r[2],h=r[3],f=r[4];for(let t=0;79>=t;t++){16>t||(o[t]=n.V(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.V(5,i)+n.U(t,c,a,h)+f+o[t]+n.v[s.floor(t/20)]|0;f=h,h=a,a=n.V(30,c),c=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+c|0,r[2]=r[2]+a|0,r[3]=r[3]+h|0,r[4]=r[4]+f|0}},P={getRandomValues(t){const e=new c(t.buffer),n=t=>{let e=987654321;const n=4294967295;return()=>(e=36969*(65535&e)+(e>>16)&n,(((e<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,o=0;o<t.length;o+=4){const t=n(4294967296*(r||s.random()));r=987654071*t(),e[o/4]=4294967296*t()|0}return t}},U={importKey:t=>new U.M(I.bytes.m(t)),_(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const o=1+(s>>5)<<2;let i,c,a,h,l;const u=new ArrayBuffer(o),w=new f(u);let p=0;const d=x;for(e=I.bytes.m(e),l=1;(o||1)>p;l++){for(i=c=t.encrypt(d.concat(e,[l])),a=1;n>a;a++)for(c=t.encrypt(c),h=0;h<c.length;h++)i[h]^=c[h];for(a=0;(o||1)>p&&a<i.length;a++)w.setInt32(p,i[a]),p+=4}return u.slice(0,s/8)},M:class{constructor(t){const e=this,n=e.B=R,s=[[],[]];e.D=[new n,new n];const r=e.D[0].blockSize/32;t.length>r&&(t=(new n).update(t).P());for(let e=0;r>e;e++)s[0][e]=909522486^t[e],s[1][e]=1549556828^t[e];e.D[0].update(s[0]),e.D[1].update(s[1]),e.W=new n(e.D[0])}reset(){const t=this;t.W=new t.B(t.D[0]),t.K=!1}update(t){this.K=!0,this.W.update(t)}digest(){const t=this,e=t.W.P(),n=new t.B(t.D[1]).update(e).P();return t.reset(),n}encrypt(t){if(this.K)throw new r("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},V=typeof w!=v&&typeof w.getRandomValues==k,M="Invalid password",_="Invalid signature",B="zipjs-abort-check-password";function D(t){return V?w.getRandomValues(t):P.getRandomValues(t)}const W=16,K={name:"PBKDF2"},E=e.assign({hash:{name:"HMAC"}},K),L=e.assign({iterations:1e3,hash:{name:"SHA-1"}},K),O=["deriveBits"],T=[8,12,16],j=[16,24,32],H=10,Z=[0,0,0,0],F=typeof w!=v,N=F&&w.subtle,q=F&&typeof N!=v,G=I.bytes,J=class{constructor(t){const e=this;e.L=[[[],[],[],[],[]],[[],[],[],[],[]]],e.L[0][0][0]||e.O();const n=e.L[0][4],s=e.L[1],o=t.length;let i,c,a,h=1;if(4!==o&&6!==o&&8!==o)throw new r("invalid aes key size");for(e.v=[c=t.slice(0),a=[]],i=o;4*o+28>i;i++){let t=c[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^h<<24,h=h<<1^283*(h>>7))),c[i]=c[i-o]^t}for(let t=0;i;t++,i--){const e=c[3&t?i:i-4];a[t]=4>=i||4>t?e:s[0][n[e>>>24]]^s[1][n[e>>16&255]]^s[2][n[e>>8&255]]^s[3][n[255&e]]}}encrypt(t){return this.T(t,0)}decrypt(t){return this.T(t,1)}O(){const t=this.L[0],e=this.L[1],n=t[4],s=e[4],r=[],o=[];let i,c,a,h;for(let t=0;256>t;t++)o[(r[t]=t<<1^283*(t>>7))^t]=t;for(let f=i=0;!n[f];f^=c||1,i=o[i]||1){let o=i^i<<1^i<<2^i<<3^i<<4;o=o>>8^255&o^99,n[f]=o,s[o]=f,h=r[a=r[c=r[f]]];let l=16843009*h^65537*a^257*c^16843008*f,u=257*r[o]^16843008*o;for(let n=0;4>n;n++)t[n][f]=u=u<<24^u>>>8,e[n][o]=l=l<<24^l>>>8}for(let n=0;5>n;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}T(t,e){if(4!==t.length)throw new r("invalid aes block size");const n=this.v[e],s=n.length/4-2,o=[0,0,0,0],i=this.L[e],c=i[0],a=i[1],h=i[2],f=i[3],l=i[4];let u,w,p,d=t[0]^n[0],y=t[e?3:1]^n[1],m=t[2]^n[2],g=t[e?1:3]^n[3],S=4;for(let t=0;s>t;t++)u=c[d>>>24]^a[y>>16&255]^h[m>>8&255]^f[255&g]^n[S],w=c[y>>>24]^a[m>>16&255]^h[g>>8&255]^f[255&d]^n[S+1],p=c[m>>>24]^a[g>>16&255]^h[d>>8&255]^f[255&y]^n[S+2],g=c[g>>>24]^a[d>>16&255]^h[y>>8&255]^f[255&m]^n[S+3],S+=4,d=u,y=w,m=p;for(let t=0;4>t;t++)o[e?3&-t:t]=l[d>>>24]<<24^l[y>>16&255]<<16^l[m>>8&255]<<8^l[255&g]^n[S++],u=d,d=y,y=m,m=g,g=u;return o}},Q=class{constructor(t,e){this.j=t,this.H=e,this.Z=e}reset(){this.Z=this.H}update(t){return this.F(this.j,t,this.Z)}N(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,s=255&t;255===e?(e=0,255===n?(n=0,255===s?s=0:++s):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=s}return t}q(t){0===(t[0]=this.N(t[0]))&&(t[1]=this.N(t[1]))}F(t,e,n){let s;if(!(s=e.length))return[];const r=x.h(e);for(let r=0;s>r;r+=4){this.q(n);const s=t.encrypt(n);e[r]^=s[0],e[r+1]^=s[1],e[r+2]^=s[2],e[r+3]^=s[3]}return x.l(e,r)}},X=U.M;let Y=F&&q&&typeof N.importKey==k,$=F&&q&&typeof N.deriveBits==k;class tt extends d{constructor({password:t,rawPassword:n,signed:s,encryptionStrength:i,checkPasswordOnly:c}){super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),signed:s,J:i-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:i,G:a,ready:h}=n;s?(await(async(t,e,n,s)=>{const o=await st(t,e,n,it(s,0,T[e])),i=it(s,T[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new r(M)})(n,i,s,it(t,0,T[i]+2)),t=it(t,T[i]+2),c?e.error(new r(B)):a()):await h;const f=new o(t.length-H-(t.length-H)%W);e.enqueue(nt(n,t,f,0,H,!0))},async flush(t){const{signed:e,X:n,Y:s,pending:i,ready:c}=this;if(s&&n){await c;const a=it(i,0,i.length-H),h=it(i,i.length-H);let f=new o;if(a.length){const t=at(G,a);s.update(t);const e=n.update(t);f=ct(G,e)}if(e){const t=it(ct(G,s.digest()),0,H);for(let e=0;H>e;e++)if(t[e]!=h[e])throw new r(_)}t.enqueue(f)}}})}}class et extends d{constructor({password:t,rawPassword:n,encryptionStrength:s}){let r;super({start(){e.assign(this,{ready:new l(t=>this.G=t),password:rt(t,n),J:s-1,pending:new o})},async transform(t,e){const n=this,{password:s,J:r,G:i,ready:c}=n;let a=new o;s?(a=await(async(t,e,n)=>{const s=D(new o(T[e]));return ot(s,await st(t,e,n,s))})(n,r,s),i()):await c;const h=new o(a.length+t.length-t.length%W);h.set(a,0),e.enqueue(nt(n,t,h,a.length,0))},async flush(t){const{X:e,Y:n,pending:s,ready:i}=this;if(n&&e){await i;let c=new o;if(s.length){const t=e.update(at(G,s));n.update(t),c=ct(G,t)}r.signature=ct(G,n.digest()).slice(0,H),t.enqueue(ot(c,r.signature))}}}),r=this}}function nt(t,e,n,s,r,i){const{X:c,Y:a,pending:h}=t,f=e.length-r;let l;for(h.length&&(e=ot(h,e),n=((t,e)=>{if(e&&e>t.length){const n=t;(t=new o(e)).set(n,0)}return t})(n,f-f%W)),l=0;f-W>=l;l+=W){const t=at(G,it(e,l,l+W));i&&a.update(t);const r=c.update(t);i||a.update(r),n.set(ct(G,r),l+s)}return t.pending=it(e,l),n}async function st(n,s,r,i){n.password=null;const c=await(async(t,e,n,s,r)=>{if(!Y)return U.importKey(e);try{return await N.importKey("raw",e,n,!1,r)}catch{return Y=!1,U.importKey(e)}})(0,r,E,0,O),a=await(async(t,e,n)=>{if(!$)return U._(e,t.salt,L.iterations,n);try{return await N.deriveBits(t,e,n)}catch{return $=!1,U._(e,t.salt,L.iterations,n)}})(e.assign({salt:i},L),c,8*(2*j[s]+2)),h=new o(a),f=at(G,it(h,0,j[s])),l=at(G,it(h,j[s],2*j[s])),u=it(h,2*j[s]);return e.assign(n,{keys:{key:f,$:l,passwordVerification:u},X:new Q(new J(f),t.from(Z)),Y:new X(l)}),u}function rt(t,e){return e===b?(t=>{if(typeof u==v){const e=new o((t=unescape(encodeURIComponent(t))).length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new u).encode(t)})(t):e}function ot(t,e){let n=t;return t.length+e.length&&(n=new o(t.length+e.length),n.set(t,0),n.set(e,t.length)),n}function it(t,e,n){return t.subarray(e,n)}function ct(t,e){return t.p(e)}function at(t,e){return t.m(e)}class ht extends d{constructor({password:t,passwordVerification:n,checkPasswordOnly:s}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;if(n.password){const e=lt(n,t.subarray(0,12));if(n.password=null,e.at(-1)!=n.passwordVerification)throw new r(M);t=t.subarray(12)}s?e.error(new r(B)):e.enqueue(lt(n,t))}})}}class ft extends d{constructor({password:t,passwordVerification:n}){super({start(){e.assign(this,{password:t,passwordVerification:n}),wt(this,t)},transform(t,e){const n=this;let s,r;if(n.password){n.password=null;const e=D(new o(12));e[11]=n.passwordVerification,s=new o(t.length+e.length),s.set(ut(n,e),0),r=12}else s=new o(t.length),r=0;s.set(ut(n,t),r),e.enqueue(s)}})}}function lt(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,n[s]);return n}function ut(t,e){const n=new o(e.length);for(let s=0;s<e.length;s++)n[s]=dt(t)^e[s],pt(t,e[s]);return n}function wt(t,n){const s=[305419896,591751049,878082192];e.assign(t,{keys:s,tt:new C(s[0]),et:new C(s[2])});for(let e=0;e<n.length;e++)pt(t,n.charCodeAt(e))}function pt(t,e){let[n,r,o]=t.keys;t.tt.append([e]),n=~t.tt.get(),r=mt(s.imul(mt(r+yt(n)),134775813)+1),t.et.append([r>>>24]),o=~t.et.get(),t.keys=[n,r,o]}function dt(t){const e=2|t.keys[2];return yt(s.imul(e,1^e)>>>8)}function yt(t){return 255&t}function mt(t){return 4294967295&t}class gt extends d{constructor(t,{chunkSize:e,nt:n,CompressionStream:s}){super({});const{compressed:r,encrypted:o,useCompressionStream:i,zipCrypto:c,signed:a,level:h}=t,l=this;let u,w,p=super.readable;o&&!c||!a||(u=new A,p=kt(p,u)),r&&(p=vt(p,i,{level:h,chunkSize:e},s,n,s)),o&&(c?p=kt(p,new ft(t)):(w=new et(t),p=kt(p,w))),bt(l,p,()=>{let t;o&&!c&&(t=w.signature),o&&!c||!a||(t=new f(u.value.buffer).getUint32(0)),l.signature=t})}}class St extends d{constructor(t,{chunkSize:e,st:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:i,signed:c,signature:a,compressed:h,useCompressionStream:l,rt:u}=t;let w,p,d=super.readable;i&&(o?d=kt(d,new ht(t)):(p=new tt(t),d=kt(d,p))),h&&(d=vt(d,l,{chunkSize:e,rt:u},s,n,s)),i&&!o||!c||(w=new A,d=kt(d,w)),bt(this,d,()=>{if((!i||o)&&c){const t=new f(w.value.buffer);if(a!=t.getUint32(0,!1))throw new r(_)}})}}function bt(t,n,s){n=kt(n,new d({flush:s})),e.defineProperty(t,"readable",{get:()=>n})}function vt(t,e,n,s,r,o){const i=e&&s?s:r||o,c=n.rt?"deflate64-raw":"deflate-raw";try{t=kt(t,new i(c,n))}catch(s){if(!e)throw s;if(r)t=kt(t,new r(c,n));else{if(!o)throw s;t=kt(t,new o(c,n))}}return t}function kt(t,e){return t.pipeThrough(e)}const zt="data",Ct="close";class At extends d{constructor(t,n){super({});const s=this,{codecType:o}=t;let i;o.startsWith("deflate")?i=gt:o.startsWith("inflate")&&(i=St),s.outputSize=0;let c=0;const a=new i(t,n),h=super.readable,f=new d({transform(t,e){t&&t.length&&(c+=t.length,e.enqueue(t))},flush(){e.assign(s,{inputSize:c})}}),l=new d({transform(e,n){if(e&&e.length&&(n.enqueue(e),s.outputSize+=e.length,t.outputSize!==b&&s.outputSize>t.outputSize))throw new r("Invalid uncompressed size")},flush(){const{signature:t}=a;e.assign(s,{signature:t,inputSize:c})}});e.defineProperty(s,"readable",{get:()=>h.pipeThrough(f).pipeThrough(a).pipeThrough(l)})}}class xt extends d{constructor(t){let e;super({transform:function n(s,r){if(e){const t=new o(e.length+s.length);t.set(e),t.set(s,e.length),s=t,e=null}s.length>t?(r.enqueue(s.slice(0,t)),n(s.slice(t),r)):e=s},flush(t){e&&e.length&&t.enqueue(e)}})}}const It=new h,Rt=new h;let Pt,Ut,Vt,Mt,_t,Bt=0;async function Dt(t){try{const{options:e,config:s}=t;if(!e.useCompressionStream)try{await self.initModule(t.config)}catch{e.useCompressionStream=!0}s.CompressionStream=self.CompressionStream,s.DecompressionStream=self.DecompressionStream;const r={highWaterMark:1},o=t.readable||new y({async pull(t){const e=new l(t=>It.set(Bt,t));Wt({type:"pull",messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await e;t.enqueue(s),r&&t.close()}},r),i=t.writable||new m({async write(t){let e;const s=new l(t=>e=t);Rt.set(Bt,e),Wt({type:zt,value:t,messageId:Bt}),Bt=(Bt+1)%n.MAX_SAFE_INTEGER,await s}},r),c=new At(e,s);Pt=new AbortController;const{signal:a}=Pt;await o.pipeThrough(c).pipeThrough(new xt(s.chunkSize)).pipeTo(i,{signal:a,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:h,inputSize:f,outputSize:u}=c;Wt({type:Ct,result:{signature:h,inputSize:f,outputSize:u}})}catch(t){t.outputSize=0,Kt(t)}}function Wt(t){let{value:e}=t;if(e)if(e.length)try{e=new o(e),t.value=e.buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t)}function Kt(t=new r("Unknown error")){const{message:e,stack:n,code:s,name:o,outputSize:i}=t;p({error:{message:e,stack:n,code:s,name:o,outputSize:i}})}function Et(t,e,n={}){const i="number"==typeof n.level?n.level:-1,c="number"==typeof n.ot?n.ot:65536,a="number"==typeof n.it?n.it:65536;return new d({start(){let n;if(this.ct=Vt(c),this.in=Vt(a),this.it=a,this.ht=new o(c),t?(this.ft=Ut.deflate_process,this.lt=Ut.deflate_last_consumed,this.ut=Ut.deflate_end,this.wt=Ut.deflate_new(),n="gzip"===e?Ut.deflate_init_gzip(this.wt,i):"deflate-raw"===e?Ut.deflate_init_raw(this.wt,i):Ut.deflate_init(this.wt,i)):"deflate64-raw"===e?(this.ft=Ut.inflate9_process,this.lt=Ut.inflate9_last_consumed,this.ut=Ut.inflate9_end,this.wt=Ut.inflate9_new(),n=Ut.inflate9_init_raw(this.wt)):(this.ft=Ut.inflate_process,this.lt=Ut.inflate_last_consumed,this.ut=Ut.inflate_end,this.wt=Ut.inflate_new(),n="deflate-raw"===e?Ut.inflate_init_raw(this.wt):"gzip"===e?Ut.inflate_init_gzip(this.wt):Ut.inflate_init(this.wt)),0!==n)throw new r("init failed:"+n)},transform(e,n){try{const i=e,a=new o(_t.buffer),h=this.ft,f=this.lt,l=this.ct,u=this.ht;let w=0;for(;w<i.length;){const e=s.min(i.length-w,32768);this.in&&this.it>=e||(this.in&&Mt&&Mt(this.in),this.in=Vt(e),this.it=e),a.set(i.subarray(w,w+e),this.in);const o=h(this.wt,this.in,e,l,c,0),p=16777215&o;if(p&&(u.set(a.subarray(l,l+p),0),n.enqueue(u.slice(0,p))),!t){const t=o>>24&255,e=128&t?t-256:t;if(0>e)throw new r("process error:"+e)}const d=f(this.wt);if(0===d)break;w+=d}}catch(t){this.ut&&this.wt&&this.ut(this.wt),this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct),n.error(t)}},flush(e){try{const n=new o(_t.buffer),s=this.ft,i=this.ct,a=this.ht;for(;;){const o=s(this.wt,0,0,i,c,4),h=16777215&o,f=o>>24&255;if(!t){const t=128&f?f-256:f;if(0>t)throw new r("process error:"+t)}if(h&&(a.set(n.subarray(i,i+h),0),e.enqueue(a.slice(0,h))),1===f||0===h)break}}catch(t){e.error(t)}finally{if(this.ut&&this.wt){const t=this.ut(this.wt);0!==t&&e.error(new r("end error:"+t))}this.in&&Mt&&Mt(this.in),this.ct&&Mt&&Mt(this.ct)}}})}addEventListener("message",({data:t})=>{const{type:e,messageId:n,value:s,done:r}=t;try{if("start"==e&&Dt(t),e==zt){const t=It.get(n);It.delete(n),t({value:new o(s),done:r})}if("ack"==e){const t=Rt.get(n);Rt.delete(n),t()}e==Ct&&Pt.abort()}catch(t){Kt(t)}});class Lt{constructor(t="deflate",e){return Et(!0,t,e)}}class Ot{constructor(t="deflate",e){return Et(!1,t,e)}}let Tt=!1;self.initModule=async t=>{try{const e=await(async(t,{baseURI:e})=>{if(!Tt){let n,s;try{try{s=new URL(t,e)}catch{}const r=await fetch(s);n=await r.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;n=(t=>{const e=t.split(",")[1],n=atob(e),s=n.length,r=new o(s);for(let t=0;s>t;++t)r[t]=n.charCodeAt(t);return r.buffer})(t)}(t=>{if(Ut=t,({malloc:Vt,free:Mt,memory:_t}=Ut),"function"!=typeof Vt||"function"!=typeof Mt||!_t)throw Ut=Vt=Mt=_t=null,new r("Invalid WASM module")})((await WebAssembly.instantiate(n)).instance.exports),Tt=!0}})(t.wasmURI,t);return t.nt=Lt,t.st=Ot,e}catch{}}});
13
- `)),e)})}const Mo=[];for(let n=0;n<256;n++){let e=n;for(let t=0;t<8;t++)e&1?e=e>>>1^3988292384:e=e>>>1;Mo[n]=e}class Vn{constructor(e){this.crc=e||-1}append(e){let t=this.crc|0;for(let i=0,s=e.length|0;i<s;i++)t=t>>>8^Mo[(t^e[i])&255];this.crc=t}get(){return~this.crc}}class Do extends TransformStream{constructor(){let e;const t=new Vn;super({transform(i,s){t.append(i),s.enqueue(i)},flush(){const i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,t.get()),e.value=i}}),e=this}}function xh(n){if(typeof TextEncoder==dt){n=unescape(encodeURIComponent(n));const e=new Uint8Array(n.length);for(let t=0;t<e.length;t++)e[t]=n.charCodeAt(t);return e}else return new TextEncoder().encode(n)}const Fe={concat(n,e){if(n.length===0||e.length===0)return n.concat(e);const t=n[n.length-1],i=Fe.getPartial(t);return i===32?n.concat(e):Fe._shiftRight(e,i,t|0,n.slice(0,n.length-1))},bitLength(n){const e=n.length;if(e===0)return 0;const t=n[e-1];return(e-1)*32+Fe.getPartial(t)},clamp(n,e){if(n.length*32<e)return n;n=n.slice(0,Math.ceil(e/32));const t=n.length;return e=e&31,t>0&&e&&(n[t-1]=Fe.partial(e,n[t-1]&2147483648>>e-1,1)),n},partial(n,e,t){return n===32?e:(t?e|0:e<<32-n)+n*1099511627776},getPartial(n){return Math.round(n/1099511627776)||32},_shiftRight(n,e,t,i){for(i===void 0&&(i=[]);e>=32;e-=32)i.push(t),t=0;if(e===0)return i.concat(n);for(let a=0;a<n.length;a++)i.push(t|n[a]>>>e),t=n[a]<<32-e;const s=n.length?n[n.length-1]:0,r=Fe.getPartial(s);return i.push(Fe.partial(e+r&31,e+r>32?t:i.pop(),1)),i}},Gn={bytes:{fromBits(n){const t=Fe.bitLength(n)/8,i=new Uint8Array(t);let s;for(let r=0;r<t;r++)(r&3)===0&&(s=n[r/4]),i[r]=s>>>24,s<<=8;return i},toBits(n){const e=[];let t,i=0;for(t=0;t<n.length;t++)i=i<<8|n[t],(t&3)===3&&(e.push(i),i=0);return t&3&&e.push(Fe.partial(8*(t&3),i)),e}}},ko={};ko.sha1=class{constructor(n){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],n?(e._h=n._h.slice(0),e._buffer=n._buffer.slice(0),e._length=n._length):e.reset()}reset(){const n=this;return n._h=n._init.slice(0),n._buffer=[],n._length=0,n}update(n){const e=this;typeof n=="string"&&(n=Gn.utf8String.toBits(n));const t=e._buffer=Fe.concat(e._buffer,n),i=e._length,s=e._length=i+Fe.bitLength(n);if(s>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const r=new Uint32Array(t);let a=0;for(let c=e.blockSize+i-(e.blockSize+i&e.blockSize-1);c<=s;c+=e.blockSize)e._block(r.subarray(16*a,16*(a+1))),a+=1;return t.splice(0,16*a),e}finalize(){const n=this;let e=n._buffer;const t=n._h;e=Fe.concat(e,[Fe.partial(1,1)]);for(let i=e.length+2;i&15;i++)e.push(0);for(e.push(Math.floor(n._length/4294967296)),e.push(n._length|0);e.length;)n._block(e.splice(0,16));return n.reset(),t}_f(n,e,t,i){if(n<=19)return e&t|~e&i;if(n<=39)return e^t^i;if(n<=59)return e&t|e&i|t&i;if(n<=79)return e^t^i}_S(n,e){return e<<n|e>>>32-n}_block(n){const e=this,t=e._h,i=Array(80);for(let d=0;d<16;d++)i[d]=n[d];let s=t[0],r=t[1],a=t[2],c=t[3],l=t[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=e._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));const h=e._S(5,s)+e._f(d,r,a,c)+l+i[d]+e._key[Math.floor(d/20)]|0;l=c,c=a,a=e._S(30,r),r=s,s=h}t[0]=t[0]+s|0,t[1]=t[1]+r|0,t[2]=t[2]+a|0,t[3]=t[3]+c|0,t[4]=t[4]+l|0}};const Po={};Po.aes=class{constructor(n){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const t=e._tables[0][4],i=e._tables[1],s=n.length;let r,a,c,l=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[a=n.slice(0),c=[]],r=s;r<4*s+28;r++){let d=a[r-1];(r%s===0||s===8&&r%s===4)&&(d=t[d>>>24]<<24^t[d>>16&255]<<16^t[d>>8&255]<<8^t[d&255],r%s===0&&(d=d<<8^d>>>24^l<<24,l=l<<1^(l>>7)*283)),a[r]=a[r-s]^d}for(let d=0;r;d++,r--){const h=a[d&3?r:r-4];r<=4||d<4?c[d]=h:c[d]=i[0][t[h>>>24]]^i[1][t[h>>16&255]]^i[2][t[h>>8&255]]^i[3][t[h&255]]}}encrypt(n){return this._crypt(n,0)}decrypt(n){return this._crypt(n,1)}_precompute(){const n=this._tables[0],e=this._tables[1],t=n[4],i=e[4],s=[],r=[];let a,c,l,d;for(let h=0;h<256;h++)r[(s[h]=h<<1^(h>>7)*283)^h]=h;for(let h=a=0;!t[h];h^=c||1,a=r[a]||1){let f=a^a<<1^a<<2^a<<3^a<<4;f=f>>8^f&255^99,t[h]=f,i[f]=h,d=s[l=s[c=s[h]]];let p=d*16843009^l*65537^c*257^h*16843008,u=s[f]*257^f*16843008;for(let m=0;m<4;m++)n[m][h]=u=u<<24^u>>>8,e[m][f]=p=p<<24^p>>>8}for(let h=0;h<5;h++)n[h]=n[h].slice(0),e[h]=e[h].slice(0)}_crypt(n,e){if(n.length!==4)throw new Error("invalid aes block size");const t=this._key[e],i=t.length/4-2,s=[0,0,0,0],r=this._tables[e],a=r[0],c=r[1],l=r[2],d=r[3],h=r[4];let f=n[0]^t[0],p=n[e?3:1]^t[1],u=n[2]^t[2],m=n[e?1:3]^t[3],E=4,A,b,w;for(let I=0;I<i;I++)A=a[f>>>24]^c[p>>16&255]^l[u>>8&255]^d[m&255]^t[E],b=a[p>>>24]^c[u>>16&255]^l[m>>8&255]^d[f&255]^t[E+1],w=a[u>>>24]^c[m>>16&255]^l[f>>8&255]^d[p&255]^t[E+2],m=a[m>>>24]^c[f>>16&255]^l[p>>8&255]^d[u&255]^t[E+3],E+=4,f=A,p=b,u=w;for(let I=0;I<4;I++)s[e?3&-I:I]=h[f>>>24]<<24^h[p>>16&255]<<16^h[u>>8&255]<<8^h[m&255]^t[E++],A=f,f=p,p=u,u=m,m=A;return s}};const Sh={getRandomValues(n){const e=new Uint32Array(n.buffer),t=i=>{let s=987654321;const r=4294967295;return function(){return s=36969*(s&65535)+(s>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((s<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,s;i<n.length;i+=4){const r=t((s||Math.random())*4294967296);s=r()*987654071,e[i/4]=r()*4294967296|0}return n}},No={};No.ctrGladman=class{constructor(n,e){this._prf=n,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(n){return this.calculate(this._prf,n,this._iv)}incWord(n){if((n>>24&255)===255){let e=n>>16&255,t=n>>8&255,i=n&255;e===255?(e=0,t===255?(t=0,i===255?i=0:++i):++t):++e,n=0,n+=e<<16,n+=t<<8,n+=i}else n+=1<<24;return n}incCounter(n){(n[0]=this.incWord(n[0]))===0&&(n[1]=this.incWord(n[1]))}calculate(n,e,t){let i;if(!(i=e.length))return[];const s=Fe.bitLength(e);for(let r=0;r<i;r+=4){this.incCounter(t);const a=n.encrypt(t);e[r]^=a[0],e[r+1]^=a[1],e[r+2]^=a[2],e[r+3]^=a[3]}return Fe.clamp(e,s)}};const Bt={importKey(n){return new Bt.hmacSha1(Gn.bytes.toBits(n))},pbkdf2(n,e,t,i){if(t=t||1e4,i<0||t<0)throw new Error("invalid params to pbkdf2");const s=(i>>5)+1<<2;let r,a,c,l,d;const h=new ArrayBuffer(s),f=new DataView(h);let p=0;const u=Fe;for(e=Gn.bytes.toBits(e),d=1;p<(s||1);d++){for(r=a=n.encrypt(u.concat(e,[d])),c=1;c<t;c++)for(a=n.encrypt(a),l=0;l<a.length;l++)r[l]^=a[l];for(c=0;p<(s||1)&&c<r.length;c++)f.setInt32(p,r[c]),p+=4}return h.slice(0,i/8)}};Bt.hmacSha1=class{constructor(n){const e=this,t=e._hash=ko.sha1,i=[[],[]];e._baseHash=[new t,new t];const s=e._baseHash[0].blockSize/32;n.length>s&&(n=new t().update(n).finalize());for(let r=0;r<s;r++)i[0][r]=n[r]^909522486,i[1][r]=n[r]^1549556828;e._baseHash[0].update(i[0]),e._baseHash[1].update(i[1]),e._resultHash=new t(e._baseHash[0])}reset(){const n=this;n._resultHash=new n._hash(n._baseHash[0]),n._updated=!1}update(n){const e=this;e._updated=!0,e._resultHash.update(n)}digest(){const n=this,e=n._resultHash.finalize(),t=new n._hash(n._baseHash[1]).update(e).finalize();return n.reset(),t}encrypt(n){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(n),this.digest(n)}};const Th=typeof crypto!=dt&&typeof crypto.getRandomValues==It,Fo="Invalid password",Ro="Invalid signature",Wi="zipjs-abort-check-password";function Lo(n){return Th?crypto.getRandomValues(n):Sh.getRandomValues(n)}const Qt=16,Mh="raw",Oo={name:"PBKDF2"},Dh={name:"HMAC"},kh="SHA-1",Ph=Object.assign({hash:Dh},Oo),ji=Object.assign({iterations:1e3,hash:{name:kh}},Oo),Nh=["deriveBits"],nn=[8,12,16],sn=[16,24,32],ut=10,Fh=[0,0,0,0],Hn=typeof crypto!=dt,on=Hn&&crypto.subtle,Uo=Hn&&typeof on!=dt,Ze=Gn.bytes,Rh=Po.aes,Lh=No.ctrGladman,Oh=Bt.hmacSha1;let _o=Hn&&Uo&&typeof on.importKey==It,Qo=Hn&&Uo&&typeof on.deriveBits==It;class Uh extends TransformStream{constructor({password:e,rawPassword:t,signed:i,encryptionStrength:s,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:Ho(e,t),signed:i,strength:s-1,pending:new Uint8Array})},async transform(a,c){const l=this,{password:d,strength:h,resolveReady:f,ready:p}=l;d?(await Qh(l,h,d,Ve(a,0,nn[h]+2)),a=Ve(a,nn[h]+2),r?c.error(new Error(Wi)):f()):await p;const u=new Uint8Array(a.length-ut-(a.length-ut)%Qt);c.enqueue(Vo(l,a,u,0,ut,!0))},async flush(a){const{signed:c,ctr:l,hmac:d,pending:h,ready:f}=this;if(d&&l){await f;const p=Ve(h,0,h.length-ut),u=Ve(h,h.length-ut);let m=new Uint8Array;if(p.length){const E=an(Ze,p);d.update(E);const A=l.update(E);m=rn(Ze,A)}if(c){const E=Ve(rn(Ze,d.digest()),0,ut);for(let A=0;A<ut;A++)if(E[A]!=u[A])throw new Error(Ro)}a.enqueue(m)}}})}}class _h extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:i}){let s;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Ho(e,t),strength:i-1,pending:new Uint8Array})},async transform(r,a){const c=this,{password:l,strength:d,resolveReady:h,ready:f}=c;let p=new Uint8Array;l?(p=await Vh(c,d,l),h()):await f;const u=new Uint8Array(p.length+r.length-r.length%Qt);u.set(p,0),a.enqueue(Vo(c,r,u,p.length,0))},async flush(r){const{ctr:a,hmac:c,pending:l,ready:d}=this;if(c&&a){await d;let h=new Uint8Array;if(l.length){const f=a.update(an(Ze,l));c.update(f),h=rn(Ze,f)}s.signature=rn(Ze,c.digest()).slice(0,ut),r.enqueue(Ki(h,s.signature))}}}),s=this}}function Vo(n,e,t,i,s,r){const{ctr:a,hmac:c,pending:l}=n,d=e.length-s;l.length&&(e=Ki(l,e),t=Yh(t,d-d%Qt));let h;for(h=0;h<=d-Qt;h+=Qt){const f=an(Ze,Ve(e,h,h+Qt));r&&c.update(f);const p=a.update(f);r||c.update(p),t.set(rn(Ze,p),h+i)}return n.pending=Ve(e,h),t}async function Qh(n,e,t,i){const s=await Go(n,e,t,Ve(i,0,nn[e])),r=Ve(i,nn[e]);if(s[0]!=r[0]||s[1]!=r[1])throw new Error(Fo)}async function Vh(n,e,t){const i=Lo(new Uint8Array(nn[e])),s=await Go(n,e,t,i);return Ki(i,s)}async function Go(n,e,t,i){n.password=null;const s=await Gh(Mh,t,Ph,!1,Nh),r=await Hh(Object.assign({salt:i},ji),s,8*(sn[e]*2+2)),a=new Uint8Array(r),c=an(Ze,Ve(a,0,sn[e])),l=an(Ze,Ve(a,sn[e],sn[e]*2)),d=Ve(a,sn[e]*2);return Object.assign(n,{keys:{key:c,authentication:l,passwordVerification:d},ctr:new Lh(new Rh(c),Array.from(Fh)),hmac:new Oh(l)}),d}async function Gh(n,e,t,i,s){if(_o)try{return await on.importKey(n,e,t,i,s)}catch{return _o=!1,Bt.importKey(e)}else return Bt.importKey(e)}async function Hh(n,e,t){if(Qo)try{return await on.deriveBits(n,e,t)}catch{return Qo=!1,Bt.pbkdf2(e,n.salt,ji.iterations,t)}else return Bt.pbkdf2(e,n.salt,ji.iterations,t)}function Ho(n,e){return e===he?xh(n):e}function Ki(n,e){let t=n;return n.length+e.length&&(t=new Uint8Array(n.length+e.length),t.set(n,0),t.set(e,n.length)),t}function Yh(n,e){if(e&&e>n.length){const t=n;n=new Uint8Array(e),n.set(t,0)}return n}function Ve(n,e,t){return n.subarray(e,t)}function rn(n,e){return n.fromBits(e)}function an(n,e){return n.toBits(e)}const ln=12;class zh extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Wo(this,e)},transform(s,r){const a=this;if(a.password){const c=Yo(a,s.subarray(0,ln));if(a.password=null,c.at(-1)!=a.passwordVerification)throw new Error(Fo);s=s.subarray(ln)}i?r.error(new Error(Wi)):r.enqueue(Yo(a,s))}})}}class Wh extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Wo(this,e)},transform(i,s){const r=this;let a,c;if(r.password){r.password=null;const l=Lo(new Uint8Array(ln));l[ln-1]=r.passwordVerification,a=new Uint8Array(i.length+l.length),a.set(zo(r,l),0),c=ln}else a=new Uint8Array(i.length),c=0;a.set(zo(r,i),c),s.enqueue(a)}})}}function Yo(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=jo(n)^e[i],$i(n,t[i]);return t}function zo(n,e){const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=jo(n)^e[i],$i(n,e[i]);return t}function Wo(n,e){const t=[305419896,591751049,878082192];Object.assign(n,{keys:t,crcKey0:new Vn(t[0]),crcKey2:new Vn(t[2])});for(let i=0;i<e.length;i++)$i(n,e.charCodeAt(i))}function $i(n,e){let[t,i,s]=n.keys;n.crcKey0.append([e]),t=~n.crcKey0.get(),i=$o(Math.imul($o(i+Ko(t)),134775813)+1),n.crcKey2.append([i>>>24]),s=~n.crcKey2.get(),n.keys=[t,i,s]}function jo(n){const e=n.keys[2]|2;return Ko(Math.imul(e,e^1)>>>8)}function Ko(n){return n&255}function $o(n){return n&4294967295}const Xo="Invalid uncompressed size",jh="deflate-raw",Kh="deflate64-raw";class $h extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:i,CompressionStream:s}){super({});const{compressed:r,encrypted:a,useCompressionStream:c,zipCrypto:l,signed:d,level:h}=e,f=this;let p,u,m=super.readable;(!a||l)&&d&&(p=new Do,m=et(m,p)),r&&(m=Jo(m,c,{level:h,chunkSize:t},s,i,s)),a&&(l?m=et(m,new Wh(e)):(u=new _h(e),m=et(m,u))),qo(f,m,()=>{let E;a&&!l&&(E=u.signature),(!a||l)&&d&&(E=new DataView(p.value.buffer).getUint32(0)),f.signature=E})}}class Xh extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:i,DecompressionStream:s}){super({});const{zipCrypto:r,encrypted:a,signed:c,signature:l,compressed:d,useCompressionStream:h,deflate64:f}=e;let p,u,m=super.readable;a&&(r?m=et(m,new zh(e)):(u=new Uh(e),m=et(m,u))),d&&(m=Jo(m,h,{chunkSize:t,deflate64:f},s,i,s)),(!a||r)&&c&&(p=new Do,m=et(m,p)),qo(this,m,()=>{if((!a||r)&&c){const E=new DataView(p.value.buffer);if(l!=E.getUint32(0,!1))throw new Error(Ro)}})}}function qo(n,e,t){e=et(e,new TransformStream({flush:t})),Object.defineProperty(n,"readable",{get(){return e}})}function Jo(n,e,t,i,s,r){const a=e&&i?i:s||r,c=t.deflate64?Kh:jh;try{n=et(n,new a(c,t))}catch(l){if(e)if(s)n=et(n,new s(c,t));else if(r)n=et(n,new r(c,t));else throw l;else throw l}return n}function et(n,e){return n.pipeThrough(e)}const qh="message",Jh="start",Zh="pull",Zo="data",ef="ack",er="close",tf="deflate",tr="inflate";class nf extends TransformStream{constructor(e,t){super({});const i=this,{codecType:s}=e;let r;s.startsWith(tf)?r=$h:s.startsWith(tr)&&(r=Xh),i.outputSize=0;let a=0;const c=new r(e,t),l=super.readable,d=new TransformStream({transform(f,p){f&&f.length&&(a+=f.length,p.enqueue(f))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(f,p){if(f&&f.length&&(p.enqueue(f),i.outputSize+=f.length,e.outputSize!==he&&i.outputSize>e.outputSize))throw new Error(Xo)},flush(){const{signature:f}=c;Object.assign(i,{signature:f,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return l.pipeThrough(d).pipeThrough(c).pipeThrough(h)}})}}class sf extends TransformStream{constructor(e){let t;super({transform:i,flush(s){t&&t.length&&s.enqueue(t)}});function i(s,r){if(t){const a=new Uint8Array(t.length+s.length);a.set(t),a.set(s,t.length),s=a,t=null}s.length>e?(r.enqueue(s.slice(0,e)),i(s.slice(e),r)):t=s}}}let nr=typeof Worker!=dt,ir=()=>{};function of({initModule:n}){ir=n}class Xi{constructor(e,{readable:t,writable:i},{options:s,config:r,streamOptions:a,useWebWorkers:c,transferStreams:l,workerURI:d},h){const{signal:f}=a;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new sf(r.chunkSize)).pipeThrough(new rf(a),{signal:f}),writable:i,options:Object.assign({},s),workerURI:d,transferStreams:l,terminate(){return new Promise(p=>{const{worker:u,busy:m}=e;u?(m?e.resolveTerminated=p:(u.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)}}),(c&&nr?af:sr)(e,r)}}class rf extends TransformStream{constructor({onstart:e,onprogress:t,size:i,onend:s}){let r=0;super({async start(){e&&await qi(e,i)},async transform(a,c){r+=a.length,t&&await qi(t,r,i),c.enqueue(a)},async flush(){s&&await qi(s,r)}})}}async function qi(n,...e){try{await n(...e)}catch{}}function sr(n,e){return{run:()=>lf(n,e)}}function af(n,e){const{baseURI:t,chunkSize:i}=e;let{wasmURI:s}=e;if(!n.interface){typeof s==It&&(s=s());let r;try{r=uf(n.workerURI,t,n)}catch{return nr=!1,sr(n,e)}Object.assign(n,{worker:r,interface:{run:()=>cf(n,{chunkSize:i,wasmURI:s,baseURI:t})}})}return n.interface}async function lf({options:n,readable:e,writable:t,onTaskFinished:i},s){let r;try{if(!n.useCompressionStream)try{await ir(s)}catch{n.useCompressionStream=!0}r=new nf(n,s),await e.pipeThrough(r).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:a,inputSize:c,outputSize:l}=r;return{signature:a,inputSize:c,outputSize:l}}catch(a){throw r&&(a.outputSize=r.outputSize),a}finally{i()}}async function cf(n,e){let t,i;const s=new Promise((f,p)=>{t=f,i=p});Object.assign(n,{reader:null,writer:null,resolveResult:t,rejectResult:i,result:s});const{readable:r,options:a}=n,{writable:c,closed:l}=df(n.writable),d=Yn({type:Jh,options:a,config:e,readable:r,writable:c},n);d||Object.assign(n,{reader:r.getReader(),writer:c.getWriter()});const h=await s;return d||await c.getWriter().close(),await l,h}function df(n){let e;const t=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){const r=n.getWriter();await r.ready,await r.write(s),r.releaseLock()},close(){e()},abort(s){return n.getWriter().abort(s)}}),closed:t}}let or=!0;function uf(n,e,t){const i={type:"module"};let s,r;if(typeof n==It&&(n=n()),n.startsWith("data:")||n.startsWith("blob:"))try{r=new Worker(n)}catch{r=new Worker(n,i)}else{try{s=new URL(n,e)}catch{s=n}r=new Worker(s,i)}return r.addEventListener(qh,a=>hf(a,t)),r}function Yn(n,{worker:e,writer:t,onTaskFinished:i,transferStreams:s}){try{const{value:r,readable:a,writable:c}=n,l=[];if(r&&(n.value=r,l.push(n.value.buffer)),s&&or?(a&&l.push(a),c&&l.push(c)):n.readable=n.writable=null,l.length)try{return e.postMessage(n,l),!0}catch{or=!1,n.readable=n.writable=null,e.postMessage(n)}else e.postMessage(n)}catch(r){throw t&&t.releaseLock(),i(),r}}async function hf({data:n},e){const{type:t,value:i,messageId:s,result:r,error:a}=n,{reader:c,writer:l,resolveResult:d,rejectResult:h,onTaskFinished:f}=e;try{if(a){const{message:u,stack:m,code:E,name:A,outputSize:b}=a,w=new Error(u);Object.assign(w,{stack:m,code:E,name:A,outputSize:b}),p(w)}else{if(t==Zh){const{value:u,done:m}=await c.read();Yn({type:Zo,value:u,done:m,messageId:s},e)}t==Zo&&(await l.ready,await l.write(new Uint8Array(i)),Yn({type:ef,messageId:s},e)),t==er&&p(null,r)}}catch(u){Yn({type:er,messageId:s},e),p(u)}function p(u,m){u?h(u):d(m),l&&l.releaseLock(),f()}}let xt=[];const Ji=[];let rr=0;async function ff(n,e){const{options:t,config:i}=e,{transferStreams:s,useWebWorkers:r,useCompressionStream:a,compressed:c,signed:l,encrypted:d}=t,{workerURI:h,maxWorkers:f}=i;e.transferStreams=s||s===he;const p=!c&&!l&&!d&&!e.transferStreams;return e.useWebWorkers=!p&&(r||r===he&&i.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:he,t.useCompressionStream=a||a===he&&i.useCompressionStream,(await u()).run();async function u(){const E=xt.find(A=>!A.busy);if(E)return ar(E),new Xi(E,n,e,m);if(xt.length<f){const A={indexWorker:rr};return rr++,xt.push(A),new Xi(A,n,e,m)}else return new Promise(A=>Ji.push({resolve:A,stream:n,workerOptions:e}))}function m(E){if(Ji.length){const[{resolve:A,stream:b,workerOptions:w}]=Ji.splice(0,1);A(new Xi(E,b,w,m))}else E.worker?(ar(E),pf(E,e)):xt=xt.filter(A=>A!=E)}}function pf(n,e){const{config:t}=e,{terminateWorkerTimeout:i}=t;Number.isFinite(i)&&i>=0&&(n.terminated?n.terminated=!1:n.terminateTimeout=setTimeout(async()=>{xt=xt.filter(s=>s!=n);try{await n.terminate()}catch{}},i))}function ar(n){const{terminateTimeout:e}=n;e&&(clearTimeout(e),n.terminateTimeout=null)}const mf="Writer iterator completed too soon",gf="Content-Type",Af=64*1024,lr="writable";class Zi{constructor(){this.size=0}init(){this.initialized=!0}}class cr extends Zi{get readable(){const e=this,{chunkSize:t=Af}=e,i=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:r=0,size:a,diskNumberStart:c}=i,{chunkOffset:l}=this,d=a===he?t:Math.min(t,a-l),h=await Me(e,r+l,d,c);s.enqueue(h),l+t>a||a===he&&!h.length&&d?s.close():this.chunkOffset+=t}});return i}}class es extends cr{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,t){const i=this,s=e+t;let a=await(e||s<i.size?i.blob.slice(e,s):i.blob).arrayBuffer();return a.byteLength>t&&(a=a.slice(e,s)),new Uint8Array(a)}}class yf extends Zi{constructor(e){super();const t=this,i=new TransformStream,s=[];e&&s.push([gf,e]),Object.defineProperty(t,lr,{get(){return i.writable}}),t.blob=new Response(i.readable,{headers:s}).blob()}getData(){return this.blob}}class Cf extends yf{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:t}=this,i=await super.getData();if(i.text&&t)return i.text();{const s=new FileReader;return new Promise((r,a)=>{Object.assign(s,{onload:({target:c})=>r(c.result),onerror:()=>a(s.error)}),s.readAsText(i,e)})}}}class Ef extends cr{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:t}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(t.map(async(i,s)=>{await i.init(),s!=t.length-1&&(e.lastDiskOffset+=i.size),e.size+=i.size})),super.init()}async readUint8Array(e,t,i=0){const s=this,{readers:r}=this;let a,c=i;c==-1&&(c=r.length-1);let l=e;for(;r[c]&&l>=r[c].size;)l-=r[c].size,c++;const d=r[c];if(d){const h=d.size;if(l+t<=h)a=await Me(d,l,t);else{const f=h-l;a=new Uint8Array(t);const p=await Me(d,l,f);a.set(p,0);const u=await s.readUint8Array(e+f,t-f,i);a.set(u,f),p.length+u.length<t&&(a=a.subarray(0,p.length+u.length))}}else a=new Uint8Array;return s.lastDiskNumber=Math.max(c,s.lastDiskNumber),a}}class dr extends Zi{constructor(e,t=4294967295){super();const i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:t,availableSize:t});let s,r,a;const c=new WritableStream({async write(h){const{availableSize:f}=i;if(a)h.length>=f?(await l(h.subarray(0,f)),await d(),i.diskOffset+=s.size,i.diskNumber++,a=null,await this.write(h.subarray(f))):await l(h);else{const{value:p,done:u}=await e.next();if(u&&!p)throw new Error(mf);s=p,s.size=0,s.maxSize&&(i.maxSize=s.maxSize),i.availableSize=i.maxSize,await zn(s),r=p.writable,a=r.getWriter(),await this.write(h)}},async close(){await a.ready,await d()}});Object.defineProperty(i,lr,{get(){return c}});async function l(h){const f=h.length;f&&(await a.ready,await a.write(h),s.size+=f,i.size+=f,i.availableSize-=f)}async function d(){await a.close()}}}class bf{constructor(e){return Array.isArray(e)&&(e=new Ef(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class wf{constructor(e){return e.writable===he&&typeof e.next==It&&(e=new dr(e)),e instanceof WritableStream&&(e={writable:e}),e.size===he&&(e.size=0),e instanceof dr||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function zn(n,e){if(n.init&&!n.initialized)await n.init(e);else return Promise.resolve()}function Me(n,e,t,i){return n.readUint8Array(e,t,i)}const ur="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),vf=ur.length==256;function If(n){if(vf){let e="";for(let t=0;t<n.length;t++)e+=ur[n[t]];return e}else return new TextDecoder().decode(n)}function Wn(n,e){return e&&e.trim().toLowerCase()=="cp437"?If(n):new TextDecoder(e).decode(n)}const hr="filename",fr="rawFilename",pr="comment",mr="rawComment",gr="uncompressedSize",Ar="compressedSize",yr="offset",Cr="diskNumberStart",ts="lastModDate",ns="rawLastModDate",Er="lastAccessDate",Bf="rawLastAccessDate",br="creationDate",wr="rawCreationDate",xf=[hr,fr,gr,Ar,ts,ns,pr,mr,Er,br,wr,yr,Cr,"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 vr{constructor(e){xf.forEach(t=>this[t]=e[t])}}const Sf="filenameEncoding",Tf="commentEncoding",Mf="decodeText",Df="extractPrependedData",kf="extractAppendedData",Pf="password",Nf="rawPassword",Ff="passThrough",Rf="signal",Lf="checkPasswordOnly",Of="checkOverlappingEntryOnly",Uf="checkOverlappingEntry",_f="checkSignature",Qf="useWebWorkers",Vf="useCompressionStream",Gf="transferStreams",Hf="preventClose",is="File format is not recognized",Yf="End of central directory not found",zf="End of Zip64 central directory locator not found",Wf="Central directory header not found",jf="Local file header not found",Kf="Zip64 extra field not found",$f="File contains encrypted entry",Xf="Encryption method not supported",Ir="Compression method not supported",Br="Split zip file",qf="Overlapping entry found",xr="utf-8",Jf="UTF8",Sr="cp437",Zf=[[gr,vt],[Ar,vt],[yr,vt],[Cr,Je]],ep={[Je]:{getValue:fe,bytes:4},[vt]:{getValue:Vt,bytes:8}};class Tr{constructor(e,t={}){Object.assign(this,{reader:new bf(e),options:t,config:vh(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:i}=t;const{config:s}=t;if(await zn(i),(i.size===he||!i.readUint8Array)&&(i=new es(await new Response(i.readable).blob()),await zn(i)),i.size<_t)throw new Error(is);i.chunkSize=Ih(s);const r=await ap(i,ju,i.size,_t,Je*16);if(!r){const x=await Me(i,0,4),M=pe(x);throw fe(M)==Co?new Error(Br):new Error(Yf)}const a=pe(r);let c=fe(a,12),l=fe(a,16);const d=r.offset,h=Se(a,20),f=d+_t+h;let p=Se(a,4);const u=i.lastDiskNumber||0;let m=Se(a,6),E=Se(a,8),A=0,b=0;if(l==vt||c==vt||E==Je||m==Je){const x=await Me(i,r.offset-Vi,Vi),M=pe(x);if(fe(M,0)==Ku){l=Vt(M,8);let L=await Me(i,l,Gi,-1),V=pe(L);const k=r.offset-Vi-Gi;if(fe(V,0)!=bo&&l!=k){const C=l;l=k,l>C&&(A=l-C),L=await Me(i,l,Gi,-1),V=pe(L)}if(fe(V,0)!=bo)throw new Error(zf);p==Je&&(p=fe(V,16)),m==Je&&(m=fe(V,20)),E==Je&&(E=Vt(V,32)),c==vt&&(c=Vt(V,40)),l-=c}}if(l>=i.size&&(A=i.size-l-c-_t,l=i.size-c-_t),u!=p)throw new Error(Br);if(l<0)throw new Error(is);let w=0,I=await Me(i,l,c,m),D=pe(I);if(c){const x=r.offset-c;if(fe(D,w)!=Eo&&l!=x){const M=l;l=x,l>M&&(A+=l-M),I=await Me(i,l,c,m),D=pe(I)}}const N=r.offset-l-(i.lastDiskOffset||0);if(c!=N&&N>=0&&(c=N,I=await Me(i,l,c,m),D=pe(I)),l<0||l>=i.size)throw new Error(is);const S=De(t,e,Sf),B=De(t,e,Tf);for(let x=0;x<E;x++){const M=new tp(i,s,t.options);if(fe(D,w)!=Eo)throw new Error(Wf);Mr(M,D,w+6);const L=!!M.bitFlag.languageEncodingFlag,V=w+46,k=V+M.filenameLength,C=k+M.extraFieldLength,y=Se(D,w+4),v=y>>8==0,P=y>>8==3,F=I.subarray(V,k),U=Se(D,w+32),O=C+U,T=I.subarray(C,O),_=L,H=L,j=fe(D,w+38),X=j&Qi,Z={readOnly:!!(X&ch),hidden:!!(X&dh),system:!!(X&uh),directory:!!(X&lh),archive:!!(X&hh)},re=fe(D,w+42)+A,se=De(t,e,Mf)||Wn,oe=_?xr:S||Sr,ye=H?xr:B||Sr;let Ie=se(F,oe);Ie===he&&(Ie=Wn(F,oe));let Ee=se(T,ye);Ee===he&&(Ee=Wn(T,ye)),Object.assign(M,{versionMadeBy:y,msDosCompatible:v,compressedSize:0,uncompressedSize:0,commentLength:U,offset:re,diskNumberStart:Se(D,w+34),internalFileAttributes:Se(D,w+36),externalFileAttributes:j,msdosAttributesRaw:X,msdosAttributes:Z,rawFilename:F,filenameUTF8:_,commentUTF8:H,rawExtraField:I.subarray(k,C),rawComment:T,filename:Ie,comment:Ee}),b=Math.max(re,b),Dr(M,M,D,w+6);const xe=M.externalFileAttributes>>16&Je;M.unixMode===he&&(xe&(fh|Yi|Hi))!=0&&(M.unixMode=xe);const Te=!!(M.unixMode&ph),_e=!!(M.unixMode&mh),z=!!(M.unixMode&gh),Y=M.unixMode!==he?(M.unixMode&Yi)!=0:P&&(xe&Yi)!=0,K=M.unixMode!==he&&(M.unixMode&xo)==Hi,Pe=(xe&xo)==Hi;Object.assign(M,{setuid:Te,setgid:_e,sticky:z,unixExternalUpper:xe,internalFileAttribute:M.internalFileAttributes,externalFileAttribute:M.externalFileAttributes,executable:Y,directory:K||Pe||v&&Z.directory||Ie.endsWith(Ah)&&!M.uncompressedSize,zipCrypto:M.encrypted&&!M.extraFieldAES});const Re=new vr(M);Re.getData=(Sn,$e)=>M.getData(Sn,Re,t.readRanges,$e),Re.arrayBuffer=async Sn=>{const $e=new TransformStream,[Tn]=await Promise.all([new Response($e.readable).arrayBuffer(),M.getData($e,Re,t.readRanges,Sn)]);return Tn},w=O;const{onprogress:He}=e;if(He)try{await He(x+1,E,new vr(M))}catch{}yield Re}const g=De(t,e,Df),R=De(t,e,kf);return g&&(t.prependedData=b>0?await Me(i,0,b):new Uint8Array),t.comment=h?await Me(i,d+_t,h):new Uint8Array,R&&(t.appendedData=f<i.size?await Me(i,f,i.size-f):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const i of this.getEntriesGenerator(e))t.push(i);return t}async close(){}}class tp{constructor(e,t,i){Object.assign(this,{reader:e,config:t,options:i})}async getData(e,t,i,s={}){const r=this,{reader:a,offset:c,diskNumberStart:l,extraFieldAES:d,extraFieldZip64:h,compressionMethod:f,config:p,bitFlag:u,signature:m,rawLastModDate:E,uncompressedSize:A,compressedSize:b}=r,{dataDescriptor:w}=u,I=t.localDirectory={},D=await Me(a,c,zi,l),N=pe(D);let S=De(r,s,Pf),B=De(r,s,Nf);const g=De(r,s,Ff);if(S=S&&S.length&&S,B=B&&B.length&&B,d&&d.originalCompressionMethod!=Yu)throw new Error(Ir);if(f!=Hu&&f!=Gu&&f!=yo&&!g)throw new Error(Ir);if(fe(N,0)!=zu)throw new Error(jf);Mr(I,N,4);const{extraFieldLength:R,filenameLength:x,lastAccessDate:M,creationDate:L}=I;I.rawExtraField=R?await Me(a,c+zi+x,R,l):new Uint8Array,Dr(r,I,N,4,!0),Object.assign(t,{lastAccessDate:M,creationDate:L});const V=r.encrypted&&I.encrypted&&!g,k=V&&!d;if(g||(t.zipCrypto=k),V){if(!k&&d.strength===he)throw new Error(Xf);if(!S&&!B)throw new Error($f)}const C=c+zi+x+R,y=b,v=a.readable;Object.assign(v,{diskNumberStart:l,offset:C,size:y});const P=De(r,s,Rf),F=De(r,s,Lf);let U=De(r,s,Uf);const O=De(r,s,Of);O&&(U=!0);const{onstart:T,onprogress:_,onend:H}=s,j=f==yo;let X=De(r,s,Vf);j&&(X=!1);const Z={options:{codecType:tr,password:S,rawPassword:B,zipCrypto:k,encryptionStrength:d&&d.strength,signed:De(r,s,_f)&&!g,passwordVerification:k&&(w?E>>>8&Qi:m>>>24&Qi),outputSize:g?b:A,signature:m,compressed:f!=0&&!g,encrypted:r.encrypted&&!g,useWebWorkers:De(r,s,Qf),useCompressionStream:X,transferStreams:De(r,s,Gf),deflate64:j,checkPasswordOnly:F},config:p,streamOptions:{signal:P,size:y,onstart:T,onprogress:_,onend:H}};U&&await rp({reader:a,fileEntry:t,offset:c,diskNumberStart:l,signature:m,compressedSize:b,uncompressedSize:A,dataOffset:C,dataDescriptor:w||I.bitFlag.dataDescriptor,extraFieldZip64:h||I.extraFieldZip64,readRanges:i});let re;try{if(!O){F&&(e=new WritableStream),e=new wf(e),await zn(e,g?b:A),{writable:re}=e;const{outputSize:se}=await ff({readable:v,writable:re},Z);if(e.size+=se,se!=(g?b:A))throw new Error(Xo)}}catch(se){if(se.outputSize!==he&&(e.size+=se.outputSize),!F||se.message!=Wi)throw se}finally{!De(r,s,Hf)&&re&&!re.locked&&await re.getWriter().close()}return F||O?he:e.getData?e.getData():re}}function Mr(n,e,t){const i=n.rawBitFlag=Se(e,t+2),s=(i&vo)==vo,r=fe(e,t+6);Object.assign(n,{encrypted:s,version:Se(e,t),bitFlag:{level:(i&ah)>>1,dataDescriptor:(i&Io)==Io,languageEncodingFlag:(i&Bo)==Bo},rawLastModDate:r,lastModDate:lp(r),filenameLength:Se(e,t+22),extraFieldLength:Se(e,t+24)})}function Dr(n,e,t,i,s){const{rawExtraField:r}=e,a=e.extraField=new Map,c=pe(new Uint8Array(r));let l=0;try{for(;l<r.length;){const w=Se(c,l),I=Se(c,l+2);a.set(w,{type:w,data:r.slice(l+4,l+4+I)}),l+=4+I}}catch{}const d=Se(t,i+4);Object.assign(e,{signature:fe(t,i+yh),compressedSize:fe(t,i+Ch),uncompressedSize:fe(t,i+Eh)});const h=a.get(qu);h&&(np(h,e),e.extraFieldZip64=h);const f=a.get(nh);f&&(kr(f,hr,fr,e,n),e.extraFieldUnicodePath=f);const p=a.get(ih);p&&(kr(p,pr,mr,e,n),e.extraFieldUnicodeComment=p);const u=a.get(Ju);u?(ip(u,e,d),e.extraFieldAES=u):e.compressionMethod=d;const m=a.get(Zu);m&&(sp(m,e),e.extraFieldNTFS=m);const E=a.get(rh);if(E)Pr(E,e,!1),e.extraFieldUnix=E;else{const w=a.get(oh);w&&(Pr(w,e,!0),e.extraFieldInfoZip=w)}const A=a.get(th);A&&(op(A,e,s),e.extraFieldExtendedTimestamp=A);const b=a.get(sh);b&&(e.extraFieldUSDZ=b)}function np(n,e){e.zip64=!0;const t=pe(n.data),i=Zf.filter(([s,r])=>e[s]==r);for(let s=0,r=0;s<i.length;s++){const[a,c]=i[s];if(e[a]==c){const l=ep[c];e[a]=n[a]=l.getValue(t,r),r+=l.bytes}else if(n[a])throw new Error(Kf)}}function kr(n,e,t,i,s){const r=pe(n.data),a=new Vn;a.append(s[t]);const c=pe(new Uint8Array(4));c.setUint32(0,a.get(),!0);const l=fe(r,1);Object.assign(n,{version:ht(r,0),[e]:Wn(n.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&l==fe(c,0)}),n.valid&&(i[e]=n[e],i[e+Jf]=!0)}function ip(n,e,t){const i=pe(n.data),s=ht(i,4);Object.assign(n,{vendorVersion:ht(i,0),vendorId:ht(i,2),strength:s,originalCompressionMethod:t,compressionMethod:Se(i,5)}),e.compressionMethod=n.compressionMethod}function sp(n,e){const t=pe(n.data);let i=4,s;try{for(;i<n.data.length&&!s;){const r=Se(t,i),a=Se(t,i+2);r==eh&&(s=n.data.slice(i+4,i+4+a)),i+=4+a}}catch{}try{if(s&&s.length==24){const r=pe(s),a=r.getBigUint64(0,!0),c=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(n,{rawLastModDate:a,rawLastAccessDate:c,rawCreationDate:l});const d=ss(a),h=ss(c),f=ss(l),p={lastModDate:d,lastAccessDate:h,creationDate:f};Object.assign(n,p),Object.assign(e,p)}}catch{}}function Pr(n,e,t){try{const i=pe(new Uint8Array(n.data));let s=0;const r=ht(i,s++),a=ht(i,s++),c=n.data.subarray(s,s+a);s+=a;const l=Nr(c),d=ht(i,s++),h=n.data.subarray(s,s+d);s+=d;const f=Nr(h);let p=he;if(!t&&s+2<=n.data.length){const u=n.data;p=new DataView(u.buffer,u.byteOffset+s,2).getUint16(0,!0)}Object.assign(n,{version:r,uid:l,gid:f,unixMode:p}),l!==he&&(e.uid=l),f!==he&&(e.gid=f),p!==he&&(e.unixMode=p)}catch{}}function Nr(n){const e=new Uint8Array(4);return e.set(n,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function op(n,e,t){const i=pe(n.data),s=ht(i,0),r=[],a=[];t?((s&1)==1&&(r.push(ts),a.push(ns)),(s&2)==2&&(r.push(Er),a.push(Bf)),(s&4)==4&&(r.push(br),a.push(wr))):n.data.length>=5&&(r.push(ts),a.push(ns));let c=1;r.forEach((l,d)=>{if(n.data.length>=c+4){const h=fe(i,c);e[l]=n[l]=new Date(h*1e3);const f=a[d];n[f]=h}c+=4})}async function rp({reader:n,fileEntry:e,offset:t,diskNumberStart:i,signature:s,compressedSize:r,uncompressedSize:a,dataOffset:c,dataDescriptor:l,extraFieldZip64:d,readRanges:h}){let f=0;if(i)for(let m=0;m<i;m++){const E=n.readers[m];f+=E.size}let p=0;if(l&&(d?p=Xu:p=$u),p){const m=await Me(n,c+r,p+wo,i);if(fe(pe(m),0)==Wu){const A=fe(pe(m),4);let b,w;d?(b=Vt(pe(m),8),w=Vt(pe(m),16)):(b=fe(pe(m),8),w=fe(pe(m),12)),(e.encrypted&&!e.zipCrypto||A==s)&&b==r&&w==a&&(p+=wo)}}const u={start:f+t,end:f+c+r+p,fileEntry:e};for(const m of h)if(m.fileEntry!=e&&u.start>=m.start&&u.start<m.end){const E=new Error(qf);throw E.overlappingEntry=m.fileEntry,E}h.push(u)}async function ap(n,e,t,i,s){const r=new Uint8Array(4),a=pe(r);cp(a,0,e);const c=i+s;return await l(i)||await l(Math.min(c,t));async function l(d){const h=t-d,f=await Me(n,h,d);for(let p=f.length-i;p>=0;p--)if(f[p]==r[0]&&f[p+1]==r[1]&&f[p+2]==r[2]&&f[p+3]==r[3])return{offset:h+p,buffer:f.slice(p,p+i).buffer}}}function De(n,e,t){return e[t]===he?n.options[t]:e[t]}function lp(n){const e=(n&4294901760)>>16,t=n&Je;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 ss(n){return new Date(Number(n/BigInt(1e4)-BigInt(116444736e5)))}function ht(n,e){return n.getUint8(e)}function Se(n,e){return n.getUint16(e,!0)}function fe(n,e){return n.getUint32(e,!0)}function Vt(n,e){return Number(n.getBigUint64(e,!0))}function cp(n,e,t){n.setUint32(e,t,!0)}function pe(n){return new DataView(n.buffer)}try{Qn({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function dp(n){let e;n({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(a=>{const c=(a=(a+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,l=[];for(let d=0;c>d;d+=4){const h=Oe.indexOf(a[d])<<18|Oe.indexOf(a[d+1])<<12|(63&Oe.indexOf(a[d+2]))<<6|63&Oe.indexOf(a[d+3]);l.push(h>>16&255),a[d+2]!=="="&&l.push(h>>8&255),a[d+3]!=="="&&l.push(255&h)}return new Uint8Array(l)})(t);let i=new Uint8Array(1024),s=0;for(let a=0;a<t.length;){const c=t[a++];if(128&c){const l=3+(127&c),d=t[a++]<<8|t[a++],h=s-d;r(s+l);for(let f=0;l>f;f++)i[s++]=i[h+f]}else{const l=c;r(s+l);for(let d=0;l>d&&a<t.length;d++)i[s++]=t[a++]}}return(a=>{let c="";const l=a.length;let d=0;for(;l>d+2;d+=3){const f=a[d]<<16|a[d+1]<<8|a[d+2];c+=Oe[f>>18&63]+Oe[f>>12&63]+Oe[f>>6&63]+Oe[63&f]}const h=l-d;if(h===1){const f=a[d]<<16;c+=Oe[f>>18&63]+Oe[f>>12&63]+"=="}else if(h===2){const f=a[d]<<16|a[d+1]<<8;c+=Oe[f>>18&63]+Oe[f>>12&63]+Oe[f>>6&63]+"="}return c})(new Uint8Array(i.buffer.slice(0,s)));function r(a){if(i.length<a){let c=2*i.length;for(;a>c;)c*=2;const l=new Uint8Array(c);l.set(i.subarray(0,s)),i=l}}})("FQBhc20BAAAAAUULYAF/AX9gAn9/AIEABYAACwIDf4IABwEBgAARAQaAAAuDAA6BABUDAGAAgAADgAANAQSBABUDAGAHgwAegAAfEgNCQQcABAEABAgIAAIABQIKAIAAB4EAAwEFgQAHAgICgQAHEAEDAAUGAAMDBQQJBAQJAQaAAAEeAAIEAwIEAgIBBAcDAwQFAXABDQ0FBgEBggKCAgYIgACYIkHQ1QQLB4oEHAZtZW1vcnkCAAxpbmZsYXRlOV9uZXcABw2GAA8HaW5pdAAIEYoAEAdfcmF3AAoQhgAUCXByb2Nlc3MAC4cARgZlbmQADhaGAA8QbGFzdF9jb25zdW1lZAARC4QAGYMAbYUANoMAbAEShQBYhwBrARSFAH+DABMHZ3ppcAAVD4UAFIUAfgEWhgBWgQB9AhgVhQAOjQB8AmRliQB8hQAOggB8AhoQiQAPggB8AhsRigATggB8AhwPhQAUhQB8AR2GAFaBAHwJHwRmcmVlAAIVhQAVjACDCgZtYWxsb2MAAQuCAFUKaWFsaXplAAAZX4AADxZkaXJlY3RfZnVuY3Rpb25fdGFibGUBgAAcG2Vtc2NyaXB0ZW5fc3RhY2tfcmVzdG9yZQAFHI4AGwJnZYAAbw51cnJlbnQABiJfX2N4YYAAWwRjcmVtgAASBl9leGNlcIIAXQZyZWZjb3WAACUtPQkSAQBBAQsMACEiDA8XGR4+NTg7CqHlAkECAAu/JwELfyMAQRBrIgokAAJAjwACEiAAQfQBTQRAQaQnKAIAIgNBEIAAEgYLakH4A3GBAAkQSRsiBkEDdiIAdiIBQQNxBIEAMgYBQX9zQQGAAB8GaiICQQN0gAAZDMwnaiIAIAEoAtQnIoAABgQIIgVGggBSCSADQX4gAndxNoACphEBCyAFIAA2AgwgACAFNgIIC4AASAMIaiGAADcBIIIARoAABQRyNgIEgQAPA2oiAYEATQMEQQGBABIHDAsLIAZBrIIAnwMITQ2AABuBAIYEQQIgAIEANQUAIAJrcoAANQQAdHFogQCjA3QiAIIAj4AAH4IAj4AABosAjwUBd3EiA4YAkQECgQCRAQKEAJEBAIAAaIMAhYAACgJqIoAAjIIA3wUgBmsiBYMAjIAAGQIBaoEALgoAIAgEQCAIQXhxgQBuBCEBQbiBAKAEIQICf4AAZQEBgAAZBwN2dCIHcUWEAHgCIAeAAD6AADyBAHWBASEDCyEDgQDpgAB2gAAchACEAQGDAAeAAJyBAIuCARyAAFYCIASAADmAAP6CAHWAAQsCQaiCAQkCC0WAAQkFC2hBAnSAAOYDKSICgQEuAnhxgACqByEEIAIhAQOCAagFKAIQIgCAAIOBAAoBFIAACgENgAB+gAEQhAAqgADZgQFuBQRJIgEbgAA2gAFJASCAAAmAATgBIYEApwILIIAAVAMYIQmAABaAAAkEDCIAR4AASIAACgEIgAA3hAHGgACxAwgMCoIAKQUUIgEEf4AByAIUaoABU4EAdwMBRQ2AANkOQRBqCyEFA0AgBSEHIAGAAZoDFGohgAIFggAwAg0AgADlARCEABCAADEGDQALIAdBgABbCAAMCQtBfyEGgAAfA79/S4IAJwELgAISgAC1AiEGhAD+CAdFDQBBHyEIgAH+ggDygALEA///B4ACxoABwQEmgQJYBnZnIgBrdoICpQpBAXRrQT5qIQgLhALxAQiFATUBAYEBngIAIYECCoEAB4AAPAEZgAAdAwF2a4AAVwgIQR9HG3QhAoUBSYUBNAQDIARPgACTAQGAALcDAyIEgACGAQCAAH8BAYAARAEDgQI/ggFoAQOAAdOBAtQGHXZBBHFqggDcAkYbgAAdAgMbgABkAQKAAI+AAWSBAO6BADECBXKDAIQBBYACzwEIgQK7gADugALPAgdxgQGuAwMgAIUB4QEhgAEdggHAgAFMiAHCAQKAAb4BIYAAbIEByYMBxAEFgQAJhQFTgAGTAQGDAW8DCyIAggByAQWAATkCIASDA02AAEGBAMsBBYEB5wEIgAA5gAAJhAHngAAKjQHngAKTgAAWgwHnAQWCAeeAAA+EAecBBYIB54ABK4ACeoAA+4MB54IDgIgB54IAEIQB5wEDgwHnAQeHA9gBBYEEgoMDQ4AEpoAAjYECnwNBEE+AAI2CA4uAATKGA4ECBWqBAJOAAFeFA66BA1WAABeGA7sBBYsEQIABX4AEJwEhgAHlgANGgQA6gQNWgAN0gQCZgQNlgAJvgABKAbCCAIgCAkmAAIgBsIAAH4IAgYEALAK8J4AAA4EAG4MAiIEAN4kAjYYEMYUAS4QCSgEvgAQ/BQJ/QfwqgAA7gABTAoQrgAAIgQJoBYgrQn83gABXBoArQoCggIAAAQEEgQAOEfwqIApBDGpBcHFB2KrVqgVzgQB6ApArggEnA0HgKoMACAaAIAsiAWqABaKAAZMBa4AEXIEEmQVNDQhB3IEAZAIiBYAAZgHUggAKAQiABKMFIgkgCE2AAUcFCUlyDQmAAvmAAEUDLQAAgAKQgAJvhQX6hADYgQA5BOQqIQCDAlqBAD+BAY2AADwBCIICagNqSQ2BAtuBAhKCAkMEQQAQBIAFdwJ/RoAB+QMBIQOAAMmCAR0BQYAAk4AD+4AGIYEC/AFrgQVTAWqCAs0DcWohgABAAQOBAKsBA4QAq4EBEYMAq4ADRQNqIgeAAHGAAUoBB4AAqwEEgAAqgABfgAFjBUcNAQwFgQA4gABMgADrgQAWggJCgABTgQCVAUaABP4BAoIDFYEAioABCQVBMGogA4EAuIAB7QMMBAuDAXGBAyADIANrgQCJBwJrcSICEASDAC6ABWWAAJaCACuAAJyAAM0ERw0CC4EBaAHggQCWAkEEgQWsgAWohADpggDygQBoAXKBBSQDTXINgANTgABQgAPoCAZBKGpNDQULgADOgwDRgQDPggGsAdiCAA4BAIECTgLYKoEDSQEAgQGFgwFxAQSHAXGDANOBA2uAANUCIgWAANeCABKDAWuBAMcBtIMCe4EBSoAAewEbgQQtAbSDAr2CAmkDQegqgQYwAQCAAFCCABUFQcQnQX+BAAgCyCeDAnuBAAwB8IMCQIEB4IMGz4MHsIAGUAHUgAMQgQZYAtgngQUngAC7A0EgR4AAeYEDAQQDQShrgAAQAXiAAOkBQYECa4AB3oMDDoQHoIIGzoADdIUDCAQCakEogQNsBMAnQYyBAXuBA+CAAc6AAYEBTYEGZAJLcoMA2gQMQQhxgQAKgAHZAgVqgQAwgABRgATNAiAEggBmgAhRggN0ArAngwOPgQFPgAAtgACJgwBvgAClggBvgABWkABvAQOCARMCDAaDAAeFAT0DIAJLiAE1gwH7AQWCAYACAkCBBpmEAYKBBPeEAXoDAQwCgQWcAi0AgQCtgATgAQuEAa6BCSyDAa4BBIECaYEHPIICjAMiBUmEB1kBCIIGTJQBQAEHkAFAAQeZAUCAAGICBUGAB/iBAEEDakEvgABPgAAoAQSABUyACZQDAUEbggksCUHsKikCADcCEIAACwHkgwALAQiAABSCCVuBAHCNAiCEAgyAACABGIAEr4ICE4AAmIMEv4AABQEEgQmQgADPgQL+AyAERoEG6YMFSQF+gAnDAQSDCC+ABnaEALaCCMEBAIAI8gMCQf+BCkOAAAiECQ+AABWEClCABSqBCd+ACQ0BAoUJDYAAEYIJDYIJgoEBNgELgAbDgADagQkNgABggAZ1AkEMgAWyAQiBBS8BH4IHMwH/hAfdAQKAB92AABmQB92AALGAAMUGNgIcIARCggEPAQCABzkDQdQpgAmaggTrgwg3gAKvgQo1AQOCAIoBqIEJlwEFgwmXggllgQCPAQKACAOAAFWCCAOACGKBCAOCB9aAB6KBAi2BCt2CB3wBAoIDqoAH44EHbIEH04MDDoAH8AIiA4EG5wEFggbngQBXARCBAJqAAe8DGEEIgAcEAgQigAgsAkEMhQoHgAHTgQDwgwCBAQiDAMOACNWAACMBGIABAgEMgAA7hAbsgQLygwRHhAapgAZkAU2ACH6AAmqBB8ixBquAAyEEoCdBMIEAOYEDMIIIwIMHFoIC14ADKIIDa4UCwwFqgAYZhQBCgAmMgAaDggAVgAUFAiAIgAbsA2shB4UE4QIgA4ELboED2YoDzAEHgwUbgQDlhAvYgAHgggfzgwAxhwrrhAifjgAxgQIlgwEGgQFAgAFogQWXBANxQQGAAD+AACSACiABCYEAFoACPYIM14MClIAAEYEIzAECgwwCgwKWgAwGgAA5AXaDDJgBAoEC7IcLg4ECd4EANQMYIQaAAEaABC+BBBqCAEWCAR+BACaBAaWAACaAAB+AABiAC1iACRMBA4IJE4IB+4EJp4AAEIEJE4ALh4IKKoAGiYEJE4IEMIAAMIADV4ELGoEJuYIAMYECLAEFgwkTggqKgACSAQaACaiDAGABHIAA5AECgAW2gQoGggEpgAF+gALYgwGrAwINAYACyIMC3oEA1YUA0oEAOwIgBoAAXYEAMAEGgQAsARCBANeCAAoBFIAC5oIMCoAI5IACl4QAtYEDXoEA2YADOoEAJQEYggEEggw0gQJFgAAZARSGABkEByAJaoALzwEDgAAHgQLtAQSBA32AB02GBCSFBNWAAAoCaiCBBPaAABKDAYwBB5MEIAEHrQQggwMpgQAHhAGxgAQoAQKBAGaEBCgBB4AEKAEHkgQogAFbgALUiAQogA8mgwQogg8dhAQoggS1A3QiBYUEKIAD24MAkoYEKAEHgAQogAUHggQoAQKEDCuCBh6DAfSBDnaCBCgBB4EEKIEMC4EB7YML+4EFfYEEKIMLQIIB/IYEKIAA1gEYgAAHhADkgQDyhQEEgQZ2gwuPgwQqgQIvgQAriAEIAQuADLWCA9qCAgABCIMCQoAAZgEcgADQgADOgAJsgAJCgQ8KgACKgQJCggNdgAbvgQDiAQeEDxmBAa+DAECACgCEAkCACgiEAkCCAAqAAkCEDkoCIAiBAISDAMiCC6mAAIaABomCAMaFDC+BAkCCABkBFIUAGYAAXAMEQQ+DCmMBBIEEqYADi4cLuYMEfYYEIYEMCoQAH4AACoEEb4QAHIEFXQFqggGPgAASgwJegQFxkAJeAQSiAl6BD3aAAByAAAcBDIECzYMAB4cCXoIAZoQCXgEEgAJeAQSVBoaCADwDHCADkQaGgQMaghC1hQJYgAK0hAaAgQelgwBxARiBAJgBBJYGh4MCX4UP74AHo4QGh4IJHYEAJoEF8oECXwEHhw9VgQBeARCDEGiBA9iFAOWBAPOCBvSDBN2CABaDEH+DDaGABBuDBPKCANSBDgGDAl+CBPoBCYMCX4AAPIQCX4AB74ACX4EFZ4AAKI0CXwELgwJfhgJdAwIgCYQCXQEJhgJdggAKiAJdAQmBAIKDEEyPAl2DEHOZAl2BC/uKAl2ACXaNAl2ABQKEAB+AAAqAA5KGAl2AAm6EAl2KEeaBDjqCAYWAAmGGEeQBIIMIT4gR5ogCW4ABO4ICRoMB3IEH6YICW4IB8QEIgQb/ghHXgQ6ZgQBugQiAgQFjAQuADg4DEGokgABKBgveCwEIf4EGz4IA7AJBCIEMd4AJqAFrgwLeAXiBCzQCIQWCE5QCAXGBCa8BQYACXYEGgIEFv4AAIoAAL4MLB4AKo4ISvIME6IAE6oQHeoQG3oAHNIAAPIQJxoMG7wEEgA0ViQcygBMMhAcygQ2YggchigcfiwdFgQ3KhRAwiAcdghAwgwcdAQSAAsoBBIISF4IHHYABhIUQMIIHHYIAEIsSF4AIo4ACZoAJQ4EH9QIDR4AOUIABOIICZ4AQ9oQGf4EBHoMBxIIUbQIAD4QF8YEAmYIFUIAN6Y4HYoICwQEEhwdiAQSWB2KJAsWrB2KBAsWCARyBAsWIB2KCAsWCABmBAsWFA6MBBYQRmoEA7QEBgAHShhW7gwHigglggQHAghTZgAlrggvlhglrgA1IggEXhwENAQODAfACRw2BEXGDEE8BuIMACAEPhAmFgQ/4hAmHggBNhgmHjwBNgQ2YhQFdgQKEgAAjgQw3iwJGghJEgAF7jAl4igJGiwGagAIzghKMgQJXAQWIEoeJAleDAgOREoeAADS0AleAAg2RAkCGAOaDDlmHAjOHB1ODAjOCB1OjAjOABsSjAjOGB1WMAjOHB1WOAjOOALiAABQBCIAPz4UDJYABrYULFIELLIMWt4YHKoAE+oILFIAUhIUEz4AG9I0WtYQGq4AICIUGRYIE1oMGIYACSoEJh4AAZYQHKQEAgAcpgASzgAcpAQGDBymAAsyGCYeCBlyGBymGCYeAEzWAAucBf4sJiYMXSIIJiYMFYoABqIECpIENJYMJIpEJj4ABnoAVnYECD4YNtwEAhgmPgQzagxWKgAG7hgcwgBXRhQcwgQBdgAu9gAfpgQD3AgMihgEGgALVggD8gwEKgAAngADjgRRhAQuAAnWBEF6DBjiEARqCAY2CD/qAEZoBxIICEoAFlIASTQIgAIAPwYATTwSMCwEHgAANgQWagAXHgxBjgRJ3ggXOgAEWggXOghB3gACOhAhIgQAmgRKBhAaPhBC7AQyABm2FD4mAAZGRBcOBD4mGA32AACKBA2yEBgSCADCCB/6BAc+BGJmBA5CCDLABBIADbIEV04QWVgEEghaZiBXzAQeAAWGBBeOAATCCBNKAAUWCBeODABCFAVWLBcOAAIqHBcOCDuKAFD2EA4OBBsaFBcOBABuCBcOEAJmHBcOAAEqEA5CAAJYBHIAAUYYDkAEAhwOQgwlXiwOQhBqPggOQgA8VhgOQgQH1gwOQgAAKgAOQAQOCA5CABeWBA5CCAPoBAoIBWoEDuIMJKIADd4IBIYADuoEB8YEDx4UAGYYFr4QA7pEFtIIFhoYFtIATf4QW1oYPsqkFtIIAH4YFtJAATYEauIQBToERp4ICTYMFtIcCN4QFtIIPj5UCN4sBi4cFtIAGtIYFtIsCSIUFtIECSIgFtIACSIUFtK8CSIIFtI8CMYYA5oMFtIcCJIIFtIgCJIgFtJ0CJIkFtJoCJIIA1pACJIIA/ZACJJEAuIENVYQFtIQBrYUHUIEHaYIFtIAcY4YdrIEVzIEFtIAII4UM3oEK0IAEHoUL2YEM3oMQsoUKfIQQx4MKmIIFtIAErIYFtAEBhhtAAQKDBbSBBSeCBbSCEiGAALkDHCAAgwW0AQOFBbSAEW+GDzuBBkiAFmWGBbKAEAWDAJGEDBCCBq+CBUuABbOAAMGCBbMBA4MFs4ABH4EFs4ICDoEBqIIFswEBgQWzAQOBBbOBAAeABbOAAnqAAJWGBbMBAoMFs4QQu4AClYIBWYQA6oMGl4EGCoYa0IMTZIADXYIM4oQTgIMBDQMLC0mBBxEBkIMGe4EVGwFqgQtiAQKCCzWAAHSCA1CCF4UDIAA/gAUCAXSAHo2HE0UBf4ABTAGQhAqQAwELBoAALQYkAAsEACOAE7MCAQGABtUEQcQAEIAQGYMLyAIEa4EZj4AMOoIADoAGHgMA/AuBGM6CBWuAASMBJIEHjQU2AiAgAIASGQMLCxGAACaBAVEBfoIHxQsQEAkL2QIBA39BeoAHMARAQZQIgQBNATGBAjgBfoEcBYQAVYQEuAEggwJ8gAAKASSEAAgKKEEBQdg3IAIRA4AGVoEAVwF8gQBXgweQgADmAzYCOIUBrwQCQb/+gAAJgABlBCAAECODFg8GQR91IgNzgBlXgQKAgBQFgBYugwLSASiDDnwCdkGCGfoEAUEAToAeWYEfa4ABYIIAPYIAXAM0IAKBAj8BLIkAFIAA54EAB4ABloEAG4AI1YIN8YAAX4ADhgEwgALIgQAWATyDACsBJIAAB4AbNYIOHAFCgRtAAXCCCD8BQoAAqAE3gQ3IAkKBgwAUAcyAAOCAACsCtAqCCr4BcIMA0QFUgwAHAlBBggkNgAEJgxmBAyQRAYQBMQEcgAIsjAFtAXCAAW0BEoIB+oEA5oIXlAgEEA0L/SQBIoQhWQIUJIEBeAEZhgEkgQeMAiIShAFsAwQhE4QbV4ECNwETgARnAwAhE4IAfYEEkAHcgAs6AR+AAKcF9AVqIRWAAAgB2IAAEAEbgAAIAfCAAAgBGoMAvwIhFoEAIIAAEAMRQZyBGBkEIRxBmIIACAQdQZQrgAH4AiEegQM2A0AhCoEABwE8gQr5AUGAGDIIAkkhIEF9IQ2AAA4GBkchISATgQIYgQMvAxchEIEY+JEiCpIAAoEJjpEiNoEQgoAiGoABdxdrDhMEBQYHCAkDAgwNARkAGw8iIhQhIoIEfwVMIQYMGYYACoAW0IAACgFsgR5MgQAIASKAC9YDKAJggh8wAwxJG4AAIQQGCyAggR/agABWgAZSBA4hDQyAAZGBBMYCDQ+ADxICCHKAFeABCIEEAIIXjQMKQQKCBrQDRQ0OgRqIAWuBH5KAARADIAp0gBR4gRSggBrSgAAtAwkhCoMgzoERfoACUAMIQcGAAF6AAtKGAMuAABgBdoIWRwZrDgMAAQKABOgBHoENdIIfmAUIA0BBkIAKBoAP7QGQghokARGBICIFdGpBCDuAAjSAAAuAIFiBAF+AACcCgAKAH0YBBIAAB4MAJ4AFCYAAJwEJgQAngAALgArZhAAnApgCggBOAZiEACeDAE4BB40AToAANAGgigBJggBwhwBJgSB3gAIIA0GgK4EEewKgPIMACQMgFEGAETYBDIAFgwERgAA/gAAXgAARBwxqIBUQJBqCAFMBIIkAUgEFjABSAZyAAE4BPIECqgEcgwBKgBCZAQyAIJYDEUEgigBJgAJ2A0EBOoAEcASgKyEdgQFXAR2AA1GAA3gBiYADeAHQgAOEAViAABOAAEKAA2sCQceCBDwCQQGAAqMBIYAKNAQKQQNrgAKngRXuAiEHgQAdgQg2gSB6gAERgQHsBB8LQcSBAZuDC9ECwguBGTQB0YEAEYIcR4AASoERF4gAQ4UAPQIMGoEAGYAX/gEFgAYIAQqAGJaAAByBGa0CQR+CE66CB+mAAh+AAXaBAh8BBYQCH4MBboMS1AMFDAKABWeAAVKBAhsBBoAAVAEKggCRAR2ABZOBCHID//8DgB6CgAAJgCT3AhB2ggsuAkHdgxKfgQChggqqgAJmBBoLQcKCAEABAoEACIMSVoAE/gFEgABagAi2gABUgQOMgAQWgQBbgACzAwJBw4IAJoIC4gNEIgOCCDmCFNiAG+ACAyCBE7EBEIEACoECiYAAKoQDEYAAOQESgBWIAwMQJYMjmQFEgAWJgABkgAAtBBJqIRKBADYCayGBADuAANaBGlCAAA4CBAyBEzCEBckCDBeACNOCAz0CDUuADFmNAR2FAzyEAR2AA3QBaoMDP4IBHoEBnoMAhoEAUoABEAEfgAEXA0GBAoAaKQFkggAQAgV2gAATgAA7AzYCaIIAEAUKdkEPcYAcVQEigAkgAWCAAE4BDoMBvQEOggG9AkEegiHeAkGhigFKgAChgAAMAcWDAjoCACGABCOBBZgBbIADE4ADqgMGIAyBCpsBE4AACQcGQRNNGyEJgADLAwYgCYIN1oAAE4EhHoAALYAC44AADAV0LwGwDoIC6gEAgQLqAQOABGABAIEHZJgESQEKowRJgANhgBrygwBpgAAMhgBpgADbAgdxgQBsiwKnAQSAAMaFAquDAEEBFoMGi4AAB4AGmYEdgYEDNYAADoAGmYADcAUTIBogG4EDbAIiDoIBIQG/ghdnhgEhARaBASEBxoQCYYIBHYABKAEOgQ6AggJKA2QiD4EABwRoaiEMgADcAQuABVqAATKAHaMEKAJYdIACwQEhghVUA1AhIoABAQEJgACbgAOXggEFASKAAzwCGHGACdIHaiIjLQABIoADBoAfOIEK4YEWDoABFYABAYkDPwEJgQEVAQmFAz+AANeAAZ8GIy8BAiIIhRV/gAj3hgEmgAAMgAEfggTEgSPbgQEcAiAGgwEcAQuBFlABf4UGaIACegQQaw4CgAWHgSOUgAl6gg/AhgCMgBAwoQCMigBlAwUgC4IJsgJBh4sDswEJgAGTAQOAAvmAJpuBBmeAAgaBADOAJYmBAJiAJE2ADqCBJp2BALsDIBFqgAAeAi8Bgg7AgBYzjQCXARuoAJeEAhuAAJqACyyDAiCAAjaAAFSCDFiACnOMAFwBGqkAXAEHiABcAQeDAFwD/wBxgCc/gCeGgQIiAwQgDIAAKQILaoACFJYBEYAD3YEFPoIGKoMBuAEEgQG4gQHPgAJigwMhhALIgAWjAWyAF7mEADiCABQELwH0BIMBbwKUCooCtwEVgQK3gABxhQLrhAMAgQasAiAPjALyAaOLAvKCADuABEMBXIME8wFwgAM+gQaZggLuggChgQLwgABDAR+IAEMB8Y0AQ4QGcYYGloADNIQFkYAACwENgwBkAciFBZGBA1cC0DeJAzeCA1UBUIADyosDNwEMgAFugATjgQM3AQuLAzeBJuahAbgBC4ADNQIhD4AC+oAAQIAp14ELUwX/AXFBDoEARwMGIQyAAJ0BBoECGgMMIA+BAGYCIRiAAJUBBoABwoIAlYIBqQIgGIAAhAELgCgPAXaCAIcBD4EAhwEMgBjPgQHkgACIgAR8pwMzgQdCggOYgABGAQCAAe4BD4IAnYEB6wEPgQZlgAVkAiAMgAXeAtA3gAAvAQyDAmwBDIEALwELgQC0gA/SgQP5AkHNgwFzARGBGscBIIEmEYUGfYAACYAknQLQN4MAGwLAAIEAHAMAQdWBB+mHAaqAABwDAkHJhQdAgBnNAXGBBj4BTIUCZoIP0oAGoYoBhoAAvIQA7oAIUqIA7oICSYAAxwEGgwDOhAdLgAfiAiAGgQFagA5dAQyBAPGLBK2FAumAKDABEIMKHwEQgQDthAcUARKBB5qBAEeACR2GAkwCIBCBAI8DECASgQCCAhIMgh3lggebAQqBHJiAAdABCoIHWoAFz4QARoYAIoIAGIAHCIQAGIITBYUAGIIAEgEOlABMgAE8hAA0AQ2AAk6AAAeBC3cCQdCDAI+GCSGDCTIBCoQrvwJEIYIik5IAUIAAyYQAUIAA+AMCQcqFAZuAASEC1DeAK6mBAEABXIMCj4EACwFUkgMkAQuDAySCAp2HAySAB2miAa6CAoeBBmKBApcCIg+DKhiCAcGCB5SAAGIBC4gDHQEPgwMdAQ+GAx0BD4YDHYIDpIgDHaUCL4sDHYUCO4ACGoEDtYAEHIIDxYAAiAEhgAzCgQMlAQqFAyWJAj8BD4YC8wHxigLzhgJYgCsQAwJBy4UBYAEPhgL7ggVpAUiHAwKIAV8DIAYEgybGhQMBgRnrtQMBAUiJAwGBAHKSAv+BAKUBzIQFKYYDB4AAEYQCJQEGgAfOggBNgArEAhcggA8fAQmAAe2CGy4BCYEcvIAAGgEwgCS5gQAIAsw3gxCpAfyLBikBB4QAQQE0gCrEAQOBANaAAAyAEJEBKIAQM4MARAFrggcrggAWgAAiAWuBBtyBE1qBC0WBFIcDBkkbgQAgARKBCvyCLo2AABeBHYmBAZiHC1cBCYILNgMJIQOAAT4DEiAFgAEtgQO3gwOngQblgQf7gQFKAiIDgRJgARCAAHmAA8aBAE2AAWKFA92BFP6SAzOAAcSEAQ6BDLSFABuJA9mAA0aEACKACFKIB0GIBA6BABaEDIqBEZ4BEIMS4QEShiIFgRQ2gAblgRF9gAFBgQlygApJATyHD58BLIABXQQQIBdGgAhVgAP9gCmBgRG8gBgSgSYJgAARgCsIhBCHgBVdATiDBbyCGDeAEh6BFXACKHSBGhKAEj+BEiaAAG8COCCBFbGCHLUDLCIFggAugRGXATCCMO+CADCBKiICLAuDAfWAALuBA6QBBIEBXANrIAWADK6CIFMBNIMemQEsgBHXgwRwgAANgAHoAWqBDNSAACeBAd+AASWBASkGSSIJGyIEgAA4AQmBAGqBAeyBDPeAKH0DBGsggQAXghaAjABPggANATSAIhiACoWAARyDAKsCCUeAGWmAACmAAniAAJYBCYEdWIENZ4EpH4ASW4IRpAIIIIIRpAEEgABcgAAWgRrdAReDES2AEuSCLQUBFIAAF4EVt4ABVgEgggA6gBKxghF2gAPSgRpygABDBBtqQYCAEdyDERiCEMIBRoEAE4ASrYIUOIEOEoEwBYEIfoAAGYABKQcgDUF7IA0bginVAQ2AAJMBF4AAHwENgACZAROAAAiAAagERhshGYMokQHSgwiwAnwhgBFJARSDIBcGGQuUCQEMgBQrhhKngAEhgAjQgAAHgBMngAM0gANCAQ6CB40BEIIatwMCQUCAAY6HJ++CC3OAM+kBAoEz6YEozoEz6IAEwAEOgSBggCGaAQSABWSABh4BDYEFcoEUpYAASgELgADJgSBEAQuADc8CIA2BC+IBCYAEEwQNIAtrgy1rgAmIAU2BLUWCF5sDCSANgAx/gQjUgwArgQAngAGUARCBAEEBCYAAFQEPgBFgAnJBgSOIgAT9gAjNgCFFgCFNggAPAwwgDIYho4AEeQMIEAOBI4GDGTmCDf2DGS4DDWoigABVgABykwBQAQiDAHOEJoqBKSaFK36BAzKBAFKDIP+CAFKDGTOAAFIFCCALSQ2BKDyAAAmBAD2CBmeSAGABDYYm5YACU4EAOYIm5wEIgSUzhCssgyLSgQA5AiAIhQA7ggAsAgcggBa3hzCagRAagAeogBnCAQ2EIgmCJYOBBtWBAYiAMqwBcYABNYEigoEAooALkoEBRIAABwFrgASngAAiAwwhCoINNYMYJIAAEQEIgABhAQqMGcCBIqmGKOyAAB+BBEOABdaEI/+AADUBGIEUFYAAEwEMgRDchQBFigAmgAAfgAAYAxQiB4AWoQEMghnEgAAPARCBM4gBAYAAEIEZxAENgAVJAQ2ABLMDByIKgRnEgAEiggAwgANvgSLMgAAQAQqCADGBBU6AA56EAYaAERaBBkWCGaOAAFEBHIEA8IAYPYIZo4EBnIABZ4EZo4AAjIAAR4sZowEIiBmjAwwgEIQZowEQgQAsghmjggAKgBmjAQqCGaMBCoEFQAEYhAC1gAAoggDZARCDAQ2AEM2DANyBBo+CABkBFIYAGQESgw7OhAHKARGHAgUBEYsByoMB75ICigEShALajgA0gAIQAhIQggX/gAf5AgcLggCYgCi2gQbegQRJgBgtgSVlAxpBfIArbgEOhCPzgBBTAnEbgilIgQBMgRD2AwdLG4IAOgYJIA4gB/yAOmaAA8cBEIADFwILIoEEAocX2wE8gAAHAQ6ABceABA6AAC6ADPwCIAKDAC6CBk2BBluDF6qBACyBBluBBFODGbKACAYBEYEk9YEAHIIFKIAHO4EF24EFI4AMrYAaOYEf2gUYdHILCIEE6gUFEBALS4AZSIEXDgQEf0F+gh43gCExgQZmgQB7jRd4gAAdgDOcgwAXggZyiBePgRj8AR2JF48DIAERgAengQCcgADkBQAQAgsQhAAehBfSAUCMF74FDxATC9KBGSuHJUObGRiBCQyhGRgBtIcZGAEmgQ5DgC0QgAEFgApqgAYFA0giBIATuANBD0uCGwwDQYH+gAVDAXKIGSaCGR6CGSgBIIEAKYMZIYAARo4ZIYYAFI4ZIYAZXZ0ZJIEbaYsZJIAAtIoZJAHEtBkkAkF+jAFmAXGAAWaLABIBH4AAEowZNgEGgBk2BIBEASOEGTYBEIIZNgEXhQFCgxk2AQyEAYqEGS+BAm2GCKeCB1oBA4IHWoIOVAHAgwcYgAAHgRybgRj2AiEdgAAXgRlTgBkTghlTgAe0khlTgRlrghlTgxk7gBAWgxk7gggFARyFGSsDDiESiRjzgRSCgBlTgiGmpRknwwACgAHmgAG7A2sOH4IZZxszNDU2CgsMDQ4PEBEDAhQVASQAJhcYBD4/QEGEGWoDCwwkhgAKgSRZgBlsgw5aghl2ghopgxl2AQqBB/aBDkmAABIBDIAMGQEygwAKghZ0hgFiAgwzgRBnAQaDBQmACgQBN4oWMgEGixYyAQaBDGKBELGBEP+AIPWABKsEn5YCR4E45oEAWwEogwBZgBBNASiBBf2ABMKAHPyAAAICECeBAwcBHIAPLoAALgI7AYEpLwEQgABKBEECECeCIJ8BtYgXUIAEFYAAYgEzggCrASSBNr6AAlyAEFeAAwSABT0DdEGAgANugi39BWpBH3BFggMhggjBAwBBuYsMaIAAQgEHgRafAQiDF9EBh4AO0I0AHgIEdoEDxwNxIgmCDTiADUYCB02CAMYCIgqABwcBCoAMXYEpvgIoIIAhFgQFT3ENgBaXgAWmgjq4Aa6LDeEBA4AUYwEyiwFGATakAUaCC9aABpCCEhWTAKuAAbYEB0GAwIE9nYAAHQHYixL5gwHTASSEGF+BARiCBDKBNo+BADaAOBGBBGSBNOyDAAuAAXcDOgAIgAc+gQArAjoAhDv/gQGagwGPgh0kAwJBtoUTRYEIwAEGgwDbgxlvA0UNNaUA24gAmIEOToEMtwMtABWCJPSLAJSCCIaKAIoBBIYAigG3kACKhQFlgAwMrgCKgAD3gyK8ggFzgSAWmQCYgQKskwEiAbiLAJiBACSAPBsDQYAIgQGnAQeCERmFAKmBAASLAKiABLyAL4CKAKiDGqKCFq4BNoIamIICfYATlIEAvIENJYAP34EI8YIDV4AAaIEAo4AFvIUArgEogACugBvykQCuAgwohQECgQAngg2oARCAABSKAdQBMqcCr4AICoECWoADh4ADj4A8y4ECc4QDlQQYdnJygwPpgghuATCAAScBvo8BJ4EQVYMIrYEIloAC7I8O8YARF4UO8QRBAiEXgAEShgRKASiMAGGDFHsDCyAdgB8UAg0vhB5PgRohjBoGgBhuhBoGAQ+KGgaFAOyGGgaHAOmkHk+BHkeABjsCpDyAAE+BDG+BHWWCD+7/HlyXHlwFqDxBsDyCJqEBzYAABIEACoACM4keXYAAGIAAEoAeFQMUECmgHl4BrIAAUAHNggfagikfARCJHl+KAEuAASiCHmCBAdIBqIEBK48eX4AAQoceX4MXxYE7jIAR8AEGjR4bATKfHlSTADkBKoEAGYQeVIAZlrceVIAATgMGDDCpHkoBBoEAfZMeRAEGhBizAgwtnh5AAQ6AAAoBDoIeQAINLIANIZIeMwEMgA+mgQApAWuAEDyLHjOBBBOFHjMBJ4MEC4IPyoAECwErqAQLkh4hgTmHjx4jgAGbAWCAAD+AHiOBAYyCHiMEBUEeSYEl+wFNhQfBix4qASeKHiqACNeIHiqAFZqDHiqAGWGCHiqDGCcBC4MeKoIcm4QeKoEa440eKoBFTIEeKpgEJIAbR6EEJAEKgQBpgAS0gQBpgAAMjx4qiwJ9AQiAAMaLHioBFYMLkYAAB4geKoAADoALnwIhDYgeLoADOgIiFoIBJYweLgEmkR4ugR5DiR4qgQHhgBGrgT0piBrzARODGvMBGIYWcAEGggEFgRdSARODF88BGYEXT4AdNIQXz4AAvaQeKgEZgR4qhjOpAQ2IASaAAAyFHHIDBSAKggEcAiAKgwEcAQ2LHiqAPQqFHiqAHbyAAn2CAeIBCIQXCIEUcaMX2ocAZQMFIA2eHiqAFOGAAgaBADOMHioBBIIAu4oeKoAgB40AlwEkqACXhAIbgACagBEXgwIghx4qgBnHjQBcASOpAFyAHiqGAFyCHiqAEkSEHiqAA04BC4AA8oEVnwENmx4qggglgQUNhQG4ggZKgQHPgBHwgwQmhALIgBLdph4qASWIHiqBAuuEAwCIHiqHAu6MHiqCADugHioBHogAQ4weKoIAQ4YeJAEWhx4kAwUMK4keJAQEQQZJgBGXA4ICSYIM3aYIsIAFjAIOaoAFFAFrgBo3gQV9AhJrgSgDgRaRgQ7CghaJAxwiDYEXF4ADkoEWwQQgaiEhgAOXgAAMgxtmASKDAA2DA6QBI4EACwFUgAOkgAAHA1AhGYEABwFAgQLIgQ7QAQOBAAeBFheAAAcDMCEkgga/AQ6BA3KFBrSAMJuAAAuBPrgCCGqAGKGCRckBcoIKeYEDTwILIIAroQIgI4ID6oE9DIRBLwEGgQP0gAzngRl0AgR2gQQWgRuUggHKgBtZAy0AAoEZSIEjIoAcU4ADBIADpoEK8QEGgRshAQmAEhWCHdGCAC6CBO2CA9OBEB+CAJiBIYCBAt2CBk0BCogAqIIAnAIIaoAAT4IAeYABAgEEghqmgTyKgBoEgACJgTF+hADfAQqGAv+BAAuGAN+BHPOAANiBIeOBAOYBC4IEyQEihADfhwDbAQiDG+kBCIEDFIIA24AWuIFK9wF/gACWgQC7hEUegRt/ggOIiQNsgQXvghDsgD8SAQOAGuYBGoMAgQEDhAAfgS7tgQA4gACHgQNhgAC3gwBsgwFHgAEighuAgwDaAWqABVgDDCAfgBjwgxs/gBo+gRkcASSBGzyAAdABxIEbPIAbOoAGaoEdGYEXa4EBVAMOICCAACiDB4KAAIkBC4EFmQMOICGDABSBABGAAESBIhaBGQiBLWeCAbKCGvqDAbKCJUSCBpCBQrGBFawBDoEaioEAfIAUzgIiB4AXcaIANoAWOoEEYIAANANrIQmBFnYBDoEET4EAhYAAB4AUuYEZh6sASYABKwEJgQRuAwlBA4EXlogAOoIBtwE6gAFnhQJ/gBT9gQU7AQmAAFWAAjqBAFWAAAeDB5KAFVGAIMKGADwCCUGAQciAFsuDAq6AAJyCAG+BI4ABDIAcS4AAqYQAKIAADIQAZIIACoIAZIIAVoAuT4MF/IEAcoAQJwECgEqvggBmgAJNgQAqgAA+gAWPAUGCC26AEB2EAGaAAOEFLQAEOgCAOqGAFASAABSAAo0BCIMeHYAeG4EBAIId3QMIDB+BHsCBAhmBAqWCAh2AEOGAAh2DArSAANKCCKeCIUuBAf4BGYcALIcDI4YALAELgQnQgiGTAw0cGoAhdoAAFQEbgQDyhgE/gQMegCAsgBsOAU+AJNKAInGBRAiDKKqABPMByJEjD4ADpIoIHIEeLIQjDwENgQNNgAZtqwgcAiANhSMPgABAAgAigAZLiCMPAQuCHV+BJjGAAGmDIw8BE4AAlYAANYMf8oEYgwEFgBvMgBqYA3EgC4gjD4AKDoUf8qUAiIAKLIMDnQELhiMPAQ2PIw+BAFmBARuMCKwBDYIjD4IUw4YjD4Ao2AEIkSMPAsg3gwAblCMPgikPhiMPggSDgAAhiCMPgE4JgQqjiQGGgAC8hADuggqTpSAOgADHhADOiCMPAQuFBI6DIw+AARWBAOaCARWFB86AAjQBDoEPNoItz4si/oAK7YEMXIQDYYABqoIUX4EePoIHUQEKixBlASSkDFqAHwYCIA6CPQmMHZuBRLMBIIJFh4AZO4EHXAFGggecgBHOgSDHgRD4giJGgRGLgQJPgAG/AQODFGGCAJaAADeABK2AAl2DABkBKIEWV4MUcoQQToID2oARQoERQIAZyZwQ6YIAZwIbRoAAMQMAQeeKCOKABVUBEoEs7oMmkIAAEoEWqAGAgAS3AXSDACaTEMkCvf6CHleCE+wCAHGBR/+BDhUCDB6GIISABHKCIGkBBoEBaYMAFIAAZo8AHpEAMoAtyo4AFIISxwHOhSQ4hA8Fgw8WAQaCLAKBJDgBCoM3joMOnYAA2IEANAHPgwK7gRZ7hyQvgAECAcyLJC+CAZIBVIADV4sCvoAcOgIgCogkL4cERKQqioMDp4EdGIwkLwLIN4MHGYAcjIgEPYokL4EEPYAZxYQEPYEHvoEeaIUEPaUAgYsEPYUDW4ABIYEILoAFPAEKggChgB0vggN7gSfPhARFiQNfniQvggFgiyQvggQbgQ53gRBpkiQ0gAFkAiALhCQ0hQQmqic1jAQmgyQ0hAQmgyQ0iQDFgQ03gACEiSQ0AQ6BNTWAKX6AAMCHJCqCA9GBAeiCJCoBBYwkKoII7o8kKgEShiQqgAoUjSQqgQBEiCQqgAAiiiQqgSIugCD1gyY+hyQqAQuDJCqBAB6FEUGJJCqAD/eLCLGOJCoBDoEkKgEOggBNgAUThiQqhie/iANggSkGjQAUhyghhwAUgAA8hQHzggT9gThtgQEDgSvPgA1nggFVhgx4gRJ+AgN2gCFugx28gAWWAWuBEYEBIoQMngETgCNogAh0gROFgQA9AQWBTJyAE4qBA3aBCDMBBYIByIEMposbGYAABwEEgQR9AUeBBP+EBraAQr+BEt+DJKcBBoFUmoMVwQJBuYcSlwEUgAkUgxbyggFegUXxgSzagBKWggHqghZ2gB+hgB93gRtxAQ2EAAoBGIABnoAABwEUgQHEAQWBAgOADNGADKuAAZaAJEyBGriAHTkDC0sbgRLQgAAmgAoYgUSQkBjMhBbrgRL7hBeWhRL/gQD0AUSEEuyEEvqAAF2AUSqAAL8BuogRLQFEhhf9gQDFgQa0gQaohA93AWqBA80BA4UAx4EfrIFE1gEcgVWbggK2AUSACHiAABEBIIEkc4MSC4EAdYEIMwIgA4IU4YFRyoECQYEBGAJJG4ACPpYYaoYAygEFhADKgQB/ghOugA40gADCgCDkgimehBfGgR4Ygh2qgADGAbuSAM+BDNOFAM+CFNmVAM8BJI0AzwEo5ADPgzYliQDPgRzVAkG8iQJdAQWBAfWCBM2HGfSBLvSgCEWDAJyFAJGAAuIDLwEcgU7wAwBBmosJgYIXwIcYnYQaKAFBgDowgCb7gADwAQmDG1GAEhiMHMyMGIKBBGqAFDmCBGgBFIAACIoI+oJGeqAI+oEIpIEjc4IDkgEggVLLAwBB0IoFFYIApYAF6YQXyYIAuYMHo4AAGwEWgRaWgQCpgywOgSwfgUAJpRC7hBN5gQVhgTTHgAlfgVNMgySngShjhyhiAQiBCvaAABCJKGKCCw+WKGKAAG4BOIFKtIUoYoMokI0oYoAAmwEsgQG7ggYvgAbRgQfZAQiABZaFKBWQKGSCKAcENCIGaoAAJwEJgAAngU8ugCWJgSWNAUmBIagBCIAAOIESw4IoZIAAI4AFIYAQBIAmeYEoZIAAlpMoZIFO84AC74IowYsoZIIPXIsoZIAE3IMnnQEEgQGFhChzgEyChShuggDOlShphQKmhwrPgSEqgACmgwq4ARyBWaKDBweBCtSBEQ0DCBAngySPgQALAigLgQFbgQKOgAAHgijxgQXauSi4AQWAKLgBBYMouAEFggCVARuCS8kBHIYouAEXgwJkgyi4AQuAKLmADMQBEIMouQEXgyQjAQeHJCMBJsEkIwEKg0DqAw8QP4UACwFxhwALAR+AAAuMIosBCIAiiwLXJIApQoEhuoFPOAIQNIEiQYArJAIAGoIC44EBY4QiiwEcg03ZgFWegwCZg0qfgQDqgwE0BQRBmgVHgCtdgRpgAYeBA4uFKZGAJteCAx6ADEiAAHmABDCAAXiHA0KBAa0DABA2ggApgwcfgAIdgwE5gAdfASiFRpUBBIBWdYFFNgJBd4MkNQJLG4EP3IQAEAcDQQRKG2pKgAC2gBBCmCI/AwRBKoEQgYIAqoNEToAEcwELgTCxgAB3ARiDDqYB8YIEpIMwDgMwQQyAIUgB8IEY4IEEOIMAsQGIgACHAUqDBgoChAGAGdYCAkiAEoEBwIEIAgEDgBUKgAAMgAJHAcCBUPkBBoACA4MbX4BPNoAAKQIgcoMJdAFsgSUUAh9wgEChBEEfcxCCCGIBbIIX/wQALwEygQAQgQAJAzAQPIEBSYQNAoMFQIIAm4IBLYEBOIQEc4EAYwMEQTmDUfqEBXiCAC+DBhqBGYqBA0uCAHqAFVsBH4IOl5MAHAGLgRxvlQAdgCEOhkzogyMXkwAoggoV7AAcgB77gkjPggGQAQmAAeMBQYBGy4MDzIIBroE2lwICSIQBjpEARgEggBKFlgBigQfVjgF+ggLUgwKigALmgATxASSBCv6BAyaADEWBHtiAC/OABRKBCq+BBPaBAvqECgeCAF2CALKABLGCAH2ABpwCR0GBBGYDCBtyggC4AQOAAAiCXdOAAAgBEIEITQIbcoIAhIAAX4IG1IUATYMcQIAKH4QASYMAqp4AJoIi0YMAKQMvAQagAE8CLQCBE4mcACa9AX2CALeCRYWcAI6CVlmBTU6BCvShAQyZACaIAQyAAcABC4ABs4IYxIAEG4ADQ4EGn4EAN4IDUoIdZYcKQwEgglsygwOBggRbAcWAJpkGBQIJCQkDghSLAduAMFmBUaUB54EMLIJaAoICLoIoTocAxoAHbwIvAYAG6YAG54EOLYEAbYEEaIFD+YImgIJPvAFPgwPrgAoXghm4gADSgjGCASCAAL+BFpGGHtCAEbuCBzaCACMCLEWBBHgBT4QZlIcA0IAARIAGpgFrhQDTggBJhBIwhgLcgRWlgQwTAQaBBPaDDvKDAuuDQLmQAIkBBoUAhAEUglKdigCHgAClAU2RAIeBAL2GAVqBAVKCE+KGCbyAAD0BHIMGEQEUgiBzgQAThAEjgU1PgADvgkaLhADqAQePAGOAGPeAABiFAGOGBTeCAfuAAEqEChWBIPmBC4SDAQqEAiGAEzyDDAaBBb6EAjOGALeBAjCBDuOEBQ6BAIGDBg+BYPKAGBqBB2OKAIaAABaPAOkB24IA6YYARIIre+MA7IArFq4A7LEA6gHniQHLgQNXgQDIhADUgBdjgh1RhQCpgRPDg0tnATCXAImGAB6aA8uJBwaBAIeNBbiBKUeCAs2CNmaCAAqCD66CAAqADAaEAAqDAI6CK3aAADgBdIFF84FJqIED8oAIP4E0NYQIV4IKc4EE/YMHFQMBEDWCMCeFCOCABQQBAoUfnwMCQZSBESaDRHaFAFcDAhA5iABihBUJArQtgwxCgQmrgAAdAVyBYO0BToFkWYELnQIDaoE8xIEADAFsgAOmBEEBEC6DACYBbIId8IAGfQMQNkGABXSCAAuAA6MBG4MA1oAAVgFggwBAgQArhgHzgAANAqAtgUiugAFNAqAtgUhTBCgCmC2JB3SwAB+DAbCBEg+BFD6ADCuAIAmAACSBHxWCADSADPGAEk0BdIQAt4EPK4I/IIIAToEABgKkLZsA+4EQsYAB448A+IUA9IJhNYIBIwKgLYIObJ4BRpkAToACNYMBRIEBv4IjWIMhfYIAy4BF/QKDAoIVWYYBYwFsgyVogQHaAgFFhwAlAklxgA+VgDioiwAqgSFHgQ4ygQCVgBbHggInhgICgi3iwAICgQLsgwEMhCrJuAEMAQeEEWKAAK6AD7OCET+CAO+BWueAMvQBAYFJ0oANxoEV44IPA4Id/IYACoBi0YEzCgGCgRtkgAkGgBFoiQACgAT8gBvygBE6gR4vAQiDWXWAAAyAADWAGfSBAAqBTyuDAAqAAx6BMjqAAAqAC82BY6WAAAqAIKKAXYaBAAoCB0eBPR2BGMCBHoSAE+mBFdOBE7YFA0H6AUmBHreCEVuCP8iAFd6BBAOAIsiBAAqBLMWBHMwBCYJN1IEcrAEJgk26gRyigh3DgC/CgQAKgRDHgSJ8gQENgAnLgBRfgADUgl4Hgjl7gQcFggHjgAMggQMJAQOANLCAL3eCAHCCAyyCAyqBZB2HC3aBACuFAB+CBNeOA2qOAB+BAFqACAOCBaiBG20ELQCQIYADdYASjQJBhIEffYoDe4Au74IuRoMCfoER6wKIE4IAHAGIgCTjggKogicSgQOYgwyqgwOYggKUgQB/gRYUgQHmgQQ8gQNUgwnJhgDMAQOMAK2GAB+CAE2OAMyOAB8CIAWBAB+CAYmoBDaEAJyFBDeEACy0BDeAHeiBAO2BTj8GQQxsQZgggGi3AQCAM/UBC4AATwF+gBmMgzFyAZqACWiBV9gCQX2ANpSBNKSCADwBBoExVoYJ5IAA3oAExIUGCYALCYAKHgUAAQEBAoJU3IABewK4LYMDoQG8gAEKBXRyIgY7gAASghDCAwNBDoEy1JQLLQEGlwyqgREjArktgwyugFXkhQBdAmt2hABdBANBDWuCEbuAAt+AANEBNoAAHoQAcQEKvwBxgCgygQDAgQBzAkEJhABnAgdqgBRDgQBlAhAtggUQhAeaASuBT62CAaqAMZuBD8SCZkSAAA2AFxmFKHuBIluBDQqCTg6BAfyFNAKABRiCAAiAAbuDKOeGED6CACKCB7yDEJiBJK6CBVcBGIECDARMDQMagwhCgQHcgWdXlQDVggOQhAAqlQAjhQhsgA+ymAAmggAjAy0AM50AI4AAC7sAI4cAjwEKnwCPg1EKlgAjghUlgh/cgGp4AXaLEJCDAyoBGIFniAFKgwbIgGaVhlyIAkULgjTzAfqBJyQEQXsLHIBP7og1CwEQgAxhhzavArsBgDaMgRJwixL3gQ63glZcmBL+gAAgAUScACABQJwAILATXgF9ghJoAfGAE/0BC4FQ1AEBgADEAQmCE0sCbBCBcHOAACcBbYET6gcQQAu6CQEVgTXcAUCAJWSCBtICBkGBOZODDdYCIAeBEoICCkGADTSCZvYCdGqCBOWABPCAScuHBPCAABqAFvmCDXuCV76AF9cCIQmAbgwBDoEj+oFA3YIAQoAQTYIAQIEKeoAADIEkY4EAMoEkJ4AABIFOSoAW2YEZpYAlu4EsBgEQgB8JgiomgAA8gi8UgAA8gjtVgi8UgSNEgCG/gQAdgUo2hAOKgySKhABYgRuOBAhLGyGAOd6ADFEBAYImL4A8H4EA04EAzIE67YIAuYIAQYIeXwIgaoEAZQFrgAkAAgBOhGhRgAALgAIXgQCxAkdygBkegjGogCLQATuAI7KDAFKAAO2AAK6HAS6HASkBIoEJPgEKgwCfhAExgABagwEzgWEhgixSgAANgS5jhQFBAkETgUDJgE+KARWEBYwDAA4CgAuPgT3IDCESQe4IIRVBrgghFIE6bQF/gAARAvANgAARA7ANIYAyQQEBgBatBA9BCUuBaXuAZVyBYOABAoAU7QFxgGnDgARZAw90IoAHPQNrIReDEfCAKZOCDWSABIOBCiOBY84DdCEYgAosAX+BEcECIBaFAMKARQOAFDEBGoAyhgISTIRCNAHggjznARSBRSOACimBACaAQWMDBiAVgQdoAwshGoEk7oAIXwIiDoEBYIApw4BGaoMkzAIgGIIOLYEeZIA9EwEHgyyKAiAQgAFJgCUCAQ6BJMsDGSAagQP1gSZCgl+oAwFrdIMBYoE+EgF2glxhAQeAWWCJAhOGAoiAAbSEAoqAbMWAIcyBUswBB4FxF4AAy4FRjQEGgh9cgijBgEx5gwGwghzNAQyDChSCRUkDAiAXgCBFgRpQgwElgQAYBSAPIgkhgDdshwDLgQRQgQC2gBlMgQC2gRVPgRPWgD8kiACygWIHglmngD4JgmzwgwCYAQCCbV6AAJiCAqODX+8CIBOBAFaDWyCAJKGBAmMBDoEJ4oApA4YBiYQAB4Ifk4AApYEg3gFGgADKAQ+AbNeBPZqDGRkBS4Il/wQgDBsigEflAQeAALIBGIIBegERgQFNgQGTBAZ0IRCCL2eBA3EBDIAvvIEhoYA9cYEBToJKM4IC/IAFUAFKgW2bgDzfggJUgQJNggIgAyATaoACRAPTBkuEAlsFE0HRBEuAAl+CFEqAAtqAJUCCRa0CIA+BAReAAtWDCSCAM7WAUtkBdoEBMoAhOoED0oEAbIECNIMDrIEDyQEAgwMPgT5vg04QgwMdhwOTgAAYAQ2BAAiBAzyFJ0EDDgsrgAFfggHLgATbhB/hgQSTgVzwgQAHgmW8gGr4gW8AgwT1A2BB1IIE9QLEA4JxZYQ8goFV5QHVgRgkgRcbAdWABnSCAAeDUS8BAYEdcoMAHoMlpYAQVIEmy4ADNIEOkoFRBYAcz4EoKoEMDYM364AOYYAIxQdBoIbi7X5zgiASAgFxgXHngzBohBwSgAoagAoQAcCAb+6BABaCIaqBAGiBHKKDbyABc4Agu4FrpIAuKAF/gwKuggDlAyADc4InW4FyYYAAPoEQSIAAKokA8YUCXYAAQ4AYjJQAM4ACoQIIdoEAHoACwYkAHocAGYAC4ZMAGYAcDZMAGYAQuJMAGYAHMpMAGYADIZMAGYA71YoAGYIA4oAdUIEA4oAbRIIA4gMLvQWCB5aCA9qAACGAPKCEXiGBCviAADGAAPuBA60E8f8Da4ER+wRB8P8DgCDEgWqOgXKlgXaGA4CAPIAKF4AAW4IAGwMgAHKBWbqCdRKBHpiEAXaDAVSGAFGBZsKBdD2CAXGDBvSBAGMBcIAAUoEHc4EAbYFjLIIAUoAAUIACKQLbAoEMgANBsCuBD3iAbEmCDjeBAmeDAE2DAA2BMtuEAAuBDZmEAAuAb0qFAAuAALaFAAuADiGFAAuBFMCEAAuADtCFAAuBDUyEAAuBae6EAAuADqqFAAuAQOOFAAuABAmFAAuABZiFAAsBDocACwEPgQALgnWugC0IgiAsgCGJgQR3gwD4ggLZggAJgQGkArArgwGlArArhQKIAQKAAr+BAVIBEIcCyKQBUoYAWoEj/4QBzoJsS4ICuIAADYQAC4FmI4QAC4FxyYQAC4ABMIUAC4FooYQAC4FmXIQAC4FsqYQAC4ABMIUAC4ABMIUAC4E/YYQAC4ABMIUAC4ABMIUAC4ABMIUAC4ABMIUAC4UBMIACZIMBDAEQhAELgRezgS9aAnRygAFEAwsLkYkJeoARooMInocJfAEGiAl8ggUQhQl8gCjFhwl8iAjyhwl8ggBCgTpeigl5gUV3hwl4hGZsgXA+giR1BEHAAjaBDMySABeCTJKBFZGPCa2CB0+BJFCjCa2CCR2DCa2ICjeHCa2ALDyCAFyAbpiECo2CdCiABh2BCYyFLmiAEDOICa+ACMoBToEINYBbzAEggENVgWGnhAmyAg0CgFXfgSjkhgmzgQiEgD5BjAFnhwFihURoiAFqgQh/hAm1ggAXASCBCGuFAI6CBbkBFIAGzwUFIhMhFIwJtQKBAoAJMQmgDyEUQeAOIROBCbWBCUICoBCBABEBD4BaUYAHWAENkgmzAgQagQAbAnQigEraAWuAMiCECbQBDYIXHIEJtIBUJYAAIYAH0QEWhAm0gACAAiAVhQDDgCvAAWqALtMBGoAf6IADdoEGqgEOhAm3AROBABOAE4OFCboBDoABdgEUiQm6BA9rIheBAWuBCO8BD4MJugEHgCKBggs7gijzgAbZgQfmAxggDoEH0gMYIBeBB+0BGIMJugEGiQm6ggFpgQfJgilNAiAGjQm6hQLGgAG/hALIggkiAQaBCSIBBoEJuoAAz4FB9IM5f4UJuoF2v4gA64oJGAEZgClKgEaAgAAoAQ2NCRgBD4AITAQPGyIPgRq3ARGACVaHCRiAAPGACvuADKqCCRiAKcCAUESDMYCCAKyBVimDAmWAUdSBCRgBB4AkUoJldYIJFoAj9AISaoABpgHUhgkWAxJB0IIJFgEHgFQCgkX7g07lgE6/AQ2EMO6DMP8BEYAYfYQJFwELgAp+gAM8gQBrgAGRhAMWggkXgAM1ggyqgSzbgQAYgQKKgAKAhwL8giXJhwkYgQVugTXXgjBOhwqoggGkhAqohgp2ARKECnaCNjGCCncDCwuqgBHygQdSgRY6gTIzAwFBnoISRQQAQYgTgAASgAJJgmzJAkEegwAVAfyBYfaGABUBE4J8a4AACYAAWIMD4YgF0oABMAM7AZSAbC2BDqACsC2DRRIBqIAACIEAEAKgLYEToJIAOZYAGQMLrwKCAKyBD++BEi6BDwKAEkABBIASnYA8xYAAEoF04gEEgxKdgg8ugRnIgxBAgkQpgBBAghPBlAAcgAb4gxIsgmLNhABdgBKdihKbgTJGgxI0AgAQgEX5gwBKhxCmgwBKgjValQAchRELlQAfgAL7AXODFTCUAKiGHhODECKEJI+BD+oBEIA3E4MANYBtRIFAYwGngBPQgkdRggDMAwFBCYgBG4EBWIRtkIUA/wG4hAD/lQAgggEfgxK9gBKvmQAqggBKgiIggwGZgQCAgm76gAH7gQE8ghRwgTkkgQA6BMAtC6aFAKmBAeCEAK2CSie8AK2FAIKCTUqBClABSIJtXp4AVIEAP4cAuoAKgIIB9AQLC/wKgGgFgwarhQX4gRtcgxJugQwyASKAKw8BLIETvoEKnYEDVAcJQf+A/59/gjSsAQaDP3qBDB2BB0CBGVmDBzaCIyOABTaBGWyGBmKABxWCAuoBAYFwOgMvAbyEAAgByIAACAJBIINYfIAMh4E9KIAcroAMW4EAOoAhtIIRcIUWKIEYFIQpGoAOX4ANaoIpAIEBFwWYFmoQL4IACgGkhgAKgACwgQDFBJwWEDCCABCABAKBABABqIUAEAGwgwAqAkH+gYAdAkESgQYjgAECgDVggQZyAQKDL7OCN50B8IBBxIMA2oMF5oYyD4EATgEtgQAygBe6AwVBEYABgIEEEQYoAqwtQQqAIsmAWQ6ACm2AJteAAAqCLFCAABuAHKCBeOCCEYaADXyBHpKBGrSBTt6Aeq2DHmiCJjECECuBAICCBByDdcGAAnOAGA2EACGAFVOABCeANWsCciKARriSBC2NAhGJA8eXAmGBOC2FArSEBC0BAY8ELQJBoIBBjAMaEDGCAoeBJhCEAI2CdwKGAIeEAJq5AI+EAz0BDYEqpIEAmoAAlIIKi4Q3AIRMRoEAk4EB6YEt9gH+gls+ggHogUlaggEXAQyEAJCBIYuHATK4AJgBBYIH04kBKoJuggELggEohABngWwKgAKxgH88gwChgACKAQGHAIqAYzDCAIqDCF2WAIqCAGeCABKHAIoEBkH9/4MBJYIAkwENhwEdwwCTkQEfASKAPaKCAksBDIIAmYcAb4UAGAEEgACfgwHKggQ0AQqGA5iAA+uCE3UBCoJCtoEcbooDk4F/a4YAR58DBYEnV6AAwYEZz48AvIgDB4kArIYEDoEEcoAAkAMJEDKFBHCAZ84BB4IADoEgqQExgReWgH0YgiGJBywLC5YLARKBDT8EIGsiD4AqpIJ1Z4BhrYIXj4INCYEX5oElogEAgk1NAtDHgAhxAdCCRymBAAQBSoKDbwNB2CiDDtoC3BaBVeMBf4MVFIIMF4Fqa4ESWoBXbwEogW3ZgBT/ggDagQCkgFd8ASiAAUuFOeCBLzyBFG+AJjmBVP+CcE6BQtiAH0mAgh2ACPiBAMGAfvuDEqGDBPeCHB2ABO+BNG8CCRuBFoSCbjKDBP+CE5+ANG2AACMBrIEajAELgXQrgwBSgB4bgAG3hQGiAdCALZSAChWEAJCCFVSEcM2GAHCAa6GCLFeCCgyBBgWBCduCAXOAAV2DJiCABmyCAPSAB8iDBrkC0CiCABGCAO+AAISAAF2AABUB4IAMBoICQoIAh4JF4gLgFoAAEYAfRAIQM4MAjwHUgACPgjGlAdSFADKCHwiCAJeABm2EAP2JACaFAB6EATSCIYKGAOoBBYMK4YMMcYEA94INhYN4QoAMKIEfuYEWFAEEggAKgBokgR7JgADfhCHNgQr7gC1NgwsCgBw/iACthEPxhgHcgCshhAaQgwCcgACOggCcgwHhggDKgw8MAbyAAieARc2BGfqAcEqBAmYBCYYCcgEQg3wZAQiDW1ABBINOpoJD74I0hIAKRoI8T4IsCIUcOIYUEYIx1YEMrYMAhIMBYYUK94AxP4IJ7wHUgACtgACUBrwETBshEoIHboIBzoEjGIAv1IAx+IEvNoQAPIEktYAX84A0QoAB6IBSZYQ8YoFDwYEANYEHJQVMIgIbIoIXgIGD9oEqEYEFdAIgDIIV/oIX34se14IU8YA+jYEEIIBIMIFWRIMAbINsZIMHzoAAaYAAfIABpQMQamyDB9GANB+HAtmAQN2AFkeAAIaAAcOBACCDAt+AAMqChuKBRyiAAHaCRNkBAYICg4AB4IEK84KAvYE8noIO3oEI0YAASIE6poIOOoNIvIEBHIEArAECggImgl+igQ5egg+4A0ECSoEABYAtGoAAO4EAXYEAlIQAboEOP4IC/4ID8IM4LIEtKYQBR4EBEIE+HYIJWIAfxIEBQoAFfIMFT4MA9IAAFIEIVQIFa4QA8oAR+4UDbIUTBYEK4oAMuIIWuAMAQbqAAkeBAU+BEJCEAhyBGvEBf4I6nwIASIECxYIEioINWIQbhIMNBoMAgIEFBAEPgwJJgS/RggXIhgGkgoIfgQB8AXGABdiBDj2CAmgBS4QD6IQ4NIITv4JD+IIAnIUNpgEPgA5XASSAFa+DAF2AhreBHHGAbuWBA3yBABGABt6JAraBhVKAA62AA1KHAOsFC7YCAQmABxmBOSyCgmyCAsaABtECOwGAP0sBQYACQoAE7gRBB0GKgGbHARuALHGDDkaBHC4BCoE6ZoEEhoMBAYJ1voEK2ICGroADHoNCyIIaBYAZooF5K4IW7oGMzIQC2IAv24EET4EFjgFLgRBtgAbOgAVegSe5gAQHggE9gxotgALtggDHgh/2ghYqggcdhQAlgHDohgLzggLYgAtugRCLATuAAAeDQvqBCuYBCYJ1KoEAHQHAgwAdAsAVgweagAASAcSDABIBxIBivoARWAIKQYA7hIEEtgRGIgMbhQD3gCTwgAMlARuEAQ+CATgC0AiAATiDDESAJPqBAF6CCr2CCY2ACr2BAHqDBpCAIryAEYeBQNGCekOCB7YBL4EFDIEANYFDOIIikIMBgIIAkIEOsoIcfIQHlYEhwYIPJIAHp4AzgwIDSIcH8Y0OgokPI40AHIgH8YATp4UAXIAH8YMPgIEFqIAU+4EMeoEAC4MK7IAk7AKQIYFBcgJ0IoEWpAQvAYYIiwCmAoQIgDawgwBLAQeAAKeAAjaDCJmDAKsBB4gAq4EHeIEAj4JUAIUtQ58Aq4BY14UAYIAAq4MAYIEkJoEAq4QmF4UInwYJQRxrQWyBF7WCf1YCkB6BOnCDAIyAAA8BoIA0hYA0mYMAkoAaCoIJSYBJAocJ/40AhoIuOoQAHJYQcIwJ/QEEgAqSgzSVhAChhABqhAAVhQCrgACCgQB6gQq0gQ1jgCbRgUgggA4SgR8eBIECSRuAAXgBI4MBeIAW94AC4YANoYMAt4ECGYBEpokRN4AAfQEGhgDakgCupBE6hwFsgADHhABggQe6hgFsAQaGI9oDCUEEgVsjgAjFgAFpAR+ADLCAADuAAAsDoBwigACLhAKigTSwgQK8hAIVgwB/hytZqgIHgYAYiwFnjwCghwByhQLShgCwgRzFgBhsgiF/AqAtgUNygALeAy8BgoGGLYJ82AMvAYCBcryBAD2EAhSDXbubA2+iAiKBETCFALiAgMuEAQ2AiIqDALaBeM2DEKEFswsBCn+DBWuBBY8BIoAfEIEw7YAs9wEbghsvhAV5iwV1gI/CghzcgA6LgQcVgALygU2VgTgkg00Xgj+EgmoygIMmgStDggWEgwVxgQs4gj3SgBVJghVjgABmggTFggDEgATFgR1CggSagQJ9gAFbgQJ9gD2OjAElgAHyAQWIASWNAeKJASWNAByIASWAXOCEASUBBYAB3YMAYIGCjYQBJ4EACwELgQqGgSXyhR4ngRXehxA4hBRUgXrdgRA6gQX4gAD0gRTlgh2whQDmASKCSSaDix6DIeSCA0+CAqaAHluCAfWZA02iArKCI/mBBWCBAMCCEhuBbjSABByDAfOBG0GGD86CfFeBBraDAIqBKraBAQwELwG+FYB2H4YEs4kDRsAAlIEEeo0AlIAF/IAAJ4IBZAEFhQ83gB1chFsFgSoXjQ8zgQ4TgQBtggasjA8zgQJrgi9njwHtjAU2gHcFgyfhgVCZgA/HgQaFhgBxhAAagCs/gQAagkrKgDwQhHuAgQfQjQE3AcL6ATcB/oUBN4QPmeIBN4APrJABM4NOxIIBJgHEjgEmAcb6ASYB9oUBJoIqHeQBJoMqOo0BJoAIQYN+WYIj/4IDkYIKA4At4gFGgA1zgQWPAQiBBYqBCgOAAA+ALiGBBY8BCIQKBwL/AYCX+4MQmoEJsYEQmoGRooUMkIBNOoAMC4FKnYMNKIMOBYCNHYEAnYAOzgEEgAyugkONAQSAHRKCGyuAAWKABV+FAECCBLKBBKWBelmEMPOBABiALt6DABgBDYM9nQENgSpzgATvgQ9cghCPgAAIgj4agAuPgw1cgBraigBCggBjggBagXhbgQDtgQy3gQA/hA+tgXl3gQEpgg9Vg39uhA0ehQAVgCmLAwALg4EahIANGYKMDoQ7zoF2X4EACIVf84ApfoEACoEPggEggS+3gRYHgz0KAduAG6oEAUEWTYAru4AGs4BfxgSggAJxgCe4gQBNgzb1AQGAm8aCC9oDQSpGgUA4AgVGgV/lAwBBOYEtAYEG+YACXwML3AmCAYaBkPqAQs6CAhQBLIEr9oAG34Byv4EAD4AAA4BUXoIruoMpOYMXo4J74YJ64YMCLgJBKoAWwAJ1IoB5b4EBtYACSIEAFwFsgwg5AVyAJaiAAYiBi42BmLaABI6BAGuAAtyBYhyDFJsBT4ASTwFLgRbjgBwAAUWAZfIFIARHcnKBZFuCLJyEPNCADFuAanOALKmBArqCAs6AW2qAHU2EFgOFABOAIpmGGnCHABaBk/WAJCqEGmWHABiAHY6GNKSDLnaAHKKEgHOBARiBAAgBOIIAxoFD5IEAt4AfvoI33oIBBIBEMoEAJYE3q4KLFIE3fYEvroALx4EADYAD8YIDboIAXQFcggANgVH9gDfGgQF/hRk/ghyqgDWFAhA3gi0NhwARggBWggANgQdeg4kngTlhhBrqgn4/ggFjgBCcghjugQMTgn/Tg35DgQGEggJ8gRB6gYGUggSbAiwigjMagnvKgRyjgi+MgQJjgQEkgQDZhAAlgi3XggPbAWyDAEOAABeAY6iBAdiAAWQBBIKY/IAAkYEuKIE0KIEASIEDw4FFAIQBIAGwgARGAUGDg9SCCUGBAHCCALCAAEKBAAcCtC2BQI2CErcBtIMAGYEwFoQBe4ADUYNBOIIAkAFsgSTPgQCLgglSgQChgwBBgWkGgQq/AgVJgDrTgABhggBIgQC0AVyBBT+AACMCxC2BHueCABMCxC2CDtUBBIM0JwEBgAMkgZ9RhAFCgTZXgSIAgQL+gQGtgBpkhgD0gi8LhAAlggCygQLVggmMgEILgCo5gQBfgpJ7gwCggTnLgQHphAESgomvggFZmAESgEgVhBOsAWyDA1SFARyCAYeCBo6CAnCCP+yBBYqBMs2BG1iDATaADQEBA4ICP4MBLIGUmoMAjIIAOIUBLIAAo4QAPIABToMAWJABJIQBAYAMkoAKeIQDy4IDCIUD54EBDoAy2IIDt4QCUoFG+IAD0IMhhoAQtAFFhQO0AQaAYV6ElV6CAWODgx6DAKgBOIAFMYIMfINHdoGAO4ID7IAE6gEagzHAgwGWARqCOzWAGJmBA/yDA0qBAwGCAWGBA7KBEucBQYBa0AEDgorSAUGAQkuAHV6AJIUBi4Muz4JjnwEQgAqkgy9fghfJgGs+gRqTgZSshAVsgjkFgBo7hQJxgBT5ggN/gi+VgAAYgAANgUSGgQQ2ggANhAPVgRptg4FPggBdgWVqgwAcgjVdggAWgACQBBALC4SBHe6BADKAZCeCBEiBJ6WCBAOCA0SCXCyCANGBAiuHHWiAOaYBGIEyp4M4rIIAcwEwgh73gUB/hBGLhQAThDpohABGgACkhAf2gAS4gAANgSI8BQuECQEPgQd3gSDogRk+gR2ugiSDhwByA3RBhYJaSAEAgTcpggARgAKzAoYCgjy1gzCEgzmvgTU8hABuAVSDAriDAoyABwSCAe8BSIEABQNYdHOAgKOBS3qAAA2EAq4BNIAfAoMWcIBQpYMU04EHUIAJTIIDR4IStYQBlQEsgAB5gUUWAgNrgQdtggQrAhA6gjXFggD7gjU7ggT1g1N4ggA0gDTFgwNagTR/gQARgTTFggMWgAAFAXCABQSGCQ6SACqBjzybACKCNd2CBnaBhJqGNd2AEVyBNd2EFZ+DJUqBb16BUiSBXVmBDn+EEKyBRMCAF8QCkCOBCDCCDVyKADaCAHsBdIIA34EE34ABP4IADQKkLYEUSIEAlYFFVoABgIMD3QKAAYUeEoIV04AN6wFgggGIgRz7ggEkAUiDB7EBbIMEXwE0gBfTgQGMgCyFgQGCg0X7AVSATfeBAa6BLTmBAEmCAPaEBdeBFIqECR8DEHRzgE6AgXH3AUiCbhYBDIMByoAlXoIBx4EWIYJfWYELGIMKUoUAkYIpSYI1A4QAV4AksIA4K4ILfoM2+ocEuoQAd4IEIYAAD4FUqYQCQ4MCbIFU7oMBjoECXoEAGYIATYILMoIANYEASYQ7S5YBxogaprAAH4ML3IFSwJQBvYQ3FYMA1YcBTII3FIIBy4Kb1IFEoIQGToALSoE3GYIAwAECgzcZgQQXgjcZgwBGiATxgQAHgztQgpoMgaJtgwY4gAFgAU+AR+2HOqeEAF6CaZKEAF4BAYQ6V4GXJIE6pI0AXoI6pIQAYgEbg0YtAqAtgzpRnQBPmQCtgUaZgAdfgSH2Awu+BYARsoID4IALqYAD4oMKa4Kg0IEACYI03oIEUQFqgRSLggAdASyAA5qCBJaBB1SBEaaBlb6AGIyFBa8BcIAKVoFeh4QCR4AKY4I8vYQGL4EAHAFcgwR+ArQtgj7kgQuahAh0AUSBAAUBTIEd6YMRy4FEIoEAioABCIIG6oMQ7IAADIJD/gQgCE8bhCWjgAuDhAmAgwyeghqkghjOpQA7gBe5gA3PhAhogIXWgkb8gQJEgwV5gwFiAgRqgAcmAhA3ggASggfYAXSDADCBB9GBExCABYmEAneBCG6CAP+BQoGAHleCHDuHAzqBDQ2BAzyCBA8BWIAxKIAFnIAf7YBRFoEQJoEStYAAfoKUb4NAfoEqL4AD8gEIhAAmggDogAAFgEpLiAXCggE3ASKAUjSCA/uAHNyDAwWCGs6CAWSFHIeCHayCWIOBGjMBhYEACoQCHIE/0IUJbIMJaQHEgB9TgiMLgyUbggEJgCM+gAJlgWAGAYKCOwqBpCIBAYAADIAIhYEjHICKGIVKgIEDQoEISoI4p4Gc0YIPTII8CoAAQoGlpIECroGKCIEAB4QM74AHjIAUI4UAQQEBgp+Wg4b2gQCPgA0CgABDgRRxgAkhAwurBIAflIEAGQF8gRlHgCjfgQAMAXiDAX0CjAGFDTuECuUCLGuAAuOBGcCBBUoBA4Bh7YIFgAGQgJACggDbgAGVgAxUgAA0ggWQATiAHMmBoHWBURaABZQBB4I9k4Eq9YEu9oEE04NYIoEACoIAmgE0gB2AgQGYgx0pgQrWgF3AgQv/gwAvgBnzgk6gggAyAiALggiTgQAKgVo7hAANgANKgz4KgT34gxIwiGYwhj3/gACAggAtgQV9gT3QgAANgAHRgj4FgAv0gTEugAANgDpAgAKSgTEigAANgAnHgABQgTEWgAANgD4OgASegTEKgAANgD4RgAGDgTD+gAANghRqgQVKgQc8gBAMgg9KgC6rgT4XgAeMgSC4gz4egACfhD4egRB8g4WQgF9PgQAKgkAHgB3cAQaDRdOAETUBBoOhO4JbW4Ico4AA14IU84IeS4Ja5oBt5oMCFIAC7oMn2YAC5oBKAQEggiLrAQODTo2BAPmDAXeALCiCAAqAABSBTpcBDIBNGIBf84IDCYED5gEBgQuugS53AiIJgQLOgRlLgQAEBUkbC6ALgRwpgwlzgSoZhAlzhQl1ggIFiQlzAUWDAheBCXSAQJyAAV2AQuKCBX2RCXOCAmKaCXODB/WTCXOCCWyAApWFHAOCCHEDNgJ4hAVTgGUYgAIVgSJAgABPAWCBToiFAFABgIIA74EC3YIJoYQEdIUJpAEEgAmkgwf2gEy2hibRgh5MgAulgAH9AUGAAUODADWBAGeAVAMBIIEA2YgAbIIC3AF4gqObgwjoAQWFYMiAABiJB5GCBjeBA0KAAAmFCeiDCogBZIAP7oACT5sHx4BQvccJ7YEo3LQJ7QF4gR3fggkrhAF8gD9QgAeegACMgCjkgRsVglojgQDdgwahAaSCAPoCoC2OCa6AHeWEHbKEAiOBBQyCNMyJAh6ABZiVBc+DIGSLCcqCGiOECcsBeIQJy4MCE4IJvAFohQnZgQ5zgZHUhgl5AVyBUIeGCCoBBIUIKoCjT5oI14Kk+IAACgFohQWOggX+hAT38gnUhwm4iAlVkAmzggLUlAm2hANigQoOhgiahgoohgD6AQSCobKDAVWUAC6ABJiCqZ//ASGHASGCAgjoCouGAmG4CouBBF6AjxYDAAs/gg+agQAejxcghj/GlAAfgAAcglI2AgRAgAGUAQOAAA0CgweBN1qFP2KAENOAIiWBLjyATW2Al8aCULCOdeuFDu+BFfgBQYAjsIAAMAF/gFCoAQaCpL0CAEiAP46BE52BFj+CMuiAVRiCesqCBTGBNXiBF4mCBtyAF3qCkRUCCEmBIbwCS3KAFfOAUuKCBRCBdj8ByIAJjYFUz4MAcINePYNXjIEFY4KaDQJBKoEQioABX4IWuQRC//+BgmzZAVSAAAwDgICCgFF3ATeAW8SATlOBAWaACXmCVmiCFoOBAAyBWtqBCt2DVJiBAHWBI8+CAOSAAHeBVUSEABaBT4aJABmCAseCABcBTIcAF4JCFIAAHQHEgR6TgABegFkbgDjKgAAJAZyEMQgBKIEAD4AYXoQAMIEEgIFkuIAARgGcgSwPAQKAXrGAe+eDFRQBOIJXqYAE84QACAFEgks1gpMgg0Q6gAGRAYCCZ2yAQRSAeNaCB/2BAH4BiIEjhIALRQGEgQCOgCoZgGkkggpUATaCRV2BQzUBbIAFngE2gAQbg5DfAhA0ggHdgACMgBN2incXgACngY9Wg19ShRIZg0G7gAUngRpRgQokgWVJg0G9BEE5QSqBJY+AAdSCp0+CK4mBAv6DS0qCNWeDUoqACpeAS++BAGaAE6ODCCuEQ/oGQYgRNgK4gI+lgAALgB8IgBRvgo+xgHpvAayDABWACJaAALyBABUB4IAAFQGggwAVgAijgADfgQAVAX6CeBOAKpCDAL2BAK4BLIAGIoRbhIVEKIIoEgFEgDgahDK+ghZehQuBhkQhgiqgAiA3gQbcgQCrgG1ihQAShEQ3AUiDAReAMFsCDGyAGOQClCCBCVoBNoALK4EDbwJBkIQADwGMgwAPAZKEAA8BgIMADwGWhAAPAXyBDmACC0ODGVyBWjCXGVyCDWuBOE2CGVyBAAqAATmAeSgBSYIEGgMLC+OAjWKAAhQEC6EEaYCzYAVmZmljaYCy5QEgg7TZEwAxLjMuMS4xLW1vdGxleQBpbnaAs20VZCBsaXRlcmFsL2xlbmd0aHMgc2V0hgAcBWNvZGUgiQAZD3Vua25vd24gaGVhZGVyIICz0wFniwAyAmRpgLN3AW6AtAmKABYDYml0hABHECByZXBlYXQAdG9vIG1hbnmFABcHc3ltYm9sc44AGAJvcoYAU4YAJIUAVoKz9IAAXYC0QAFrhQCmAgBigAD4gACaDGVycm9yAHN0cmVhbYQADYoA1QstLSBtaXNzaW5nIIC0pwQtb2YtggBHgAAlAmNvgLQtAmN0hQDjA2NoZYoAF4QAmI0AFwRkYXRhhgAViwELASCBANQFZmFyIGKAtJABAIUAVwJyY4EAgQVtYXRjaIYAMgF3gLT0BG93IHOBtQOGATuCAN4DdHlwhwATiwGyggDQjwB1ggAWhQGvBGNvbXCAtSQBc4C06YACDgR0aG9kgDInEwwLpQIDAAQABQAGAAcACAAJAAqAKQcNDQAPABEAEwAXABsAH4CVbhYrADMAOwBDAFMAYwBzAIMAowDDAOMAgAY4ggABAYCMAAIBgYQAAgGChAACAYOEAAIBhIQAAgGFhAACBZAASQDIghjMgK1JggCEAQeAAIABDYAAegEZgCkpATGAA4wBYYAARgHBgEjqAYGBSOyAQBYEAQYBCIApDAMQARiABbwJMAFAAWABgAHAiQB4hQBwhQBoAYaAAAIBh4AAAgGIgAACAYmAAAIBioAAAgGLgAACAYyAAAIBjYAAAgGOgAACARCAAHIBEoAAiAEIggCAAQaAAQIBBYABBAMEAAyAAJaAHJwCAA6AAKIBD4CwMwQOC7cMtQEsgBzVggABARCMAAIBEYQAAgEShAACAROEAAIBFIQAAgEVhAACARDAASyJAICFAHSFAGyBAGQBFoAAAgEXgAACARiAAAIBGYAAAgEagAACARuAAAIBHIAAAgEdgAACAUCAAAIGoAgAAKANgACIgADQAR6AAAQBD4AAVAEggAAQAiAOgwDgAR6AAASBABSBAAEBoIQAFAETgAAEAQeEABQBDIABOAGMgAAEAUyAAAQBzIAABAEsgAAEAayAAAQBbIAABAHsgAAEARyAAAQBnIAABAFcgAAEAdyAAAQBPIAABAG8gAAEAXyAAAQB/IAABAECgAAEAYKAAAQBQoAABAHCgAAEASKAAAQBooAABAFigAAEAeKAAAQBEoAABAGSgAAEAVKAAAQB0oAABAEygAAEAbKAAAQBcoAABAHygAAEAQqAAAQBioAABAFKgAAEAcqAAAQBKoAABAGqgAAEAWqAAAQB6oAABAEagAAEAZqAAAQBWoAABAHagAAEgHm4AgC6gAAEAXqAAAQB+oAABAEGgAAEAYaAAAQBRoAABAHGgAAEASaAAAQBpoAABAFmgAAEAeaAAAQBFoAABAGWgAAEAVaAAAQB1oAABAE2gAAEAbaAAAQBdoAABAH2gAAEAQ6AAAQBjoAABAFOgAAEAc6AAAQBLoAABAGugAAEAW6AAAQB7oAABAEegAAEAZ6AAAQBXoAABAHegAAEAT6AAAQBvoAABAF+gAAEAf6AAAQBAYAABAGBgAAEAUGAAAQBwYAABAEhgAAEAaGAAAQBYYAABAHhgAAEARGAAAQBkYAABAFRgAAEAdGAAAQBMYAABAGxgAAEAXGAAAQB8YAABAEJgAAEAYmAAAQBSYAABAHJgAAEASmAAAQBqYAABAFpgAAEAemAAAQBGYAABAGZgAAEAVmAAAQB2YAABAE5gAAEAbmAAAQBeYAABAH5gAAEAQWAAAQBhYAABAFFgAAEAcWAAAQBJYAABAGlgAAEAWWAAAQB5YAABAEVgAAEAZWAAAQBVYAABAHVgAAEATWAAAQBtYAABAF1gAAEAfWAAAQBDYAABAGNgAAEAU2AAAQBzYAABIARMwIArYAABAFtgAAEAe2AAAQBHYAABAGdgAAEAV2AAAQB3YAABAE9gAAEAb2AAAQBfYAABAH9gAAEAROAAMIFEwEJAJOAAAgBk4AACAFTgAAIAVOAAAgB04AACAHTgAAIATOAAAgBM4AACAGzgAAIAbOAAAgBc4AACAFzgAAIAfOAAAgB84AACAELgAAIgBDagAQCgAAEgAAIAUuAAAgBS4AACAHLgAAIAcuAAAgBK4AACAErgAAIAauAAAgBq4AACAFrgAAIAWuAAAgB64AACAHrgAAIARuAAAgBG4AACAGbgAAIAZuAAAgBW4AACAFbgAAIAduAAAgB24AACAE7gAAIATuAAAgBu4AACAG7gAAIAXuAAAgBe4AACAH7gAAIAfuAAAiBA7YBB4AACAGHgAAIAYeAAAgBR4AACAFHgAAIAceAAAgBx4AACAEngAAIASeAAAgBp4AACAGngAAIAWeAAAgBZ4AACAHngAAIAeeAAAgBF4AACAEXgAAIAZeAAAgBl4AACAFXgAAIAVeAAAgB14AACAHXgAAIATeAAAgBN4AACAG3gAAIAbeAAAgBd4AACAF3gAAIAfeAAAgB94AACAEPgAAIAQ+AAAgBj4AACAGPgAAIAU+AAAgBT4AACAHPgAAIAc+AAAgBL4AACAEvgAAIAa+AAAgBr4AACAFvgAAIAW+AAAgB74AACAHvgAAIAR+AAAgBH4AACAGfgAAIAZ+AAAgBX4AACAFfgAAIAd+AAAgB34AACAE/gAAIAT+AAAgBv4AACAG/gAAIAX+AAAgBf4AACAH/gAAIAf+AAAiBBAoBQIAABAEggAAEAWCAAAQBEIAABAFQgAAEATCAAAQBcIIFVgMHAEiAAAQBKIAABAFogAAEARiAAAQBWIAABAE4gAAEAXiAAAQBBIAABAFEgAAEASSAAAQBZIAABAEUgAAEAVSAAAQBNIAABAF0gAAEAQOAAEIBg4AABAFDgAAEAcOAAAQBI4AABAGjgAAEAWOAAAQB44AABIC+K4AAdIECxgEFgABcAQWCBUoBFIAABAEMgAAEARyAAASAvlaABEQBBYIGBAEaggXqAQWAA9QBBYADuAEFgAOcgE92gAAEARGAAAQBCYAABAEZgAAEgQACARWAAAQBDYAABAEdgAAEgL59gAKkgQZAAQWAAiyBBaYBBYABtAEFgD3fAxsLTYMfuYcABIC+rooABIEHUYkABAEEjAAEAQWKAAQEQbAcC4C9CosAS40AO4UALwEGhAAEgQWIgQAEgQEKgQAEgQGSgQAEgIS2ggAEAQuEAAQBDIQABIAF24FHeQTgHQsjhQBfhQXLAhARgAVtBgcJBgoFC4A6uAQNAg4BgAclBJQeC2mFAJCFAIiFAICFAHiBAGiBAFyBBh8BEIAABAEUgAAEARiAAAQBHIAABAEggAAEASiAAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Ae,Gt,Ue,cn;function up(n){if(Ae=n,{malloc:Gt,free:Ue,memory:cn}=Ae,typeof Gt!="function"||typeof Ue!="function"||!cn)throw Ae=Gt=Ue=cn=null,new Error("Invalid WASM module")}function Fr(n,e,t={}){const i=typeof t.level=="number"?t.level:-1,s=typeof t.outBuffer=="number"?t.outBuffer:64*1024,r=typeof t.inBufferSize=="number"?t.inBufferSize:64*1024;return new TransformStream({start(){let a;if(this.out=Gt(s),this.in=Gt(r),this.inBufferSize=r,this._scratch=new Uint8Array(s),n?(this._process=Ae.deflate_process,this._last_consumed=Ae.deflate_last_consumed,this._end=Ae.deflate_end,this.streamHandle=Ae.deflate_new(),e==="gzip"?a=Ae.deflate_init_gzip(this.streamHandle,i):e==="deflate-raw"?a=Ae.deflate_init_raw(this.streamHandle,i):a=Ae.deflate_init(this.streamHandle,i)):e==="deflate64-raw"?(this._process=Ae.inflate9_process,this._last_consumed=Ae.inflate9_last_consumed,this._end=Ae.inflate9_end,this.streamHandle=Ae.inflate9_new(),a=Ae.inflate9_init_raw(this.streamHandle)):(this._process=Ae.inflate_process,this._last_consumed=Ae.inflate_last_consumed,this._end=Ae.inflate_end,this.streamHandle=Ae.inflate_new(),e==="deflate-raw"?a=Ae.inflate_init_raw(this.streamHandle):e==="gzip"?a=Ae.inflate_init_gzip(this.streamHandle):a=Ae.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)},transform(a,c){try{const l=a,d=new Uint8Array(cn.buffer),h=this._process,f=this._last_consumed,p=this.out,u=this._scratch;let m=0;for(;m<l.length;){const E=Math.min(l.length-m,32768);(!this.in||this.inBufferSize<E)&&(this.in&&Ue&&Ue(this.in),this.in=Gt(E),this.inBufferSize=E),d.set(l.subarray(m,m+E),this.in);const A=h(this.streamHandle,this.in,E,p,s,0),b=A&16777215;if(b&&(u.set(d.subarray(p,p+b),0),c.enqueue(u.slice(0,b))),!n){const I=A>>24&255,D=I&128?I-256:I;if(D<0)throw new Error("process error:"+D)}const w=f(this.streamHandle);if(w===0)break;m+=w}}catch(l){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Ue&&Ue(this.in),this.out&&Ue&&Ue(this.out),c.error(l)}},flush(a){try{const c=new Uint8Array(cn.buffer),l=this._process,d=this.out,h=this._scratch;for(;;){const f=l(this.streamHandle,0,0,d,s,4),p=f&16777215,u=f>>24&255;if(!n){const m=u&128?u-256:u;if(m<0)throw new Error("process error:"+m)}if(p&&(h.set(c.subarray(d,d+p),0),a.enqueue(h.slice(0,p))),u===1||p===0)break}}catch(c){a.error(c)}finally{if(this._end&&this.streamHandle){const c=this._end(this.streamHandle);c!==0&&a.error(new Error("end error:"+c))}this.in&&Ue&&Ue(this.in),this.out&&Ue&&Ue(this.out)}}})}class hp{constructor(e="deflate",t){return Fr(!0,e,t)}}class fp{constructor(e="deflate",t){return Fr(!1,e,t)}}let Rr=!1;async function pp(n,{baseURI:e}){if(!Rr){let t,i;try{try{i=new URL(n,e)}catch{}t=await(await fetch(i)).arrayBuffer()}catch(r){if(n.startsWith("data:application/wasm;base64,"))t=mp(n);else throw r}const s=await WebAssembly.instantiate(t);up(s.instance.exports),Rr=!0}}function mp(n){const e=n.split(",")[1],t=atob(e),i=t.length,s=new Uint8Array(i);for(let r=0;r<i;++r)s[r]=t.charCodeAt(r);return s.buffer}let os;dp(Qn),of({initModule:n=>{if(!os){let{wasmURI:e}=n;typeof e==It&&(e=e()),os=pp(e,n)}return os}}),Qn({CompressionStreamZlib:hp,DecompressionStreamZlib:fp});const rs={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const n={};for(const e of Object.keys(rs))for(const t of Object.keys(rs[e])){const i=rs[e][t];if(typeof i=="string")n[i]=e+"/"+t;else for(let s=0;s<i.length;s++)n[i[s]]=e+"/"+t}return n})(),Bh(Qn);const gp="E84#E3C4!8C4&A1";async function ot(n){try{const e=await fetch(n);if(!e.ok)return!1;const t=await e.blob();try{const i=new Tr(new es(t),{password:gp}),r=(await i.getEntries()).find(c=>!c.directory&&c.filename.endsWith(".json"));if(!r)return await i.close(),!1;const a=await r.getData(new Cf);return await i.close(),JSON.parse(a.trim())}catch{const i=await t.text();try{return JSON.parse(i.trim())}catch(s){throw console.error(`[loadModelFile] JSON parse error: ${n}`,s),s}}}catch(e){return console.error("[loadModelFile] 加载失败",`${n} ${e}`),!1}}function Ap(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}class jn{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(i=>i(...t))}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(i=>i!==t))}}class Lr{cesium;viewer;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new jn;options={flyTo:!0,flyToDuration:0,loadTreeNodeDetails:!0,loadTreeNodeDetailsUrl:"/elementInfo.zip",loadTree:!0,loadTreeUrl:"/allElementsInfo.zip",boxRegionUrl:"/BoundingBoxInfo.zip",regionUrl:"/region.zip",batchIDInfoUrl:"/batchIDInfo.zip",enabledSection:!0,delay:0,tilesetOptions:{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:32,skipLevelOfDetail:!0,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:128,skipLevels:5,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*10,preloadWhenHidden:!0,preferLeaves:!0,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.options.tilesetOptions&&(this.options.tilesetOptions.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE)}deleteAllModels(){const e=[];return Object.keys(this.mapTileset).forEach(t=>{const i=this.mapTileset[t];i&&(this.viewer.scene.primitives.remove(i),e.push(t)),delete this.mapTileset[t],delete this.hasLoaded3dTiles[t],delete this.mapRecordModelId[t]}),this.modelList=[],this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:[]}),e}deleteModels(e){const t=[];return e.forEach(({modelId:i})=>{const s=this.mapTileset[i];s&&(this.viewer.scene.primitives.remove(s),t.push(i)),delete this.mapTileset[i],delete this.hasLoaded3dTiles[i],delete this.mapRecordModelId[i]}),this.modelList=this.modelList.filter(i=>!t.includes(i.modelId)),this.viewer.scene.requestRender(),this.events.emit("updateModels",{modelList:this.modelList}),t}showModels(e){const t=[];return e.forEach(i=>{const s=`${i.modelId}`,r=this.mapTileset[s];r&&(r.show=!!i.show,t.push(s))}),t.length&&this.viewer.scene.requestRender(),t}async addModels({files:e,fileNames:t,options:i}){const s=e||t||[];s.length>0&&await this.add3DTilesModel(s,i)}async add3DTilesModel(e,t){const i=t?Vu({},this.options,t):{...this.options};if(e?.length){for(const s of e){const r=`${s.modelId}`;if(this.mapRecordModelId[r])continue;const a=`${s.outPutPath}${s.dbName}/tileset.json`;this.modelList.push({...s,url:a,state:Ut.NotLoaded}),this.mapRecordModelId[r]=!1}await this.load3DTilesModel(i)}}async load3DTilesModel(e){const t=this.modelList.filter(a=>a.state===Ut.NotLoaded);if(!t.length)return;const i=t.length;this.events.emit("loadingStatus",`正在加载 ${i} 个模型`);let s=0,r=!1;for(const a of t){s++;try{a.state=Ut.Loading;const c=a.url,l=this.getBaseUrlPath(c);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${a.modelName}构件信息`);let d=e.loadTreeNodeDetails?await ot(`${l}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${a.modelName}目录树`);const h=e.loadTree?await ot(`${l}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${i} 个模型: 加载${a.modelName}模型数据`);const f=e.boxRegionUrl?await ot(`${l}${e.boxRegionUrl}`):!1,p=e.batchIDInfoUrl?await ot(`${l}${e.batchIDInfoUrl}`):!1;p&&(d||(d=p));const u=await this.loadTilesetWithZipSupport(c,a.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(u),await u.readyPromise;const m=`${u?.asset?.tilesetVersion??a.modelId}`;this.mapTileset[`${a.modelId}`]=u;const E={versionId:m,selectedFn:e.selectedFn,model:{modelId:a.modelId,modelName:a.modelName,dbName:a.dbName,fileType:a.fileType,outPutPath:a.outPutPath,url:a.url,treeUrl:`${l}${e.loadTreeUrl}`,nodeUrl:`${l}${e.loadTreeNodeDetailsUrl}`,formData:a.formData,type:"BIM"},node:d||null,tree:h||null,box:null};if(f?.min&&f?.max){const A={x:f.min.X,y:f.min.Y,z:f.min.Z},b={x:f.max.X,y:f.max.Y,z:f.max.Z},w={x:(A.x+b.x)/2,y:(A.y+b.y)/2,z:(A.z+b.z)/2};E.box={min:A,max:b,center:w}}if(!a.formData){const A=await ot(`${a.outPutPath}${a.dbName}${e.regionUrl}`);if(A)a.formData={modelId:a.modelId.toString(),longitude:A.Longitude,latitude:A.Latitude,distance:1e-6,rotation:30,totalRotation:A.DAngle||0,height:A.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:a.modelId.toString(),label:a.modelName}],X:A?.X||0,Y:A?.Y||0,Z:A?.Z||0};else{const b=t.indexOf(a);a.formData={modelId:a.modelId.toString(),longitude:118.12548706388897,latitude:24.596796919444404,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:0,lonlat:1e-5,modelOptions:[{value:b+1,label:a.modelName}],X:0,Y:0,Z:0}}}a.formData&&(a.formData.heightDistance=a.formData.heightDistance??1,E.model.formData=a.formData),u.leiting=E,_i({Cesium:this.cesium,tileset:u}),a.state=Ut.Loaded,this.mapRecordModelId[a.modelId]=!0,this.events.emit("tilesetLoaded",u),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(u),!r&&e.flyTo&&(this.BIMmodelId=a.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),r=!0),e.delay&&await new Promise(A=>setTimeout(A,e.delay))}catch(c){console.error(`模型 ${a.modelName} 加载失败:`,c),this.events.emit("loadingStatus",`模型 ${a.modelName} 加载失败`),a.state=Ut.Error}}e.mountAll3Dtiles&&e.mountAll3Dtiles(this.modelList),e.onMountAll3Dtiles&&e.onMountAll3Dtiles(this.modelList),this.events.emit("loadingStatus",""),this.events.emit("mountAll3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset})}async addOSGB({files:e,options:t}){const i=this.cesium;if(!e?.length)return;this.events.emit("loadingStatus",`正在加载 ${e.length} 个倾斜摄影模型`);let s=!1,r=0;for(const a of e){r++,this.events.emit("loadingStatus",`正在加载第 ${r}/${e.length} 个模型: 加载${a.modelName}`);try{const{outPutPath:c,dbName:l,modelId:d}=a,h=`${c}${l}/tileset.json`,f=await i.Cesium3DTileset.fromUrl(h,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(f.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(f),await f.readyPromise,this.mapTileset[`${d}`]=f,this.hasLoaded3dTiles[`${d}`]=(this.hasLoaded3dTiles[`${d}`]||0)+1,this.mapRecordModelId[`${d}`]=!0,!a?.formData){const p=f.root.computedTransform;if(p){const u=i.Matrix4.fromColumnMajorArray(p),m=i.Matrix4.getTranslation(u,new i.Cartesian3),E=i.Ellipsoid.WGS84.cartesianToCartographic(m),A=i.Math.toDegrees(E.longitude),b=i.Math.toDegrees(E.latitude),w=E.height;a.formData={modelId:a.modelId.toString(),longitude:A,latitude:b,distance:1e-5,rotation:0,totalRotation:0,heightDistance:1,height:w,lonlat:1e-5,modelOptions:[{value:a.modelId.toString(),label:a.modelName}],X:0,Y:0,Z:0}}else console.warn(`OSGB模型 ${d} 无法获取初始位置信息`)}a.formData&&(a.formData.heightDistance=a.formData.heightDistance??1),f.leiting={versionId:`${f?.asset?.tilesetVersion??d}`,selectedFn:t?.selectedFn,model:{modelId:a.modelId,modelName:a.modelName,dbName:a.dbName,fileType:a.fileType,outPutPath:a.outPutPath,url:h,formData:a.formData,type:"OSGB"},box:null},_i({Cesium:this.cesium,tileset:f}),this.modelList.push({...a,url:h,state:Ut.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=a.modelId,this.viewer.zoomTo(f),s=!0)}catch(c){console.error(`OSGB模型 ${a.dbName} 加载失败:`,c);continue}}this.events.emit("loadingStatus",""),this.events.emit("onMountAllOsgb3Dtiles",{modelList:this.modelList,mapTileset:this.mapTileset}),t?.onMountAllOsgb3Dtiles(this.modelList)}updateOSGBMatrix(e){const{X:t,Y:i,Z:s,modelId:r}=e,a=this.cesium,c=this.mapTileset[r];if(!c){console.warn("tileSet not found for modelId:",r);return}let l=t||0,d=i||0,h=s||0;const f=c.boundingSphere.center,p=a.Transforms.eastNorthUpToFixedFrame(f),u=new a.Cartesian3(l,d,h),m=a.Matrix4.multiplyByPoint(p,u,new a.Cartesian3(0,0,0)),E=a.Cartesian3.subtract(m,f,new a.Cartesian3);c.modelMatrix=a.Matrix4.fromTranslation(E)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:r,cancel:a,...c}=t,l={duration:0,...c};this.viewer.flyTo(s,l).then(d=>{d?r&&r():a&&a()}).catch(d=>{a&&a(),console.error("FlyTo error",d)})}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=e.lastIndexOf("/");return t===-1?".":e.substr(0,t)}async loadTilesetWithZipSupport(e,t,i,s){try{const r=`${this.getBaseUrlPath(e)}/tileset.zip`;if((await fetch(r,{method:"HEAD"})).status===200){const l=await ot(r);if(l){const d=new Blob([JSON.stringify(l)],{type:"application/json"}),h=URL.createObjectURL(d);class f{getURL(A){return A.includes("blob://")?A.replace(/blob:\/\//g,u):A}}const p=new f,u=this.getBaseUrlPath(e),m=new s.Resource({url:h,proxy:p});try{return await s.Cesium3DTileset.fromUrl(m,{id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}}return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}catch{return await s.Cesium3DTileset.fromUrl(e,{url:e,id:t,...i})}}async loadTreeForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting.tree)return t.leiting.tree;const i=t.leiting.model?.modelName||e,s=t.leiting.model?.treeUrl;if(!t.leiting.model?.dbName&&!s)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${i} 目录树...`);try{if(s){const a=await ot(s);if(a)return t.leiting.tree=a,a}}catch(a){console.error(`Failed to load tree for model ${e}:`,a)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async _loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const r=await ot(i);if(r)return r.batchIdEIDInfos||(r.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=r,r}catch(r){console.error(`Failed to load node details for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}async loadNodeDetailsForModel(e){const t=this.mapTileset[e];if(!t||!t.leiting)return null;if(t.leiting?.node?.nodeExtras)return t.leiting.node;const i=t.leiting.model?.nodeUrl,s=t.leiting.model?.modelName||e;if(!i)return null;this.lazyLoadingCount++,this.events.emit("loadingStatus",`正在加载 ${s} 构件详情...`);try{const r=await ot(i);if(r)return r.batchIdEIDInfos||(r.batchIdEIDInfos=t.leiting.node.batchIdEIDInfos),t.leiting.node=r,r}catch(r){console.error(`Failed to load node details for model ${e}:`,r)}finally{this.lazyLoadingCount--,this.lazyLoadingCount<=0&&(this.lazyLoadingCount=0,this.events.emit("loadingStatus",""))}return null}}const Or={normal:0,process:2},yp={color:1};function Ur(n){return n===1||n==="exist"?1:n===2||n==="process"?2:0}function Ht(n){return Number.isNaN(n)?0:n<=1?Math.min(Math.max(n,0),1):Math.min(Math.max(n/255,0),1)}function _r(n){return Number.isNaN(n)?1:n<=1?Math.min(Math.max(n,0),1):1}function as(n){if(!n)return null;const e=Number(n.r),t=Number(n.g),i=Number(n.b),s=n.a===void 0?1:Number(n.a);if([e,t,i,s].some(l=>Number.isNaN(l)))return null;const r=Math.round(e*255),a=Math.round(t*255),c=Math.round(i*255);return`rgba(${r},${a},${c},${s})`}function Cp(n){if(!n||typeof n!="string")return null;const t=n.replace(/\s+/g,"").match(/^rgba?\((\d+),(\d+),(\d+)(?:,([0-9.]+))?\)$/i);if(!t)return null;const i=Number(t[1]),s=Number(t[2]),r=Number(t[3]),a=t[4]===void 0?1:Number(t[4]);return[i,s,r,a].some(c=>Number.isNaN(c))?null:{r:Math.min(Math.max(i/255,0),1),g:Math.min(Math.max(s/255,0),1),b:Math.min(Math.max(r/255,0),1),a:Math.min(Math.max(a,0),1)}}function Ep(n){if(n==null)return null;const e=Number(n);return Number.isNaN(e)?null:e}function bp(n){const e=n.lastIndexOf("-"),t=n.substring(0,e),i=n.substring(e+1);return[t,i]}function ls(n){if(!n)return null;const e=n.Min??n.min,t=n.Max??n.max;if(!e||!t)return null;const i=Number(e.x??e.X),s=Number(e.y??e.Y),r=Number(e.z??e.Z),a=Number(t.x??t.X),c=Number(t.y??t.Y),l=Number(t.z??t.Z);return[i,s,r,a,c,l].some(d=>Number.isNaN(d))?null:{min:{x:i,y:s,z:r},max:{x:a,y:c,z:l}}}function dn(n,e){if(e)return`${e}`;const t=n?.leiting?.model?.modelId??n?.modelId??n?.id;return t==null?null:`${t}`}function wp(n,e){if(e==null)return null;const t=n?.leiting?.node;if(!t)return null;const i=`${e}`,s=t?.[i],r=ls(s?.box3??s?.box);if(r)return r;const a=t?.element?.[i]??t?.elements?.[i]??t?.nodeExtras?.element?.[i]??t?.nodeExtras?.elements?.[i];return ls(a?.box3??a?.box)}function vp(n){const e=n?.leiting?.box;return e?ls({min:e.min,max:e.max}):null}class Ip{base;constructor(e){this.base=e}initTime(){const t=this.base.cesium.JulianDate.fromDate(new Date(2023,3,21,10,0));this.base.viewer.clock.currentTime=t,this.base.start=this.base.viewer.clock.currentTime.secondsOfDay*1e3}processAnimation(e,t,i,s=null){if(this.base.start==null)return;const r=this.base.start+(e?.delay??0),a=this.base.start+(e?.playtime??0)+(e?.delay??0);t<=r&&(e.cash=!0,e.groupData.forEach(c=>{const{batchIds:l,modelId:d,rgba:h}=c;if(Array.isArray(l)&&l[0]){l[0][1]=h;const f=i[d];f?f.push(l[0]):i[d]=[l[0]]}})),t>=r&&t<a&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(c=>{const{batchIds:l,playTimeColor:d,modelId:h}=c;if(Array.isArray(l)&&l[0]){l[0][1]=d;const f=i[h];f?f.push(l[0]):i[h]=[l[0]]}})),t>=a&&(e.finished=!0)}onTick=e=>{if(!this.base.cesium||!this.base.viewer)return;const t=e?.currentTime?.secondsOfDay?e.currentTime.secondsOfDay*1e3:this.base.viewer.clock.currentTime.secondsOfDay*1e3,i={};Array.isArray(this.base.data)&&this.base.data.forEach(r=>{this.processAnimation(r,t,i,.1)});const s=Object.entries(i);if(s.forEach(([r,a])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:a})}),Object.keys(this.base.mapAnimations).forEach(r=>{const a=this.base.mapAnimations[r];a.length&&a.every(c=>c.finished)&&!this.base.clearedModelIds.has(r)&&(this.base.setTileSyltByConstructionProcessTracking({modelId:r,batchIds:[]}),this.base.clearedModelIds.add(r))}),this.base.recoverStaus){s.length&&(this.base.recoverStaus=!1);return}s.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(r=>{r.groupData.forEach(a=>{const{modelId:c}=a;this.base.setTileSyltByConstructionProcessTracking({modelId:c,batchIds:[]})}),this.base.recoverStaus=!0})};enableConstructionProgressTracking(){this.base.clearedModelIds.clear(),this.initTime(),this.base.groupBatchIds={},Array.isArray(this.base.data)&&(this.base.data.forEach(e=>{e.cash=!1,e.playCash=!1,e.groupData.forEach(t=>{const{batchIds:i,modelId:s,rgba:r}=t;if(Array.isArray(i)&&i[0]){i[0][1]=r;const a=this.base.groupBatchIds[s];a?a.push(i[0]):this.base.groupBatchIds[s]=[i[0]]}})}),Object.entries(this.base.groupBatchIds).forEach(([e,t])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t})})),this.base.viewer.clock.onTick.addEventListener(this.onTick)}disableConstructionProgressTracking(){this.base.viewer.clock.onTick.removeEventListener(this.onTick),this.base.viewer.scene.ambientLightIntensity=1,Array.isArray(this.base.data)&&this.base.data.forEach(e=>{e.cash=!0,e.playCash=!0,e.groupData.forEach(t=>{const{modelId:i}=t,s=[];this.base.setTileSyltByConstructionProcessTracking({modelId:i,batchIds:s})})}),this.base.start=null}freshConstructionProgressTracking(){const e=this.base.viewer.clock.currentTime.secondsOfDay*1e3,t={};Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.playCash=!1,this.processAnimation(s,e,t)});const i=Object.entries(t);i.forEach(([s,r])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:s,batchIds:r})}),i.length===0&&Array.isArray(this.base.data)&&this.base.data.forEach(s=>{s.groupData.forEach(r=>{const{modelId:a}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:a,batchIds:[]})})})}reStartAnimation(){let e={};this.base.clearedModelIds.clear(),Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData.forEach(i=>{const{batchIds:s,modelId:r,rgba:a}=i;if(Array.isArray(s)&&s[0]){s[0][1]=a;const c=e[r];c?c.push(s[0]):e[r]=[s[0]]}})}),Object.entries(e).forEach(([t,i])=>{this.base.setTileSyltByConstructionProcessTracking({modelId:t,batchIds:i})}),this.initTime()}setAllConstructionProgressTracking(e){this.base.data=e,Array.isArray(this.base.data)&&this.base.data.forEach(t=>{t.cash=!1,t.playCash=!1,t.groupData=[],t.finished=!1,t.mergeCpts.forEach(i=>{const s=[];i.cpts.forEach(l=>{s.push({dbName:i.linkModelId,modelId:i.modelId,elementId:`${l}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const r=Or.process,a=yp.color,{allElements:c}=this.base.groupByModelId(s);this.base.mapAnimations[i.modelId]=this.base.mapAnimations[i.modelId]||[],this.base.mapAnimations[i.modelId].push(t),Object.entries(c).forEach(([l,d])=>{const[h,f]=bp(l),p=this.base.getTileSyltByConstructionProcessTracking({elementIds:d,modelId:h,color:f,colorRank:r,show:!0,selectionRank:a}),u=t?.playTimeColor?.r??1,m=t?.playTimeColor?.g??1,E=t?.playTimeColor?.b??0,A=t?.playTimeColor?.a??.1,b=this.base.setColor({r:u,g:m,b:E,a:A}),w=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:p,playTimeColor:b,rgba:w})})})})}}class Bp{base;constructor(e){this.base=e}attachTileset(e,t,i){const s=this.base.cesium;this.base.handler||(this.base.handler=new s.ScreenSpaceEventHandler(this.base.viewer.scene.canvas));const r=dn(e,i);r&&(this.base.tilesetMap[r]=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=>{let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){await this.base.clearSelection();const s=dn(i.tileset);if(!s||!this.base.tilesetMap[s])return;const r=this.base.getFeatureId(i);if(r==="-1")return;let a;const c=this.base.viewer.scene.pickPosition(t.position);if(e.defined(c)){const h=e.Cartographic.fromCartesian(c),f=e.Math.toDegrees(h.longitude),p=e.Math.toDegrees(h.latitude),u=h.height;a=[f,p,u]}const d=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...d,{batchId:r,selectedColor:this.base.selectedColor,rank:0,point:a,isTrigger:!0}],this.base.setBaseStyle(s),await this.base.triggerSelectionChange(s),i.tileset.leiting?.selectedFn)if(i.tileset.leiting.node){const h=i.tileset.leiting.node.batchIdEIDInfos[r].elementID,f=i.tileset.leiting.node.nodeExtras.element[h];f.elementId=h,f.modelId=i.tileset.leiting.model.modelId,i.tileset.leiting.selectedFn({elementInfo:f,elementId:h,point:a,modelId:i.tileset.leiting.model.modelId,_propsData:f})}else i.tileset.leiting.selectedFn(null)}else await this.base.clearSelection()},e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.setInputAction(async t=>{let i;try{i=this.base.viewer.scene.pick(t.position)}catch{}if(e.defined(i)&&i instanceof e.Cesium3DTileFeature){const s=dn(i.tileset);if(!s||!this.base.tilesetMap[s])return;const r=this.base.getFeatureId(i);if(r==="-1")return;let a;const c=this.base.viewer.scene.pickPosition(t.position);if(e.defined(c)){const l=e.Cartographic.fromCartesian(c),d=e.Math.toDegrees(l.longitude),h=e.Math.toDegrees(l.latitude),f=l.height;a=[d,h,f]}await this.base.toggleMultiSelect(s,r,this.base.selectedColor,a)}},e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{this.base.ensureSelectionDiv();const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState===null&&(this.base.cameraControllerState={enableRotate:i.enableRotate,enableTilt:i.enableTilt,enableLook:i.enableLook},i.enableRotate=!1,i.enableTilt=!1,i.enableLook=!1),this.base.selectStart=this.base.cesium.Cartesian2.clone(t.position),this.base.selectEnd=null,this.base.selectionDiv&&this.base.selectStart&&(this.base.selectionDiv.style.left=`${this.base.selectStart.x}px`,this.base.selectionDiv.style.top=`${this.base.selectStart.y}px`,this.base.selectionDiv.style.width="0px",this.base.selectionDiv.style.height="0px",this.base.selectionDiv.style.display="block")},e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(t=>{if(!this.base.selectStart||!this.base.selectionDiv)return;const i=performance.now();if(i-this.base.lastDrawTime<20)return;this.base.lastDrawTime=i,this.base.selectEnd=this.base.cesium.Cartesian2.clone(t.endPosition);const s=Math.min(this.base.selectStart.x,this.base.selectEnd.x),r=Math.min(this.base.selectStart.y,this.base.selectEnd.y),a=Math.abs(this.base.selectStart.x-this.base.selectEnd.x),c=Math.abs(this.base.selectStart.y-this.base.selectEnd.y);this.base.selectionDiv.style.left=`${s}px`,this.base.selectionDiv.style.top=`${r}px`,this.base.selectionDiv.style.width=`${a}px`,this.base.selectionDiv.style.height=`${c}px`,this.base.selectionDiv.style.backgroundColor="rgba(0, 255, 255, 0.5)",this.base.selectionDiv.style.position="absolute",this.base.selectionDiv.style.zIndex="2"},e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.setInputAction(async()=>{if(!this.base.selectStart||!this.base.selectionDiv)return;if(!this.base.selectStart||!this.base.selectEnd){this.base.selectionDiv.style.display="none";const i=this.base.viewer?.scene?.screenSpaceCameraController;i&&this.base.cameraControllerState!==null&&(i.enableRotate=this.base.cameraControllerState.enableRotate,i.enableTilt=this.base.cameraControllerState.enableTilt,i.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null);return}this.base.selectionDiv.style.display="none",await this.base.selectTilesInRectangle(this.base.selectStart,this.base.selectEnd,this.base.selectedColor),this.base.viewer.scene.requestRender(),this.base.selectStart=null,this.base.selectEnd=null;const t=this.base.viewer?.scene?.screenSpaceCameraController;t&&this.base.cameraControllerState!==null&&(t.enableRotate=this.base.cameraControllerState.enableRotate,t.enableTilt=this.base.cameraControllerState.enableTilt,t.enableLook=this.base.cameraControllerState.enableLook,this.base.cameraControllerState=null)},e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}unbindInputs(){if(!this.base.handler)return;const e=this.base.cesium;this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_CLICK,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE,e.KeyboardEventModifier.CTRL),this.base.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP,e.KeyboardEventModifier.CTRL)}}class xp{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;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.animationModule=new Ip(this),this.selectionModule=new Bp(this)}attachTileset(e,t,i){this.selectionModule.attachTileset(e,t,i)}setLoadNodeDetailsCallback(e){this.loadNodeDetailsCallback=e}selectionChange(e){e&&typeof e=="function"&&this.onSelectionChangeCallbacks.push(e)}removeSelectionChange(e){this.onSelectionChangeCallbacks=this.onSelectionChangeCallbacks.filter(t=>t!==e)}async triggerSelectionChange(e){if(e)await this.loadNodeDetailsForModel(e);else{const t=Object.keys(this.hasSelectedFeaturesMap);t.length>0&&await Promise.all(t.map(i=>{try{return this.loadNodeDetailsForModel(i)}catch(s){return console.error(`Error loading node details for model ${i}:`,s),Promise.resolve()}}))}if(this.onSelectionChangeCallbacks.length>0){const t=await this.getSelected({rank:0});this.onSelectionChangeCallbacks.forEach(i=>{try{i(t)}catch(s){console.error("Selection callback error:",s)}})}}enableSelection(){this.selectionModule.bindInputs()}disableSelection(){this.selectionModule.unbindInputs()}async clearSelection(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const r=s.filter(a=>a.rank!==0);r.length?(this.hasSelectedFeaturesMap[i]=r,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange(e)}clearExist(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const r=s.filter(a=>a.rank!==1);r.length?(this.hasSelectedFeaturesMap[i]=r,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}clearProcess(e){this.getTargetModelIds(e).forEach(i=>{const s=this.hasSelectedFeaturesMap[i];if(!s?.length)return;const r=s.filter(a=>a.rank!==2);r.length?(this.hasSelectedFeaturesMap[i]=r,this.setBaseStyle(i)):(delete this.hasSelectedFeaturesMap[i],this.applyShowStyleOnly(i))}),this.viewer.scene.requestRender()}async clearAllHaveSelected(){this.getTargetModelIds().forEach(t=>{this.hasSelectedFeaturesMap[t]&&(delete this.hasSelectedFeaturesMap[t],this.applyShowStyleOnly(t))}),this.viewer.scene.requestRender(),await this.triggerSelectionChange()}async loadAllNodeDetailsForModel(){for(const e of Object.keys(this.tilesetMap))await this.loadNodeDetailsForModel(e)}getSelected(e){const t=e&&typeof e=="object"&&"rank"in e?e.rank:e,i=Ur(t),s=[];for(const r of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[r]||[]).forEach(c=>{if(c.rank!==i)return;const l=Cp(c.selectedColor);let d=this.getBatchIdToElementIdSync(c.batchId,r);d===null&&(d=c.batchId),c.isTrigger&&s.push({elementId:d,modelId:r,rgba:l||void 0,point:c?.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 r=new Map;return s.forEach(a=>{a&&a.elementID&&r.set(`${a.batchId}`,`${a.elementID}`)}),this.batchIdToElementIdMap[t]=r,r.get(e)??null}return null}setAllConstructionProgressTracking(e){this.animationModule.setAllConstructionProgressTracking(e)}initTime(){this.animationModule.initTime()}processAnimation(e,t,i,s=null){this.animationModule.processAnimation(e,t,i,s)}onTick=e=>{this.animationModule.onTick(e)};enableConstructionProgressTracking(){this.animationModule.enableConstructionProgressTracking()}disableConstructionProgressTracking(){this.animationModule.disableConstructionProgressTracking()}freshConstructionProgressTracking(){this.animationModule.freshConstructionProgressTracking()}reStartAnimation(){this.animationModule.reStartAnimation()}setTileSyltByConstructionProcessTracking({modelId:e,batchIds:t}){const i=this.tilesetMap[e];if(!i)return;const s=i?.style?.show?.conditionsExpression?.conditions;Array.isArray(t)&&t.length?s?i.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s},color:{conditions:t}}):i.style=new this.cesium.Cesium3DTileStyle({color:{conditions:t}}):this.applyShowStyleOnly(e),this.viewer.scene.requestRender()}resumeFlyTo(){this.viewer.clock.shouldAnimate=!0}pauseFlyTo(){this.viewer.clock.shouldAnimate=!1}async flyToObjects({selectCpts:e,options:t}){if(!Array.isArray(e)||e.length===0)return;await this.clearSelection(),await this.setSelectColorUserModelCpt(e,{rank:0});const i=this.cesium,s=t?.scale??1,r=[];for(const a of e){const c=a?.modelId;if(c==null)continue;await this.loadNodeDetailsForModel(c);const l=a?.elementId,d=this.tilesetMap[`${c}`];if(!d)continue;const f=wp(d,l)||vp(d);if(!f)continue;const p=new i.Cartesian3(f.min.x,f.min.y,f.min.z),u=new i.Cartesian3(f.max.x,f.max.y,f.max.z),m=d?.root?.computedTransform??d?.modelMatrix;if(m){const E=i.Matrix4.multiplyByPoint(m,p,new i.Cartesian3),A=i.Matrix4.multiplyByPoint(m,u,new i.Cartesian3);r.push(E,A)}else r.push(p,u)}if(r.length){const a=i.BoundingSphere.fromPoints(r);a.radius=a.radius*s;const c=this.viewer.scene.camera,l=new i.HeadingPitchRange(c.heading,c.pitch,0);c.flyToBoundingSphere(a,{duration:t?.duration??0,complete:t?.complete,offset:l})}else{const a=e[0]?.modelId,c=a?this.tilesetMap[`${a}`]:null;c&&this.viewer.flyTo(c,{duration:t?.duration??0,complete:t?.complete})}}setBaseStyle(e){this.getTargetModelIds(e).forEach(i=>{this.setColorStyle(i)})}setColorStyle(e){this.updateTilesetStyle(e)}buildColorConditions(e){const t=this.tilesetMap[e],i=this.hasSelectedFeaturesMap[e];if(!t||!i?.length)return;const s=new Map;i.forEach(l=>{const d=s.get(l.batchId);(!d||l.rank>=d.rank)&&s.set(l.batchId,l)});const r=new Map;if(s.forEach(({batchId:l,selectedColor:d})=>{r.has(d)||r.set(d,new Set),r.get(d)?.add(l)}),this.colorRankColor.length){const l=new Set;this.colorRankColor.forEach(d=>{const h=r.get(d);h&&h.forEach(f=>l.add(f))}),r.forEach((d,h)=>{if(this.colorRankColor.includes(h))return;const f=new Set;d.forEach(p=>{l.has(p)||f.add(p)}),r.set(h,f)})}const a=[...this.colorRankColor.filter(l=>r.has(l)),...Array.from(r.keys()).filter(l=>!this.colorRankColor.includes(l))],c=[];return a.forEach(l=>{const d=r.get(l);if(!d||!d.size)return;const h=Array.from(d).join("|");h&&c.push([`(regExp('^(${h})$').test(\${id}))`,l])}),c.length?c:void 0}updateTilesetStyle(e){const t=this.tilesetMap[e];if(!t)return;t.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0,r=this.buildColorConditions(e);s||r?t.style=new this.cesium.Cesium3DTileStyle({show:s?{conditions:s}:void 0,color:r?{conditions:r}:void 0}):t.style=void 0,this.viewer.scene.requestRender()}setShowStyle(e){this.getTargetModelIds(e?.modelId).forEach(i=>{const s=this.showStateMap[i]||{batchIds:[],mode:"include"};this.showStateMap[i]={batchIds:e?.batchIds??s.batchIds,mode:e?.mode??s.mode},this.updateTilesetStyle(i)})}setColor(e){if(!e)return this.selectedColor;if(typeof e=="string")return e;const t=Ht(Number(e.r)),i=Ht(Number(e.g)),s=Ht(Number(e.b)),r=_r(e.a===void 0?1:Number(e.a));return as({r:t,g:i,b:s,a:r})||this.selectedColor}groupByModelId(e){const t={};return e.forEach(i=>{const s=i?.modelId,r=i?.elementId;if(s==null||r===void 0||r===null)return;const a=i?.color??i?.rgba,c=this.setColor(a??{r:.4,g:.4,b:.4,a:.1}),l=`${s}-${c}`;t[l]||(t[l]=[]),t[l].push(`${r}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const i=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[i]){const l=this.eidToBatchIdMap[i].get(s);if(l!==void 0)return l}const a=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(a&&Array.isArray(a)){const l=new Map;a.forEach(h=>{const f=`${h.elementID}`,p=`${h.batchId}`;l.has(f)||l.set(f,[]),l.get(f).push(p)}),this.eidToBatchIdMap[i]=l;const d=l.get(s);if(d!==void 0)return d}const c=Ep(e);return c!=null?[String(c)]:[]}async setComponentVisibility(e){if(Array.isArray(e)){Object.keys(this.showStateMap).forEach(t=>{this.showStateMap[t]={batchIds:[],mode:"exclude"}});for(const t of e){const i=`${t.modelId}`;this.showStateMap[i]||(this.showStateMap[i]={batchIds:[],mode:"exclude"});const s=this.showStateMap[i];if(!t.show){const r=this.getBatchIds(t.elementId,i);s.batchIds.push(...r)}}Object.keys(this.showStateMap).forEach(t=>{this.updateTilesetStyle(t)})}}async isolateComponentVisibility(e){const t={};e.forEach(i=>{const s=`${i.modelId}`;t[s]||(t[s]=new Set),t[s].add(`${i.elementId}`)});for(const i of Object.keys(this.tilesetMap)){await this.loadNodeDetailsForModel(i);const r=this.tilesetMap[i]?.leiting?.node?.batchIdEIDInfos;if(!r)continue;this.showStateMap[i]={batchIds:[],mode:"exclude"};const a=t[i];if(a&&a.size>0){const c=[];for(const l of r)a.has(`${l.elementID}`)||c.push(`${l.batchId}`);this.showStateMap[i].batchIds=c;continue}this.showStateMap[i].batchIds=r.map(c=>c.batchId)}Object.keys(this.showStateMap).forEach(i=>{this.updateTilesetStyle(i)})}async setAllComponentsVisibility(e){const t=this.getTargetModelIds();for(const i of t)await this.loadNodeDetailsForModel(i),e?this.setShowStyle({modelId:i,batchIds:[],mode:"exclude"}):this.setShowStyle({modelId:i,batchIds:[],mode:"include"})}getComponentsByVisibility(e){const t=this.getTargetModelIds(),i=[];return t.forEach(s=>{const r=this.showStateMap[s],a=this.tilesetMap[s];if(!a?.leiting?.node?.batchIdEIDInfos)return;const c=a.leiting.node.batchIdEIDInfos,l=new Set(r?.batchIds??[]),d=r?.mode??"exclude",h=new Set;c.forEach(f=>{const p=l.has(`${f.batchId}`);if((d==="include"?p:!p)===e){const m=`${f.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}async _getComponentsByVisibility(e){const t=this.getTargetModelIds();for(const s of t)this.loadNodeDetailsForModel(s);const i=[];return t.forEach(s=>{const r=this.showStateMap[s],a=this.tilesetMap[s];if(!a?.leiting?.node?.batchIdEIDInfos)return;const c=a.leiting.node.batchIdEIDInfos,l=new Set(r?.batchIds??[]),d=r?.mode??"exclude",h=new Set;c.forEach(f=>{const p=l.has(`${f.batchId}`);if((d==="include"?p:!p)===e){const m=`${f.elementID}`;h.has(m)||(i.push({elementId:m,modelId:s}),h.add(m))}})}),i}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:i,colorRank:s,show:r,selectionRank:a}){const c=this.tilesetMap[t];if(!Array.isArray(e))return[];const l=c.leiting.node,d=new Set(e),h=l.batchIdEIDInfos.filter(p=>d.has(`${p.elementID}`)).map(p=>String(p.batchId));return h.length?(s===Or.normal&&!this.colorRankColor.includes(i)&&(this.colorRankColor=[i]),[[`(regExp('^(${h.join("|")})$').test(\${id}))`,i]]):[]}async setSelectColorUserModelCpt(e,t){if(!Array.isArray(e))return;const i=new Map,s=t?.rank===void 0?"exist":t?.rank,r=Ur(s),a=t?.isTrigger??!0;for(const c of e){const l=c?.modelId;if(l==null)continue;const d=`${l}`;await this.loadNodeDetailsForModel(d);const h=Array.isArray(c?.elementIds)?c.elementIds:c?.elementId?[c.elementId]:[];if(!h.length)continue;const f=as(c?.rgba)||this.selectedColor;for(const p of h){const u=this.getBatchIds(p,d);if(u.length!==0){i.has(d)||i.set(d,[]);for(const m of u)i.get(d)?.push({batchId:m,selectedColor:f,rank:r,isTrigger:a})}}}for(const[c,l]of i){const d=this.mergeSelections(c,l);this.hasSelectedFeaturesMap[c]=d,this.setBaseStyle(c)}a&&await this.triggerSelectionChange()}async setAllSelectColorUserModelCpt(e,t){const{modelId:i,rgba:s}=e,r=t?.isTrigger??!0;if(!i)return;await this.loadNodeDetailsForModel(i);const a=String(i),c=this.tilesetMap[a];if(!c)return;const l=c?.leiting?.node?.batchIdEIDInfos;if(!l||!Array.isArray(l))return;const d=[];l.forEach(h=>{h&&h.elementID!==void 0&&d.push(h.elementID)}),d.length!==0&&await this.setSelectColorUserModelCpt([{modelId:a,elementIds:d,rgba:s}],{rank:0,isTrigger:r})}getFeatureId(e){if(this.cesium.defined(e)&&this.cesium.defined(e.getProperty)){const t=e.getProperty("id");return t!=null?String(t):"-1"}return"-1"}getTargetModelIds(e){return e?[e]:Object.keys(this.tilesetMap)}buildShowConditions(e,t){const i=e.join("|");return i?t==="include"?[[`(regExp('^(${i})$').test(\${id}))`,"true"],["true","false"]]:[[`(regExp('^(${i})$').test(\${id}))`,"false"],["true","true"]]:t==="include"?[["true","false"]]:void 0}applyShowStyleOnly(e){const t=this.tilesetMap[e];if(!t)return;const i=this.showStateMap[e],s=i?this.buildShowConditions(i.batchIds,i.mode):void 0;s?t.style=new this.cesium.Cesium3DTileStyle({show:{conditions:s}}):t.style=void 0}setSelectedColorRgba(e,t,i,s=1){const r=Ht(e),a=Ht(t),c=Ht(i),l=_r(s),d=as({r,g:a,b:c,a:l});d&&(this.selectedColor=d)}mergeSelections(e,t){const i=new Map;return(this.hasSelectedFeaturesMap[e]||[]).forEach(r=>i.set(r.batchId,r)),t.forEach(r=>{const a=i.get(r.batchId);(!a||r.rank>a.rank||r.rank===a.rank)&&i.set(r.batchId,r)}),Array.from(i.values())}async toggleMultiSelect(e,t,i,s){const r=this.hasSelectedFeaturesMap[e]||[],a=r.filter(f=>f.rank!==0),c=r.filter(f=>f.rank===0),d=c.some(f=>f.batchId===t)?c.filter(f=>f.batchId!==t):[...c,{batchId:t,selectedColor:i,rank:0,point:s,isTrigger:!0}],h=[...a,...d];h.length?(this.hasSelectedFeaturesMap[e]=h,this.setBaseStyle(e)):(delete this.hasSelectedFeaturesMap[e],this.applyShowStyleOnly(e)),await this.triggerSelectionChange(e)}ensureSelectionDiv(){if(this.selectionDiv)return;const e=document.createElement("div");e.style.display="none",e.style.pointerEvents="none",e.style.border="1px solid rgba(0, 255, 255, 0.8)",this.viewer.container.appendChild(e),this.selectionDiv=e}isRepeatedClick(e){const t=e?.position;return!t||typeof t.x!="number"||typeof t.y!="number"?!1:this.selectedPosition.x===t.x&&this.selectedPosition.y===t.y?!0:(this.selectedPosition.x=t.x,this.selectedPosition.y=t.y,!1)}async selectTilesInRectangle(e,t,i){const s=Math.min(e.x,t.x),r=Math.max(e.x,t.x),a=Math.min(e.y,t.y),c=Math.max(e.y,t.y),l=r-s,d=c-a;if(Math.abs(l)<15||Math.abs(d)<15)return;const h=s+l/2,f=a+d/2,p=new this.cesium.Cartesian2(h,f),u=this.viewer.scene.drillPick(p,void 0,l,d);if(!Array.isArray(u))return;const m=new Map;u.forEach(E=>{if(!(E instanceof this.cesium.Cesium3DTileFeature))return;const A=dn(E.tileset);if(!A||!this.tilesetMap[A])return;const b=this.getFeatureId(E);b!=="-1"&&(m.has(A)||m.set(A,new Set),m.get(A)?.add(b))}),m.forEach((E,A)=>{const b=this.hasSelectedFeaturesMap[A]||[],w=b.filter(S=>S.rank!==0),I=new Set(b.filter(S=>S.rank===0).map(S=>S.batchId)),D=[];E.forEach(S=>{I.has(S)||D.push({batchId:S,selectedColor:i,rank:0,isTrigger:!0})});const N=b.filter(S=>S.rank===0);this.hasSelectedFeaturesMap[A]=[...w,...N,...D],this.setBaseStyle(A)}),await this.triggerSelectionChange()}}class Sp{cesium;viewer;tilesetMap={};planeEntities=[];clippingPlanesMap={};activeModelIds=new Set;boxMatrix=null;boxInverseMatrix=null;boxCenter=null;boxOrientation=null;targetZPlus=0;targetZMinus=0;targetXPlus=0;targetXMinus=0;targetYPlus=0;targetYMinus=0;currentPlaneType="";selectedPlane=null;hoveredPlane=null;dragStartPoint=null;moveCallBack=null;downHandler=null;upHandler=null;moveHandler=null;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}attachTileset(e,t){this.tilesetMap[t]=e}open(e,t){!this.tilesetMap[e]||this.activeModelIds.has(e)||(this.activeModelIds.add(e),this.moveCallBack=t?.moveCallBack,this.fitToModels(),this.activeModelIds.size===1&&(this.createPlaneEntities(),this.initEventHandlers()))}setupClippingPlanes(e){const t=this.cesium,i=this.tilesetMap[e];if(!i||!this.boxMatrix)return;const s=new t.ClippingPlaneCollection({planes:[new t.ClippingPlane(new t.Cartesian3(1,0,0),this.targetXMinus),new t.ClippingPlane(new t.Cartesian3(-1,0,0),this.targetXPlus),new t.ClippingPlane(new t.Cartesian3(0,1,0),this.targetYMinus),new t.ClippingPlane(new t.Cartesian3(0,-1,0),this.targetYPlus),new t.ClippingPlane(new t.Cartesian3(0,0,1),this.targetZMinus),new t.ClippingPlane(new t.Cartesian3(0,0,-1),this.targetZPlus)],edgeWidth:2,edgeColor:t.Color.WHITE,enabled:!0,unionClippingRegions:!0}),r=t.Matrix4.inverse(i.root.transform,new t.Matrix4);s.modelMatrix=t.Matrix4.multiply(r,this.boxMatrix,new t.Matrix4),i.clippingPlanes=s,this.clippingPlanesMap[e]=s}createPlaneEntities(){const e=this.cesium,t=this.viewer;this.planeEntities.forEach(s=>t.entities.remove(s)),this.planeEntities=[];const i=["left","right","behind","front","top","down"];for(const s of i){const r=t.entities.add({name:s,position:new e.CallbackProperty(()=>{if(!this.boxMatrix)return e.Cartesian3.ZERO;const a=this.getPlaneOffsetCartesian(s);return e.Matrix4.multiplyByPoint(this.boxMatrix,a,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 a=.1,c=Math.max(a,this.targetXMinus+this.targetXPlus),l=Math.max(a,this.targetYPlus+this.targetYMinus),d=Math.max(a,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(c,l):s==="left"||s==="right"?new e.Cartesian2(l,d):new e.Cartesian2(c,d)},!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(r)}}getPlaneOffsetCartesian(e){const t=(this.targetXPlus-this.targetXMinus)/2,i=(this.targetYPlus-this.targetYMinus)/2,s=(this.targetZPlus-this.targetZMinus)/2;switch(e){case"left":return new this.cesium.Cartesian3(-this.targetXMinus,i,s);case"right":return new this.cesium.Cartesian3(this.targetXPlus,i,s);case"behind":return new this.cesium.Cartesian3(t,-this.targetYMinus,s);case"front":return new this.cesium.Cartesian3(t,this.targetYPlus,s);case"top":return new this.cesium.Cartesian3(t,i,this.targetZPlus);case"down":return new this.cesium.Cartesian3(t,i,-this.targetZMinus);default:return this.cesium.Cartesian3.ZERO}}getNormalByType(e){const t=this.cesium;switch(e){case"left":return new t.Cartesian3(1,0,0);case"right":return new t.Cartesian3(-1,0,0);case"behind":return new t.Cartesian3(0,1,0);case"front":return new t.Cartesian3(0,-1,0);case"top":return new t.Cartesian3(0,0,-1);case"down":return new t.Cartesian3(0,0,1);default:return t.Cartesian3.UNIT_X}}getPlaneByType(e){const t=this.cesium,i=this.getNormalByType(e),s=t.Cartesian3.negate(i,new t.Cartesian3);let r=0;switch(e){case"left":r=this.targetXMinus;break;case"right":r=this.targetXPlus;break;case"behind":r=this.targetYMinus;break;case"front":r=this.targetYPlus;break;case"top":r=this.targetZPlus;break;case"down":r=this.targetZMinus;break}return new t.Plane(s,-r)}initEventHandlers(){const e=this.cesium,t=this.viewer.scene.canvas,i=this.viewer.scene;this.downHandler=new e.ScreenSpaceEventHandler(t),this.upHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler=new e.ScreenSpaceEventHandler(t),this.moveHandler.setInputAction(s=>{if(this.selectedPlane)return;let r;try{r=i.pick(s.endPosition)}catch{}e.defined(r)&&r.id&&r.id.plane?this.hoveredPlane!==r.id.plane&&(this.hoveredPlane&&(this.hoveredPlane.material=e.Color.WHITE.withAlpha(.1)),this.hoveredPlane=r.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 r;try{r=i.pick(s.position)}catch{}if(e.defined(r)&&r.id&&r.id.plane){this.currentPlaneType=r.id.name,this.selectedPlane=r.id.plane,this.selectedPlane.material=e.Color.RED.withAlpha(.4),i.screenSpaceCameraController.enableInputs=!1;const a=i.camera.getPickRay(s.position),c=this.boxInverseMatrix,l=e.Matrix4.multiplyByPoint(c,a.origin,new e.Cartesian3),d=e.Matrix4.multiplyByPointAsVector(c,a.direction,new e.Cartesian3);e.Cartesian3.normalize(d,d);const h=new e.Ray(l,d),f=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,f,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 r=i.camera.getPickRay(s.endPosition),a=this.boxInverseMatrix,c=e.Matrix4.multiplyByPoint(a,r.origin,new e.Cartesian3),l=e.Matrix4.multiplyByPointAsVector(a,r.direction,new e.Cartesian3);e.Cartesian3.normalize(l,l);const d=new e.Ray(c,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 f=-e.Cartesian3.dot(this.dragStartPoint,h),p=new e.Plane(h,f);let u=e.IntersectionTests.rayPlane(d,p,new e.Cartesian3);if(!u){const E=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,A=-e.Cartesian3.dot(this.dragStartPoint,E);u=e.IntersectionTests.rayPlane(d,new e.Plane(E,A),new e.Cartesian3)}if(!u)return;const m=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+m,-u.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+m,u.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+m,-u.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+m,u.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+m,u.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+m,-u.z);break}this.syncClippingPlanes(),this.moveCallBack&&this.moveCallBack(this.getRangeParams())},e.ScreenSpaceEventType.MOUSE_MOVE),this.upHandler.setInputAction(()=>{this.selectedPlane&&(this.selectedPlane.material=e.Color.WHITE.withAlpha(.1),this.selectedPlane=null,this.currentPlaneType="",this.dragStartPoint=null),i.screenSpaceCameraController.enableInputs=!0,t.style.cursor="default"},e.ScreenSpaceEventType.LEFT_UP)}syncClippingPlanes(){this.activeModelIds.size!==0&&Object.keys(this.clippingPlanesMap).forEach(e=>{const t=this.clippingPlanesMap[e],i=this.tilesetMap[e];if(t&&i&&!t.isDestroyed()){const s=this.cesium;t.get(0).distance=this.targetXMinus,t.get(1).distance=this.targetXPlus,t.get(2).distance=this.targetYMinus,t.get(3).distance=this.targetYPlus,t.get(4).distance=this.targetZMinus,t.get(5).distance=this.targetZPlus;const r=s.Matrix4.inverse(i.root.transform,new s.Matrix4);t.modelMatrix=s.Matrix4.multiply(r,this.boxMatrix,new s.Matrix4)}})}fitToModels(){const e=this.cesium;if(this.activeModelIds.size===0)return;let t=[];if(this.activeModelIds.forEach(f=>{const p=this.tilesetMap[f];p&&p.boundingSphere&&t.push(p.boundingSphere.center)}),t.length===0)return;const i=new e.Cartesian3;t.forEach(f=>e.Cartesian3.add(i,f,i)),this.boxCenter=e.Cartesian3.divideByScalar(i,t.length,new e.Cartesian3),this.boxMatrix=e.Transforms.eastNorthUpToFixedFrame(this.boxCenter),this.boxInverseMatrix=e.Matrix4.inverse(this.boxMatrix,new e.Matrix4),this.boxOrientation=e.Quaternion.fromRotationMatrix(e.Matrix4.getMatrix3(this.boxMatrix,new e.Matrix3));let s=1/0,r=-1/0,a=1/0,c=-1/0,l=1/0,d=-1/0;this.activeModelIds.forEach(f=>{const p=this.tilesetMap[f];if(!p)return;const u=[],m=p.leiting?.box,E=p.root?.boundingVolume?.boundingVolume;if(m&&m.min&&m.max){const{min:A,max:b}=m,w=[new e.Cartesian3(A.x,A.y,A.z),new e.Cartesian3(b.x,A.y,A.z),new e.Cartesian3(A.x,b.y,A.z),new e.Cartesian3(b.x,b.y,A.z),new e.Cartesian3(A.x,A.y,b.z),new e.Cartesian3(b.x,A.y,b.z),new e.Cartesian3(A.x,b.y,b.z),new e.Cartesian3(b.x,b.y,b.z)],I=p.root.transform;w.forEach(D=>{u.push(e.Matrix4.multiplyByPoint(I,D,new e.Cartesian3))})}else if(E&&E.halfAxes){const A=E.center,b=E.halfAxes,w=e.Matrix3.getColumn(b,0,new e.Cartesian3),I=e.Matrix3.getColumn(b,1,new e.Cartesian3),D=e.Matrix3.getColumn(b,2,new e.Cartesian3);for(let N=0;N<8;N++){const S=e.Cartesian3.clone(A,new e.Cartesian3);e.Cartesian3.add(S,e.Cartesian3.multiplyByScalar(w,N&1?1:-1,new e.Cartesian3),S),e.Cartesian3.add(S,e.Cartesian3.multiplyByScalar(I,N&2?1:-1,new e.Cartesian3),S),e.Cartesian3.add(S,e.Cartesian3.multiplyByScalar(D,N&4?1:-1,new e.Cartesian3),S),u.push(S)}}else if(p.boundingSphere){const A=p.boundingSphere,b=A.center,w=A.radius,I=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,b,new e.Cartesian3);s=Math.min(s,I.x-w),r=Math.max(r,I.x+w),a=Math.min(a,I.y-w),c=Math.max(c,I.y+w),l=Math.min(l,I.z-w),d=Math.max(d,I.z+w)}u.forEach(A=>{const b=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,A,new e.Cartesian3);s=Math.min(s,b.x),r=Math.max(r,b.x),a=Math.min(a,b.y),c=Math.max(c,b.y),l=Math.min(l,b.z),d=Math.max(d,b.z)})});const h=1.01;this.targetXMinus=Math.abs(s)*h,this.targetXPlus=Math.abs(r)*h,this.targetYMinus=Math.abs(a)*h,this.targetYPlus=Math.abs(c)*h,this.targetZMinus=Math.abs(l)*h,this.targetZPlus=Math.abs(d)*h,this.activeModelIds.forEach(f=>{this.setupClippingPlanes(f)}),this.viewer.scene.requestRender()}getRangeParams(){const e=this.cesium;return{targetZPlus:this.targetZPlus,targetZMinus:this.targetZMinus,targetXPlus:this.targetXPlus,targetXMinus:this.targetXMinus,targetYPlus:this.targetYPlus,targetYMinus:this.targetYMinus,maxBox:new e.Cartesian3(this.targetXPlus,this.targetYPlus,this.targetZPlus),minBox:new e.Cartesian3(-this.targetXMinus,-this.targetYMinus,-this.targetZMinus)}}updateRange(e){if(!this.boxMatrix)return;e.targetXMinus!==void 0&&(this.targetXMinus=e.targetXMinus),e.targetXPlus!==void 0&&(this.targetXPlus=e.targetXPlus),e.targetYMinus!==void 0&&(this.targetYMinus=e.targetYMinus),e.targetYPlus!==void 0&&(this.targetYPlus=e.targetYPlus),e.targetZPlus!==void 0&&(this.targetZPlus=e.targetZPlus),e.targetZMinus!==void 0&&(this.targetZMinus=e.targetZMinus);const t=.1;this.targetXMinus+this.targetXPlus<t&&(this.targetXPlus=t-this.targetXMinus),this.targetYPlus+this.targetYMinus<t&&(this.targetYPlus=t-this.targetYMinus),this.targetZPlus+this.targetZMinus<t&&(this.targetZPlus=t-this.targetZMinus),this.syncClippingPlanes(),this.viewer.scene.requestRender()}getRange(){return this.getRangeParams()}setBoxVisibility(e){this.planeEntities.forEach(t=>{t.show=e}),this.viewer.scene.requestRender()}close(e){if(e){const t=this.tilesetMap[e];t&&(t.clippingPlanes&&(t.clippingPlanes.enabled=!1),t.clippingPlanes=void 0),delete this.clippingPlanesMap[e],this.activeModelIds.delete(e),this.activeModelIds.size>0&&this.fitToModels()}else Object.keys(this.clippingPlanesMap).forEach(t=>{const i=this.tilesetMap[t];i&&(i.clippingPlanes&&(i.clippingPlanes.enabled=!1),i.clippingPlanes=void 0)}),this.clippingPlanesMap={},this.activeModelIds.clear();this.activeModelIds.size===0&&(this.planeEntities.forEach(t=>{this.viewer.entities.remove(t)}),this.planeEntities=[],this.destroyEventHandlers(),this.boxMatrix=null,this.boxInverseMatrix=null),this.viewer.scene.requestRender()}destroyEventHandlers(){this.downHandler?.destroy(),this.upHandler?.destroy(),this.moveHandler?.destroy(),this.downHandler=this.upHandler=this.moveHandler=null}}let cs=performance.now();const Tp=10;class Mp{cesium;viewer;modelInfo={modelName:"Person",modelId:"player_111",url:"person/model.glb",scale:.0032};startTime=0;radian=0;speed=.1;speedVector;position;hpRoll;cameralHpRoll;fixedFrameTransforms;model;transparentTest=!0;gravityTestByMove=!1;gravityTest=!0;lastMoveTime=0;moveInterval=.01;collisionTest=!0;wheelCount=2;isLeftDragging=!1;lastScreenY=0;lastScreenX=0;pauseAnimationFn;resumeAnimationFn;selectedColor;selectedColorRecover;handler;moveState={moveFront:!1,moveBack:!1,moveLeft:!1,moveRight:!1,moveUp:!1,moveDown:!1};onLoading=null;onSuccess=null;onError=null;constructor({cesium:e,viewer:t,modelInfo:i,callbacks:s}){this.cesium=e,this.viewer=t,this.radian=this.cesium.Math.toRadians(4),this.speedVector=new this.cesium.Cartesian3,this.position=new this.cesium.Cartesian3,this.hpRoll=new this.cesium.HeadingPitchRoll,this.cameralHpRoll=new this.cesium.HeadingPitchRoll,this.fixedFrameTransforms=new this.cesium.Transforms.localFrameToFixedFrameGenerator("north","west"),i&&(this.modelInfo=Object.assign(this.modelInfo,i)),s&&(this.onLoading=s.onLoading||null,this.onSuccess=s.onSuccess||null,this.onError=s.onError||null),this.selectedColor=new this.cesium.Color(1,1,1,.4),this.selectedColorRecover=new this.cesium.Color(1,1,1,1);const r=this.viewer.scene.canvas;this.handler=new this.cesium.ScreenSpaceEventHandler(r)}getModel(){return this.model}setPauseAnimation(e){this.pauseAnimationFn=e}setResumeAnimationFn(e){this.resumeAnimationFn=e}async setPersonPosition(e){e&&(this.position=e),this.getModel()?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(e,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.model.show=!0,this.initKeyBoard()):await this.openPlayer(),this.setCameralDefault(!1)}setModelInfo(e){e&&(this.modelInfo=Object.assign(this.modelInfo,e))}async openPlayer(){if(this.enablePositionSelection(),this.model){this.model.show=!0,this.initKeyBoard(),this.setCameralDefault(!1);return}this.position&&!(this.position.x===0&&this.position.y===0&&this.position.z===0)?(await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)):this.onLoading&&this.onLoading("请按住 Ctrl + 左键点击场景选择初始位置...")}enablePositionSelection(){this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null);const e=new this.cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);e.setInputAction(async t=>{const i=this.viewer.scene;let s;try{s=i.pickPosition(t.position)}catch(r){console.warn("pickPosition failed:",r)}s&&(this.position=s,this.model?(this.model.modelMatrix=this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),this.updatedCamera(),this.onSuccess&&this.onSuccess("已更新漫游位置")):(this.onSuccess&&this.onSuccess("位置已选择,正在加载模型..."),await this.loadModel(),this.initKeyBoard(),this.setCameralDefault(!1)))},this.cesium.ScreenSpaceEventType.LEFT_CLICK,this.cesium.KeyboardEventModifier.CTRL),this._positionHandler=e}_positionHandler;setDefaultPosition(){const e=this.viewer.scene,t=this.viewer.camera,i=new this.cesium.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2);let s;try{s=e.pickPosition(i)}catch(r){console.warn("pickPosition failed:",r)}if(s)this.position=s;else{const r=t.direction,c=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(r,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=c}}async loadModel(){let e;try{this.onLoading&&this.onLoading("正在加载漫游人物...");const t=await this.cesium.Model.fromGltfAsync({id:this.modelInfo.modelId,url:this.modelInfo.url,modelMatrix:this.cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpRoll,this.cesium.Ellipsoid.WGS84,this.fixedFrameTransforms),scale:this.modelInfo.scale,allowPicking:!1,debugShowBoundingVolume:!1,debugWireframe:!1,cull:!1,gltfCallback:s=>{e=s.animations},backFaceCulling:!1}),i=()=>{if(e&&e.length>0){console.log("Model has animations:",e.length);try{t.activeAnimations.add({index:0,loop:this.cesium.ModelAnimationLoop.REPEAT,multiplier:1})}catch(s){console.error("Failed to add animation:",s)}this.pauseAnimationFn=()=>{this.viewer.clock.shouldAnimate=!1},this.resumeAnimationFn=()=>{this.viewer.clock.shouldAnimate=!0},this.viewer.clock.shouldAnimate=!1}else console.warn("No animations found in the model.")};t.ready?i():t.readyEvent.addEventListener(i),this.model=await this.viewer.scene.primitives.add(t),this.updatedCamera(),this.onLoading&&this.onLoading(""),this.onSuccess&&this.onSuccess("漫游模型加载完成")}catch(t){console.error("Failed to load model:",t),this.onLoading&&this.onLoading(""),this.onError&&this.onError("漫游模型加载失败")}}initKeyBoard(){const e=this.handler,t=this.cesium;cs=performance.now();const i=(r,a)=>{const c=r.code,l=r.keyCode;c==="KeyA"||l===65?this.moveState.moveLeft=a:c==="KeyW"||l===87?this.moveState.moveFront=a:c==="KeyD"||l===68?this.moveState.moveRight=a:c==="KeyS"||l===83?this.moveState.moveBack=a:c==="KeyQ"||l===81?this.moveState.moveUp=a:(c==="KeyE"||l===69)&&(this.moveState.moveDown=a)};e.setInputAction(r=>{this.wheelCount-=r*.001,this.wheelCount<.1&&(this.wheelCount=.1),this.updatedCamera()},t.ScreenSpaceEventType.WHEEL),this._keydownHandler=r=>{r.target.tagName==="INPUT"||r.target.tagName==="TEXTAREA"||(i(r,!0),this.resumeAnimationFn&&this.resumeAnimationFn())},this._keyupHandler=r=>{r.target.tagName==="INPUT"||r.target.tagName==="TEXTAREA"||(i(r,!1),Object.keys(this.moveState).every(a=>this.moveState[a]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())},document.addEventListener("keydown",this._keydownHandler),document.addEventListener("keyup",this._keyupHandler),e.setInputAction(r=>{this.isLeftDragging=!0,this.lastScreenY=r.position.y,this.lastScreenX=r.position.x},this.cesium.ScreenSpaceEventType.LEFT_DOWN),e.setInputAction(r=>{if(!this.isLeftDragging)return;const a=r.endPosition.x,c=r.endPosition.y,l=c-this.lastScreenY,d=a-this.lastScreenX;Math.abs(l)<Math.abs(d)&&(d>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=a),this.lastScreenY=c;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=r=>{const a=performance.now();if(a-cs<Tp)return;cs=a;const c=1.75;if(r===1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,this.speed,this.speedVector),this.gravityTestByMove=!0):r===-1?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,-this.speed,this.speedVector),this.gravityTestByMove=!0):r===0?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_X,0,this.speedVector),this.gravityTestByMove=!1):r===2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,.05,this.speedVector),this.gravityTestByMove=!1):r===-2?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Z,-.05,this.speedVector),this.gravityTestByMove=!1):r===3?(this.speedVector=this.cesium.Cartesian3.multiplyByScalar(this.cesium.Cartesian3.UNIT_Y,this.speed,this.speedVector),this.gravityTestByMove=!0):r===-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=(f,p)=>new this.cesium.Ray(f,p),d=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,d),this.cesium.Cartesian3.normalize(d,d);const h=new this.cesium.Cartesian3;if(this.cesium.Matrix4.getColumn(this.model.modelMatrix,1,h),this.cesium.Cartesian3.normalize(h,h),Math.abs(r)!=2&&this.collisionTest){const f=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,c),f);let u=d;r===-1?u=this.cesium.Cartesian3.multiplyByScalar(d,-1,new this.cesium.Cartesian3):r===3?u=h:r===-3&&(u=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const m=l(p,u),E=this.viewer.scene.pickFromRay(m,[this.model],1);if(E&&E.position&&this.cesium.Cartesian3.distance(p,E.position)<.9&&r!==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 f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=.5,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),f),m=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,u,m),this.cesium.Cartesian3.normalize(m,m);const E=l(u,m),A=this.viewer.scene.pickFromRay(E,[this.model],1),b=c,w=this.cesium.Cartesian3.add(u,this.cesium.Cartesian3.multiplyByScalar(d,b,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(A)){const I=t.Cartesian3.distance(u,A.position);I-p>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),I-p<-.1&&I<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!A&&this.gravityTestByMove){const I=l(this.position,m),D=this.viewer.scene.pickFromRay(I,[this.model],1);if(D){const N=this.cesium.Cartesian3.distance(this.position,D.position);Math.abs(N-1)>.05&&N<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(A&&this.gravityTestByMove&&this.gravityTest){const I=this.cesium.Cartesian3.distance(w,A.position);Math.abs(I-c)>.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,(c-I)/Math.abs(c-I)*.05),this.position))}}if(this.transparentTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),p=1.75,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,p),f),m=this.viewer.camera.positionWC,E=u,A=t.Cartesian3.subtract(E,m,new t.Cartesian3),b=t.Cartesian3.distance(u,m),w=t.Cartesian3.normalize(A,new t.Cartesian3),I=new t.Ray(m,w);let D;try{D=this.viewer.scene.pickFromRay(I,void 0,1)}catch{}t.defined(D)&&D.primitive!==this.model&&D.position&&t.Cartesian3.distance(m,D.position)<b&&(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 r=performance.now()/1e3;(r-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=r)},this.viewer.clock.onTick.addEventListener(this._tickHandler)}updatedCamera(){if(!this.model)return;const e=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),t=1.75,i=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,t),e);this.viewer.camera.viewBoundingSphere(new this.cesium.BoundingSphere(i,this.wheelCount),this.cameralHpRoll)}_keydownHandler;_keyupHandler;_tickHandler;_uiEventListeners=[];bindUiKeys(e){this.unbindUiKeys(),Object.entries(e).forEach(([t,i])=>{if(!i)return;const s=()=>this.setMoveState(t,!0),r=()=>this.setMoveState(t,!1);i.addEventListener("mousedown",s),i.addEventListener("mouseup",r),i.addEventListener("mouseleave",r),i.addEventListener("touchstart",a=>{a.preventDefault(),s()}),i.addEventListener("touchend",a=>{a.preventDefault(),r()}),this._uiEventListeners.push(()=>{i.removeEventListener("mousedown",s),i.removeEventListener("mouseup",r),i.removeEventListener("mouseleave",r),i.removeEventListener("touchstart",s),i.removeEventListener("touchend",r)})})}unbindUiKeys(){this._uiEventListeners.forEach(e=>e()),this._uiEventListeners=[]}openCameraRoam(){const e=this.cesium,t=this.viewer,i=t.camera;this.setDefaultPosition(),this.setCameralDefault(!1);const s=this.handler;let r=!1,a=0,c=0;s.setInputAction(l=>{r=!0,a=l.position.x,c=l.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(l=>{if(!r)return;const d=l.endPosition.x,h=l.endPosition.y,f=d-a,p=h-c;Math.abs(f)>Math.abs(p)&&(i.heading-=f*.003),i.pitch+=p*.003,a=d,c=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{r=!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,d=i.direction,h=i.right,f=i.up;let p=0,u=0,m=0;this.moveState.moveFront&&(p+=d.x*l,u+=d.y*l,m+=d.z*l),this.moveState.moveBack&&(p-=d.x*l,u-=d.y*l,m-=d.z*l),this.moveState.moveRight&&(p+=h.x*l,u+=h.y*l,m+=h.z*l),this.moveState.moveLeft&&(p-=h.x*l,u-=h.y*l,m-=h.z*l),this.moveState.moveUp&&(p+=f.x*l,u+=f.y*l,m+=f.z*l),this.moveState.moveDown&&(p-=f.x*l,u-=f.y*l,m-=f.z*l),i.position=new e.Cartesian3(i.position.x+p,i.position.y+u,i.position.z+m)},t.clock.onTick.addEventListener(this._tickHandler),this.onSuccess&&this.onSuccess("视角漫游已启动")}closePlayer(){const e=this.cesium;this.model&&(this.model.show=!1),this.setCameralDefault(!0),this.handler&&(this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_DOWN),this.handler.removeInputAction(e.ScreenSpaceEventType.MOUSE_MOVE),this.handler.removeInputAction(e.ScreenSpaceEventType.LEFT_UP),this.handler.removeInputAction(e.ScreenSpaceEventType.WHEEL)),this._positionHandler&&(this._positionHandler.destroy(),this._positionHandler=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._keyupHandler&&document.removeEventListener("keyup",this._keyupHandler),this._tickHandler&&this.viewer.clock.onTick.removeEventListener(this._tickHandler),this.unbindUiKeys(),this.viewer.camera.lookAtTransform(e.Matrix4.IDENTITY),this.onLoading&&this.onLoading("")}setSpeed({speed:e}){this.speed=e/50}setParams({gravityTest:e,collisionTest:t,transparentTest:i}){e!==void 0&&(this.gravityTest=e),t!==void 0&&(this.collisionTest=t),i!==void 0&&(this.transparentTest=i)}setMoveState(e,t){this.moveState.hasOwnProperty(e)&&(this.moveState[e]=t,t?this.resumeAnimationFn&&this.resumeAnimationFn():Object.keys(this.moveState).every(i=>this.moveState[i]==!1)&&this.pauseAnimationFn&&this.pauseAnimationFn())}setCameralDefault(e){const t=this.viewer;t.scene.screenSpaceCameraController.enableRotate=e,t.scene.screenSpaceCameraController.enableTranslate=e,t.scene.screenSpaceCameraController.enableZoom=e,t.scene.screenSpaceCameraController.enableLook=e,t.scene.screenSpaceCameraController.enableTilt=e}}class Dp{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new tc(e),this.baseTiles=new Lr(e),this.baseCompt=new xp(e),this.baseSection=new Sp(e),this.basePlayer=new Mp({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 kp{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new jn;showGlobal=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t}getMapLayers(e){const t=typeof e=="object"?e?.modelId:e;return t?this.mapLayers[t]||{}:this.mapLayers}setModelId(e){this.modelId=e}getModelId(){return this.modelId}flyToCadModel(e={}){const t=e.modelId||this.modelId,i=this.dxfModelsList.find(s=>s.modelId===t);i&&this.flyToBounds(i)}setDxfOpen(e){this.open=e}getDxfOpen(){return this.open}getDxfModelsList(){return this.dxfModelsList}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.dxfModelsList.find(i=>i.modelId===t):this.dxfModelsList}showJson({modelId:e,show:t}){this.mapLayers[e]&&Object.values(this.mapLayers[e]).forEach(s=>{s.forEach(r=>{r.primitive&&(r.primitive.show=t)})});const i=this.dxfModelsList.find(s=>s.modelId===e);i&&(i.show=t)}showJsonByLayer({modelId:e,show:t,layers:i}){const s=this.dxfModelsList.find(a=>a.modelId===e);if(!s){console.error("Tileset not found for modelId:",e);return}s.hiddenBatchIds||(s.hiddenBatchIds=new Set),s.layerMap&&Array.isArray(i)&&i.forEach(a=>{const c=s.layerMap[a];c!==void 0&&(t?s.hiddenBatchIds.delete(c):s.hiddenBatchIds.add(c))});const r=Array.from(s.hiddenBatchIds);if(r.length>0){const a=r.map(c=>`\${_BATCHID} !== ${c}`).join(" && ");s.style=new this.cesium.Cesium3DTileStyle({show:a})}else s.style=new this.cesium.Cesium3DTileStyle({show:!0});s.hasVisibilityListener||(s.hasVisibilityListener=!0,s.tileVisible.addEventListener(a=>{const c=a.content,l=c.featuresLength;if(l>0&&s.hiddenBatchIds)for(let d=0;d<l;d++)s.hiddenBatchIds.has(d)?c.getFeature(d).show=!1:c.getFeature(d).show=!0}))}flyToBounds(e,t){const i=this.cesium,s=e.boundingSphere?.radius||1e3,r={offset:new i.HeadingPitchRange(0,i.Math.toRadians(-90),s*2),...t},a=r.duration??0;e&&this.viewer.flyTo(e,{duration:a,offset:r.offset})}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const i=await t.blob(),s=new Tr(new es(i),{password:"abc!?123",useWebWorkers:!1}),a=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!a)return console.error("未找到 JSON 文件"),await s.close(),!1;const c=await a.arrayBuffer({useWebWorkers:!1});await s.close();const l=new TextDecoder().decode(c);return JSON.parse(l.trim())}catch(t){return console.error("解压或获取失败:",t),!1}}async addDxfModel({fileNames:e,options:t}){const i=this.renderGenAll;if(e?.length){for(const s of e){if(this.renderGenAll!==i)return;const r=this.renderGenByModel[s.modelId]||0;if((this.renderGenByModel[s.modelId]||0)!==r||~this.dxfModelsList.findIndex(d=>d.modelId===s.modelId))return;const c=`${s.outPutPath}${s.dbName}/tileset.json`,l={...this.options,...t};try{const d=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(d);if(this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==r)return;const f=await this.cesium.Cesium3DTileset.fromUrl(c,{allowPicking:!1,clampToTerrain:!0});if(f.maximumScreenSpaceError=0,this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==r)return;if(Object.assign(f,{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?f.formData=s.formData:f.formData={modelId:f.modelId,longitude:f.deltaLongitude,latitude:f.deltaLatitude,distance:1e-6,rotation:0,totalRotation:f.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:f.modelId,label:f.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...f.formData,tileset:f}),Array.isArray(h)){const p=h;f.layerMap={};let u=this.mapLayers[s.modelId];u||(u={},this.mapLayers[s.modelId]=u),p.forEach(m=>{f.layerMap[m.layerName]=m.batchId,u[m.layerName]||(u[m.layerName]=[]),u[m.layerName].push({batchId:m.batchId,color:m.layerColor})})}if(this.dxfModelsList.push(f),this.setModelId(s.modelId),this.viewer.scene.primitives.add(f),this.renderGenAll!==i||(this.renderGenByModel[s.modelId]||0)!==r)return;l.flyTo&&this.flyToBounds(f),l.onSuccess&&l.onSuccess(f)}catch(d){console.error(`Failed to load tileset or layer info: ${c}`,d)}}this.events.emit("mountAllCad",this.dxfModelsList)}}adjustingModelByCad(e){const t=this.cesium,i=t.Quaternion.fromAxisAngle(t.Cartesian3.UNIT_Z,t.Math.toRadians(e.totalRotation)),s=t.Matrix4.fromRotationTranslation(t.Matrix3.fromQuaternion(i),new t.Cartesian3(0,0,0)),r=t.Cartesian3.fromDegrees(e.longitude,e.latitude,e.height),a=t.Transforms.eastNorthUpToFixedFrame(r);t.Matrix4.multiply(a,s,a),e.tileset?._root&&(e.tileset._root.transform=a)}deleteCad({modelId:e}){this.mapLayers[e]&&(Object.values(this.mapLayers[e]).forEach(i=>{i.forEach(s=>{this.viewer.scene.primitives.remove(s.primitive),s.primitive?.destroy()})}),delete this.mapLayers[e]),this.renderGen[e]=(this.renderGen[e]||0)+1,this.renderGenByModel[e]=(this.renderGenByModel[e]||0)+1;const t=this.dxfModelsList.findIndex(i=>i.modelId===e);if(t>-1){const i=this.dxfModelsList[t];this.viewer.scene.primitives.remove(i),i.destroy&&!i.isDestroyed()&&i.destroy(),this.dxfModelsList.splice(t,1)}}deleteAllCad(){Object.keys(this.mapLayers).forEach(e=>{this.deleteCad({modelId:e})}),[...this.dxfModelsList].forEach(e=>{e.modelId&&this.deleteCad({modelId:e.modelId})})}}class ft{constructor(e,t){if(this.viewer=e,!this.viewer)return;this.type="prompt",t=t||{};const i=t.type==null?1:t.type;let s={id:new Date().getTime()+""+Math.floor(Math.random()*1e4),type:i,anchor:i==2,closeBtn:i==2,offset:i==2?{x:0,y:-20}:{x:10,y:10},content:"",show:!0,style:{background:"rgba(0,0,0,0.5)",color:"white"}};this.opt=Object.assign(s,t),this.attr=this.opt;const r=this.viewer.container.id;this.isShow=this.opt.show==null?!0:this.opt.show;let a="",c="";const l=this.opt.style.background,d=this.opt.style.color;this.opt.anchor&&(a+=`
12
+ `});d.isModelAdjustment=!0,c.customShader=d}else{let d="color('white')";e!==1&&(d=`${d} * ${e}`),c.style=new n.Cesium3DTileStyle({color:d})}}}}var Pa=typeof global=="object"&&global&&global.Object===Object&&global,Lh=typeof self=="object"&&self&&self.Object===Object&&self,$t=Pa||Lh||Function("return this")(),Ln=$t.Symbol,_a=Object.prototype,Oh=_a.hasOwnProperty,Gh=_a.toString,Oi=Ln?Ln.toStringTag:void 0;function Uh(i){var e=Oh.call(i,Oi),t=i[Oi];try{i[Oi]=void 0;var n=!0}catch{}var s=Gh.call(i);return n&&(e?i[Oi]=t:delete i[Oi]),s}var Vh=Object.prototype,Qh=Vh.toString;function Hh(i){return Qh.call(i)}var Yh="[object Null]",zh="[object Undefined]",Da=Ln?Ln.toStringTag:void 0;function Gi(i){return i==null?i===void 0?zh:Yh:Da&&Da in Object(i)?Uh(i):Hh(i)}function hi(i){return i!=null&&typeof i=="object"}var jh="[object Symbol]";function Wh(i){return typeof i=="symbol"||hi(i)&&Gi(i)==jh}var $s=Array.isArray,$h=/\s/;function Kh(i){for(var e=i.length;e--&&$h.test(i.charAt(e)););return e}var qh=/^\s+/;function Xh(i){return i&&i.slice(0,Kh(i)+1).replace(qh,"")}function pt(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}var ka=NaN,Jh=/^[-+]0x[0-9a-f]+$/i,Zh=/^0b[01]+$/i,eu=/^0o[0-7]+$/i,tu=parseInt;function Na(i){if(typeof i=="number")return i;if(Wh(i))return ka;if(pt(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=pt(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Xh(i);var t=Zh.test(i);return t||eu.test(i)?tu(i.slice(2),t?2:8):Jh.test(i)?ka:+i}function Ra(i){return i}var iu="[object AsyncFunction]",nu="[object Function]",su="[object GeneratorFunction]",ou="[object Proxy]";function Ks(i){if(!pt(i))return!1;var e=Gi(i);return e==nu||e==su||e==iu||e==ou}var qs=$t["__core-js_shared__"],Fa=(function(){var i=/[^.]+$/.exec(qs&&qs.keys&&qs.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""})();function au(i){return!!Fa&&Fa in i}var ru=Function.prototype,lu=ru.toString;function cu(i){if(i!=null){try{return lu.call(i)}catch{}try{return i+""}catch{}}return""}var du=/[\\^$.*+?()[\]{}|]/g,hu=/^\[object .+?Constructor\]$/,uu=Function.prototype,fu=Object.prototype,mu=uu.toString,gu=fu.hasOwnProperty,pu=RegExp("^"+mu.call(gu).replace(du,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Au(i){if(!pt(i)||au(i))return!1;var e=Ks(i)?pu:hu;return e.test(cu(i))}function yu(i,e){return i?.[e]}function Xs(i,e){var t=yu(i,e);return Au(t)?t:void 0}var La=Object.create,Eu=(function(){function i(){}return function(e){if(!pt(e))return{};if(La)return La(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}})();function Cu(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 vu(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e}var bu=800,wu=16,Iu=Date.now;function Su(i){var e=0,t=0;return function(){var n=Iu(),s=wu-(n-t);if(t=n,s>0){if(++e>=bu)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}function xu(i){return function(){return i}}var On=(function(){try{var i=Xs(Object,"defineProperty");return i({},"",{}),i}catch{}})(),Mu=On?function(i,e){return On(i,"toString",{configurable:!0,enumerable:!1,value:xu(e),writable:!0})}:Ra,Bu=Su(Mu),Tu=9007199254740991,Pu=/^(?:0|[1-9]\d*)$/;function Oa(i,e){var t=typeof i;return e=e??Tu,!!e&&(t=="number"||t!="symbol"&&Pu.test(i))&&i>-1&&i%1==0&&i<e}function Js(i,e,t){e=="__proto__"&&On?On(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}function Gn(i,e){return i===e||i!==i&&e!==e}var _u=Object.prototype,Du=_u.hasOwnProperty;function ku(i,e,t){var n=i[e];(!(Du.call(i,e)&&Gn(n,t))||t===void 0&&!(e in i))&&Js(i,e,t)}function Nu(i,e,t,n){var s=!t;t||(t={});for(var o=-1,r=e.length;++o<r;){var l=e[o],c=void 0;c===void 0&&(c=i[l]),s?Js(t,l,c):ku(t,l,c)}return t}var Ga=Math.max;function Ru(i,e,t){return e=Ga(e===void 0?i.length-1:e,0),function(){for(var n=arguments,s=-1,o=Ga(n.length-e,0),r=Array(o);++s<o;)r[s]=n[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=n[s];return l[e]=t(r),Cu(i,this,l)}}function Fu(i,e){return Bu(Ru(i,e,Ra),i+"")}var Lu=9007199254740991;function Ua(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=Lu}function Zs(i){return i!=null&&Ua(i.length)&&!Ks(i)}function Ou(i,e,t){if(!pt(t))return!1;var n=typeof e;return(n=="number"?Zs(t)&&Oa(e,t.length):n=="string"&&e in t)?Gn(t[e],i):!1}function Gu(i){return Fu(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&&Ou(t[0],t[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);++n<s;){var l=t[n];l&&i(e,l,n,o)}return e})}var Uu=Object.prototype;function Va(i){var e=i&&i.constructor,t=typeof e=="function"&&e.prototype||Uu;return i===t}function Vu(i,e){for(var t=-1,n=Array(i);++t<i;)n[t]=e(t);return n}var Qu="[object Arguments]";function Qa(i){return hi(i)&&Gi(i)==Qu}var Ha=Object.prototype,Hu=Ha.hasOwnProperty,Yu=Ha.propertyIsEnumerable,eo=Qa((function(){return arguments})())?Qa:function(i){return hi(i)&&Hu.call(i,"callee")&&!Yu.call(i,"callee")};function zu(){return!1}var Ya=typeof V=="object"&&V&&!V.nodeType&&V,za=Ya&&typeof module=="object"&&module&&!module.nodeType&&module,ju=za&&za.exports===Ya,ja=ju?$t.Buffer:void 0,Wu=ja?ja.isBuffer:void 0,Wa=Wu||zu,$u="[object Arguments]",Ku="[object Array]",qu="[object Boolean]",Xu="[object Date]",Ju="[object Error]",Zu="[object Function]",ef="[object Map]",tf="[object Number]",nf="[object Object]",sf="[object RegExp]",of="[object Set]",af="[object String]",rf="[object WeakMap]",lf="[object ArrayBuffer]",cf="[object DataView]",df="[object Float32Array]",hf="[object Float64Array]",uf="[object Int8Array]",ff="[object Int16Array]",mf="[object Int32Array]",gf="[object Uint8Array]",pf="[object Uint8ClampedArray]",Af="[object Uint16Array]",yf="[object Uint32Array]",ye={};ye[df]=ye[hf]=ye[uf]=ye[ff]=ye[mf]=ye[gf]=ye[pf]=ye[Af]=ye[yf]=!0,ye[$u]=ye[Ku]=ye[lf]=ye[qu]=ye[cf]=ye[Xu]=ye[Ju]=ye[Zu]=ye[ef]=ye[tf]=ye[nf]=ye[sf]=ye[of]=ye[af]=ye[rf]=!1;function Ef(i){return hi(i)&&Ua(i.length)&&!!ye[Gi(i)]}function Cf(i){return function(e){return i(e)}}var $a=typeof V=="object"&&V&&!V.nodeType&&V,Ui=$a&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Ui&&Ui.exports===$a,to=vf&&Pa.process,Ka=(function(){try{var i=Ui&&Ui.require&&Ui.require("util").types;return i||to&&to.binding&&to.binding("util")}catch{}})(),qa=Ka&&Ka.isTypedArray,Xa=qa?Cf(qa):Ef;function bf(i,e){var t=$s(i),n=!t&&eo(i),s=!t&&!n&&Wa(i),o=!t&&!n&&!s&&Xa(i),r=t||n||s||o,l=r?Vu(i.length,String):[],c=l.length;for(var d in i)r&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Oa(d,c))||l.push(d);return l}function wf(i,e){return function(t){return i(e(t))}}function If(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e}var Sf=Object.prototype,xf=Sf.hasOwnProperty;function Mf(i){if(!pt(i))return If(i);var e=Va(i),t=[];for(var n in i)n=="constructor"&&(e||!xf.call(i,n))||t.push(n);return t}function Ja(i){return Zs(i)?bf(i):Mf(i)}var Vi=Xs(Object,"create");function Bf(){this.__data__=Vi?Vi(null):{},this.size=0}function Tf(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var Pf="__lodash_hash_undefined__",_f=Object.prototype,Df=_f.hasOwnProperty;function kf(i){var e=this.__data__;if(Vi){var t=e[i];return t===Pf?void 0:t}return Df.call(e,i)?e[i]:void 0}var Nf=Object.prototype,Rf=Nf.hasOwnProperty;function Ff(i){var e=this.__data__;return Vi?e[i]!==void 0:Rf.call(e,i)}var Lf="__lodash_hash_undefined__";function Of(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=Vi&&e===void 0?Lf:e,this}function Kt(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])}}Kt.prototype.clear=Bf,Kt.prototype.delete=Tf,Kt.prototype.get=kf,Kt.prototype.has=Ff,Kt.prototype.set=Of;function Gf(){this.__data__=[],this.size=0}function Un(i,e){for(var t=i.length;t--;)if(Gn(i[t][0],e))return t;return-1}var Uf=Array.prototype,Vf=Uf.splice;function Qf(i){var e=this.__data__,t=Un(e,i);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vf.call(e,t,1),--this.size,!0}function Hf(i){var e=this.__data__,t=Un(e,i);return t<0?void 0:e[t][1]}function Yf(i){return Un(this.__data__,i)>-1}function zf(i,e){var t=this.__data__,n=Un(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this}function It(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])}}It.prototype.clear=Gf,It.prototype.delete=Qf,It.prototype.get=Hf,It.prototype.has=Yf,It.prototype.set=zf;var Za=Xs($t,"Map");function jf(){this.size=0,this.__data__={hash:new Kt,map:new(Za||It),string:new Kt}}function Wf(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}function Vn(i,e){var t=i.__data__;return Wf(e)?t[typeof e=="string"?"string":"hash"]:t.map}function $f(i){var e=Vn(this,i).delete(i);return this.size-=e?1:0,e}function Kf(i){return Vn(this,i).get(i)}function qf(i){return Vn(this,i).has(i)}function Xf(i,e){var t=Vn(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this}function ui(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])}}ui.prototype.clear=jf,ui.prototype.delete=$f,ui.prototype.get=Kf,ui.prototype.has=qf,ui.prototype.set=Xf;var er=wf(Object.getPrototypeOf,Object),Jf="[object Object]",Zf=Function.prototype,em=Object.prototype,tr=Zf.toString,tm=em.hasOwnProperty,im=tr.call(Object);function nm(i){if(!hi(i)||Gi(i)!=Jf)return!1;var e=er(i);if(e===null)return!0;var t=tm.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&tr.call(t)==im}function sm(){this.__data__=new It,this.size=0}function om(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t}function am(i){return this.__data__.get(i)}function rm(i){return this.__data__.has(i)}var lm=200;function cm(i,e){var t=this.__data__;if(t instanceof It){var n=t.__data__;if(!Za||n.length<lm-1)return n.push([i,e]),this.size=++t.size,this;t=this.__data__=new ui(n)}return t.set(i,e),this.size=t.size,this}function fi(i){var e=this.__data__=new It(i);this.size=e.size}fi.prototype.clear=sm,fi.prototype.delete=om,fi.prototype.get=am,fi.prototype.has=rm,fi.prototype.set=cm;var ir=typeof V=="object"&&V&&!V.nodeType&&V,nr=ir&&typeof module=="object"&&module&&!module.nodeType&&module,dm=nr&&nr.exports===ir,sr=dm?$t.Buffer:void 0;sr&&sr.allocUnsafe;function hm(i,e){return i.slice()}var or=$t.Uint8Array;function um(i){var e=new i.constructor(i.byteLength);return new or(e).set(new or(i)),e}function fm(i,e){var t=um(i.buffer);return new i.constructor(t,i.byteOffset,i.length)}function mm(i){return typeof i.constructor=="function"&&!Va(i)?Eu(er(i)):{}}function gm(i){return function(e,t,n){for(var s=-1,o=Object(e),r=n(e),l=r.length;l--;){var c=r[++s];if(t(o[c],c,o)===!1)break}return e}}var pm=gm(),io=function(){return $t.Date.now()},Am="Expected a function",ym=Math.max,Em=Math.min;function Qn(i,e,t){var n,s,o,r,l,c,d=0,h=!1,f=!1,m=!0;if(typeof i!="function")throw new TypeError(Am);e=Na(e)||0,pt(t)&&(h=!!t.leading,f="maxWait"in t,o=f?ym(Na(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function u(M){var B=n,_=s;return n=s=void 0,d=M,r=i.apply(_,B),r}function g(M){return d=M,l=setTimeout(y,e),h?u(M):r}function A(M){var B=M-c,_=M-d,E=e-B;return f?Em(E,o-_):E}function p(M){var B=M-c,_=M-d;return c===void 0||B>=e||B<0||f&&_>=o}function y(){var M=io();if(p(M))return C(M);l=setTimeout(y,A(M))}function C(M){return l=void 0,m&&n?u(M):(n=s=void 0,r)}function I(){l!==void 0&&clearTimeout(l),d=0,n=c=s=l=void 0}function P(){return l===void 0?r:C(io())}function k(){var M=io(),B=p(M);if(n=arguments,s=this,c=M,B){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(y,e),u(c)}return l===void 0&&(l=setTimeout(y,e)),r}return k.cancel=I,k.flush=P,k}function no(i,e,t){(t!==void 0&&!Gn(i[e],t)||t===void 0&&!(e in i))&&Js(i,e,t)}function Cm(i){return hi(i)&&Zs(i)}function so(i,e){if(!(e==="constructor"&&typeof i[e]=="function")&&e!="__proto__")return i[e]}function vm(i){return Nu(i,Ja(i))}function bm(i,e,t,n,s,o,r){var l=so(i,t),c=so(e,t),d=r.get(c);if(d){no(i,t,d);return}var h=o?o(l,c,t+"",i,e,r):void 0,f=h===void 0;if(f){var m=$s(c),u=!m&&Wa(c),g=!m&&!u&&Xa(c);h=c,m||u||g?$s(l)?h=l:Cm(l)?h=vu(l):u?(f=!1,h=hm(c)):g?(f=!1,h=fm(c)):h=[]:nm(c)||eo(c)?(h=l,eo(l)?h=vm(l):(!pt(l)||Ks(l))&&(h=mm(c))):f=!1}f&&(r.set(c,h),s(h,c,n,o,r),r.delete(c)),no(i,t,h)}function ar(i,e,t,n,s){i!==e&&pm(e,function(o,r){if(s||(s=new fi),pt(o))bm(i,e,r,t,ar,n,s);else{var l=n?n(so(i,r),o,r+"",i,e,s):void 0;l===void 0&&(l=o),no(i,r,l)}},Ja)}var wm=Gu(function(i,e,t){ar(i,e,t)});function oo({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),l=i.Cartesian3.fromDegrees(n.longitude,n.latitude,n.height),c=i.Transforms.eastNorthUpToFixedFrame(l),d=i.Matrix4.multiply(c,r,new i.Matrix4);if(e._root){if(!s){e._root.transform=d;return}try{const{center:h}=s,f=e.root.boundingVolume.boundingSphere,m=new i.Cartesian3(h.x,h.y,0),u=i.Matrix4.multiplyByPoint(d,m,new i.Cartesian3),g=i.Cartographic.fromCartesian(u),A=f.center,p=i.Transforms.eastNorthUpToFixedFrame(new i.Cartesian3(A.x,A.y,A.z)),y=new i.Cartesian3(-h.x+(n.X||0),-h.y+(n.Y||0),n.Z||0),C=i.Matrix4.fromTranslation(y),I=i.Matrix4.multiply(r,C,new i.Matrix4),P=i.Cartesian3.fromDegrees(g.longitude/Math.PI*180,g.latitude/Math.PI*180,n.height),k=i.Transforms.eastNorthUpToFixedFrame(P),M=i.Matrix4.multiply(k,I,new i.Matrix4);i.Matrix4.multiply(p,I,p),e._root.transform=M}catch(h){console.error("Update model position failed:",h)}}}const mi={NotLoaded:0,Loading:1,Loaded:2,Error:3},qt=4294967295,At=65535,ao=255,Im=8,rr=9,Sm=0,xm=99,Mm=67324752,lr=134695760,Bm=lr,cr=33639248,Tm=101010256,dr=101075792,Pm=117853008,gi=22,ro=20,lo=56,_m=12,Dm=20,hr=4,km=1,Nm=39169,Rm=10,Fm=1,Lm=21589,Om=28789,Gm=25461,Um=6534,Vm=30837,Qm=30805,ur=1,Hm=6,fr=8,mr=2048,Ym=16,zm=1,jm=2,Wm=4,$m=32,gr=61440,co=16384,ho=73,Km=420,qm=2048,Xm=1024,Jm=512,Zm="/",uo=30,eg=10,tg=14,ig=18,Ee=void 0,_t="undefined",Xt="function",ng=64;let pr=2;try{typeof navigator!=_t&&navigator.hardwareConcurrency&&(pr=navigator.hardwareConcurrency)}catch{}const sg={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:pr,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=_t&&CompressionStream,DecompressionStream:typeof DecompressionStream!=_t&&DecompressionStream},Ar=Object.assign({},sg);function og(){return Ar}function ag(i){return Math.max(i.chunkSize,ng)}function Hn(i){const{baseURI:e,chunkSize:t,maxWorkers:n,terminateWorkerTimeout:s,useCompressionStream:o,useWebWorkers:r,CompressionStream:l,DecompressionStream:c,CompressionStreamZlib:d,DecompressionStreamZlib:h,workerURI:f,wasmURI:m}=i;it("baseURI",e),it("wasmURI",m),it("workerURI",f),it("chunkSize",t),it("maxWorkers",n),it("terminateWorkerTimeout",s),it("useCompressionStream",o),it("useWebWorkers",r),it("CompressionStream",l),it("DecompressionStream",c),it("CompressionStreamZlib",d),it("DecompressionStreamZlib",h)}function it(i,e){e!==Ee&&(Ar[i]=e)}function rg(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 yr=[];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;yr[i]=e}class Yn{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^yr[(t^e[n])&255];this.crc=t}get(){return~this.crc}}class Er extends TransformStream{constructor(){let e;const t=new Yn;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 lg(i){if(typeof TextEncoder==_t){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 Ye={concat(i,e){if(i.length===0||e.length===0)return i.concat(e);const t=i[i.length-1],n=Ye.getPartial(t);return n===32?i.concat(e):Ye._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+Ye.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]=Ye.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=Ye.getPartial(s);return n.push(Ye.partial(e+o&31,e+o>32?t:n.pop(),1)),n}},zn={bytes:{fromBits(i){const t=Ye.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(Ye.partial(8*(t&3),n)),e}}},Cr={};Cr.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=zn.utf8String.toBits(i));const t=e._buffer=Ye.concat(e._buffer,i),n=e._length,s=e._length=n+Ye.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 l=e.blockSize+n-(e.blockSize+n&e.blockSize-1);l<=s;l+=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=Ye.concat(e,[Ye.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 d=0;d<16;d++)n[d]=i[d];let s=t[0],o=t[1],r=t[2],l=t[3],c=t[4];for(let d=0;d<=79;d++){d>=16&&(n[d]=e._S(1,n[d-3]^n[d-8]^n[d-14]^n[d-16]));const h=e._S(5,s)+e._f(d,o,r,l)+c+n[d]+e._key[Math.floor(d/20)]|0;c=l,l=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]+l|0,t[4]=t[4]+c|0}};const vr={};vr.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,l,c=1;if(s!==4&&s!==6&&s!==8)throw new Error("invalid aes key size");for(e._key=[r=i.slice(0),l=[]],o=s;o<4*s+28;o++){let d=r[o-1];(o%s===0||s===8&&o%s===4)&&(d=t[d>>>24]<<24^t[d>>16&255]<<16^t[d>>8&255]<<8^t[d&255],o%s===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),r[o]=r[o-s]^d}for(let d=0;o;d++,o--){const h=r[d&3?o:o-4];o<=4||d<4?l[d]=h:l[d]=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,l,c,d;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^=l||1,r=o[r]||1){let f=r^r<<1^r<<2^r<<3^r<<4;f=f>>8^f&255^99,t[h]=f,n[f]=h,d=s[c=s[l=s[h]]];let m=d*16843009^c*65537^l*257^h*16843008,u=s[f]*257^f*16843008;for(let g=0;g<4;g++)i[g][h]=u=u<<24^u>>>8,e[g][f]=m=m<<24^m>>>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],l=o[1],c=o[2],d=o[3],h=o[4];let f=i[0]^t[0],m=i[e?3:1]^t[1],u=i[2]^t[2],g=i[e?1:3]^t[3],A=4,p,y,C;for(let I=0;I<n;I++)p=r[f>>>24]^l[m>>16&255]^c[u>>8&255]^d[g&255]^t[A],y=r[m>>>24]^l[u>>16&255]^c[g>>8&255]^d[f&255]^t[A+1],C=r[u>>>24]^l[g>>16&255]^c[f>>8&255]^d[m&255]^t[A+2],g=r[g>>>24]^l[f>>16&255]^c[m>>8&255]^d[u&255]^t[A+3],A+=4,f=p,m=y,u=C;for(let I=0;I<4;I++)s[e?3&-I:I]=h[f>>>24]<<24^h[m>>16&255]<<16^h[u>>8&255]<<8^h[g&255]^t[A++],p=f,f=m,m=u,u=g,g=p;return s}};const cg={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}},br={};br.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=Ye.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 Ye.clamp(e,s)}};const Jt={importKey(i){return new Jt.hmacSha1(zn.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,l,c,d;const h=new ArrayBuffer(s),f=new DataView(h);let m=0;const u=Ye;for(e=zn.bytes.toBits(e),d=1;m<(s||1);d++){for(o=r=i.encrypt(u.concat(e,[d])),l=1;l<t;l++)for(r=i.encrypt(r),c=0;c<r.length;c++)o[c]^=r[c];for(l=0;m<(s||1)&&l<o.length;l++)f.setInt32(m,o[l]),m+=4}return h.slice(0,n/8)}};Jt.hmacSha1=class{constructor(i){const e=this,t=e._hash=Cr.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 dg=typeof crypto!=_t&&typeof crypto.getRandomValues==Xt,wr="Invalid password",Ir="Invalid signature",fo="zipjs-abort-check-password";function Sr(i){return dg?crypto.getRandomValues(i):cg.getRandomValues(i)}const pi=16,hg="raw",xr={name:"PBKDF2"},ug={name:"HMAC"},fg="SHA-1",mg=Object.assign({hash:ug},xr),mo=Object.assign({iterations:1e3,hash:{name:fg}},xr),gg=["deriveBits"],Qi=[8,12,16],Hi=[16,24,32],Dt=10,pg=[0,0,0,0],jn=typeof crypto!=_t,Yi=jn&&crypto.subtle,Mr=jn&&typeof Yi!=_t,yt=zn.bytes,Ag=vr.aes,yg=br.ctrGladman,Eg=Jt.hmacSha1;let Br=jn&&Mr&&typeof Yi.importKey==Xt,Tr=jn&&Mr&&typeof Yi.deriveBits==Xt;class Cg 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:Dr(e,t),signed:n,strength:s-1,pending:new Uint8Array})},async transform(r,l){const c=this,{password:d,strength:h,resolveReady:f,ready:m}=c;d?(await bg(c,h,d,nt(r,0,Qi[h]+2)),r=nt(r,Qi[h]+2),o?l.error(new Error(fo)):f()):await m;const u=new Uint8Array(r.length-Dt-(r.length-Dt)%pi);l.enqueue(Pr(c,r,u,0,Dt,!0))},async flush(r){const{signed:l,ctr:c,hmac:d,pending:h,ready:f}=this;if(d&&c){await f;const m=nt(h,0,h.length-Dt),u=nt(h,h.length-Dt);let g=new Uint8Array;if(m.length){const A=ji(yt,m);d.update(A);const p=c.update(A);g=zi(yt,p)}if(l){const A=nt(zi(yt,d.digest()),0,Dt);for(let p=0;p<Dt;p++)if(A[p]!=u[p])throw new Error(Ir)}r.enqueue(g)}}})}}class vg extends TransformStream{constructor({password:e,rawPassword:t,encryptionStrength:n}){let s;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:Dr(e,t),strength:n-1,pending:new Uint8Array})},async transform(o,r){const l=this,{password:c,strength:d,resolveReady:h,ready:f}=l;let m=new Uint8Array;c?(m=await wg(l,d,c),h()):await f;const u=new Uint8Array(m.length+o.length-o.length%pi);u.set(m,0),r.enqueue(Pr(l,o,u,m.length,0))},async flush(o){const{ctr:r,hmac:l,pending:c,ready:d}=this;if(l&&r){await d;let h=new Uint8Array;if(c.length){const f=r.update(ji(yt,c));l.update(f),h=zi(yt,f)}s.signature=zi(yt,l.digest()).slice(0,Dt),o.enqueue(go(h,s.signature))}}}),s=this}}function Pr(i,e,t,n,s,o){const{ctr:r,hmac:l,pending:c}=i,d=e.length-s;c.length&&(e=go(c,e),t=xg(t,d-d%pi));let h;for(h=0;h<=d-pi;h+=pi){const f=ji(yt,nt(e,h,h+pi));o&&l.update(f);const m=r.update(f);o||l.update(m),t.set(zi(yt,m),h+n)}return i.pending=nt(e,h),t}async function bg(i,e,t,n){const s=await _r(i,e,t,nt(n,0,Qi[e])),o=nt(n,Qi[e]);if(s[0]!=o[0]||s[1]!=o[1])throw new Error(wr)}async function wg(i,e,t){const n=Sr(new Uint8Array(Qi[e])),s=await _r(i,e,t,n);return go(n,s)}async function _r(i,e,t,n){i.password=null;const s=await Ig(hg,t,mg,!1,gg),o=await Sg(Object.assign({salt:n},mo),s,8*(Hi[e]*2+2)),r=new Uint8Array(o),l=ji(yt,nt(r,0,Hi[e])),c=ji(yt,nt(r,Hi[e],Hi[e]*2)),d=nt(r,Hi[e]*2);return Object.assign(i,{keys:{key:l,authentication:c,passwordVerification:d},ctr:new yg(new Ag(l),Array.from(pg)),hmac:new Eg(c)}),d}async function Ig(i,e,t,n,s){if(Br)try{return await Yi.importKey(i,e,t,n,s)}catch{return Br=!1,Jt.importKey(e)}else return Jt.importKey(e)}async function Sg(i,e,t){if(Tr)try{return await Yi.deriveBits(i,e,t)}catch{return Tr=!1,Jt.pbkdf2(e,i.salt,mo.iterations,t)}else return Jt.pbkdf2(e,i.salt,mo.iterations,t)}function Dr(i,e){return e===Ee?lg(i):e}function go(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 xg(i,e){if(e&&e>i.length){const t=i;i=new Uint8Array(e),i.set(t,0)}return i}function nt(i,e,t){return i.subarray(e,t)}function zi(i,e){return i.fromBits(e)}function ji(i,e){return i.toBits(e)}const Wi=12;class Mg extends TransformStream{constructor({password:e,passwordVerification:t,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(s,o){const r=this;if(r.password){const l=kr(r,s.subarray(0,Wi));if(r.password=null,l.at(-1)!=r.passwordVerification)throw new Error(wr);s=s.subarray(Wi)}n?o.error(new Error(fo)):o.enqueue(kr(r,s))}})}}class Bg extends TransformStream{constructor({password:e,passwordVerification:t}){super({start(){Object.assign(this,{password:e,passwordVerification:t}),Rr(this,e)},transform(n,s){const o=this;let r,l;if(o.password){o.password=null;const c=Sr(new Uint8Array(Wi));c[Wi-1]=o.passwordVerification,r=new Uint8Array(n.length+c.length),r.set(Nr(o,c),0),l=Wi}else r=new Uint8Array(n.length),l=0;r.set(Nr(o,n),l),s.enqueue(r)}})}}function kr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,t[n]);return t}function Nr(i,e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=Fr(i)^e[n],po(i,e[n]);return t}function Rr(i,e){const t=[305419896,591751049,878082192];Object.assign(i,{keys:t,crcKey0:new Yn(t[0]),crcKey2:new Yn(t[2])});for(let n=0;n<e.length;n++)po(i,e.charCodeAt(n))}function po(i,e){let[t,n,s]=i.keys;i.crcKey0.append([e]),t=~i.crcKey0.get(),n=Or(Math.imul(Or(n+Lr(t)),134775813)+1),i.crcKey2.append([n>>>24]),s=~i.crcKey2.get(),i.keys=[t,n,s]}function Fr(i){const e=i.keys[2]|2;return Lr(Math.imul(e,e^1)>>>8)}function Lr(i){return i&255}function Or(i){return i&4294967295}const Gr="Invalid uncompressed size",Tg="deflate-raw",Pg="deflate64-raw";class _g extends TransformStream{constructor(e,{chunkSize:t,CompressionStreamZlib:n,CompressionStream:s}){super({});const{compressed:o,encrypted:r,useCompressionStream:l,zipCrypto:c,signed:d,level:h}=e,f=this;let m,u,g=super.readable;(!r||c)&&d&&(m=new Er,g=Et(g,m)),o&&(g=Vr(g,l,{level:h,chunkSize:t},s,n,s)),r&&(c?g=Et(g,new Bg(e)):(u=new vg(e),g=Et(g,u))),Ur(f,g,()=>{let A;r&&!c&&(A=u.signature),(!r||c)&&d&&(A=new DataView(m.value.buffer).getUint32(0)),f.signature=A})}}class Dg extends TransformStream{constructor(e,{chunkSize:t,DecompressionStreamZlib:n,DecompressionStream:s}){super({});const{zipCrypto:o,encrypted:r,signed:l,signature:c,compressed:d,useCompressionStream:h,deflate64:f}=e;let m,u,g=super.readable;r&&(o?g=Et(g,new Mg(e)):(u=new Cg(e),g=Et(g,u))),d&&(g=Vr(g,h,{chunkSize:t,deflate64:f},s,n,s)),(!r||o)&&l&&(m=new Er,g=Et(g,m)),Ur(this,g,()=>{if((!r||o)&&l){const A=new DataView(m.value.buffer);if(c!=A.getUint32(0,!1))throw new Error(Ir)}})}}function Ur(i,e,t){e=Et(e,new TransformStream({flush:t})),Object.defineProperty(i,"readable",{get(){return e}})}function Vr(i,e,t,n,s,o){const r=e&&n?n:s||o,l=t.deflate64?Pg:Tg;try{i=Et(i,new r(l,t))}catch(c){if(e)if(s)i=Et(i,new s(l,t));else if(o)i=Et(i,new o(l,t));else throw c;else throw c}return i}function Et(i,e){return i.pipeThrough(e)}const kg="message",Ng="start",Rg="pull",Qr="data",Fg="ack",Hr="close",Lg="deflate",Yr="inflate";class Og extends TransformStream{constructor(e,t){super({});const n=this,{codecType:s}=e;let o;s.startsWith(Lg)?o=_g:s.startsWith(Yr)&&(o=Dg),n.outputSize=0;let r=0;const l=new o(e,t),c=super.readable,d=new TransformStream({transform(f,m){f&&f.length&&(r+=f.length,m.enqueue(f))},flush(){Object.assign(n,{inputSize:r})}}),h=new TransformStream({transform(f,m){if(f&&f.length&&(m.enqueue(f),n.outputSize+=f.length,e.outputSize!==Ee&&n.outputSize>e.outputSize))throw new Error(Gr)},flush(){const{signature:f}=l;Object.assign(n,{signature:f,inputSize:r})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(d).pipeThrough(l).pipeThrough(h)}})}}class Gg 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 zr=typeof Worker!=_t,jr=()=>{};function Ug({initModule:i}){jr=i}class Ao{constructor(e,{readable:t,writable:n},{options:s,config:o,streamOptions:r,useWebWorkers:l,transferStreams:c,workerURI:d},h){const{signal:f}=r;return Object.assign(e,{busy:!0,readable:t.pipeThrough(new Gg(o.chunkSize)).pipeThrough(new Vg(r),{signal:f}),writable:n,options:Object.assign({},s),workerURI:d,transferStreams:c,terminate(){return new Promise(m=>{const{worker:u,busy:g}=e;u?(g?e.resolveTerminated=m:(u.terminate(),m()),e.interface=null):m()})},onTaskFinished(){const{resolveTerminated:m}=e;m&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),m()),e.busy=!1,h(e)}}),(l&&zr?Qg:Wr)(e,o)}}class Vg extends TransformStream{constructor({onstart:e,onprogress:t,size:n,onend:s}){let o=0;super({async start(){e&&await yo(e,n)},async transform(r,l){o+=r.length,t&&await yo(t,o,n),l.enqueue(r)},async flush(){s&&await yo(s,o)}})}}async function yo(i,...e){try{await i(...e)}catch{}}function Wr(i,e){return{run:()=>Hg(i,e)}}function Qg(i,e){const{baseURI:t,chunkSize:n}=e;let{wasmURI:s}=e;if(!i.interface){typeof s==Xt&&(s=s());let o;try{o=jg(i.workerURI,t,i)}catch{return zr=!1,Wr(i,e)}Object.assign(i,{worker:o,interface:{run:()=>Yg(i,{chunkSize:n,wasmURI:s,baseURI:t})}})}return i.interface}async function Hg({options:i,readable:e,writable:t,onTaskFinished:n},s){let o;try{if(!i.useCompressionStream)try{await jr(s)}catch{i.useCompressionStream=!0}o=new Og(i,s),await e.pipeThrough(o).pipeTo(t,{preventClose:!0,preventAbort:!0});const{signature:r,inputSize:l,outputSize:c}=o;return{signature:r,inputSize:l,outputSize:c}}catch(r){throw o&&(r.outputSize=o.outputSize),r}finally{n()}}async function Yg(i,e){let t,n;const s=new Promise((f,m)=>{t=f,n=m});Object.assign(i,{reader:null,writer:null,resolveResult:t,rejectResult:n,result:s});const{readable:o,options:r}=i,{writable:l,closed:c}=zg(i.writable),d=Wn({type:Ng,options:r,config:e,readable:o,writable:l},i);d||Object.assign(i,{reader:o.getReader(),writer:l.getWriter()});const h=await s;return d||await l.getWriter().close(),await c,h}function zg(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 $r=!0;function jg(i,e,t){const n={type:"module"};let s,o;if(typeof i==Xt&&(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(kg,r=>Wg(r,t)),o}function Wn(i,{worker:e,writer:t,onTaskFinished:n,transferStreams:s}){try{const{value:o,readable:r,writable:l}=i,c=[];if(o&&(i.value=o,c.push(i.value.buffer)),s&&$r?(r&&c.push(r),l&&c.push(l)):i.readable=i.writable=null,c.length)try{return e.postMessage(i,c),!0}catch{$r=!1,i.readable=i.writable=null,e.postMessage(i)}else e.postMessage(i)}catch(o){throw t&&t.releaseLock(),n(),o}}async function Wg({data:i},e){const{type:t,value:n,messageId:s,result:o,error:r}=i,{reader:l,writer:c,resolveResult:d,rejectResult:h,onTaskFinished:f}=e;try{if(r){const{message:u,stack:g,code:A,name:p,outputSize:y}=r,C=new Error(u);Object.assign(C,{stack:g,code:A,name:p,outputSize:y}),m(C)}else{if(t==Rg){const{value:u,done:g}=await l.read();Wn({type:Qr,value:u,done:g,messageId:s},e)}t==Qr&&(await c.ready,await c.write(new Uint8Array(n)),Wn({type:Fg,messageId:s},e)),t==Hr&&m(null,o)}}catch(u){Wn({type:Hr,messageId:s},e),m(u)}function m(u,g){u?h(u):d(g),c&&c.releaseLock(),f()}}let Zt=[];const Eo=[];let Kr=0;async function $g(i,e){const{options:t,config:n}=e,{transferStreams:s,useWebWorkers:o,useCompressionStream:r,compressed:l,signed:c,encrypted:d}=t,{workerURI:h,maxWorkers:f}=n;e.transferStreams=s||s===Ee;const m=!l&&!c&&!d&&!e.transferStreams;return e.useWebWorkers=!m&&(o||o===Ee&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:Ee,t.useCompressionStream=r||r===Ee&&n.useCompressionStream,(await u()).run();async function u(){const A=Zt.find(p=>!p.busy);if(A)return qr(A),new Ao(A,i,e,g);if(Zt.length<f){const p={indexWorker:Kr};return Kr++,Zt.push(p),new Ao(p,i,e,g)}else return new Promise(p=>Eo.push({resolve:p,stream:i,workerOptions:e}))}function g(A){if(Eo.length){const[{resolve:p,stream:y,workerOptions:C}]=Eo.splice(0,1);p(new Ao(A,y,C,g))}else A.worker?(qr(A),Kg(A,e)):Zt=Zt.filter(p=>p!=A)}}function Kg(i,e){const{config:t}=e,{terminateWorkerTimeout:n}=t;Number.isFinite(n)&&n>=0&&(i.terminated?i.terminated=!1:i.terminateTimeout=setTimeout(async()=>{Zt=Zt.filter(s=>s!=i);try{await i.terminate()}catch{}},n))}function qr(i){const{terminateTimeout:e}=i;e&&(clearTimeout(e),i.terminateTimeout=null)}const qg="Writer iterator completed too soon",Xg="Content-Type",Jg=64*1024,Xr="writable";class Co{constructor(){this.size=0}init(){this.initialized=!0}}class Jr extends Co{get readable(){const e=this,{chunkSize:t=Jg}=e,n=new ReadableStream({start(){this.chunkOffset=0},async pull(s){const{offset:o=0,size:r,diskNumberStart:l}=n,{chunkOffset:c}=this,d=r===Ee?t:Math.min(t,r-c),h=await Le(e,o+c,d,l);s.enqueue(h),c+t>r||r===Ee&&!h.length&&d?s.close():this.chunkOffset+=t}});return n}}class $n extends Jr{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 Zg extends Co{constructor(e){super();const t=this,n=new TransformStream,s=[];e&&s.push([Xg,e]),Object.defineProperty(t,Xr,{get(){return n.writable}}),t.blob=new Response(n.readable,{headers:s}).blob()}getData(){return this.blob}}class ep extends Zg{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:l})=>o(l.result),onerror:()=>r(s.error)}),s.readAsText(n,e)})}}}class tp extends Jr{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,l=n;l==-1&&(l=o.length-1);let c=e;for(;o[l]&&c>=o[l].size;)c-=o[l].size,l++;const d=o[l];if(d){const h=d.size;if(c+t<=h)r=await Le(d,c,t);else{const f=h-c;r=new Uint8Array(t);const m=await Le(d,c,f);r.set(m,0);const u=await s.readUint8Array(e+f,t-f,n);r.set(u,f),m.length+u.length<t&&(r=r.subarray(0,m.length+u.length))}}else r=new Uint8Array;return s.lastDiskNumber=Math.max(l,s.lastDiskNumber),r}}class Zr extends Co{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 l=new WritableStream({async write(h){const{availableSize:f}=n;if(r)h.length>=f?(await c(h.subarray(0,f)),await d(),n.diskOffset+=s.size,n.diskNumber++,r=null,await this.write(h.subarray(f))):await c(h);else{const{value:m,done:u}=await e.next();if(u&&!m)throw new Error(qg);s=m,s.size=0,s.maxSize&&(n.maxSize=s.maxSize),n.availableSize=n.maxSize,await Kn(s),o=m.writable,r=o.getWriter(),await this.write(h)}},async close(){await r.ready,await d()}});Object.defineProperty(n,Xr,{get(){return l}});async function c(h){const f=h.length;f&&(await r.ready,await r.write(h),s.size+=f,n.size+=f,n.availableSize-=f)}async function d(){await r.close()}}}class ip{constructor(e){return Array.isArray(e)&&(e=new tp(e)),e instanceof ReadableStream&&(e={readable:e}),e}}class np{constructor(e){return e.writable===Ee&&typeof e.next==Xt&&(e=new Zr(e)),e instanceof WritableStream&&(e={writable:e}),e.size===Ee&&(e.size=0),e instanceof Zr||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}}async function Kn(i,e){if(i.init&&!i.initialized)await i.init(e);else return Promise.resolve()}function Le(i,e,t,n){return i.readUint8Array(e,t,n)}const el="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),sp=el.length==256;function op(i){if(sp){let e="";for(let t=0;t<i.length;t++)e+=el[i[t]];return e}else return new TextDecoder().decode(i)}function qn(i,e){return e&&e.trim().toLowerCase()=="cp437"?op(i):new TextDecoder(e).decode(i)}const tl="filename",il="rawFilename",nl="comment",sl="rawComment",ol="uncompressedSize",al="compressedSize",rl="offset",ll="diskNumberStart",vo="lastModDate",bo="rawLastModDate",cl="lastAccessDate",ap="rawLastAccessDate",dl="creationDate",hl="rawCreationDate",rp=[tl,il,ol,al,vo,bo,nl,sl,cl,dl,hl,rl,ll,"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 ul{constructor(e){rp.forEach(t=>this[t]=e[t])}}const lp="filenameEncoding",cp="commentEncoding",dp="decodeText",hp="extractPrependedData",up="extractAppendedData",fp="password",mp="rawPassword",gp="passThrough",pp="signal",Ap="checkPasswordOnly",yp="checkOverlappingEntryOnly",Ep="checkOverlappingEntry",Cp="checkSignature",vp="useWebWorkers",bp="useCompressionStream",wp="transferStreams",Ip="preventClose",wo="File format is not recognized",Sp="End of central directory not found",xp="End of Zip64 central directory locator not found",Mp="Central directory header not found",Bp="Local file header not found",Tp="Zip64 extra field not found",Pp="File contains encrypted entry",_p="Encryption method not supported",fl="Compression method not supported",ml="Split zip file",Dp="Overlapping entry found",gl="utf-8",kp="UTF8",pl="cp437",Np=[[ol,qt],[al,qt],[rl,qt],[ll,At]],Rp={[At]:{getValue:Ce,bytes:4},[qt]:{getValue:Ai,bytes:8}};class Io{constructor(e,t={}){Object.assign(this,{reader:new ip(e),options:t,config:og(),readRanges:[]})}async*getEntriesGenerator(e={}){const t=this;let{reader:n}=t;const{config:s}=t;if(await Kn(n),(n.size===Ee||!n.readUint8Array)&&(n=new $n(await new Response(n.readable).blob()),await Kn(n)),n.size<gi)throw new Error(wo);n.chunkSize=ag(s);const o=await Qp(n,Tm,n.size,gi,At*16);if(!o){const w=await Le(n,0,4),D=ve(w);throw Ce(D)==lr?new Error(ml):new Error(Sp)}const r=ve(o);let l=Ce(r,12),c=Ce(r,16);const d=o.offset,h=Fe(r,20),f=d+gi+h;let m=Fe(r,4);const u=n.lastDiskNumber||0;let g=Fe(r,6),A=Fe(r,8),p=0,y=0;if(c==qt||l==qt||A==At||g==At){const w=await Le(n,o.offset-ro,ro),D=ve(w);if(Ce(D,0)==Pm){c=Ai(D,8);let F=await Le(n,c,lo,-1),U=ve(F);const R=o.offset-ro-lo;if(Ce(U,0)!=dr&&c!=R){const b=c;c=R,c>b&&(p=c-b),F=await Le(n,c,lo,-1),U=ve(F)}if(Ce(U,0)!=dr)throw new Error(xp);m==At&&(m=Ce(U,16)),g==At&&(g=Ce(U,20)),A==At&&(A=Ai(U,32)),l==qt&&(l=Ai(U,40)),c-=l}}if(c>=n.size&&(p=n.size-c-l-gi,c=n.size-l-gi),u!=m)throw new Error(ml);if(c<0)throw new Error(wo);let C=0,I=await Le(n,c,l,g),P=ve(I);if(l){const w=o.offset-l;if(Ce(P,C)!=cr&&c!=w){const D=c;c=w,c>D&&(p+=c-D),I=await Le(n,c,l,g),P=ve(I)}}const k=o.offset-c-(n.lastDiskOffset||0);if(l!=k&&k>=0&&(l=k,I=await Le(n,c,l,g),P=ve(I)),c<0||c>=n.size)throw new Error(wo);const M=Oe(t,e,lp),B=Oe(t,e,cp);for(let w=0;w<A;w++){const D=new Fp(n,s,t.options);if(Ce(P,C)!=cr)throw new Error(Mp);Al(D,P,C+6);const F=!!D.bitFlag.languageEncodingFlag,U=C+46,R=U+D.filenameLength,b=R+D.extraFieldLength,v=Fe(P,C+4),x=v>>8==0,N=v>>8==3,O=I.subarray(U,R),Q=Fe(P,C+32),L=b+Q,T=I.subarray(b,L),S=F,G=F,Y=Ce(P,C+38),q=Y&ao,W={readOnly:!!(q&zm),hidden:!!(q&jm),system:!!(q&Wm),directory:!!(q&Ym),archive:!!(q&$m)},re=Ce(P,C+42)+p,ae=Oe(t,e,dp)||qn,de=S?gl:M||pl,he=G?gl:B||pl;let ge=ae(O,de);ge===Ee&&(ge=qn(O,de));let De=ae(T,he);De===Ee&&(De=qn(T,he)),Object.assign(D,{versionMadeBy:v,msDosCompatible:x,compressedSize:0,uncompressedSize:0,commentLength:Q,offset:re,diskNumberStart:Fe(P,C+34),internalFileAttributes:Fe(P,C+36),externalFileAttributes:Y,msdosAttributesRaw:q,msdosAttributes:W,rawFilename:O,filenameUTF8:S,commentUTF8:G,rawExtraField:I.subarray(R,b),rawComment:T,filename:ge,comment:De}),y=Math.max(re,y),yl(D,D,P,C+6);const Re=D.externalFileAttributes>>16&At;D.unixMode===Ee&&(Re&(Km|ho|co))!=0&&(D.unixMode=Re);const We=!!(D.unixMode&qm),Ve=!!(D.unixMode&Xm),et=!!(D.unixMode&Jm),$=D.unixMode!==Ee?(D.unixMode&ho)!=0:N&&(Re&ho)!=0,z=D.unixMode!==Ee&&(D.unixMode&gr)==co,ee=(Re&gr)==co;Object.assign(D,{setuid:We,setgid:Ve,sticky:et,unixExternalUpper:Re,internalFileAttribute:D.internalFileAttributes,externalFileAttribute:D.externalFileAttributes,executable:$,directory:z||ee||x&&W.directory||ge.endsWith(Zm)&&!D.uncompressedSize,zipCrypto:D.encrypted&&!D.extraFieldAES});const ke=new ul(D);ke.getData=(tt,Ri)=>D.getData(tt,ke,t.readRanges,Ri),ke.arrayBuffer=async tt=>{const Ri=new TransformStream,[zt]=await Promise.all([new Response(Ri.readable).arrayBuffer(),D.getData(Ri,ke,t.readRanges,tt)]);return zt},C=L;const{onprogress:rt}=e;if(rt)try{await rt(w+1,A,new ul(D))}catch{}yield ke}const _=Oe(t,e,hp),E=Oe(t,e,up);return _&&(t.prependedData=y>0?await Le(n,0,y):new Uint8Array),t.comment=h?await Le(n,d+gi,h):new Uint8Array,E&&(t.appendedData=f<n.size?await Le(n,f,n.size-f):new Uint8Array),!0}async getEntries(e={}){const t=[];for await(const n of this.getEntriesGenerator(e))t.push(n);return t}async close(){}}class Fp{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:l,diskNumberStart:c,extraFieldAES:d,extraFieldZip64:h,compressionMethod:f,config:m,bitFlag:u,signature:g,rawLastModDate:A,uncompressedSize:p,compressedSize:y}=o,{dataDescriptor:C}=u,I=t.localDirectory={},P=await Le(r,l,uo,c),k=ve(P);let M=Oe(o,s,fp),B=Oe(o,s,mp);const _=Oe(o,s,gp);if(M=M&&M.length&&M,B=B&&B.length&&B,d&&d.originalCompressionMethod!=xm)throw new Error(fl);if(f!=Sm&&f!=Im&&f!=rr&&!_)throw new Error(fl);if(Ce(k,0)!=Mm)throw new Error(Bp);Al(I,k,4);const{extraFieldLength:E,filenameLength:w,lastAccessDate:D,creationDate:F}=I;I.rawExtraField=E?await Le(r,l+uo+w,E,c):new Uint8Array,yl(o,I,k,4,!0),Object.assign(t,{lastAccessDate:D,creationDate:F});const U=o.encrypted&&I.encrypted&&!_,R=U&&!d;if(_||(t.zipCrypto=R),U){if(!R&&d.strength===Ee)throw new Error(_p);if(!M&&!B)throw new Error(Pp)}const b=l+uo+w+E,v=y,x=r.readable;Object.assign(x,{diskNumberStart:c,offset:b,size:v});const N=Oe(o,s,pp),O=Oe(o,s,Ap);let Q=Oe(o,s,Ep);const L=Oe(o,s,yp);L&&(Q=!0);const{onstart:T,onprogress:S,onend:G}=s,Y=f==rr;let q=Oe(o,s,bp);Y&&(q=!1);const W={options:{codecType:Yr,password:M,rawPassword:B,zipCrypto:R,encryptionStrength:d&&d.strength,signed:Oe(o,s,Cp)&&!_,passwordVerification:R&&(C?A>>>8&ao:g>>>24&ao),outputSize:_?y:p,signature:g,compressed:f!=0&&!_,encrypted:o.encrypted&&!_,useWebWorkers:Oe(o,s,vp),useCompressionStream:q,transferStreams:Oe(o,s,wp),deflate64:Y,checkPasswordOnly:O},config:m,streamOptions:{signal:N,size:v,onstart:T,onprogress:S,onend:G}};Q&&await Vp({reader:r,fileEntry:t,offset:l,diskNumberStart:c,signature:g,compressedSize:y,uncompressedSize:p,dataOffset:b,dataDescriptor:C||I.bitFlag.dataDescriptor,extraFieldZip64:h||I.extraFieldZip64,readRanges:n});let re;try{if(!L){O&&(e=new WritableStream),e=new np(e),await Kn(e,_?y:p),{writable:re}=e;const{outputSize:ae}=await $g({readable:x,writable:re},W);if(e.size+=ae,ae!=(_?y:p))throw new Error(Gr)}}catch(ae){if(ae.outputSize!==Ee&&(e.size+=ae.outputSize),!O||ae.message!=fo)throw ae}finally{!Oe(o,s,Ip)&&re&&!re.locked&&await re.getWriter().close()}return O||L?Ee:e.getData?e.getData():re}}function Al(i,e,t){const n=i.rawBitFlag=Fe(e,t+2),s=(n&ur)==ur,o=Ce(e,t+6);Object.assign(i,{encrypted:s,version:Fe(e,t),bitFlag:{level:(n&Hm)>>1,dataDescriptor:(n&fr)==fr,languageEncodingFlag:(n&mr)==mr},rawLastModDate:o,lastModDate:Hp(o),filenameLength:Fe(e,t+22),extraFieldLength:Fe(e,t+24)})}function yl(i,e,t,n,s){const{rawExtraField:o}=e,r=e.extraField=new Map,l=ve(new Uint8Array(o));let c=0;try{for(;c<o.length;){const C=Fe(l,c),I=Fe(l,c+2);r.set(C,{type:C,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{}const d=Fe(t,n+4);Object.assign(e,{signature:Ce(t,n+eg),compressedSize:Ce(t,n+tg),uncompressedSize:Ce(t,n+ig)});const h=r.get(km);h&&(Lp(h,e),e.extraFieldZip64=h);const f=r.get(Om);f&&(El(f,tl,il,e,i),e.extraFieldUnicodePath=f);const m=r.get(Gm);m&&(El(m,nl,sl,e,i),e.extraFieldUnicodeComment=m);const u=r.get(Nm);u?(Op(u,e,d),e.extraFieldAES=u):e.compressionMethod=d;const g=r.get(Rm);g&&(Gp(g,e),e.extraFieldNTFS=g);const A=r.get(Qm);if(A)Cl(A,e,!1),e.extraFieldUnix=A;else{const C=r.get(Vm);C&&(Cl(C,e,!0),e.extraFieldInfoZip=C)}const p=r.get(Lm);p&&(Up(p,e,s),e.extraFieldExtendedTimestamp=p);const y=r.get(Um);y&&(e.extraFieldUSDZ=y)}function Lp(i,e){e.zip64=!0;const t=ve(i.data),n=Np.filter(([s,o])=>e[s]==o);for(let s=0,o=0;s<n.length;s++){const[r,l]=n[s];if(e[r]==l){const c=Rp[l];e[r]=i[r]=c.getValue(t,o),o+=c.bytes}else if(i[r])throw new Error(Tp)}}function El(i,e,t,n,s){const o=ve(i.data),r=new Yn;r.append(s[t]);const l=ve(new Uint8Array(4));l.setUint32(0,r.get(),!0);const c=Ce(o,1);Object.assign(i,{version:kt(o,0),[e]:qn(i.data.subarray(5)),valid:!s.bitFlag.languageEncodingFlag&&c==Ce(l,0)}),i.valid&&(n[e]=i[e],n[e+kp]=!0)}function Op(i,e,t){const n=ve(i.data),s=kt(n,4);Object.assign(i,{vendorVersion:kt(n,0),vendorId:kt(n,2),strength:s,originalCompressionMethod:t,compressionMethod:Fe(n,5)}),e.compressionMethod=i.compressionMethod}function Gp(i,e){const t=ve(i.data);let n=4,s;try{for(;n<i.data.length&&!s;){const o=Fe(t,n),r=Fe(t,n+2);o==Fm&&(s=i.data.slice(n+4,n+4+r)),n+=4+r}}catch{}try{if(s&&s.length==24){const o=ve(s),r=o.getBigUint64(0,!0),l=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(i,{rawLastModDate:r,rawLastAccessDate:l,rawCreationDate:c});const d=So(r),h=So(l),f=So(c),m={lastModDate:d,lastAccessDate:h,creationDate:f};Object.assign(i,m),Object.assign(e,m)}}catch{}}function Cl(i,e,t){try{const n=ve(new Uint8Array(i.data));let s=0;const o=kt(n,s++),r=kt(n,s++),l=i.data.subarray(s,s+r);s+=r;const c=vl(l),d=kt(n,s++),h=i.data.subarray(s,s+d);s+=d;const f=vl(h);let m=Ee;if(!t&&s+2<=i.data.length){const u=i.data;m=new DataView(u.buffer,u.byteOffset+s,2).getUint16(0,!0)}Object.assign(i,{version:o,uid:c,gid:f,unixMode:m}),c!==Ee&&(e.uid=c),f!==Ee&&(e.gid=f),m!==Ee&&(e.unixMode=m)}catch{}}function vl(i){const e=new Uint8Array(4);return e.set(i,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Up(i,e,t){const n=ve(i.data),s=kt(n,0),o=[],r=[];t?((s&1)==1&&(o.push(vo),r.push(bo)),(s&2)==2&&(o.push(cl),r.push(ap)),(s&4)==4&&(o.push(dl),r.push(hl))):i.data.length>=5&&(o.push(vo),r.push(bo));let l=1;o.forEach((c,d)=>{if(i.data.length>=l+4){const h=Ce(n,l);e[c]=i[c]=new Date(h*1e3);const f=r[d];i[f]=h}l+=4})}async function Vp({reader:i,fileEntry:e,offset:t,diskNumberStart:n,signature:s,compressedSize:o,uncompressedSize:r,dataOffset:l,dataDescriptor:c,extraFieldZip64:d,readRanges:h}){let f=0;if(n)for(let g=0;g<n;g++){const A=i.readers[g];f+=A.size}let m=0;if(c&&(d?m=Dm:m=_m),m){const g=await Le(i,l+o,m+hr,n);if(Ce(ve(g),0)==Bm){const p=Ce(ve(g),4);let y,C;d?(y=Ai(ve(g),8),C=Ai(ve(g),16)):(y=Ce(ve(g),8),C=Ce(ve(g),12)),(e.encrypted&&!e.zipCrypto||p==s)&&y==o&&C==r&&(m+=hr)}}const u={start:f+t,end:f+l+o+m,fileEntry:e};for(const g of h)if(g.fileEntry!=e&&u.start>=g.start&&u.start<g.end){const A=new Error(Dp);throw A.overlappingEntry=g.fileEntry,A}h.push(u)}async function Qp(i,e,t,n,s){const o=new Uint8Array(4),r=ve(o);Yp(r,0,e);const l=n+s;return await c(n)||await c(Math.min(l,t));async function c(d){const h=t-d,f=await Le(i,h,d);for(let m=f.length-n;m>=0;m--)if(f[m]==o[0]&&f[m+1]==o[1]&&f[m+2]==o[2]&&f[m+3]==o[3])return{offset:h+m,buffer:f.slice(m,m+n).buffer}}}function Oe(i,e,t){return e[t]===Ee?i.options[t]:e[t]}function Hp(i){const e=(i&4294901760)>>16,t=i&At;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 So(i){return new Date(Number(i/BigInt(1e4)-BigInt(116444736e5)))}function kt(i,e){return i.getUint8(e)}function Fe(i,e){return i.getUint16(e,!0)}function Ce(i,e){return i.getUint32(e,!0)}function Ai(i,e){return Number(i.getBigUint64(e,!0))}function Yp(i,e,t){i.setUint32(e,t,!0)}function ve(i){return new DataView(i.buffer)}try{Hn({baseURI:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href})}catch{}const Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function zp(i){let e;i({wasmURI:()=>(e||(e="data:application/wasm;base64,"+(t=>{t=(r=>{const l=(r=(r+"").replace(/[^A-Za-z0-9+/=]/g,"")).length,c=[];for(let d=0;l>d;d+=4){const h=Je.indexOf(r[d])<<18|Je.indexOf(r[d+1])<<12|(63&Je.indexOf(r[d+2]))<<6|63&Je.indexOf(r[d+3]);c.push(h>>16&255),r[d+2]!=="="&&c.push(h>>8&255),r[d+3]!=="="&&c.push(255&h)}return new Uint8Array(c)})(t);let n=new Uint8Array(1024),s=0;for(let r=0;r<t.length;){const l=t[r++];if(128&l){const c=3+(127&l),d=t[r++]<<8|t[r++],h=s-d;o(s+c);for(let f=0;c>f;f++)n[s++]=n[h+f]}else{const c=l;o(s+c);for(let d=0;c>d&&r<t.length;d++)n[s++]=t[r++]}}return(r=>{let l="";const c=r.length;let d=0;for(;c>d+2;d+=3){const f=r[d]<<16|r[d+1]<<8|r[d+2];l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+Je[63&f]}const h=c-d;if(h===1){const f=r[d]<<16;l+=Je[f>>18&63]+Je[f>>12&63]+"=="}else if(h===2){const f=r[d]<<16|r[d+1]<<8;l+=Je[f>>18&63]+Je[f>>12&63]+Je[f>>6&63]+"="}return l})(new Uint8Array(n.buffer.slice(0,s)));function o(r){if(n.length<r){let l=2*n.length;for(;r>l;)l*=2;const c=new Uint8Array(l);c.set(n.subarray(0,s)),n=c}}})("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BAGZgAAEAVmAAAQB2YAABAE5gAAEAbmAAAQBeYAABAH5gAAEAQWAAAQBhYAABAFFgAAEAcWAAAQBJYAABAGlgAAEAWWAAAQB5YAABAEVgAAEAZWAAAQBVYAABAHVgAAEATWAAAQBtYAABAF1gAAEAfWAAAQBDYAABAGNgAAEAU2AAAQBzYAABIARMwIArYAABAFtgAAEAe2AAAQBHYAABAGdgAAEAV2AAAQB3YAABAE9gAAEAb2AAAQBfYAABAH9gAAEAROAAMIFEwEJAJOAAAgBk4AACAFTgAAIAVOAAAgB04AACAHTgAAIATOAAAgBM4AACAGzgAAIAbOAAAgBc4AACAFzgAAIAfOAAAgB84AACAELgAAIgBDagAQCgAAEgAAIAUuAAAgBS4AACAHLgAAIAcuAAAgBK4AACAErgAAIAauAAAgBq4AACAFrgAAIAWuAAAgB64AACAHrgAAIARuAAAgBG4AACAGbgAAIAZuAAAgBW4AACAFbgAAIAduAAAgB24AACAE7gAAIATuAAAgBu4AACAG7gAAIAXuAAAgBe4AACAH7gAAIAfuAAAiBA7YBB4AACAGHgAAIAYeAAAgBR4AACAFHgAAIAceAAAgBx4AACAEngAAIASeAAAgBp4AACAGngAAIAWeAAAgBZ4AACAHngAAIAeeAAAgBF4AACAEXgAAIAZeAAAgBl4AACAFXgAAIAVeAAAgB14AACAHXgAAIATeAAAgBN4AACAG3gAAIAbeAAAgBd4AACAF3gAAIAfeAAAgB94AACAEPgAAIAQ+AAAgBj4AACAGPgAAIAU+AAAgBT4AACAHPgAAIAc+AAAgBL4AACAEvgAAIAa+AAAgBr4AACAFvgAAIAW+AAAgB74AACAHvgAAIAR+AAAgBH4AACAGfgAAIAZ+AAAgBX4AACAFfgAAIAd+AAAgB34AACAE/gAAIAT+AAAgBv4AACAG/gAAIAX+AAAgBf4AACAH/gAAIAf+AAAiBBAoBQIAABAEggAAEAWCAAAQBEIAABAFQgAAEATCAAAQBcIIFVgMHAEiAAAQBKIAABAFogAAEARiAAAQBWIAABAE4gAAEAXiAAAQBBIAABAFEgAAEASSAAAQBZIAABAEUgAAEAVSAAAQBNIAABAF0gAAEAQOAAEIBg4AABAFDgAAEAcOAAAQBI4AABAGjgAAEAWOAAAQB44AABIC+K4AAdIECxgEFgABcAQWCBUoBFIAABAEMgAAEARyAAASAvlaABEQBBYIGBAEaggXqAQWAA9QBBYADuAEFgAOcgE92gAAEARGAAAQBCYAABAEZgAAEgQACARWAAAQBDYAABAEdgAAEgL59gAKkgQZAAQWAAiyBBaYBBYABtAEFgD3fAxsLTYMfuYcABIC+rooABIEHUYkABAEEjAAEAQWKAAQEQbAcC4C9CosAS40AO4UALwEGhAAEgQWIgQAEgQEKgQAEgQGSgQAEgIS2ggAEAQuEAAQBDIQABIAF24FHeQTgHQsjhQBfhQXLAhARgAVtBgcJBgoFC4A6uAQNAg4BgAclBJQeC2mFAJCFAIiFAICFAHiBAGiBAFyBBh8BEIAABAEUgAAEARiAAAQBHIAABAEggAAEASiAAAQBMIAABAE4gAAEAUCAAAQBUIAABIEGvQFwgAAEAYCAAAQBoIAABAHAgAAEAeCAAG8DHwtyjQBvgQBrgQBngQBjgQBfgQBbgQBXgQBTgQBPgQBLgQBHgQBDgQE8AYCvAEGAUc0CC22BAMcBBIAAAgEIgAAEgQEzgQJLARCAAA6DAAyBnqyAqmuEACSBB3OBAE8BCIAACIEAGIUADIEIt4MADAEggQCUgDKEgQBrAYCBCC8BBIMADIA/SAoBABAMAEGRIQv/gCUfgMDAgIKxBQgJCQoKgEk3gAABAQ2AAAEBDoAAAQEPgAABARCEAAEBEYQAAQEShAABAROEAAEBFIwAAQEVjAABARaMAAEBF4wAAQEYnAABARmcAAEBGpwAAQEbmwABARyBffsEBAQFBYHB1QEHgAABAQiEAAGAXSqCAAEBCowAAYAnsooAAYEBMJkAAYEBTJkAAYEBaLkAAYEBpLkAAYIDdYABzoUBvI0BqJ0BkLwBgAIbHLwAAQEdvAABgA9PgH05A9AqAQ==")),e)})}let Se,yi,Ze,$i;function jp(i){if(Se=i,{malloc:yi,free:Ze,memory:$i}=Se,typeof yi!="function"||typeof Ze!="function"||!$i)throw Se=yi=Ze=$i=null,new Error("Invalid WASM module")}function bl(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=yi(s),this.in=yi(o),this.inBufferSize=o,this._scratch=new Uint8Array(s),i?(this._process=Se.deflate_process,this._last_consumed=Se.deflate_last_consumed,this._end=Se.deflate_end,this.streamHandle=Se.deflate_new(),e==="gzip"?r=Se.deflate_init_gzip(this.streamHandle,n):e==="deflate-raw"?r=Se.deflate_init_raw(this.streamHandle,n):r=Se.deflate_init(this.streamHandle,n)):e==="deflate64-raw"?(this._process=Se.inflate9_process,this._last_consumed=Se.inflate9_last_consumed,this._end=Se.inflate9_end,this.streamHandle=Se.inflate9_new(),r=Se.inflate9_init_raw(this.streamHandle)):(this._process=Se.inflate_process,this._last_consumed=Se.inflate_last_consumed,this._end=Se.inflate_end,this.streamHandle=Se.inflate_new(),e==="deflate-raw"?r=Se.inflate_init_raw(this.streamHandle):e==="gzip"?r=Se.inflate_init_gzip(this.streamHandle):r=Se.inflate_init(this.streamHandle)),r!==0)throw new Error("init failed:"+r)},transform(r,l){try{const c=r,d=new Uint8Array($i.buffer),h=this._process,f=this._last_consumed,m=this.out,u=this._scratch;let g=0;for(;g<c.length;){const A=Math.min(c.length-g,32768);(!this.in||this.inBufferSize<A)&&(this.in&&Ze&&Ze(this.in),this.in=yi(A),this.inBufferSize=A),d.set(c.subarray(g,g+A),this.in);const p=h(this.streamHandle,this.in,A,m,s,0),y=p&16777215;if(y&&(u.set(d.subarray(m,m+y),0),l.enqueue(u.slice(0,y))),!i){const I=p>>24&255,P=I&128?I-256:I;if(P<0)throw new Error("process error:"+P)}const C=f(this.streamHandle);if(C===0)break;g+=C}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out),l.error(c)}},flush(r){try{const l=new Uint8Array($i.buffer),c=this._process,d=this.out,h=this._scratch;for(;;){const f=c(this.streamHandle,0,0,d,s,4),m=f&16777215,u=f>>24&255;if(!i){const g=u&128?u-256:u;if(g<0)throw new Error("process error:"+g)}if(m&&(h.set(l.subarray(d,d+m),0),r.enqueue(h.slice(0,m))),u===1||m===0)break}}catch(l){r.error(l)}finally{if(this._end&&this.streamHandle){const l=this._end(this.streamHandle);l!==0&&r.error(new Error("end error:"+l))}this.in&&Ze&&Ze(this.in),this.out&&Ze&&Ze(this.out)}}})}class Wp{constructor(e="deflate",t){return bl(!0,e,t)}}class $p{constructor(e="deflate",t){return bl(!1,e,t)}}let wl=!1;async function Kp(i,{baseURI:e}){if(!wl){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=qp(i);else throw o}const s=await WebAssembly.instantiate(t);jp(s.instance.exports),wl=!0}}function qp(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 xo;zp(Hn),Ug({initModule:i=>{if(!xo){let{wasmURI:e}=i;typeof e==Xt&&(e=e()),xo=Kp(e,i)}return xo}}),Hn({CompressionStreamZlib:Wp,DecompressionStreamZlib:$p});const Mo={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(Mo))for(const t of Object.keys(Mo[e])){const n=Mo[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})(),rg(Hn);const Xp="E84#E3C4!8C4&A1";async function St(i){try{const e=await fetch(i);if(!e.ok)return!1;const t=await e.blob();try{const n=new Io(new $n(t),{password:Xp}),o=(await n.getEntries()).find(l=>!l.directory&&l.filename.endsWith(".json"));if(!o)return await n.close(),!1;const r=await o.getData(new ep);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 Jp(){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 Ki{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 Il="35aa3175ce8b1a55331e.64c93d5e3268979d98c900";class Sl{cesium;viewer;modelList=[];hasLoaded3dTiles={};mapRecordModelId={};mapTileset={};BIMmodelId="";lazyLoadingCount=0;events=new Ki;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?wm({},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:mi.NotLoaded}),this.mapRecordModelId[o]=!1}await this.load3DTilesModel(n)}}async load3DTilesModel(e){const t=this.modelList.filter(r=>r.state===mi.NotLoaded);if(!t.length)return;const n=t.length;this.events.emit("loadingStatus",`正在加载 ${n} 个模型`);let s=0,o=!1;for(const r of t){s++;try{r.state=mi.Loading;const l=r.url,c=this.getBaseUrlPath(l);e.loadTreeNodeDetails=!1,e.loadTreeNodeDetails&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}构件信息`);let d=e.loadTreeNodeDetails?await St(`${c}${e.loadTreeNodeDetailsUrl}`):!1;e.loadTree=!1,e.loadTree&&this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}目录树`);const h=e.loadTree?await St(`${c}${e.loadTreeUrl}`):!1;this.events.emit("loadingStatus",`正在加载第 ${s}/${n} 个模型: 加载${r.modelName}模型数据`);const f=e.boxRegionUrl?await St(`${c}${e.boxRegionUrl}`):!1,m=e.batchIDInfoUrl?await St(`${c}${e.batchIDInfoUrl}`):!1;m&&(d||(d=m));const u=await this.loadTilesetWithZipSupport(l,r.modelId,e.tilesetOptions||{},this.cesium);this.viewer.scene.primitives.add(u),await u.readyPromise;const g=`${u?.asset?.tilesetVersion??r.modelId}`;this.mapTileset[`${r.modelId}`]=u;const A={versionId:g,selectedFn:e.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:r.url,treeUrl:`${c}${e.loadTreeUrl}`,nodeUrl:`${c}${e.loadTreeNodeDetailsUrl}`,formData:r.formData,type:"BIM"},node:d||null,tree:h||null,box:null};if(f?.min&&f?.max){const p={x:f.min.X,y:f.min.Y,z:f.min.Z},y={x:f.max.X,y:f.max.Y,z:f.max.Z},C={x:(p.x+y.x)/2,y:(p.y+y.y)/2,z:(p.z+y.z)/2};A.box={min:p,max:y,center:C}}if(!r.formData){const p=await St(`${r.outPutPath}${r.dbName}${e.regionUrl}`);if(p)r.formData={modelId:r.modelId.toString(),longitude:p.Longitude,latitude:p.Latitude,distance:1e-6,rotation:30,totalRotation:p.DAngle||0,height:p.MinHeight,lonlat:1e-5,heightDistance:1,modelOptions:[{value:r.modelId.toString(),label:r.modelName}],X:p?.X||0,Y:p?.Y||0,Z:p?.Z||0};else{const y=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:y+1,label:r.modelName}],X:0,Y:0,Z:0}}}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1,A.model.formData=r.formData),u.leiting=A,oo({Cesium:this.cesium,tileset:u}),r.state=mi.Loaded,this.mapRecordModelId[r.modelId]=!0,this.events.emit("tilesetLoaded",u),e.tilesLoad3dTiles&&e.tilesLoad3dTiles(u),!o&&e.flyTo&&(this.BIMmodelId=r.modelId,this.flyToTileset({modelId:this.BIMmodelId,options:{duration:e.flyToDuration??0}}),o=!0),e.delay&&await new Promise(p=>setTimeout(p,e.delay))}catch(l){console.error(`模型 ${r.modelName} 加载失败:`,l),this.events.emit("loadingStatus",`模型 ${r.modelName} 加载失败`),r.state=mi.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:l,dbName:c,modelId:d}=r,h=`${l}${c}/tileset.json`,f=await n.Cesium3DTileset.fromUrl(h,{maximumScreenSpaceError:16,preferLeaves:!0,cullWithChildrenBounds:!0,...t?.tilesetOptions});if(f.colorBlendMode=this.cesium.Cesium3DTileColorBlendMode.REPLACE,this.viewer.scene.primitives.add(f),await f.readyPromise,this.mapTileset[`${d}`]=f,this.hasLoaded3dTiles[`${d}`]=(this.hasLoaded3dTiles[`${d}`]||0)+1,this.mapRecordModelId[`${d}`]=!0,!r?.formData){const m=f.root.computedTransform;if(m){const u=n.Matrix4.fromColumnMajorArray(m),g=n.Matrix4.getTranslation(u,new n.Cartesian3),A=n.Ellipsoid.WGS84.cartesianToCartographic(g),p=n.Math.toDegrees(A.longitude),y=n.Math.toDegrees(A.latitude),C=A.height;r.formData={modelId:r.modelId.toString(),longitude:p,latitude:y,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模型 ${d} 无法获取初始位置信息`)}r.formData&&(r.formData.heightDistance=r.formData.heightDistance??1),f.leiting={versionId:`${f?.asset?.tilesetVersion??d}`,selectedFn:t?.selectedFn,model:{modelId:r.modelId,modelName:r.modelName,dbName:r.dbName,fileType:r.fileType,outPutPath:r.outPutPath,url:h,formData:r.formData,type:"OSGB"},box:null},oo({Cesium:this.cesium,tileset:f}),this.modelList.push({...r,url:h,state:mi.Loaded}),!s&&t?.flyTo&&(this.BIMmodelId=r.modelId,this.viewer.zoomTo(f),s=!0)}catch(l){console.error(`OSGB模型 ${r.dbName} 加载失败:`,l);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,l=this.mapTileset[o];if(!l){console.warn("tileSet not found for modelId:",o);return}let c=t||0,d=n||0,h=s||0;const f=l.boundingSphere.center,m=r.Transforms.eastNorthUpToFixedFrame(f),u=new r.Cartesian3(c,d,h),g=r.Matrix4.multiplyByPoint(m,u,new r.Cartesian3(0,0,0)),A=r.Cartesian3.subtract(g,f,new r.Cartesian3);l.modelMatrix=r.Matrix4.fromTranslation(A)}flyToTileset({modelId:e=this.BIMmodelId,options:t={}}={}){const s=this.getMapTileset()[e];if(!s||!this.viewer)return;const{complete:o,cancel:r,...l}=t,c={duration:0,...l};this.viewer.flyTo(s,c).then(d=>{d?o&&o():r&&r()}).catch(d=>{r&&r(),console.error("FlyTo error",d)})}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=e.lastIndexOf("/");return t===-1?".":e.substr(0,t)}async loadTilesetWithZipSupport(e,t,n,s){try{const o=`${this.getBaseUrlPath(e)}/tileset.zip`;if((await fetch(o,{method:"HEAD"})).status===200){const c=await St(o);if(c){const d=this.getBaseUrlPath(e),h=u=>{!u||typeof u!="object"||(typeof u.uri=="string"&&!/^(data:|https?:\/\/)/i.test(u.uri)&&(u.uri=`${d}/${u.uri.replace(/^\.?\//,"")}`),Object.values(u).forEach(g=>{if(Array.isArray(g)){g.forEach(A=>h(A));return}g&&typeof g=="object"&&h(g)}))};h(c);const f=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(c))))}`,m=new s.Resource({url:f});try{return await s.Cesium3DTileset.fromUrl(m,{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 St(s);if(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 St(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 St(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 xl={normal:0,process:2},Zp={color:1};function Ml(i){return i===1||i==="exist"?1:i===2||i==="process"?2:0}function Ei(i){return Number.isNaN(i)?0:i<=1?Math.min(Math.max(i,0),1):Math.min(Math.max(i/255,0),1)}function Bl(i){return Number.isNaN(i)?1:i<=1?Math.min(Math.max(i,0),1):1}function Bo(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(c=>Number.isNaN(c)))return null;const o=Math.round(e*255),r=Math.round(t*255),l=Math.round(n*255);return`rgba(${o},${r},${l},${s})`}function e0(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(l=>Number.isNaN(l))?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 t0(i){if(i==null)return null;const e=Number(i);return Number.isNaN(e)?null:e}function i0(i){const e=i.lastIndexOf("-"),t=i.substring(0,e),n=i.substring(e+1);return[t,n]}function To(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),l=Number(t.y??t.Y),c=Number(t.z??t.Z);return[n,s,o,r,l,c].some(d=>Number.isNaN(d))?null:{min:{x:n,y:s,z:o},max:{x:r,y:l,z:c}}}function qi(i,e){if(e)return`${e}`;const t=i?.leiting?.model?.modelId??i?.modelId??i?.id;return t==null?null:`${t}`}function n0(i,e){if(e==null)return null;const t=i?.leiting?.node;if(!t)return null;const n=`${e}`,s=t?.[n],o=To(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 To(r?.box3??r?.box)}function s0(i){const e=i?.leiting?.box;return e?To({min:e.min,max:e.max}):null}class o0{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(l=>{const{batchIds:c,modelId:d,rgba:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=h;const f=n[d];f?f.push(c[0]):n[d]=[c[0]]}})),t>=o&&t<r&&(s!==null&&(this.base.viewer.scene.ambientLightIntensity=s),e.cash=!1,e.playCash=!0,e.groupData.forEach(l=>{const{batchIds:c,playTimeColor:d,modelId:h}=l;if(Array.isArray(c)&&c[0]){c[0][1]=d;const f=n[h];f?f.push(c[0]):n[h]=[c[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(l=>l.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:l}=r;this.base.setTileSyltByConstructionProcessTracking({modelId:l,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 l=e[o];l?l.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(c=>{s.push({dbName:n.linkModelId,modelId:n.modelId,elementId:`${c}`,show:!0,rgba:t.rgba??{r:.2,g:.2,b:.2,a:.2}})});const o=xl.process,r=Zp.color,{allElements:l}=this.base.groupByModelId(s);this.base.mapAnimations[n.modelId]=this.base.mapAnimations[n.modelId]||[],this.base.mapAnimations[n.modelId].push(t),Object.entries(l).forEach(([c,d])=>{const[h,f]=i0(c),m=this.base.getTileSyltByConstructionProcessTracking({elementIds:d,modelId:h,color:f,colorRank:o,show:!0,selectionRank:r}),u=t?.playTimeColor?.r??1,g=t?.playTimeColor?.g??1,A=t?.playTimeColor?.b??0,p=t?.playTimeColor?.a??.1,y=this.base.setColor({r:u,g,b:A,a:p}),C=this.base.setColor(t.rgba??{r:.2,g:.2,b:.2,a:.2});t.groupData.push({modelId:h,batchIds:m,playTimeColor:y,rgba:C})})})})}}class a0{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=qi(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=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const h=e.Cartographic.fromCartesian(l),f=e.Math.toDegrees(h.longitude),m=e.Math.toDegrees(h.latitude),u=h.height;r=[f,m,u]}const d=(this.base.hasSelectedFeaturesMap[s]||[]).filter(h=>h.rank!==0);if(this.base.hasSelectedFeaturesMap[s]=[...d,{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,f=n.tileset.leiting.node.nodeExtras.element[h];f.elementId=h,f.modelId=n.tileset.leiting.model.modelId,n.tileset.leiting.selectedFn({elementInfo:f,elementId:h,point:r,modelId:n.tileset.leiting.model.modelId,_propsData:f})}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=qi(n.tileset);if(!s||!this.base.tilesetMap[s])return;const o=this.base.getFeatureId(n);if(o==="-1")return;let r;const l=this.base.viewer.scene.pickPosition(t.position);if(e.defined(l)){const c=e.Cartographic.fromCartesian(l),d=e.Math.toDegrees(c.longitude),h=e.Math.toDegrees(c.latitude),f=c.height;r=[d,h,f]}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),l=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=`${l}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 r0{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 o0(this),this.selectionModule=new a0(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=Ml(t),s=[];for(const o of Object.keys(this.hasSelectedFeaturesMap))(this.hasSelectedFeaturesMap[o]||[]).forEach(l=>{if(l.rank!==n)return;const c=e0(l.selectedColor);let d=this.getBatchIdToElementIdSync(l.batchId,o);d===null&&(d=l.batchId),l.isTrigger&&s.push({elementId:d,modelId:o,rgba:c||void 0,point:l?.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 l=r?.modelId;if(l==null)continue;await this.loadNodeDetailsForModel(l);const c=r?.elementId,d=this.tilesetMap[`${l}`];if(!d)continue;const f=n0(d,c)||s0(d);if(!f)continue;const m=new n.Cartesian3(f.min.x,f.min.y,f.min.z),u=new n.Cartesian3(f.max.x,f.max.y,f.max.z),g=d?.root?.computedTransform??d?.modelMatrix;if(g){const A=n.Matrix4.multiplyByPoint(g,m,new n.Cartesian3),p=n.Matrix4.multiplyByPoint(g,u,new n.Cartesian3);o.push(A,p)}else o.push(m,u)}if(o.length){const r=n.BoundingSphere.fromPoints(o);r.radius=r.radius*s;const l=this.viewer.scene.camera,c=new n.HeadingPitchRange(l.heading,l.pitch,0);l.flyToBoundingSphere(r,{duration:t?.duration??0,complete:t?.complete,offset:c})}else{const r=e[0]?.modelId,l=r?this.tilesetMap[`${r}`]:null;l&&this.viewer.flyTo(l,{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(c=>{const d=s.get(c.batchId);(!d||c.rank>=d.rank)&&s.set(c.batchId,c)});const o=new Map;if(s.forEach(({batchId:c,selectedColor:d})=>{o.has(d)||o.set(d,new Set),o.get(d)?.add(c)}),this.colorRankColor.length){const c=new Set;this.colorRankColor.forEach(d=>{const h=o.get(d);h&&h.forEach(f=>c.add(f))}),o.forEach((d,h)=>{if(this.colorRankColor.includes(h))return;const f=new Set;d.forEach(m=>{c.has(m)||f.add(m)}),o.set(h,f)})}const r=[...this.colorRankColor.filter(c=>o.has(c)),...Array.from(o.keys()).filter(c=>!this.colorRankColor.includes(c))],l=[];return r.forEach(c=>{const d=o.get(c);if(!d||!d.size)return;const h=Array.from(d).join("|");h&&l.push([`(regExp('^(${h})$').test(\${id}))`,c])}),l.length?l: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=Ei(Number(e.r)),n=Ei(Number(e.g)),s=Ei(Number(e.b)),o=Bl(e.a===void 0?1:Number(e.a));return Bo({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,l=this.setColor(r??{r:.4,g:.4,b:.4,a:.1}),c=`${s}-${l}`;t[c]||(t[c]=[]),t[c].push(`${o}`)}),{allElements:t,transform:null,box:null}}getBatchIds(e,t){const n=`${t}`,s=`${e}`;if(this.eidToBatchIdMap[n]){const c=this.eidToBatchIdMap[n].get(s);if(c!==void 0)return c}const r=this.tilesetMap[n]?.leiting?.node?.batchIdEIDInfos;if(r&&Array.isArray(r)){const c=new Map;r.forEach(h=>{const f=`${h.elementID}`,m=`${h.batchId}`;c.has(f)||c.set(f,[]),c.get(f).push(m)}),this.eidToBatchIdMap[n]=c;const d=c.get(s);if(d!==void 0)return d}const l=t0(e);return l!=null?[String(l)]:[]}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 l=[];for(const c of o)r.has(`${c.elementID}`)||l.push(`${c.batchId}`);this.showStateMap[n].batchIds=l;continue}this.showStateMap[n].batchIds=o.map(l=>l.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 l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),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 l=r.leiting.node.batchIdEIDInfos,c=new Set(o?.batchIds??[]),d=o?.mode??"exclude",h=new Set;l.forEach(f=>{const m=c.has(`${f.batchId}`);if((d==="include"?m:!m)===e){const g=`${f.elementID}`;h.has(g)||(n.push({elementId:g,modelId:s}),h.add(g))}})}),n}getTileSyltByConstructionProcessTracking({elementIds:e,modelId:t,color:n,colorRank:s,show:o,selectionRank:r}){const l=this.tilesetMap[t];if(!Array.isArray(e))return[];const c=l.leiting.node,d=new Set(e),h=c.batchIdEIDInfos.filter(m=>d.has(`${m.elementID}`)).map(m=>String(m.batchId));return h.length?(s===xl.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=Ml(s),r=t?.isTrigger??!0;for(const l of e){const c=l?.modelId;if(c==null)continue;const d=`${c}`;await this.loadNodeDetailsForModel(d);const h=Array.isArray(l?.elementIds)?l.elementIds:l?.elementId?[l.elementId]:[];if(!h.length)continue;const f=Bo(l?.rgba)||this.selectedColor;for(const m of h){const u=this.getBatchIds(m,d);if(u.length!==0){n.has(d)||n.set(d,[]);for(const g of u)n.get(d)?.push({batchId:g,selectedColor:f,rank:o,isTrigger:r})}}}for(const[l,c]of n){const d=this.mergeSelections(l,c);this.hasSelectedFeaturesMap[l]=d,this.setBaseStyle(l)}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),l=this.tilesetMap[r];if(!l)return;const c=l?.leiting?.node?.batchIdEIDInfos;if(!c||!Array.isArray(c))return;const d=[];c.forEach(h=>{h&&h.elementID!==void 0&&d.push(h.elementID)}),d.length!==0&&await this.setSelectColorUserModelCpt([{modelId:r,elementIds:d,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=Ei(e),r=Ei(t),l=Ei(n),c=Bl(s),d=Bo({r:o,g:r,b:l,a:c});d&&(this.selectedColor=d)}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(f=>f.rank!==0),l=o.filter(f=>f.rank===0),d=l.some(f=>f.batchId===t)?l.filter(f=>f.batchId!==t):[...l,{batchId:t,selectedColor:n,rank:0,point:s,isTrigger:!0}],h=[...r,...d];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),l=Math.max(e.y,t.y),c=o-s,d=l-r;if(Math.abs(c)<15||Math.abs(d)<15)return;const h=s+c/2,f=r+d/2,m=new this.cesium.Cartesian2(h,f),u=this.viewer.scene.drillPick(m,void 0,c,d);if(!Array.isArray(u))return;const g=new Map;u.forEach(A=>{if(!(A instanceof this.cesium.Cesium3DTileFeature))return;const p=qi(A.tileset);if(!p||!this.tilesetMap[p])return;const y=this.getFeatureId(A);y!=="-1"&&(g.has(p)||g.set(p,new Set),g.get(p)?.add(y))}),g.forEach((A,p)=>{const y=this.hasSelectedFeaturesMap[p]||[],C=y.filter(M=>M.rank!==0),I=new Set(y.filter(M=>M.rank===0).map(M=>M.batchId)),P=[];A.forEach(M=>{I.has(M)||P.push({batchId:M,selectedColor:n,rank:0,isTrigger:!0})});const k=y.filter(M=>M.rank===0);this.hasSelectedFeaturesMap[p]=[...C,...k,...P],this.setBaseStyle(p)}),await this.triggerSelectionChange()}}class l0{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,l=Math.max(r,this.targetXMinus+this.targetXPlus),c=Math.max(r,this.targetYPlus+this.targetYMinus),d=Math.max(r,this.targetZPlus+this.targetZMinus);return s==="top"||s==="down"?new e.Cartesian2(l,c):s==="left"||s==="right"?new e.Cartesian2(c,d):new e.Cartesian2(l,d)},!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),l=this.boxInverseMatrix,c=e.Matrix4.multiplyByPoint(l,r.origin,new e.Cartesian3),d=e.Matrix4.multiplyByPointAsVector(l,r.direction,new e.Cartesian3);e.Cartesian3.normalize(d,d);const h=new e.Ray(c,d),f=this.getPlaneByType(this.currentPlaneType);this.dragStartPoint=e.IntersectionTests.rayPlane(h,f,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,l=e.Matrix4.multiplyByPoint(r,o.origin,new e.Cartesian3),c=e.Matrix4.multiplyByPointAsVector(r,o.direction,new e.Cartesian3);e.Cartesian3.normalize(c,c);const d=new e.Ray(l,c);let h=new e.Cartesian3;this.currentPlaneType==="top"||this.currentPlaneType==="down"?h=Math.abs(c.x)>Math.abs(c.y)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Y:this.currentPlaneType==="left"||this.currentPlaneType==="right"?h=Math.abs(c.y)>Math.abs(c.z)?e.Cartesian3.UNIT_Y:e.Cartesian3.UNIT_Z:h=Math.abs(c.x)>Math.abs(c.z)?e.Cartesian3.UNIT_X:e.Cartesian3.UNIT_Z;const f=-e.Cartesian3.dot(this.dragStartPoint,h),m=new e.Plane(h,f);let u=e.IntersectionTests.rayPlane(d,m,new e.Cartesian3);if(!u){const A=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,p=-e.Cartesian3.dot(this.dragStartPoint,A);u=e.IntersectionTests.rayPlane(d,new e.Plane(A,p),new e.Cartesian3)}if(!u)return;const g=.01;switch(this.currentPlaneType){case"left":this.targetXMinus=Math.max(-this.targetXPlus+g,-u.x);break;case"right":this.targetXPlus=Math.max(-this.targetXMinus+g,u.x);break;case"behind":this.targetYMinus=Math.max(-this.targetYPlus+g,-u.y);break;case"front":this.targetYPlus=Math.max(-this.targetYMinus+g,u.y);break;case"top":this.targetZPlus=Math.max(-this.targetZMinus+g,u.z);break;case"down":this.targetZMinus=Math.max(-this.targetZPlus+g,-u.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(f=>{const m=this.tilesetMap[f];m&&m.boundingSphere&&t.push(m.boundingSphere.center)}),t.length===0)return;const n=new e.Cartesian3;t.forEach(f=>e.Cartesian3.add(n,f,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,l=-1/0,c=1/0,d=-1/0;this.activeModelIds.forEach(f=>{const m=this.tilesetMap[f];if(!m)return;const u=[],g=m.leiting?.box,A=m.root?.boundingVolume?.boundingVolume;if(g&&g.min&&g.max){const{min:p,max:y}=g,C=[new e.Cartesian3(p.x,p.y,p.z),new e.Cartesian3(y.x,p.y,p.z),new e.Cartesian3(p.x,y.y,p.z),new e.Cartesian3(y.x,y.y,p.z),new e.Cartesian3(p.x,p.y,y.z),new e.Cartesian3(y.x,p.y,y.z),new e.Cartesian3(p.x,y.y,y.z),new e.Cartesian3(y.x,y.y,y.z)],I=m.root.transform;C.forEach(P=>{u.push(e.Matrix4.multiplyByPoint(I,P,new e.Cartesian3))})}else if(A&&A.halfAxes){const p=A.center,y=A.halfAxes,C=e.Matrix3.getColumn(y,0,new e.Cartesian3),I=e.Matrix3.getColumn(y,1,new e.Cartesian3),P=e.Matrix3.getColumn(y,2,new e.Cartesian3);for(let k=0;k<8;k++){const M=e.Cartesian3.clone(p,new e.Cartesian3);e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(C,k&1?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(I,k&2?1:-1,new e.Cartesian3),M),e.Cartesian3.add(M,e.Cartesian3.multiplyByScalar(P,k&4?1:-1,new e.Cartesian3),M),u.push(M)}}else if(m.boundingSphere){const p=m.boundingSphere,y=p.center,C=p.radius,I=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,y,new e.Cartesian3);s=Math.min(s,I.x-C),o=Math.max(o,I.x+C),r=Math.min(r,I.y-C),l=Math.max(l,I.y+C),c=Math.min(c,I.z-C),d=Math.max(d,I.z+C)}u.forEach(p=>{const y=e.Matrix4.multiplyByPoint(this.boxInverseMatrix,p,new e.Cartesian3);s=Math.min(s,y.x),o=Math.max(o,y.x),r=Math.min(r,y.y),l=Math.max(l,y.y),c=Math.min(c,y.z),d=Math.max(d,y.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(l)*h,this.targetZMinus=Math.abs(c)*h,this.targetZPlus=Math.abs(d)*h,this.activeModelIds.forEach(f=>{this.setupClippingPlanes(f)}),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 Po=performance.now();const c0=10;class d0{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,l=this.cesium.Cartesian3.add(t.positionWC,this.cesium.Cartesian3.multiplyByScalar(o,10,new this.cesium.Cartesian3),new this.cesium.Cartesian3);this.position=l}}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;Po=performance.now();const n=(o,r)=>{const l=o.code,c=o.keyCode;l==="KeyA"||c===65?this.moveState.moveLeft=r:l==="KeyW"||c===87?this.moveState.moveFront=r:l==="KeyD"||c===68?this.moveState.moveRight=r:l==="KeyS"||c===83?this.moveState.moveBack=r:l==="KeyQ"||c===81?this.moveState.moveUp=r:(l==="KeyE"||c===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,l=o.endPosition.y,c=l-this.lastScreenY,d=r-this.lastScreenX;Math.abs(c)<Math.abs(d)&&(d>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=l;const h=this.viewer.camera;this.cameralHpRoll.pitch=h.pitch+this.cesium.Math.toRadians(-c*.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-Po<c0)return;Po=r;const l=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 c=(f,m)=>new this.cesium.Ray(f,m),d=new this.cesium.Cartesian3;this.cesium.Matrix4.getColumn(this.model.modelMatrix,0,d),this.cesium.Cartesian3.normalize(d,d);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 f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,l),f);let u=d;o===-1?u=this.cesium.Cartesian3.multiplyByScalar(d,-1,new this.cesium.Cartesian3):o===3?u=h:o===-3&&(u=this.cesium.Cartesian3.multiplyByScalar(h,-1,new this.cesium.Cartesian3));const g=c(m,u),A=this.viewer.scene.pickFromRay(g,[this.model],1);if(A&&A.position&&this.cesium.Cartesian3.distance(m,A.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 f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=.5,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=new this.cesium.Cartesian3;this.cesium.Cartesian3.subtract(this.position,u,g),this.cesium.Cartesian3.normalize(g,g);const A=c(u,g),p=this.viewer.scene.pickFromRay(A,[this.model],1),y=l,C=this.cesium.Cartesian3.add(u,this.cesium.Cartesian3.multiplyByScalar(d,y,new this.cesium.Cartesian3),new this.cesium.Cartesian3);if(t.defined(p)){const I=t.Cartesian3.distance(u,p.position);I-m>.2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position)),I-m<-.1&&I<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,.2),this.position))}if(!p&&this.gravityTestByMove){const I=c(this.position,g),P=this.viewer.scene.pickFromRay(I,[this.model],1);if(P){const k=this.cesium.Cartesian3.distance(this.position,P.position);Math.abs(k-1)>.05&&k<2&&(this.position=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,-.2),this.position))}}if(p&&this.gravityTestByMove&&this.gravityTest){const I=this.cesium.Cartesian3.distance(C,p.position);Math.abs(I-l)>.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,(l-I)/Math.abs(l-I)*.05),this.position))}}if(this.transparentTest){const f=new this.cesium.Cartesian3(this.position.x,this.position.y,this.position.z),m=1.75,u=this.cesium.Matrix4.multiplyByPoint(this.model.modelMatrix,new this.cesium.Cartesian3(0,0,m),f),g=this.viewer.camera.positionWC,A=u,p=t.Cartesian3.subtract(A,g,new t.Cartesian3),y=t.Cartesian3.distance(u,g),C=t.Cartesian3.normalize(p,new t.Cartesian3),I=new t.Ray(g,C);let P;try{P=this.viewer.scene.pickFromRay(I,void 0,1)}catch{}t.defined(P)&&P.primitive!==this.model&&P.position&&t.Cartesian3.distance(g,P.position)<y&&(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,l=0;s.setInputAction(c=>{o=!0,r=c.position.x,l=c.position.y},e.ScreenSpaceEventType.LEFT_DOWN),s.setInputAction(c=>{if(!o)return;const d=c.endPosition.x,h=c.endPosition.y,f=d-r,m=h-l;Math.abs(f)>Math.abs(m)&&(n.heading-=f*.003),n.pitch+=m*.003,r=d,l=h},e.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(()=>{o=!1},e.ScreenSpaceEventType.LEFT_UP),s.setInputAction(c=>{this.wheelCount-=c*.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 c=(this.speed||.02)*12,d=n.direction,h=n.right,f=n.up;let m=0,u=0,g=0;this.moveState.moveFront&&(m+=d.x*c,u+=d.y*c,g+=d.z*c),this.moveState.moveBack&&(m-=d.x*c,u-=d.y*c,g-=d.z*c),this.moveState.moveRight&&(m+=h.x*c,u+=h.y*c,g+=h.z*c),this.moveState.moveLeft&&(m-=h.x*c,u-=h.y*c,g-=h.z*c),this.moveState.moveUp&&(m+=f.x*c,u+=f.y*c,g+=f.z*c),this.moveState.moveDown&&(m-=f.x*c,u-=f.y*c,g-=f.z*c),n.position=new e.Cartesian3(n.position.x+m,n.position.y+u,n.position.z+g)},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 h0{cesium;viewer;baseCesium;baseTiles;baseCompt;baseSection;basePlayer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer,this.baseCesium=new Fh(e),this.baseTiles=new Sl(e),this.baseCompt=new r0(e),this.baseSection=new l0(e),this.basePlayer=new d0({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 u0{cesium;viewer;mapLayers={};renderGen={};renderGenAll=0;renderGenByModel={};modelId="default";options={flyTo:!0};dxfModelsList=[];open=!1;events=new Ki;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 l=s.layerMap[r];l!==void 0&&(t?s.hiddenBatchIds.delete(l):s.hiddenBatchIds.add(l))});const o=Array.from(s.hiddenBatchIds);if(o.length>0){const r=o.map(l=>`\${_BATCHID} !== ${l}`).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 l=r.content,c=l.featuresLength;if(c>0&&s.hiddenBatchIds)for(let d=0;d<c;d++)s.hiddenBatchIds.has(d)?l.getFeature(d).show=!1:l.getFeature(d).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 Io(new $n(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return console.error("未找到 JSON 文件"),await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.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=`${n}/tileset.zip`;try{if((await fetch(s,{method:"HEAD"})).status===200){const r=await this.loadModelFile(s);if(r){const l=h=>{!h||typeof h!="object"||(typeof h.uri=="string"&&!/^(data:|https?:\/\/)/i.test(h.uri)&&(h.uri=`${n}/${h.uri.replace(/^\.?\//,"")}`),Object.values(h).forEach(f=>{if(Array.isArray(f)){f.forEach(m=>l(m));return}f&&typeof f=="object"&&l(f)}))};l(r);const c=`data:text/plain;base64,${btoa(unescape(encodeURIComponent(JSON.stringify(r))))}`,d=new this.cesium.Resource({url:c});try{return await this.cesium.Cesium3DTileset.fromUrl(d,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(d=>d.modelId===s.modelId))return;const l=`${s.outPutPath}${s.dbName}/tileset.json`,c={...this.options,...t};try{const d=`${s.outPutPath}${s.dbName}/layerInfo.zip`,h=await this.loadModelFile(d);if(this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;const f=await this.loadTilesetWithZipSupport(l,{allowPicking:!1,clampToTerrain:!0});if(f.maximumScreenSpaceError=0,this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;if(Object.assign(f,{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?f.formData=s.formData:f.formData={modelId:f.modelId,longitude:f.deltaLongitude,latitude:f.deltaLatitude,distance:1e-6,rotation:0,totalRotation:f.totalRotation,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[{value:f.modelId,label:f.modelName}],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0},this.adjustingModelByCad({...f.formData,tileset:f}),Array.isArray(h)){const m=h;f.layerMap={};let u=this.mapLayers[s.modelId];u||(u={},this.mapLayers[s.modelId]=u),m.forEach(g=>{f.layerMap[g.layerName]=g.batchId,u[g.layerName]||(u[g.layerName]=[]),u[g.layerName].push({batchId:g.batchId,color:g.layerColor})})}if(this.dxfModelsList.push(f),this.setModelId(s.modelId),this.viewer.scene.primitives.add(f),this.renderGenAll!==n||(this.renderGenByModel[s.modelId]||0)!==o)return;c.flyTo&&this.flyToBounds(f),c.onSuccess&&c.onSuccess(f)}catch(d){console.error(`Failed to load tileset or layer info: ${l}`,d)}}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 f0(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 ei=1,ti=2,Ci=3,m0=4,_o=5,Tl=6378137,g0=6356752314e-3,Pl=.0066943799901413165,Xi=484813681109536e-20,j=Math.PI/2,p0=.16666666666666666,A0=.04722222222222222,y0=.022156084656084655,K=1e-10,xe=.017453292519943295,$e=57.29577951308232,ue=Math.PI/4,Ji=Math.PI*2,Me=3.14159265359,Ke={};Ke.greenwich=0,Ke.lisbon=-9.131906111111,Ke.paris=2.337229166667,Ke.bogota=-74.080916666667,Ke.madrid=-3.687938888889,Ke.rome=12.452333333333,Ke.bern=7.439583333333,Ke.jakarta=106.807719444444,Ke.ferro=-17.666666666667,Ke.brussels=4.367975,Ke.stockholm=18.058277777778,Ke.athens=23.7163375,Ke.oslo=10.722916666667;const E0={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 _l=/[\s_\-\/\(\)]/g;function Nt(i,e){if(i[e])return i[e];for(var t=Object.keys(i),n=e.toLowerCase().replace(_l,""),s=-1,o,r;++s<t.length;)if(o=t[s],r=o.toLowerCase().replace(_l,""),r===n)return i[o]}function Do(i){var e={},t=i.split("+").map(function(l){return l.trim()}).filter(function(l){return l}).reduce(function(l,c){var d=c.split("=");return d.push(!0),l[d[0].toLowerCase()]=d[1],l},{}),n,s,o,r={proj:"projName",datum:"datumCode",rf:function(l){e.rf=parseFloat(l)},lat_0:function(l){e.lat0=l*xe},lat_1:function(l){e.lat1=l*xe},lat_2:function(l){e.lat2=l*xe},lat_ts:function(l){e.lat_ts=l*xe},lon_0:function(l){e.long0=l*xe},lon_1:function(l){e.long1=l*xe},lon_2:function(l){e.long2=l*xe},alpha:function(l){e.alpha=parseFloat(l)*xe},gamma:function(l){e.rectified_grid_angle=parseFloat(l)*xe},lonc:function(l){e.longc=l*xe},x_0:function(l){e.x0=parseFloat(l)},y_0:function(l){e.y0=parseFloat(l)},k_0:function(l){e.k0=parseFloat(l)},k:function(l){e.k0=parseFloat(l)},a:function(l){e.a=parseFloat(l)},b:function(l){e.b=parseFloat(l)},r:function(l){e.a=e.b=parseFloat(l)},r_a:function(){e.R_A=!0},zone:function(l){e.zone=parseInt(l,10)},south:function(){e.utmSouth=!0},towgs84:function(l){e.datum_params=l.split(",").map(function(c){return parseFloat(c)})},to_meter:function(l){e.to_meter=parseFloat(l)},units:function(l){e.units=l;var c=Nt(E0,l);c&&(e.to_meter=c.to_meter)},from_greenwich:function(l){e.from_greenwich=l*xe},pm:function(l){var c=Nt(Ke,l);e.from_greenwich=(c||parseFloat(l))*xe},nadgrids:function(l){l==="@null"?e.datumCode="none":e.nadgrids=l},axis:function(l){var c="ewnsud";l.length===3&&c.indexOf(l.substr(0,1))!==-1&&c.indexOf(l.substr(1,1))!==-1&&c.indexOf(l.substr(2,1))!==-1&&(e.axis=l)},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 Dl{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(l=>Array.isArray(l)&&l[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 d=s[1].toUpperCase();if(d==="E")n="east";else if(d==="N")n="north";else if(d==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${d}`)}else n=e[2]?e[2].toLowerCase():"unknown";const o=e.find(d=>Array.isArray(d)&&d[0]==="ORDER"),r=o?parseInt(o[1],10):null,l=e.find(d=>Array.isArray(d)&&(d[0]==="LENGTHUNIT"||d[0]==="ANGLEUNIT"||d[0]==="SCALEUNIT")),c=this.convertUnit(l);return{name:t,direction:n,unit:c,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(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="BASEGEOGCRS")):null,t.conversion=e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="CONVERSION")):null;const n=e.find(m=>Array.isArray(m)&&m[0]==="CS");n&&(t.coordinate_system={type:n[1],axis:this.extractAxes(e)});const s=e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT");if(s){const m=this.convertUnit(s);t.coordinate_system.unit=m}t.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":t.type="GeographicCRS",t.name=e[1];const o=e.find(m=>Array.isArray(m)&&(m[0]==="DATUM"||m[0]==="ENSEMBLE"));if(o){const m=this.convert(o);o[0]==="ENSEMBLE"?t.datum_ensemble=m:t.datum=m;const u=e.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");u&&u[1]!=="Greenwich"&&(m.prime_meridian={name:u[1],longitude:parseFloat(u[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(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":t.type="DatumEnsemble",t.name=e[1],t.members=e.filter(m=>Array.isArray(m)&&m[0]==="MEMBER").map(m=>({type:"DatumEnsembleMember",name:m[1],id:this.getId(m)}));const r=e.find(m=>Array.isArray(m)&&m[0]==="ENSEMBLEACCURACY");r&&(t.accuracy=parseFloat(r[1]));const l=e.find(m=>Array.isArray(m)&&m[0]==="ELLIPSOID");l&&(t.ellipsoid=this.convert(l)),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(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT")&&this.convert(e.find(m=>Array.isArray(m)&&m[0]==="LENGTHUNIT"),t);break;case"CONVERSION":t.type="Conversion",t.name=e[1],t.method=e.find(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&m[0]==="PARAMETER").map(m=>this.convert(m));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(m=>Array.isArray(m)&&(m[0]==="LENGTHUNIT"||m[0]==="ANGLEUNIT"||m[0]==="SCALEUNIT"))),t.id=this.getId(e);break;case"BOUNDCRS":t.type="BoundCRS";const c=e.find(m=>Array.isArray(m)&&m[0]==="SOURCECRS");if(c){const m=c.find(u=>Array.isArray(u));t.source_crs=m?this.convert(m):null}const d=e.find(m=>Array.isArray(m)&&m[0]==="TARGETCRS");if(d){const m=d.find(u=>Array.isArray(u));t.target_crs=m?this.convert(m):null}const h=e.find(m=>Array.isArray(m)&&m[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(m=>Array.isArray(m)&&m[0]==="METHOD")?this.convert(e.find(m=>Array.isArray(m)&&m[0]==="METHOD")):null,t.parameters=e.filter(m=>Array.isArray(m)&&(m[0]==="PARAMETER"||m[0]==="PARAMETERFILE")).map(m=>{if(m[0]==="PARAMETER")return this.convert(m);if(m[0]==="PARAMETERFILE")return{name:m[1],value:m[2],id:{authority:"EPSG",code:8656}}}),t.parameters.length===7){const m=t.parameters[6];m.name==="Scale difference"&&(m.value=Math.round((m.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 f=this.convertUnit(e,"LinearUnit");t.coordinate_system&&t.coordinate_system.axis&&t.coordinate_system.axis.forEach(m=>{m.unit||(m.unit=f)}),f.conversion_factor&&f.conversion_factor!==1&&t.semi_major_axis&&(t.semi_major_axis={value:t.semi_major_axis,unit:f});break;default:t.keyword=e[0];break}return t}}class C0 extends Dl{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 v0 extends Dl{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(c=>Array.isArray(c)&&c[0]==="SCOPE"),r=s.find(c=>Array.isArray(c)&&c[0]==="AREA"),l=s.find(c=>Array.isArray(c)&&c[0]==="BBOX");t.usage={},o&&(t.usage.scope=o[1]),r&&(t.usage.area=r[1]),l&&(t.usage.bbox=l.slice(1))}return t}}function b0(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 w0(i){return(b0(i)==="2019"?v0:C0).convert(i)}function I0(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 Zi=1,kl=2,Nl=3,Xn=4,Rl=5,ko=-1,S0=/\s/,x0=/[A-Za-z]/,M0=/[A-Za-z84_]/,Jn=/[,\]]/,Fl=/[\d\.E\-\+]/;function xt(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=Zi}xt.prototype.readCharicter=function(){var i=this.text[this.place++];if(this.state!==Xn)for(;S0.test(i);){if(this.place>=this.text.length)return;i=this.text[this.place++]}switch(this.state){case Zi:return this.neutral(i);case kl:return this.keyword(i);case Xn:return this.quoted(i);case Rl:return this.afterquote(i);case Nl:return this.number(i);case ko:return}},xt.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Xn;return}if(Jn.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)},xt.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Zi;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Zi,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ko);return}},xt.prototype.number=function(i){if(Fl.test(i)){this.word+=i;return}if(Jn.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)},xt.prototype.quoted=function(i){if(i==='"'){this.state=Rl;return}this.word+=i},xt.prototype.keyword=function(i){if(M0.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=Zi;return}if(Jn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)},xt.prototype.neutral=function(i){if(x0.test(i)){this.word=i,this.state=kl;return}if(i==='"'){this.word="",this.state=Xn;return}if(Fl.test(i)){this.word=i,this.state=Nl;return}if(Jn.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)},xt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ko)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function B0(i){var e=new xt(i);return e.output()}function No(i,e,t){Array.isArray(e)&&(t.unshift(e),e=null);var n=e?{}:i,s=t.reduce(function(o,r){return vi(r,o),o},n);e&&(i[e]=s)}function vi(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]={},vi(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&&vi(i[2],e[t]);return;case"SPHEROID":case"ELLIPSOID":e[t]={name:i[0],a:i[1],rf:i[2]},i.length===4&&vi(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]],No(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]],No(e,t,i),e[t].type=t;return;default:for(n=-1;++n<i.length;)if(!Array.isArray(i[n]))return vi(i,e[t]);return No(e,t,i)}}var T0=.017453292519943295;function lt(i){return i*T0}function Ll(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=lt(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=lt(i.lat0>0?90:-90),delete i.lat1)}function Ol(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 Gl(i){return typeof i=="object"?i.value*i.unit.conversion_factor:i}function Ul(i,e){i.ellipsoid.radius?(e.a=i.ellipsoid.radius,e.rf=0):(e.a=Gl(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-Gl(i.ellipsoid.semi_minor_axis))))}function Zn(i,e={}){return!i||typeof i!="object"?i:i.type==="BoundCRS"?(Zn(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,Ul(n,e)),n.prime_meridian&&(e.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=n.name,Ul(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}=Ol(n.unit);e.units=s,e.to_meter=o}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:o}=Ol(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":Zn(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),Ll(e),e)}var P0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function _0(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 Vl(i){for(var e=Object.keys(i),t=0,n=e.length;t<n;++t){var s=e[t];P0.indexOf(s)!==-1&&D0(i[s]),typeof i[s]=="object"&&Vl(i[s])}}function D0(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=lt(i.rectified_grid_angle));function l(h){var f=i.to_meter||1;return h*f}var c=function(h){return _0(i,h)},d=[["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",lt],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",lt],["x0","false_easting",l],["y0","false_northing",l],["long0","central_meridian",lt],["lat0","latitude_of_origin",lt],["lat0","standard_parallel_1",lt],["lat1","standard_parallel_1",lt],["lat2","standard_parallel_2",lt],["azimuth","Azimuth"],["alpha","azimuth",lt],["srsCode","name"]];d.forEach(c),Ll(i)}function es(i){if(typeof i=="object")return Zn(i);const e=I0(i);var t=B0(i);if(e==="WKT2"){const o=w0(t);return Zn(o)}var n=t[0],s={};return vi(t,s),Vl(s),s[n]}function Ge(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?Ge[i]=Do(arguments[1]):Ge[i]=es(arguments[1]):t&&typeof t=="object"&&!("projName"in t)?Ge[i]=es(arguments[1]):(Ge[i]=t,t||delete Ge[i])}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(n){return Array.isArray(n)?Ge.apply(e,n):Ge(n)});if(typeof i=="string"){if(i in Ge)return Ge[i]}else"EPSG"in i?Ge["EPSG:"+i.EPSG]=i:"ESRI"in i?Ge["ESRI:"+i.ESRI]=i:"IAU2000"in i?Ge["IAU2000:"+i.IAU2000]=i:console.log(i);return}}f0(Ge);function k0(i){return typeof i=="string"}function N0(i){return i in Ge}function R0(i){return i.indexOf("+")!==0&&i.indexOf("[")!==-1||typeof i=="object"&&!("srsCode"in i)}var F0=["3857","900913","3785","102113"];function L0(i){var e=Nt(i,"authority");if(e){var t=Nt(e,"epsg");return t&&F0.indexOf(t)>-1}}function O0(i){var e=Nt(i,"extension");if(e)return Nt(e,"proj4")}function G0(i){return i[0]==="+"}function U0(i){if(k0(i)){if(N0(i))return Ge[i];if(R0(i)){var e=es(i);if(L0(e))return Ge["EPSG:3857"];var t=O0(e);return t?Do(t):e}if(G0(i))return Do(i)}else return"projName"in i?i:es(i)}function Ql(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 Ct(i,e,t){var n=i*e;return t/Math.sqrt(1-n*n)}function en(i){return i<0?-1:1}function X(i,e){return e||Math.abs(i)<=Me?i:i-en(i)*Ji}function ct(i,e,t){var n=i*t,s=.5*i;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(j-e))/n}function tn(i,e){for(var t=.5*i,n,s,o=j-2*Math.atan(e),r=0;r<=15;r++)if(n=i*Math.sin(o),s=j-2*Math.atan(e*Math.pow((1-n)/(1+n),t))-o,o+=s,Math.abs(s)<=1e-10)return o;return-9999}function V0(){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=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Q0(i){var e=i.x,t=i.y;if(t*$e>90&&t*$e<-90&&e*$e>180&&e*$e<-180)return null;var n,s;if(Math.abs(Math.abs(t)-j)<=K)return null;if(this.sphere)n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(ue+.5*t));else{var o=Math.sin(t),r=ct(this.e,t,o);n=this.x0+this.a*this.k0*X(e-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return i.x=n,i.y=s,i}function H0(i){var e=i.x-this.x0,t=i.y-this.y0,n,s;if(this.sphere)s=j-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var o=Math.exp(-t/(this.a*this.k0));if(s=tn(this.e,o),s===-9999)return null}return n=X(this.long0+e/(this.a*this.k0),this.over),i.x=n,i.y=s,i}var Y0=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const z0={init:V0,forward:Q0,inverse:H0,names:Y0};function j0(){}function Hl(i){return i}var Yl=["longlat","identity"],W0=[z0,{init:j0,forward:Hl,inverse:Hl,names:Yl}],ii={},bi=[];function zl(i,e){var t=bi.length;return i.names?(bi[t]=i,i.names.forEach(function(n){ii[n.toLowerCase()]=t}),this):(console.log(e),!0)}function jl(i){return i.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function $0(i){if(!i)return!1;var e=i.toLowerCase();if(typeof ii[e]<"u"&&bi[ii[e]]||(e=jl(e),e in ii&&bi[ii[e]]))return bi[ii[e]]}function K0(){W0.forEach(zl)}const q0={start:K0,add:zl,get:$0};var Wl={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 X0=Wl.WGS84;function J0(i,e,t,n){var s=i*i,o=e*e,r=(s-o)/s,l=0;n?(i*=1-r*(p0+r*(A0+r*y0)),s=i*i,r=0):l=Math.sqrt(r);var c=(s-o)/o;return{es:r,e:l,ep2:c}}function Z0(i,e,t,n,s){if(!i){var o=Nt(Wl,n);o||(o=X0),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 ts={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 eA in ts){var Ro=ts[eA];Ro.datumName&&(ts[Ro.datumName]=Ro)}function tA(i,e,t,n,s,o,r){var l={};return i===void 0||i==="none"?l.datum_type=_o:l.datum_type=m0,e&&(l.datum_params=e.map(parseFloat),(l.datum_params[0]!==0||l.datum_params[1]!==0||l.datum_params[2]!==0)&&(l.datum_type=ei),l.datum_params.length>3&&(l.datum_params[3]!==0||l.datum_params[4]!==0||l.datum_params[5]!==0||l.datum_params[6]!==0)&&(l.datum_type=ti,l.datum_params[3]*=Xi,l.datum_params[4]*=Xi,l.datum_params[5]*=Xi,l.datum_params[6]=l.datum_params[6]/1e6+1)),r&&(l.datum_type=Ci,l.grids=r),l.a=t,l.b=n,l.es=s,l.ep2=o,l}var Fo={};function iA(i,e,t){return e instanceof ArrayBuffer?nA(i,e,t):{ready:sA(i,e)}}function nA(i,e,t){var n=!0;t!==void 0&&t.includeErrorFields===!1&&(n=!1);var s=new DataView(e),o=rA(s),r=lA(s,o),l=cA(s,r,o,n),c={header:r,subgrids:l};return Fo[i]=c,c}async function sA(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(),l=r,c=[o.getWidth(),o.getHeight()],d=o.getBoundingBox().map($l),h=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map($l),f=d[0]+(c[0]-1)*h[0],m=d[3]-(c[1]-1)*h[1],u=l[0],g=l[1],A=[];for(let C=c[1]-1;C>=0;C--)for(let I=c[0]-1;I>=0;I--){var p=C*c[0]+I;A.push([-Rt(g[p]),Rt(u[p])])}t.push({del:h,lim:c,ll:[-f,m],cvs:A})}var y={header:{nSubgrids:n},subgrids:t};return Fo[i]=y,y}function oA(i){if(i===void 0)return null;var e=i.split(",");return e.map(aA)}function aA(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:Fo[i]||null,isNull:!1}}function $l(i){return i*Math.PI/180}function Rt(i){return i/3600*Math.PI/180}function rA(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 lA(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:Lo(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 Lo(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function cA(i,e,t,n){for(var s=176,o=[],r=0;r<e.nSubgrids;r++){var l=hA(i,s,t),c=uA(i,s,l,t,n),d=Math.round(1+(l.upperLongitude-l.lowerLongitude)/l.longitudeInterval),h=Math.round(1+(l.upperLatitude-l.lowerLatitude)/l.latitudeInterval);o.push({ll:[Rt(l.lowerLongitude),Rt(l.lowerLatitude)],del:[Rt(l.longitudeInterval),Rt(l.latitudeInterval)],lim:[d,h],count:l.gridNodeCount,cvs:dA(c)});var f=16;n===!1&&(f=8),s+=176+l.gridNodeCount*f}return o}function dA(i){return i.map(function(e){return[Rt(e.longitudeShift),Rt(e.latitudeShift)]})}function hA(i,e,t){return{name:Lo(i,e+8,e+16).trim(),parent:Lo(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 uA(i,e,t,n,s){var o=e+176,r=16;s===!1&&(r=8);for(var l=[],c=0;c<t.gridNodeCount;c++){var d={latitudeShift:i.getFloat32(o+c*r,n),longitudeShift:i.getFloat32(o+c*r+4,n)};s!==!1&&(d.latitudeAccuracy=i.getFloat32(o+c*r+8,n),d.longitudeAccuracy=i.getFloat32(o+c*r+12,n)),l.push(d)}return l}function st(i,e){if(!(this instanceof st))return new st(i);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(d){if(d)throw d};var t=U0(i);if(typeof t!="object"){e("Could not parse to valid json: "+i);return}var n=st.projections.get(t.projName);if(!n){e("Could not get projection name from: "+i);return}if(t.datumCode&&t.datumCode!=="none"){var s=Nt(ts,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=Z0(t.a,t.b,t.rf,t.ellps,t.sphere),r=J0(o.a,o.b,o.rf,t.R_A),l=oA(t.nadgrids),c=t.datum||tA(t.datumCode,t.datum_params,o.a,o.b,r.es,r.ep2,l);Ql(this,t),Ql(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=c,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}st.projections=q0,st.projections.start();function fA(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===ei?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===ti?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 Kl(i,e,t){var n=i.x,s=i.y,o=i.z?i.z:0,r,l,c,d;if(s<-j&&s>-1.001*j)s=-j;else if(s>j&&s<1.001*j)s=j;else{if(s<-j)return{x:-1/0,y:-1/0,z:i.z};if(s>j)return{x:1/0,y:1/0,z:i.z}}return n>Math.PI&&(n-=2*Math.PI),l=Math.sin(s),d=Math.cos(s),c=l*l,r=t/Math.sqrt(1-e*c),{x:(r+o)*d*Math.cos(n),y:(r+o)*d*Math.sin(n),z:(r*(1-e)+o)*l}}function ql(i,e,t,n){var s=1e-12,o=s*s,r=30,l,c,d,h,f,m,u,g,A,p,y,C,I,P=i.x,k=i.y,M=i.z?i.z:0,B,_,E;if(l=Math.sqrt(P*P+k*k),c=Math.sqrt(P*P+k*k+M*M),l/t<s){if(B=0,c/t<s)return _=j,E=-n,{x:i.x,y:i.y,z:i.z}}else B=Math.atan2(k,P);d=M/c,h=l/c,f=1/Math.sqrt(1-e*(2-e)*h*h),g=h*(1-e)*f,A=d*f,I=0;do I++,u=t/Math.sqrt(1-e*A*A),E=l*g+M*A-u*(1-e*A*A),m=e*u/(u+E),f=1/Math.sqrt(1-m*(2-m)*h*h),p=h*(1-m)*f,y=d*f,C=y*g-p*A,g=p,A=y;while(C*C>o&&I<r);return _=Math.atan(y/Math.abs(p)),{x:B,y:_,z:E}}function mA(i,e,t){if(e===ei)return{x:i.x+t[0],y:i.y+t[1],z:i.z+t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6];return{x:d*(i.x-c*i.y+l*i.z)+n,y:d*(c*i.x+i.y-r*i.z)+s,z:d*(-l*i.x+r*i.y+i.z)+o}}}function gA(i,e,t){if(e===ei)return{x:i.x-t[0],y:i.y-t[1],z:i.z-t[2]};if(e===ti){var n=t[0],s=t[1],o=t[2],r=t[3],l=t[4],c=t[5],d=t[6],h=(i.x-n)/d,f=(i.y-s)/d,m=(i.z-o)/d;return{x:h+c*f-l*m,y:-c*h+f+r*m,z:l*h-r*f+m}}}function is(i){return i===ei||i===ti}function pA(i,e,t){if(fA(i,e)||i.datum_type===_o||e.datum_type===_o)return t;var n=i.a,s=i.es;if(i.datum_type===Ci){var o=Xl(i,!1,t);if(o!==0)return;n=Tl,s=Pl}var r=e.a,l=e.b,c=e.es;if(e.datum_type===Ci&&(r=Tl,l=g0,c=Pl),s===c&&n===r&&!is(i.datum_type)&&!is(e.datum_type))return t;if(t=Kl(t,s,n),is(i.datum_type)&&(t=mA(t,i.datum_type,i.datum_params)),is(e.datum_type)&&(t=gA(t,e.datum_type,e.datum_params)),t=ql(t,c,r,l),e.datum_type===Ci){var d=Xl(e,!0,t);if(d!==0)return}return t}function Xl(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 l=i.grids[r];if(o.push(l.name),l.isNull){s=n;break}if(l.grid===null){if(l.mandatory)return console.log("Unable to find mandatory grid '"+l.name+"'"),-1;continue}for(var c=l.grid.subgrids,d=0,h=c.length;d<h;d++){var f=c[d],m=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,u=f.ll[0]-m,g=f.ll[1]-m,A=f.ll[0]+(f.lim[0]-1)*f.del[0]+m,p=f.ll[1]+(f.lim[1]-1)*f.del[1]+m;if(!(g>n.y||u>n.x||p<n.y||A<n.x)&&(s=AA(n,e,f),!isNaN(s.x)))break e}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*$e+" "+n.y*$e+" tried: '"+o+"'"),-1):(t.x=-s.x,t.y=s.y,0)}function AA(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=X(s.x-Math.PI)+Math.PI;var o=Jl(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,l=1e-12,c,d;do{if(d=Jl(o,t),isNaN(d.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}c={x:s.x-(d.x+o.x),y:s.y-(d.y+o.y)},o.x+=c.x,o.y+=c.y}while(r--&&Math.abs(c.x)>l&&Math.abs(c.y)>l);if(r<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=X(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 Jl(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 l={x:e.cvs[r][0],y:e.cvs[r][1]};r++;var c={x:e.cvs[r][0],y:e.cvs[r][1]};r+=e.lim[0];var d={x:e.cvs[r][0],y:e.cvs[r][1]};r--;var h={x:e.cvs[r][0],y:e.cvs[r][1]},f=s.x*s.y,m=s.x*(1-s.y),u=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return o.x=u*l.x+m*c.x+g*h.x+f*d.x,o.y=u*l.y+m*c.y+g*h.y+f*d.y,o}function Zl(i,e,t){var n=t.x,s=t.y,o=t.z||0,r,l,c,d={};for(c=0;c<3;c++)if(!(e&&c===2&&t.z===void 0))switch(c===0?(r=n,"ew".indexOf(i.axis[c])!==-1?l="x":l="y"):c===1?(r=s,"ns".indexOf(i.axis[c])!==-1?l="y":l="x"):(r=o,l="z"),i.axis[c]){case"e":d[l]=r;break;case"w":d[l]=-r;break;case"n":d[l]=r;break;case"s":d[l]=-r;break;case"u":t[l]!==void 0&&(d.z=r);break;case"d":t[l]!==void 0&&(d.z=-r);break;default:return null}return d}function ec(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 yA(i){tc(i.x),tc(i.y)}function tc(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 EA(i,e){return(i.datum.datum_type===ei||i.datum.datum_type===ti||i.datum.datum_type===Ci)&&e.datumCode!=="WGS84"||(e.datum.datum_type===ei||e.datum.datum_type===ti||e.datum.datum_type===Ci)&&i.datumCode!=="WGS84"}function ns(i,e,t,n){var s;Array.isArray(t)?t=ec(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var o=t.z!==void 0;if(yA(t),i.datum&&e.datum&&EA(i,e)&&(s=new st("WGS84"),t=ns(i,s,t,n),i=s),n&&i.axis!=="enu"&&(t=Zl(i,!1,t)),i.projName==="longlat")t={x:t.x*xe,y:t.y*xe,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=pA(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*$e,y:t.y*$e,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"?Zl(e,!0,t):(t&&!o&&delete t.z,t)}var ic=st("WGS84");function Oo(i,e,t,n){var s,o,r;return Array.isArray(t)?(s=ns(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=ns(i,e,t,n),r=Object.keys(t),r.length===2||r.forEach(function(l){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(l==="x"||l==="y"||l==="z")return}else if(l==="x"||l==="y")return;o[l]=t[l]}),o)}function ss(i){return i instanceof st?i:typeof i=="object"&&"oProj"in i?i.oProj:st(i)}function CA(i,e,t){var n,s,o=!1,r;return typeof e>"u"?(s=ss(i),n=ic,o=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,s=ss(i),n=ic,o=!0),n||(n=ss(i)),s||(s=ss(e)),t?Oo(n,s,t):(r={forward:function(l,c){return Oo(n,s,l,c)},inverse:function(l,c){return Oo(s,n,l,c)}},o&&(r.oProj=s),r)}var nc=6,sc="AJSAJS",oc="AFAFAF",wi=65,qe=73,ot=79,nn=86,sn=90;const vA={forward:ac,inverse:bA,toPoint:rc};function ac(i,e){return e=e||5,SA(wA({lat:i[1],lon:i[0]}),e)}function bA(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function rc(i){var e=Uo(dc(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Go(i){return i*(Math.PI/180)}function lc(i){return 180*(i/Math.PI)}function wA(i){var e=i.lat,t=i.lon,n=6378137,s=.00669438,o=.9996,r,l,c,d,h,f,m,u=Go(e),g=Go(t),A,p;p=Math.floor((t+180)/6)+1,t===180&&(p=60),e>=56&&e<64&&t>=3&&t<12&&(p=32),e>=72&&e<84&&(t>=0&&t<9?p=31:t>=9&&t<21?p=33:t>=21&&t<33?p=35:t>=33&&t<42&&(p=37)),r=(p-1)*6-180+3,A=Go(r),l=s/(1-s),c=n/Math.sqrt(1-s*Math.sin(u)*Math.sin(u)),d=Math.tan(u)*Math.tan(u),h=l*Math.cos(u)*Math.cos(u),f=Math.cos(u)*(g-A),m=n*((1-s/4-3*s*s/64-5*s*s*s/256)*u-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*u)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*u)-35*s*s*s/3072*Math.sin(6*u));var y=o*c*(f+(1-d+h)*f*f*f/6+(5-18*d+d*d+72*h-58*l)*f*f*f*f*f/120)+5e5,C=o*(m+c*Math.tan(u)*(f*f/2+(5-d+9*h+4*h*h)*f*f*f*f/24+(61-58*d+d*d+600*h-330*l)*f*f*f*f*f*f/720));return e<0&&(C+=1e7),{northing:Math.round(C),easting:Math.round(y),zoneNumber:p,zoneLetter:IA(e)}}function Uo(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,l=.00669438,c,d=(1-Math.sqrt(1-l))/(1+Math.sqrt(1-l)),h,f,m,u,g,A,p,y,C,I=t-5e5,P=e;n<"N"&&(P-=1e7),p=(s-1)*6-180+3,c=l/(1-l),A=P/o,y=A/(r*(1-l/4-3*l*l/64-5*l*l*l/256)),C=y+(3*d/2-27*d*d*d/32)*Math.sin(2*y)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*y)+151*d*d*d/96*Math.sin(6*y),h=r/Math.sqrt(1-l*Math.sin(C)*Math.sin(C)),f=Math.tan(C)*Math.tan(C),m=c*Math.cos(C)*Math.cos(C),u=r*(1-l)/Math.pow(1-l*Math.sin(C)*Math.sin(C),1.5),g=I/(h*o);var k=C-h*Math.tan(C)/u*(g*g/2-(5+3*f+10*m-4*m*m-9*c)*g*g*g*g/24+(61+90*f+298*m+45*f*f-252*c-3*m*m)*g*g*g*g*g*g/720);k=lc(k);var M=(g-(1+2*f+m)*g*g*g/6+(5-2*m+28*f-3*m*m+8*c+24*f*f)*g*g*g*g*g/120)/Math.cos(C);M=p+lc(M);var B;if(i.accuracy){var _=Uo({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});B={top:_.lat,right:_.lon,bottom:k,left:M}}else B={lat:k,lon:M};return B}function IA(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 SA(i,e){var t="00000"+i.easting,n="00000"+i.northing;return i.zoneNumber+i.zoneLetter+xA(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+n.substr(n.length-5,e)}function xA(i,e,t){var n=cc(t),s=Math.floor(i/1e5),o=Math.floor(e/1e5)%20;return MA(s,o,n)}function cc(i){var e=i%nc;return e===0&&(e=nc),e}function MA(i,e,t){var n=t-1,s=sc.charCodeAt(n),o=oc.charCodeAt(n),r=s+i-1,l=o+e,c=!1;r>sn&&(r=r-sn+wi-1,c=!0),(r===qe||s<qe&&r>qe||(r>qe||s<qe)&&c)&&r++,(r===ot||s<ot&&r>ot||(r>ot||s<ot)&&c)&&(r++,r===qe&&r++),r>sn&&(r=r-sn+wi-1),l>nn?(l=l-nn+wi-1,c=!0):c=!1,(l===qe||o<qe&&l>qe||(l>qe||o<qe)&&c)&&l++,(l===ot||o<ot&&l>ot||(l>ot||o<ot)&&c)&&(l++,l===qe&&l++),l>nn&&(l=l-nn+wi-1);var d=String.fromCharCode(r)+String.fromCharCode(l);return d}function dc(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 l=i.charAt(o++);if(l<="A"||l==="B"||l==="Y"||l>="Z"||l==="I"||l==="O")throw"MGRSPoint zone letter "+l+" not handled: "+i;t=i.substring(o,o+=2);for(var c=cc(r),d=BA(t.charAt(0),c),h=TA(t.charAt(1),c);h<PA(l);)h+=2e6;var f=e-o;if(f%2!==0)throw`MGRSPoint has to have an even number
14
+ of digits after the zone letter and two 100km letters - front
15
+ half for easting meters, second half for
16
+ northing meters`+i;var m=f/2,u=0,g=0,A,p,y,C,I;return m>0&&(A=1e5/Math.pow(10,m),p=i.substring(o,o+m),u=parseFloat(p)*A,y=i.substring(o+m),g=parseFloat(y)*A),C=u+d,I=g+h,{easting:C,northing:I,zoneLetter:l,zoneNumber:r,accuracy:A}}function BA(i,e){for(var t=sc.charCodeAt(e-1),n=1e5,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>sn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function TA(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=oc.charCodeAt(e-1),n=0,s=!1;t!==i.charCodeAt(0);){if(t++,t===qe&&t++,t===ot&&t++,t>nn){if(s)throw"Bad character: "+i;t=wi,s=!0}n+=1e5}return n}function PA(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 Ii(i,e,t){if(!(this instanceof Ii))return new Ii(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")}Ii.fromMGRS=function(i){return new Ii(rc(i))},Ii.prototype.toMGRS=function(i){return ac([this.x,this.y],i)};var _A=1,DA=.25,hc=.046875,uc=.01953125,fc=.01068115234375,kA=.75,NA=.46875,RA=.013020833333333334,FA=.007120768229166667,LA=.3645833333333333,OA=.005696614583333333,GA=.3076171875;function Vo(i){var e=[];e[0]=_A-i*(DA+i*(hc+i*(uc+i*fc))),e[1]=i*(kA-i*(hc+i*(uc+i*fc)));var t=i*i;return e[2]=t*(NA-i*(RA+i*FA)),t*=i,e[3]=t*(LA-i*OA),e[4]=t*i*GA,e}function Si(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 UA=20;function Qo(i,e,t){for(var n=1/(1-e),s=i,o=UA;o;--o){var r=Math.sin(s),l=1-e*r*r;if(l=(Si(s,r,Math.cos(s),t)-i)*(l*Math.sqrt(l))*n,s-=l,Math.abs(l)<K)return s}return s}function VA(){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=Vo(this.es),this.ml0=Si(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function QA(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o,r,l=Math.sin(t),c=Math.cos(t);if(this.es){var h=c*n,f=Math.pow(h,2),m=this.ep2*Math.pow(c,2),u=Math.pow(m,2),g=Math.abs(c)>K?Math.tan(t):0,A=Math.pow(g,2),p=Math.pow(A,2);s=1-this.es*Math.pow(l,2),h=h/Math.sqrt(s);var y=Si(t,l,c,this.en);o=this.a*(this.k0*h*(1+f/6*(1-A+m+f/20*(5-18*A+p+14*m-58*A*m+f/42*(61+179*p-p*A-479*A)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+l*n*h/2*(1+f/12*(5-A+9*m+4*u+f/30*(61+p-58*A+270*m-330*A*m+f/56*(1385+543*p-p*A-3111*A))))))+this.y0}else{var d=c*Math.sin(n);if(Math.abs(Math.abs(d)-1)<K)return 93;if(o=.5*this.a*this.k0*Math.log((1+d)/(1-d))+this.x0,r=c*Math.cos(n)/Math.sqrt(1-Math.pow(d,2)),d=Math.abs(r),d>=1){if(d-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 HA(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=Qo(e,this.es,this.en),Math.abs(t)<j){var f=Math.sin(t),m=Math.cos(t),u=Math.abs(m)>K?Math.tan(t):0,g=this.ep2*Math.pow(m,2),A=Math.pow(g,2),p=Math.pow(u,2),y=Math.pow(p,2);e=1-this.es*Math.pow(f,2);var C=o*Math.sqrt(e)/this.k0,I=Math.pow(C,2);e=e*u,n=t-e*I/(1-this.es)*.5*(1-I/12*(5+3*p-9*g*p+g-4*A-I/30*(61+90*p-252*g*p+45*y+46*g-I/56*(1385+3633*p+4095*y+1574*y*p)))),s=X(this.long0+C*(1-I/6*(1+2*p+g-I/20*(5+28*p+24*y+8*g*p+6*g-I/42*(61+662*p+1320*y+720*y*p))))/m,this.over)}else n=j*en(r),s=0;else{var l=Math.exp(o/this.k0),c=.5*(l-1/l),d=this.lat0+r/this.k0,h=Math.cos(d);e=Math.sqrt((1-Math.pow(h,2))/(1+Math.pow(c,2))),n=Math.asin(e),r<0&&(n=-n),c===0&&h===0?s=0:s=X(Math.atan2(c,h)+this.long0,this.over)}return i.x=s,i.y=n,i}var YA=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const os={init:VA,forward:QA,inverse:HA,names:YA};function mc(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function Xe(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 zA(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function jA(i){var e=Math.abs(i);return e=zA(e*(1+e/(Xe(1,e)+1))),i<0?-e:e}function Ho(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 WA(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 $A(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function gc(i,e,t){for(var n=Math.sin(e),s=Math.cos(e),o=mc(t),r=$A(t),l=2*s*r,c=-2*n*o,d=i.length-1,h=i[d],f=0,m=0,u=0,g,A;--d>=0;)g=m,A=f,m=h,f=u,h=-g+l*m-c*f+i[d],u=-A+c*m+l*f;return l=n*r,c=s*o,[l*h-c*u,l*u+c*h]}function KA(){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&&(os.init.apply(this),this.forward=os.forward,this.inverse=os.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=Ho(this.cbg,this.lat0);this.Zb=-this.Qn*(n+WA(this.gtu,2*n))}function qA(i){var e=X(i.x-this.long0,this.over),t=i.y;t=Ho(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,Xe(n,s*r)),e=jA(Math.tan(e));var l=gc(this.gtu,2*t,2*e);t=t+l[0],e=e+l[1];var c,d;return Math.abs(e)<=2.623395162778?(c=this.a*(this.Qn*e)+this.x0,d=this.a*(this.Qn*t+this.Zb)+this.y0):(c=1/0,d=1/0),i.x=c,i.y=d,i}function XA(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=gc(this.utg,2*t,2*e);t=t+o[0],e=e+o[1],e=Math.atan(mc(e));var r=Math.sin(t),l=Math.cos(t),c=Math.sin(e),d=Math.cos(e);t=Math.atan2(r*d,Xe(c,d*l)),e=Math.atan2(c,d*l),n=X(e+this.long0,this.over),s=Ho(this.cgb,t)}else n=1/0,s=1/0;return i.x=n,i.y=s,i}var JA=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const as={init:KA,forward:qA,inverse:XA,names:JA};function ZA(i,e){if(i===void 0){if(i=Math.floor((X(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var ey="etmerc";function ty(){var i=ZA(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*xe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,as.init.apply(this),this.forward=as.forward,this.inverse=as.inverse}var iy=["Universal Transverse Mercator System","utm"];const ny={init:ty,names:iy,dependsOn:ey};function Yo(i,e){return Math.pow((1-i)/(1+i),e)}var sy=20;function oy(){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+ue)/(Math.pow(Math.tan(.5*this.lat0+ue),this.C)*Yo(this.e*i,this.ratexp))}function ay(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+ue),this.C)*Yo(this.e*Math.sin(t),this.ratexp))-j,i.x=this.C*e,i}function ry(i){for(var e=1e-14,t=i.x/this.C,n=i.y,s=Math.pow(Math.tan(.5*n+ue)/this.K,1/this.C),o=sy;o>0&&(n=2*Math.atan(s*Yo(this.e*Math.sin(i.y),-.5*this.e))-j,!(Math.abs(n-i.y)<e));--o)i.y=n;return o?(i.x=t,i.y=n,i):null}const zo={init:oy,forward:ay,inverse:ry};function ly(){zo.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 cy(i){var e,t,n,s;return i.x=X(i.x-this.long0,this.over),zo.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 dy(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=Xe(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,zo.inverse.apply(this,[i]),i.x=X(i.x+this.long0,this.over),i}var hy=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const uy={init:ly,forward:cy,inverse:dy,names:hy};function jo(i,e,t){return e*=t,Math.tan(.5*(j+i))*Math.pow((1-e)/(1+e),.5*t)}function fy(){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+en(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*Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ct(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ct(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(jo(this.lat0,this.sinlat0,this.e))-j,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function my(i){var e=i.x,t=i.y,n=Math.sin(t),s=Math.cos(t),o,r,l,c,d,h,f=X(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(f)),i.x=this.a*o*s*Math.sin(f)+this.x0,i.y=this.a*o*(this.coslat0*n-this.sinlat0*s*Math.cos(f))+this.y0,i):(r=2*Math.atan(jo(t,n,this.e))-j,c=Math.cos(r),l=Math.sin(r),Math.abs(this.coslat0)<=K?(d=ct(this.e,t*this.con,this.con*n),h=2*this.a*this.k0*d/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+c*Math.cos(f)),i.y=o*l):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*l+this.cosX0*c*Math.cos(f))),i.y=o*(this.cosX0*l-this.sinX0*c*Math.cos(f))+this.y0),i.x=o*c*Math.sin(f)+this.x0,i))}function gy(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 l=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(l)*this.sinlat0+i.y*Math.sin(l)*this.coslat0/r),Math.abs(this.coslat0)<K?this.lat0>0?e=X(this.long0+Math.atan2(i.x,-1*i.y),this.over):e=X(this.long0+Math.atan2(i.x,i.y),this.over):e=X(this.long0+Math.atan2(i.x*Math.sin(l),r*this.coslat0*Math.cos(l)-i.y*this.sinlat0*Math.sin(l)),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*tn(this.e,n),e=this.con*X(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=X(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*tn(this.e,Math.tan(.5*(j+o)));return i.x=e,i.y=t,i}var py=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const Ay={init:fy,forward:my,inverse:gy,names:py,ssfn_:jo};function yy(){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 l=Math.log(Math.tan(Math.PI/4+this.b0/2)),c=Math.log(Math.tan(Math.PI/4+i/2)),d=Math.log((1+r*e)/(1-r*e));this.K=l-this.alpha*c+this.alpha*r/2*d}function Ey(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))),l=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(l))/(1-Math.sin(l)))+this.y0,i.x=this.R*r+this.x0,i}function Cy(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))),l=this.lambda0+r/this.alpha,c=0,d=o,h=-1e3,f=0;Math.abs(d-h)>1e-7;){if(++f>20)return;c=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(d))/2)),h=d,d=2*Math.atan(Math.exp(c))-Math.PI/2}return i.x=l,i.y=d,i}var vy=["somerc"];const by={init:yy,forward:Ey,inverse:Cy,names:vy};var xi=1e-7;function wy(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(jl(t))!==-1}function Iy(){var i,e,t,n,s,o,r,l,c,d,h=0,f,m=0,u=0,g=0,A=0,p=0,y=0;this.no_off=wy(this),this.no_rot="no_rot"in this;var C=!1;"alpha"in this&&(C=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),C&&(y=this.alpha),I&&(h=this.rectified_grid_angle),C||I)m=this.longc;else if(u=this.long1,A=this.lat1,g=this.long2,p=this.lat2,Math.abs(A-p)<=xi||(i=Math.abs(A))<=xi||Math.abs(i-j)<=xi||Math.abs(Math.abs(this.lat0)-j)<=xi||Math.abs(Math.abs(p)-j)<=xi)throw new Error;var P=1-this.es;e=Math.sqrt(P),Math.abs(this.lat0)>K?(l=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*l*l,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/P),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(ct(this.e,this.lat0,l),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=s=1),C||I?(C?(f=Math.asin(Math.sin(y)/n),I||(h=y)):(f=h,y=Math.asin(n*Math.sin(f))),this.lam0=m-Math.asin(.5*(s-1/s)*Math.tan(f))/this.B):(o=Math.pow(ct(this.e,A,Math.sin(A)),this.B),r=Math.pow(ct(this.e,p,Math.sin(p)),this.B),s=this.E/o,c=(r-o)/(r+o),d=this.E*this.E,d=(d-r*o)/(d+r*o),i=u-g,i<-Math.PI?g-=Ji:i>Math.PI&&(g+=Ji),this.lam0=X(.5*(u+g)-Math.atan(d*Math.tan(.5*this.B*(u-g))/c)/this.B,this.over),f=Math.atan(2*Math.sin(this.B*X(u-this.lam0,this.over))/(s-1/s)),h=y=Math.asin(n*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),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(y))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(ue-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(ue+s))}function Sy(i){var e={},t,n,s,o,r,l,c,d;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-j)>K){if(r=this.E/Math.pow(ct(this.e,i.y,Math.sin(i.y)),this.B),l=1/r,t=.5*(r-l),n=.5*(r+l),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;d=.5*this.ArB*Math.log((1-s)/(1+s)),l=Math.cos(this.B*i.x),Math.abs(l)<xi?c=this.A*i.x:c=this.ArB*Math.atan2(t*this.cosgam+o*this.singam,l)}else d=i.y>0?this.v_pole_n:this.v_pole_s,c=this.ArB*i.y;return this.no_rot?(e.x=c,e.y=d):(c-=this.u_0,e.x=d*this.cosrot+c*this.sinrot,e.y=c*this.cosrot-d*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function xy(i){var e,t,n,s,o,r,l,c={};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),l=(r*this.cosgam+s*this.singam)/o,Math.abs(Math.abs(l)-1)<K)c.x=0,c.y=l<0?-j:j;else{if(c.y=this.E/Math.sqrt((1+l)/(1-l)),c.y=tn(this.e,Math.pow(c.y,1/this.B)),c.y===1/0)throw new Error;c.x=-this.rB*Math.atan2(s*this.cosgam-r*this.singam,Math.cos(this.BrA*e))}return c.x+=this.lam0,c}var My=["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 By={init:Iy,forward:Sy,inverse:xy,names:My};function Ty(){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=Ct(this.e,e,t),s=ct(this.e,this.lat1,e),o=Math.sin(this.lat2),r=Math.cos(this.lat2),l=Ct(this.e,o,r),c=ct(this.e,this.lat2,o),d=Math.abs(Math.abs(this.lat0)-j)<K?0:ct(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>K?this.ns=Math.log(n/l)/Math.log(s/c):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(d,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Py(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=K&&(t=en(t)*(j-2*K));var n=Math.abs(Math.abs(t)-j),s,o;if(n>K)s=ct(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*X(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 _y(i){var e,t,n,s,o,r=(i.x-this.x0)/this.k0,l=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(r*r+l*l),t=1):(e=-Math.sqrt(r*r+l*l),t=-1);var c=0;if(e!==0&&(c=Math.atan2(t*r,t*l)),e!==0||this.ns>0){if(t=1/this.ns,n=Math.pow(e/(this.a*this.f0),t),s=tn(this.e,n),s===-9999)return null}else s=-j;return o=X(c/this.ns+this.long0,this.over),i.x=o,i.y=s,i}var Dy=["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 ky={init:Ty,forward:Py,inverse:_y,names:Dy};function Ny(){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 Ry(i){var e,t,n,s,o,r,l,c=i.x,d=i.y,h=X(c-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(d))/(1-this.e*Math.sin(d)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(d/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,l=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=l*Math.cos(r)/1,i.x=l*Math.sin(r)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Fy(i){var e,t,n,s,o,r,l,c,d=i.x;i.x=i.y,i.y=d,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,l=e,c=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(l))/(1-this.e*Math.sin(l)),this.e/2))-this.s45),Math.abs(l-i.y)<1e-10&&(c=1),l=i.y,h+=1;while(c===0&&h<15);return h>=15?null:i}var Ly=["Krovak","krovak"];const Oy={init:Ny,forward:Ry,inverse:Fy,names:Ly};function ze(i,e,t,n,s){return i*s-e*Math.sin(2*s)+t*Math.sin(4*s)-n*Math.sin(6*s)}function on(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function an(i){return .375*i*(1+.25*i*(1+.46875*i))}function rn(i){return .05859375*i*i*(1+.75*i)}function ln(i){return i*i*i*(35/3072)}function Wo(i,e,t){var n=e*t;return i/Math.sqrt(1-n*n)}function Ft(i){return Math.abs(i)<j?i:i-en(i)*Math.PI}function rs(i,e,t,n,s){var o,r;o=i/e;for(var l=0;l<15;l++)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 Gy(){this.sphere||(this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Uy(i){var e,t,n=i.x,s=i.y;if(n=X(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),l=Wo(this.a,this.e,o),c=Math.tan(s)*Math.tan(s),d=n*Math.cos(s),h=d*d,f=this.es*r*r/(1-this.es),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,s);e=l*d*(1-h*c*(1/6-(8-c+8*f)*h/120)),t=m-this.ml0+l*o/r*h*(.5+(5-c+6*f)*h/24)}return i.x=e+this.x0,i.y=t+this.y0,i}function Vy(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,l=rs(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(l)-j)<=K)return i.x=this.long0,i.y=j,t<0&&(i.y*=-1),i;var c=Wo(this.a,this.e,Math.sin(l)),d=c*c*c/this.a/this.a*(1-this.es),h=Math.pow(Math.tan(l),2),f=e*this.a/c,m=f*f;n=l-c*Math.tan(l)/d*f*f*(.5-(1+3*h)*f*f/24),s=f*(1-m*(h/3+(1+3*h)*h*m/15))/Math.cos(l)}return i.x=X(s+this.long0,this.over),i.y=Ft(n),i}var Qy=["Cassini","Cassini_Soldner","cass"];const Hy={init:Gy,forward:Uy,inverse:Vy,names:Qy};function Lt(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 $o=1,Ko=2,qo=3,ls=4;function Yy(){var i=Math.abs(this.lat0);if(Math.abs(i-j)<K?this.mode=this.lat0<0?$o:Ko:Math.abs(i)<K?this.mode=qo:this.mode=ls,this.es>0){var e;switch(this.qp=Lt(this.e,1),this.mmf=.5/(1-this.es),this.apa=Zy(this.es),this.mode){case Ko:this.dd=1;break;case $o:this.dd=1;break;case qo:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case ls:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Lt(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===ls&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function zy(i){var e,t,n,s,o,r,l,c,d,h,f=i.x,m=i.y;if(f=X(f-this.long0,this.over),this.sphere){if(o=Math.sin(m),h=Math.cos(m),n=Math.cos(f),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(f),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(m+this.lat0)<K)return null;t=ue-m*.5,t=2*(this.mode===this.S_POLE?Math.cos(t):Math.sin(t)),e=t*Math.sin(f),t*=n}}else{switch(l=0,c=0,d=0,n=Math.cos(f),s=Math.sin(f),o=Math.sin(m),r=Lt(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=r/this.qp,c=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:d=1+this.sinb1*l+this.cosb1*c*n;break;case this.EQUIT:d=1+c*n;break;case this.N_POLE:d=j+m,r=this.qp-r;break;case this.S_POLE:d=m-j,r=this.qp+r;break}if(Math.abs(d)<K)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:d=Math.sqrt(2/d),this.mode===this.OBLIQ?t=this.ymf*d*(this.cosb1*l-this.sinb1*c*n):t=(d=Math.sqrt(2/(1+c*n)))*l*this.ymf,e=this.xmf*d*c*s;break;case this.N_POLE:case this.S_POLE:r>=0?(e=(d=Math.sqrt(r))*s,t=n*(this.mode===this.S_POLE?d:-d)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function jy(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,n,s,o,r,l,c,d;if(this.sphere){var h=0,f,m=0;if(f=Math.sqrt(e*e+t*t),s=f*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(m=Math.sin(s),h=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(f)<=K?0:Math.asin(t*m/f),e*=m,t=h*f;break;case this.OBLIQ:s=Math.abs(f)<=K?this.lat0:Math.asin(h*this.sinph0+t*m*this.cosph0/f),e*=m*this.cosph0,t=(h-Math.sin(s)*this.sinph0)*f;break;case this.N_POLE:t=-t,s=j-s;break;case this.S_POLE:s-=j;break}n=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(d=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,c=Math.sqrt(e*e+t*t),c<K)return i.x=this.long0,i.y=this.lat0,i;r=2*Math.asin(.5*c/this.rq),o=Math.cos(r),e*=r=Math.sin(r),this.mode===this.OBLIQ?(d=o*this.sinb1+t*r*this.cosb1/c,l=this.qp*d,t=c*this.cosb1*o-t*this.sinb1*r):(d=t*r/c,l=this.qp*d,t=c*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(t=-t),l=e*e+t*t,!l)return i.x=this.long0,i.y=this.lat0,i;d=1-l/this.qp,this.mode===this.S_POLE&&(d=-d)}n=Math.atan2(e,t),s=e1(Math.asin(d),this.apa)}return i.x=X(this.long0+n,this.over),i.y=s,i}var Wy=.3333333333333333,$y=.17222222222222222,Ky=.10257936507936508,qy=.06388888888888888,Xy=.0664021164021164,Jy=.016415012942191543;function Zy(i){var e,t=[];return t[0]=i*Wy,e=i*i,t[0]+=e*$y,t[1]=e*qy,e*=i,t[0]+=e*Ky,t[1]+=e*Xy,t[2]=e*Jy,t}function e1(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 t1=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const i1={init:Yy,forward:zy,inverse:jy,names:t1,S_POLE:$o,N_POLE:Ko,EQUIT:qo,OBLIQ:ls};function Ot(i){return Math.abs(i)>1&&(i=i>1?1:-1),Math.asin(i)}function n1(){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=Ct(this.e3,this.sin_po,this.cos_po),this.qs1=Lt(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=Ct(this.e3,this.sin_po,this.cos_po),this.qs2=Lt(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=Lt(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 s1(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var n=Lt(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*X(e-this.long0,this.over),r=s*Math.sin(o)+this.x0,l=this.rh-s*Math.cos(o)+this.y0;return i.x=r,i.y=l,i}function o1(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=X(s/this.ns0+this.long0,this.over),i.x=o,i.y=r,i}function a1(i,e){var t,n,s,o,r,l=Ot(.5*e);if(i<K)return l;for(var c=i*i,d=1;d<=25;d++)if(t=Math.sin(l),n=Math.cos(l),s=i*t,o=1-s*s,r=.5*o*o/n*(e/(1-c)-t/o+.5/i*Math.log((1-s)/(1+s))),l=l+r,Math.abs(r)<=1e-7)return l;return null}var r1=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const l1={init:n1,forward:s1,inverse:o1,names:r1,phi1z:a1};function c1(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function d1(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-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?(l=this.x0+this.a*o*t*Math.sin(n)/r,c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)/r):(l=this.x0+this.infinity_dist*t*Math.sin(n),c=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function h1(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=Ot(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=X(this.long0+o,this.over)):(r=this.phic0,o=0),i.x=o,i.y=r,i}var u1=["gnom"];const f1={init:c1,forward:d1,inverse:h1,names:u1};function m1(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*j:j;for(var n=Math.asin(.5*e),s,o,r,l,c=0;c<30;c++)if(o=Math.sin(n),r=Math.cos(n),l=i*o,s=Math.pow(1-l*l,2)/(2*r)*(e/(1-i*i)-o/(1-l*l)+.5/i*Math.log((1-l)/(1+l))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function g1(){this.sphere||(this.k0=Ct(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function p1(i){var e=i.x,t=i.y,n,s,o=X(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=Lt(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 A1(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=X(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=m1(this.e,2*i.y*this.k0/this.a),e=X(this.long0+i.x/(this.a*this.k0),this.over)),i.x=e,i.y=t,i}var y1=["cea"];const E1={init:g1,forward:p1,inverse:A1,names:y1};function C1(){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 v1(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s=Ft(t-this.lat0);return i.x=this.x0+this.a*n*this.rc,i.y=this.y0+this.a*s,i}function b1(i){var e=i.x,t=i.y;return i.x=X(this.long0+(e-this.x0)/(this.a*this.rc),this.over),i.y=Ft(this.lat0+(t-this.y0)/this.a),i}var w1=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const I1={init:C1,forward:v1,inverse:b1,names:w1};var pc=20;function S1(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.ml0=this.a*ze(this.e0,this.e1,this.e2,this.e3,this.lat0)}function x1(i){var e=i.x,t=i.y,n,s,o,r=X(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*(Ft(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 l=Wo(this.a,this.e,Math.sin(t))/Math.tan(t);n=l*Math.sin(o),s=this.a*ze(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+l*(1-Math.cos(o))}return i.x=n+this.x0,i.y=s+this.y0,i}function M1(i){var e,t,n,s,o,r,l,c,d;if(n=i.x-this.x0,s=i.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=K)e=X(n/this.a+this.long0,this.over),t=0;else{r=this.lat0+s/this.a,l=n*n/this.a/this.a+r*r,c=r;var h;for(o=pc;o;--o)if(h=Math.tan(c),d=-1*(r*(c*h+1)-c-.5*(c*c+l)*h)/((c-r)/h-1),c+=d,Math.abs(d)<=K){t=c;break}e=X(this.long0+Math.asin(n*Math.tan(c)/this.a)/Math.sin(t),this.over)}else if(Math.abs(s+this.ml0)<=K)t=0,e=X(this.long0+n/this.a,this.over);else{r=(this.ml0+s)/this.a,l=n*n/this.a/this.a+r*r,c=r;var f,m,u,g,A;for(o=pc;o;--o)if(A=this.e*Math.sin(c),f=Math.sqrt(1-A*A)*Math.tan(c),m=this.a*ze(this.e0,this.e1,this.e2,this.e3,c),u=this.e0-2*this.e1*Math.cos(2*c)+4*this.e2*Math.cos(4*c)-6*this.e3*Math.cos(6*c),g=m/this.a,d=(r*(f*g+1)-g-.5*f*(g*g+l))/(this.es*Math.sin(2*c)*(g*g+l-2*r*g)/(4*f)+(r-g)*(f*u-2/Math.sin(2*c))-u),c-=d,Math.abs(d)<=K){t=c;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=X(this.long0+Math.asin(n*f/this.a)/Math.sin(t),this.over)}return i.x=e,i.y=t,i}var B1=["Polyconic","American_Polyconic","poly"];const T1={init:S1,forward:x1,inverse:M1,names:B1};function P1(){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 _1(i){var e,t=i.x,n=i.y,s=n-this.lat0,o=t-this.long0,r=s/Xi*1e-5,l=o,c=1,d=0;for(e=1;e<=10;e++)c=c*r,d=d+this.A[e]*c;var h=d,f=l,m=1,u=0,g,A,p=0,y=0;for(e=1;e<=6;e++)g=m*h-u*f,A=u*h+m*f,m=g,u=A,p=p+this.B_re[e]*m-this.B_im[e]*u,y=y+this.B_im[e]*m+this.B_re[e]*u;return i.x=y*this.a+this.x0,i.y=p*this.a+this.y0,i}function D1(i){var e,t=i.x,n=i.y,s=t-this.x0,o=n-this.y0,r=o/this.a,l=s/this.a,c=1,d=0,h,f,m=0,u=0;for(e=1;e<=6;e++)h=c*r-d*l,f=d*r+c*l,c=h,d=f,m=m+this.C_re[e]*c-this.C_im[e]*d,u=u+this.C_im[e]*c+this.C_re[e]*d;for(var g=0;g<this.iterations;g++){var A=m,p=u,y,C,I=r,P=l;for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,I=I+(e-1)*(this.B_re[e]*A-this.B_im[e]*p),P=P+(e-1)*(this.B_im[e]*A+this.B_re[e]*p);A=1,p=0;var k=this.B_re[1],M=this.B_im[1];for(e=2;e<=6;e++)y=A*m-p*u,C=p*m+A*u,A=y,p=C,k=k+e*(this.B_re[e]*A-this.B_im[e]*p),M=M+e*(this.B_im[e]*A+this.B_re[e]*p);var B=k*k+M*M;m=(I*k+P*M)/B,u=(P*k-I*M)/B}var _=m,E=u,w=1,D=0;for(e=1;e<=9;e++)w=w*_,D=D+this.D[e]*w;var F=this.lat0+D*Xi*1e5,U=this.long0+E;return i.x=U,i.y=F,i}var k1=["New_Zealand_Map_Grid","nzmg"];const N1={init:P1,forward:_1,inverse:D1,names:k1};function R1(){}function F1(i){var e=i.x,t=i.y,n=X(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 L1(i){i.x-=this.x0,i.y-=this.y0;var e=X(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 O1=["Miller_Cylindrical","mill"];const G1={init:R1,forward:F1,inverse:L1,names:O1};var U1=20;function V1(){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=Vo(this.es)}function Q1(i){var e,t,n=i.x,s=i.y;if(n=X(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=U1;r;--r){var l=(this.m*s+Math.sin(s)-o)/(this.m+Math.cos(s));if(s-=l,Math.abs(l)<K)break}e=this.a*this.C_x*n*(this.m+Math.cos(s)),t=this.a*this.C_y*s}else{var c=Math.sin(s),d=Math.cos(s);t=this.a*Si(s,c,d,this.en),e=this.a*n*d/Math.sqrt(1-this.es*c*c)}return i.x=e,i.y=t,i}function H1(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=Ot((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Ot(Math.sin(e)/this.n)),n=X(n+this.long0,this.over),e=Ft(e)):(e=Qo(i.y/this.a,this.es,this.en),s=Math.abs(e),s<j?(s=Math.sin(e),t=this.long0+i.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(e)),n=X(t,this.over)):s-K<j&&(n=this.long0)),i.x=n,i.y=e,i}var Y1=["Sinusoidal","sinu"];const z1={init:V1,forward:Q1,inverse:H1,names:Y1};function j1(){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 W1(i){for(var e=i.x,t=i.y,n=X(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 l=.900316316158*this.a*n*Math.cos(s)+this.x0,c=1.4142135623731*this.a*Math.sin(s)+this.y0;return i.x=l,i.y=c,i}function $1(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=X(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 K1=["Mollweide","moll"];const q1={init:j1,forward:W1,inverse:$1,names:K1};function X1(){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=on(this.es),this.e1=an(this.es),this.e2=rn(this.es),this.e3=ln(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Ct(this.e,this.sin_phi,this.cos_phi),this.ml1=ze(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=Ct(this.e,this.sin_phi,this.cos_phi),this.ml2=ze(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=ze(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function J1(i){var e=i.x,t=i.y,n;if(this.sphere)n=this.a*(this.g-t);else{var s=ze(this.e0,this.e1,this.e2,this.e3,t);n=this.a*(this.g-s)}var o=this.ns*X(e-this.long0,this.over),r=this.x0+n*Math.sin(o),l=this.y0+this.rh-n*Math.cos(o);return i.x=r,i.y=l,i}function Z1(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=X(this.long0+o/this.ns,this.over),n=Ft(this.g-t/this.a),i.x=s,i.y=n,i;var r=this.g-t/this.a;return n=rs(r,this.e0,this.e1,this.e2,this.e3),s=X(this.long0+o/this.ns,this.over),i.x=s,i.y=n,i}var eE=["Equidistant_Conic","eqdc"];const tE={init:X1,forward:J1,inverse:Z1,names:eE};function iE(){this.R=this.a}function nE(i){var e=i.x,t=i.y,n=X(e-this.long0,this.over),s,o;Math.abs(t)<=K&&(s=this.x0+this.R*n,o=this.y0);var r=Ot(2*Math.abs(t/Math.PI));(Math.abs(n)<=K||Math.abs(Math.abs(t)-j)<=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 l=.5*Math.abs(Math.PI/n-n/Math.PI),c=l*l,d=Math.sin(r),h=Math.cos(r),f=h/(d+h-1),m=f*f,u=f*(2/d-1),g=u*u,A=Math.PI*this.R*(l*(f-g)+Math.sqrt(c*(f-g)*(f-g)-(g+c)*(m-g)))/(g+c);n<0&&(A=-A),s=this.x0+A;var p=c+f;return A=Math.PI*this.R*(u*p-l*Math.sqrt((g+c)*(c+1)-p*p))/(g+c),t>=0?o=this.y0+A:o=this.y0-A,i.x=s,i.y=o,i}function sE(i){var e,t,n,s,o,r,l,c,d,h,f,m,u;return i.x-=this.x0,i.y-=this.y0,f=Math.PI*this.R,n=i.x/f,s=i.y/f,o=n*n+s*s,r=-Math.abs(s)*(1+o),l=r-2*s*s+n*n,c=-2*r+1+2*s*s+o*o,u=s*s/c+(2*l*l*l/c/c/c-9*r*l/c/c)/27,d=(r-l*l/3/c)/c,h=2*Math.sqrt(-d/3),f=3*u/d/h,Math.abs(f)>1&&(f>=0?f=1:f=-1),m=Math.acos(f)/3,i.y>=0?t=(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI:t=-(-h*Math.cos(m+Math.PI/3)-l/3/c)*Math.PI,Math.abs(n)<K?e=this.long0:e=X(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 oE=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const aE={init:iE,forward:nE,inverse:sE,names:oE};function rE(i,e,t,n,s,o){const r=n-e,l=Math.atan((1-o)*Math.tan(i)),c=Math.atan((1-o)*Math.tan(t)),d=Math.sin(l),h=Math.cos(l),f=Math.sin(c),m=Math.cos(c);let u=r,g,A=100,p,y,C,I,P,k,M,B,_,E,w,D,F,U;do{if(p=Math.sin(u),y=Math.cos(u),C=Math.sqrt(m*p*(m*p)+(h*f-d*m*y)*(h*f-d*m*y)),C===0)return{azi1:0,s12:0};I=d*f+h*m*y,P=Math.atan2(C,I),k=h*m*p/C,M=1-k*k,B=M!==0?I-2*d*f/M:0,_=o/16*M*(4+o*(4-3*M)),g=u,u=r+(1-_)*o*k*(P+_*C*(B+_*I*(-1+2*B*B)))}while(Math.abs(u-g)>1e-12&&--A>0);return A===0?{azi1:NaN,s12:NaN}:(E=M*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),w=1+E/16384*(4096+E*(-768+E*(320-175*E))),D=E/1024*(256+E*(-128+E*(74-47*E))),F=D*C*(B+D/4*(I*(-1+2*B*B)-D/6*B*(-3+4*C*C)*(-3+4*B*B))),U=s*(1-o)*w*(P-F),{azi1:Math.atan2(m*p,h*f-d*m*y),s12:U})}function lE(i,e,t,n,s,o){const r=Math.atan((1-o)*Math.tan(i)),l=Math.sin(r),c=Math.cos(r),d=Math.sin(t),h=Math.cos(t),f=Math.atan2(l,c*h),m=c*d,u=1-m*m,g=u*(s*s-s*(1-o)*(s*(1-o)))/(s*(1-o)*(s*(1-o))),A=1+g/16384*(4096+g*(-768+g*(320-175*g))),p=g/1024*(256+g*(-128+g*(74-47*g)));let y=n/(s*(1-o)*A),C,I=100,P,k,M,B;do P=Math.cos(2*f+y),k=Math.sin(y),M=Math.cos(y),B=p*k*(P+p/4*(M*(-1+2*P*P)-p/6*P*(-3+4*k*k)*(-3+4*P*P))),C=y,y=n/(s*(1-o)*A)+B;while(Math.abs(y-C)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const _=l*k-c*M*h,E=Math.atan2(l*M+c*k*h,(1-o)*Math.sqrt(m*m+_*_)),w=Math.atan2(k*d,c*M-l*k*h),D=o/16*u*(4+o*(4-3*u)),F=w-(1-D)*o*m*(y+D*k*(P+D*M*(-1+2*P*P))),U=e+F;return{lat2:E,lon2:U}}function cE(){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 dE(i){var e=i.x,t=i.y,n=Math.sin(i.y),s=Math.cos(i.y),o=X(e-this.long0,this.over),r,l,c,d,h,f,m,u,g,A,p;return this.sphere?Math.abs(this.sin_p12-1)<=K?(i.x=this.x0+this.a*(j-t)*Math.sin(o),i.y=this.y0-this.a*(j-t)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(i.x=this.x0+this.a*(j+t)*Math.sin(o),i.y=this.y0+this.a*(j+t)*Math.cos(o),i):(g=this.sin_p12*n+this.cos_p12*s*Math.cos(o),m=Math.acos(g),u=m?m/Math.sin(m):1,i.x=this.x0+this.a*u*s*Math.sin(o),i.y=this.y0+this.a*u*(this.cos_p12*n-this.sin_p12*s*Math.cos(o)),i):(r=on(this.es),l=an(this.es),c=rn(this.es),d=ln(this.es),Math.abs(this.sin_p12-1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h-f)*Math.sin(o),i.y=this.y0-(h-f)*Math.cos(o),i):Math.abs(this.sin_p12+1)<=K?(h=this.a*ze(r,l,c,d,j),f=this.a*ze(r,l,c,d,t),i.x=this.x0+(h+f)*Math.sin(o),i.y=this.y0+(h+f)*Math.cos(o),i):Math.abs(e)<K&&Math.abs(t-this.lat0)<K?(i.x=i.y=0,i):(A=rE(this.lat0,this.long0,t,e,this.a,this.f),p=A.azi1,i.x=A.s12*Math.sin(p),i.y=A.s12*Math.cos(p),i))}function hE(i){i.x-=this.x0,i.y-=this.y0;var e,t,n,s,o,r,l,c,d,h,f,m,u,g,A,p;return this.sphere?(e=Math.sqrt(i.x*i.x+i.y*i.y),e>2*j*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=Ot(s*this.sin_p12+i.y*n*this.cos_p12/e),l=Math.abs(this.lat0)-j,Math.abs(l)<=K?this.lat0>=0?o=X(this.long0+Math.atan2(i.x,-i.y),this.over):o=X(this.long0-Math.atan2(-i.x,i.y),this.over):o=X(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)):(c=on(this.es),d=an(this.es),h=rn(this.es),f=ln(this.es),Math.abs(this.sin_p12-1)<=K?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=m-e,r=rs(u/this.a,c,d,h,f),o=X(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?(m=this.a*ze(c,d,h,f,j),e=Math.sqrt(i.x*i.x+i.y*i.y),u=e-m,r=rs(u/this.a,c,d,h,f),o=X(this.long0+Math.atan2(i.x,i.y),this.over),i.x=o,i.y=r,i):(g=Math.atan2(i.x,i.y),A=Math.sqrt(i.x*i.x+i.y*i.y),p=lE(this.lat0,this.long0,g,A,this.a,this.f),i.x=p.lon2,i.y=p.lat2,i))}var uE=["Azimuthal_Equidistant","aeqd"];const fE={init:cE,forward:dE,inverse:hE,names:uE};function mE(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function gE(i){var e,t,n,s,o,r,l,c,d=i.x,h=i.y;return n=X(d-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)&&(l=this.a*o*t*Math.sin(n),c=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*t*s)),i.x=l,i.y=c,i}function pE(i){var e,t,n,s,o,r,l;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=Ot(e/this.a),n=Math.sin(t),s=Math.cos(t),r=this.long0,Math.abs(e)<=K?(l=this.lat0,i.x=r,i.y=l,i):(l=Ot(s*this.sin_p14+i.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-j,Math.abs(o)<=K?(this.lat0>=0?r=X(this.long0+Math.atan2(i.x,-i.y),this.over):r=X(this.long0-Math.atan2(-i.x,i.y),this.over),i.x=r,i.y=l,i):(r=X(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=l,i))}var AE=["ortho"];const yE={init:mE,forward:gE,inverse:pE,names:AE};var Ie={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},fe={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function EE(){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>=j-ue/2?this.face=Ie.TOP:this.lat0<=-(j-ue/2)?this.face=Ie.BOTTOM:Math.abs(this.long0)<=ue?this.face=Ie.FRONT:Math.abs(this.long0)<=j+ue?this.face=this.long0>0?Ie.RIGHT:Ie.LEFT:this.face=Ie.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 CE(i){var e={x:0,y:0},t,n,s,o,r,l,c={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===Ie.TOP)o=j-t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=n-j):n>j+ue||n<=-(j+ue)?(c.value=fe.AREA_1,s=n>0?n-Me:n+Me):n>-(j+ue)&&n<=-ue?(c.value=fe.AREA_2,s=n+j):(c.value=fe.AREA_3,s=n);else if(this.face===Ie.BOTTOM)o=j+t,n>=ue&&n<=j+ue?(c.value=fe.AREA_0,s=-n+j):n<ue&&n>=-ue?(c.value=fe.AREA_1,s=-n):n<-ue&&n>=-(j+ue)?(c.value=fe.AREA_2,s=-n-j):(c.value=fe.AREA_3,s=n>0?-n+Me:-n-Me);else{var d,h,f,m,u,g,A;this.face===Ie.RIGHT?n=Mi(n,+j):this.face===Ie.BACK?n=Mi(n,+Me):this.face===Ie.LEFT&&(n=Mi(n,-j)),m=Math.sin(t),u=Math.cos(t),g=Math.sin(n),A=Math.cos(n),d=u*A,h=u*g,f=m,this.face===Ie.FRONT?(o=Math.acos(d),s=cs(o,f,h,c)):this.face===Ie.RIGHT?(o=Math.acos(h),s=cs(o,f,-d,c)):this.face===Ie.BACK?(o=Math.acos(-d),s=cs(o,f,-h,c)):this.face===Ie.LEFT?(o=Math.acos(-h),s=cs(o,f,d,c)):(o=s=0,c.value=fe.AREA_0)}return l=Math.atan(12/Me*(s+Math.acos(Math.sin(s)*Math.cos(ue))-j)),r=Math.sqrt((1-Math.cos(o))/(Math.cos(l)*Math.cos(l))/(1-Math.cos(Math.atan(1/Math.cos(s))))),c.value===fe.AREA_1?l+=j:c.value===fe.AREA_2?l+=Me:c.value===fe.AREA_3&&(l+=1.5*Me),e.x=r*Math.cos(l),e.y=r*Math.sin(l),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 vE(i){var e={lam:0,phi:0},t,n,s,o,r,l,c,d,h,f={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)?f.value=fe.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(f.value=fe.AREA_1,t-=j):i.x<0&&-i.x>=Math.abs(i.y)?(f.value=fe.AREA_2,t=t<0?t+Me:t-Me):(f.value=fe.AREA_3,t+=j),h=Me/12*Math.tan(t),r=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),l=Math.atan(r),s=Math.cos(t),o=Math.tan(n),c=1-s*s*o*o*(1-Math.cos(Math.atan(1/Math.cos(l)))),c<-1?c=-1:c>1&&(c=1),this.face===Ie.TOP)d=Math.acos(c),e.phi=j-d,f.value===fe.AREA_0?e.lam=l+j:f.value===fe.AREA_1?e.lam=l<0?l+Me:l-Me:f.value===fe.AREA_2?e.lam=l-j:e.lam=l;else if(this.face===Ie.BOTTOM)d=Math.acos(c),e.phi=d-j,f.value===fe.AREA_0?e.lam=-l+j:f.value===fe.AREA_1?e.lam=-l:f.value===fe.AREA_2?e.lam=-l-j:e.lam=l<0?-l-Me:-l+Me;else{var m,u,g;m=c,h=m*m,h>=1?g=0:g=Math.sqrt(1-h)*Math.sin(l),h+=g*g,h>=1?u=0:u=Math.sqrt(1-h),f.value===fe.AREA_1?(h=u,u=-g,g=h):f.value===fe.AREA_2?(u=-u,g=-g):f.value===fe.AREA_3&&(h=u,u=g,g=-h),this.face===Ie.RIGHT?(h=m,m=-u,u=h):this.face===Ie.BACK?(m=-m,u=-u):this.face===Ie.LEFT&&(h=m,m=u,u=-h),e.phi=Math.acos(-g)-j,e.lam=Math.atan2(u,m),this.face===Ie.RIGHT?e.lam=Mi(e.lam,-j):this.face===Ie.BACK?e.lam=Mi(e.lam,-Me):this.face===Ie.LEFT&&(e.lam=Mi(e.lam,+j))}if(this.es!==0){var A,p,y;A=e.phi<0?1:0,p=Math.tan(e.phi),y=this.b/Math.sqrt(p*p+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),A&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function cs(i,e,t,n){var s;return i<K?(n.value=fe.AREA_0,s=0):(s=Math.atan2(e,t),Math.abs(s)<=ue?n.value=fe.AREA_0:s>ue&&s<=j+ue?(n.value=fe.AREA_1,s-=j):s>j+ue||s<=-(j+ue)?(n.value=fe.AREA_2,s=s>=0?s-Me:s+Me):(n.value=fe.AREA_3,s+=j)),s}function Mi(i,e){var t=i+e;return t<-Me?t+=Ji:t>+Me&&(t-=Ji),t}var bE=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const wE={init:EE,forward:CE,inverse:vE,names:bE};var Xo=[[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]],cn=[[-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]],Ac=.8487,yc=1.3523,Ec=$e/5,IE=1/Ec,Bi=18,ds=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},SE=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function xE(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 ME(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function BE(i){var e=X(i.x-this.long0,this.over),t=Math.abs(i.y),n=Math.floor(t*Ec);n<0?n=0:n>=Bi&&(n=Bi-1),t=$e*(t-IE*n);var s={x:ds(Xo[n],t)*e,y:ds(cn[n],t)};return i.y<0&&(s.y=-s.y),s.x=s.x*this.a*Ac+this.x0,s.y=s.y*this.a*yc+this.y0,s}function TE(i){var e={x:(i.x-this.x0)/(this.a*Ac),y:Math.abs(i.y-this.y0)/(this.a*yc)};if(e.y>=1)e.x/=Xo[Bi][0],e.y=i.y<0?-j:j;else{var t=Math.floor(e.y*Bi);for(t<0?t=0:t>=Bi&&(t=Bi-1);;)if(cn[t][0]>e.y)--t;else if(cn[t+1][0]<=e.y)++t;else break;var n=cn[t],s=5*(e.y-n[0])/(cn[t+1][0]-n[0]);s=xE(function(o){return(ds(n,o)-e.y)/SE(n,o)},s,K,100),e.x/=ds(Xo[t],s),e.y=(5*t+s)*xe,i.y<0&&(e.y=-e.y)}return e.x=X(e.x+this.long0,this.over),e}var PE=["Robinson","robin"];const _E={init:ME,forward:BE,inverse:TE,names:PE};function DE(){this.name="geocent"}function kE(i){var e=Kl(i,this.es,this.a);return e}function NE(i){var e=ql(i,this.es,this.a,this.b);return e}var RE=["Geocentric","geocentric","geocent","Geocent"];const FE={init:DE,forward:kE,inverse:NE,names:RE};var Qe={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},dn={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 LE(){if(Object.keys(dn).forEach((function(t){if(typeof this[t]>"u")this[t]=dn[t].def;else{if(dn[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);dn[t].num&&(this[t]=parseFloat(this[t]))}dn[t].degrees&&(this[t]=this[t]*xe)}).bind(this)),Math.abs(Math.abs(this.lat0)-j)<K?this.mode=this.lat0<0?Qe.S_POLE:Qe.N_POLE:Math.abs(this.lat0)<K?this.mode=Qe.EQUIT:(this.mode=Qe.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 OE(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 Qe.OBLIQ:o=this.sinph0*e+this.cosph0*t*n;break;case Qe.EQUIT:o=t*n;break;case Qe.S_POLE:o=-e;break;case Qe.N_POLE:o=e;break}switch(o=this.pn1/(this.p-o),s=o*t*Math.sin(i.x),this.mode){case Qe.OBLIQ:o*=this.cosph0*e-this.sinph0*t*n;break;case Qe.EQUIT:o*=e;break;case Qe.N_POLE:o*=-(t*n);break;case Qe.S_POLE:o*=t*n;break}var r,l;return r=o*this.cg+s*this.sg,l=1/(r*this.sw*this.h1+this.cw),s=(s*this.cg-o*this.sg)*this.cw*l,o=r*l,i.x=s*this.a,i.y=o*this.a,i}function GE(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=Xe(i.x,i.y);if(Math.abs(o)<K)e.x=0,e.y=i.y;else{var r,l;switch(l=1-o*o*this.pfact,l=(this.p-Math.sqrt(l))/(this.pn1/o+o/this.pn1),r=Math.sqrt(1-l*l),this.mode){case Qe.OBLIQ:e.y=Math.asin(r*this.sinph0+i.y*l*this.cosph0/o),i.y=(r-this.sinph0*Math.sin(e.y))*o,i.x*=l*this.cosph0;break;case Qe.EQUIT:e.y=Math.asin(i.y*l/o),i.y=r*o,i.x*=l;break;case Qe.N_POLE:e.y=Math.asin(r),i.y=-i.y;break;case Qe.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 UE=["Tilted_Perspective","tpers"];const VE={init:LE,forward:OE,inverse:GE,names:UE};function QE(){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 HE(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 l=this.radius_p/Xe(this.radius_p*Math.cos(t),Math.sin(t));if(s=l*Math.cos(e)*Math.cos(t),o=l*Math.sin(e)*Math.cos(t),r=l*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/Xe(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/Xe(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/Xe(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/Xe(o,n))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function YE(i){var e=-1,t=0,n=0,s,o,r,l;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)*Xe(1,n)):(t=Math.tan(i.x/this.radius_g_1),n=Math.tan(i.y/this.radius_g_1)*Xe(1,t));var c=n/this.radius_p;if(s=t*t+c*c+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;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,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;l=(-o-Math.sqrt(r))/(2*s),e=this.radius_g+l*e,t*=l,n*=l,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 zE=["Geostationary Satellite View","Geostationary_Satellite","geos"];const jE={init:QE,forward:HE,inverse:YE,names:zE};var hn=1.340264,un=-.081106,fn=893e-6,mn=.003796,hs=Math.sqrt(3)/2;function WE(){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 $E(i){var e=X(i.x-this.long0,this.over),t=i.y,n=Math.asin(hs*Math.sin(t)),s=n*n,o=s*s*s;return i.x=e*Math.cos(n)/(hs*(hn+3*un*s+o*(7*fn+9*mn*s))),i.y=n*(hn+un*s+o*(fn+mn*s)),i.x=this.a*i.x+this.x0,i.y=this.a*i.y+this.y0,i}function KE(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,l,c,d;for(d=0;d<t&&(s=n*n,o=s*s*s,r=n*(hn+un*s+o*(fn+mn*s))-i.y,l=hn+3*un*s+o*(7*fn+9*mn*s),n-=c=r/l,!(Math.abs(c)<e));++d);return s=n*n,o=s*s*s,i.x=hs*i.x*(hn+3*un*s+o*(7*fn+9*mn*s))/Math.cos(n),i.y=Math.asin(Math.sin(n)/hs),i.x=X(i.x+this.long0,this.over),i}var qE=["eqearth","Equal Earth","Equal_Earth"];const XE={init:WE,forward:$E,inverse:KE,names:qE};var gn=1e-10;function JE(){var i;if(this.phi1=this.lat1,Math.abs(this.phi1)<gn)throw new Error;this.es?(this.en=Vo(this.es),this.m1=Si(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=eC,this.forward=ZE):(Math.abs(this.phi1)+gn>=j?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=iC,this.forward=tC)}function ZE(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s,o;return n=this.am1+this.m1-Si(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 eC(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=Xe(i.x,i.y=this.am1-i.y),s=Qo(this.am1+this.m1-t,this.es,this.en),(e=Math.abs(s))<j)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-j)<=gn)n=0;else throw new Error;return i.x=X(n+(this.long0||0),this.over),i.y=Ft(s),i}function tC(i){var e=X(i.x-(this.long0||0),this.over),t=i.y,n,s;return s=this.cphi1+this.phi1-t,Math.abs(s)>gn?(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 iC(i){i.x=(i.x-(this.x0||0))/this.a,i.y=(i.y-(this.y0||0))/this.a;var e,t,n=Xe(i.x,i.y=this.cphi1-i.y);if(t=this.cphi1+this.phi1-n,Math.abs(t)>j)throw new Error;return Math.abs(Math.abs(t)-j)<=gn?e=0:e=n*Math.atan2(i.x,i.y)/Math.cos(t),i.x=X(e+(this.long0||0),this.over),i.y=Ft(t),i}var nC=["bonne","Bonne (Werner lat_1=90)"];const sC={init:JE,names:nC},Cc={OBLIQUE:{forward:cC,inverse:hC},TRANSVERSE:{forward:dC,inverse:uC}},us={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 oC(){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=Yl.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=st(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(us),s=l=>{if(typeof this[l]>"u")return;const c=parseFloat(this[l])*xe;if(isNaN(c))throw new Error("Invalid value for "+l+": "+this[l]);return c};for(let l=0;l<n.length;l++){const c=n[l],d=us[c],h=Object.entries(d);if(h.some(([m])=>typeof this[m]<"u")){t=d;for(let m=0;m<h.length;m++){const[u,g]=h[m],A=s(u);if(typeof A>"u")throw new Error("Missing parameter: "+u+".");this[g]=A}break}}if(!t)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:o,phip:r}=lC(this,t);this.lamp=o,Math.abs(r)>K?(this.cphip=Math.cos(r),this.sphip=Math.sin(r),this.projectionType=Cc.OBLIQUE):this.projectionType=Cc.TRANSVERSE}function aC(i){return this.projectionType.forward(this,i)}function rC(i){return this.projectionType.inverse(this,i)}function lC(i,e){let t,n;if(e===us.ROTATE){let s=i.oLongC,o=i.oLatC,r=i.oAlpha;if(Math.abs(Math.abs(o)-j)<=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===us.NEW_POLE)n=i.oLongP,t=i.oLatP;else{let s=i.oLong1,o=i.oLat1,r=i.oLong2,l=i.oLat2,c=Math.abs(o);if(Math.abs(o)>j-K)throw new Error("Invalid value for o_lat_1: "+i.o_lat_1+" should be < 90°");if(Math.abs(l)>j-K)throw new Error("Invalid value for o_lat_2: "+i.o_lat_2+" should be < 90°");if(Math.abs(o-l)<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(c<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(l)*Math.cos(s)-Math.sin(o)*Math.cos(l)*Math.cos(r),Math.sin(o)*Math.cos(l)*Math.sin(r)-Math.cos(o)*Math.sin(l)*Math.sin(s)),t=Math.atan(-1*Math.cos(n-s)/Math.tan(o))}return{lamp:n,phip:t}}function cC(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=X(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 l=i.obliqueProjection.forward(e);return i.isIdentity&&(l.x*=$e,l.y*=$e),l}function dC(i,e){let{x:t,y:n}=e;t+=i.long0;const s=Math.cos(n),o=Math.cos(t);e.x=X(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*=$e,r.y*=$e),r}function hC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);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),l=Math.cos(s);e.x=Math.atan2(l*Math.sin(n),i.sphip*l*o-i.cphip*r),e.y=Math.asin(i.sphip*r+i.cphip*l*o)}return e.x=X(e.x+i.long0),e}function uC(i,e){i.isIdentity&&(e.x*=xe,e.y*=xe);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=X(e.x+i.long0),e}var fC=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const mC={init:oC,forward:aC,inverse:rC,names:fC};function gC(i){i.Proj.projections.add(os),i.Proj.projections.add(as),i.Proj.projections.add(ny),i.Proj.projections.add(uy),i.Proj.projections.add(Ay),i.Proj.projections.add(by),i.Proj.projections.add(By),i.Proj.projections.add(ky),i.Proj.projections.add(Oy),i.Proj.projections.add(Hy),i.Proj.projections.add(i1),i.Proj.projections.add(l1),i.Proj.projections.add(f1),i.Proj.projections.add(E1),i.Proj.projections.add(I1),i.Proj.projections.add(T1),i.Proj.projections.add(N1),i.Proj.projections.add(G1),i.Proj.projections.add(z1),i.Proj.projections.add(q1),i.Proj.projections.add(tE),i.Proj.projections.add(aE),i.Proj.projections.add(fE),i.Proj.projections.add(yE),i.Proj.projections.add(wE),i.Proj.projections.add(_E),i.Proj.projections.add(FE),i.Proj.projections.add(VE),i.Proj.projections.add(jE),i.Proj.projections.add(XE),i.Proj.projections.add(sC),i.Proj.projections.add(mC)}const fs=Object.assign(CA,{defaultDatum:"WGS84",Proj:st,WGS84:new st("WGS84"),Point:Ii,toPoint:ec,defs:Ge,nadgrid:iA,transform:ns,mgrs:vA,version:"__VERSION__"});gC(fs);class pC{cesium;viewer;mapLayers={};modelId="default";options={flyTo:!0};gisCadModelsList=[];open=!1;events=new Ki;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}getDxfModels(e){const t=typeof e=="object"?e?.modelId:e;return t?this.gisCadModelsList.find(n=>n.modelId===t):this.gisCadModelsList}getDefaultCoordinateTransformConfig(){return{centralMeridian:117,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 d=Number(e.longitude),h=Number(e.latitude);if([d,h].some(u=>Number.isNaN(u)))throw new Error("经纬度参数无效");const[f,m]=fs(n,s,[d,h]);return{direction:e.direction,x:f,y:m,config:t}}const o=Number(e.x),r=Number(e.y);if([o,r].some(d=>Number.isNaN(d)))throw new Error("投影坐标参数无效");const[l,c]=fs(s,n,[o,r]);return{direction:e.direction,longitude:l,latitude:c,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)})})}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(l=>{l.primitive&&(l.primitive.show=t)})})}flyToCadModel(e={}){const t=e.modelId||this.modelId,n=this.gisCadModelsList.find(s=>s.modelId===t);n&&this.flyToBounds(n,{duration:e.duration})}flyToBounds(e,t){if(!e)return;const n=t?.duration??0,s=e?.bounds?.rectangleDegrees;if(s){const o=this.cesium.Rectangle.fromDegrees(s.west,s.south,s.east,s.north);this.viewer.camera.flyTo({destination:o,duration:n});return}e.root&&this.viewer.flyTo(e.root,{duration:n})}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 l=this.cesium.Color.fromCssColorString(r);if(l)return l.withAlpha(t)}catch(l){console.warn("Failed to parse CAD color candidate:",r,l)}return console.warn("Failed to parse CAD color, fallback to white:",e),n}getLineWidth(e){return typeof e!="number"||Number.isNaN(e)?1:Math.max(1,Math.min(4,Math.round(e*4)))}uniqueKey(e){return e.map(t=>`${t??""}`).join("::")}normalizePoint(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),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||{},o=s.longitude??t.deltaLongitude??e.longitude??e.result?.origin?.longitude??0,r=s.latitude??t.deltaLatitude??e.latitude??e.result?.origin?.latitude??0,l=s.height??0,c=e.result?.extMin?.x??0,d=e.result?.extMin?.y??0,h=e.result?.realUnits??e.unit??1,f=Math.max(1e-6,Number(s.scale??1)),m=h*f;let u=null,g=null,A=null;if(s.transformConfig&&s.transformDirection==="projectedToLonlat"){const P=this.buildLongLatProj4Def(s.transformConfig),k=this.buildProjectedProj4Def(s.transformConfig);u=fs(k,P);try{const[M,B]=u.forward([c*h,d*h]);g=n.Cartesian3.fromDegrees(M,B,0);const _=n.Transforms.eastNorthUpToFixedFrame(g);A=n.Matrix4.inverseTransformation(_,new n.Matrix4)}catch(M){console.warn("Failed to calculate projection base",M),u=null}}const p=n.Cartesian3.fromDegrees(o,r,l),y=n.Transforms.eastNorthUpToFixedFrame(p),C=s.totalRotation??t.totalRotation??0;if(C){const P=n.Quaternion.fromAxisAngle(n.Cartesian3.UNIT_Z,n.Math.toRadians(C)),k=n.Matrix4.fromRotationTranslation(n.Matrix3.fromQuaternion(P),new n.Cartesian3(0,0,0));n.Matrix4.multiply(y,k,y)}return{originLongitude:o,originLatitude:r,originHeight:l,localOriginX:c,localOriginY:d,scaleToMeter:h,scale:f,totalScaleToMeter:m,toWorld:P=>{const k=this.normalizePoint(P);if(!k)return null;if(u&&g&&A)try{const B=k[0]*h,_=k[1]*h,[E,w]=u.forward([B,_]),D=n.Cartesian3.fromDegrees(E,w,k[2]*h),F=n.Matrix4.multiplyByPoint(A,D,new n.Cartesian3);return F.x*=f,F.y*=f,F.z*=f,n.Matrix4.multiplyByPoint(y,F,new n.Cartesian3)}catch{}const M=new n.Cartesian3((k[0]-c)*m,(k[1]-d)*m,k[2]*m);return n.Matrix4.multiplyByPoint(y,M,new n.Cartesian3)}}}createLinePrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPolylinePrimitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PolylineColorAppearance,asynchronous:!0,allowPicking:!1}):null}createPolygonPrimitive(e,t){return e.length?t.clampToGround?new this.cesium.GroundPrimitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):new this.cesium.Primitive({geometryInstances:e,appearance:new this.cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,closed:!0}),asynchronous:!0,allowPicking:!1}):null}createPointPrimitive(e){if(!e.length)return null;const t=new this.cesium.PointPrimitiveCollection;return e.forEach(n=>{t.add(n)}),t}buildModelPrimitives(e,t,n){const s=this.cesium,o=new s.PrimitiveCollection,r={},l={},c=this.buildTransform(t,e),d=new Map,h=new Map,f=new Map,m=Array.isArray(t.result?.lines)?t.result?.lines||[]:[],u=Array.isArray(t.result?.polygons)?t.result?.polygons||[]:[],g=Array.isArray(t.result?.points)?t.result?.points||[]:[];m.forEach(p=>{const C=(Array.isArray(p?.positions)?p.positions:[]).map(B=>c.toWorld(B)).filter(Boolean);if(C.length<2)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"line",this.getLineWidth(p.lineWeight)]),M=d.get(k)||[];M.push(new s.GeometryInstance({geometry:n.clampToGround?new s.GroundPolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight)}):new s.PolylineGeometry({positions:C,width:this.getLineWidth(p.lineWeight),vertexFormat:s.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(P,1))},id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"line"}})),d.set(k,M)}),u.forEach(p=>{const C=(Array.isArray(p?.outerPositions)?p.outerPositions:[]).map(_=>c.toWorld(_)).filter(Boolean);if(C.length<3)return;const I=Array.isArray(p?.holes)?p.holes.map(_=>{const E=Array.isArray(_)?_.map(w=>c.toWorld(w)).filter(Boolean):[];return E.length<3?null:new s.PolygonHierarchy(E)}).filter(Boolean):[],P=p.layer||"default",k=p.color||"#ffffff",M=this.uniqueKey([P,"polygon"]),B=h.get(M)||[];B.push(new s.GeometryInstance({geometry:new s.PolygonGeometry({polygonHierarchy:new s.PolygonHierarchy(C,I),vertexFormat:s.PerInstanceColorAppearance.VERTEX_FORMAT}),attributes:{color:s.ColorGeometryInstanceAttribute.fromColor(this.parseColor(k,.45))},id:{modelId:e.modelId,layer:P,batchId:p.batchId,type:"polygon"}})),h.set(M,B)}),g.forEach(p=>{const y=p?.position||p?.positions?.[0]||p,C=c.toWorld(y);if(!C)return;const I=p.layer||"default",P=p.color||"#ffffff",k=this.uniqueKey([I,"point"]),M=f.get(k)||[];M.push({position:C,color:this.parseColor(P,1),pixelSize:Math.max(4,Number(p.pixelSize||6)),id:{modelId:e.modelId,layer:I,batchId:p.batchId,type:"point"}}),f.set(k,M)});const A=(p,y,C)=>{y&&(o.add(y),n.recordLayers!==!1&&(l[p]||(l[p]=[]),l[p].push({primitive:y,color:C.color,batchId:C.batchId,type:C.type})),r[p]||(r[p]={}),r[p][C.type]=y)};return d.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createLinePrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"line"})}),h.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPolygonPrimitive(p,n),{color:void 0,batchId:p[0]?.id?.batchId,type:"polygon"})}),f.forEach((p,y)=>{const[C="default"]=y.split("::");A(C,this.createPointPrimitive(p),{color:void 0,batchId:p[0]?.id?.batchId,type:"point"})}),{root:o,layerPrimitiveMap:r,layerItemsMap:l,transform:c}}buildModelRoot(e,t,n){const s=new this.cesium.PrimitiveCollection,o={};let r=null;return t.forEach(l=>{const c=this.buildModelPrimitives(e,l,n);r||(r=c),s.add(c.root),this.mergeLayerItemsMap(o,c.layerItemsMap)}),{root:s,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){t.clampToGround!==void 0&&(e.buildOptions.clampToGround=t.clampToGround);const n=this.buildModelRoot({...e,formData:t},e.sourceDataList,e.buildOptions);e.groundRoot&&this.removeModelNode(e.root,e.groundRoot),e.groundRoot=n.root,e.root.add(e.groundRoot),e.groundRoot.show=e.show!==!1,e.transform=n.transform,this.mapLayers[e.modelId]=n.layerItemsMap}async loadModelFile(e){try{if(!e||typeof e!="string")return!1;const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`HTTP ${t.status} for ${e}`);if(e.endsWith(".json")||t.headers.get("content-type")?.includes("application/json"))return await t.json();const n=await t.blob(),s=new Io(new $n(n),{password:Il,useWebWorkers:!1}),r=(await s.getEntries()).find(d=>!d.directory&&d.filename.endsWith(".json"));if(!r)return await s.close(),!1;const l=await r.arrayBuffer({useWebWorkers:!1});await s.close();const c=new TextDecoder().decode(l);return JSON.parse(c.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}/${e.dbName}.zip`,`${t}${e.dbName}/${e.dbName}.json`,`${t}cad/0.json`].filter(Boolean);return Array.from(new Set(n))}getChunkCandidateUrls(e,t,n){const s=e.outPutPath.endsWith("/")?e.outPutPath:`${e.outPutPath}/`,o=[`${s}${e.dbName}/${e.dbName}_${n}.zip`,`${s}${e.dbName}/${e.dbName}${n}.zip`,`${s}${e.dbName}/${e.dbName}_${n}.json`,`${s}${e.dbName}/${e.dbName}${n}.json`,`${s}cad/${e.dbName}_${n}.zip`,`${s}cad/${e.dbName}${n}.zip`,`${s}cad/${e.dbName}_${n}.json`,`${s}cad/${e.dbName}${n}.json`];try{const r=new URL(t),l=r.pathname,c=l.lastIndexOf("/"),d=c>=0?l.slice(0,c+1):"/",h=l.lastIndexOf("."),f=h>=0?l.slice(h):".zip",m=c>=0?l.slice(c+1,h>=0?h:void 0):l.slice(0,h>=0?h:void 0),u=m===e.dbName?e.dbName:m;o.unshift(`${r.origin}${d}${u}_${n}${f}`,`${r.origin}${d}${u}${n}${f}`)}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 loadSourceDataList(e){const t=await this.loadSourceData(e);if(!t.data)return{url:t.url,dataList:[]};const n=t.data,s=[n],o=Math.max(1,Number(n.numbersOfFile||1)),r=t.url||"";for(let l=1;l<o;l++){const c=this.getChunkCandidateUrls(e,r,l);let d=!1;for(const h of c){const f=await this.loadModelFile(h);if(f){s.push(f),d=!0;break}}d||console.warn(`Failed to load GIS CAD chunk ${l} for ${e.modelId}`)}return{url:r,dataList:s}}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(c=>c.modelId===o.modelId))continue;const l=await this.loadSourceDataList(o);if(!l.dataList.length){console.error("Failed to resolve GIS CAD source for model:",o);continue}try{const c=l.dataList[0],d=this.buildTransform(c,o),h=this.normalizeFormData(o,d,s.clampToGround),f=this.buildModelRoot({...o,formData:h},l.dataList,s),m=new this.cesium.PrimitiveCollection;m.add(f.root);const u=c.bounds||null,g={...o,type:"gis-cad",sourceUrl:l.url,sourceData:c,sourceDataList:l.dataList,root:m,groundRoot:f.root,previewRoot:null,bounds:u,transform:f.transform,show:!0,formData:h,editingFormData:null,isEditing:!1,buildOptions:s};this.mapLayers[o.modelId]=f.layerItemsMap,this.viewer.scene.primitives.add(g.root),this.gisCadModelsList.push(g),this.setModelId(o.modelId),n.flyTo&&this.flyToBounds(g),n.onSuccess&&n.onSuccess(g)}catch(c){console.error("Failed to build GIS CAD model:",o,c)}}this.events.emit("mountAllGISCad",this.gisCadModelsList)}beginEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.isEditing||(t.isEditing=!0,t.editingFormData={...t.formData},this.rebuildPreviewRoot(t)),t):null}adjustGISCadModel(e){const t=this.getRuntimeModel(e.modelId);return t?(t.isEditing||this.beginEditGISCad({modelId:e.modelId}),t.editingFormData={...t.editingFormData||t.formData,...e,modelId:t.modelId,scale:Math.max(1e-6,Number(e.scale??t.editingFormData?.scale??t.formData.scale))},e.clampToGround!==void 0&&(t.buildOptions.clampToGround=e.clampToGround),this.rebuildPreviewRoot(t),t.editingFormData):null}commitEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return!t||!t.isEditing||!t.editingFormData||(t.formData={...t.editingFormData},this.replaceGroundRoot(t,t.formData),t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.isEditing=!1,t.editingFormData=null),t}cancelEditGISCad({modelId:e}){const t=this.getRuntimeModel(e);return t?(t.previewRoot&&(this.removeModelNode(t.root,t.previewRoot),t.previewRoot=null),t.groundRoot&&(t.groundRoot.show=t.show!==!1),t.isEditing=!1,t.editingFormData=null,t):null}deleteCad({modelId:e}){this.mapLayers[e]&&delete this.mapLayers[e];const t=this.gisCadModelsList.findIndex(n=>n.modelId===e);if(t>-1){const n=this.gisCadModelsList[t];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 Gt{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="",l="";const c=this.opt.style.background,d=this.opt.style.color;this.opt.anchor&&(r+=`
14
17
  <div class="prompt-anchor-container">
15
- <div class="prompt-anchor" style="background:${l} !important;">
18
+ <div class="prompt-anchor" style="background:${c} !important;">
16
19
  </div>
17
20
  </div>
18
- `),this.opt.closeBtn&&(c=`<a class="prompt-close" attr="${this.opt.id}" id="prompt-close-${this.opt.id}">x</a>`);let h=this.opt.style.boxShadow;const f="prompt-"+this.opt.id,p=`
21
+ `),this.opt.closeBtn&&(l=`<a class="prompt-close" attr="${this.opt.id}" id="prompt-close-${this.opt.id}">x</a>`);let h=this.opt.style.boxShadow;const f="prompt-"+this.opt.id,m=`
19
22
  <!-- 文本内容 -->
20
- <div class="prompt-content-container" style="background:${l} !important;color:${d} !important;box-shadow:${h} !important">
23
+ <div class="prompt-content-container" style="background:${c} !important;color:${d} !important;box-shadow:${h} !important">
21
24
  <div class="prompt-content" id="prompt-content-${this.opt.id}">
22
25
  ${this.opt.content}
23
26
  </div>
24
27
  </div>
25
28
  <!-- 锚 -->
26
- ${a}
29
+ ${r}
27
30
  <!-- 关闭按钮 -->
28
- ${c}
29
- `;this.promptDiv=window.document.createElement("div"),this.promptDiv.className=`easy3d-prompt ${this.opt.className}`,this.promptDiv.id=f,this.promptDiv.innerHTML=p,window.document.getElementById(r).appendChild(this.promptDiv);const m=window.document.getElementById(`prompt-close-${this.opt.id}`);let E=this;m&&m.addEventListener("click",A=>{E.hide(),E.opt.close&&E.opt.close()}),this.promptDom=window.document.getElementById(f),this.position=this.transPosition(this.opt.position),i==2&&this.bindRender(),this.opt.show==!1&&this.hide(),this.containerW=this.viewer.container.offsetWidth,this.containerH=this.viewer.container.offsetHeight,this.containerLeft=this.viewer.container.offsetLeft,this.containerTop=this.viewer.container.offsetTop,this.contentW=Math.ceil(Number(this.promptDom.offsetWidth)),this.contentH=this.promptDom.offsetHeight,this.opt.success&&this.opt.success()}destroy(){this.promptDiv&&(window.document.getElementById(this.viewer.container.id).removeChild(this.promptDiv),this.promptDiv=null),this.rendHandler&&(this.rendHandler(),this.rendHandler=null)}bindRender(){let e=this;this.rendHandler=this.viewer.scene.postRender.addEventListener(function(){if(!e.isShow&&e.promptDom){e.promptDom.style.display="none";return}if(e.position)if(e.position instanceof Cesium.Cartesian3){let t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e.viewer.scene,e.position);if(!t)return;new Cesium.EllipsoidalOccluder(e.viewer.scene.globe.ellipsoid,e.viewer.scene.camera.position).isPointVisible(e.position)?e.promptDom&&(e.promptDom.style.display="block"):e.promptDom&&(e.promptDom.style.display="none"),e.setByPX({x:t.x,y:t.y})}else e.setByPX({x:e.position.x,y:e.position.y})},this)}update(e,t){e instanceof Cesium.Cartesian3&&(this.position=e.clone(),e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e)),this.contentW=Math.ceil(Number(this.promptDom.offsetWidth)),this.contentH=this.promptDom.offsetHeight,e&&this.setByPX(e),t&&this.setContent(t)}isInView(){if(!this.position)return!1;let e=null;this.position instanceof Cesium.Cartesian2?e=this.position:e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,this.position);const i=new Cesium.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.position).isPointVisible(this.position);let s=!1;return e?(e.x>this.containerLeft&&e.x<this.containerLeft+this.containerW&&e.y>this.containerTop&&e.y<this.containerTop+this.containerH&&(s=!0),i&&s):s}setVisible(e){this.isInView(this.position)&&e?(this.isShow=!0,this.promptDom&&(this.promptDom.style.display="block")):(this.isShow=!1,this.promptDom&&(this.promptDom.style.display="none"))}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}setContent(e){let t=window.document.getElementById(`prompt-content-${this.opt.id}`);t.innerHTML=e}setByPX(e){e&&this.promptDom&&(this.promptDom.offsetWidth,this.promptDom.offsetHeight,this.opt.type==1?(this.promptDom.style.left=Number(e.x)+Number(this.opt.offset.x||0)+"px",this.promptDom.style.top=Number(e.y)+Number(this.opt.offset.y||0)+"px"):(this.promptDom.style.left=Number(e.x)+Number(this.opt.offset.x||0)-Number(this.contentW)/2+"px",this.promptDom.style.top=Number(e.y)+Number(this.opt.offset.y||0)-Number(this.contentH)+"px"))}transPosition(e){let t;return Array.isArray(e)?t=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0).clone():e instanceof Cesium.Cartesian3?t=e.clone():t=e,t}}const Qr=Object.freeze(Object.defineProperty({__proto__:null,default:ft},Symbol.toStringTag,{value:"Module"}));let ae={};ae.cartesianToLnglat=function(n,e){if(!n)return[];var t=Cesium.Cartographic.fromCartesian(n),i=Cesium.Math.toDegrees(t.latitude),s=Cesium.Math.toDegrees(t.longitude),r=t.height;return[s,i,r]},ae.getViewCenter=n=>{if(n){var e=n.camera.computeViewRectangle(),t=e.west/Math.PI*180,i=e.north/Math.PI*180,s=e.east/Math.PI*180,r=e.south/Math.PI*180;return[(s+t)/2,(i+r)/2]}},ae.cartesiansToLnglats=function(n,e){if(!(!n||n.length<1)){if(e=e||window.viewer,!e){console.log("util.cartesiansToLnglats方法缺少viewer对象");return}for(var t=[],i=0;i<n.length;i++)t.push(ae.cartesianToLnglat(n[i],e));return t}},ae.lnglatsToCartesians=function(n){if(!(!n||n.length<1)){for(var e=[],t=0;t<n.length;t++){var i=Cesium.Cartesian3.fromDegrees(n[t][0],n[t][1],n[t][2]||0);e.push(i)}return e}},ae.flyTo=function(n,e){if(!e){console.log("util.flyTo缺少viewer对象");return}n=n||{};let t=n.center;if(!t){console.log("缺少定位坐标!");return}if(t instanceof Cesium.Cartesian3&&e.camera.flyToBoundingSphere(new Cesium.BoundingSphere(t),{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(n.heading||0),Cesium.Math.toRadians(n.pitch||-60),n.range||1e4)}),t instanceof Array){var i=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]));e.camera.flyToBoundingSphere(i,{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(n.heading||0),Cesium.Math.toRadians(n.pitch||-60),n.range||1e4)})}},ae.getCameraView=function(n){if(n=n||window.viewer,!n){console.log("util.getCameraView缺少viewer对象");return}var e=n.camera,t=e.position,i=e.heading,s=e.pitch,r=e.roll,a=Cesium.Cartographic.fromCartesian(t),c={x:Cesium.Math.toDegrees(a.longitude),y:Cesium.Math.toDegrees(a.latitude),z:a.height,heading:Cesium.Math.toDegrees(i),pitch:Cesium.Math.toDegrees(s),roll:Cesium.Math.toDegrees(r)};return c},ae.setCameraView=function(n,e){if(e=e||window.viewer,!e){console.log("util.setCameraView缺少viewer对象");return}if(n){var t=n.destination||Cesium.Cartesian3.fromDegrees(n.x,n.y,n.z);e.camera.flyTo({destination:t,orientation:{heading:Cesium.Math.toRadians(n.heading||0),pitch:Cesium.Math.toRadians(n.pitch||0),roll:Cesium.Math.toRadians(n.roll||0)},duration:n.duration===void 0?3:n.duration,complete:n.complete})}},ae.computeAreaOfTriangle=function(n,e,t){if(!n||!e||!t)return console.log("传入坐标有误!"),0;var i=Cesium.Cartesian3.distance(n,e),s=Cesium.Cartesian3.distance(e,t),r=Cesium.Cartesian3.distance(t,n),a=(i+s+r)/2;return Math.sqrt(a*(a-i)*(a-s)*(a-r))};class tt{constructor(e,t){this.viewer=e,this.style=t||{},this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.handler=void 0,this.modifyHandler=void 0,this.type="",this.positions=[],this.state=null,this.prompt=null,this.controlPoints=[],this.modifyPoint=null,this.entity=null,this.pointStyle={},this.promptStyle=this.style.prompt||{show:!0},this.properties={},this.clientScale=1}getCatesian3FromPX(e){if(e=this.transpx(e),this.viewer.scene.mode===Cesium.SceneMode.SCENE2D){let r=this.viewer.camera.getPickRay(e),a=null;return r&&(a=this.viewer.scene.globe.pick(r,this.viewer.scene)),a||(a=this.viewer.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),a}let t=this.viewer.scene.drillPick(e);this.viewer.scene.render();let i,s=!1;for(let r=0;r<t.length;r++)if(t[r]&&t[r].primitive&&t[r].primitive instanceof Cesium.Cesium3DTileset){s=!0;break}if(s)i=this.viewer.scene.pickPosition(e);else{let r=this.viewer.camera.getPickRay(e);if(!r)return null;i=this.viewer.scene.globe.pick(r,this.viewer.scene)}return i}setClientScale(e){e=e||1,this.clientScale=e}transpx(e){return{x:e.x/(this.clientScale||1),y:e.y/(this.clientScale||1)}}getEntity(){return this.entity}getPositions(e){return e?ae.cartesiansToLnglats(this.positions,this.viewer):this.positions}getLnglats(){return ae.cartesiansToLnglats(this.positions,this.viewer)}setOwnProp(e){this.entity&&(this.entity.ownProp=e)}remove(){this.entity&&(this.state="no",this.viewer.entities.remove(this.entity),this.entity=null)}setVisible(e){this.entity&&(this.entity.show=e)}forbidDrawWorld(e){this.viewer.scene.screenSpaceCameraController.enableRotate=!e,this.viewer.scene.screenSpaceCameraController.enableTilt=!e,this.viewer.scene.screenSpaceCameraController.enableTranslate=!e,this.viewer.scene.screenSpaceCameraController.enableInputs=!e}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.positions=[],this.style=null;for(var e=0;e<this.controlPoints.length;e++){var t=this.controlPoints[e];this.viewer.entities.remove(t)}this.controlPoints=[],this.modifyPoint=null,this.prompt&&(this.prompt.destroy(),this.prompt=null),this.state="no",this.forbidDrawWorld(!1)}startEdit(e){if(this.state=="startEdit"||this.state=="editing"||!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this;for(let i=0;i<t.controlPoints.length;i++){let s=t.controlPoints[i];s&&(s.show=!0)}this.entity.show=!0,this.modifyHandler.setInputAction(function(i){if(!t.entity)return;let s=t.viewer.scene.pick(i.position);Cesium.defined(s)&&s.id&&(s.id.objId||(t.modifyPoint=s.id),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(i){if(t.positions.length<1||!t.modifyPoint)return;let s=t.getCatesian3FromPX(i.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.position.setValue(s),t.positions[t.modifyPoint.wz]=s,t.state="editing",e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(i){t.modifyPoint&&(t.modifyPoint=null,t.forbidDrawWorld(!1),t.state="editing")},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){for(let t=0;t<this.controlPoints.length;t++){let i=this.controlPoints[t];i&&(i.show=!1)}this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}endCreate(){}done(){}createPoint(e){if(!e)return;this.pointStyle.color=this.pointStyle.color||Cesium.Color.CORNFLOWERBLUE,this.pointStyle.outlineColor=this.pointStyle.color||Cesium.Color.CORNFLOWERBLUE;let t=this.pointStyle.color instanceof Cesium.Color?this.pointStyle.color:Cesium.Color.fromCssColorString(this.pointStyle.color);t=t.withAlpha(this.pointStyle.colorAlpha||1);let i=this.pointStyle.outlineColor instanceof Cesium.Color?this.pointStyle.outlineColor:Cesium.Color.fromCssColorString(this.pointStyle.outlineColor);return i=i.withAlpha(this.pointStyle.outlineColorAlpha||1),this.viewer.entities.add({position:e,point:{pixelSize:this.pointStyle.property||10,color:t,outlineWidth:this.pointStyle.outlineWidth||0,outlineColor:i,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:!1})}transfromLineMaterial(e){if(!e)return;let t={};if(e instanceof Cesium.Color){let i=e.color.getValue();t.colorAlpha=i.alpha,t.colorHex=new Cesium.Color(i.red,i.green,i.blue,1).toCssHexString()}return t}transfromGonMaterial(e){if(!e)return;let t={};if(e instanceof Cesium.Color){let i=e.color.getValue();t.colorAlpha=i.alpha,t.colorHex=new Cesium.Color(i.red,i.green,i.blue,1).toCssHexString()}return t}setAttr(e){this.properties.attr=e||{}}getAttr(){return this.properties.attr}zoomTo(){this.entity&&this.viewer.zoomTo(this.entity)}}const Pp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAptJREFUOE+FVD1oU1EYvecVCU5acHFqsggKSlUcdDGZuvhToeAgYuIuaUcHMZ0c2+JuAg4dKrS6iFPiooMUAyqCS5PFTVpBKJKa4/nez817yateeOTm3vOd75zv3u/C5QySx50b3HMO89oupyBdzTvOHawBR3t5sRhfJH+tiqiu9X4UDJH80Tc169ywGCeZcY7CDZaB6b00hyckd6WKbW2WFLQoYCtPga0JW40I3Y6wt4T1alOE382OBuaBk7l20gnIHQkoyEFA5/YrQClUGhKS/YZ+FmVpVhuejNzXemhfwU4BWAUKywlxRBoYfguYkWohosXBruY14JS3Sf6Ik1CJpqRkaAe0ovSyeGJrRPrNiJr6ziu+K8LPCqBqdraYtdRPMms/GmRPxNiTGiP3g/ykcrELnKuKcNtAPeBCKHkU/EUKgw5wWvsJ4VcLFPbMGOG2HdBN4GJJhO9UVMju5VaacHxOfjClsux0AJd8kkj5+7LdEOAKRNgWoYEqGVBWbVvqoTpRiSsTicUhQidC0ZBvjFAXdE4WJwe5qUM7ovtmmGtmbWKQr0UYiHDOCF9JmdXwulTkgddj8O2JrkrQ5EuJQRW4URThhv2pAwvT+YTNotaLQO0fJXlhTaFTXrBTXlfA0CypPndy6vPU6nMVeOAvdDox+Tx0IA4V8G4n7pRnVht7XbRYi1swCiOfyIF7DDzMeUia1v8ftd8H7lvipPVs47dZOqb+1I2v+ReEbMSWGxnLZBgTPyYFK8molyMlK9aXpk6krgHU1/JqGmPN5qaipJplYMm7ytiISA9kn7LvevpVzwZSRmWnlAb6WNWeqX6r66SXacm78ZbHlahuChhaj1uL6TH146dmSsIW8ChTggRx6N06zO7/1v8CLeIaJJK0e+4AAAAASUVORK5CYII=";class Np extends tt{constructor(e,t){super(e,t),this.type="billboard",this.viewer=e;let i={verticalOrigin:Cesium.VerticalOrigin.BOTTOM,scale:1};this.style=Object.assign({},i,t||{}),this.entity=null,this.style.hasOwnProperty("image")||console.warn("CreateBillboard: 未在 style 中指定 image,后续将使用回退图或占位图。"),this.position=null,this._defaultFallback=Pp,this.prompt=null,this.modifyHandler=null,this._globalMouseUpHandler=null,this._isDragging=!1,this._editPickedEntity=null,this.controlPoints=[],this.modifyPoint=null,this._isScaling=!1,this._fileInput=null}_preloadImage(e,t=7e3){return new Promise((i,s)=>{if(!e)return s(new Error("empty url"));try{const r=new window.Image;r.crossOrigin="anonymous";let a=!1;const c=()=>{a||(a=!0,clearTimeout(d),i(r))},l=h=>{a||(a=!0,clearTimeout(d),s(new Error("image load error: "+e)))};r.onload=c,r.onerror=l;const d=setTimeout(()=>{a||(a=!0,r.onload=r.onerror=null,s(new Error("image load timeout: "+e)))},t);r.src=e}catch(r){s(r)}})}createBillboard(e){if(!e)return;const t=this.style.fallbackImage||this._defaultFallback,i=this.viewer.entities.add({position:e,billboard:{image:t,scale:this.style.scale||1,pixelOffset:this.style.pixelOffset,heightReference:this.style.heightReference==null?Cesium.HeightReference.CLAMP_TO_GROUND:Number(this.style.heightReference),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,color:this.style.color?this.style.color instanceof Cesium.Color?this.style.color.withAlpha(this.style.colorAlpha||1):Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1):Cesium.Color.WHITE}});i.objId=this.objId;const s=this.style.image;if(s)this._preloadImage(s,7e3).then(r=>{try{i.billboard.image=r,this.style.image=s}catch(a){console.warn("CreateBillboard: set billboard image element failed, fallback to url string",a);try{i.billboard.image=s}catch{}}try{this.viewer.scene.requestRender()}catch{}}).catch(r=>{console.error("CreateBillboard: image load failed:",r.message," URL:",s," 使用回退图:",t);try{this.viewer.scene.requestRender()}catch{}});else try{this.viewer.scene.requestRender()}catch{}return this.position=e.clone(),this.entity=i,i}updateBillboardImage(e){if(!this.entity||!this.entity.billboard)return;const t=this.style.fallbackImage||this._defaultFallback;if(!e){try{this.entity.billboard.image=t}catch{}this.style.image=t;try{this.viewer.scene.requestRender()}catch{}return}try{this.entity.billboard.image=t}catch{}this._preloadImage(e,7e3).then(i=>{try{this.entity.billboard.image=i}catch(s){console.warn("CreateBillboard: set billboard image element failed, fallback to url string",s);try{this.entity.billboard.image=e}catch{}}this.style.image=e;try{this.viewer.scene.requestRender()}catch{}}).catch(i=>{console.error("CreateBillboard: updateBillboardImage failed to load:",i.message," URL:",e);try{this.entity.billboard.image=t}catch{}this.style.image=t;try{this.viewer.scene.requestRender()}catch{}})}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(i){let s=t.getCatesian3FromPX(i.position,t.viewer);if(s){if(t.position=s.clone(),t.entity=t.createBillboard(t.position),t.handler){try{t.handler.destroy()}catch{}t.handler=null}if(t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}t.state="endCreate",e&&e(t.entity)}},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){t.prompt&&t.prompt.update&&t.prompt.update(i.endPosition,"单击新增"),t.state="creating"},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){let e=this;if(e.handler){try{e.handler.destroy()}catch{}e.handler=null}if(e.prompt){try{e.prompt.destroy()}catch{}e.prompt=null}e.state="endCreate"}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let i=null;e instanceof Cesium.Cartesian3?i=e.clone():i=Cesium.Cartesian3.fromDegrees(Number(e[0]),Number(e[1]),Number(e[2]||0)),i&&(this.position=i.clone(),this.entity=this.createBillboard(this.position),t&&t(this.entity),this.state="endCreate")}setStyle(e){if(!e)return;let t=this.entity&&this.entity.billboard;if(t){if(e.image!=null&&this.updateBillboardImage(e.image),e.heightReference!=null){let i=1;e.heightReference==!0?i=1:i=Number(e.heightReference);try{t.heightReference=i}catch{}}if(e.scale!=null)try{t.scale=Number(e.scale)}catch{}if(e.color){let i=e.color instanceof Cesium.Color?e.color:Cesium.Color.fromCssColorString(e.color);i=i.withAlpha(e.colorAlpha||1);try{t.color=i}catch{}}}this.style=Object.assign(this.style,e)}getStyle(){let e={},t=this.entity&&this.entity.billboard;if(e.image=this.style.image,t&&t.heightReference)try{let i=t.heightReference.getValue();e.heightReference=Number(i)}catch{}if(t&&t.scale)try{e.scale=t.scale.getValue()}catch{}if(t&&t.color)try{let i=t.color.getValue();e.colorAlpha=i.alpha,e.color=new Cesium.Color(i.red,i.green,i.blue,1).toCssHexString()}catch{}return e}startEdit(e){if(this._cleanupEditState(),!this.entity)return;this.state="startEdit",this.controlPoints=[],this.showControlPoints(),this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);let t=this,i=null,s=!1;const r=()=>{if(s){if(s=!1,t.entity&&Cesium.defined(t.entity.position))try{t.position=t.entity.position.getValue(Cesium.JulianDate.now()).clone()}catch(a){console.warn("更新位置引用失败:",a)}i=null,t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}t.state="editing"}};window.addEventListener("mouseup",r,!0),this._globalMouseUpHandler=r,this.modifyHandler.setInputAction(function(a){const c=t.viewer.scene.pick(a.position);if(Cesium.defined(c)&&c.id){if(c.id===t.entity){i=c.id,s=!0,t._isDragging=!0,t._editPickedEntity=i,t.modifyPoint=null;try{t.forbidDrawWorld(!0)}catch{}}else if(t.controlPoints.includes(c.id)){t.modifyPoint=c.id,s=!0,t._isDragging=!0,i=t.entity;try{t.forbidDrawWorld(!0)}catch{}}}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(a){if(!s)return;let c=t.getCatesian3FromPX(a.endPosition,t.viewer);if(c){if(Cesium.defined(i)){try{i.position.setValue(c)}catch{i.position=c}t.position=c.clone(),t.controlPoints&&t.controlPoints.length>0&&t.controlPoints.forEach(l=>{try{l.position.setValue(c)}catch(d){console.warn("更新控制点位置失败:",d);try{l.position=c.clone()}catch(h){console.error("重新设置控制点位置失败:",h)}}})}t.state="editing",e&&e()}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){if(s){if(s=!1,t.entity&&Cesium.defined(t.entity.position))try{t.position=t.entity.position.getValue(Cesium.JulianDate.now()).clone()}catch(a){console.warn("更新位置引用失败:",a)}t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}t.state="editing"}},Cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(){if(t._isScaling){t._isScaling=!1,t._isDragging=!1,t._scalingControlPoint=null,delete t._initialScale,delete t._initialMousePosition,t.viewer.canvas.style.cursor="",t._hideScaleHint();try{t.forbidDrawWorld(!1)}catch{}}if(s){s=!1,t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}}if(t.hideControlPoints(),t.modifyHandler){try{t.modifyHandler.destroy()}catch{}t.modifyHandler=null}t._globalMouseUpHandler&&(window.removeEventListener("mouseup",t._globalMouseUpHandler,!0),t._globalMouseUpHandler=null),t.state="endEdit"},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.modifyHandler.setInputAction(function(a){const c=t.viewer.scene.pick(a.position);Cesium.defined(c)&&c.id===t.entity&&t._handleDoubleClick()},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}createControlPoint(e){return e?this.viewer.entities.add({position:e,point:{pixelSize:8,color:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}}):null}createYellowControlPoint(e){if(!e)return null;const t=this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.YELLOW,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}});return t.isYellowControl=!0,t}createScaleControlPoint(e,t){if(!e)return null;let i=Cesium.Color.GREEN;t==="bottomLeft"&&(i=Cesium.Color.BLUE);const s=this.viewer.entities.add({position:e,point:{pixelSize:10,color:i,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}});return s.isScaleControl=!0,s.corner=t,s}_calculateSpecialPosition(e){return this._calculateCornerPosition(e,"bottomRight")}_calculateCornerPosition(e,t){if(!e)return null;const s=50*(this.style.scale||1),r=this.viewer.camera,a=new Cesium.Cartesian3,c=new Cesium.Cartesian3,l=new Cesium.Cartesian3;Cesium.Cartesian3.clone(r.direction,a),Cesium.Cartesian3.clone(r.right,c),Cesium.Cartesian3.clone(r.up,l),Cesium.Cartesian3.normalize(a,a),Cesium.Cartesian3.normalize(c,c),Cesium.Cartesian3.normalize(l,l);const d=new Cesium.Cartesian3;Cesium.Cartesian3.multiplyByScalar(c,s,d),Cesium.Cartesian3.multiplyByScalar(l,s,l),Cesium.Cartesian3.add(d,l,d);const h=new Cesium.Ray(e,a),f=this.viewer.scene.globe.pick(h,this.viewer.scene),u=Cesium.Cartesian3.distance(e,f||e)*.001;return Cesium.Cartesian3.multiplyByScalar(d,u,d),Cesium.Cartesian3.add(e,d,new Cesium.Cartesian3)}showControlPoints(){if(this.controlPoints=this.controlPoints||[],this._isDragging){this.position&&this.controlPoints.length>0&&this.controlPoints.forEach(e=>{try{e.position.setValue(this.position)}catch{try{e.position=this.position.clone()}catch(i){console.warn("更新拖拽中控制点位置失败:",i)}}});return}if(this.controlPoints.length>0&&([...this.controlPoints].forEach(t=>{try{this.viewer&&this.viewer.entities&&t&&this.viewer.entities.remove(t)}catch(i){console.warn("移除控制点失败:",i)}}),this.controlPoints.length=0),this.position&&this.viewer&&!this._isDragging){const e=this.createControlPoint(this.position);e&&(e.wz=0,this.controlPoints.push(e))}}hideControlPoints(){this.controlPoints&&Array.isArray(this.controlPoints)&&this.controlPoints.length>0?([...this.controlPoints].forEach(t=>{try{this.viewer&&this.viewer.entities&&t&&this.viewer.entities.remove(t)}catch(i){console.warn("移除控制点失败:",i)}}),this.controlPoints.length=0):(!this.controlPoints||!Array.isArray(this.controlPoints))&&(this.controlPoints=[]),this.topRightControlPoint=null,this.bottomLeftControlPoint=null,this.scaleControlPoint=null,this.modifyPoint=null}endEdit(e){if(this.hideControlPoints(),this.modifyHandler){try{this.modifyHandler.destroy()}catch{}this.modifyHandler=null}if(this._globalMouseUpHandler){try{window.removeEventListener("mouseup",this._globalMouseUpHandler,!0)}catch{}this._globalMouseUpHandler=null}try{this.forbidDrawWorld(!1)}catch{}this.viewer&&this.viewer.canvas&&(this.viewer.canvas.style.cursor=""),this._isDragging=!1,this._editPickedEntity=null,this.modifyPoint=null,this.state="endEdit",e&&e(this.entity)}_cleanupEditState(){if(this._globalMouseUpHandler){try{window.removeEventListener("mouseup",this._globalMouseUpHandler,!0)}catch{}this._globalMouseUpHandler=null}if(this.modifyHandler){try{this.modifyHandler.destroy()}catch{}this.modifyHandler=null}this.controlPoints=this.controlPoints||[],this.hideControlPoints(),this._isDragging=!1,this._editPickedEntity=null,this.modifyPoint=null;try{this.forbidDrawWorld(!1)}catch{}}_showScaleHint(e){this._scaleHintElement||(this._scaleHintElement=document.createElement("div"),this._scaleHintElement.style.position="absolute",this._scaleHintElement.style.background="rgba(0, 0, 0, 0.7)",this._scaleHintElement.style.color="white",this._scaleHintElement.style.padding="4px 8px",this._scaleHintElement.style.borderRadius="4px",this._scaleHintElement.style.fontSize="12px",this._scaleHintElement.style.pointerEvents="none",this._scaleHintElement.style.zIndex="10000",document.body.appendChild(this._scaleHintElement)),this._scaleHintElement.textContent=`缩放: ${e.toFixed(2)}x`,this._scaleHintElement.style.left=`${window.event.clientX+10}px`,this._scaleHintElement.style.top=`${window.event.clientY-30}px`,this._scaleHintElement.style.display="block"}_hideScaleHint(){this._scaleHintElement&&(this._scaleHintElement.style.display="none")}move(e){if(!this.entity)return;let t=null;e instanceof Cesium.Cartesian3?t=e:t=Cesium.Cartesian3.fromDegrees(Number(e[0]),Number(e[1]),Number(e[2]||0));try{this.entity.position.setValue(t.clone())}catch{this.entity.position=t.clone()}this.position=t.clone(),this.state="editing"}_createFileInput(){if(this._fileInput)return this._fileInput;const e=document.createElement("input");return e.type="file",e.accept="image/*",e.style.display="none",e.onchange=t=>{this._handleFileUpload(t)},document.body.appendChild(e),this._fileInput=e,e}_handleFileUpload(e){const t=e.target.files[0];if(!t)return;if(!t.type.match("image.*")){console.warn("请选择有效的图片文件");return}const i=new FileReader;i.onload=s=>{this.updateBillboardImage(s.target.result),this._fileInput&&(this._fileInput.value="")},i.onerror=s=>{console.error("文件读取失败:",s)},i.readAsDataURL(t)}_handleDoubleClick(){this._createFileInput().click()}editImage(e){return e?(this.updateBillboardImage(e),!0):(console.warn("CreateBillboard.editImage: 未提供有效的图片URL"),!1)}remove(){try{this.endEdit()}catch{}if(this.entity){this.state="no";try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}}getPositions(e){return e?ae.cartesianToLnglat(this.position,this.viewer):this.position}getLnglats(){return this.getPositions(!0)}setPosition(e){let t=null;e instanceof Cesium.Cartesian3?t=e:t=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0);try{this.entity.position.setValue(t.clone())}catch{this.entity.position=t.clone()}this.position=t.clone()}destroy(){try{this.endEdit()}catch{}if(this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}this.position=null,this.state="no",this._isDragging=!1,this._editPickedEntity=null}}class Fp extends tt{constructor(e,t){super(e,t),this.type="circle",this.viewer=e,this.style=t||{},this.center=null,this.radiusPoint=null,this.radiusPointEntity=null,this.entity=null,this.handler=null,this.modifyHandler=null,this.modifyPoint=null,this._dragStartCart=null,this._dragStartCartCarto=null,this.pointsCount=64}start(e){!this.prompt&&this.promptStyle?.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate",this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.handler.setInputAction(function(i){const s=t.getCatesian3FromPX(i.position,t.viewer,[]);s&&(t.entity?(t.endCreate(),e&&e(t.entity)):(t.center=s.clone(),t.radiusPoint=s.clone(),t.entity=t._createPolyline(),t.radiusPointEntity=t.createPoint(t.radiusPoint),t.radiusPointEntity.typeAttr="radius",t.radiusPointEntity.show=!1))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){if(!t.entity){t.prompt?.update(i.endPosition,"单击开始绘制");return}t.prompt?.update(i.endPosition,"单击结束");const s=t.getCatesian3FromPX(i.endPosition,t.viewer,[]);s&&(t.radiusPoint=s.clone(),t._updatePolyline(),t._updateAuxPoints(),t.state="creating")},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){this.handler?.destroy(),this.handler=null,this.radiusPointEntity&&(this.radiusPointEntity.show=!1),this.prompt?.destroy(),this.prompt=null,this.state="endCreate"}startEdit(e){if(!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.radiusPointEntity&&(this.radiusPointEntity.show=!0),this.modifyHandler.setInputAction(function(i){const s=t.viewer.scene.pick(i.position);if(!s?.id)return;t.modifyPoint=s.id;const r=t.getCatesian3FromPX(i.position,t.viewer,[t.entity,t.modifyPoint]);r&&(t._dragStartCart=r,t._dragStartCartCarto=Cesium.Ellipsoid.WGS84.cartesianToCartographic(r),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(i){if(!t.modifyPoint)return;const s=t.getCatesian3FromPX(i.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.typeAttr==="radius"&&(t.radiusPoint=s.clone()),t._updatePolyline(),t._updateAuxPoints(),e&&e(),t.state="editing")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){t.modifyPoint=null,t._dragStartCart=null,t._dragStartCartCarto=null,t.forbidDrawWorld(!1),t._updatePolyline(),e&&e(t.entity),t.state="editing"},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.radiusPointEntity&&(this.radiusPointEntity.show=!1),this.modifyHandler?.destroy(),this.modifyHandler=null,this.forbidDrawWorld(!1),this.state="endEdit",e&&e(this.entity)}_createPolyline(){const e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(()=>e._buildCirclePositions(),!1),width:this.style.outlineWidth||this.style.width||5,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color||"#00FF00"),clampToGround:!1}});return t._plotInstance=this,t.objId=this.objId,t}_updatePolyline(){if(!this.entity)return;const e=this._buildCirclePositions();try{const t=this.entity.polyline.positions;if(t&&typeof t.getValue=="function")return;if(t&&typeof t.setValue=="function"){t.setValue(e);return}this.entity.polyline.positions=e}catch{this.entity.polyline.positions=e}}_buildCirclePositions(){if(!this.center||!this.radiusPoint)return[];const e=[],t=Cesium.Ellipsoid.WGS84,i=t.cartesianToCartographic(this.center),s=t.cartesianToCartographic(this.radiusPoint),r=Math.abs(s.longitude-i.longitude),a=Math.abs(s.latitude-i.latitude);for(let c=0;c<=this.pointsCount;c++){const l=c/this.pointsCount*Math.PI*2,d=i.longitude+r*Math.cos(l),h=i.latitude+a*Math.sin(l);e.push(Cesium.Cartesian3.fromRadians(d,h))}return e}_updateAuxPoints(){!this.radiusPoint||!this.radiusPointEntity||(this.radiusPointEntity.position=this.radiusPoint)}syncFromEntity(){if(!this.entity||!this.center||!this.radiusPoint)return;const e=this.center,t=this.entity._centerCoord;if(!t)return;const i=t.x-e.x,s=t.y-e.y,r=t.z-e.z;this.center=new Cesium.Cartesian3(this.center.x+i,this.center.y+s,this.center.z+r),this.radiusPoint=new Cesium.Cartesian3(this.radiusPoint.x+i,this.radiusPoint.y+s,this.radiusPoint.z+r);const a=this.entity.objId,c=this.entity._plotInstance;this.radiusPointEntity&&this.viewer.entities.remove(this.radiusPointEntity),this.radiusPointEntity=null,this.viewer.entities.remove(this.entity),this.entity=this._createPolyline(),this.entity._plotInstance=c,this.entity.objId=a,this.radiusPointEntity=this.createPoint(this.radiusPoint),this.radiusPointEntity.typeAttr="radius",this.radiusPointEntity.show=this.state==="editing"}updatePositions(e){if(!e||e.length<1)return!1;try{if(!this.center||!this.radiusPoint)return!1;let t;if(e[0]instanceof Cesium.Cartesian3)t=e[0];else return!1;this.center=Cesium.Cartesian3.add(this.center,t,new Cesium.Cartesian3),this.radiusPoint=Cesium.Cartesian3.add(this.radiusPoint,t,new Cesium.Cartesian3),this._updatePolyline(),this._updateAuxPoints();try{this.viewer.scene.requestRender()}catch{}return!0}catch(t){return console.warn("Failed to update circle positions:",t),!1}}getPositions(e){return e?ae.cartesiansToLnglats([this.center,this.radiusPoint],this.viewer):[this.center,this.radiusPoint]}getStyle(){const e=this.entity.polyline,t=e.material.color.getValue();return{color:new Cesium.Color(t.red,t.green,t.blue,1).toCssHexString(),colorAlpha:t.alpha,outlineWidth:e.width.getValue()}}setStyle(e){if(!this.entity)return;const t={...this.style,...e};let i=t.color instanceof Cesium.Color?t.color:Cesium.Color.fromCssColorString(t.color||"#00FF00");t.colorAlpha!=null&&(i=i.withAlpha(t.colorAlpha)),this.entity.polyline.material=i,this.entity.polyline.width=t.outlineWidth||t.width||5,this.style=t}destroy(){try{this.handler?.destroy(),this.modifyHandler?.destroy(),this.entity&&this.viewer.entities.remove(this.entity),this.entity=null,this.radiusPointEntity&&this.viewer.entities.remove(this.radiusPointEntity),this.radiusPointEntity=null,this.prompt?.destroy(),this.prompt=null}catch{}}_manageRadiusPointEntity(){this.radiusPointEntity?this.radiusPoint&&(this.radiusPointEntity.position=this.radiusPoint):(this.radiusPointEntity=this.createPoint(this.radiusPoint),this.radiusPointEntity&&(this.radiusPointEntity.typeAttr="radius",this.radiusPointEntity.show=!1))}createByPositions(e,t){try{if(!e||e.length===0)return console.error("createByPositions: positions array is empty or undefined"),t&&t(null),this;const i=e[0]instanceof Cesium.Cartesian3?e:ae.lnglatsToCartesians(e);if(!i||i.length===0)return console.error("createByPositions: failed to convert positions to Cartesian3"),t&&t(null),this;if(i.length>=2)this.center=Cesium.Cartesian3.clone(i[0]),this.radiusPoint=Cesium.Cartesian3.clone(i[1]);else if(i.length===1)this.center=Cesium.Cartesian3.clone(i[0]),this._createDefaultRadiusPoint();else return console.error("createByPositions: invalid positions array"),t&&t(null),this;this.entity?this._updatePolyline():this.entity=this._createPolyline(),this._manageRadiusPointEntity(),this._updateAuxPoints(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch(s){console.error("requestRender error:",s)}return t&&t(this.entity),this}catch(i){return console.error("createByPositions error:",i),t&&t(null),this}}}class Rp extends tt{constructor(e,t){if(super(e,t),this.type="gltfModel",t=t||{},this.viewer=e,!t.uri){console.warn("请输入模型地址!");return}let i={heading:0,pitch:0,roll:0,minimumPixelSize:24,maximumScale:120};this.style=Object.assign(i,t||{}),this.modelUri=t.uri,this.entity=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(i){let s=t.getCatesian3FromPX(i.position,t.viewer);s&&(t.entity.position=s,t.position=s.clone()),t.endCreate(),e&&e(t.entity)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){t.prompt.update(i.endPosition,"单击新增"),t.state="creating";let s=t.getCatesian3FromPX(i.endPosition,t.viewer,[t.entity]);s&&(t.entity?t.entity.position=s:t.entity=t.createGltfModel(s.clone()))},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}createByPositions(e,t){e&&(this.state="startCreate",e instanceof Cesium.Cartesian3?this.position=e:this.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0),this.entity=this.createGltfModel(this.position),t(this.entity),this.state="endCreate")}startEdit(e){if(this.state=="startEdit"||this.state=="editing")return;this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this,i;this.state="startEdit",this.modifyHandler.setInputAction(function(s){let r=t.viewer.scene.pick(s.position);Cesium.defined(r)&&r.id&&(i=r.id,t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(s){if(!i)return;let r=t.getCatesian3FromPX(s.endPosition,t.viewer,[t.entity]);r&&(t.entity&&(t.entity.position.setValue(r),t.position=r.clone()),t.state="editing",e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(s){i&&(t.forbidDrawWorld(!1),t.modifyHandler&&(t.modifyHandler.destroy(),t.modifyHandler=null),t.state="editing")},Cesium.ScreenSpaceEventType.LEFT_UP)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.prompt&&(e.prompt.destroy(),e.prompt=null)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}endEdit(e){this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}createGltfModel(e){if(!e)return;let t=Cesium.Math.toRadians(this.style.heading),i=Cesium.Math.toRadians(this.style.pitch),s=Cesium.Math.toRadians(this.style.roll),r=new Cesium.HeadingPitchRoll(t,i,s),a=Cesium.Transforms.headingPitchRollQuaternion(e,r),c=this.viewer.entities.add({position:e,orientation:a,model:{uri:this.modelUri,minimumPixelSize:this.style.minimumPixelSize,maximumScale:this.style.maximumScale,scale:this.style.scale||1,heightReference:this.style.heightReference}});return c.objId=this.objId,c}getPositions(e){return e?ae.cartesianToLnglat(this.position,this.viewer):this.position}getStyle(){let e={},t=this.entity.model;e.minimumPixelSize=t.minimumPixelSize.getValue();let i=this.entity.orientation.getValue(),s=this.entity.position.getValue(this.viewer.clock.currentTime),r=ae.oreatationToHpr(s.clone(),i,!0)||{};e.heading=(r.heading||0)<360?r.heading+360:r.heading,e.pitch=r.pitch||0,e.roll=r.roll||0,e.scale=t.scale.getValue(),e.uri=t.uri.getValue();let a=this.entity.heightReference&&this.entity.heightReference.getValue();return a!=null&&(e.heightReference=Number(a)),e}setStyle(e){e&&(this.setOrientation(e.heading,e.pitch,e.roll),this.entity.model.scale.setValue(e.scale==null?1:e.scale),e.uri&&this.entity.model.uri.setValue(e.uri),e.heightReference!=null&&this.entity.model.heightReference.setValue(Number(e.heightReference)),this.style=Object.assign(this.style,e))}setOrientation(e,t,i){e=e||0,t=t||0,i=i||0,this.style.heading=e,this.style.pitch=t,this.style.roll=i;var s=Cesium.Math.toRadians(e||0),r=Cesium.Math.toRadians(t||0),a=Cesium.Math.toRadians(i||0),c=new Cesium.HeadingPitchRoll(s,r,a),l=this.entity.position._value,d=Cesium.Transforms.headingPitchRollQuaternion(l,c);this.entity&&(this.entity.orientation=d)}remove(){this.entity&&(this.state="no",this.viewer.entities.remove(this.entity),this.entity=null)}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.style=null,this.prompt&&(this.prompt.destroy(),this.prompt=null)}}String.prototype.codePointAt||(function(){var n=(function(){try{var t={},i=Object.defineProperty,s=i(t,t,t)&&i}catch{}return s})(),e=function(t){if(this==null)throw TypeError();var i=String(this),s=i.length,r=t?Number(t):0;if(r!=r&&(r=0),!(r<0||r>=s)){var a=i.charCodeAt(r),c;return a>=55296&&a<=56319&&s>r+1&&(c=i.charCodeAt(r+1),c>=56320&&c<=57343)?(a-55296)*1024+c-56320+65536:a}};n?n(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();function Yt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ds,Vr;function Lp(){if(Vr)return ds;Vr=1;var n=0,e=-3;function t(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function i(g,R){this.source=g,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=R,this.destLen=0,this.ltree=new t,this.dtree=new t}var s=new t,r=new t,a=new Uint8Array(30),c=new Uint16Array(30),l=new Uint8Array(30),d=new Uint16Array(30),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new t,p=new Uint8Array(320);function u(g,R,x,M){var L,V;for(L=0;L<x;++L)g[L]=0;for(L=0;L<30-x;++L)g[L+x]=L/x|0;for(V=M,L=0;L<30;++L)R[L]=V,V+=1<<g[L]}function m(g,R){var x;for(x=0;x<7;++x)g.table[x]=0;for(g.table[7]=24,g.table[8]=152,g.table[9]=112,x=0;x<24;++x)g.trans[x]=256+x;for(x=0;x<144;++x)g.trans[24+x]=x;for(x=0;x<8;++x)g.trans[168+x]=280+x;for(x=0;x<112;++x)g.trans[176+x]=144+x;for(x=0;x<5;++x)R.table[x]=0;for(R.table[5]=32,x=0;x<32;++x)R.trans[x]=x}var E=new Uint16Array(16);function A(g,R,x,M){var L,V;for(L=0;L<16;++L)g.table[L]=0;for(L=0;L<M;++L)g.table[R[x+L]]++;for(g.table[0]=0,V=0,L=0;L<16;++L)E[L]=V,V+=g.table[L];for(L=0;L<M;++L)R[x+L]&&(g.trans[E[R[x+L]]++]=L)}function b(g){g.bitcount--||(g.tag=g.source[g.sourceIndex++],g.bitcount=7);var R=g.tag&1;return g.tag>>>=1,R}function w(g,R,x){if(!R)return x;for(;g.bitcount<24;)g.tag|=g.source[g.sourceIndex++]<<g.bitcount,g.bitcount+=8;var M=g.tag&65535>>>16-R;return g.tag>>>=R,g.bitcount-=R,M+x}function I(g,R){for(;g.bitcount<24;)g.tag|=g.source[g.sourceIndex++]<<g.bitcount,g.bitcount+=8;var x=0,M=0,L=0,V=g.tag;do M=2*M+(V&1),V>>>=1,++L,x+=R.table[L],M-=R.table[L];while(M>=0);return g.tag=V,g.bitcount-=L,R.trans[x+M]}function D(g,R,x){var M,L,V,k,C,y;for(M=w(g,5,257),L=w(g,5,1),V=w(g,4,4),k=0;k<19;++k)p[k]=0;for(k=0;k<V;++k){var v=w(g,3,0);p[h[k]]=v}for(A(f,p,0,19),C=0;C<M+L;){var P=I(g,f);switch(P){case 16:var F=p[C-1];for(y=w(g,2,3);y;--y)p[C++]=F;break;case 17:for(y=w(g,3,3);y;--y)p[C++]=0;break;case 18:for(y=w(g,7,11);y;--y)p[C++]=0;break;default:p[C++]=P;break}}A(R,p,0,M),A(x,p,M,L)}function N(g,R,x){for(;;){var M=I(g,R);if(M===256)return n;if(M<256)g.dest[g.destLen++]=M;else{var L,V,k,C;for(M-=257,L=w(g,a[M],c[M]),V=I(g,x),k=g.destLen-w(g,l[V],d[V]),C=k;C<k+L;++C)g.dest[g.destLen++]=g.dest[C]}}}function S(g){for(var R,x,M;g.bitcount>8;)g.sourceIndex--,g.bitcount-=8;if(R=g.source[g.sourceIndex+1],R=256*R+g.source[g.sourceIndex],x=g.source[g.sourceIndex+3],x=256*x+g.source[g.sourceIndex+2],R!==(~x&65535))return e;for(g.sourceIndex+=4,M=R;M;--M)g.dest[g.destLen++]=g.source[g.sourceIndex++];return g.bitcount=0,n}function B(g,R){var x=new i(g,R),M,L,V;do{switch(M=b(x),L=w(x,2,0),L){case 0:V=S(x);break;case 1:V=N(x,s,r);break;case 2:D(x,x.ltree,x.dtree),V=N(x,x.ltree,x.dtree);break;default:V=e}if(V!==n)throw new Error("Data error")}while(!M);return x.destLen<x.dest.length?typeof x.dest.slice=="function"?x.dest.slice(0,x.destLen):x.dest.subarray(0,x.destLen):x.dest}return m(s,r),u(a,c,4,3),u(l,d,2,1),a[28]=0,c[28]=258,ds=B,ds}var Op=Lp();const Up=Yt(Op);function zt(n,e,t,i,s){return Math.pow(1-s,3)*n+3*Math.pow(1-s,2)*s*e+3*(1-s)*Math.pow(s,2)*t+Math.pow(s,3)*i}function pt(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}pt.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},pt.prototype.addPoint=function(n,e){typeof n=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=n,this.x2=n),n<this.x1&&(this.x1=n),n>this.x2&&(this.x2=n)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},pt.prototype.addX=function(n){this.addPoint(n,null)},pt.prototype.addY=function(n){this.addPoint(null,n)},pt.prototype.addBezier=function(n,e,t,i,s,r,a,c){const l=[n,e],d=[t,i],h=[s,r],f=[a,c];this.addPoint(n,e),this.addPoint(a,c);for(let p=0;p<=1;p++){const u=6*l[p]-12*d[p]+6*h[p],m=-3*l[p]+9*d[p]-9*h[p]+3*f[p],E=3*d[p]-3*l[p];if(m===0){if(u===0)continue;const I=-E/u;0<I&&I<1&&(p===0&&this.addX(zt(l[p],d[p],h[p],f[p],I)),p===1&&this.addY(zt(l[p],d[p],h[p],f[p],I)));continue}const A=Math.pow(u,2)-4*E*m;if(A<0)continue;const b=(-u+Math.sqrt(A))/(2*m);0<b&&b<1&&(p===0&&this.addX(zt(l[p],d[p],h[p],f[p],b)),p===1&&this.addY(zt(l[p],d[p],h[p],f[p],b)));const w=(-u-Math.sqrt(A))/(2*m);0<w&&w<1&&(p===0&&this.addX(zt(l[p],d[p],h[p],f[p],w)),p===1&&this.addY(zt(l[p],d[p],h[p],f[p],w)))}},pt.prototype.addQuad=function(n,e,t,i,s,r){const a=n+.6666666666666666*(t-n),c=e+2/3*(i-e),l=a+1/3*(s-n),d=c+1/3*(r-e);this.addBezier(n,e,a,c,l,d,s,r)};function Be(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}Be.prototype.moveTo=function(n,e){this.commands.push({type:"M",x:n,y:e})},Be.prototype.lineTo=function(n,e){this.commands.push({type:"L",x:n,y:e})},Be.prototype.curveTo=Be.prototype.bezierCurveTo=function(n,e,t,i,s,r){this.commands.push({type:"C",x1:n,y1:e,x2:t,y2:i,x:s,y:r})},Be.prototype.quadTo=Be.prototype.quadraticCurveTo=function(n,e,t,i){this.commands.push({type:"Q",x1:n,y1:e,x:t,y:i})},Be.prototype.close=Be.prototype.closePath=function(){this.commands.push({type:"Z"})},Be.prototype.extend=function(n){if(n.commands)n=n.commands;else if(n instanceof pt){const e=n;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,n)},Be.prototype.getBoundingBox=function(){const n=new pt;let e=0,t=0,i=0,s=0;for(let r=0;r<this.commands.length;r++){const a=this.commands[r];switch(a.type){case"M":n.addPoint(a.x,a.y),e=i=a.x,t=s=a.y;break;case"L":n.addPoint(a.x,a.y),i=a.x,s=a.y;break;case"Q":n.addQuad(i,s,a.x1,a.y1,a.x,a.y),i=a.x,s=a.y;break;case"C":n.addBezier(i,s,a.x1,a.y1,a.x2,a.y2,a.x,a.y),i=a.x,s=a.y;break;case"Z":i=e,s=t;break;default:throw new Error("Unexpected path command "+a.type)}}return n.isEmpty()&&n.addPoint(0,0),n},Be.prototype.draw=function(n){n.beginPath();for(let e=0;e<this.commands.length;e+=1){const t=this.commands[e];t.type==="M"?n.moveTo(t.x,t.y):t.type==="L"?n.lineTo(t.x,t.y):t.type==="C"?n.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?n.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&n.closePath()}this.fill&&(n.fillStyle=this.fill,n.fill()),this.stroke&&(n.strokeStyle=this.stroke,n.lineWidth=this.strokeWidth,n.stroke())},Be.prototype.toPathData=function(n){n=n!==void 0?n:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(n)}function t(){let s="";for(let r=0;r<arguments.length;r+=1){const a=arguments[r];a>=0&&r>0&&(s+=" "),s+=e(a)}return s}let i="";for(let s=0;s<this.commands.length;s+=1){const r=this.commands[s];r.type==="M"?i+="M"+t(r.x,r.y):r.type==="L"?i+="L"+t(r.x,r.y):r.type==="C"?i+="C"+t(r.x1,r.y1,r.x2,r.y2,r.x,r.y):r.type==="Q"?i+="Q"+t(r.x1,r.y1,r.x,r.y):r.type==="Z"&&(i+="Z")}return i},Be.prototype.toSVG=function(n){let e='<path d="';return e+=this.toPathData(n),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e},Be.prototype.toDOMElement=function(n){const e=this.toPathData(n),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function Gr(n){throw new Error(n)}function Hr(n,e){n||Gr(e)}const ne={fail:Gr,argument:Hr,assert:Hr},Yr=32768,zr=2147483648,Wt={},W={},te={};function Ye(n){return function(){return n}}W.BYTE=function(n){return ne.argument(n>=0&&n<=255,"Byte value should be between 0 and 255."),[n]},te.BYTE=Ye(1),W.CHAR=function(n){return[n.charCodeAt(0)]},te.CHAR=Ye(1),W.CHARARRAY=function(n){const e=[];for(let t=0;t<n.length;t+=1)e[t]=n.charCodeAt(t);return e},te.CHARARRAY=function(n){return n.length},W.USHORT=function(n){return[n>>8&255,n&255]},te.USHORT=Ye(2),W.SHORT=function(n){return n>=Yr&&(n=-(2*Yr-n)),[n>>8&255,n&255]},te.SHORT=Ye(2),W.UINT24=function(n){return[n>>16&255,n>>8&255,n&255]},te.UINT24=Ye(3),W.ULONG=function(n){return[n>>24&255,n>>16&255,n>>8&255,n&255]},te.ULONG=Ye(4),W.LONG=function(n){return n>=zr&&(n=-(2*zr-n)),[n>>24&255,n>>16&255,n>>8&255,n&255]},te.LONG=Ye(4),W.FIXED=W.ULONG,te.FIXED=te.ULONG,W.FWORD=W.SHORT,te.FWORD=te.SHORT,W.UFWORD=W.USHORT,te.UFWORD=te.USHORT,W.LONGDATETIME=function(n){return[0,0,0,0,n>>24&255,n>>16&255,n>>8&255,n&255]},te.LONGDATETIME=Ye(8),W.TAG=function(n){return ne.argument(n.length===4,"Tag should be exactly 4 ASCII characters."),[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3)]},te.TAG=Ye(4),W.Card8=W.BYTE,te.Card8=te.BYTE,W.Card16=W.USHORT,te.Card16=te.USHORT,W.OffSize=W.BYTE,te.OffSize=te.BYTE,W.SID=W.USHORT,te.SID=te.USHORT,W.NUMBER=function(n){return n>=-107&&n<=107?[n+139]:n>=108&&n<=1131?(n=n-108,[(n>>8)+247,n&255]):n>=-1131&&n<=-108?(n=-n-108,[(n>>8)+251,n&255]):n>=-32768&&n<=32767?W.NUMBER16(n):W.NUMBER32(n)},te.NUMBER=function(n){return W.NUMBER(n).length},W.NUMBER16=function(n){return[28,n>>8&255,n&255]},te.NUMBER16=Ye(3),W.NUMBER32=function(n){return[29,n>>24&255,n>>16&255,n>>8&255,n&255]},te.NUMBER32=Ye(5),W.REAL=function(n){let e=n.toString();const t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){const r=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(n*r)/r).toString()}let i="";for(let r=0,a=e.length;r<a;r+=1){const c=e[r];c==="e"?i+=e[++r]==="-"?"c":"b":c==="."?i+="a":c==="-"?i+="e":i+=c}i+=i.length&1?"f":"ff";const s=[30];for(let r=0,a=i.length;r<a;r+=2)s.push(parseInt(i.substr(r,2),16));return s},te.REAL=function(n){return W.REAL(n).length},W.NAME=W.CHARARRAY,te.NAME=te.CHARARRAY,W.STRING=W.CHARARRAY,te.STRING=te.CHARARRAY,Wt.UTF8=function(n,e,t){const i=[],s=t;for(let r=0;r<s;r++,e+=1)i[r]=n.getUint8(e);return String.fromCharCode.apply(null,i)},Wt.UTF16=function(n,e,t){const i=[],s=t/2;for(let r=0;r<s;r++,e+=2)i[r]=n.getUint16(e);return String.fromCharCode.apply(null,i)},W.UTF16=function(n){const e=[];for(let t=0;t<n.length;t+=1){const i=n.charCodeAt(t);e[e.length]=i>>8&255,e[e.length]=i&255}return e},te.UTF16=function(n){return n.length*2};const us={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Wt.MACSTRING=function(n,e,t,i){const s=us[i];if(s===void 0)return;let r="";for(let a=0;a<t;a++){const c=n.getUint8(e+a);c<=127?r+=String.fromCharCode(c):r+=s[c&127]}return r};const Kn=typeof WeakMap=="function"&&new WeakMap;let $n;const _p=function(n){if(!$n){$n={};for(let s in us)$n[s]=new String(s)}const e=$n[n];if(e===void 0)return;if(Kn){const s=Kn.get(e);if(s!==void 0)return s}const t=us[n];if(t===void 0)return;const i={};for(let s=0;s<t.length;s++)i[t.charCodeAt(s)]=s+128;return Kn&&Kn.set(e,i),i};W.MACSTRING=function(n,e){const t=_p(e);if(t===void 0)return;const i=[];for(let s=0;s<n.length;s++){let r=n.charCodeAt(s);if(r>=128&&(r=t[r],r===void 0))return;i[s]=r}return i},te.MACSTRING=function(n,e){const t=W.MACSTRING(n,e);return t!==void 0?t.length:0};function hs(n){return n>=-128&&n<=127}function Qp(n,e,t){let i=0;const s=n.length;for(;e<s&&i<64&&n[e]===0;)++e,++i;return t.push(128|i-1),e}function Vp(n,e,t){let i=0;const s=n.length;let r=e;for(;r<s&&i<64;){const a=n[r];if(!hs(a)||a===0&&r+1<s&&n[r+1]===0)break;++r,++i}t.push(i-1);for(let a=e;a<r;++a)t.push(n[a]+256&255);return r}function Gp(n,e,t){let i=0;const s=n.length;let r=e;for(;r<s&&i<64;){const a=n[r];if(a===0||hs(a)&&r+1<s&&hs(n[r+1]))break;++r,++i}t.push(64|i-1);for(let a=e;a<r;++a){const c=n[a];t.push(c+65536>>8&255,c+256&255)}return r}W.VARDELTAS=function(n){let e=0;const t=[];for(;e<n.length;){const i=n[e];i===0?e=Qp(n,e,t):i>=-128&&i<=127?e=Vp(n,e,t):e=Gp(n,e,t)}return t},W.INDEX=function(n){let e=1;const t=[e],i=[];for(let c=0;c<n.length;c+=1){const l=W.OBJECT(n[c]);Array.prototype.push.apply(i,l),e+=l.length,t.push(e)}if(i.length===0)return[0,0];const s=[],r=1+Math.floor(Math.log(e)/Math.log(2))/8|0,a=[void 0,W.BYTE,W.USHORT,W.UINT24,W.ULONG][r];for(let c=0;c<t.length;c+=1){const l=a(t[c]);Array.prototype.push.apply(s,l)}return Array.prototype.concat(W.Card16(n.length),W.OffSize(r),s,i)},te.INDEX=function(n){return W.INDEX(n).length},W.DICT=function(n){let e=[];const t=Object.keys(n),i=t.length;for(let s=0;s<i;s+=1){const r=parseInt(t[s],0),a=n[r];e=e.concat(W.OPERAND(a.value,a.type)),e=e.concat(W.OPERATOR(r))}return e},te.DICT=function(n){return W.DICT(n).length},W.OPERATOR=function(n){return n<1200?[n]:[12,n-1200]},W.OPERAND=function(n,e){let t=[];if(Array.isArray(e))for(let i=0;i<e.length;i+=1)ne.argument(n.length===e.length,"Not enough arguments given for type"+e),t=t.concat(W.OPERAND(n[i],e[i]));else if(e==="SID")t=t.concat(W.NUMBER(n));else if(e==="offset")t=t.concat(W.NUMBER32(n));else if(e==="number")t=t.concat(W.NUMBER(n));else if(e==="real")t=t.concat(W.REAL(n));else throw new Error("Unknown operand type "+e);return t},W.OP=W.BYTE,te.OP=te.BYTE;const Xn=typeof WeakMap=="function"&&new WeakMap;W.CHARSTRING=function(n){if(Xn){const i=Xn.get(n);if(i!==void 0)return i}let e=[];const t=n.length;for(let i=0;i<t;i+=1){const s=n[i];e=e.concat(W[s.type](s.value))}return Xn&&Xn.set(n,e),e},te.CHARSTRING=function(n){return W.CHARSTRING(n).length},W.OBJECT=function(n){const e=W[n.type];return ne.argument(e!==void 0,"No encoding function for type "+n.type),e(n.value)},te.OBJECT=function(n){const e=te[n.type];return ne.argument(e!==void 0,"No sizeOf function for type "+n.type),e(n.value)},W.TABLE=function(n){let e=[];const t=n.fields.length,i=[],s=[];for(let r=0;r<t;r+=1){const a=n.fields[r],c=W[a.type];ne.argument(c!==void 0,"No encoding function for field type "+a.type+" ("+a.name+")");let l=n[a.name];l===void 0&&(l=a.value);const d=c(l);a.type==="TABLE"?(s.push(e.length),e=e.concat([0,0]),i.push(d)):e=e.concat(d)}for(let r=0;r<i.length;r+=1){const a=s[r],c=e.length;ne.argument(c<65536,"Table "+n.tableName+" too big."),e[a]=c>>8,e[a+1]=c&255,e=e.concat(i[r])}return e},te.TABLE=function(n){let e=0;const t=n.fields.length;for(let i=0;i<t;i+=1){const s=n.fields[i],r=te[s.type];ne.argument(r!==void 0,"No sizeOf function for field type "+s.type+" ("+s.name+")");let a=n[s.name];a===void 0&&(a=s.value),e+=r(a),s.type==="TABLE"&&(e+=2)}return e},W.RECORD=W.TABLE,te.RECORD=te.TABLE,W.LITERAL=function(n){return n},te.LITERAL=function(n){return n.length};function ke(n,e,t){for(let i=0;i<e.length;i+=1){const s=e[i];this[s.name]=s.value}if(this.tableName=n,this.fields=e,t){const i=Object.keys(t);for(let s=0;s<i.length;s+=1){const r=i[s],a=t[r];this[r]!==void 0&&(this[r]=a)}}}ke.prototype.encode=function(){return W.TABLE(this)},ke.prototype.sizeOf=function(){return te.TABLE(this)};function un(n,e,t){t===void 0&&(t=e.length);const i=new Array(e.length+1);i[0]={name:n+"Count",type:"USHORT",value:t};for(let s=0;s<e.length;s++)i[s+1]={name:n+s,type:"USHORT",value:e[s]};return i}function fs(n,e,t){const i=e.length,s=new Array(i+1);s[0]={name:n+"Count",type:"USHORT",value:i};for(let r=0;r<i;r++)s[r+1]={name:n+r,type:"TABLE",value:t(e[r],r)};return s}function qn(n,e,t){const i=e.length;let s=[];s[0]={name:n+"Count",type:"USHORT",value:i};for(let r=0;r<i;r++)s=s.concat(t(e[r],r));return s}function Jn(n){n.format===1?ke.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(un("glyph",n.glyphs))):ne.assert(!1,"Can't create coverage table format 2 yet.")}Jn.prototype=Object.create(ke.prototype),Jn.prototype.constructor=Jn;function Zn(n){ke.call(this,"scriptListTable",qn("scriptRecord",n,function(e,t){const i=e.script;let s=i.defaultLangSys;return ne.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new ke("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new ke("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(un("featureIndex",s.featureIndexes)))}].concat(qn("langSys",i.langSysRecords,function(r,a){const c=r.langSys;return[{name:"langSysTag"+a,type:"TAG",value:r.tag},{name:"langSys"+a,type:"TABLE",value:new ke("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:c.reqFeatureIndex}].concat(un("featureIndex",c.featureIndexes)))}]})))}]}))}Zn.prototype=Object.create(ke.prototype),Zn.prototype.constructor=Zn;function ei(n){ke.call(this,"featureListTable",qn("featureRecord",n,function(e,t){const i=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new ke("featureTable",[{name:"featureParams",type:"USHORT",value:i.featureParams}].concat(un("lookupListIndex",i.lookupListIndexes)))}]}))}ei.prototype=Object.create(ke.prototype),ei.prototype.constructor=ei;function ti(n,e){ke.call(this,"lookupListTable",fs("lookup",n,function(t){let i=e[t.lookupType];return ne.assert(!!i,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new ke("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(fs("subtable",t.subtables,i)))}))}ti.prototype=Object.create(ke.prototype),ti.prototype.constructor=ti;const ee={Table:ke,Record:ke,Coverage:Jn,ScriptList:Zn,FeatureList:ei,LookupList:ti,ushortList:un,tableList:fs,recordList:qn};function Wr(n,e){return n.getUint8(e)}function ni(n,e){return n.getUint16(e,!1)}function Hp(n,e){return n.getInt16(e,!1)}function ps(n,e){return n.getUint32(e,!1)}function jr(n,e){const t=n.getInt16(e,!1),i=n.getUint16(e+2,!1);return t+i/65535}function Yp(n,e){let t="";for(let i=e;i<e+4;i+=1)t+=String.fromCharCode(n.getInt8(i));return t}function zp(n,e,t){let i=0;for(let s=0;s<t;s+=1)i<<=8,i+=n.getUint8(e+s);return i}function Wp(n,e,t){const i=[];for(let s=e;s<t;s+=1)i.push(n.getUint8(s));return i}function jp(n){let e="";for(let t=0;t<n.length;t+=1)e+=String.fromCharCode(n[t]);return e}const Kp={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function G(n,e){this.data=n,this.offset=e,this.relativeOffset=0}G.prototype.parseByte=function(){const n=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,n},G.prototype.parseChar=function(){const n=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,n},G.prototype.parseCard8=G.prototype.parseByte,G.prototype.parseUShort=function(){const n=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,n},G.prototype.parseCard16=G.prototype.parseUShort,G.prototype.parseSID=G.prototype.parseUShort,G.prototype.parseOffset16=G.prototype.parseUShort,G.prototype.parseShort=function(){const n=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,n},G.prototype.parseF2Dot14=function(){const n=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,n},G.prototype.parseULong=function(){const n=ps(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,n},G.prototype.parseOffset32=G.prototype.parseULong,G.prototype.parseFixed=function(){const n=jr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,n},G.prototype.parseString=function(n){const e=this.data,t=this.offset+this.relativeOffset;let i="";this.relativeOffset+=n;for(let s=0;s<n;s++)i+=String.fromCharCode(e.getUint8(t+s));return i},G.prototype.parseTag=function(){return this.parseString(4)},G.prototype.parseLongDateTime=function(){let n=ps(this.data,this.offset+this.relativeOffset+4);return n-=2082844800,this.relativeOffset+=8,n},G.prototype.parseVersion=function(n){const e=ni(this.data,this.offset+this.relativeOffset),t=ni(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,n===void 0&&(n=4096),e+t/n/10},G.prototype.skip=function(n,e){e===void 0&&(e=1),this.relativeOffset+=Kp[n]*e},G.prototype.parseULongList=function(n){n===void 0&&(n=this.parseULong());const e=new Array(n),t=this.data;let i=this.offset+this.relativeOffset;for(let s=0;s<n;s++)e[s]=t.getUint32(i),i+=4;return this.relativeOffset+=n*4,e},G.prototype.parseOffset16List=G.prototype.parseUShortList=function(n){n===void 0&&(n=this.parseUShort());const e=new Array(n),t=this.data;let i=this.offset+this.relativeOffset;for(let s=0;s<n;s++)e[s]=t.getUint16(i),i+=2;return this.relativeOffset+=n*2,e},G.prototype.parseShortList=function(n){const e=new Array(n),t=this.data;let i=this.offset+this.relativeOffset;for(let s=0;s<n;s++)e[s]=t.getInt16(i),i+=2;return this.relativeOffset+=n*2,e},G.prototype.parseByteList=function(n){const e=new Array(n),t=this.data;let i=this.offset+this.relativeOffset;for(let s=0;s<n;s++)e[s]=t.getUint8(i++);return this.relativeOffset+=n,e},G.prototype.parseList=function(n,e){e||(e=n,n=this.parseUShort());const t=new Array(n);for(let i=0;i<n;i++)t[i]=e.call(this);return t},G.prototype.parseList32=function(n,e){e||(e=n,n=this.parseULong());const t=new Array(n);for(let i=0;i<n;i++)t[i]=e.call(this);return t},G.prototype.parseRecordList=function(n,e){e||(e=n,n=this.parseUShort());const t=new Array(n),i=Object.keys(e);for(let s=0;s<n;s++){const r={};for(let a=0;a<i.length;a++){const c=i[a],l=e[c];r[c]=l.call(this)}t[s]=r}return t},G.prototype.parseRecordList32=function(n,e){e||(e=n,n=this.parseULong());const t=new Array(n),i=Object.keys(e);for(let s=0;s<n;s++){const r={};for(let a=0;a<i.length;a++){const c=i[a],l=e[c];r[c]=l.call(this)}t[s]=r}return t},G.prototype.parseStruct=function(n){if(typeof n=="function")return n.call(this);{const e=Object.keys(n),t={};for(let i=0;i<e.length;i++){const s=e[i],r=n[s];t[s]=r.call(this)}return t}},G.prototype.parseValueRecord=function(n){if(n===void 0&&(n=this.parseUShort()),n===0)return;const e={};return n&1&&(e.xPlacement=this.parseShort()),n&2&&(e.yPlacement=this.parseShort()),n&4&&(e.xAdvance=this.parseShort()),n&8&&(e.yAdvance=this.parseShort()),n&16&&(e.xPlaDevice=void 0,this.parseShort()),n&32&&(e.yPlaDevice=void 0,this.parseShort()),n&64&&(e.xAdvDevice=void 0,this.parseShort()),n&128&&(e.yAdvDevice=void 0,this.parseShort()),e},G.prototype.parseValueRecordList=function(){const n=this.parseUShort(),e=this.parseUShort(),t=new Array(e);for(let i=0;i<e;i++)t[i]=this.parseValueRecord(n);return t},G.prototype.parsePointer=function(n){const e=this.parseOffset16();if(e>0)return new G(this.data,this.offset+e).parseStruct(n)},G.prototype.parsePointer32=function(n){const e=this.parseOffset32();if(e>0)return new G(this.data,this.offset+e).parseStruct(n)},G.prototype.parseListOfLists=function(n){const e=this.parseOffset16List(),t=e.length,i=this.relativeOffset,s=new Array(t);for(let r=0;r<t;r++){const a=e[r];if(a===0){s[r]=void 0;continue}if(this.relativeOffset=a,n){const c=this.parseOffset16List(),l=new Array(c.length);for(let d=0;d<c.length;d++)this.relativeOffset=a+c[d],l[d]=n.call(this);s[r]=l}else s[r]=this.parseUShortList()}return this.relativeOffset=i,s},G.prototype.parseCoverage=function(){const n=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){const i=new Array(t);for(let s=0;s<t;s++)i[s]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:i}}throw new Error("0x"+n.toString(16)+": Coverage format must be 1 or 2.")},G.prototype.parseClassDef=function(){const n=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:G.uShort,end:G.uShort,classId:G.uShort})};throw new Error("0x"+n.toString(16)+": ClassDef format must be 1 or 2.")},G.list=function(n,e){return function(){return this.parseList(n,e)}},G.list32=function(n,e){return function(){return this.parseList32(n,e)}},G.recordList=function(n,e){return function(){return this.parseRecordList(n,e)}},G.recordList32=function(n,e){return function(){return this.parseRecordList32(n,e)}},G.pointer=function(n){return function(){return this.parsePointer(n)}},G.pointer32=function(n){return function(){return this.parsePointer32(n)}},G.tag=G.prototype.parseTag,G.byte=G.prototype.parseByte,G.uShort=G.offset16=G.prototype.parseUShort,G.uShortList=G.prototype.parseUShortList,G.uLong=G.offset32=G.prototype.parseULong,G.uLongList=G.prototype.parseULongList,G.struct=G.prototype.parseStruct,G.coverage=G.prototype.parseCoverage,G.classDef=G.prototype.parseClassDef;const Kr={reserved:G.uShort,reqFeatureIndex:G.uShort,featureIndexes:G.uShortList};G.prototype.parseScriptList=function(){return this.parsePointer(G.recordList({tag:G.tag,script:G.pointer({defaultLangSys:G.pointer(Kr),langSysRecords:G.recordList({tag:G.tag,langSys:G.pointer(Kr)})})}))||[]},G.prototype.parseFeatureList=function(){return this.parsePointer(G.recordList({tag:G.tag,feature:G.pointer({featureParams:G.offset16,lookupListIndexes:G.uShortList})}))||[]},G.prototype.parseLookupList=function(n){return this.parsePointer(G.list(G.pointer(function(){const e=this.parseUShort();ne.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");const t=this.parseUShort(),i=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(G.pointer(n[e])),markFilteringSet:i?this.parseUShort():void 0}})))||[]},G.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){const n=this.parseUShort(),e=this.parseUShort();return ne.argument(n===1&&e<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:G.offset32,featureTableSubstitutionOffset:G.offset32})})||[]};const q={getByte:Wr,getCard8:Wr,getUShort:ni,getCard16:ni,getShort:Hp,getULong:ps,getFixed:jr,getTag:Yp,getOffset:zp,getBytes:Wp,bytesToString:jp,Parser:G};function $p(n,e){e.parseUShort(),n.length=e.parseULong(),n.language=e.parseULong();let t;n.groupCount=t=e.parseULong(),n.glyphIndexMap={};for(let i=0;i<t;i+=1){const s=e.parseULong(),r=e.parseULong();let a=e.parseULong();for(let c=s;c<=r;c+=1)n.glyphIndexMap[c]=a,a++}}function Xp(n,e,t,i,s){n.length=e.parseUShort(),n.language=e.parseUShort();let r;n.segCount=r=e.parseUShort()>>1,e.skip("uShort",3),n.glyphIndexMap={};const a=new q.Parser(t,i+s+14),c=new q.Parser(t,i+s+16+r*2),l=new q.Parser(t,i+s+16+r*4),d=new q.Parser(t,i+s+16+r*6);let h=i+s+16+r*8;for(let f=0;f<r-1;f+=1){let p;const u=a.parseUShort(),m=c.parseUShort(),E=l.parseShort(),A=d.parseUShort();for(let b=m;b<=u;b+=1)A!==0?(h=d.offset+d.relativeOffset-2,h+=A,h+=(b-m)*2,p=q.getUShort(t,h),p!==0&&(p=p+E&65535)):p=b+E&65535,n.glyphIndexMap[b]=p}}function qp(n,e){const t={};t.version=q.getUShort(n,e),ne.argument(t.version===0,"cmap table version should be 0."),t.numTables=q.getUShort(n,e+2);let i=-1;for(let r=t.numTables-1;r>=0;r-=1){const a=q.getUShort(n,e+4+r*8),c=q.getUShort(n,e+4+r*8+2);if(a===3&&(c===0||c===1||c===10)||a===0&&(c===0||c===1||c===2||c===3||c===4)){i=q.getULong(n,e+4+r*8+4);break}}if(i===-1)throw new Error("No valid cmap sub-tables found.");const s=new q.Parser(n,e+i);if(t.format=s.parseUShort(),t.format===12)$p(t,s);else if(t.format===4)Xp(t,s,n,e,i);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function Jp(n,e,t){n.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function Zp(n){n.segments.push({end:65535,start:65535,delta:1,offset:0})}function em(n){let e=!0,t;for(t=n.length-1;t>0;t-=1)if(n.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}let i=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(i=i.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),i=i.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);const s=new ee.Table("cmap",i);for(s.segments=[],t=0;t<n.length;t+=1){const u=n.get(t);for(let m=0;m<u.unicodes.length;m+=1)Jp(s,u.unicodes[m],t);s.segments=s.segments.sort(function(m,E){return m.start-E.start})}Zp(s);const r=s.segments.length;let a=0,c=[],l=[],d=[],h=[],f=[],p=[];for(t=0;t<r;t+=1){const u=s.segments[t];u.end<=65535&&u.start<=65535?(c=c.concat({name:"end_"+t,type:"USHORT",value:u.end}),l=l.concat({name:"start_"+t,type:"USHORT",value:u.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:u.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:u.offset}),u.glyphId!==void 0&&(f=f.concat({name:"glyph_"+t,type:"USHORT",value:u.glyphId}))):a+=1,!e&&u.glyphIndex!==void 0&&(p=p.concat({name:"cmap12Start_"+t,type:"ULONG",value:u.start}),p=p.concat({name:"cmap12End_"+t,type:"ULONG",value:u.end}),p=p.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:u.glyphIndex}))}if(s.segCountX2=(r-a)*2,s.searchRange=Math.pow(2,Math.floor(Math.log(r-a)/Math.log(2)))*2,s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(c),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(l),s.fields=s.fields.concat(d),s.fields=s.fields.concat(h),s.fields=s.fields.concat(f),s.cmap4Length=14+c.length*2+2+l.length*2+d.length*2+h.length*2+f.length*2,!e){const u=16+p.length*4;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:u},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:p.length/3}]),s.fields=s.fields.concat(p)}return s}const $r={parse:qp,make:em},ii=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],tm=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],nm=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],St=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function Xr(n){this.font=n}Xr.prototype.charToGlyphIndex=function(n){const e=n.codePointAt(0),t=this.font.glyphs;if(t)for(let i=0;i<t.length;i+=1){const s=t.get(i);for(let r=0;r<s.unicodes.length;r+=1)if(s.unicodes[r]===e)return i}return null};function qr(n){this.cmap=n}qr.prototype.charToGlyphIndex=function(n){return this.cmap.glyphIndexMap[n.codePointAt(0)]||0};function si(n,e){this.encoding=n,this.charset=e}si.prototype.charToGlyphIndex=function(n){const e=n.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function ms(n){switch(n.version){case 1:this.names=St.slice();break;case 2:this.names=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)n.glyphNameIndex[e]<St.length?this.names[e]=St[n.glyphNameIndex[e]]:this.names[e]=n.names[n.glyphNameIndex[e]-St.length];break;case 2.5:this.names=new Array(n.numberOfGlyphs);for(let e=0;e<n.numberOfGlyphs;e++)this.names[e]=St[e+n.glyphNameIndex[e]];break;case 3:this.names=[];break;default:this.names=[];break}}ms.prototype.nameToGlyphIndex=function(n){return this.names.indexOf(n)},ms.prototype.glyphIndexToName=function(n){return this.names[n]};function im(n){let e;const t=n.tables.cmap.glyphIndexMap,i=Object.keys(t);for(let s=0;s<i.length;s+=1){const r=i[s],a=t[r];e=n.glyphs.get(a),e.addUnicode(parseInt(r))}for(let s=0;s<n.glyphs.length;s+=1)e=n.glyphs.get(s),n.cffEncoding?n.isCIDFont?e.name="gid"+s:e.name=n.cffEncoding.charset[s]:n.glyphNames.names&&(e.name=n.glyphNames.glyphIndexToName(s))}function sm(n,e,t,i,s){n.beginPath(),n.moveTo(e,t),n.lineTo(i,s),n.stroke()}const Tt={line:sm};function om(n,e){let t=e||new Be;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(i){t=i}}}function Ge(n){this.bindConstructorValues(n)}Ge.prototype.bindConstructorValues=function(n){this.index=n.index||0,this.name=n.name||null,this.unicode=n.unicode||void 0,this.unicodes=n.unicodes||n.unicode!==void 0?[n.unicode]:[],n.xMin&&(this.xMin=n.xMin),n.yMin&&(this.yMin=n.yMin),n.xMax&&(this.xMax=n.xMax),n.yMax&&(this.yMax=n.yMax),n.advanceWidth&&(this.advanceWidth=n.advanceWidth),Object.defineProperty(this,"path",om(this,n.path))},Ge.prototype.addUnicode=function(n){this.unicodes.length===0&&(this.unicode=n),this.unicodes.push(n)},Ge.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},Ge.prototype.getPath=function(n,e,t,i,s){n=n!==void 0?n:0,e=e!==void 0?e:0,t=t!==void 0?t:72;let r,a;i||(i={});let c=i.xScale,l=i.yScale;if(i.hinting&&s&&s.hinting&&(a=this.path&&s.hinting.exec(this,t)),a)r=s.hinting.getCommands(a),n=Math.round(n),e=Math.round(e),c=l=1;else{r=this.path.commands;const h=1/this.path.unitsPerEm*t;c===void 0&&(c=h),l===void 0&&(l=h)}const d=new Be;for(let h=0;h<r.length;h+=1){const f=r[h];f.type==="M"?d.moveTo(n+f.x*c,e+-f.y*l):f.type==="L"?d.lineTo(n+f.x*c,e+-f.y*l):f.type==="Q"?d.quadraticCurveTo(n+f.x1*c,e+-f.y1*l,n+f.x*c,e+-f.y*l):f.type==="C"?d.curveTo(n+f.x1*c,e+-f.y1*l,n+f.x2*c,e+-f.y2*l,n+f.x*c,e+-f.y*l):f.type==="Z"&&d.closePath()}return d},Ge.prototype.getContours=function(){if(this.points===void 0)return[];const n=[];let e=[];for(let t=0;t<this.points.length;t+=1){const i=this.points[t];e.push(i),i.lastPointOfContour&&(n.push(e),e=[])}return ne.argument(e.length===0,"There are still points left in the current contour."),n},Ge.prototype.getMetrics=function(){const n=this.path.commands,e=[],t=[];for(let s=0;s<n.length;s+=1){const r=n[s];r.type!=="Z"&&(e.push(r.x),t.push(r.y)),(r.type==="Q"||r.type==="C")&&(e.push(r.x1),t.push(r.y1)),r.type==="C"&&(e.push(r.x2),t.push(r.y2))}const i={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(i.xMin)||(i.xMin=0),isFinite(i.xMax)||(i.xMax=this.advanceWidth),isFinite(i.yMin)||(i.yMin=0),isFinite(i.yMax)||(i.yMax=0),i.rightSideBearing=this.advanceWidth-i.leftSideBearing-(i.xMax-i.xMin),i},Ge.prototype.draw=function(n,e,t,i,s){this.getPath(e,t,i,s).draw(n)},Ge.prototype.drawPoints=function(n,e,t,i){function s(d,h,f,p){const u=Math.PI*2;n.beginPath();for(let m=0;m<d.length;m+=1)n.moveTo(h+d[m].x*p,f+d[m].y*p),n.arc(h+d[m].x*p,f+d[m].y*p,2,0,u,!1);n.closePath(),n.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,i=i!==void 0?i:24;const r=1/this.path.unitsPerEm*i,a=[],c=[],l=this.path;for(let d=0;d<l.commands.length;d+=1){const h=l.commands[d];h.x!==void 0&&a.push({x:h.x,y:-h.y}),h.x1!==void 0&&c.push({x:h.x1,y:-h.y1}),h.x2!==void 0&&c.push({x:h.x2,y:-h.y2})}n.fillStyle="blue",s(a,e,t,r),n.fillStyle="red",s(c,e,t,r)},Ge.prototype.drawMetrics=function(n,e,t,i){let s;e=e!==void 0?e:0,t=t!==void 0?t:0,i=i!==void 0?i:24,s=1/this.path.unitsPerEm*i,n.lineWidth=1,n.strokeStyle="black",Tt.line(n,e,-1e4,e,1e4),Tt.line(n,-1e4,t,1e4,t);const r=this.xMin||0;let a=this.yMin||0;const c=this.xMax||0;let l=this.yMax||0;const d=this.advanceWidth||0;n.strokeStyle="blue",Tt.line(n,e+r*s,-1e4,e+r*s,1e4),Tt.line(n,e+c*s,-1e4,e+c*s,1e4),Tt.line(n,-1e4,t+-a*s,1e4,t+-a*s),Tt.line(n,-1e4,t+-l*s,1e4,t+-l*s),n.strokeStyle="green",Tt.line(n,e+d*s,-1e4,e+d*s,1e4)};function oi(n,e,t){Object.defineProperty(n,e,{get:function(){return n.path,n[t]},set:function(i){n[t]=i},enumerable:!0,configurable:!0})}function gs(n,e){if(this.font=n,this.glyphs={},Array.isArray(e))for(let t=0;t<e.length;t++)this.glyphs[t]=e[t];this.length=e&&e.length||0}gs.prototype.get=function(n){return typeof this.glyphs[n]=="function"&&(this.glyphs[n]=this.glyphs[n]()),this.glyphs[n]},gs.prototype.push=function(n,e){this.glyphs[n]=e,this.length++};function rm(n,e){return new Ge({index:e,font:n})}function am(n,e,t,i,s,r){return function(){const a=new Ge({index:e,font:n});return a.path=function(){t(a,i,s);const c=r(n.glyphs,a);return c.unitsPerEm=n.unitsPerEm,c},oi(a,"xMin","_xMin"),oi(a,"xMax","_xMax"),oi(a,"yMin","_yMin"),oi(a,"yMax","_yMax"),a}}function lm(n,e,t,i){return function(){const s=new Ge({index:e,font:n});return s.path=function(){const r=t(n,s,i);return r.unitsPerEm=n.unitsPerEm,r},s}}const jt={GlyphSet:gs,glyphLoader:rm,ttfGlyphLoader:am,cffGlyphLoader:lm};function Jr(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t+=1)if(!Jr(n[t],e[t]))return!1;return!0}else return!1}function As(n){let e;return n.length<1240?e=107:n.length<33900?e=1131:e=32768,e}function mt(n,e,t){const i=[],s=[],r=q.getCard16(n,e);let a,c;if(r!==0){const l=q.getByte(n,e+2);a=e+(r+1)*l+2;let d=e+3;for(let h=0;h<r+1;h+=1)i.push(q.getOffset(n,d,l)),d+=l;c=a+i[r]}else c=e+2;for(let l=0;l<i.length-1;l+=1){let d=q.getBytes(n,a+i[l],a+i[l+1]);t&&(d=t(d)),s.push(d)}return{objects:s,startOffset:e,endOffset:c}}function cm(n){let e="";const i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=n.parseByte(),r=s>>4,a=s&15;if(r===15||(e+=i[r],a===15))break;e+=i[a]}return parseFloat(e)}function dm(n,e){let t,i,s,r;if(e===28)return t=n.parseByte(),i=n.parseByte(),t<<8|i;if(e===29)return t=n.parseByte(),i=n.parseByte(),s=n.parseByte(),r=n.parseByte(),t<<24|i<<16|s<<8|r;if(e===30)return cm(n);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=n.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=n.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function um(n){const e={};for(let t=0;t<n.length;t+=1){const i=n[t][0],s=n[t][1];let r;if(s.length===1?r=s[0]:r=s,e.hasOwnProperty(i)&&!isNaN(e[i]))throw new Error("Object "+e+" already has key "+i);e[i]=r}return e}function Zr(n,e,t){e=e!==void 0?e:0;const i=new q.Parser(n,e),s=[];let r=[];for(t=t!==void 0?t:n.length;i.relativeOffset<t;){let a=i.parseByte();a<=21?(a===12&&(a=1200+i.parseByte()),s.push([a,r]),r=[]):r.push(dm(i,a))}return um(s)}function hn(n,e){return e<=390?e=ii[e]:e=n[e-391],e}function ea(n,e,t){const i={};let s;for(let r=0;r<e.length;r+=1){const a=e[r];if(Array.isArray(a.type)){const c=[];c.length=a.type.length;for(let l=0;l<a.type.length;l++)s=n[a.op]!==void 0?n[a.op][l]:void 0,s===void 0&&(s=a.value!==void 0&&a.value[l]!==void 0?a.value[l]:null),a.type[l]==="SID"&&(s=hn(t,s)),c[l]=s;i[a.name]=c}else s=n[a.op],s===void 0&&(s=a.value!==void 0?a.value:null),a.type==="SID"&&(s=hn(t,s)),i[a.name]=s}return i}function hm(n,e){const t={};return t.formatMajor=q.getCard8(n,e),t.formatMinor=q.getCard8(n,e+1),t.size=q.getCard8(n,e+2),t.offsetSize=q.getCard8(n,e+3),t.startOffset=e,t.endOffset=e+4,t}const ta=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],na=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function fm(n,e){const t=Zr(n,0,n.byteLength);return ea(t,ta,e)}function ia(n,e,t,i){const s=Zr(n,e,t);return ea(s,na,i)}function sa(n,e,t,i){const s=[];for(let r=0;r<t.length;r+=1){const a=new DataView(new Uint8Array(t[r]).buffer),c=fm(a,i);c._subrs=[],c._subrsBias=0;const l=c.private[0],d=c.private[1];if(l!==0&&d!==0){const h=ia(n,d+e,l,i);if(c._defaultWidthX=h.defaultWidthX,c._nominalWidthX=h.nominalWidthX,h.subrs!==0){const f=d+h.subrs,p=mt(n,f+e);c._subrs=p.objects,c._subrsBias=As(c._subrs)}c._privateDict=h}s.push(c)}return s}function pm(n,e,t,i){let s,r;const a=new q.Parser(n,e);t-=1;const c=[".notdef"],l=a.parseCard8();if(l===0)for(let d=0;d<t;d+=1)s=a.parseSID(),c.push(hn(i,s));else if(l===1)for(;c.length<=t;){s=a.parseSID(),r=a.parseCard8();for(let d=0;d<=r;d+=1)c.push(hn(i,s)),s+=1}else if(l===2)for(;c.length<=t;){s=a.parseSID(),r=a.parseCard16();for(let d=0;d<=r;d+=1)c.push(hn(i,s)),s+=1}else throw new Error("Unknown charset format "+l);return c}function mm(n,e,t){let i;const s={},r=new q.Parser(n,e),a=r.parseCard8();if(a===0){const c=r.parseCard8();for(let l=0;l<c;l+=1)i=r.parseCard8(),s[i]=l}else if(a===1){const c=r.parseCard8();i=1;for(let l=0;l<c;l+=1){const d=r.parseCard8(),h=r.parseCard8();for(let f=d;f<=d+h;f+=1)s[f]=i,i+=1}}else throw new Error("Unknown encoding format "+a);return new si(s,t)}function gm(n,e,t){let i,s,r,a;const c=new Be,l=[];let d=0,h=!1,f=!1,p=0,u=0,m,E,A,b;if(n.isCIDFont){const S=n.tables.cff.topDict._fdSelect[e.index],B=n.tables.cff.topDict._fdArray[S];m=B._subrs,E=B._subrsBias,A=B._defaultWidthX,b=B._nominalWidthX}else m=n.tables.cff.topDict._subrs,E=n.tables.cff.topDict._subrsBias,A=n.tables.cff.topDict._defaultWidthX,b=n.tables.cff.topDict._nominalWidthX;let w=A;function I(S,B){f&&c.closePath(),c.moveTo(S,B),f=!0}function D(){let S;S=l.length%2!==0,S&&!h&&(w=l.shift()+b),d+=l.length>>1,l.length=0,h=!0}function N(S){let B,g,R,x,M,L,V,k,C,y,v,P,F=0;for(;F<S.length;){let U=S[F];switch(F+=1,U){case 1:D();break;case 3:D();break;case 4:l.length>1&&!h&&(w=l.shift()+b,h=!0),u+=l.pop(),I(p,u);break;case 5:for(;l.length>0;)p+=l.shift(),u+=l.shift(),c.lineTo(p,u);break;case 6:for(;l.length>0&&(p+=l.shift(),c.lineTo(p,u),l.length!==0);)u+=l.shift(),c.lineTo(p,u);break;case 7:for(;l.length>0&&(u+=l.shift(),c.lineTo(p,u),l.length!==0);)p+=l.shift(),c.lineTo(p,u);break;case 8:for(;l.length>0;)i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a+l.shift(),c.curveTo(i,s,r,a,p,u);break;case 10:M=l.pop()+E,L=m[M],L&&N(L);break;case 11:return;case 12:switch(U=S[F],F+=1,U){case 35:i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),V=r+l.shift(),k=a+l.shift(),C=V+l.shift(),y=k+l.shift(),v=C+l.shift(),P=y+l.shift(),p=v+l.shift(),u=P+l.shift(),l.shift(),c.curveTo(i,s,r,a,V,k),c.curveTo(C,y,v,P,p,u);break;case 34:i=p+l.shift(),s=u,r=i+l.shift(),a=s+l.shift(),V=r+l.shift(),k=a,C=V+l.shift(),y=a,v=C+l.shift(),P=u,p=v+l.shift(),c.curveTo(i,s,r,a,V,k),c.curveTo(C,y,v,P,p,u);break;case 36:i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),V=r+l.shift(),k=a,C=V+l.shift(),y=a,v=C+l.shift(),P=y+l.shift(),p=v+l.shift(),c.curveTo(i,s,r,a,V,k),c.curveTo(C,y,v,P,p,u);break;case 37:i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),V=r+l.shift(),k=a+l.shift(),C=V+l.shift(),y=k+l.shift(),v=C+l.shift(),P=y+l.shift(),Math.abs(v-p)>Math.abs(P-u)?p=v+l.shift():u=P+l.shift(),c.curveTo(i,s,r,a,V,k),c.curveTo(C,y,v,P,p,u);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+U),l.length=0}break;case 14:l.length>0&&!h&&(w=l.shift()+b,h=!0),f&&(c.closePath(),f=!1);break;case 18:D();break;case 19:case 20:D(),F+=d+7>>3;break;case 21:l.length>2&&!h&&(w=l.shift()+b,h=!0),u+=l.pop(),p+=l.pop(),I(p,u);break;case 22:l.length>1&&!h&&(w=l.shift()+b,h=!0),p+=l.pop(),I(p,u);break;case 23:D();break;case 24:for(;l.length>2;)i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a+l.shift(),c.curveTo(i,s,r,a,p,u);p+=l.shift(),u+=l.shift(),c.lineTo(p,u);break;case 25:for(;l.length>6;)p+=l.shift(),u+=l.shift(),c.lineTo(p,u);i=p+l.shift(),s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a+l.shift(),c.curveTo(i,s,r,a,p,u);break;case 26:for(l.length%2&&(p+=l.shift());l.length>0;)i=p,s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r,u=a+l.shift(),c.curveTo(i,s,r,a,p,u);break;case 27:for(l.length%2&&(u+=l.shift());l.length>0;)i=p+l.shift(),s=u,r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a,c.curveTo(i,s,r,a,p,u);break;case 28:B=S[F],g=S[F+1],l.push((B<<24|g<<16)>>16),F+=2;break;case 29:M=l.pop()+n.gsubrsBias,L=n.gsubrs[M],L&&N(L);break;case 30:for(;l.length>0&&(i=p,s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a+(l.length===1?l.shift():0),c.curveTo(i,s,r,a,p,u),l.length!==0);)i=p+l.shift(),s=u,r=i+l.shift(),a=s+l.shift(),u=a+l.shift(),p=r+(l.length===1?l.shift():0),c.curveTo(i,s,r,a,p,u);break;case 31:for(;l.length>0&&(i=p+l.shift(),s=u,r=i+l.shift(),a=s+l.shift(),u=a+l.shift(),p=r+(l.length===1?l.shift():0),c.curveTo(i,s,r,a,p,u),l.length!==0);)i=p,s=u+l.shift(),r=i+l.shift(),a=s+l.shift(),p=r+l.shift(),u=a+(l.length===1?l.shift():0),c.curveTo(i,s,r,a,p,u);break;default:U<32?console.log("Glyph "+e.index+": unknown operator "+U):U<247?l.push(U-139):U<251?(B=S[F],F+=1,l.push((U-247)*256+B+108)):U<255?(B=S[F],F+=1,l.push(-(U-251)*256-B-108)):(B=S[F],g=S[F+1],R=S[F+2],x=S[F+3],F+=4,l.push((B<<24|g<<16|R<<8|x)/65536))}}}return N(t),e.advanceWidth=w,c}function Am(n,e,t,i){const s=[];let r;const a=new q.Parser(n,e),c=a.parseCard8();if(c===0)for(let l=0;l<t;l++){if(r=a.parseCard8(),r>=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+i+")");s.push(r)}else if(c===3){const l=a.parseCard16();let d=a.parseCard16();if(d!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+d);let h;for(let f=0;f<l;f++){if(r=a.parseCard8(),h=a.parseCard16(),r>=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+i+")");if(h>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+h);for(;d<h;d++)s.push(r);d=h}if(h!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+h)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+c);return s}function ym(n,e,t){t.tables.cff={};const i=hm(n,e),s=mt(n,i.endOffset,q.bytesToString),r=mt(n,s.endOffset),a=mt(n,r.endOffset,q.bytesToString),c=mt(n,a.endOffset);t.gsubrs=c.objects,t.gsubrsBias=As(t.gsubrs);const l=sa(n,e,r.objects,a.objects);if(l.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);const d=l[0];if(t.tables.cff.topDict=d,d._privateDict&&(t.defaultWidthX=d._privateDict.defaultWidthX,t.nominalWidthX=d._privateDict.nominalWidthX),d.ros[0]!==void 0&&d.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){let m=d.fdArray,E=d.fdSelect;if(m===0||E===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");m+=e;const A=mt(n,m),b=sa(n,e,A.objects,a.objects);d._fdArray=b,E+=e,d._fdSelect=Am(n,E,t.numGlyphs,b.length)}const h=e+d.private[1],f=ia(n,h,d.private[0],a.objects);if(t.defaultWidthX=f.defaultWidthX,t.nominalWidthX=f.nominalWidthX,f.subrs!==0){const m=h+f.subrs,E=mt(n,m);t.subrs=E.objects,t.subrsBias=As(t.subrs)}else t.subrs=[],t.subrsBias=0;const p=mt(n,e+d.charStrings);t.nGlyphs=p.objects.length;const u=pm(n,e+d.charset,t.nGlyphs,a.objects);d.encoding===0?t.cffEncoding=new si(tm,u):d.encoding===1?t.cffEncoding=new si(nm,u):t.cffEncoding=mm(n,e+d.encoding,u),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new jt.GlyphSet(t);for(let m=0;m<t.nGlyphs;m+=1){const E=p.objects[m];t.glyphs.push(m,jt.cffGlyphLoader(t,m,gm,E))}}function oa(n,e){let t,i=ii.indexOf(n);return i>=0&&(t=i),i=e.indexOf(n),i>=0?t=i+ii.length:(t=ii.length+e.length,e.push(n)),t}function Cm(){return new ee.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function Em(n){const e=new ee.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(let t=0;t<n.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:n[t]});return e}function ra(n,e,t){const i={};for(let s=0;s<n.length;s+=1){const r=n[s];let a=e[r.name];a!==void 0&&!Jr(a,r.value)&&(r.type==="SID"&&(a=oa(a,t)),i[r.op]={name:r.name,type:r.type,value:a})}return i}function aa(n,e){const t=new ee.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=ra(ta,n,e),t}function la(n){const e=new ee.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:n}],e}function bm(n){const e=new ee.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(let t=0;t<n.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:n[t]});return e}function wm(){return new ee.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function vm(n,e){const t=new ee.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let i=0;i<n.length;i+=1){const s=n[i],r=oa(s,e);t.fields.push({name:"glyph_"+i,type:"SID",value:r})}return t}function Im(n){const e=[],t=n.path;e.push({name:"width",type:"NUMBER",value:n.advanceWidth});let i=0,s=0;for(let r=0;r<t.commands.length;r+=1){let a,c,l=t.commands[r];if(l.type==="Q"){const d=.3333333333333333,h=2/3;l={type:"C",x:l.x,y:l.y,x1:d*i+h*l.x1,y1:d*s+h*l.y1,x2:d*l.x+h*l.x1,y2:d*l.y+h*l.y1}}if(l.type==="M")a=Math.round(l.x-i),c=Math.round(l.y-s),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:c}),e.push({name:"rmoveto",type:"OP",value:21}),i=Math.round(l.x),s=Math.round(l.y);else if(l.type==="L")a=Math.round(l.x-i),c=Math.round(l.y-s),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:c}),e.push({name:"rlineto",type:"OP",value:5}),i=Math.round(l.x),s=Math.round(l.y);else if(l.type==="C"){const d=Math.round(l.x1-i),h=Math.round(l.y1-s),f=Math.round(l.x2-l.x1),p=Math.round(l.y2-l.y1);a=Math.round(l.x-l.x2),c=Math.round(l.y-l.y2),e.push({name:"dx1",type:"NUMBER",value:d}),e.push({name:"dy1",type:"NUMBER",value:h}),e.push({name:"dx2",type:"NUMBER",value:f}),e.push({name:"dy2",type:"NUMBER",value:p}),e.push({name:"dx",type:"NUMBER",value:a}),e.push({name:"dy",type:"NUMBER",value:c}),e.push({name:"rrcurveto",type:"OP",value:8}),i=Math.round(l.x),s=Math.round(l.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function Bm(n){const e=new ee.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let t=0;t<n.length;t+=1){const i=n.get(t),s=Im(i);e.charStrings.push({name:i.name,type:"CHARSTRING",value:s})}return e}function xm(n,e){const t=new ee.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=ra(na,n,e),t}function Sm(n,e){const t=new ee.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),i=1/e.unitsPerEm,s={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[i,0,0,i,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},r={},a=[];let c;for(let f=1;f<n.length;f+=1)c=n.get(f),a.push(c.name);const l=[];t.header=Cm(),t.nameIndex=Em([e.postScriptName]);let d=aa(s,l);t.topDictIndex=la(d),t.globalSubrIndex=wm(),t.charsets=vm(a,l),t.charStringsIndex=Bm(n),t.privateDict=xm(r,l),t.stringIndex=bm(l);const h=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return s.charset=h,s.encoding=0,s.charStrings=s.charset+t.charsets.sizeOf(),s.private[1]=s.charStrings+t.charStringsIndex.sizeOf(),d=aa(s,l),t.topDictIndex=la(d),t}const ca={parse:ym,make:Sm};function Tm(n,e){const t={},i=new q.Parser(n,e);return t.version=i.parseVersion(),t.fontRevision=Math.round(i.parseFixed()*1e3)/1e3,t.checkSumAdjustment=i.parseULong(),t.magicNumber=i.parseULong(),ne.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=i.parseUShort(),t.unitsPerEm=i.parseUShort(),t.created=i.parseLongDateTime(),t.modified=i.parseLongDateTime(),t.xMin=i.parseShort(),t.yMin=i.parseShort(),t.xMax=i.parseShort(),t.yMax=i.parseShort(),t.macStyle=i.parseUShort(),t.lowestRecPPEM=i.parseUShort(),t.fontDirectionHint=i.parseShort(),t.indexToLocFormat=i.parseShort(),t.glyphDataFormat=i.parseShort(),t}function Mm(n){const e=Math.round(new Date().getTime()/1e3)+2082844800;let t=e;return n.createdTimestamp&&(t=n.createdTimestamp+2082844800),new ee.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],n)}const da={parse:Tm,make:Mm};function Dm(n,e){const t={},i=new q.Parser(n,e);return t.version=i.parseVersion(),t.ascender=i.parseShort(),t.descender=i.parseShort(),t.lineGap=i.parseShort(),t.advanceWidthMax=i.parseUShort(),t.minLeftSideBearing=i.parseShort(),t.minRightSideBearing=i.parseShort(),t.xMaxExtent=i.parseShort(),t.caretSlopeRise=i.parseShort(),t.caretSlopeRun=i.parseShort(),t.caretOffset=i.parseShort(),i.relativeOffset+=8,t.metricDataFormat=i.parseShort(),t.numberOfHMetrics=i.parseUShort(),t}function km(n){return new ee.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],n)}const ua={parse:Dm,make:km};function Pm(n,e,t,i,s){let r,a;const c=new q.Parser(n,e);for(let l=0;l<i;l+=1){l<t&&(r=c.parseUShort(),a=c.parseShort());const d=s.get(l);d.advanceWidth=r,d.leftSideBearing=a}}function Nm(n){const e=new ee.Table("hmtx",[]);for(let t=0;t<n.length;t+=1){const i=n.get(t),s=i.advanceWidth||0,r=i.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:s}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:r})}return e}const ha={parse:Pm,make:Nm};function Fm(n){const e=new ee.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:n.length}]);let t="";const i=12+n.length*4;for(let s=0;s<n.length;++s){let r=t.indexOf(n[s]);r<0&&(r=t.length,t+=n[s]),e.fields.push({name:"offset "+s,type:"USHORT",value:i+r}),e.fields.push({name:"length "+s,type:"USHORT",value:n[s].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function Rm(n,e){const t=new q.Parser(n,e),i=t.parseULong();ne.argument(i===1,"Unsupported ltag table version."),t.skip("uLong",1);const s=t.parseULong(),r=[];for(let a=0;a<s;a++){let c="";const l=e+t.parseUShort(),d=t.parseUShort();for(let h=l;h<l+d;++h)c+=String.fromCharCode(n.getInt8(h));r.push(c)}return r}const fa={make:Fm,parse:Rm};function Lm(n,e){const t={},i=new q.Parser(n,e);return t.version=i.parseVersion(),t.numGlyphs=i.parseUShort(),t.version===1&&(t.maxPoints=i.parseUShort(),t.maxContours=i.parseUShort(),t.maxCompositePoints=i.parseUShort(),t.maxCompositeContours=i.parseUShort(),t.maxZones=i.parseUShort(),t.maxTwilightPoints=i.parseUShort(),t.maxStorage=i.parseUShort(),t.maxFunctionDefs=i.parseUShort(),t.maxInstructionDefs=i.parseUShort(),t.maxStackElements=i.parseUShort(),t.maxSizeOfInstructions=i.parseUShort(),t.maxComponentElements=i.parseUShort(),t.maxComponentDepth=i.parseUShort()),t}function Om(n){return new ee.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:n}])}const pa={parse:Lm,make:Om},ma=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],ga={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Um={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Aa={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function _m(n,e,t){switch(n){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return ga[e];case 3:return Aa[e]}}const ys="utf-16",Qm={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},Vm={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function ya(n,e,t){switch(n){case 0:return ys;case 1:return Vm[t]||Qm[e];case 3:if(e===1||e===10)return ys;break}}function Gm(n,e,t){const i={},s=new q.Parser(n,e),r=s.parseUShort(),a=s.parseUShort(),c=s.offset+s.parseUShort();for(let l=0;l<a;l++){const d=s.parseUShort(),h=s.parseUShort(),f=s.parseUShort(),p=s.parseUShort(),u=ma[p]||p,m=s.parseUShort(),E=s.parseUShort(),A=_m(d,f,t),b=ya(d,h,f);if(b!==void 0&&A!==void 0){let w;if(b===ys?w=Wt.UTF16(n,c+E,m):w=Wt.MACSTRING(n,c+E,m,b),w){let I=i[u];I===void 0&&(I=i[u]={}),I[A]=w}}}return r===1&&s.parseUShort(),i}function Cs(n){const e={};for(let t in n)e[n[t]]=parseInt(t);return e}function Ca(n,e,t,i,s,r){return new ee.Record("NameRecord",[{name:"platformID",type:"USHORT",value:n},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:i},{name:"length",type:"USHORT",value:s},{name:"offset",type:"USHORT",value:r}])}function Hm(n,e){const t=n.length,i=e.length-t+1;e:for(let s=0;s<i;s++)for(;s<i;s++){for(let r=0;r<t;r++)if(e[s+r]!==n[r])continue e;return s}return-1}function Ea(n,e){let t=Hm(n,e);if(t<0){t=e.length;let i=0;const s=n.length;for(;i<s;++i)e.push(n[i])}return t}function Ym(n,e){let t;const i=[],s={},r=Cs(ma);for(let f in n){let p=r[f];if(p===void 0&&(p=f),t=parseInt(p),isNaN(t))throw new Error('Name table entry "'+f+'" does not exist, see nameTableNames for complete list.');s[t]=n[f],i.push(t)}const a=Cs(ga),c=Cs(Aa),l=[],d=[];for(let f=0;f<i.length;f++){t=i[f];const p=s[t];for(let u in p){const m=p[u];let E=1,A=a[u],b=Um[A];const w=ya(E,b,A);let I=W.MACSTRING(m,w);I===void 0&&(E=0,A=e.indexOf(u),A<0&&(A=e.length,e.push(u)),b=4,I=W.UTF16(m));const D=Ea(I,d);l.push(Ca(E,b,A,t,I.length,D));const N=c[u];if(N!==void 0){const S=W.UTF16(m),B=Ea(S,d);l.push(Ca(3,1,N,t,S.length,B))}}}l.sort(function(f,p){return f.platformID-p.platformID||f.encodingID-p.encodingID||f.languageID-p.languageID||f.nameID-p.nameID});const h=new ee.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:l.length},{name:"stringOffset",type:"USHORT",value:6+l.length*12}]);for(let f=0;f<l.length;f++)h.fields.push({name:"record_"+f,type:"RECORD",value:l[f]});return h.fields.push({name:"strings",type:"LITERAL",value:d}),h}const ba={parse:Gm,make:Ym},Es=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function zm(n){for(let e=0;e<Es.length;e+=1){const t=Es[e];if(n>=t.begin&&n<t.end)return e}return-1}function Wm(n,e){const t={},i=new q.Parser(n,e);t.version=i.parseUShort(),t.xAvgCharWidth=i.parseShort(),t.usWeightClass=i.parseUShort(),t.usWidthClass=i.parseUShort(),t.fsType=i.parseUShort(),t.ySubscriptXSize=i.parseShort(),t.ySubscriptYSize=i.parseShort(),t.ySubscriptXOffset=i.parseShort(),t.ySubscriptYOffset=i.parseShort(),t.ySuperscriptXSize=i.parseShort(),t.ySuperscriptYSize=i.parseShort(),t.ySuperscriptXOffset=i.parseShort(),t.ySuperscriptYOffset=i.parseShort(),t.yStrikeoutSize=i.parseShort(),t.yStrikeoutPosition=i.parseShort(),t.sFamilyClass=i.parseShort(),t.panose=[];for(let s=0;s<10;s++)t.panose[s]=i.parseByte();return t.ulUnicodeRange1=i.parseULong(),t.ulUnicodeRange2=i.parseULong(),t.ulUnicodeRange3=i.parseULong(),t.ulUnicodeRange4=i.parseULong(),t.achVendID=String.fromCharCode(i.parseByte(),i.parseByte(),i.parseByte(),i.parseByte()),t.fsSelection=i.parseUShort(),t.usFirstCharIndex=i.parseUShort(),t.usLastCharIndex=i.parseUShort(),t.sTypoAscender=i.parseShort(),t.sTypoDescender=i.parseShort(),t.sTypoLineGap=i.parseShort(),t.usWinAscent=i.parseUShort(),t.usWinDescent=i.parseUShort(),t.version>=1&&(t.ulCodePageRange1=i.parseULong(),t.ulCodePageRange2=i.parseULong()),t.version>=2&&(t.sxHeight=i.parseShort(),t.sCapHeight=i.parseShort(),t.usDefaultChar=i.parseUShort(),t.usBreakChar=i.parseUShort(),t.usMaxContent=i.parseUShort()),t}function jm(n){return new ee.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],n)}const bs={parse:Wm,make:jm,unicodeRanges:Es,getUnicodeRange:zm};function Km(n,e){const t={},i=new q.Parser(n,e);switch(t.version=i.parseVersion(),t.italicAngle=i.parseFixed(),t.underlinePosition=i.parseShort(),t.underlineThickness=i.parseShort(),t.isFixedPitch=i.parseULong(),t.minMemType42=i.parseULong(),t.maxMemType42=i.parseULong(),t.minMemType1=i.parseULong(),t.maxMemType1=i.parseULong(),t.version){case 1:t.names=St.slice();break;case 2:t.numberOfGlyphs=i.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(let s=0;s<t.numberOfGlyphs;s++)t.glyphNameIndex[s]=i.parseUShort();t.names=[];for(let s=0;s<t.numberOfGlyphs;s++)if(t.glyphNameIndex[s]>=St.length){const r=i.parseChar();t.names.push(i.parseString(r))}break;case 2.5:t.numberOfGlyphs=i.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(let s=0;s<t.numberOfGlyphs;s++)t.offset[s]=i.parseChar();break}return t}function $m(){return new ee.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}const wa={parse:Km,make:$m},ze=new Array(9);ze[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(G.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(G.coverage),substitute:this.parseOffset16List()};ne.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},ze[2]=function(){const e=this.parseUShort();return ne.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(G.coverage),sequences:this.parseListOfLists()}},ze[3]=function(){const e=this.parseUShort();return ne.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(G.coverage),alternateSets:this.parseListOfLists()}},ze[4]=function(){const e=this.parseUShort();return ne.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(G.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};const Kt={sequenceIndex:G.uShort,lookupListIndex:G.uShort};ze[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(G.coverage),ruleSets:this.parseListOfLists(function(){const i=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(s,Kt)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(G.coverage),classDef:this.parsePointer(G.classDef),classSets:this.parseListOfLists(function(){const i=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(s,Kt)}})};if(t===3){const i=this.parseUShort(),s=this.parseUShort();return{substFormat:t,coverages:this.parseList(i,G.pointer(G.coverage)),lookupRecords:this.parseRecordList(s,Kt)}}ne.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},ze[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(G.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Kt)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(G.coverage),backtrackClassDef:this.parsePointer(G.classDef),inputClassDef:this.parsePointer(G.classDef),lookaheadClassDef:this.parsePointer(G.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Kt)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(G.pointer(G.coverage)),inputCoverage:this.parseList(G.pointer(G.coverage)),lookaheadCoverage:this.parseList(G.pointer(G.coverage)),lookupRecords:this.parseRecordList(Kt)};ne.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},ze[7]=function(){const e=this.parseUShort();ne.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),i=new G(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:ze[t].call(i)}},ze[8]=function(){const e=this.parseUShort();return ne.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(G.coverage),backtrackCoverage:this.parseList(G.pointer(G.coverage)),lookaheadCoverage:this.parseList(G.pointer(G.coverage)),substitutes:this.parseUShortList()}};function Xm(n,e){e=e||0;const t=new G(n,e),i=t.parseVersion(1);return ne.argument(i===1||i===1.1,"Unsupported GSUB table version."),i===1?{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ze)}:{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ze),variations:t.parseFeatureVariationsList()}}const ri=new Array(9);ri[1]=function(e){return e.substFormat===1?new ee.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ee.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new ee.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new ee.Coverage(e.coverage)}].concat(ee.ushortList("substitute",e.substitute)))},ri[3]=function(e){return ne.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new ee.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ee.Coverage(e.coverage)}].concat(ee.tableList("altSet",e.alternateSets,function(t){return new ee.Table("alternateSetTable",ee.ushortList("alternate",t))})))},ri[4]=function(e){return ne.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new ee.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ee.Coverage(e.coverage)}].concat(ee.tableList("ligSet",e.ligatureSets,function(t){return new ee.Table("ligatureSetTable",ee.tableList("ligature",t,function(i){return new ee.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:i.ligGlyph}].concat(ee.ushortList("component",i.components,i.components.length+1)))}))})))};function qm(n){return new ee.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ee.ScriptList(n.scripts)},{name:"features",type:"TABLE",value:new ee.FeatureList(n.features)},{name:"lookups",type:"TABLE",value:new ee.LookupList(n.lookups,ri)}])}const va={parse:Xm,make:qm};function Jm(n,e){const t=new q.Parser(n,e),i=t.parseULong();ne.argument(i===1,"Unsupported META table version."),t.parseULong(),t.parseULong();const s=t.parseULong(),r={};for(let a=0;a<s;a++){const c=t.parseTag(),l=t.parseULong(),d=t.parseULong(),h=Wt.UTF8(n,e+l,d);r[c]=h}return r}function Zm(n){const e=Object.keys(n).length;let t="";const i=16+e*12,s=new ee.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:i},{name:"numTags",type:"ULONG",value:e}]);for(let r in n){const a=t.length;t+=n[r],s.fields.push({name:"tag "+r,type:"TAG",value:r}),s.fields.push({name:"offset "+r,type:"ULONG",value:i+a}),s.fields.push({name:"length "+r,type:"ULONG",value:n[r].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),s}const Ia={parse:Jm,make:Zm};function Ba(n){return Math.log(n)/Math.log(2)|0}function ws(n){for(;n.length%4!==0;)n.push(0);let e=0;for(let t=0;t<n.length;t+=4)e+=(n[t]<<24)+(n[t+1]<<16)+(n[t+2]<<8)+n[t+3];return e%=Math.pow(2,32),e}function xa(n,e,t,i){return new ee.Record("Table Record",[{name:"tag",type:"TAG",value:n!==void 0?n:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:i!==void 0?i:0}])}function Sa(n){const e=new ee.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=n,e.numTables=n.length;const t=Math.pow(2,Ba(e.numTables));e.searchRange=16*t,e.entrySelector=Ba(t),e.rangeShift=e.numTables*16-e.searchRange;const i=[],s=[];let r=e.sizeOf()+xa().sizeOf()*e.numTables;for(;r%4!==0;)r+=1,s.push({name:"padding",type:"BYTE",value:0});for(let a=0;a<n.length;a+=1){const c=n[a];ne.argument(c.tableName.length===4,"Table name"+c.tableName+" is invalid.");const l=c.sizeOf(),d=xa(c.tableName,ws(c.encode()),r,l);for(i.push({name:d.tag+" Table Record",type:"RECORD",value:d}),s.push({name:c.tableName+" table",type:"RECORD",value:c}),r+=l,ne.argument(!isNaN(r),"Something went wrong calculating the offset.");r%4!==0;)r+=1,s.push({name:"padding",type:"BYTE",value:0})}return i.sort(function(a,c){return a.value.tag>c.value.tag?1:-1}),e.fields=e.fields.concat(i),e.fields=e.fields.concat(s),e}function Ta(n,e,t){for(let i=0;i<e.length;i+=1){const s=n.charToGlyphIndex(e[i]);if(s>0)return n.glyphs.get(s).getMetrics()}return t}function eg(n){let e=0;for(let t=0;t<n.length;t+=1)e+=n[t];return e/n.length}function tg(n){const e=[],t=[],i=[],s=[],r=[],a=[],c=[];let l,d=0,h=0,f=0,p=0,u=0;for(let T=0;T<n.glyphs.length;T+=1){const _=n.glyphs.get(T),H=_.unicode|0;if(isNaN(_.advanceWidth))throw new Error("Glyph "+_.name+" ("+T+"): advanceWidth is not a number.");(l>H||l===void 0)&&H>0&&(l=H),d<H&&(d=H);const j=bs.getUnicodeRange(H);if(j<32)h|=1<<j;else if(j<64)f|=1<<j-32;else if(j<96)p|=1<<j-64;else if(j<123)u|=1<<j-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(_.name===".notdef")continue;const X=_.getMetrics();e.push(X.xMin),t.push(X.yMin),i.push(X.xMax),s.push(X.yMax),a.push(X.leftSideBearing),c.push(X.rightSideBearing),r.push(_.advanceWidth)}const m={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,r),advanceWidthAvg:eg(r),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,c)};m.ascender=n.ascender,m.descender=n.descender;const E=da.make({flags:3,unitsPerEm:n.unitsPerEm,xMin:m.xMin,yMin:m.yMin,xMax:m.xMax,yMax:m.yMax,lowestRecPPEM:3,createdTimestamp:n.createdTimestamp}),A=ua.make({ascender:m.ascender,descender:m.descender,advanceWidthMax:m.advanceWidthMax,minLeftSideBearing:m.minLeftSideBearing,minRightSideBearing:m.minRightSideBearing,xMaxExtent:m.maxLeftSideBearing+(m.xMax-m.xMin),numberOfHMetrics:n.glyphs.length}),b=pa.make(n.glyphs.length),w=bs.make({xAvgCharWidth:Math.round(m.advanceWidthAvg),usWeightClass:n.tables.os2.usWeightClass,usWidthClass:n.tables.os2.usWidthClass,usFirstCharIndex:l,usLastCharIndex:d,ulUnicodeRange1:h,ulUnicodeRange2:f,ulUnicodeRange3:p,ulUnicodeRange4:u,fsSelection:n.tables.os2.fsSelection,sTypoAscender:m.ascender,sTypoDescender:m.descender,sTypoLineGap:0,usWinAscent:m.yMax,usWinDescent:Math.abs(m.yMin),ulCodePageRange1:1,sxHeight:Ta(n,"xyvw",{yMax:Math.round(m.ascender/2)}).yMax,sCapHeight:Ta(n,"HIKLEFJMNTZBDPRAGOQSUVWXY",m).yMax,usDefaultChar:n.hasChar(" ")?32:0,usBreakChar:n.hasChar(" ")?32:0}),I=ha.make(n.glyphs),D=$r.make(n.glyphs),N=n.getEnglishName("fontFamily"),S=n.getEnglishName("fontSubfamily"),B=N+" "+S;let g=n.getEnglishName("postScriptName");g||(g=N.replace(/\s/g,"")+"-"+S);const R={};for(let T in n.names)R[T]=n.names[T];R.uniqueID||(R.uniqueID={en:n.getEnglishName("manufacturer")+":"+B}),R.postScriptName||(R.postScriptName={en:g}),R.preferredFamily||(R.preferredFamily=n.names.fontFamily),R.preferredSubfamily||(R.preferredSubfamily=n.names.fontSubfamily);const x=[],M=ba.make(R,x),L=x.length>0?fa.make(x):void 0,V=wa.make(),k=ca.make(n.glyphs,{version:n.getEnglishName("version"),fullName:B,familyName:N,weightName:S,postScriptName:g,unitsPerEm:n.unitsPerEm,fontBBox:[0,m.yMin,m.ascender,m.advanceWidthMax]}),C=n.metas&&Object.keys(n.metas).length>0?Ia.make(n.metas):void 0,y=[E,A,b,w,M,D,V,k,I];L&&y.push(L),n.tables.gsub&&y.push(va.make(n.tables.gsub)),C&&y.push(C);const v=Sa(y),P=v.encode(),F=ws(P),U=v.fields;let O=!1;for(let T=0;T<U.length;T+=1)if(U[T].name==="head table"){U[T].value.checkSumAdjustment=2981146554-F,O=!0;break}if(!O)throw new Error("Could not find head table with checkSum to adjust.");return v}const ng={make:Sa,fontToTable:tg,computeCheckSum:ws};function vs(n,e){let t=0,i=n.length-1;for(;t<=i;){const s=t+i>>>1,r=n[s].tag;if(r===e)return s;r<e?t=s+1:i=s-1}return-t-1}function Ma(n,e){let t=0,i=n.length-1;for(;t<=i;){const s=t+i>>>1,r=n[s];if(r===e)return s;r<e?t=s+1:i=s-1}return-t-1}function Da(n,e){let t,i=0,s=n.length-1;for(;i<=s;){const r=i+s>>>1;t=n[r];const a=t.start;if(a===e)return t;a<e?i=r+1:s=r-1}if(i>0)return t=n[i-1],e>t.end?0:t}function fn(n,e){this.font=n,this.tableName=e}fn.prototype={searchTag:vs,binSearch:Ma,getTable:function(n){let e=this.font.tables[this.tableName];return!e&&n&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){let n=this.getTable();return n?n.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){let n=this.getTable();if(!n)return;let e=!1;for(let t=0;t<n.scripts.length;t++){const i=n.scripts[t].tag;if(i==="DFLT")return i;i==="latn"&&(e=!0)}if(e)return"latn"},getScriptTable:function(n,e){const t=this.getTable(e);if(t){n=n||"DFLT";const i=t.scripts,s=vs(t.scripts,n);if(s>=0)return i[s].script;if(e){const r={tag:n,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return i.splice(-1-s,0,r),r.script}}},getLangSysTable:function(n,e,t){const i=this.getScriptTable(n,t);if(i){if(!e||e==="dflt"||e==="DFLT")return i.defaultLangSys;const s=vs(i.langSysRecords,e);if(s>=0)return i.langSysRecords[s].langSys;if(t){const r={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return i.langSysRecords.splice(-1-s,0,r),r.langSys}}},getFeatureTable:function(n,e,t,i){const s=this.getLangSysTable(n,e,i);if(s){let r;const a=s.featureIndexes,c=this.font.tables[this.tableName].features;for(let l=0;l<a.length;l++)if(r=c[a[l]],r.tag===t)return r.feature;if(i){const l=c.length;return ne.assert(l===0||t>=c[l-1].tag,"Features must be added in alphabetical order."),r={tag:t,feature:{params:0,lookupListIndexes:[]}},c.push(r),a.push(l),r.feature}}},getLookupTables:function(n,e,t,i,s){const r=this.getFeatureTable(n,e,t,s),a=[];if(r){let c;const l=r.lookupListIndexes,d=this.font.tables[this.tableName].lookups;for(let h=0;h<l.length;h++)c=d[l[h]],c.lookupType===i&&a.push(c);if(a.length===0&&s){c={lookupType:i,lookupFlag:0,subtables:[],markFilteringSet:void 0};const h=d.length;return d.push(c),l.push(h),[c]}}return a},getGlyphClass:function(n,e){switch(n.format){case 1:return n.startGlyph<=e&&e<n.startGlyph+n.classes.length?n.classes[e-n.startGlyph]:0;case 2:const t=Da(n.ranges,e);return t?t.classId:0}},getCoverageIndex:function(n,e){switch(n.format){case 1:const t=Ma(n.glyphs,e);return t>=0?t:-1;case 2:const i=Da(n.ranges,e);return i?i.index+e-i.start:-1}},expandCoverage:function(n){if(n.format===1)return n.glyphs;{const e=[],t=n.ranges;for(let i=0;i<t.length;i++){const s=t[i],r=s.start,a=s.end;for(let c=r;c<=a;c++)e.push(c)}return e}}};function pn(n){fn.call(this,n,"gpos")}pn.prototype=fn.prototype,pn.prototype.init=function(){const n=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(n)},pn.prototype.getKerningValue=function(n,e,t){for(let i=0;i<n.length;i++){const s=n[i].subtables;for(let r=0;r<s.length;r++){const a=s[r],c=this.getCoverageIndex(a.coverage,e);if(!(c<0))switch(a.posFormat){case 1:let l=a.pairSets[c];for(let p=0;p<l.length;p++){let u=l[p];if(u.secondGlyph===t)return u.value1&&u.value1.xAdvance||0}break;case 2:const d=this.getGlyphClass(a.classDef1,e),h=this.getGlyphClass(a.classDef2,t),f=a.classRecords[d][h];return f.value1&&f.value1.xAdvance||0}}}return 0},pn.prototype.getKerningTables=function(n,e){if(this.font.tables.gpos)return this.getLookupTables(n,e,"kern",2)};function We(n){fn.call(this,n,"gsub")}function ig(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function ka(n,e,t){const i=n.subtables;for(let s=0;s<i.length;s++){const r=i[s];if(r.substFormat===e)return r}if(t)return i.push(t),t}We.prototype=fn.prototype,We.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},We.prototype.getSingle=function(n,e,t){const i=[],s=this.getLookupTables(e,t,n,1);for(let r=0;r<s.length;r++){const a=s[r].subtables;for(let c=0;c<a.length;c++){const l=a[c],d=this.expandCoverage(l.coverage);let h;if(l.substFormat===1){const f=l.deltaGlyphId;for(h=0;h<d.length;h++){const p=d[h];i.push({sub:p,by:p+f})}}else{const f=l.substitute;for(h=0;h<d.length;h++)i.push({sub:d[h],by:f[h]})}}}return i},We.prototype.getAlternates=function(n,e,t){const i=[],s=this.getLookupTables(e,t,n,3);for(let r=0;r<s.length;r++){const a=s[r].subtables;for(let c=0;c<a.length;c++){const l=a[c],d=this.expandCoverage(l.coverage),h=l.alternateSets;for(let f=0;f<d.length;f++)i.push({sub:d[f],by:h[f]})}}return i},We.prototype.getLigatures=function(n,e,t){const i=[],s=this.getLookupTables(e,t,n,4);for(let r=0;r<s.length;r++){const a=s[r].subtables;for(let c=0;c<a.length;c++){const l=a[c],d=this.expandCoverage(l.coverage),h=l.ligatureSets;for(let f=0;f<d.length;f++){const p=d[f],u=h[f];for(let m=0;m<u.length;m++){const E=u[m];i.push({sub:[p].concat(E.components),by:E.ligGlyph})}}}}return i},We.prototype.addSingle=function(n,e,t,i){const s=this.getLookupTables(t,i,n,1,!0)[0],r=ka(s,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});ne.assert(r.coverage.format===1,"Ligature: unable to modify coverage table format "+r.coverage.format);const a=e.sub;let c=this.binSearch(r.coverage.glyphs,a);c<0&&(c=-1-c,r.coverage.glyphs.splice(c,0,a),r.substitute.splice(c,0,0)),r.substitute[c]=e.by},We.prototype.addAlternate=function(n,e,t,i){const s=this.getLookupTables(t,i,n,3,!0)[0],r=ka(s,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});ne.assert(r.coverage.format===1,"Ligature: unable to modify coverage table format "+r.coverage.format);const a=e.sub;let c=this.binSearch(r.coverage.glyphs,a);c<0&&(c=-1-c,r.coverage.glyphs.splice(c,0,a),r.alternateSets.splice(c,0,0)),r.alternateSets[c]=e.by},We.prototype.addLigature=function(n,e,t,i){const s=this.getLookupTables(t,i,n,4,!0)[0];let r=s.subtables[0];r||(r={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},s.subtables[0]=r),ne.assert(r.coverage.format===1,"Ligature: unable to modify coverage table format "+r.coverage.format);const a=e.sub[0],c=e.sub.slice(1),l={ligGlyph:e.by,components:c};let d=this.binSearch(r.coverage.glyphs,a);if(d>=0){const h=r.ligatureSets[d];for(let f=0;f<h.length;f++)if(ig(h[f].components,c))return;h.push(l)}else d=-1-d,r.coverage.glyphs.splice(d,0,a),r.ligatureSets.splice(d,0,[l])},We.prototype.getFeature=function(n,e,t){if(/ss\d\d/.test(n))return this.getSingle(n,e,t);switch(n){case"aalt":case"salt":return this.getSingle(n,e,t).concat(this.getAlternates(n,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(n,e,t)}},We.prototype.add=function(n,e,t,i){if(/ss\d\d/.test(n))return this.addSingle(n,e,t,i);switch(n){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(n,e,t,i):this.addAlternate(n,e,t,i);case"dlig":case"liga":case"rlig":return this.addLigature(n,e,t,i)}};function sg(){return typeof window<"u"}function og(n){const e=new ArrayBuffer(n.length),t=new Uint8Array(e);for(let i=0;i<n.length;++i)t[i]=n[i];return e}function rg(n){const e=new Buffer(n.byteLength),t=new Uint8Array(n);for(let i=0;i<e.length;++i)e[i]=t[i];return e}function $t(n,e){if(!n)throw e}function Pa(n,e,t,i,s){let r;return(e&i)>0?(r=n.parseByte(),(e&s)===0&&(r=-r),r=t+r):(e&s)>0?r=t:r=t+n.parseShort(),r}function ag(n,e,t){const i=new q.Parser(e,t);n.numberOfContours=i.parseShort(),n._xMin=i.parseShort(),n._yMin=i.parseShort(),n._xMax=i.parseShort(),n._yMax=i.parseShort();let s,r;if(n.numberOfContours>0){const a=n.endPointIndices=[];for(let l=0;l<n.numberOfContours;l+=1)a.push(i.parseUShort());n.instructionLength=i.parseUShort(),n.instructions=[];for(let l=0;l<n.instructionLength;l+=1)n.instructions.push(i.parseByte());const c=a[a.length-1]+1;s=[];for(let l=0;l<c;l+=1)if(r=i.parseByte(),s.push(r),(r&8)>0){const d=i.parseByte();for(let h=0;h<d;h+=1)s.push(r),l+=1}if(ne.argument(s.length===c,"Bad flags."),a.length>0){const l=[];let d;if(c>0){for(let p=0;p<c;p+=1)r=s[p],d={},d.onCurve=!!(r&1),d.lastPointOfContour=a.indexOf(p)>=0,l.push(d);let h=0;for(let p=0;p<c;p+=1)r=s[p],d=l[p],d.x=Pa(i,r,h,2,16),h=d.x;let f=0;for(let p=0;p<c;p+=1)r=s[p],d=l[p],d.y=Pa(i,r,f,4,32),f=d.y}n.points=l}else n.points=[]}else if(n.numberOfContours===0)n.points=[];else{n.isComposite=!0,n.points=[],n.components=[];let a=!0;for(;a;){s=i.parseUShort();const c={glyphIndex:i.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(s&1)>0?(s&2)>0?(c.dx=i.parseShort(),c.dy=i.parseShort()):c.matchedPoints=[i.parseUShort(),i.parseUShort()]:(s&2)>0?(c.dx=i.parseChar(),c.dy=i.parseChar()):c.matchedPoints=[i.parseByte(),i.parseByte()],(s&8)>0?c.xScale=c.yScale=i.parseF2Dot14():(s&64)>0?(c.xScale=i.parseF2Dot14(),c.yScale=i.parseF2Dot14()):(s&128)>0&&(c.xScale=i.parseF2Dot14(),c.scale01=i.parseF2Dot14(),c.scale10=i.parseF2Dot14(),c.yScale=i.parseF2Dot14()),n.components.push(c),a=!!(s&32)}if(s&256){n.instructionLength=i.parseUShort(),n.instructions=[];for(let c=0;c<n.instructionLength;c+=1)n.instructions.push(i.parseByte())}}}function Is(n,e){const t=[];for(let i=0;i<n.length;i+=1){const s=n[i],r={x:e.xScale*s.x+e.scale01*s.y+e.dx,y:e.scale10*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(r)}return t}function lg(n){const e=[];let t=[];for(let i=0;i<n.length;i+=1){const s=n[i];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return ne.argument(t.length===0,"There are still points left in the current contour."),e}function Na(n){const e=new Be;if(!n)return e;const t=lg(n);for(let i=0;i<t.length;++i){const s=t[i];let r=null,a=s[s.length-1],c=s[0];if(a.onCurve)e.moveTo(a.x,a.y);else if(c.onCurve)e.moveTo(c.x,c.y);else{const l={x:(a.x+c.x)*.5,y:(a.y+c.y)*.5};e.moveTo(l.x,l.y)}for(let l=0;l<s.length;++l)if(r=a,a=c,c=s[(l+1)%s.length],a.onCurve)e.lineTo(a.x,a.y);else{let d=c;r.onCurve||((a.x+r.x)*.5,(a.y+r.y)*.5),c.onCurve||(d={x:(a.x+c.x)*.5,y:(a.y+c.y)*.5}),e.quadraticCurveTo(a.x,a.y,d.x,d.y)}e.closePath()}return e}function cg(n,e){if(e.isComposite)for(let t=0;t<e.components.length;t+=1){const i=e.components[t],s=n.get(i.glyphIndex);if(s.getPath(),s.points){let r;if(i.matchedPoints===void 0)r=Is(s.points,i);else{if(i.matchedPoints[0]>e.points.length-1||i.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+e.name);const a=e.points[i.matchedPoints[0]];let c=s.points[i.matchedPoints[1]];const l={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};c=Is([c],l)[0],l.dx=a.x-c.x,l.dy=a.y-c.y,r=Is(s.points,l)}e.points=e.points.concat(r)}}return Na(e.points)}function dg(n,e,t,i){const s=new jt.GlyphSet(i);for(let r=0;r<t.length-1;r+=1){const a=t[r],c=t[r+1];a!==c?s.push(r,jt.ttfGlyphLoader(i,r,ag,n,e+a,cg)):s.push(r,jt.glyphLoader(i,r))}return s}const Fa={getPath:Na,parse:dg};let Ra,Mt,La,Bs;function Oa(n){this.font=n,this.getCommands=function(e){return Fa.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function ug(n){return n}function Ua(n){return Math.sign(n)*Math.round(Math.abs(n))}function hg(n){return Math.sign(n)*Math.round(Math.abs(n*2))/2}function fg(n){return Math.sign(n)*(Math.round(Math.abs(n)+.5)-.5)}function pg(n){return Math.sign(n)*Math.ceil(Math.abs(n))}function mg(n){return Math.sign(n)*Math.floor(Math.abs(n))}const _a=function(n){const e=this.srPeriod;let t=this.srPhase;const i=this.srThreshold;let s=1;return n<0&&(n=-n,s=-1),n+=i-t,n=Math.trunc(n/e)*e,n+=t,n<0?t*s:n*s},nt={x:1,y:0,axis:"x",distance:function(n,e,t,i){return(t?n.xo:n.x)-(i?e.xo:e.x)},interpolate:function(n,e,t,i){let s,r,a,c,l,d,h;if(!i||i===this){if(s=n.xo-e.xo,r=n.xo-t.xo,l=e.x-e.xo,d=t.x-t.xo,a=Math.abs(s),c=Math.abs(r),h=a+c,h===0){n.x=n.xo+(l+d)/2;return}n.x=n.xo+(l*c+d*a)/h;return}if(s=i.distance(n,e,!0,!0),r=i.distance(n,t,!0,!0),l=i.distance(e,e,!1,!0),d=i.distance(t,t,!1,!0),a=Math.abs(s),c=Math.abs(r),h=a+c,h===0){nt.setRelative(n,n,(l+d)/2,i,!0);return}nt.setRelative(n,n,(l*c+d*a)/h,i,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(n,e,t,i,s){if(!i||i===this){n.x=(s?e.xo:e.x)+t;return}const r=s?e.xo:e.x,a=s?e.yo:e.y,c=r+t*i.x,l=a+t*i.y;n.x=c+(n.y-l)/i.normalSlope},slope:0,touch:function(n){n.xTouched=!0},touched:function(n){return n.xTouched},untouch:function(n){n.xTouched=!1}},rt={x:0,y:1,axis:"y",distance:function(n,e,t,i){return(t?n.yo:n.y)-(i?e.yo:e.y)},interpolate:function(n,e,t,i){let s,r,a,c,l,d,h;if(!i||i===this){if(s=n.yo-e.yo,r=n.yo-t.yo,l=e.y-e.yo,d=t.y-t.yo,a=Math.abs(s),c=Math.abs(r),h=a+c,h===0){n.y=n.yo+(l+d)/2;return}n.y=n.yo+(l*c+d*a)/h;return}if(s=i.distance(n,e,!0,!0),r=i.distance(n,t,!0,!0),l=i.distance(e,e,!1,!0),d=i.distance(t,t,!1,!0),a=Math.abs(s),c=Math.abs(r),h=a+c,h===0){rt.setRelative(n,n,(l+d)/2,i,!0);return}rt.setRelative(n,n,(l*c+d*a)/h,i,!0)},normalSlope:0,setRelative:function(n,e,t,i,s){if(!i||i===this){n.y=(s?e.yo:e.y)+t;return}const r=s?e.xo:e.x,a=s?e.yo:e.y,c=r+t*i.x,l=a+t*i.y;n.y=l+i.normalSlope*(n.x-c)},slope:Number.POSITIVE_INFINITY,touch:function(n){n.yTouched=!0},touched:function(n){return n.yTouched},untouch:function(n){n.yTouched=!1}};Object.freeze(nt),Object.freeze(rt);function mn(n,e){this.x=n,this.y=e,this.axis=void 0,this.slope=e/n,this.normalSlope=-n/e,Object.freeze(this)}mn.prototype.distance=function(n,e,t,i){return this.x*nt.distance(n,e,t,i)+this.y*rt.distance(n,e,t,i)},mn.prototype.interpolate=function(n,e,t,i){let s,r,a,c,l,d,h;if(a=i.distance(n,e,!0,!0),c=i.distance(n,t,!0,!0),s=i.distance(e,e,!1,!0),r=i.distance(t,t,!1,!0),l=Math.abs(a),d=Math.abs(c),h=l+d,h===0){this.setRelative(n,n,(s+r)/2,i,!0);return}this.setRelative(n,n,(s*d+r*l)/h,i,!0)},mn.prototype.setRelative=function(n,e,t,i,s){i=i||this;const r=s?e.xo:e.x,a=s?e.yo:e.y,c=r+t*i.x,l=a+t*i.y,d=i.normalSlope,h=this.slope,f=n.x,p=n.y;n.x=(h*f-d*c+l-p)/(h-d),n.y=h*(n.x-f)+p},mn.prototype.touch=function(n){n.xTouched=!0,n.yTouched=!0};function gn(n,e){const t=Math.sqrt(n*n+e*e);return n/=t,e/=t,n===1&&e===0?nt:n===0&&e===1?rt:new mn(n,e)}function at(n,e,t,i){this.x=this.xo=Math.round(n*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=i,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}at.prototype.nextTouched=function(n){let e=this.nextPointOnContour;for(;!n.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},at.prototype.prevTouched=function(n){let e=this.prevPointOnContour;for(;!n.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};const An=Object.freeze(new at(0,0)),gg={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function gt(n,e){switch(this.env=n,this.stack=[],this.prog=e,n){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=nt,this.round=Ua}}Oa.prototype.exec=function(n,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;const t=this.font;let i=this._prepState;if(!i||i.ppem!==e){let s=this._fpgmState;if(!s){gt.prototype=gg,s=this._fpgmState=new gt("fpgm",t.tables.fpgm),s.funcs=[],s.font=t,Q.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{Mt(s)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}gt.prototype=s,i=this._prepState=new gt("prep",t.tables.prep),i.ppem=e;const r=t.tables.cvt;if(r){const a=i.cvt=new Array(r.length),c=e/t.unitsPerEm;for(let l=0;l<r.length;l++)a[l]=r[l]*c}else i.cvt=[];Q.DEBUG&&(console.log("---EXEC PREP---"),i.step=-1);try{Mt(i)}catch(a){this._errorState<2&&console.log("Hinting error in PREP:"+a),this._errorState=2}}if(!(this._errorState>1))try{return La(n,i)}catch(s){this._errorState<1&&(console.log("Hinting error:"+s),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}},La=function(n,e){const t=e.ppem/e.font.unitsPerEm,i=t;let s=n.components,r,a,c;if(gt.prototype=e,!s)c=new gt("glyf",n.instructions),Q.DEBUG&&(console.log("---EXEC GLYPH---"),c.step=-1),Bs(n,c,t,i),a=c.gZone;else{const l=e.font;a=[],r=[];for(let d=0;d<s.length;d++){const h=s[d],f=l.glyphs.get(h.glyphIndex);c=new gt("glyf",f.instructions),Q.DEBUG&&(console.log("---EXEC COMP "+d+"---"),c.step=-1),Bs(f,c,t,i);const p=Math.round(h.dx*t),u=Math.round(h.dy*i),m=c.gZone,E=c.contours;for(let b=0;b<m.length;b++){const w=m[b];w.xTouched=w.yTouched=!1,w.xo=w.x=w.x+p,w.yo=w.y=w.y+u}const A=a.length;a.push.apply(a,m);for(let b=0;b<E.length;b++)r.push(E[b]+A)}n.instructions&&!c.inhibitGridFit&&(c=new gt("glyf",n.instructions),c.gZone=c.z0=c.z1=c.z2=a,c.contours=r,a.push(new at(0,0),new at(Math.round(n.advanceWidth*t),0)),Q.DEBUG&&(console.log("---EXEC COMPOSITE---"),c.step=-1),Mt(c),a.length-=2)}return a},Bs=function(n,e,t,i){const s=n.points||[],r=s.length,a=e.gZone=e.z0=e.z1=e.z2=[],c=e.contours=[];let l;for(let f=0;f<r;f++)l=s[f],a[f]=new at(l.x*t,l.y*i,l.lastPointOfContour,l.onCurve);let d,h;for(let f=0;f<r;f++)l=a[f],d||(d=l,c.push(f)),l.lastPointOfContour?(l.nextPointOnContour=d,d.prevPointOnContour=l,d=void 0):(h=a[f+1],l.nextPointOnContour=h,h.prevPointOnContour=l);if(!e.inhibitGridFit){if(Q.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(let f=0;f<r;f++)console.log(f,a[f].x,a[f].y)}if(a.push(new at(0,0),new at(Math.round(n.advanceWidth*t),0)),Mt(e),a.length-=2,Q.DEBUG){console.log("FINISHED GLYPH",e.stack);for(let f=0;f<r;f++)console.log(f,a[f].x,a[f].y)}}},Mt=function(n){let e=n.prog;if(!e)return;const t=e.length;let i;for(n.ip=0;n.ip<t;n.ip++){if(Q.DEBUG&&n.step++,i=Ra[e[n.ip]],!i)throw new Error("unknown instruction: 0x"+Number(e[n.ip]).toString(16));i(n)}};function ai(n){const e=n.tZone=new Array(n.gZone.length);for(let t=0;t<e.length;t++)e[t]=new at(0,0)}function Qa(n,e){const t=n.prog;let i=n.ip,s=1,r;do if(r=t[++i],r===88)s++;else if(r===89)s--;else if(r===64)i+=t[i+1]+1;else if(r===65)i+=2*t[i+1]+1;else if(r>=176&&r<=183)i+=r-176+1;else if(r>=184&&r<=191)i+=(r-184+1)*2;else if(e&&s===1&&r===27)break;while(s>0);n.ip=i}function Va(n,e){Q.DEBUG&&console.log(e.step,"SVTCA["+n.axis+"]"),e.fv=e.pv=e.dpv=n}function Ga(n,e){Q.DEBUG&&console.log(e.step,"SPVTCA["+n.axis+"]"),e.pv=e.dpv=n}function Ha(n,e){Q.DEBUG&&console.log(e.step,"SFVTCA["+n.axis+"]"),e.fv=n}function Ya(n,e){const t=e.stack,i=t.pop(),s=t.pop(),r=e.z2[i],a=e.z1[s];Q.DEBUG&&console.log("SPVTL["+n+"]",i,s);let c,l;n?(c=r.y-a.y,l=a.x-r.x):(c=a.x-r.x,l=a.y-r.y),e.pv=e.dpv=gn(c,l)}function za(n,e){const t=e.stack,i=t.pop(),s=t.pop(),r=e.z2[i],a=e.z1[s];Q.DEBUG&&console.log("SFVTL["+n+"]",i,s);let c,l;n?(c=r.y-a.y,l=a.x-r.x):(c=a.x-r.x,l=a.y-r.y),e.fv=gn(c,l)}function Ag(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"SPVFS[]",t,i),n.pv=n.dpv=gn(i,t)}function yg(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"SPVFS[]",t,i),n.fv=gn(i,t)}function Cg(n){const e=n.stack,t=n.pv;Q.DEBUG&&console.log(n.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Eg(n){const e=n.stack,t=n.fv;Q.DEBUG&&console.log(n.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function bg(n){n.fv=n.pv,Q.DEBUG&&console.log(n.step,"SFVTPV[]")}function wg(n){const e=n.stack,t=e.pop(),i=e.pop(),s=e.pop(),r=e.pop(),a=e.pop(),c=n.z0,l=n.z1,d=c[t],h=c[i],f=l[s],p=l[r],u=n.z2[a];Q.DEBUG&&console.log("ISECT[], ",t,i,s,r,a);const m=d.x,E=d.y,A=h.x,b=h.y,w=f.x,I=f.y,D=p.x,N=p.y,S=(m-A)*(I-N)-(E-b)*(w-D),B=m*b-E*A,g=w*N-I*D;u.x=(B*(w-D)-g*(m-A))/S,u.y=(B*(I-N)-g*(E-b))/S}function vg(n){n.rp0=n.stack.pop(),Q.DEBUG&&console.log(n.step,"SRP0[]",n.rp0)}function Ig(n){n.rp1=n.stack.pop(),Q.DEBUG&&console.log(n.step,"SRP1[]",n.rp1)}function Bg(n){n.rp2=n.stack.pop(),Q.DEBUG&&console.log(n.step,"SRP2[]",n.rp2)}function xg(n){const e=n.stack.pop();switch(Q.DEBUG&&console.log(n.step,"SZP0[]",e),n.zp0=e,e){case 0:n.tZone||ai(n),n.z0=n.tZone;break;case 1:n.z0=n.gZone;break;default:throw new Error("Invalid zone pointer")}}function Sg(n){const e=n.stack.pop();switch(Q.DEBUG&&console.log(n.step,"SZP1[]",e),n.zp1=e,e){case 0:n.tZone||ai(n),n.z1=n.tZone;break;case 1:n.z1=n.gZone;break;default:throw new Error("Invalid zone pointer")}}function Tg(n){const e=n.stack.pop();switch(Q.DEBUG&&console.log(n.step,"SZP2[]",e),n.zp2=e,e){case 0:n.tZone||ai(n),n.z2=n.tZone;break;case 1:n.z2=n.gZone;break;default:throw new Error("Invalid zone pointer")}}function Mg(n){const e=n.stack.pop();switch(Q.DEBUG&&console.log(n.step,"SZPS[]",e),n.zp0=n.zp1=n.zp2=e,e){case 0:n.tZone||ai(n),n.z0=n.z1=n.z2=n.tZone;break;case 1:n.z0=n.z1=n.z2=n.gZone;break;default:throw new Error("Invalid zone pointer")}}function Dg(n){n.loop=n.stack.pop(),Q.DEBUG&&console.log(n.step,"SLOOP[]",n.loop)}function kg(n){Q.DEBUG&&console.log(n.step,"RTG[]"),n.round=Ua}function Pg(n){Q.DEBUG&&console.log(n.step,"RTHG[]"),n.round=fg}function Ng(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"SMD[]",e),n.minDis=e/64}function Fg(n){Q.DEBUG&&console.log(n.step,"ELSE[]"),Qa(n,!1)}function Rg(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"JMPR[]",e),n.ip+=e-1}function Lg(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"SCVTCI[]",e),n.cvCutIn=e/64}function Og(n){const e=n.stack;Q.DEBUG&&console.log(n.step,"DUP[]"),e.push(e[e.length-1])}function xs(n){Q.DEBUG&&console.log(n.step,"POP[]"),n.stack.pop()}function Ug(n){Q.DEBUG&&console.log(n.step,"CLEAR[]"),n.stack.length=0}function _g(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"SWAP[]"),e.push(t),e.push(i)}function Qg(n){const e=n.stack;Q.DEBUG&&console.log(n.step,"DEPTH[]"),e.push(e.length)}function Vg(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"LOOPCALL[]",t,i);const s=n.ip,r=n.prog;n.prog=n.funcs[t];for(let a=0;a<i;a++)Mt(n),Q.DEBUG&&console.log(++n.step,a+1<i?"next loopcall":"done loopcall",a);n.ip=s,n.prog=r}function Gg(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"CALL[]",e);const t=n.ip,i=n.prog;n.prog=n.funcs[e],Mt(n),n.ip=t,n.prog=i,Q.DEBUG&&console.log(++n.step,"returning from",e)}function Hg(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"CINDEX[]",t),e.push(e[e.length-t])}function Yg(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function zg(n){if(n.env!=="fpgm")throw new Error("FDEF not allowed here");const e=n.stack,t=n.prog;let i=n.ip;const s=e.pop(),r=i;for(Q.DEBUG&&console.log(n.step,"FDEF[]",s);t[++i]!==45;);n.ip=i,n.funcs[s]=t.slice(r+1,i)}function Wa(n,e){const t=e.stack.pop(),i=e.z0[t],s=e.fv,r=e.pv;Q.DEBUG&&console.log(e.step,"MDAP["+n+"]",t);let a=r.distance(i,An);n&&(a=e.round(a)),s.setRelative(i,An,a,r),s.touch(i),e.rp0=e.rp1=t}function ja(n,e){const t=e.z2,i=t.length-2;let s,r,a;Q.DEBUG&&console.log(e.step,"IUP["+n.axis+"]");for(let c=0;c<i;c++)s=t[c],!n.touched(s)&&(r=s.prevTouched(n),r!==s&&(a=s.nextTouched(n),r===a&&n.setRelative(s,s,n.distance(r,r,!1,!0),n,!0),n.interpolate(s,r,a,n)))}function Ka(n,e){const t=e.stack,i=n?e.rp1:e.rp2,s=(n?e.z0:e.z1)[i],r=e.fv,a=e.pv;let c=e.loop;const l=e.z2;for(;c--;){const d=t.pop(),h=l[d],f=a.distance(s,s,!1,!0);r.setRelative(h,h,f,a),r.touch(h),Q.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-c)+": ":"")+"SHP["+(n?"rp1":"rp2")+"]",d)}e.loop=1}function $a(n,e){const t=e.stack,i=n?e.rp1:e.rp2,s=(n?e.z0:e.z1)[i],r=e.fv,a=e.pv,c=t.pop(),l=e.z2[e.contours[c]];let d=l;Q.DEBUG&&console.log(e.step,"SHC["+n+"]",c);const h=a.distance(s,s,!1,!0);do d!==s&&r.setRelative(d,d,h,a),d=d.nextPointOnContour;while(d!==l)}function Xa(n,e){const t=e.stack,i=n?e.rp1:e.rp2,s=(n?e.z0:e.z1)[i],r=e.fv,a=e.pv,c=t.pop();Q.DEBUG&&console.log(e.step,"SHZ["+n+"]",c);let l;switch(c){case 0:l=e.tZone;break;case 1:l=e.gZone;break;default:throw new Error("Invalid zone")}let d;const h=a.distance(s,s,!1,!0),f=l.length-2;for(let p=0;p<f;p++)d=l[p],r.setRelative(d,d,h,a)}function Wg(n){const e=n.stack;let t=n.loop;const i=n.fv,s=e.pop()/64,r=n.z2;for(;t--;){const a=e.pop(),c=r[a];Q.DEBUG&&console.log(n.step,(n.loop>1?"loop "+(n.loop-t)+": ":"")+"SHPIX[]",a,s),i.setRelative(c,c,s),i.touch(c)}n.loop=1}function jg(n){const e=n.stack,t=n.rp1,i=n.rp2;let s=n.loop;const r=n.z0[t],a=n.z1[i],c=n.fv,l=n.dpv,d=n.z2;for(;s--;){const h=e.pop(),f=d[h];Q.DEBUG&&console.log(n.step,(n.loop>1?"loop "+(n.loop-s)+": ":"")+"IP[]",h,t,"<->",i),c.interpolate(f,r,a,l),c.touch(f)}n.loop=1}function qa(n,e){const t=e.stack,i=t.pop()/64,s=t.pop(),r=e.z1[s],a=e.z0[e.rp0],c=e.fv,l=e.pv;c.setRelative(r,a,i,l),c.touch(r),Q.DEBUG&&console.log(e.step,"MSIRP["+n+"]",i,s),e.rp1=e.rp0,e.rp2=s,n&&(e.rp0=s)}function Kg(n){const e=n.stack,t=n.rp0,i=n.z0[t];let s=n.loop;const r=n.fv,a=n.pv,c=n.z1;for(;s--;){const l=e.pop(),d=c[l];Q.DEBUG&&console.log(n.step,(n.loop>1?"loop "+(n.loop-s)+": ":"")+"ALIGNRP[]",l),r.setRelative(d,i,0,a),r.touch(d)}n.loop=1}function $g(n){Q.DEBUG&&console.log(n.step,"RTDG[]"),n.round=hg}function Ja(n,e){const t=e.stack,i=t.pop(),s=t.pop(),r=e.z0[s],a=e.fv,c=e.pv;let l=e.cvt[i];Q.DEBUG&&console.log(e.step,"MIAP["+n+"]",i,"(",l,")",s);let d=c.distance(r,An);n&&(Math.abs(d-l)<e.cvCutIn&&(d=l),d=e.round(d)),a.setRelative(r,An,d,c),e.zp0===0&&(r.xo=r.x,r.yo=r.y),a.touch(r),e.rp0=e.rp1=s}function Xg(n){const e=n.prog;let t=n.ip;const i=n.stack,s=e[++t];Q.DEBUG&&console.log(n.step,"NPUSHB[]",s);for(let r=0;r<s;r++)i.push(e[++t]);n.ip=t}function qg(n){let e=n.ip;const t=n.prog,i=n.stack,s=t[++e];Q.DEBUG&&console.log(n.step,"NPUSHW[]",s);for(let r=0;r<s;r++){let a=t[++e]<<8|t[++e];a&32768&&(a=-((a^65535)+1)),i.push(a)}n.ip=e}function Jg(n){const e=n.stack;let t=n.store;t||(t=n.store=[]);const i=e.pop(),s=e.pop();Q.DEBUG&&console.log(n.step,"WS",i,s),t[s]=i}function Zg(n){const e=n.stack,t=n.store,i=e.pop();Q.DEBUG&&console.log(n.step,"RS",i);const s=t&&t[i]||0;e.push(s)}function eA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"WCVTP",t,i),n.cvt[i]=t/64}function tA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"RCVT",t),e.push(n.cvt[t]*64)}function Za(n,e){const t=e.stack,i=t.pop(),s=e.z2[i];Q.DEBUG&&console.log(e.step,"GC["+n+"]",i),t.push(e.dpv.distance(s,An,n,!1)*64)}function el(n,e){const t=e.stack,i=t.pop(),s=t.pop(),r=e.z1[i],a=e.z0[s],c=e.dpv.distance(a,r,n,n);Q.DEBUG&&console.log(e.step,"MD["+n+"]",i,s,"->",c),e.stack.push(Math.round(c*64))}function nA(n){Q.DEBUG&&console.log(n.step,"MPPEM[]"),n.stack.push(n.ppem)}function iA(n){Q.DEBUG&&console.log(n.step,"FLIPON[]"),n.autoFlip=!0}function sA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"LT[]",t,i),e.push(i<t?1:0)}function oA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"LTEQ[]",t,i),e.push(i<=t?1:0)}function rA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"GT[]",t,i),e.push(i>t?1:0)}function aA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"GTEQ[]",t,i),e.push(i>=t?1:0)}function lA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"EQ[]",t,i),e.push(t===i?1:0)}function cA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"NEQ[]",t,i),e.push(t!==i?1:0)}function dA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function uA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function hA(n){let e=n.stack.pop();Q.DEBUG&&console.log(n.step,"IF[]",e),e||(Qa(n,!0),Q.DEBUG&&console.log(n.step,"EIF[]"))}function fA(n){Q.DEBUG&&console.log(n.step,"EIF[]")}function pA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"AND[]",t,i),e.push(t&&i?1:0)}function mA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"OR[]",t,i),e.push(t||i?1:0)}function gA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"NOT[]",t),e.push(t?0:1)}function Ss(n,e){const t=e.stack,i=t.pop(),s=e.fv,r=e.pv,a=e.ppem,c=e.deltaBase+(n-1)*16,l=e.deltaShift,d=e.z0;Q.DEBUG&&console.log(e.step,"DELTAP["+n+"]",i,t);for(let h=0;h<i;h++){const f=t.pop(),p=t.pop();if(c+((p&240)>>4)!==a)continue;let m=(p&15)-8;m>=0&&m++,Q.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",m*l);const E=d[f];s.setRelative(E,E,m*l,r)}}function AA(n){const t=n.stack.pop();Q.DEBUG&&console.log(n.step,"SDB[]",t),n.deltaBase=t}function yA(n){const t=n.stack.pop();Q.DEBUG&&console.log(n.step,"SDS[]",t),n.deltaShift=Math.pow(.5,t)}function CA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"ADD[]",t,i),e.push(i+t)}function EA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"SUB[]",t,i),e.push(i-t)}function bA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"DIV[]",t,i),e.push(i*64/t)}function wA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"MUL[]",t,i),e.push(i*t/64)}function vA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"ABS[]",t),e.push(Math.abs(t))}function IA(n){const e=n.stack;let t=e.pop();Q.DEBUG&&console.log(n.step,"NEG[]",t),e.push(-t)}function BA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function xA(n){const e=n.stack,t=e.pop();Q.DEBUG&&console.log(n.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function li(n,e){const t=e.stack,i=t.pop();Q.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(i/64)*64)}function SA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"WCVTF[]",t,i),n.cvt[i]=t*n.ppem/n.font.unitsPerEm}function Ts(n,e){const t=e.stack,i=t.pop(),s=e.ppem,r=e.deltaBase+(n-1)*16,a=e.deltaShift;Q.DEBUG&&console.log(e.step,"DELTAC["+n+"]",i,t);for(let c=0;c<i;c++){const l=t.pop(),d=t.pop();if(r+((d&240)>>4)!==s)continue;let f=(d&15)-8;f>=0&&f++;const p=f*a;Q.DEBUG&&console.log(e.step,"DELTACFIX",l,"by",p),e.cvt[l]+=p}}function TA(n){let e=n.stack.pop();Q.DEBUG&&console.log(n.step,"SROUND[]",e),n.round=_a;let t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(n.srPeriod=t,e&48){case 0:n.srPhase=0;break;case 16:n.srPhase=.25*t;break;case 32:n.srPhase=.5*t;break;case 48:n.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?n.srThreshold=0:n.srThreshold=(e/8-.5)*t}function MA(n){let e=n.stack.pop();Q.DEBUG&&console.log(n.step,"S45ROUND[]",e),n.round=_a;let t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(n.srPeriod=t,e&48){case 0:n.srPhase=0;break;case 16:n.srPhase=.25*t;break;case 32:n.srPhase=.5*t;break;case 48:n.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?n.srThreshold=0:n.srThreshold=(e/8-.5)*t}function DA(n){Q.DEBUG&&console.log(n.step,"ROFF[]"),n.round=ug}function kA(n){Q.DEBUG&&console.log(n.step,"RUTG[]"),n.round=pg}function PA(n){Q.DEBUG&&console.log(n.step,"RDTG[]"),n.round=mg}function NA(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"SCANCTRL[]",e)}function tl(n,e){const t=e.stack,i=t.pop(),s=t.pop(),r=e.z2[i],a=e.z1[s];Q.DEBUG&&console.log(e.step,"SDPVTL["+n+"]",i,s);let c,l;n?(c=r.y-a.y,l=a.x-r.x):(c=a.x-r.x,l=a.y-r.y),e.dpv=gn(c,l)}function FA(n){const e=n.stack,t=e.pop();let i=0;Q.DEBUG&&console.log(n.step,"GETINFO[]",t),t&1&&(i=35),t&32&&(i|=4096),e.push(i)}function RA(n){const e=n.stack,t=e.pop(),i=e.pop(),s=e.pop();Q.DEBUG&&console.log(n.step,"ROLL[]"),e.push(i),e.push(t),e.push(s)}function LA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"MAX[]",t,i),e.push(Math.max(i,t))}function OA(n){const e=n.stack,t=e.pop(),i=e.pop();Q.DEBUG&&console.log(n.step,"MIN[]",t,i),e.push(Math.min(i,t))}function UA(n){const e=n.stack.pop();Q.DEBUG&&console.log(n.step,"SCANTYPE[]",e)}function _A(n){const e=n.stack.pop();let t=n.stack.pop();switch(Q.DEBUG&&console.log(n.step,"INSTCTRL[]",e,t),e){case 1:n.inhibitGridFit=!!t;return;case 2:n.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function At(n,e){const t=e.stack,i=e.prog;let s=e.ip;Q.DEBUG&&console.log(e.step,"PUSHB["+n+"]");for(let r=0;r<n;r++)t.push(i[++s]);e.ip=s}function yt(n,e){let t=e.ip;const i=e.prog,s=e.stack;Q.DEBUG&&console.log(e.ip,"PUSHW["+n+"]");for(let r=0;r<n;r++){let a=i[++t]<<8|i[++t];a&32768&&(a=-((a^65535)+1)),s.push(a)}e.ip=t}function $(n,e,t,i,s,r){const a=r.stack,c=n&&a.pop(),l=a.pop(),d=r.rp0,h=r.z0[d],f=r.z1[l],p=r.minDis,u=r.fv,m=r.dpv;let E,A,b,w;A=E=m.distance(f,h,!0,!0),b=A>=0?1:-1,A=Math.abs(A),n&&(w=r.cvt[c],i&&Math.abs(A-w)<r.cvCutIn&&(A=w)),t&&A<p&&(A=p),i&&(A=r.round(A)),u.setRelative(f,h,b*A,m),u.touch(f),Q.DEBUG&&console.log(r.step,(n?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(i?"R":"_")+(s===0?"Gr":s===1?"Bl":s===2?"Wh":"")+"]",n?c+"("+r.cvt[c]+","+w+")":"",l,"(d =",E,"->",b*A,")"),r.rp1=r.rp0,r.rp2=l,e&&(r.rp0=l)}Ra=[Va.bind(void 0,rt),Va.bind(void 0,nt),Ga.bind(void 0,rt),Ga.bind(void 0,nt),Ha.bind(void 0,rt),Ha.bind(void 0,nt),Ya.bind(void 0,0),Ya.bind(void 0,1),za.bind(void 0,0),za.bind(void 0,1),Ag,yg,Cg,Eg,bg,wg,vg,Ig,Bg,xg,Sg,Tg,Mg,Dg,kg,Pg,Ng,Fg,Rg,Lg,void 0,void 0,Og,xs,Ug,_g,Qg,Hg,Yg,void 0,void 0,void 0,Vg,Gg,zg,void 0,Wa.bind(void 0,0),Wa.bind(void 0,1),ja.bind(void 0,rt),ja.bind(void 0,nt),Ka.bind(void 0,0),Ka.bind(void 0,1),$a.bind(void 0,0),$a.bind(void 0,1),Xa.bind(void 0,0),Xa.bind(void 0,1),Wg,jg,qa.bind(void 0,0),qa.bind(void 0,1),Kg,$g,Ja.bind(void 0,0),Ja.bind(void 0,1),Xg,qg,Jg,Zg,eA,tA,Za.bind(void 0,0),Za.bind(void 0,1),void 0,el.bind(void 0,0),el.bind(void 0,1),nA,void 0,iA,void 0,void 0,sA,oA,rA,aA,lA,cA,dA,uA,hA,fA,pA,mA,gA,Ss.bind(void 0,1),AA,yA,CA,EA,bA,wA,vA,IA,BA,xA,li.bind(void 0,0),li.bind(void 0,1),li.bind(void 0,2),li.bind(void 0,3),void 0,void 0,void 0,void 0,SA,Ss.bind(void 0,2),Ss.bind(void 0,3),Ts.bind(void 0,1),Ts.bind(void 0,2),Ts.bind(void 0,3),TA,MA,void 0,void 0,DA,void 0,kA,PA,xs,xs,void 0,void 0,void 0,void 0,void 0,NA,tl.bind(void 0,0),tl.bind(void 0,1),FA,void 0,RA,LA,OA,UA,_A,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,At.bind(void 0,1),At.bind(void 0,2),At.bind(void 0,3),At.bind(void 0,4),At.bind(void 0,5),At.bind(void 0,6),At.bind(void 0,7),At.bind(void 0,8),yt.bind(void 0,1),yt.bind(void 0,2),yt.bind(void 0,3),yt.bind(void 0,4),yt.bind(void 0,5),yt.bind(void 0,6),yt.bind(void 0,7),yt.bind(void 0,8),$.bind(void 0,0,0,0,0,0),$.bind(void 0,0,0,0,0,1),$.bind(void 0,0,0,0,0,2),$.bind(void 0,0,0,0,0,3),$.bind(void 0,0,0,0,1,0),$.bind(void 0,0,0,0,1,1),$.bind(void 0,0,0,0,1,2),$.bind(void 0,0,0,0,1,3),$.bind(void 0,0,0,1,0,0),$.bind(void 0,0,0,1,0,1),$.bind(void 0,0,0,1,0,2),$.bind(void 0,0,0,1,0,3),$.bind(void 0,0,0,1,1,0),$.bind(void 0,0,0,1,1,1),$.bind(void 0,0,0,1,1,2),$.bind(void 0,0,0,1,1,3),$.bind(void 0,0,1,0,0,0),$.bind(void 0,0,1,0,0,1),$.bind(void 0,0,1,0,0,2),$.bind(void 0,0,1,0,0,3),$.bind(void 0,0,1,0,1,0),$.bind(void 0,0,1,0,1,1),$.bind(void 0,0,1,0,1,2),$.bind(void 0,0,1,0,1,3),$.bind(void 0,0,1,1,0,0),$.bind(void 0,0,1,1,0,1),$.bind(void 0,0,1,1,0,2),$.bind(void 0,0,1,1,0,3),$.bind(void 0,0,1,1,1,0),$.bind(void 0,0,1,1,1,1),$.bind(void 0,0,1,1,1,2),$.bind(void 0,0,1,1,1,3),$.bind(void 0,1,0,0,0,0),$.bind(void 0,1,0,0,0,1),$.bind(void 0,1,0,0,0,2),$.bind(void 0,1,0,0,0,3),$.bind(void 0,1,0,0,1,0),$.bind(void 0,1,0,0,1,1),$.bind(void 0,1,0,0,1,2),$.bind(void 0,1,0,0,1,3),$.bind(void 0,1,0,1,0,0),$.bind(void 0,1,0,1,0,1),$.bind(void 0,1,0,1,0,2),$.bind(void 0,1,0,1,0,3),$.bind(void 0,1,0,1,1,0),$.bind(void 0,1,0,1,1,1),$.bind(void 0,1,0,1,1,2),$.bind(void 0,1,0,1,1,3),$.bind(void 0,1,1,0,0,0),$.bind(void 0,1,1,0,0,1),$.bind(void 0,1,1,0,0,2),$.bind(void 0,1,1,0,0,3),$.bind(void 0,1,1,0,1,0),$.bind(void 0,1,1,0,1,1),$.bind(void 0,1,1,0,1,2),$.bind(void 0,1,1,0,1,3),$.bind(void 0,1,1,1,0,0),$.bind(void 0,1,1,1,0,1),$.bind(void 0,1,1,1,0,2),$.bind(void 0,1,1,1,0,3),$.bind(void 0,1,1,1,1,0),$.bind(void 0,1,1,1,1,1),$.bind(void 0,1,1,1,1,2),$.bind(void 0,1,1,1,1,3)];const QA=Array.from||(n=>n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[]);function le(n){n=n||{},n.empty||($t(n.familyName,"When creating a new Font object, familyName is required."),$t(n.styleName,"When creating a new Font object, styleName is required."),$t(n.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),$t(n.ascender,"When creating a new Font object, ascender is required."),$t(n.descender,"When creating a new Font object, descender is required."),$t(n.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:n.familyName||" "},fontSubfamily:{en:n.styleName||" "},fullName:{en:n.fullName||n.familyName+" "+n.styleName},postScriptName:{en:n.postScriptName||(n.familyName+n.styleName).replace(/\s/g,"")},designer:{en:n.designer||" "},designerURL:{en:n.designerURL||" "},manufacturer:{en:n.manufacturer||" "},manufacturerURL:{en:n.manufacturerURL||" "},license:{en:n.license||" "},licenseURL:{en:n.licenseURL||" "},version:{en:n.version||"Version 0.1"},description:{en:n.description||" "},copyright:{en:n.copyright||" "},trademark:{en:n.trademark||" "}},this.unitsPerEm=n.unitsPerEm||1e3,this.ascender=n.ascender,this.descender=n.descender,this.createdTimestamp=n.createdTimestamp,this.tables={os2:{usWeightClass:n.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:n.widthClass||this.usWidthClasses.MEDIUM,fsSelection:n.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new jt.GlyphSet(this,n.glyphs||[]),this.encoding=new Xr(this),this.position=new pn(this),this.substitution=new We(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new Oa(this)}})}le.prototype.hasChar=function(n){return this.encoding.charToGlyphIndex(n)!==null},le.prototype.charToGlyphIndex=function(n){return this.encoding.charToGlyphIndex(n)},le.prototype.charToGlyph=function(n){const e=this.charToGlyphIndex(n);let t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},le.prototype.stringToGlyphs=function(n,e){e=e||this.defaultRenderOptions;const t=QA(n),i=[];for(let c=0;c<t.length;c+=1){const l=t[c];i.push(this.charToGlyphIndex(l))}let s=i.length;if(e.features){const c=e.script||this.substitution.getDefaultScriptName();let l=[];e.features.liga&&(l=l.concat(this.substitution.getFeature("liga",c,e.language))),e.features.rlig&&(l=l.concat(this.substitution.getFeature("rlig",c,e.language)));for(let d=0;d<s;d+=1)for(let h=0;h<l.length;h++){const f=l[h],p=f.sub,u=p.length;let m=0;for(;m<u&&p[m]===i[d+m];)m++;m===u&&(i.splice(d,u,f.by),s=s-u+1)}}const r=new Array(s),a=this.glyphs.get(0);for(let c=0;c<s;c+=1)r[c]=this.glyphs.get(i[c])||a;return r},le.prototype.nameToGlyphIndex=function(n){return this.glyphNames.nameToGlyphIndex(n)},le.prototype.nameToGlyph=function(n){const e=this.nameToGlyphIndex(n);let t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},le.prototype.glyphIndexToName=function(n){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(n):""},le.prototype.getKerningValue=function(n,e){n=n.index||n,e=e.index||e;const t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,n,e):this.kerningPairs[n+","+e]||0},le.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},le.prototype.forEachGlyph=function(n,e,t,i,s,r){e=e!==void 0?e:0,t=t!==void 0?t:0,i=i!==void 0?i:72,s=s||this.defaultRenderOptions;const a=1/this.unitsPerEm*i,c=this.stringToGlyphs(n,s);let l;if(s.kerning){const d=s.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(d,s.language)}for(let d=0;d<c.length;d+=1){const h=c[d];if(r.call(this,h,e,t,i,s),h.advanceWidth&&(e+=h.advanceWidth*a),s.kerning&&d<c.length-1){const f=l?this.position.getKerningValue(l,h.index,c[d+1].index):this.getKerningValue(h,c[d+1]);e+=f*a}s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e},le.prototype.getPath=function(n,e,t,i,s){const r=new Be;return this.forEachGlyph(n,e,t,i,s,function(a,c,l,d){const h=a.getPath(c,l,d,s,this);r.extend(h)}),r},le.prototype.getPaths=function(n,e,t,i,s){const r=[];return this.forEachGlyph(n,e,t,i,s,function(a,c,l,d){const h=a.getPath(c,l,d,s,this);r.push(h)}),r},le.prototype.getAdvanceWidth=function(n,e,t){return this.forEachGlyph(n,0,0,e,t,function(){})},le.prototype.draw=function(n,e,t,i,s,r){this.getPath(e,t,i,s,r).draw(n)},le.prototype.drawPoints=function(n,e,t,i,s,r){this.forEachGlyph(e,t,i,s,r,function(a,c,l,d){a.drawPoints(n,c,l,d)})},le.prototype.drawMetrics=function(n,e,t,i,s,r){this.forEachGlyph(e,t,i,s,r,function(a,c,l,d){a.drawMetrics(n,c,l,d)})},le.prototype.getEnglishName=function(n){const e=this.names[n];if(e)return e.en},le.prototype.validate=function(){const n=this;function e(i,s){}function t(i){const s=n.getEnglishName(i);s&&s.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0},le.prototype.toTables=function(){return ng.fontToTable(this)},le.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},le.prototype.toArrayBuffer=function(){const e=this.toTables().encode(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let s=0;s<e.length;s++)i[s]=e[s];return t},le.prototype.download=function(n){const e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");n=n||e.replace(/\s/g,"")+"-"+t+".otf";const i=this.toArrayBuffer();if(sg())if(window.URL=window.URL||window.webkitURL,window.URL){const s=new DataView(i),r=new Blob([s],{type:"font/opentype"});let a=document.createElement("a");a.href=window.URL.createObjectURL(r),a.download=n;let c=document.createEvent("MouseEvents");c.initEvent("click",!0,!1),a.dispatchEvent(c)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{const s=require("fs"),r=rg(i);s.writeFileSync(n,r)}},le.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},le.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},le.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function nl(n,e){const t=JSON.stringify(n);let i=256;for(let s in e){let r=parseInt(s);if(!(!r||r<256)){if(JSON.stringify(e[s])===t)return r;i<=r&&(i=r+1)}}return e[i]=n,i}function VA(n,e,t){const i=nl(e.name,t);return[{name:"tag_"+n,type:"TAG",value:e.tag},{name:"minValue_"+n,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+n,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+n,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+n,type:"USHORT",value:0},{name:"nameID_"+n,type:"USHORT",value:i}]}function GA(n,e,t){const i={},s=new q.Parser(n,e);return i.tag=s.parseTag(),i.minValue=s.parseFixed(),i.defaultValue=s.parseFixed(),i.maxValue=s.parseFixed(),s.skip("uShort",1),i.name=t[s.parseUShort()]||{},i}function HA(n,e,t,i){const s=nl(e.name,i),r=[{name:"nameID_"+n,type:"USHORT",value:s},{name:"flags_"+n,type:"USHORT",value:0}];for(let a=0;a<t.length;++a){const c=t[a].tag;r.push({name:"axis_"+n+" "+c,type:"FIXED",value:e.coordinates[c]<<16})}return r}function YA(n,e,t,i){const s={},r=new q.Parser(n,e);s.name=i[r.parseUShort()]||{},r.skip("uShort",1),s.coordinates={};for(let a=0;a<t.length;++a)s.coordinates[t[a].tag]=r.parseFixed();return s}function zA(n,e){const t=new ee.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:n.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:n.instances.length},{name:"instanceSize",type:"USHORT",value:4+n.axes.length*4}]);t.offsetToData=t.sizeOf();for(let i=0;i<n.axes.length;i++)t.fields=t.fields.concat(VA(i,n.axes[i],e));for(let i=0;i<n.instances.length;i++)t.fields=t.fields.concat(HA(i,n.instances[i],n.axes,e));return t}function WA(n,e,t){const i=new q.Parser(n,e),s=i.parseULong();ne.argument(s===65536,"Unsupported fvar table version.");const r=i.parseOffset16();i.skip("uShort",1);const a=i.parseUShort(),c=i.parseUShort(),l=i.parseUShort(),d=i.parseUShort(),h=[];for(let u=0;u<a;u++)h.push(GA(n,e+r+u*c,t));const f=[],p=e+r+a*c;for(let u=0;u<l;u++)f.push(YA(n,p+u*d,h,t));return{axes:h,instances:f}}const jA={make:zA,parse:WA},je=new Array(10);je[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(G.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(G.coverage),values:this.parseValueRecordList()};ne.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},je[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();ne.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");const i=this.parsePointer(G.coverage),s=this.parseUShort(),r=this.parseUShort();if(t===1)return{posFormat:t,coverage:i,valueFormat1:s,valueFormat2:r,pairSets:this.parseList(G.pointer(G.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}})))};if(t===2){const a=this.parsePointer(G.classDef),c=this.parsePointer(G.classDef),l=this.parseUShort(),d=this.parseUShort();return{posFormat:t,coverage:i,valueFormat1:s,valueFormat2:r,classDef1:a,classDef2:c,class1Count:l,class2Count:d,classRecords:this.parseList(l,G.list(d,function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(r)}}))}}},je[3]=function(){return{error:"GPOS Lookup 3 not supported"}},je[4]=function(){return{error:"GPOS Lookup 4 not supported"}},je[5]=function(){return{error:"GPOS Lookup 5 not supported"}},je[6]=function(){return{error:"GPOS Lookup 6 not supported"}},je[7]=function(){return{error:"GPOS Lookup 7 not supported"}},je[8]=function(){return{error:"GPOS Lookup 8 not supported"}},je[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function KA(n,e){e=e||0;const t=new G(n,e),i=t.parseVersion(1);return ne.argument(i===1||i===1.1,"Unsupported GPOS table version "+i),i===1?{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(je)}:{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(je),variations:t.parseFeatureVariationsList()}}const $A=new Array(10);function XA(n){return new ee.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ee.ScriptList(n.scripts)},{name:"features",type:"TABLE",value:new ee.FeatureList(n.features)},{name:"lookups",type:"TABLE",value:new ee.LookupList(n.lookups,$A)}])}const qA={parse:KA,make:XA};function JA(n){const e={};n.skip("uShort");const t=n.parseUShort();ne.argument(t===0,"Unsupported kern sub-table version."),n.skip("uShort",2);const i=n.parseUShort();n.skip("uShort",3);for(let s=0;s<i;s+=1){const r=n.parseUShort(),a=n.parseUShort(),c=n.parseShort();e[r+","+a]=c}return e}function ZA(n){const e={};n.skip("uShort"),n.parseULong()>1&&console.warn("Only the first kern subtable is supported."),n.skip("uLong");const s=n.parseUShort()&255;if(n.skip("uShort"),s===0){const r=n.parseUShort();n.skip("uShort",3);for(let a=0;a<r;a+=1){const c=n.parseUShort(),l=n.parseUShort(),d=n.parseShort();e[c+","+l]=d}}return e}function ey(n,e){const t=new q.Parser(n,e),i=t.parseUShort();if(i===0)return JA(t);if(i===1)return ZA(t);throw new Error("Unsupported kern table version ("+i+").")}const ty={parse:ey};function ny(n,e,t,i){const s=new q.Parser(n,e),r=i?s.parseUShort:s.parseULong,a=[];for(let c=0;c<t+1;c+=1){let l=r.call(s);i&&(l*=2),a.push(l)}return a}const iy={parse:ny};function sy(n,e){require("fs").readFile(n,function(i,s){if(i)return e(i.message);e(null,og(s))})}function oy(n,e){const t=new XMLHttpRequest;t.open("get",n,!0),t.responseType="arraybuffer",t.onload=function(){return t.response?e(null,t.response):e("Font could not be loaded: "+t.statusText)},t.onerror=function(){e("Font could not be loaded")},t.send()}function il(n,e){const t=[];let i=12;for(let s=0;s<e;s+=1){const r=q.getTag(n,i),a=q.getULong(n,i+4),c=q.getULong(n,i+8),l=q.getULong(n,i+12);t.push({tag:r,checksum:a,offset:c,length:l,compression:!1}),i+=16}return t}function ry(n,e){const t=[];let i=44;for(let s=0;s<e;s+=1){const r=q.getTag(n,i),a=q.getULong(n,i+4),c=q.getULong(n,i+8),l=q.getULong(n,i+12);let d;c<l?d="WOFF":d=!1,t.push({tag:r,offset:a,compression:d,compressedLength:c,length:l}),i+=20}return t}function we(n,e){if(e.compression==="WOFF"){const t=new Uint8Array(n.buffer,e.offset+2,e.compressedLength-2),i=new Uint8Array(e.length);if(Up(t,i),i.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(i.buffer,0),offset:0}}else return{data:n,offset:e.offset}}function ay(n){let e,t;const i=new le({empty:!0}),s=new DataView(n,0);let r,a=[];const c=q.getTag(s,0);if(c==="\0\0\0"||c==="true"||c==="typ1")i.outlinesFormat="truetype",r=q.getUShort(s,4),a=il(s,r);else if(c==="OTTO")i.outlinesFormat="cff",r=q.getUShort(s,4),a=il(s,r);else if(c==="wOFF"){const N=q.getTag(s,4);if(N==="\0\0\0")i.outlinesFormat="truetype";else if(N==="OTTO")i.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+c);r=q.getUShort(s,12),a=ry(s,r)}else throw new Error("Unsupported OpenType signature "+c);let l,d,h,f,p,u,m,E,A,b,w;for(let N=0;N<r;N+=1){const S=a[N];let B;switch(S.tag){case"cmap":B=we(s,S),i.tables.cmap=$r.parse(B.data,B.offset),i.encoding=new qr(i.tables.cmap);break;case"cvt ":B=we(s,S),w=new q.Parser(B.data,B.offset),i.tables.cvt=w.parseShortList(S.length/2);break;case"fvar":d=S;break;case"fpgm":B=we(s,S),w=new q.Parser(B.data,B.offset),i.tables.fpgm=w.parseByteList(S.length);break;case"head":B=we(s,S),i.tables.head=da.parse(B.data,B.offset),i.unitsPerEm=i.tables.head.unitsPerEm,e=i.tables.head.indexToLocFormat;break;case"hhea":B=we(s,S),i.tables.hhea=ua.parse(B.data,B.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case"hmtx":u=S;break;case"ltag":B=we(s,S),t=fa.parse(B.data,B.offset);break;case"maxp":B=we(s,S),i.tables.maxp=pa.parse(B.data,B.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case"name":A=S;break;case"OS/2":B=we(s,S),i.tables.os2=bs.parse(B.data,B.offset);break;case"post":B=we(s,S),i.tables.post=wa.parse(B.data,B.offset),i.glyphNames=new ms(i.tables.post);break;case"prep":B=we(s,S),w=new q.Parser(B.data,B.offset),i.tables.prep=w.parseByteList(S.length);break;case"glyf":h=S;break;case"loca":E=S;break;case"CFF ":l=S;break;case"kern":m=S;break;case"GPOS":f=S;break;case"GSUB":p=S;break;case"meta":b=S;break}}const I=we(s,A);if(i.tables.name=ba.parse(I.data,I.offset,t),i.names=i.tables.name,h&&E){const N=e===0,S=we(s,E),B=iy.parse(S.data,S.offset,i.numGlyphs,N),g=we(s,h);i.glyphs=Fa.parse(g.data,g.offset,B,i)}else if(l){const N=we(s,l);ca.parse(N.data,N.offset,i)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");const D=we(s,u);if(ha.parse(D.data,D.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs),im(i),m){const N=we(s,m);i.kerningPairs=ty.parse(N.data,N.offset)}else i.kerningPairs={};if(f){const N=we(s,f);i.tables.gpos=qA.parse(N.data,N.offset),i.position.init()}if(p){const N=we(s,p);i.tables.gsub=va.parse(N.data,N.offset)}if(d){const N=we(s,d);i.tables.fvar=jA.parse(N.data,N.offset,i.names)}if(b){const N=we(s,b);i.tables.meta=Ia.parse(N.data,N.offset),i.metas=i.tables.meta}return i}function ly(n,e){(typeof window>"u"?sy:oy)(n,function(s,r){if(s)return e(s);let a;try{a=ay(r)}catch(c){return e(c,null)}return e(null,a)})}const Ms=1e-12;function yn(n){if(!Array.isArray(n)||n.length===0)return n||[];const e=n[0],t=n[n.length-1];if(!e||!t||e.length<2||t.length<2)return n;const i=e[0]??0,s=e[1]??0,r=t[0]??0,a=t[1]??0;return(Math.abs(i-r)>Ms||Math.abs(s-a)>Ms)&&n.push([i,s]),n}function Dt(n){let e=0;if(!n)return 0;for(let t=0;t<n.length-1;t++){const i=n[t],s=n[t+1];if(!i||!s)continue;const r=i[0]??0,a=i[1]??0,c=s[0]??0,l=s[1]??0;e+=r*l-c*a}return e/2}function ci(n,e=Ms){const t=[];if(!n)return t;for(const i of n){if(!i||i.length<2)continue;const s=t[t.length-1],r=i[0]??0,a=i[1]??0;if(!s){t.push([r,a]);continue}const c=s[0]??0,l=s[1]??0;(Math.abs(r-c)>e||Math.abs(a-l)>e)&&t.push([r,a])}return t}function cy(n,e,t,i,s=16){const r=[],a=n?.[0]??0,c=n?.[1]??0,l=t?.[0]??0,d=t?.[1]??0,h=i?.[0]??0,f=i?.[1]??0,p=e?.[0]??0,u=e?.[1]??0;for(let m=0;m<=s;m++){const E=m/s,A=1-E,b=A*A*A*a+3*A*A*E*l+3*A*E*E*h+E*E*E*p,w=A*A*A*c+3*A*A*E*d+3*A*E*E*f+E*E*E*u;r.push([b,w])}return r}function sl(n,e){if(!n||!e)return!1;const t=n[0]??0,i=n[1]??0;let s=!1;for(let r=0,a=e.length-1;r<e.length;a=r++){const c=e[r],l=e[a];if(!c||!l)continue;const d=c[0]??0,h=c[1]??0,f=l[0]??0,p=l[1]??0;h>i!=p>i&&t<(f-d)*(i-h)/(p-h+0)+d&&(s=!s)}return s}function Ds(n){return n?(Dt(n)<0&&n.reverse(),yn(n),n):[]}function dy(n){return n?(Dt(n)>0&&n.reverse(),yn(n),n):[]}function ol(n,e=16){if(!n||!Array.isArray(n.commands))return[];const t=[];let i=[];for(const s of n.commands){let r=function(c){const l=c.x!==void 0?c.x:0,d=c.y!==void 0?-c.y:0;return[l,d]};const a=s.type;if(a==="M")i.length&&t.push(ci(i)),i=[r(s)];else if(a==="L")i.push(r(s));else if(a==="Q"){const l=i[i.length-1]||r(s),d=[],h=s.x??0,f=s.y??0,p=s.x1??0,u=s.y1??0,m=l[0]??0,E=l[1]??0;for(let A=1;A<=e;A++){const b=A/e,w=1-b,I=w*w*m+2*w*b*p+b*b*h,D=w*w*E+2*w*b*u+b*b*-f;d.push([I,D])}d.length?i.push(...d):i.push(r(s))}else if(a==="C"){const l=i[i.length-1]||r(s),d=[s.x1||0,-(s.y1||0)],h=[s.x2||0,-(s.y2||0)],f=[s.x||0,-(s.y||0)],p=cy(l,f,d,h,e);p.length>1?i.push(...p.slice(1)):i.push(f)}else a==="Z"||a==="z"?(i.length&&t.push(ci(i)),i=[]):s.x!==void 0&&s.y!==void 0&&i.push(r(s))}return i.length&&t.push(ci(i)),t.map(s=>yn(s)).filter(s=>s&&s.length>=4)}function ks(n,e){if(!n)return null;const t=n.map(i=>yn(i.slice()));return{type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:{...e.properties||{},rings:t.length,polygons:1}}}function uy(n,e,t={}){t=Object.assign({sampleSegments:16,simplifyTolerance:0,epsArea:1e-24,debug:!1,scale:1,widthScale:.6,fillWinding:"auto"},t||{scale:1});const i=!!t.debug;if(!n||!n.geometry||!Array.isArray(n.geometry.coordinates))return{type:"FeatureCollection",features:[]};const s=n.geometry.coordinates,r=n.properties||{},a=r.text||r.label||"",c=r.rotation??0,l=t.sampleSegments||16,d=t.epsArea||1e-24,f=r.height/.9||1,p=(t.scale||1)*f,u=-c*Math.PI/180,m=Math.cos(u),E=Math.sin(u),A=r.attachmentPoint||"bottom-left",b=[];if(!e||typeof e.getPaths!="function")return{type:"FeatureCollection",features:b};const w=e.getPaths(a,0,0,t.fontSize||1)||[];let I=[];for(const L of w){const V=ol(L,l);for(const k of V)if(k)for(const C of k)C&&I.push(C)}let D=1/0,N=1/0,S=-1/0,B=-1/0;for(const L of I){if(!L)continue;const V=L[0]??0,k=L[1]??0;D=Math.min(D,V),N=Math.min(N,k),S=Math.max(S,V),B=Math.max(B,k)}const g=S-D,R=B-N;let x=0,M=0;switch(A){case"top-left":x=0,M=-R;break;case"top-center":x=-g/2,M=R;break;case"top-right":x=-g,M=R;break;case"center-left":x=0,M=R/2;break;case"center":x=-g/2,M=R/2;break;case"center-right":x=-g,M=R/2;break;case"bottom-left":x=0,M=0;break;case"bottom-center":x=-g/2,M=0;break;case"bottom-right":x=-g,M=0;break;default:x=0,M=0}for(const L of w){const V=ol(L,l);if(!V||V.length===0)continue;const k=V.map(F=>{if(!F)return[];const U=F.map(O=>{if(!O)return[0,0];let T=(O[0]??0)+x,_=(O[1]??0)+M;T=T*(t.widthScale||.6);const H=T*m-_*E,j=T*E+_*m;return[s[0]+H*p,s[1]+j*p]});return yn(ci(U))}).filter(F=>F&&F.length>=4&&Math.abs(Dt(F))>d);if(k.length===0)continue;let C=1;if(t.fillWinding==="positive")C=1;else if(t.fillWinding==="negative")C=-1;else{let F=0,U=-1;for(let _=0;_<k.length;_++){const H=k[_];if(!H)continue;const j=Dt(H);Math.abs(j)>U&&(U=Math.abs(j),F=_)}const O=k[F],T=O?Dt(O):0;C=T>=0?1:-1,i&&console.log("[simple] auto fillSign=",C,"largest signed area=",T)}const y=k.map((F,U)=>({idx:U,ring:F,signedArea:Dt(F),absArea:Math.abs(Dt(F))}));for(const F of y)F.isFilled=F.signedArea*C>0,i&&console.log("[simple] ring",F.idx,"signedArea=",F.signedArea.toExponential(),"isFilled=",F.isFilled);const v=y.filter(F=>F.isFilled).sort((F,U)=>F.absArea-U.absArea),P=y.filter(F=>!F.isFilled).sort((F,U)=>U.absArea-F.absArea);for(const F of v)F.holes=[];for(const F of P){const U=(function(T){let _=0,H=0;if(!T||T.length===0)return[0,0];for(const j of T)j&&(_+=j[0]??0,H+=j[1]??0);return[_/T.length,H/T.length]})(F.ring);let O=null;for(const T of v)sl(U,T.ring)&&(O===null||T.absArea<O.absArea&&T.idx<F.idx||T.absArea>O.absArea&&T.idx<F.idx&&P.length==1)&&(O=T);if(O){if(O.absArea<F.absArea&&P.length>1)for(const T of v)sl(U,T.ring)&&T.absArea>F.absArea&&T.holes.push(F.ring);else O.holes.push(F.ring);F.assigned=!0}else F.assigned=!1,i&&console.log("[simple] hole not assigned idx=",F.idx)}for(const F of v){const U=Ds(F.ring.slice()),O=(F.holes||[]).map(T=>dy(T.slice()));b.push(ks([U,...O],n))}for(const F of P)F.assigned||b.push(ks([Ds(F.ring.slice())],n));if(v.length===0)for(const F of y)b.push(ks([Ds(F.ring.slice())],n))}return{type:"FeatureCollection",features:b}}class hy extends tt{constructor(e,t){super(e,t),this.type="label",this._centerCoord=null,this._plotInstance=this,this.fontUrl="https://leiting.chenxisoft.com/resource/font/HanaMinA.ttf",this.labelText="点击编辑文本",this.fontSize=10,this.color="#ff0000",this.polygonEntities=[],t&&(this.fontSize=t.fontSize||this.fontSize,this.color=t.color||this.color,this.labelText=t.text||this.labelText)}start(e){this.startCreate(e)}startCreate(e){try{this.state="creating",this.forbidDrawWorld(!0);const t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium,i=this;if(!t){console.error("无法获取Cesium对象");return}this.handler&&this.handler.destroy(),this.handler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(s){if(!s||!s.position)return;let r=i.getCatesian3FromPX(s.position);r&&(i.positions=[r],i._centerCoord=r,i.createLabel(r,function(){i.endCreate(e)}))},t.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(s){if(!s||!s.position)return;i.getCatesian3FromPX(s.position)&&i.state},t.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(s){!s||!s.position||i.endCreate()},t.ScreenSpaceEventType.RIGHT_CLICK)}catch(t){console.error("启动创建标签功能时出错:",t),e&&e(null)}}createLabel(e,t){const i=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium,s=this;if(!e){console.error("创建标签时位置参数无效"),t&&t();return}if(!i){console.error("创建标签时无法获取Cesium对象"),t&&t();return}this.clearPolygonEntities(),ly(this.fontUrl,(r,a)=>{try{if(r){console.error("加载字体失败:",r),t&&t();return}const c=i.Cartographic.fromCartesian(e),l=i.Math.toDegrees(c.longitude),d=i.Math.toDegrees(c.latitude),h={type:"Feature",geometry:{type:"Point",coordinates:[l,d]},properties:{text:s.labelText||"",rotation:0}},f={sampleSegments:16,fontSize:s.fontSize,scale:10},p=uy(h,a,f);if(!p||!p.features||!Array.isArray(p.features)){console.error("文本转换为多边形失败"),t&&t();return}s.drawGeoJsonLocal(p,[l,d],1,a),s.entity={_centerCoord:s._centerCoord,_plotInstance:s._plotInstance,position:e,label:{text:s.labelText},updatePosition:function(u){s.updatePositions([u])},getPosition:function(){return s._centerCoord},type:s.type,objId:s.objId,isDraggable:!0,setPosition:function(u){s._centerCoord=u,s.positions[0]=u,s.createLabel(u)}},s.addClickEditHandler(),t&&t()}catch(c){console.error("创建文本标签时发生错误:",c);try{s.clearPolygonEntities()}catch(l){console.error("清理标签多边形实体时出错:",l)}t&&t()}})}drawGeoJsonLocal(e,t,i=1,s){try{const r=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!e||!t||!Array.isArray(t)||t.length!==2){console.error("drawGeoJsonLocal: 参数无效");return}const a=t[0],c=t[1],l=r.Cartesian3.fromDegrees(a,c,0),d=r.Transforms.eastNorthUpToFixedFrame(l),h=i*1;this.clearPolygonEntities();let f=[];for(const I of e.features||[]){if(!I||!I.geometry||I.geometry.type!=="Polygon")continue;const D=I.geometry.coordinates||[];for(const N of D)N&&Array.isArray(N)&&(f=f.concat(N))}let p=1/0,u=1/0,m=-1/0,E=-1/0;for(const I of f)Array.isArray(I)&&I.length>=2&&(p=Math.min(p,I[0]),u=Math.min(u,I[1]),m=Math.max(m,I[0]),E=Math.max(E,I[1]));const A=(p+m)/2,b=(u+E)/2,w=I=>{const D=(I[0]-A)*h,N=(I[1]-b)*h,S=new r.Cartesian3(D,N,0);return r.Matrix4.multiplyByPoint(d,S,new r.Cartesian3)};for(const I of e.features||[]){if(!I||!I.geometry||I.geometry.type!=="Polygon")continue;const D=I.geometry.coordinates||[];if(D.length>0)try{const N=D[0]||[];if(N.length===0)continue;const S=N.map(w);let B;if(D.length>1){const R=D.slice(1).map(x=>!x||!Array.isArray(x)||x.length===0?null:new r.PolygonHierarchy(x.map(w))).filter(Boolean);B=new r.PolygonHierarchy(S,R)}else B=new r.PolygonHierarchy(S);const g=this.viewer.entities.add({polygon:{hierarchy:B,material:r.Color.fromCssColorString(this.color||"#000000"),outline:!1},_labelOwner:this.objId});this.polygonEntities.push(g)}catch(N){console.warn("创建多边形实体时出错:",N);continue}}}catch(r){console.error("drawGeoJsonLocal: 发生错误:",r)}}clearPolygonEntities(){for(let e of this.polygonEntities)this.viewer.entities.remove(e);this.polygonEntities=[]}addClickEditHandler(){const e=this,t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!t){console.error("添加点击编辑事件时无法获取Cesium对象");return}this.editHandler&&(this.editHandler.destroy(),this.editHandler=null),this.editHandler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.editHandler.setInputAction(function(i){if(!i||!i.position)return;const s=e.viewer.scene.pick(i.position);t.defined(s)&&s.id&&s.id._labelOwner===e.objId&&(i.preventDefault(),e.editText())},t.ScreenSpaceEventType.LEFT_CLICK),this.editHandler.setInputAction(function(i){if(!i||!i.position)return;const s=e.viewer.scene.pick(i.position);t.defined(s)&&s.id&&s.id._labelOwner===e.objId&&(i.preventDefault(),e.openStyleEditor())},t.ScreenSpaceEventType.RIGHT_CLICK)}editText(){const e=this;(function(i,s){const r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.5)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.zIndex="10000";const a=document.createElement("div");a.style.backgroundColor="white",a.style.padding="20px",a.style.borderRadius="5px",a.style.width="500px",a.style.maxWidth="90vw",a.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.2)";const c=document.createElement("h3");c.textContent="编辑文本",c.style.marginTop="0";const l=document.createElement("textarea");l.value=i,l.style.width="100%",l.style.height="150px",l.style.marginBottom="10px",l.style.fontSize="14px",l.style.padding="8px",l.style.boxSizing="border-box";const d=document.createElement("div");d.style.display="flex",d.style.justifyContent="flex-end",d.style.gap="10px";const h=document.createElement("button");h.textContent="取消",h.addEventListener("click",function(){document.body.removeChild(r),s(null)});const f=document.createElement("button");f.textContent="确认",f.addEventListener("click",function(){document.body.removeChild(r),s(l.value)}),d.appendChild(h),d.appendChild(f),a.appendChild(c),a.appendChild(l),a.appendChild(d),r.appendChild(a),document.body.appendChild(r),l.focus();const p=function(u){u.key==="Escape"&&(document.body.removeChild(r),document.removeEventListener("keydown",p),s(null))};document.addEventListener("keydown",p)})(this.labelText,function(i){i!==null&&(e.labelText=i||"点击编辑文本",e._centerCoord&&e.createLabel(e._centerCoord))})}endCreate(e){try{this.state="endCreate",this.handler&&(this.handler.destroy(),this.handler=null),this.forbidDrawWorld(!1),this.entity&&!this.entity.objId&&(this.entity.objId=this.objId),e&&e(this.entity)}catch(t){console.error("结束创建标签时出错:",t),e&&e(null)}}updatePositions(e){try{if(!e||!e.length){console.warn("更新标签位置时参数无效");return}if(!(window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium)){console.error("更新标签位置时无法获取Cesium对象");return}this.positions=e,this._centerCoord=e[0],this.entity&&(this.entity.position=e[0]),this.createLabel(e[0])}catch(t){console.error("更新标签位置时出错:",t)}}moveEntity(e){try{const t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!t){console.error("移动实体时无法获取Cesium对象");return}if(!e||!this._centerCoord)return;const i=t.Cartesian3.add(this._centerCoord,e,new t.Cartesian3);this.updatePositions([i])}catch(t){console.error("移动实体时出错:",t)}}setStyle(e){e&&(e.color&&(this.color=e.color),e.fontSize&&(this.fontSize=e.fontSize),e.text!==void 0&&(this.labelText=e.text),this._centerCoord&&this.createLabel(this._centerCoord))}openStyleEditor(){const e=this;(function(i,s){const r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.5)",r.style.display="flex",r.style.justifyContent="center",r.style.alignItems="center",r.style.zIndex="10000";const a=document.createElement("div");a.style.backgroundColor="white",a.style.padding="20px",a.style.borderRadius="5px",a.style.width="400px",a.style.maxWidth="90vw",a.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.2)";const c=document.createElement("h3");c.textContent="编辑样式",c.style.marginTop="0";const l=document.createElement("div");l.style.marginBottom="15px";const d=document.createElement("label");d.textContent="文本颜色: ",d.style.display="block",d.style.marginBottom="5px";const h=document.createElement("input");h.type="color",h.value=i.color,h.style.width="50px",l.appendChild(d),l.appendChild(h);const f=document.createElement("div");f.style.marginBottom="15px";const p=document.createElement("label");p.textContent="字体大小: ",p.style.display="block",p.style.marginBottom="5px";const u=document.createElement("input");u.type="number",u.value=i.fontSize,u.min="8",u.max="200",u.step="1",u.style.width="100%",u.style.padding="5px",u.style.boxSizing="border-box",f.appendChild(p),f.appendChild(u);const m=document.createElement("div");m.style.display="flex",m.style.justifyContent="flex-end",m.style.gap="10px",m.style.marginTop="20px";const E=document.createElement("button");E.textContent="取消",E.addEventListener("click",function(){document.body.removeChild(r),s(null)});const A=document.createElement("button");A.textContent="确认",A.addEventListener("click",function(){document.body.removeChild(r),s({color:h.value,fontSize:parseInt(u.value)})}),m.appendChild(E),m.appendChild(A),a.appendChild(c),a.appendChild(l),a.appendChild(f),a.appendChild(m),r.appendChild(a),document.body.appendChild(r);const b=function(w){w.key==="Escape"&&(document.body.removeChild(r),document.removeEventListener("keydown",b),s(null))};document.addEventListener("keydown",b)})(this.getStyle(),function(i){i&&e.setStyle(i)})}getStyle(){return{color:this.color,fontSize:this.fontSize,text:this.labelText}}destroy(){try{try{this.clearPolygonEntities()}catch(e){console.warn("清理标签多边形实体时出错:",e)}if(this.handler){try{this.handler.destroy()}catch(e){console.warn("销毁事件处理器时出错:",e)}this.handler=null}if(this.editHandler){try{this.editHandler.destroy()}catch(e){console.warn("销毁编辑事件处理器时出错:",e)}this.editHandler=null}this._centerCoord=null,this._plotInstance=null,this.entity=null,this.positions=null,this.objId=null;try{super.destroy()}catch(e){console.warn("调用父类destroy方法时出错:",e)}}catch(e){console.error("销毁CreateLabel对象时发生错误:",e)}}syncFromEntity(){this.entity&&this.entity.position&&(this._centerCoord=this.entity.position,this._plotInstance=this)}getEntityPositions(){return this.positions}calculateCenter(){return this._centerCoord}}class fy extends tt{constructor(e,t){super(e,t),this.type="point",this.viewer=e;let i={color:Cesium.Color.AQUA,pixelSize:10,outlineWidth:1};this.style=Object.assign(i,t||{}),this.position=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(i){let s=t.getCatesian3FromPX(i.position,t.viewer);s&&(t.entity=t.createPoint(s),t.position=s,t.handler&&(t.handler.destroy(),t.handler=null),t.prompt&&(t.prompt.destroy(),t.prompt=null),t.state="endCreate",e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){t.prompt.update(i.endPosition,"单击新增"),t.state="creating"},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){let e=this;e.handler&&(e.handler.destroy(),e.handler=null),e.prompt&&(e.prompt.destroy(),e.prompt=null),e.state="endCreate"}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let i=e instanceof Cesium.Cartesian3?e:Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]);this.position=i,i&&(this.entity=this.createPoint(i),t&&t(this.entity),this.state="endCreate")}setStyle(e){if(e){if(e.color){let t=Cesium.Color.fromCssColorString(e.color||"#ffff00");t=t.withAlpha(e.colorAlpha),this.entity.point.color=t}if(this.entity.point.outlineWidth=Number(e.outlineWidth),e.outlineColor){let t=Cesium.Color.fromCssColorString(e.outlineColor||"#000000");t=t.withAlpha(e.outlineColorAlpha),this.entity.point.outlineColor=t}this.entity.point.heightReference=Number(e.heightReference),this.entity.point.pixelSize=Number(e.pixelSize),this.style=Object.assign(this.style,e)}}getStyle(){let e={},t=this.entity.point,i=t.color.getValue();e.colorAlpha=i.alpha,e.color=new Cesium.Color(i.red,i.green,i.blue,1).toCssHexString(),e.outlineWidth=t.outlineWidth._value;let s=t.outlineColor.getValue();return e.outlineColorAlpha=s.alpha,e.outlineColor=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString(),t.heightReference!=null&&(e.heightReference=t.heightReference.getValue()),e.pixelSize=Number(t.pixelSize),e}getPositions(e){return e?ae.cartesianToLnglat(this.position):this.position}getLnglats(){return this.getPositions(!0)}startEdit(e){if(this.state=="startEdit"||this.state=="editing"||!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this,i;this.modifyHandler.setInputAction(function(s){let r=t.viewer.scene.pick(s.position);Cesium.defined(r)&&r.id&&(i=r.id,t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(s){if(!i)return;let r=t.getCatesian3FromPX(s.endPosition,t.viewer);r&&(t.entity&&(t.entity.position.setValue(r),t.position=r,t.state="editing"),e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(s){i&&(t.forbidDrawWorld(!1),t.modifyHandler&&(t.modifyHandler.destroy(),t.modifyHandler=null,t.state="editing"))},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}createPoint(e){if(!e)return;let t=this.viewer.entities.add({position:e,point:{color:this.style.color instanceof Cesium.Color?this.style.color:this.style.color?Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1):Cesium.Color.WHITE,outlineColor:this.style.outlineColor instanceof Cesium.Color?this.style.outlineColor:this.style.outlineColor?Cesium.Color.fromCssColorString(this.style.outlineColor).withAlpha(this.style.outlineColorAlpha||1):Cesium.Color.BLACK,outlineWidth:this.style.outlineWidth||4,pixelSize:this.style.pixelSize||20,disableDepthTestDistance:Number.MAX_VALUE}});return t.objId=this.objId,t}}class py extends tt{constructor(e,t){super(e,t),this.type="polygon",this.viewer=e,this.entity=null,this.polyline=null;let i={outlineColor:"#000000",outlineWidth:2};this.style=Object.assign(i,t||{}),this.outline=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(i){let s=t.getCatesian3FromPX(i.position,t.viewer,[]);if(!s||(t.movePush&&(t.positions.pop(),t.movePush=!1),t.positions.some(c=>Math.abs(c.x-s.x)<1e-6&&Math.abs(c.y-s.y)<1e-6&&Math.abs(c.z-s.z)<1e-6)))return;t.positions.push(s);let a=t.createPoint(s);a.wz=t.positions.length-1,t.controlPoints.push(a)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){if(t.positions.length<1){t.prompt.update(i.endPosition,"单击开始绘制"),t.state="startCreate";return}t.prompt&&t.prompt.update(i.endPosition,"双击结束,右键取消上一步");let s=t.getCatesian3FromPX(i.endPosition,t.viewer,[]);t.positions.length>=1&&(t.state="creating",t.movePush?t.positions[t.positions.length-1]=s:(t.positions.push(s),t.movePush=!0),t.positions.length==2&&(Cesium.defined(t.polyline)||(t.polyline=t.createPolyline())),t.positions.length==3&&(Cesium.defined(t.entity)||(t.entity=t.createPolygon(t.style),!t.style.outline&&t.polyline&&(t.polyline.show=!1),t.entity.objId=t.objId)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(i){t.entity&&(t.positions.splice(t.positions.length-2,1),t.viewer.entities.remove(t.controlPoints.pop()),t.positions.length==2&&t.entity&&(t.viewer.entities.remove(t.entity),t.entity=null,t.polyline&&(t.polyline.show=!0)),t.positions.length==1&&(t.polyline&&(t.viewer.entities.remove(t.polyline),t.polyline=null),t.prompt&&t.prompt.update(i.endPosition,"单击开始绘制"),t.positions=[],t.movePush=!1))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.handler.setInputAction(function(i){t.entity&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.movePush=!1,e.prompt&&(e.prompt.destroy(),e.prompt=null),e.viewer.trackedEntity=void 0,e.viewer.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.positions.length<=2&&this.movePush==!0?this.destroy():this.endCreate():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let i=e[0]instanceof Cesium.Cartesian3?e:ae.lnglatsToCartesians(e);if(i){this.entity=this.createPolygon(),this.polyline=this.createPolyline(),this.polyline.show=this.style.outline,this.positions=i;for(let s=0;s<i.length;s++){let r=i[s],a=Cesium.Cartographic.fromCartesian(i[s]),c=this.createPoint(r);c.point.heightReference=this.style.heightReference,c.ctgc=a,c.wz=this.controlPoints.length,this.controlPoints.push(c)}this.state="endCreate",this.entity.objId=this.objId,t&&t(this.entity)}}getStyle(){if(!this.entity)return;let e={},t=this.entity.polygon;if(t.material instanceof Cesium.ColorMaterialProperty){e.material="common";let s=t.material.color.getValue();e.colorAlpha=s.alpha,e.color=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString()}if(e.fill=t.fill?t.fill.getValue():!1,t.heightReference){let s=t.heightReference.getValue();e.heightReference=Number(s)}let i=this.polyline.polyline;if(i&&this.polyline.show){e.outlineWidth=i.width.getValue(),e.outline=!0;let s=i.material.color.getValue();e.outlineColorAlpha=s.alpha,e.outlineColor=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString()}else e.outline=!1;return e}setStyle(e){if(!e)return;this.polyline.show=e.outline;let t=this.polyline.polyline;t.width=e.outlineWidth,this.polyline.clampToGround=!!e.heightReference;let s=(e.outlineColor instanceof Cesium.Color?e.outlineColor:Cesium.Color.fromCssColorString(e.outlineColor)).withAlpha(e.outlineColorAlpha||1);t.material=s,e.heightReference!=null&&(this.entity.polygon.heightReference=Number(e.heightReference));let a=(e.color instanceof Cesium.Color?e.color:Cesium.Color.fromCssColorString(e.color)).withAlpha(e.colorAlpha||1);this.entity.polygon.material=a,e.fill!=null&&(this.entity.polygon.fill=e.fill),this.style=Object.assign(this.style,e)}createPolygon(){let e=this;this.style.color=this.style.color||Cesium.Color.WHITE,this.style.outlineColor=this.style.outlineColor||Cesium.Color.BLACK;let t={polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(e.positions)},!1),heightReference:Number(this.style.heightReference),show:!0,fill:this.style.fill==null?!0:this.style.fill,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1)}};return this.style.heightReference||(t.polygon.height=0,t.polygon.perPositionHeight=!0),this.viewer.entities.add(t)}createPolyline(){let e=this;return this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions.concat(e.positions[0])},!1),clampToGround:!!this.style.heightReference,material:this.style.outlineColor instanceof Cesium.Color?this.style.outlineColor:Cesium.Color.fromCssColorString(this.style.outlineColor).withAlpha(this.style.outlineColorAlpha||1),width:this.style.outlineWidth||1}})}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=null),this.positions=[],this.style=null,this.modifyPoint&&(this.viewer.entities.remove(this.modifyPoint),this.modifyPoint=null);for(let e=0;e<this.controlPoints.length;e++){let t=this.controlPoints[e];this.viewer.entities.remove(t)}this.controlPoints=[],this.state="no",this.prompt&&this.prompt.destroy(),this.polyline&&(this.polyline=null,this.viewer.entities.remove(this.polyline)),this.forbidDrawWorld(!1)}}class my extends tt{constructor(e,t){super(e,t),this.type="rectangle",this.viewer=e,this.style=t||{},this.leftup=null,this.rightdown=null,this.leftdownPoint=null,this.rightupPoint=null,this.entity=null,this.handler=null,this.modifyHandler=null,this.modifyPoint=null,this._dragStartCart=null,this._dragStartCartCarto=null}start(e){!this.prompt&&this.promptStyle?.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate",this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.handler.setInputAction(function(i){const s=t.getCatesian3FromPX(i.position,t.viewer,[]);if(s)if(t.entity)t.endCreate(),e&&e(t.entity);else{t.leftup=s.clone(),t.rightdown=s.clone(),t.entity=t._createPolyline();const r=t._calcCornerCartesian("leftdown"),a=t._calcCornerCartesian("rightup");t.leftdownPoint=t.createPoint(r),t.leftdownPoint.typeAttr="leftdown",t.leftdownPoint.show=!1,t.rightupPoint=t.createPoint(a),t.rightupPoint.typeAttr="rightup",t.rightupPoint.show=!1}},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){if(!t.entity){t.prompt?.update(i.endPosition,"单击开始绘制");return}t.prompt?.update(i.endPosition,"单击结束");const s=t.getCatesian3FromPX(i.endPosition,t.viewer,[]);s&&(t.rightdown=s.clone(),t._updatePolyline(),t._updateAuxPoints(),t.state="creating")},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){this.handler?.destroy(),this.handler=null,this.leftdownPoint&&(this.leftdownPoint.show=!1),this.rightupPoint&&(this.rightupPoint.show=!1),this.prompt?.destroy(),this.prompt=null,this.state="endCreate"}startEdit(e){if(!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.leftdownPoint&&(this.leftdownPoint.show=!0),this.rightupPoint&&(this.rightupPoint.show=!0),this.modifyHandler.setInputAction(function(i){const s=t.viewer.scene.pick(i.position);if(!s?.id)return;t.modifyPoint=s.id;const r=t.getCatesian3FromPX(i.position,t.viewer,[t.entity,t.modifyPoint]);r&&(t._dragStartCart=r,t._dragStartCartCarto=Cesium.Ellipsoid.WGS84.cartesianToCartographic(r),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(i){if(!t.modifyPoint)return;const s=t.getCatesian3FromPX(i.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.typeAttr==="leftdown"?t._dragCorner(s,"leftdown"):t.modifyPoint.typeAttr==="rightup"&&t._dragCorner(s,"rightup"),t._updatePolyline(),t._updateAuxPoints(),e&&e(),t.state="editing")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){t.modifyPoint=null,t._dragStartCart=null,t._dragStartCartCarto=null,t.forbidDrawWorld(!1),t._updatePolyline(),e&&e(t.entity),t.state="editing"},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.leftdownPoint&&(this.leftdownPoint.show=!1),this.rightupPoint&&(this.rightupPoint.show=!1),this.modifyHandler?.destroy(),this.modifyHandler=null,this.forbidDrawWorld(!1),this.state="endEdit",e&&e(this.entity)}_createPolyline(){const e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(()=>e._buildRectPositions(),!1),width:this.style.outlineWidth||this.style.width||5,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color||"#00FF00"),clampToGround:!1}});return t._plotInstance=this,t.objId=this.objId,t}_updatePolyline(){if(!this.entity)return;const e=this._buildRectPositions();try{const t=this.entity.polyline.positions;if(t&&typeof t.getValue=="function")return;if(t&&typeof t.setValue=="function"){t.setValue(e);return}this.entity.polyline.positions=e}catch{this.entity.polyline.positions=e}}_buildRectPositions(){if(!this.leftup||!this.rightdown)return[];const e=this._calcCornerCartesian("leftdown"),t=this.leftup,i=this._calcCornerCartesian("rightup"),s=this.rightdown;return[e,s,i,t,e]}_calcCornerCartesian(e){const t=Cesium.Ellipsoid.WGS84,i=t.cartesianToCartographic(this.leftup),s=t.cartesianToCartographic(this.rightdown),r=Math.min(i.longitude,s.longitude),a=Math.max(i.longitude,s.longitude),c=Math.min(i.latitude,s.latitude),l=Math.max(i.latitude,s.latitude);if(e==="leftdown")return Cesium.Cartesian3.fromRadians(r,c);if(e==="rightup")return Cesium.Cartesian3.fromRadians(a,l)}_updateAuxPoints(){if(!this.leftup||!this.rightdown)return;const e=this._calcCornerCartesian("leftdown"),t=this._calcCornerCartesian("rightup");this.leftdownPoint&&(this.leftdownPoint.position=e),this.rightupPoint&&(this.rightupPoint.position=t)}_dragCorner(e,t){const i=Cesium.Ellipsoid.WGS84,s=i.cartesianToCartographic(this.leftup),r=i.cartesianToCartographic(this.rightdown);let a=Math.min(s.longitude,r.longitude),c=Math.max(s.longitude,r.longitude),l=Math.min(s.latitude,r.latitude),d=Math.max(s.latitude,r.latitude);const h=i.cartesianToCartographic(e);t==="leftdown"?(a=h.longitude,l=h.latitude):(c=h.longitude,d=h.latitude),this.leftup=Cesium.Cartesian3.fromRadians(a,d),this.rightdown=Cesium.Cartesian3.fromRadians(c,l)}syncFromEntity(){if(!this.entity||!this.leftup||!this.rightdown)return;const e=Cesium.Cartesian3.midpoint(this.leftup,this.rightdown,new Cesium.Cartesian3),t=this.entity._centerCoord;if(!t)return;const i=t.x-e.x,s=t.y-e.y,r=t.z-e.z;this.leftup=new Cesium.Cartesian3(this.leftup.x+i,this.leftup.y+s,this.leftup.z+r),this.rightdown=new Cesium.Cartesian3(this.rightdown.x+i,this.rightdown.y+s,this.rightdown.z+r);const a=this.entity.objId,c=this.entity._plotInstance;this.leftdownPoint&&this.viewer.entities.remove(this.leftdownPoint),this.rightupPoint&&this.viewer.entities.remove(this.rightupPoint),this.leftdownPoint=this.rightupPoint=null,this.viewer.entities.remove(this.entity),this.entity=this._createPolyline(),this.entity._plotInstance=c,this.entity.objId=a;const l=this._calcCornerCartesian("leftdown"),d=this._calcCornerCartesian("rightup");this.leftdownPoint=this.createPoint(l),this.leftdownPoint.typeAttr="leftdown",this.leftdownPoint.show=this.state==="editing",this.rightupPoint=this.createPoint(d),this.rightupPoint.typeAttr="rightup",this.rightupPoint.show=this.state==="editing"}updatePositions(e){if(!e||e.length<1)return!1;try{if(!this.leftup||!this.rightdown)return!1;let t;if(e[0]instanceof Cesium.Cartesian3)t=e[0];else return!1;this.leftup=Cesium.Cartesian3.add(this.leftup,t,new Cesium.Cartesian3),this.rightdown=Cesium.Cartesian3.add(this.rightdown,t,new Cesium.Cartesian3),this._updatePolyline(),this._updateAuxPoints();try{this.viewer.scene.requestRender()}catch{}return!0}catch(t){return console.warn("Failed to update rectangle positions:",t),!1}}getPositions(e){return e?ae.cartesiansToLnglats([this.leftup,this.rightdown],this.viewer):[this.leftup,this.rightdown]}getStyle(){const e=this.entity.polyline,t=e.material.color.getValue();return{color:new Cesium.Color(t.red,t.green,t.blue,1).toCssHexString(),colorAlpha:t.alpha,outlineWidth:e.width.getValue()}}setStyle(e){if(!this.entity)return;const t={...this.style,...e};let i=t.color instanceof Cesium.Color?t.color:Cesium.Color.fromCssColorString(t.color||"#00FF00");t.colorAlpha!=null&&(i=i.withAlpha(t.colorAlpha)),this.entity.polyline.material=i,this.entity.polyline.width=t.outlineWidth||t.width||5,this.style=t}destroy(){try{this.handler?.destroy(),this.modifyHandler?.destroy(),this.entity&&this.viewer.entities.remove(this.entity),this.entity=null,this.leftdownPoint&&this.viewer.entities.remove(this.leftdownPoint),this.rightupPoint&&this.viewer.entities.remove(this.rightupPoint),this.leftdownPoint=this.rightupPoint=null,this.prompt?.destroy(),this.prompt=null}catch{}}createByPositions(e,t){if(!e||e.length<2)return!1;const i=e[0]instanceof Cesium.Cartesian3?e:ae.lnglatsToCartesians(e);if(!i||i.length<2)return!1;if(i.length===2)this.leftup=Cesium.Cartesian3.clone(i[0]),this.rightdown=Cesium.Cartesian3.clone(i[1]);else if(i.length>=4){let s=1/0,r=1/0,a=-1/0,c=-1/0;i.forEach(l=>{const d=Cesium.Ellipsoid.WGS84.cartesianToCartographic(l);d&&(s=Math.min(s,d.longitude),r=Math.min(r,d.latitude),a=Math.max(a,d.longitude),c=Math.max(c,d.latitude))}),this.leftup=Cesium.Cartesian3.fromRadians(s,c),this.rightdown=Cesium.Cartesian3.fromRadians(a,r)}if(this.entity?this._updatePolyline():this.entity=this._createPolyline(),!this.leftdownPoint){const s=this._calcCornerCartesian("leftdown");this.leftdownPoint=this.createPoint(s),this.leftdownPoint.typeAttr="leftdown",this.leftdownPoint.show=!1}if(!this.rightupPoint){const s=this._calcCornerCartesian("rightup");this.rightupPoint=this.createPoint(s),this.rightupPoint.typeAttr="rightup",this.rightupPoint.show=!1}this._updateAuxPoints(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch(s){console.error("requestRender error:",s)}return t&&t(this.entity),!0}}class gy extends tt{constructor(e,t){super(e,t),t=t||{},this.movePush=!1,this.type="polyline",this.maxPointNum=t.maxPointNum||Number.MAX_VALUE}updatePositions(e){if(!e||e.length<1)return!1;let t=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);return t?(this.positions=t,this.updateControlPoints(),!0):!1}updateControlPoints(){for(let e=0;e<this.controlPoints.length;e++)this.viewer.entities.remove(this.controlPoints[e]);this.controlPoints=[];for(let e=0;e<this.positions.length;e++){let t=this.positions[e],i=this.createPoint(t);this.style.clampToGround&&(i.point.heightReference=1),i.wz=this.controlPoints.length,this.controlPoints.push(i)}}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new ft(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(i){let s=t.getCatesian3FromPX(i.position,t.viewer,[t.entity]);if(!s)return;t.movePush&&(t.positions.pop(),t.movePush=!1),t.positions.push(s);let r=t.createPoint(s);r.wz=t.positions.length-1,t.controlPoints.push(r),t.positions.length==t.maxPointNum&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(i){if(t.state="creating",t.positions.length<1){t.prompt.update(i.endPosition,"单击开始绘制"),t.state="startCreate";return}t.prompt.update(i.endPosition,"右键取消上一步,双击结束");let s=t.getCatesian3FromPX(i.endPosition,t.viewer,[t.entity]);s&&(t.movePush?t.positions[t.positions.length-1]=s:(t.positions.push(s),t.movePush=!0),t.positions.length==2&&(Cesium.defined(t.entity)||(t.entity=t.createPolyline())))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(i){t.entity&&(t.positions.splice(t.positions.length-2,1),t.viewer.entities.remove(t.controlPoints.pop()),t.positions.length==1&&(t.entity&&(t.viewer.entities.remove(t.entity),t.entity=null),t.prompt.update(i.endPosition,"单击开始绘制"),t.movePush=!1,t.positions=[]))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.handler.setInputAction(function(i){t.entity&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.positions.pop(),e.viewer.entities.remove(e.controlPoints.pop()),e.prompt&&(e.prompt.destroy(),e.prompt=null),e.viewer.trackedEntity=void 0,e.viewer.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.positions.length<=2&&this.movePush==!0?this.destroy():this.endCreate():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e||e.length<1)return;this.state="startCreate";let i=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);if(i){this.entity=this.createPolyline(this.style),this.positions=i,t&&t(this.entity);for(let s=0;s<i.length;s++){let r=i[s],a=this.createPoint(r);this.style.clampToGround&&(a.point.heightReference=1),a.wz=this.controlPoints.length,this.controlPoints.push(a)}this.state="endCreate"}}setStyle(e){if(!e)return;let t=this.getMaterial(e.material,e);this.entity.polyline.material=t,this.entity.polyline.clampToGround=!!e.clampToGround,e.width&&(this.entity.polyline.width=e.width||3),this.style=Object.assign(this.style,e)}getStyle(){if(!this.entity)return;let e={},t=this.entity.polyline;this.style.animateType!=null&&(e.animateType=this.style.animateType,e.image=this.style.image,e.duration=this.style.duration),t.material instanceof Cesium.ColorMaterialProperty?e.material="common":(e.material="flowline",t.material instanceof animate.FlowLineMaterial,e.duration=t.material._duration,e.image=t.material.url);let i=t.material.color.getValue();e.colorAlpha=i.alpha,e.color=new Cesium.Color(i.red,i.green,i.blue,1).toCssHexString(),e.width=t.width._value;let s=t.clampToGround?t.clampToGround.getValue():!1;return e.clampToGround=!!s,e}createPolyline(){let e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions},!1),show:!0,material:this.getMaterial(this.style.animateType,this.style),width:this.style.width||3,clampToGround:this.style.clampToGround}});return t.objId=this.objId,t}getMaterial(e,t){t=t||{};let i=null,s=t.color||Cesium.Color.WHITE;return s=s instanceof Cesium.Color?s:Cesium.Color.fromCssColorString(t.color),s=s.withAlpha(t.colorAlpha||1),e=="flowline"||e=="flyline"||(i=s),i}updatePositions(e){if(!e||e.length<1)return!1;let t=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);return t?(this.positions=t,this.updateControlPoints(),!0):!1}updateControlPoints(){for(let e=0;e<this.controlPoints.length;e++)this.viewer.entities.remove(this.controlPoints[e]);this.controlPoints=[];for(let e=0;e<this.positions.length;e++){let t=this.positions[e],i=this.createPoint(t);this.style.clampToGround&&(i.point.heightReference=1),i.wz=this.controlPoints.length,this.controlPoints.push(i)}}getPositions(e){return e?util.cartesiansToLnglats(this.positions,this.viewer):this.positions}}class Ay extends tt{constructor(e,t={}){super(e,t),this.type="freehandLine",this.maxPositions=t.maxPositions||1e4,this.minDistance=t.minDistance||2,this.renderInterval=t.renderInterval||30,this.style=Object.assign({smoothness:2,angleThreshold:3,curveResolution:3},t||{}),this.positions=[],this._stagingBuffer=[],this._flushScheduled=!1,this._flushRAF=null,this._lastFlushTime=0,this.isDrawing=!1,this.handler=null,this.startPointEntity=null,this.entity=null,this.lastAddPosition=null}start(e){if(this.state==="creating"||this.state==="startCreate")return;if(this.state="startCreate",this.positions=[],this._stagingBuffer.length=0,this._lastFlushTime=0,this.isDrawing=!1,this.lastAddPosition=null,this._cancelFlush(),!this.prompt&&this.promptStyle&&this.promptStyle.show&&Promise.resolve().then(()=>Qr).then(({default:i})=>{this.prompt=new i(this.viewer,this.promptStyle)}),this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.startPointEntity){try{this.viewer.entities.remove(this.startPointEntity)}catch{}this.startPointEntity=null}this.entity=this.createFreehandLine();const t=this;this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(i){t.state="creating",t.isDrawing=!0,t.forbidDrawWorld(!0),t.positions=[],t._stagingBuffer.length=0,t.lastAddPosition=null;let s=t._fastPick(i.position);if(!s){t.isDrawing=!1;return}const r=Cesium.Cartesian3.clone(s);if(t._pushToStaging(r),t.lastAddPosition=r,t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t.startPointEntity=t.viewer.entities.add({position:r,point:{pixelSize:6,color:Cesium.Color.RED,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}),t._scheduleFlush(!0)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(function(i){if(!t.isDrawing){t.prompt&&i&&i.endPosition&&t.prompt.update(i.endPosition,"单击开始绘制");return}if(t.prompt&&i&&i.endPosition&&t.prompt.update(i.endPosition,"松键结束"),!i||!i.endPosition||t.positions.length+t._stagingBuffer.length>=t.maxPositions)return;let s=t._fastPick(i.endPosition);if(!s||t.lastAddPosition&&Cesium.Cartesian3.distance(t.lastAddPosition,s)<=t.minDistance)return;const r=Cesium.Cartesian3.clone(s);t._pushToStaging(r),t.lastAddPosition=r,t._scheduleFlush()},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(i){if(t.isDrawing){if(t.prompt&&t.prompt.update(null,"单击结束绘制"),t.isDrawing=!1,t.forbidDrawWorld(!1),t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t._scheduleFlush(!0),t.endCreate(e)}},Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.setInputAction(function(i){if(t.isDrawing){if(t.prompt&&t.prompt.update(null,"单击结束绘制"),t.isDrawing=!1,t.forbidDrawWorld(!1),t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t._scheduleFlush(!0),t.endCreate(e)}},Cesium.ScreenSpaceEventType.RIGHT_DOWN)}_pushToStaging(e){this._stagingBuffer.push(e)}_scheduleFlush(e=!1){if(this._flushRAF){e&&(this._forceImmediate=!0);return}this._forceImmediate=e||!1;const t=this,i=function(){t._flushRAF=null;const s=performance.now();(t._forceImmediate||s-t._lastFlushTime>=t.renderInterval)&&(t._flushToPositions(),t._lastFlushTime=s),t._forceImmediate=!1};this._flushRAF=requestAnimationFrame(i)}_cancelFlush(){if(this._flushRAF){try{cancelAnimationFrame(this._flushRAF)}catch{}this._flushRAF=null}this._forceImmediate=!1}_fastPick(e){if(this.viewer.scene.mode===Cesium.SceneMode.SCENE2D){const i=this.viewer.camera.getPickRay(e);let s=null;return i&&(s=this.viewer.scene.globe.pick(i,this.viewer.scene)),s||(s=this.viewer.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),s}let t=null;try{t=this.viewer.scene.pickPosition(e)}catch{}if(!t){const i=this.viewer.camera.getPickRay(e);i&&(t=this.viewer.scene.globe.pick(i,this.viewer.scene))}return t}_flushToPositions(){if(!this._stagingBuffer||this._stagingBuffer.length===0)return;const e=this._stagingBuffer;this._stagingBuffer=[];const t=Math.max(0,Math.min(2,Number(this.style.smoothness||1)));let i=e;if(t>0){const c=(h,f)=>{if(!h||h.length<2)return h;f=Math.max(1,f|0);const p=[h[0]],u=h.length;for(let m=0;m<u-1;m++){const E=m>0?h[m-1]:h[m],A=h[m],b=h[m+1],w=m+2<u?h[m+2]:h[m+1];for(let I=1;I<f;I++){const D=I/f,N=D*D,S=N*D,B=-.5*E.x+1.5*A.x-1.5*b.x+.5*w.x,g=-.5*E.y+1.5*A.y-1.5*b.y+.5*w.y,R=-.5*E.z+1.5*A.z-1.5*b.z+.5*w.z,x=E.x-2.5*A.x+2*b.x-.5*w.x,M=E.y-2.5*A.y+2*b.y-.5*w.y,L=E.z-2.5*A.z+2*b.z-.5*w.z,V=-.5*E.x+.5*b.x,k=-.5*E.y+.5*b.y,C=-.5*E.z+.5*b.z,y=A.x,v=A.y,P=A.z,F=B*S+x*N+V*D+y,U=g*S+M*N+k*D+v,O=R*S+L*N+C*D+P;p.push(new Cesium.Cartesian3(F,U,O))}p.push(b)}return p},l=Math.max(1,Number(this.style.curveResolution)||1);i.length<200&&l>1&&(i=c(i,l));const d=h=>{if(!h||h.length<2)return h;const f=[];f.push(h[0]);for(let p=0;p<h.length-1;p++){const u=h[p],m=h[p+1],E=new Cesium.Cartesian3(u.x*.75+m.x*.25,u.y*.75+m.y*.25,u.z*.75+m.z*.25),A=new Cesium.Cartesian3(u.x*.25+m.x*.75,u.y*.25+m.y*.75,u.z*.25+m.z*.75);f.push(E),f.push(A)}return f.push(h[h.length-1]),f};i=i.slice(),i.length<300&&(i=d(i),t===2&&i.length<300&&(i=d(i)))}const s=(Number(this.style.angleThreshold)||6)*(Math.PI/180),r=this.positions,a=(c,l,d,h)=>{if(!c||!l||!d)return!1;const f=l.x-c.x,p=l.y-c.y,u=l.z-c.z,m=d.x-l.x,E=d.y-l.y,A=d.z-l.z,b=Math.hypot(f,p,u),w=Math.hypot(m,E,A);if(b===0||w===0)return!1;const I=(f*m+p*E+u*A)/(b*w),D=Math.max(-1,Math.min(1,I)),N=Math.acos(D);return Math.abs(N)<=h};for(let c=0;c<i.length;c++){const l=i[c];if(r.length===0){r.push(Cesium.Cartesian3.clone(l));continue}const d=r[r.length-1];if(!(Cesium.Cartesian3.distance(d,l)<=this.minDistance*.5)){if(r.length>=2){const f=r[r.length-2],p=r[r.length-1],u=l;if(a(f,p,u,s)){r.pop(),r.push(Cesium.Cartesian3.clone(u));continue}}if(r.push(Cesium.Cartesian3.clone(l)),r.length>this.maxPositions){const f=r.length-this.maxPositions;f>0&&r.splice(0,f)}}}try{this.viewer.scene.requestRender()}catch{}}endCreate(e){if(this.state==="endCreate")return;if(this.state="endCreate",this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}if(this._flushToPositions(),this._cancelFlush(),!this.positions||this.positions.length<2){if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}e&&e(null);return}const t=this.positions.map(i=>Cesium.Cartesian3.clone(i));this.positions=t;try{this.viewer.scene.requestRender()}catch{}e&&e(this.entity)}done(e){this.isDrawing&&(this.isDrawing=!1,this.forbidDrawWorld(!1),this.endCreate(e))}createFreehandLine(){const e=this,t=this.getMaterial(this.style.animateType,this.style),i=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions||[]},!1),show:!0,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1}});return i.objId=this.objId||null,this.entity=i,i}getMaterial(e,t){t=t||{};try{let i=t.color||Cesium.Color.RED;typeof i=="string"&&(i=Cesium.Color.fromCssColorString(i));const s=t.colorAlpha!==void 0?t.colorAlpha:1;return i=i.withAlpha(s),i}catch{return Cesium.Color.RED}}updatePositions(e){if(!e||e.length<1)return!1;try{let t=[];if(e[0]instanceof Cesium.Cartesian3?t=e.map(i=>Cesium.Cartesian3.clone(i)):t=ae&&ae.lnglatsToCartesians?ae.lnglatsToCartesians(e):e,!t||t.length===0)return!1;this.positions=t.map(i=>Cesium.Cartesian3.clone(i)),this._stagingBuffer.length=0;try{this.viewer.scene.requestRender()}catch{}return!0}catch{return!1}}setStyle(e){if(!e||(this.style=Object.assign(this.style||{},e),!this.entity||!this.entity.polyline))return;const t=this.getMaterial(this.style.animateType,this.style);try{this.entity.polyline.material=t}catch{}if(e.width!==void 0)try{this.entity.polyline.width=e.width}catch{}if(e.clampToGround!==void 0)try{this.entity.polyline.clampToGround=!!e.clampToGround}catch{}}createByPositions(e,t){if(!e||e.length<1)return!1;const i=e[0]instanceof Cesium.Cartesian3?e:ae.lnglatsToCartesians(e);if(!i||i.length<1)return!1;this.positions=i.map(s=>Cesium.Cartesian3.clone(s)),this.entity||this.createFreehandLine(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch{}return t&&t(this.entity),!0}destroy(){if(this._cancelFlush(),this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.startPointEntity){try{this.viewer.entities.remove(this.startPointEntity)}catch{}this.startPointEntity=null}this.positions=[],this._stagingBuffer=[],this.isDrawing=!1;try{this.endCreate()}catch{}}}class yy extends tt{constructor(e,t={}){if(!e)throw new Error("CreateArrow requires viewer");if(super(e,t),this.type="arrow",this.style=t||{},this.arrowAngle=t.arrowAngle||Math.PI/6,this.positions=[],this.lineEntity=null,this.arrowEntity=null,this.controlPoints=[],this.handler=null,this._finalized=!1,this._editRenderHandler=null,this.Cesium=this._getCesium(),!this.Cesium)throw new Error("Cesium not found")}_getCesium(){return typeof window<"u"&&window.Cesium?window.Cesium:typeof Cesium<"u"?Cesium:this.viewer&&this.viewer.constructor&&this.viewer.constructor.Cesium?this.viewer.constructor.Cesium:null}start(e){if(!this.viewer||!this.Cesium)return e&&e(null),this;if(this.state==="creating"||this.state==="startCreate")return this;this.state="startCreate",this._cleanup(!1),!this.prompt&&this.promptStyle&&this.promptStyle.show&&Promise.resolve().then(()=>Qr).then(({default:i})=>{this.prompt=new i(this.viewer,this.promptStyle)}).catch(()=>{});try{this.forbidDrawWorld(!0)}catch{}const t=this;return this.handler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(i){if(t.state==="startCreate"){t.state="creating",t._finalized=!1;let s=t.getCatesian3FromPX(i.position);if(!s)return;t.positions=[t.Cesium.Cartesian3.clone(s),t.Cesium.Cartesian3.clone(s)],t._createLineEntity(),t._createArrowEntity(),t._createControlPoints(),t.prompt&&i&&i.position&&t.prompt.update(i.position,"再次单击完成绘制")}else if(t.state==="creating"){if(t.state="endCreate",t._finalized=!0,t._finalizeEntities(),t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}if(t.handler){try{t.handler.destroy()}catch{}t.handler=null}try{t.forbidDrawWorld(!1)}catch{}e&&e(t.entity||t.lineEntity)}try{t.viewer.scene.requestRender()}catch{}},this.Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(function(i){if(t.state==="startCreate"){t.prompt&&i&&i.endPosition&&t.prompt.update(i.endPosition,"单击开始绘制");return}if(t.state==="creating"){let s=t.getCatesian3FromPX(i.endPosition);if(!s)return;if(t.positions[1]=s,t.controlPoints[1])try{t.controlPoints[1].position.setValue(s)}catch{}try{t.viewer.scene.requestRender()}catch{}}},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(){if(t.state==="creating"){if(t.state="endCreate",t._finalized=!1,t.lineEntity){try{t.viewer.entities.remove(t.lineEntity)}catch{}t.lineEntity=null}if(t.arrowEntity){try{t.viewer.entities.remove(t.arrowEntity)}catch{}t.arrowEntity=null}t.controlPoints.length&&(t.controlPoints.forEach(i=>{try{t.viewer.entities.remove(i)}catch{}}),t.controlPoints=[])}if(t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}if(t.handler){try{t.handler.destroy()}catch{}t.handler=null}try{t.forbidDrawWorld(!1)}catch{}e&&e(null)},this.Cesium.ScreenSpaceEventType.RIGHT_DOWN),this}_computeArrowPositions(e,t){if(!e||!t)return[];const i=this.Cesium.Cartesian3.distance(e,t);if(i<=1e-6)return[];const s=this.style.arrowLengthFactor!==void 0?this.style.arrowLengthFactor:.15,r=this.style.arrowMinSize!==void 0?this.style.arrowMinSize:1.5,a=this.style.arrowMaxSize!==void 0?this.style.arrowMaxSize:Number.MAX_VALUE;let c=this.style.arrowFixedSize!==void 0?this.style.arrowFixedSize:i*s;c<r&&(c=r),c>a&&(c=a);const l=this.Cesium.Cartesian3.subtract(t,e,new this.Cesium.Cartesian3);this.Cesium.Cartesian3.normalize(l,l);const d=this.Cesium.Transforms.eastNorthUpToFixedFrame(t),h=this.Cesium.Matrix4.getColumn(d,2,new this.Cesium.Cartesian3),f=new this.Cesium.Cartesian3(l.x-h.x*this.Cesium.Cartesian3.dot(l,h),l.y-h.y*this.Cesium.Cartesian3.dot(l,h),l.z-h.z*this.Cesium.Cartesian3.dot(l,h));let p;this.Cesium.Cartesian3.magnitudeSquared(f)<1e-6?p=this.Cesium.Matrix4.getColumn(d,0,new this.Cesium.Cartesian3):(this.Cesium.Cartesian3.normalize(f,f),p=this.Cesium.Cartesian3.cross(h,f,new this.Cesium.Cartesian3),this.Cesium.Cartesian3.normalize(p,p));const u=this.Cesium.Cartesian3.multiplyByScalar(l,-c,new this.Cesium.Cartesian3),m=this.Cesium.Cartesian3.add(t,u,new this.Cesium.Cartesian3),E=this.style.arrowWidthScale!==void 0?this.style.arrowWidthScale:1,A=Math.sin(this.arrowAngle)*c*E,b=this.Cesium.Cartesian3.multiplyByScalar(p,A,new this.Cesium.Cartesian3),w=this.Cesium.Cartesian3.multiplyByScalar(p,-A,new this.Cesium.Cartesian3),I=this.Cesium.Cartesian3.add(m,b,new this.Cesium.Cartesian3),D=this.Cesium.Cartesian3.add(m,w,new this.Cesium.Cartesian3);return[t,I,D,t]}_createLineEntity(){if(this.lineEntity){try{this.viewer.entities.remove(this.lineEntity)}catch{}this.lineEntity=null}const e=this,t=this._getMaterial(),i=new this.Cesium.CallbackProperty(function(){return!e.positions||e.positions.length<2?[]:[e.positions[0],e.positions[1]]},!1);this.lineEntity=this.viewer.entities.add({polyline:{positions:i,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1},objId:this.objId}),this.entity=this.lineEntity}_createArrowEntity(){if(this.arrowEntity){try{this.viewer.entities.remove(this.arrowEntity)}catch{}this.arrowEntity=null}const e=this,t=this._getMaterial(),i=new this.Cesium.CallbackProperty(function(){if(!e.positions||e.positions.length<2)return[];const s=e.positions[0],r=e.positions[1];return e._computeArrowPositions(s,r)},!1);this.arrowEntity=this.viewer.entities.add({polyline:{positions:i,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1},objId:this.objId}),console.log("this.arrowEntity",this.arrowEntity)}_createControlPoints(){if(this.controlPoints&&this.controlPoints.length&&(this.controlPoints.forEach(e=>{try{this.viewer.entities.remove(e)}catch{}}),this.controlPoints=[]),!(!this.positions||this.positions.length<2))for(let e=0;e<2;e++)try{const t=this.createPoint(this.positions[e]);t.wz=e,this.controlPoints.push(t)}catch{}}_finalizeEntities(){if(this.lineEntity&&this.lineEntity.polyline)try{const e=this.Cesium.Cartesian3.clone(this.positions[0]),t=this.Cesium.Cartesian3.clone(this.positions[1]);this.lineEntity.polyline.positions=[e,t]}catch{}if(this.arrowEntity&&this.arrowEntity.polyline)try{const e=this.positions[0],t=this.positions[1];this.arrowEntity.polyline.positions=this._computeArrowPositions(e,t)}catch{}this.entity=this.lineEntity,this.entity&&(this.entity.arrowEntity=this.arrowEntity,this.entity.positions=[this.positions[0],this.positions[1]],this.positions=[this.positions[0],this.positions[1]]);try{this.viewer.scene.requestRender()}catch{}}startEdit(e){super.startEdit(e),(!this.controlPoints||this.controlPoints.length<2)&&this._createControlPoints();for(let t=0;t<this.controlPoints.length;t++)try{this.controlPoints[t].show=!0}catch{}if(this.lineEntity&&this.lineEntity.polyline)try{const t=this;this.lineEntity.polyline.positions=new this.Cesium.CallbackProperty(function(){return!t.positions||t.positions.length<2?[]:[t.positions[0],t.positions[1]]},!1)}catch{}if(this.arrowEntity&&this.arrowEntity.polyline)try{const t=this;this.arrowEntity.polyline.positions=new this.Cesium.CallbackProperty(function(){if(!t.positions||t.positions.length<2)return[];const i=t.positions[0],s=t.positions[1];return t._computeArrowPositions(i,s)},!1)}catch{}if(!this._editRenderHandler){this._editRenderHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);const t=this;this._editRenderHandler.setInputAction(function(i){if(t.modifyPoint)try{t.viewer.scene.requestRender()}catch{}},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}endEdit(e){if(super.endEdit(e),this._editRenderHandler){try{this._editRenderHandler.destroy()}catch{}this._editRenderHandler=null}this._finalized=!0,this._finalizeEntities()}createByPositions(e,t){if(!e||e.length<2)return!1;let i=e[0],s=e[1];if(!(i instanceof this.Cesium.Cartesian3))if(Array.isArray(i)&&i.length>=2)i=this.Cesium.Cartesian3.fromDegrees(i[0],i[1]),s=this.Cesium.Cartesian3.fromDegrees(s[0],s[1]);else return!1;return this.positions=[this.Cesium.Cartesian3.clone(i),this.Cesium.Cartesian3.clone(s)],this._createLineEntity(),this._createArrowEntity(),this._createControlPoints(),this._finalized=!0,this._finalizeEntities(),this.state="endCreate",t&&t(this.entity||this.lineEntity),!0}updatePositions(e){if(!e||e.length<2)return!1;let t=e[0],i=e[1];if(!(t instanceof this.Cesium.Cartesian3))if(Array.isArray(t)&&t.length>=2)t=this.Cesium.Cartesian3.fromDegrees(t[0],t[1]),i=this.Cesium.Cartesian3.fromDegrees(i[0],i[1]);else return!1;return this.positions=[this.Cesium.Cartesian3.clone(t),this.Cesium.Cartesian3.clone(i)],this.lineEntity||this._createLineEntity(),this.arrowEntity||this._createArrowEntity(),this._createControlPoints(),this._finalized=!0,this._finalizeEntities(),!0}setStyle(e){if(!e)return;this.style=Object.assign(this.style||{},e),e.arrowAngle!==void 0&&(this.arrowAngle=e.arrowAngle);const t=this._getMaterial();if(this.lineEntity&&this.lineEntity.polyline){try{this.lineEntity.polyline.material=t}catch{}if(e.width!==void 0)try{this.lineEntity.polyline.width=e.width}catch{}}if(this.arrowEntity&&this.arrowEntity.polyline)try{this.arrowEntity.polyline.material=t}catch{}}endCreate(e){if(this.state!=="endCreate"){if(this.state="endCreate",this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}if(this._finalized=!0,this._finalizeEntities(),this.handler){try{this.handler.destroy()}catch{}this.handler=null}try{this.forbidDrawWorld(!1)}catch{}e&&e(this.entity||this.lineEntity)}}done(e){this.isDrawing&&(this.isDrawing=!1,this.endCreate(e))}getEntity(){return this.entity||this.lineEntity}destroy(){this._cleanup(!0),this.state=null}_cleanup(e=!0){if(this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this._editRenderHandler){try{this._editRenderHandler.destroy()}catch{}this._editRenderHandler=null}if(e){if(this.lineEntity){try{this.viewer.entities.remove(this.lineEntity)}catch{}this.lineEntity=null}if(this.arrowEntity){try{this.viewer.entities.remove(this.arrowEntity)}catch{}this.arrowEntity=null}this.controlPoints&&this.controlPoints.length&&(this.controlPoints.forEach(t=>{try{this.viewer.entities.remove(t)}catch{}}),this.controlPoints=[]),this.entity=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}this.positions=[],this.isDrawing=!1,this._finalized=!1;try{this.forbidDrawWorld(!1)}catch{}}_getMaterial(){try{let e=this.style.color||this.Cesium.Color.RED;typeof e=="string"&&(e=this.Cesium.Color.fromCssColorString(e));const t=this.style.colorAlpha!==void 0?this.style.colorAlpha:1;return e.withAlpha(t)}catch{return this.Cesium.Color.RED}}}class Cy{constructor(e,t){if(!e){console.warn("缺少必要参数!--viewer");return}if(t=t||{},this.viewer=e,this.Cesium=window.Cesium||window.cesium,this.entityObjArr=[],this.handler=null,!this.Cesium){console.error("Cesium实例未找到!");return}this.removeHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.startEditFun=null,this.endEditFun=null,this.removeFun=null,this.editingFun=void 0,this.deleteEntityObj=null,this.bindEdit(),this.bindRemove(),this.canEdit=t.canEdit==null?!0:t.canEdit,this.fireEdit=t.fireEdit==null?!0:t.fireEdit,this.nowDrawEntityObj=null,this.nowEditEntityObj=null}on(e,t){e=="startEdit"&&(this.startEditFun=t),e=="endEdit"&&(this.endEditFun=t),e=="remove"&&(this.removeFun=t),e=="endCreate"&&(this.endCreateFun=t),e=="editing"&&(this.editingFun=t)}openEdit(){this.canEdit=!0}closeEdit(){this.endEdit(),this.canEdit=!1}start(e){if(!e||!e.type)return;e.id=e.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));let t=this;this.endEdit(),this.nowDrawEntityObj&&(this.nowDrawEntityObj.state=="startCreate"||this.nowDrawEntityObj.state=="creating")&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null);let i=this.createByType(e);if(i)return i.attr=e||{},i.start(function(s){t.nowDrawEntityObj=void 0,t.entityObjArr.push(i),e.success&&e.success(i,s),t.endCreateFun&&t.endCreateFun(i,s),e.show==!1&&i.setVisible(!1),t.canEdit&&t.fireEdit&&(i.startEdit(function(){t.editingFun&&t.editingFun(i,i.entity)}),t.nowEditEntityObj=i,t.startEditFun&&t.startEditFun(i,s))}),this.nowDrawEntityObj=i,i}end(){this.nowDrawEntityObj}startEditOne(e){if(!this.canEdit)return;this.nowEditEntityObj&&(this.nowEditEntityObj.endEdit(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=null);let t=this;e&&(e.startEdit(function(){t.editingFun&&t.editingFun(e,e.entity)}),this.startEditFun&&this.startEditFun(e,e.getEntity()),this.nowEditEntityObj=e)}updateOneStyle(e,t){e&&e.setStyle(t)}createByPositions(e){if(e=e||{},e||(e={}),!e.positions)return;e.id=e.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));let t=this,i=this.createByType(e);if(i)return i.attr=e,i.createByPositions(e.positions,function(s){t.entityObjArr.push(i),i.setStyle(e.style),e.success&&e.success(i,s),t.endCreateFun&&t.endCreateFun(i,s),e.show==!1&&i.setVisible(!1),t.canEdit&&t.fireEdit&&(i.startEdit(function(){t.editingFun&&t.editingFun(i,i.entity)}),t.startEditFun&&t.startEditFun(i,s),t.nowEditEntityObj=i)}),i}createByGeojson(e){let{features:t}=e,i=[];for(let s=0;s<t.length;s++){let r=t[s];const{properties:a,geometry:c}=r;let l=a.plotType;const d=c.type,h=c.coordinates;let f=[],p="";switch(d){case"LineString":f=ae.lnglatsToCartesians(h),p="polyline";break;case"Polygon":f=ae.lnglatsToCartesians(h[0]),p="polygon";break;case"Point":f=ae.lnglatsToCartesians([h])[0],p=l;break}this.fireEdit=!1;let u=this.createByPositions({type:p,styleType:l,positions:f,style:a.style});u&&i.push(u)}return i}toGeojson(){let e={type:"FeatureCollection",features:[]};if(this.entityObjArr.length==0)return null;for(let t=0;t<this.entityObjArr.length;t++){let i=this.entityObjArr[t],s=i.getPositions(!0),r=[];for(let d=0;d<s.length;d++)r.push([s[d][0],s[d][1]]);let a=i.getStyle(),c=this.transType(i.type),l={type:"Feature",properties:{plotType:i.type,style:a},geometry:{type:c,coordinates:[]}};switch(c){case"Polygon":l.geometry.coordinates=[r];break;case"Point":l.geometry.coordinates=r;break;case"LineString":l.geometry.coordinates=r;break}l.properties=Object.assign(l.properties,i.properties),e.features.push(l)}return e}transType(e){let t="";switch(e){case"polyline":t="LineString";break;case"polygon":t="Polygon";break;case"point":case"gltfModel":case"label":case"billboard":t="Point";break;default:t=e}return t}destroy(){this.nowEditEntityObj&&(this.nowEditEntityObj.destroy(),this.nowEditEntityObj=null),this.nowDrawEntityObj&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].destroy();this.entityObjArr=[],this.nowEditEntityObj=null,this.handler&&(this.handler.destroy(),this.handler=null),this.removeHandler&&(this.removeHandler.destroy(),this.removeHandler=null)}removeOne(e){e&&e&&(e.state!="endCreate"||e.state!="endEdit"?e.destroy():this.removeByObjId(e.objId))}removeAll(){this.nowDrawEntityObj&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null),this.nowEditEntityObj&&(this.nowEditEntityObj.destroy(),this.nowEditEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].destroy();this.entityObjArr=[],this.nowEditEntityObj=null}hasEntityObj(e){return e?this.getEntityObjByObjId(e.objId)!={}:!1}removeByObjId(e){let t=this.getEntityObjByObjId(e);this.entityObjArr.splice(t.index,1),this.removeFun&&this.removeFun(t.entityObj,t.entityObj.getEntity()),t.entityObj&&t.entityObj.destroy()}removeById(e){let t=this.getEntityObjById(e);this.entityObjArr.splice(t.index,1),this.removeFun&&this.removeFun(t.entityObj,t.entityObj.getEntity()),t.entityObj&&t.entityObj.destroy()}zoomToByObjId(e){let t=this.getEntityObjByObjId(e);t.entityObj&&t.entityObj.zoomTo()}getEntityObjByField(e,t){let i={};if(t)for(let s=0;s<this.entityObjArr.length;s++){let r=this.entityObjArr[s];if(r.attr[e]==t){i.entityObj=r,i.index=s;break}}else for(let s=0;s<this.entityObjArr.length;s++){let r=this.entityObjArr[s];if(r.attr.id==e){i.entityObj=r,i.index=s;break}}return i}setVisible(e,t){let i=this.getEntityObjByField("id",e);i.entityObj&&i.entityObj.setVisible(t)}getEntityObjByObjId(e){if(!e)return;let t={};for(let i=0;i<this.entityObjArr.length;i++){let s=this.entityObjArr[i];if(s.objId==e){t.entityObj=s,t.index=i;break}}return t}getEntityObjById(e){if(!e)return;let t={};for(let i=0;i<this.entityObjArr.length;i++){let s=this.entityObjArr[i];if(s.attr.id==e){t.entityObj=s,t.index=i;break}}return t}bindEdit(){let e=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){if(!e.canEdit||e.nowDrawEntityObj)return;const i=e.viewer.scene.drillPick(t.position)||[];let s=-1,r;for(let a=0;a<i.length&&s===-1;a++){const c=i[a].id;if(c){for(let l=0;l<e.entityObjArr.length;l++)if(c.objId==e.entityObjArr[l].objId&&e.entityObjArr[l].state!="startCreate"&&e.entityObjArr[l].state!="creating"){s=l,r=c;break}}}s!==-1?(e.nowEditEntityObj&&(e.nowEditEntityObj.endEdit(),e.endEditFun&&e.endEditFun(e.nowEditEntityObj,e.nowEditEntityObj.getEntity()),e.nowEditEntityObj=null),e.entityObjArr[s].startEdit(function(){e.editingFun&&e.editingFun(e.nowEditEntityObj,e.nowEditEntityObj.entity)}),e.startEditFun&&e.startEditFun(e.entityObjArr[s],r),e.nowEditEntityObj=e.entityObjArr[s]):e.nowEditEntityObj&&(e.nowEditEntityObj.endEdit(),e.endEditFun&&e.endEditFun(e.nowEditEntityObj,e.nowEditEntityObj.getEntity()),e.nowEditEntityObj=void 0)},Cesium.ScreenSpaceEventType.LEFT_CLICK)}bindRemove(){let e=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){if(!e.canEdit||e.nowDrawEntityObj)return;const i=e.viewer.scene.drillPick(t.position)||[];let s;for(let r=0;r<i.length;r++){const a=i[r].id;if(a){for(let c=0;c<e.entityObjArr.length;c++)if(a.objId==e.entityObjArr[c].objId){s=a.objId;break}if(s)break}}s&&e.createDelteDom(t.position,s)},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}createDelteDom(e,t){if(!t)return;let i=window.document.createElement("span");i.style.background="rgba(0,0,0,0.5)",i.style.position="absolute",i.style.color="white",i.style.left=e.x+10+"px",i.style.top=e.y+10+"px",i.style.padding="4px",i.style.cursor="pointer",i.id="easy3d-plot-delete",i.setAttribute("objId",t),i.innerHTML="删除",window.document.getElementById(this.viewer.container.id).appendChild(i);const r=window.document.getElementById("easy3d-plot-delete");if(!r)return;let a=this;r.addEventListener("click",c=>{let l=i.getAttribute("objId");a.removeByObjId(l)}),document.addEventListener("click",function(){r.remove()})}endEdit(){this.nowEditEntityObj&&(this.nowEditEntityObj.endEdit(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].endEdit()}done(){this.nowEditEntityObj&&(this.nowEditEntityObj.done(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=void 0),this.nowDrawEntityObj&&(this.nowDrawEntityObj.done(),this.entityObjArr.push(this.nowDrawEntityObj),this.endCreateFun&&this.endCreateFun(this.nowDrawEntityObj,this.nowDrawEntityObj.getEntity()),this.nowDrawEntityObj=void 0)}getEntityObjArr(){return this.entityObjArr}createByType(e){let t,i="";return e=e||{},e.type=="polyline"&&(t=new gy(this.viewer,e.style),i="折线_"),e.type=="freehandLine"&&(t=new Ay(this.viewer,e.style),i="手绘线_"),e.type=="polygon"&&(t=new py(this.viewer,e.style),i="面_"),e.type=="billboard"&&(t=new Np(this.viewer,e.style),i="图标_"),(e.type=="circle"||e.type=="ellipse")&&(t=new Fp(this.viewer,e.style),i="圆_"),e.type=="rectangle"&&(t=new my(this.viewer,e.style),i="矩形_"),e.type=="gltfModel"&&(t=new Rp(this.viewer,e.style),i="模型_"),e.type=="point"&&(t=new fy(this.viewer,e.style),i="点_"),e.type=="label"&&(t=new hy(this.viewer,e.style),i="文字_"),e.type=="arrow"&&(t=new yy(this.viewer,e.style)),t&&(t.name=i+new Date().getTime()),t}}class rl{viewer;Cesium;drawTool;flatTool;tileset;tilesets;flatTools;selectedEntityObj;selectionOutline;centerHandle;_dragHandler;_listeners;currentColor;currentWidth;originalDoubleClickAction=null;constructor({viewer:e,cesium:t}){window.Cesium=t,this.viewer=e,this.Cesium=t,this.drawTool=null,this.flatTool=null,this.tileset=null,this.tilesets=null,this.flatTools=null,this.selectedEntityObj=null,this.selectionOutline=null,this.centerHandle=null,this._dragHandler=null,this._listeners=[],this.currentColor=this.Cesium.Color.fromCssColorString("#ff0000"),this.currentWidth=1,this.originalDoubleClickAction=this.viewer.screenSpaceEventHandler.getInputAction(this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.viewer.screenSpaceEventHandler.removeInputAction(this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.initDrawTool()}setCurrentColor(e){typeof e=="string"?this.currentColor=this.Cesium.Color.fromCssColorString(e):this.currentColor=e}setCurrentWidth(e){this.currentWidth=e}initDrawTool(){this.drawTool||(this.drawTool=new Cy(this.viewer,{canEdit:!0,fireEdit:!0}),this.drawTool.on("startEdit",(e,t)=>{this.selectedEntityObj=e,this.showEntityOutline(e)}),this.drawTool.on("endEdit",(e,t)=>{this.selectedEntityObj=null,this.hideEntityOutline()}),this.drawTool.on("remove",(e,t)=>{this.selectedEntityObj===e&&(this.selectedEntityObj=null,this.hideEntityOutline())}))}showEntityOutline(e){this.hideEntityOutline(),!(!e||!e.getEntity())&&this.createCenterHandle(e)}hideEntityOutline(){if(this.selectionOutline){try{this.viewer.entities.remove(this.selectionOutline)}catch{}this.selectionOutline=null}if(this.centerHandle){try{this.viewer.entities.remove(this.centerHandle)}catch{}this.centerHandle=null}if(this._dragHandler){try{this._dragHandler.destroy()}catch{}this._dragHandler=null}}createCenterHandle(e){if(!e||!e.getEntity())return;if(this.centerHandle){try{this.viewer.entities.remove(this.centerHandle)}catch{}this.centerHandle=null}const t=e.getEntity();let i=null;if(t._plotInstance&&typeof t._plotInstance.syncFromEntity=="function")try{t._plotInstance.syncFromEntity();const s=t._plotInstance;s.leftup&&s.rightdown&&(i=this.Cesium.Cartesian3.midpoint(s.leftup,s.rightdown,new this.Cesium.Cartesian3))}catch(s){console.warn("plotInstance.syncFromEntity failed",s)}if(!i){if(e.positions&&e.positions.length)i=this.calculateCenter(e.positions);else if(t.position&&t.position.getValue)i=t.position.getValue();else if(t.polyline&&t.polyline.positions&&t.polyline.positions.getValue){const s=t.polyline.positions.getValue();i=this.calculateCenter(s)}else if(t.polygon&&t.polygon.hierarchy&&t.polygon.hierarchy.getValue){const s=t.polygon.hierarchy.getValue().positions;i=this.calculateCenter(s)}else if(t.rectangle&&t.rectangle.coordinates&&t.rectangle.coordinates.getValue)try{const s=t.rectangle.coordinates.getValue(),r=(s.west+s.east)/2,a=(s.south+s.north)/2;i=this.Cesium.Cartesian3.fromRadians(r,a,0)}catch{}}i&&(this.centerHandle=this.viewer.entities.add({position:i,point:{pixelSize:10,color:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLUE,outlineWidth:2}}),this.addDragHandler(e,i))}calculateCenter(e){if(!e||e.length===0)return null;const t=e.map(a=>a);let i=0,s=0,r=0;for(let a=0;a<t.length;a++)i+=t[a].x,s+=t[a].y,r+=t[a].z;return new this.Cesium.Cartesian3(i/t.length,s/t.length,r/t.length)}getEntityPositions(e){const t=e.getEntity();if(e.positions&&Array.isArray(e.positions))return e.positions.slice();if(t.polyline&&t.polyline.positions&&t.polyline.positions.getValue){const i=t.polyline.positions.getValue();return Array.isArray(i)?i.slice():[]}if(t.polygon&&t.polygon.hierarchy&&t.polygon.hierarchy.getValue){const i=t.polygon.hierarchy.getValue();return i&&i.positions?i.positions.slice():[]}if(t.position&&t.position.getValue)return[t.position.getValue()];if(t.rectangle&&t.rectangle.coordinates&&t.rectangle.coordinates.getValue){const i=t.rectangle.coordinates.getValue();return[this.Cesium.Cartesian3.fromDegrees(i.west,i.south),this.Cesium.Cartesian3.fromDegrees(i.east,i.south),this.Cesium.Cartesian3.fromDegrees(i.east,i.north),this.Cesium.Cartesian3.fromDegrees(i.west,i.north)]}return[]}addDragHandler(e,t){if(console.log("移动线段"),this._dragHandler){try{this._dragHandler.destroy()}catch{}this._dragHandler=null}let i=!1,s,r=0;const a=16,c=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);this._dragHandler=c;const l=d=>{let h;try{h=this.viewer.scene.pickPosition(d)}catch{}if(!this.Cesium.defined(h)){const f=this.viewer.camera.getPickRay(d);f&&(h=this.viewer.scene.globe.pick(f,this.viewer.scene))}return this.Cesium.defined(h)||(h=this.viewer.scene.camera.pickEllipsoid(d,this.viewer.scene.globe.ellipsoid)),h};c.setInputAction(d=>{let h=!1;const f=this.viewer.scene.drillPick(d.position)||[];for(let p=0;p<f.length;p++){const u=f[p].id;if(u&&u===this.centerHandle){h=!0;break}}if(h){i=!0;const p=l(d.position);this.Cesium.defined(p)&&(s=p.clone()),r=performance.now(),this.viewer.scene.screenSpaceCameraController.enableRotate=!1,this.viewer.scene.screenSpaceCameraController.enableTranslate=!1,this.viewer.scene.screenSpaceCameraController.enableZoom=!1,this.viewer.scene.screenSpaceCameraController.enableTilt=!1,this.viewer.scene.screenSpaceCameraController.enableLook=!1}},this.Cesium.ScreenSpaceEventType.LEFT_DOWN),c.setInputAction(d=>{if(!i||!this.Cesium.defined(s))return;const h=performance.now();if(h-r<a)return;r=h;const f=l(d.endPosition);if(!this.Cesium.defined(f))return;const p=this.Cesium.Cartesian3.subtract(f,s,new this.Cesium.Cartesian3);if(this.centerHandle&&this.centerHandle.position&&this.centerHandle.position.setValue){const u=this.centerHandle.position.getValue(this.Cesium.JulianDate.now());if(u){const m=this.Cesium.Cartesian3.add(u,p,new this.Cesium.Cartesian3);this.centerHandle.position.setValue(m)}}this.moveEntity(e,p);try{this.viewer.scene.requestRender()}catch{}s=f.clone()},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE),c.setInputAction(()=>{if(i){i=!1,this.viewer.scene.screenSpaceCameraController.enableRotate=!0,this.viewer.scene.screenSpaceCameraController.enableTranslate=!0,this.viewer.scene.screenSpaceCameraController.enableZoom=!0,this.viewer.scene.screenSpaceCameraController.enableTilt=!0,this.viewer.scene.screenSpaceCameraController.enableLook=!0;const d=e.getEntity();if(d.state="done",d&&d.rectangle&&d.rectangle.coordinates)try{const h=d.rectangle.coordinates.getValue?d.rectangle.coordinates.getValue():d.rectangle.coordinates;h&&d.rectangle.coordinates.setValue(h)}catch(h){console.warn("Failed to refresh rectangle coordinates",h)}e&&this.selectedEntityObj!==e&&this.showEntityOutline(e)}},this.Cesium.ScreenSpaceEventType.LEFT_UP)}moveEntity(e,t){const i=e.getEntity();if(!i)return;const s=r=>this.Cesium.Cartesian3.add(r,t,new this.Cesium.Cartesian3);if(i.position){const r=i.position.getValue?i.position.getValue():i.position,a=s(r);i.position.setValue?i.position.setValue(a):i.position=a,i.state="moving",e.positions&&e.positions.length===1&&(e.positions[0]=a);return}if(i.polyline){if(i._plotInstance&&i._plotInstance.type==="rectangle"&&typeof i._plotInstance.updatePositions=="function")try{const c=new this.Cesium.Cartesian3(t.x,t.y,t.z);if(i._plotInstance.updatePositions([c]))return}catch(c){console.warn("Failed to update rectangle positions:",c)}if(i._plotInstance&&i._plotInstance.type==="circle"&&typeof i._plotInstance.updatePositions=="function")try{const c=new this.Cesium.Cartesian3(t.x,t.y,t.z);if(i._plotInstance.updatePositions([c]))return}catch(c){console.warn("Failed to update circle positions:",c)}const a=(e.positions&&Array.isArray(e.positions)?e.positions:i.polyline.positions.getValue?i.polyline.positions.getValue():[]).map(c=>s(c));if(e.updatePositions&&typeof e.updatePositions=="function")e.updatePositions(a);else if(e.positions&&Array.isArray(e.positions)&&(e.positions=a),i.polyline&&i.polyline.positions)try{i.polyline.positions instanceof this.Cesium.CallbackProperty||(i.polyline.positions=a)}catch{i.polyline.positions=a}}}startFreehandLine(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"freehandLine",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t,smoothness:2,minDistance:.01,angleThreshold:.8,renderInterval:16,curveResolution:3},e)})}startArrow(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"arrow",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t},e)})}startStraightLine(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"polyline",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t},e)})}startEllipse(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"circle",style:Object.assign({color:this.currentColor.withAlpha(1),outlineColor:this.currentColor,outlineWidth:this.currentWidth,outline:!0,fill:!1,clampToGround:!t},e)})}startImage(e,t){this.initDrawTool();const i=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"billboard",style:Object.assign({image:e,width:t&&t.width?t.width:50,height:t&&t.height?t.height:50,clampToGround:!i},t)})}startRectangle(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"rectangle",style:Object.assign({color:this.currentColor.withAlpha(1),outlineColor:this.currentColor,outlineWidth:this.currentWidth,clampToGround:!t},e)})}clearAll(){this.drawTool&&this.drawTool.removeAll(),this.hideEntityOutline()}destroy(){this.clearAll(),this.originalDoubleClickAction&&(this.viewer.screenSpaceEventHandler.setInputAction(this.originalDoubleClickAction,this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.originalDoubleClickAction=null)}getAllEntities(){return this.drawTool&&typeof this.drawTool.getEntityObjArr=="function"?this.drawTool.getEntityObjArr():[]}saveAnnotations(){try{const e=this.getAllEntities(),t={freehand:[],arrow:[],text:[],image:[],polyline:[],rectangle:[],ellipse:[],other:[]};e.forEach(r=>{if(r&&typeof r=="object"){const a=r.type||r.constructor&&r.constructor.name,c={type:a,style:{}};switch(!0){case["freehandLine","CreateFreehandLine","polyline","CreatePolyline","arrow","CreateArrow"].includes(a):c.id=r.objId||r.id||Date.now().toString(),r.style&&(c.style={color:r.style.color,width:r.style.width,opacity:r.style.opacity,...r.style}),r.positions&&Array.isArray(r.positions)&&(c.positions=r.positions.map(l=>l&&typeof l=="object"&&l.x!==void 0&&l.y!==void 0&&l.z!==void 0?{x:l.x,y:l.y,z:l.z}:l)),["freehandLine","CreateFreehandLine"].includes(a)&&(c.isEdit=r.isEdit!==void 0?r.isEdit:!0,c.isFreehand=!0);break;case["rectangle","CreateRectangle"].includes(a):try{c.id=r.objId||r.id||Date.now().toString();let l=[];if(r.positions&&Array.isArray(r.positions)&&r.positions.length)l=r.positions.map(d=>({x:d.x,y:d.y,z:d.z}));else{const d=r.getEntity?r.getEntity():r;if(d)try{if(d.polyline&&d.polyline.positions&&d.polyline.positions.getValue){const h=d.polyline.positions.getValue(this.viewer.clock.currentTime);Array.isArray(h)&&(l=h.map(f=>({x:f.x,y:f.y,z:f.z})))}else if(d.rectangle&&d.rectangle.coordinates&&d.rectangle.coordinates.getValue){const h=d.rectangle.coordinates.getValue(this.viewer.clock.currentTime);l=[{west:h.west,south:h.south,east:h.east,north:h.north}]}}catch{}}r.style&&(c.style=Object.assign({},r.style)),l&&l.length&&(c.positions=l)}catch{}break;case["ellipse","CreateEllipse","circle","CreateCircle"].includes(a):try{c.id=r.objId||r.id||Date.now().toString();let l=[];const d=r.getEntity?r.getEntity():r;if(d&&d._plotInstance&&d._plotInstance.type==="circle"&&d._plotInstance.center&&d._plotInstance.radiusPoint){const h=d._plotInstance;l=[{x:h.center.x,y:h.center.y,z:h.center.z},{x:h.radiusPoint.x,y:h.radiusPoint.y,z:h.radiusPoint.z}]}else if(r.positions&&Array.isArray(r.positions)&&r.positions.length)l=r.positions.map(h=>({x:h.x,y:h.y,z:h.z}));else if(d)try{if(d.polyline&&d.polyline.positions&&d.polyline.positions.getValue){const h=d.polyline.positions.getValue(this.viewer.clock.currentTime);Array.isArray(h)&&(l=h.map(f=>({x:f.x,y:f.y,z:f.z})))}else if(d.ellipse&&d.ellipse.center&&d.ellipse.center.getValue&&d.ellipse.semiMajorAxis&&d.ellipse.semiMajorAxis.getValue){const h=d.ellipse.center.getValue(this.viewer.clock.currentTime),f=d.ellipse.semiMajorAxis.getValue(this.viewer.clock.currentTime);if(h&&f){const p={x:h.x,y:h.y,z:h.z||0},u={x:p.x+f,y:p.y,z:p.z};l=[p,u]}}}catch{}r.style&&(c.style=Object.assign({},r.style)),l&&l.length&&(c.positions=l)}catch{}break;case["label","CreateLabel"].includes(a):if(r.style)c.style=Object.assign({},r.style);else try{const l=r.getEntity?r.getEntity():r;if(l&&l.label){const d={};try{const h=l.label.fillColor&&l.label.fillColor.getValue?l.label.fillColor.getValue(this.viewer.clock.currentTime):l.label.fillColor;h&&(d.color=h)}catch{}l.label.font&&(d.font=l.label.font),c.style=d}}catch{}if(r.text)c.text=r.text;else try{const l=r.getEntity?r.getEntity():r;if(l&&l.label&&l.label.text){const d=l.label.text.getValue?l.label.text.getValue(this.viewer.clock.currentTime):l.label.text;d&&(c.text=d)}}catch{}if(r.position)c.position=r.position;else try{const l=r.getEntity?r.getEntity():r;if(l&&l.position&&l.position.getValue){const d=l.position.getValue(this.viewer.clock.currentTime);d&&(c.position={x:d.x,y:d.y,z:d.z})}}catch{}break;case["billboard","CreateBillboard"].includes(a):if(r.style)c.style=Object.assign({},r.style);else try{const l=r.getEntity?r.getEntity():r;if(l&&l.billboard){const d={};try{const h=l.billboard.image&&l.billboard.image.getValue?l.billboard.image.getValue(this.viewer.clock.currentTime):l.billboard.image;if(h){if(typeof h=="string")d.image=h;else if(h&&h.src)try{const f=h;if(typeof document<"u"&&f instanceof HTMLImageElement){const p=document.createElement("canvas");p.width=f.naturalWidth||f.width||1,p.height=f.naturalHeight||f.height||1;const u=p.getContext("2d");u?(u.drawImage(f,0,0),d.image=p.toDataURL()):d.image=f.src}else d.image=h.src}catch{d.image=h.src}}}catch{}l.billboard.width&&(d.width=l.billboard.width),l.billboard.height&&(d.height=l.billboard.height),c.style=d}}catch{}if(r.position)c.position=r.position;else try{const l=r.getEntity?r.getEntity():r;if(l&&l.position&&l.position.getValue){const d=l.position.getValue(this.viewer.clock.currentTime);d&&(c.position={x:d.x,y:d.y,z:d.z})}}catch{}break;default:r.style&&(c.style=r.style),r.position&&(c.position=r.position);break}switch(!0){case["freehandLine","CreateFreehandLine"].includes(a):t.freehand.push(c);break;case["arrow","CreateArrow"].includes(a):t.arrow.push(c);break;case["label","CreateLabel"].includes(a):t.text.push(c);break;case["billboard","CreateBillboard"].includes(a):t.image.push(c);break;case["polyline","CreatePolyline"].includes(a):t.polyline.push(c);break;case["rectangle","CreateRectangle"].includes(a):t.rectangle.push(c);break;case["ellipse","CreateEllipse","circle","CreateCircle"].includes(a):t.ellipse.push(c);break;default:t.other.push(c)}}});const i={version:"1.0",exportTime:new Date().toISOString(),totalEntities:e.length,annotations:t},s=JSON.stringify(i);return console.log("标注数据已按类型分类保存,只包含重绘所需信息:",s),s}catch(e){return console.error("保存标注失败:",e),!1}}loadAnnotations(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(!t.annotations)return console.error("标注数据格式错误,缺少annotations字段"),!1;const i=t.annotations;let s=0;const r=(a,c)=>{Array.isArray(a)&&a.forEach(l=>{if(l.style){if(l.style.color&&typeof l.style.color=="object"){const d=l.style.color;l.style.color=`rgba(${Math.round(d.red*255)}, ${Math.round(d.green*255)}, ${Math.round(d.blue*255)}, ${d.alpha||1})`}if(l.style.outlineColor&&typeof l.style.outlineColor=="object"){const d=l.style.outlineColor;l.style.outlineColor=`rgba(${Math.round(d.red*255)}, ${Math.round(d.green*255)}, ${Math.round(d.blue*255)}, ${d.alpha||1})`}}switch(c){case"freehand":case"polyline":case"arrow":if(l.positions&&l.positions.length>0){const d=l.positions.map(p=>p&&typeof p=="object"?new this.Cesium.Cartesian3(p.x,p.y,p.z):p),h={type:c==="freehand"?"freehandLine":c,style:l.style||{},positions:d,id:l.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))},f=this.drawTool.createByPositions(h);if(f&&f.getEntity()){s++,f.isEdit=!0;const p=f.getEntity();p&&!p._plotInstance&&(p._plotInstance=f),p&&!p.objId&&(p.objId=f.objId),console.log(`Loaded ${c} entity with objId: ${f.objId}`)}}break;case"rectangle":{try{if(l.positions&&l.positions.length){let d=[];if(l.positions[0]&&l.positions[0].x!==void 0)d=l.positions.map(h=>new this.Cesium.Cartesian3(h.x,h.y,h.z!==void 0?h.z:0));else if(l.positions[0]&&l.positions[0].west!==void 0){const h=l.positions[0];d=[this.Cesium.Cartesian3.fromRadians(h.west,h.south),this.Cesium.Cartesian3.fromRadians(h.east,h.south),this.Cesium.Cartesian3.fromRadians(h.east,h.north),this.Cesium.Cartesian3.fromRadians(h.west,h.north),this.Cesium.Cartesian3.fromRadians(h.west,h.south)]}if(d.length){const h=JSON.parse(JSON.stringify(l.style||{}));if(h.color&&typeof h.color=="string"&&!h.color.startsWith("rgba"))try{const u=JSON.parse(h.color);u.red!==void 0&&(h.color=`rgba(${Math.round(u.red*255)}, ${Math.round(u.green*255)}, ${Math.round(u.blue*255)}, ${u.alpha||1})`)}catch{}const f={type:"rectangle",positions:d,style:h,id:l.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let p=null;try{p=this.drawTool.createByPositions(f)}catch(u){console.warn("drawTool.createByPositions(rectangle) failed",u)}if(p){s++,p.isEdit=!0;const u=p.getEntity?p.getEntity():p.entity||p;u&&(u._plotInstance=p,u.objId=p.objId||l.id,u.pickable=!0,u.polyline&&(u.polyline.pickWidth=10),console.log(`Loaded rectangle entity with objId: ${u.objId}, color: ${h.color}`))}}}}catch(d){console.warn("load rectangle failed",d)}break}case"text":if(l.position){const d=l.text||"文字标注",h={type:"label",style:l.style||{},text:d,position:new this.Cesium.Cartesian3(l.position.x,l.position.y,l.position.z||0)};h.style.fontSize||(h.style.fontSize=14),h.style.fontFamily||(h.style.fontFamily="Arial");let f;try{!h.positions&&h.position&&(h.positions=h.position),f=this.drawTool.createByPositions(h),!f&&this.drawTool.startText&&(console.log("使用startText创建文字"),this.drawTool.startText(h.style),this.drawTool.currentEntity&&(this.drawTool.currentEntity.text=d,this.drawTool.currentEntity.position=h.position,f=this.drawTool.currentEntity))}catch(p){console.log("创建文字失败",p)}if(!f)try{const p=this.viewer.entities.add({position:h.position,label:Object.assign({text:d,font:h.style&&h.style.font||"14pt Source Han Sans CN",fillColor:h.style&&h.style.fillColor||this.Cesium.Color.WHITE,outlineColor:h.style&&h.style.outlineColor||this.Cesium.Color.BLACK,outlineWidth:h.style&&h.style.outlineWidth||2,verticalOrigin:h.style&&h.style.verticalOrigin||this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:h.style&&h.style.pixelOffset||new this.Cesium.Cartesian2(0,-10)},h.style&&h.style.label?h.style.label:{})}),u={getEntity:()=>p,entity:p,style:h.style||{},type:"label",objId:l.id||`label_${Date.now()}_${Math.random().toFixed(3)}`,isEdit:!0,destroy:()=>this.viewer.entities.remove(p)};try{p.objId=u.objId}catch{}this.drawTool&&(this.drawTool.entityObjArr||(this.drawTool.entityObjArr=[]),this.drawTool.entityObjArr.push(u)),f=u}catch(p){console.warn("回退创建文字实体失败",p)}f&&(s++,f.isEdit=!0)}break;case"image":if(l.position){const d={type:"billboard",style:l.style||{},position:new this.Cesium.Cartesian3(l.position.x,l.position.y,l.position.z||0)};d.style.image||(console.log("使用默认图片占位符"),d.style.image="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDUwIDUwIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNlNTMyMzIiLz48L3N2Zz4="),d.style.width||(d.style.width=50),d.style.height||(d.style.height=50);let h;try{!d.positions&&d.position&&(d.positions=d.position),h=this.drawTool.createByPositions(d),!h&&this.drawTool.startImage&&(console.log("使用startImage创建图片"),this.drawTool.startImage(d.style.image,d.style),this.drawTool.currentEntity&&(this.drawTool.currentEntity.position=d.position,h=this.drawTool.currentEntity))}catch(f){console.log("创建图片失败",f)}if(!h)try{const f=d.style&&d.style.image?d.style.image:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDUwIDUwIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNlNTMyMzIiLz48L3N2Zz4=",p=this.viewer.entities.add({position:d.position,billboard:{image:f,width:d.style&&d.style.width?d.style.width:50,height:d.style&&d.style.height?d.style.height:50,verticalOrigin:d.style&&d.style.verticalOrigin||this.Cesium.VerticalOrigin.CENTER,scale:d.style&&d.style.scale||1}}),u={getEntity:()=>p,entity:p,style:d.style||{},type:"billboard",objId:l.id||`billboard_${Date.now()}_${Math.random().toFixed(3)}`,isEdit:!0,destroy:()=>this.viewer.entities.remove(p)};try{p.objId=u.objId}catch{}this.drawTool&&(this.drawTool.entityObjArr||(this.drawTool.entityObjArr=[]),this.drawTool.entityObjArr.push(u)),h=u}catch(f){console.warn("回退创建图片实体失败",f)}h&&(s++,h.isEdit=!0)}break;case"ellipse":case"circle":{try{const d=JSON.parse(JSON.stringify(l.style||{}));if(d.color&&typeof d.color=="string"&&!d.color.startsWith("rgba"))try{const p=JSON.parse(d.color);p.red!==void 0&&(d.color=`rgba(${Math.round(p.red*255)}, ${Math.round(p.green*255)}, ${Math.round(p.blue*255)}, ${p.alpha||1})`)}catch{}let h=[],f=!1;if(l.positions&&l.positions.length&&(l.positions[0]&&l.positions[0].x!==void 0&&(h=l.positions.map(p=>new this.Cesium.Cartesian3(p.x,p.y,p.z!==void 0?p.z:0))),h.length)){const p={type:c,positions:h,style:d,id:l.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let u=null;try{if(u=this.drawTool.createByPositions(p),u){s++,u.isEdit=!0;const m=u.getEntity?u.getEntity():u.entity||u;m&&(m._plotInstance=u,m.objId=u.objId||l.id,m.pickable=!0,m.polyline&&(m.polyline.pickWidth=10),console.log(`Loaded ${c} entity with objId: ${m.objId} using positions`)),f=!0}}catch(m){console.warn(`drawTool.createByPositions(${c}) failed`,m)}}if(!f&&l.center&&l.radius)try{const p=new this.Cesium.Cartesian3(l.center.x,l.center.y,l.center.z||0),u=this.Cesium.Cartesian3.add(p,new this.Cesium.Cartesian3(l.radius,0,0),new this.Cesium.Cartesian3),E={type:c,positions:[p,u],style:d,id:l.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let A=null;try{if(A=this.drawTool.createByPositions(E),A){s++,A.isEdit=!0;const b=A.getEntity?A.getEntity():A.entity||A;b&&(b._plotInstance=A,b.objId=A.objId||l.id,b.pickable=!0,b.polyline&&(b.polyline.pickWidth=10),console.log(`Loaded ${c} entity with objId: ${b.objId} using center and radius`))}}catch(b){console.warn(`drawTool.createByPositions(${c}) with center/radius failed`,b)}}catch(p){console.warn(`Fallback creation for ${c} failed`,p)}}catch(d){console.warn(`load ${c} failed`,d)}break}default:console.log(`尝试加载未知类型实体: ${c}`);break}})};return Object.keys(i).forEach(a=>{r(i[a],a)}),console.log(`成功加载 ${s} 个标注实体`),this.drawTool&&typeof this.drawTool.bindEdit=="function"&&this.drawTool.bindEdit(),!0}catch(t){return console.error("加载标注失败:",t),!1}}changeEntityColor(e){try{if(!this.selectedEntityObj)return!1;if(this.selectedEntityObj.setStyle&&typeof this.selectedEntityObj.setStyle=="function")try{return this.selectedEntityObj.setStyle({color:e}),console.log("通过实体对象的setStyle方法修改颜色成功"),!0}catch(s){console.warn("通过setStyle修改颜色失败,尝试直接修改实体:",s)}const t=this.selectedEntityObj.getEntity();if(!t)return!1;let i;try{i=this.Cesium.Color.fromCssColorString(e)}catch(s){console.warn("Invalid color format:",e,s),i=e}if(t.polyline)try{t.polyline.material=new this.Cesium.ColorMaterialProperty(i)}catch{t.polyline.material=i}else if(t.polygon)try{t.polygon.material=new this.Cesium.ColorMaterialProperty(i)}catch{t.polygon.material=i}else if(t.rectangle){const s=t.rectangle.outline,r=t.rectangle.outlineWidth;try{t.rectangle.material=new this.Cesium.ColorMaterialProperty(i)}catch{t.rectangle.material=i}t.rectangle.outlineColor=i,s!==void 0&&(t.rectangle.outline=s),r!==void 0&&(t.rectangle.outlineWidth=r)}else if(t.ellipse||t.circle){const s=t.ellipse||t.circle,r=s.outline,a=s.outlineColor,c=s.outlineWidth;s.material=i,r!==void 0&&(s.outline=r),a!==void 0&&(s.outlineColor=a),c!==void 0&&(s.outlineWidth=c)}return!0}catch(t){return console.error("changeEntityColor failed",t),!1}}changeColor(e){return this.changeEntityColor(e)}setLineWidth(e){if(!this.selectedEntityObj)return!1;const t=this.selectedEntityObj.getEntity();let i=2;if(typeof e=="number")i=e;else switch(e){case"thin":i=2;break;case"medium":i=4;break;case"thick":i=8;break}if(t.polyline)t.polyline.width=i;else if(t.polygon&&t.polygon.outline)t.polygon.outlineWidth=i;else if(t.rectangle&&t.rectangle.outline)t.rectangle.outlineWidth=i;else if((t.ellipse||t.circle)&&(t.ellipse?.outline||t.circle?.outline)){const s=t.ellipse||t.circle;s.outlineWidth=i}return!0}changeWidth(e){return this.setLineWidth(e)}deleteSelectedEntity(){if(!this.selectedEntityObj)return!1;if(typeof this.drawTool.removeOne=="function")this.drawTool.removeOne(this.selectedEntityObj);else if(typeof this.drawTool.remove=="function")this.drawTool.remove(this.selectedEntityObj);else return console.error("No remove method found on drawTool"),!1;return this.selectedEntityObj=null,this.hideEntityOutline(),!0}}class Ps{viewer;cesium;handler=null;measureEntities=[];originalDoubleClickAction=null;onMeasure=()=>{};activePoints=[];floatingPoint=null;activeShape=null;type=null;unit="m";cursorPosition=null;isSnapping=!1;snapIndicator=null;isMobile=!1;lastTapTime=0;tapTimeout=null;originalPickEnabled=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t,this.isMobile="ontouchstart"in window||navigator.maxTouchPoints>0;const i=this.cesium;this.originalDoubleClickAction=this.viewer.screenSpaceEventHandler.getInputAction(i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.viewer.screenSpaceEventHandler.removeInputAction(i.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}setUnit(e){this.unit=e}setSnapping(e){this.isSnapping=e,!e&&this.snapIndicator&&(this.viewer.entities.remove(this.snapIndicator),this.snapIndicator=null)}start(e){const t=this.cesium;this.clearActive(),this.type=e,this.viewer.scene&&this.viewer.scene.screenSpaceCameraController&&(this.originalPickEnabled=this.viewer.scene.screenSpaceCameraController.enableInputs),this.handler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(i=>{if(this.isMobile&&this.type==="area"){const s=Date.now(),r=s-this.lastTapTime;if(this.lastTapTime=s,r<300&&r>0){this.tapTimeout&&(clearTimeout(this.tapTimeout),this.tapTimeout=null),this.finish();return}this.tapTimeout=setTimeout(()=>{const a=this.getPickPosition(i.position);a&&this.addPoint(a),this.tapTimeout=null},300)}else{const s=this.getPickPosition(i.position);s&&this.addPoint(s)}},t.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(i=>{const s=this.getPickPosition(i.endPosition);s&&(this.cursorPosition=s,this.updateFloatingPoint(s))},t.ScreenSpaceEventType.MOUSE_MOVE),this.type==="area"&&!this.isMobile&&this.handler.setInputAction(()=>{this.finish()},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}addPoint(e){const t=this.cesium;this.activePoints.push(e);const i=this.viewer.entities.add({position:e,point:{pixelSize:8,color:t.Color.YELLOW,outlineColor:t.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(this.measureEntities.push(i),this.type==="distance"){if(this.activePoints.length===1)this.onMeasure(null),this.activeShape=this.viewer.entities.add({polyline:{positions:new t.CallbackProperty(()=>{if(this.activePoints.length===0)return[];const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}}),this.measureEntities.push(this.activeShape);else if(this.activePoints.length===2){const s=this.activePoints[0],r=this.activePoints[1];this.activeShape&&(this.viewer.entities.remove(this.activeShape),this.activeShape=null);const a=this.viewer.entities.add({polyline:{positions:[s,r],width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}});this.measureEntities.push(a);const c=t.Cartesian3.distance(s,r),l=t.Cartesian3.midpoint(s,r,new t.Cartesian3);this.addLabel(l,this.formatDistance(c));const d=t.Transforms.eastNorthUpToFixedFrame(s),h=t.Matrix4.inverse(d,new t.Matrix4),f=t.Matrix4.multiplyByPoint(h,r,new t.Cartesian3),p=f.x,u=f.y,m=f.z,E=t.Matrix4.getColumn(d,0,new t.Cartesian3),A=t.Matrix4.getColumn(d,1,new t.Cartesian3),b=t.Cartesian3.multiplyByScalar(E,p,new t.Cartesian3),w=t.Cartesian3.add(s,b,new t.Cartesian3),I=t.Cartesian3.multiplyByScalar(A,u,new t.Cartesian3),D=t.Cartesian3.add(w,I,new t.Cartesian3);if(this.viewer.scene.mode!==t.SceneMode.SCENE2D){const N=this.viewer.entities.add({polyline:{positions:[s,w],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.RED}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(1,0,0,.5)})}}),S=this.viewer.entities.add({polyline:{positions:[w,D],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.GREEN}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(0,1,0,.5)})}}),B=this.viewer.entities.add({polyline:{positions:[D,r],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.BLUE}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(0,0,1,.5)})}});this.measureEntities.push(N,S,B)}this.onMeasure({type:"distance",dx:p,dy:u,dz:m,dist:c}),this.activePoints=[]}}else if(this.type==="angle"){if(this.activePoints.length===1)this.onMeasure(null);else if(this.activePoints.length===2)this.activeShape=this.viewer.entities.add({polyline:{positions:new t.CallbackProperty(()=>{if(this.activePoints.length<2)return[];const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}}),this.measureEntities.push(this.activeShape);else if(this.activePoints.length===3){const s=this.activePoints[0],r=this.activePoints[1],a=this.activePoints[2];if(this.activeShape){this.viewer.entities.remove(this.activeShape);const l=this.viewer.entities.add({polyline:{positions:[s,r,a],width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}});this.measureEntities.push(l)}const c=this.calculateAngle(s,r,a);this.addLabel(r,`${c.toFixed(1)}°`),this.onMeasure({type:"angle",angle:c}),this.finish()}}else this.type==="area"&&this.activePoints.length===1&&(this.onMeasure(null),this.activeShape=this.viewer.entities.add({polygon:{hierarchy:new t.CallbackProperty(()=>{if(this.activePoints.length===0)return new t.PolygonHierarchy([]);const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),new t.PolygonHierarchy(s)},!1),material:t.Color.YELLOW.withAlpha(.3),perPositionHeight:!0,outline:!0,outlineColor:t.Color.YELLOW,outlineWidth:2},polyline:{positions:new t.CallbackProperty(()=>{const s=[...this.activePoints];return this.cursorPosition&&(s.push(this.cursorPosition),s.push(s[0])),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW,clampToGround:!1}}),this.measureEntities.push(this.activeShape))}updateFloatingPoint(e){const t=this.cesium;this.floatingPoint||(this.floatingPoint=this.viewer.entities.add({position:new t.CallbackProperty(()=>this.cursorPosition,!1),point:{pixelSize:5,color:t.Color.RED,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))}finish(){const e=this.cesium;if(this.type==="distance"&&this.activePoints.length>1){let t=0;for(let s=0;s<this.activePoints.length-1;s++)t+=e.Cartesian3.distance(this.activePoints[s],this.activePoints[s+1]);const i=this.activePoints[this.activePoints.length-1];this.addLabel(i,`Total: ${this.formatDistance(t)}`)}else if(this.type==="area"&&this.activePoints.length>=3){const t=this.calculateArea(this.activePoints),i=this.calculateCenter(this.activePoints);this.addLabel(i,`面积: ${this.formatArea(t)}`),this.onMeasure({type:"area",area:t})}this.clearActive()}clearAll(){this.clear(),this.onMeasure(null)}clear(){this.clearActive(),this.measureEntities.forEach(e=>this.viewer.entities.remove(e)),this.measureEntities=[]}stop(){this.clearActive(),this.onMeasure(null)}destroy(){if(this.clear(),this.originalDoubleClickAction){const e=this.cesium;this.viewer.screenSpaceEventHandler.setInputAction(this.originalDoubleClickAction,e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.originalDoubleClickAction=null}}clearActive(){const e=this.cesium;if(this.handler&&(this.handler.destroy(),this.handler=null),this.tapTimeout&&(clearTimeout(this.tapTimeout),this.tapTimeout=null),this.lastTapTime=0,this.viewer.scene&&this.viewer.scene.screenSpaceCameraController&&!this.originalPickEnabled&&(this.viewer.scene.screenSpaceCameraController.enableInputs=!0),this.floatingPoint&&(this.viewer.entities.remove(this.floatingPoint),this.floatingPoint=null),this.snapIndicator&&(this.viewer.entities.remove(this.snapIndicator),this.snapIndicator=null),this.activeShape){if(this.type==="distance"){const t=[...this.activePoints];this.viewer.entities.remove(this.activeShape);const i=this.viewer.entities.add({polyline:{positions:t,width:2,material:e.Color.YELLOW,depthFailMaterial:e.Color.YELLOW}});this.measureEntities.push(i)}else if(this.type==="area"){const t=[...this.activePoints];this.viewer.entities.remove(this.activeShape);const i=this.viewer.entities.add({polygon:{hierarchy:new e.PolygonHierarchy(t),material:e.Color.YELLOW.withAlpha(.3),perPositionHeight:!0,outline:!0,outlineColor:e.Color.YELLOW,outlineWidth:2},polyline:{positions:[...t,t[0]],width:2,material:e.Color.YELLOW,depthFailMaterial:e.Color.YELLOW}});this.measureEntities.push(i)}this.activeShape=null}this.activePoints=[],this.type=null,this.cursorPosition=null}getPickPosition(e){const t=this.cesium;let i;try{i=this.viewer.scene.pickPosition(e)}catch{}if(!i||!t.defined(i)){const s=this.viewer.camera.getPickRay(e);s&&(i=this.viewer.scene.globe.pick(s,this.viewer.scene))}if((!i||!t.defined(i))&&(i=this.viewer.scene.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),!i||!t.defined(i))return null;if(this.isSnapping){const s=this.snapToVertex(e);if(s)i=s;else{const r=this.snapTo3DTileFeature(e);r&&(i=r)}}return this.isSnapping&&(this.snapIndicator||(this.snapIndicator=this.viewer.entities.add({position:new t.CallbackProperty(()=>this.cursorPosition,!1),point:{pixelSize:10,color:t.Color.GREEN.withAlpha(.5),outlineColor:t.Color.GREEN,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))),i}snapTo3DTileFeature(e){const t=this.cesium,i=10,s=[{x:0,y:0},{x:-i,y:0},{x:i,y:0},{x:0,y:-i},{x:0,y:i},{x:-i,y:-i},{x:i,y:-i},{x:-i,y:i},{x:i,y:i}];for(let r=0;r<s.length;r++){const a=s[r];if(!a)continue;const c=new t.Cartesian2(e.x+a.x,e.y+a.y);let l=null;try{l=this.viewer.scene.pick(c)}catch{}if(t.defined(l)&&(l instanceof t.Cesium3DTileFeature||l.primitive&&l.primitive instanceof t.PointPrimitive))try{const d=this.viewer.scene.pickPosition(c);if(d)return d}catch{}}return null}snapToVertex(e){const t=this.cesium,i=this.viewer.entities.values;let s=20,r=null;for(let a=0;a<i.length;a++){const c=i[a];if(!c.show)continue;let l=[];if(c.polyline&&c.polyline.positions){const d=c.polyline.positions.getValue(t.JulianDate.now());d&&(l=d)}else if(c.polygon&&c.polygon.hierarchy){const d=c.polygon.hierarchy.getValue(t.JulianDate.now());d&&d.positions&&(l=d.positions)}else if(c.position){const d=c.position.getValue(t.JulianDate.now());d&&(l=[d])}else if(c.rectangle&&c.rectangle.coordinates){const d=c.rectangle.coordinates.getValue(t.JulianDate.now());d&&(l=[t.Cartesian3.fromRadians(d.west,d.south),t.Cartesian3.fromRadians(d.east,d.south),t.Cartesian3.fromRadians(d.east,d.north),t.Cartesian3.fromRadians(d.west,d.north)])}for(let d=0;d<l.length;d++){const h=l[d];try{const f=this.viewer.scene.cartesianToCanvasCoordinates(h);if(f){const p=t.Cartesian2.distance(f,e);p<s&&(s=p,r=h)}}catch{}}}return r}addLabel(e,t){const i=this.cesium,s=this.viewer.entities.add({position:e,label:{text:t,font:"14px sans-serif",fillColor:i.Color.WHITE,style:i.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:i.VerticalOrigin.BOTTOM,pixelOffset:new i.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0,backgroundColor:new i.Color(0,0,0,.5)}});this.measureEntities.push(s)}formatDistance(e){return this.unit==="mm"?`${(e*1e3).toFixed(0)}mm`:this.unit==="cm"?`${(e*100).toFixed(1)}cm`:`${e.toFixed(2)}m`}calculateAngle(e,t,i){const s=this.cesium,r=s.Cartesian3.subtract(e,t,new s.Cartesian3),a=s.Cartesian3.subtract(i,t,new s.Cartesian3);s.Cartesian3.normalize(r,r),s.Cartesian3.normalize(a,a);const c=s.Cartesian3.dot(r,a),l=Math.max(-1,Math.min(1,c)),d=Math.acos(l);return s.Math.toDegrees(d)}calculateArea(e){const t=this.cesium;if(e.length<3)return 0;const i=e[0],s=new t.Cartesian3(0,0,0);for(let r=1;r<e.length-1;r++){const a=e[r],c=e[r+1],l=t.Cartesian3.subtract(a,i,new t.Cartesian3),d=t.Cartesian3.subtract(c,i,new t.Cartesian3),h=t.Cartesian3.cross(l,d,new t.Cartesian3);t.Cartesian3.add(s,h,s)}return t.Cartesian3.magnitude(s)*.5}calculateCenter(e){const t=this.cesium;if(!e||e.length===0)return null;let i=0,s=0,r=0;for(let a=0;a<e.length;a++)i+=e[a].x,s+=e[a].y,r+=e[a].z;return new t.Cartesian3(i/e.length,s/e.length,r/e.length)}formatArea(e){return e>1e6?`${(e/1e6).toFixed(2)} km²`:`${e.toFixed(2)} m²`}}const ve=o.reactive({visible:!1,type:"info",title:"",description:"",closable:!1,showIcon:!0,duration:3});let Ce=null,al=null,ll=!1,Ns=null,di=null,Fs=null;function Ey(){if(di||typeof document>"u")return;const n=`
31
+ ${l}
32
+ `;this.promptDiv=window.document.createElement("div"),this.promptDiv.className=`easy3d-prompt ${this.opt.className}`,this.promptDiv.id=f,this.promptDiv.innerHTML=m,window.document.getElementById(o).appendChild(this.promptDiv);const g=window.document.getElementById(`prompt-close-${this.opt.id}`);let A=this;g&&g.addEventListener("click",p=>{A.hide(),A.opt.close&&A.opt.close()}),this.promptDom=window.document.getElementById(f),this.position=this.transPosition(this.opt.position),n==2&&this.bindRender(),this.opt.show==!1&&this.hide(),this.containerW=this.viewer.container.offsetWidth,this.containerH=this.viewer.container.offsetHeight,this.containerLeft=this.viewer.container.offsetLeft,this.containerTop=this.viewer.container.offsetTop,this.contentW=Math.ceil(Number(this.promptDom.offsetWidth)),this.contentH=this.promptDom.offsetHeight,this.opt.success&&this.opt.success()}destroy(){this.promptDiv&&(window.document.getElementById(this.viewer.container.id).removeChild(this.promptDiv),this.promptDiv=null),this.rendHandler&&(this.rendHandler(),this.rendHandler=null)}bindRender(){let e=this;this.rendHandler=this.viewer.scene.postRender.addEventListener(function(){if(!e.isShow&&e.promptDom){e.promptDom.style.display="none";return}if(e.position)if(e.position instanceof Cesium.Cartesian3){let t=Cesium.SceneTransforms.wgs84ToWindowCoordinates(e.viewer.scene,e.position);if(!t)return;new Cesium.EllipsoidalOccluder(e.viewer.scene.globe.ellipsoid,e.viewer.scene.camera.position).isPointVisible(e.position)?e.promptDom&&(e.promptDom.style.display="block"):e.promptDom&&(e.promptDom.style.display="none"),e.setByPX({x:t.x,y:t.y})}else e.setByPX({x:e.position.x,y:e.position.y})},this)}update(e,t){e instanceof Cesium.Cartesian3&&(this.position=e.clone(),e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,e)),this.contentW=Math.ceil(Number(this.promptDom.offsetWidth)),this.contentH=this.promptDom.offsetHeight,e&&this.setByPX(e),t&&this.setContent(t)}isInView(){if(!this.position)return!1;let e=null;this.position instanceof Cesium.Cartesian2?e=this.position:e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(this.viewer.scene,this.position);const n=new Cesium.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.position).isPointVisible(this.position);let s=!1;return e?(e.x>this.containerLeft&&e.x<this.containerLeft+this.containerW&&e.y>this.containerTop&&e.y<this.containerTop+this.containerH&&(s=!0),n&&s):s}setVisible(e){this.isInView(this.position)&&e?(this.isShow=!0,this.promptDom&&(this.promptDom.style.display="block")):(this.isShow=!1,this.promptDom&&(this.promptDom.style.display="none"))}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}setContent(e){let t=window.document.getElementById(`prompt-content-${this.opt.id}`);t.innerHTML=e}setByPX(e){e&&this.promptDom&&(this.promptDom.offsetWidth,this.promptDom.offsetHeight,this.opt.type==1?(this.promptDom.style.left=Number(e.x)+Number(this.opt.offset.x||0)+"px",this.promptDom.style.top=Number(e.y)+Number(this.opt.offset.y||0)+"px"):(this.promptDom.style.left=Number(e.x)+Number(this.opt.offset.x||0)-Number(this.contentW)/2+"px",this.promptDom.style.top=Number(e.y)+Number(this.opt.offset.y||0)-Number(this.contentH)+"px"))}transPosition(e){let t;return Array.isArray(e)?t=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0).clone():e instanceof Cesium.Cartesian3?t=e.clone():t=e,t}}const vc=Object.freeze(Object.defineProperty({__proto__:null,default:Gt},Symbol.toStringTag,{value:"Module"}));let me={};me.cartesianToLnglat=function(i,e){if(!i)return[];var t=Cesium.Cartographic.fromCartesian(i),n=Cesium.Math.toDegrees(t.latitude),s=Cesium.Math.toDegrees(t.longitude),o=t.height;return[s,n,o]},me.getViewCenter=i=>{if(i){var e=i.camera.computeViewRectangle(),t=e.west/Math.PI*180,n=e.north/Math.PI*180,s=e.east/Math.PI*180,o=e.south/Math.PI*180;return[(s+t)/2,(n+o)/2]}},me.cartesiansToLnglats=function(i,e){if(!(!i||i.length<1)){if(e=e||window.viewer,!e){console.log("util.cartesiansToLnglats方法缺少viewer对象");return}for(var t=[],n=0;n<i.length;n++)t.push(me.cartesianToLnglat(i[n],e));return t}},me.lnglatsToCartesians=function(i){if(!(!i||i.length<1)){for(var e=[],t=0;t<i.length;t++){var n=Cesium.Cartesian3.fromDegrees(i[t][0],i[t][1],i[t][2]||0);e.push(n)}return e}},me.flyTo=function(i,e){if(!e){console.log("util.flyTo缺少viewer对象");return}i=i||{};let t=i.center;if(!t){console.log("缺少定位坐标!");return}if(t instanceof Cesium.Cartesian3&&e.camera.flyToBoundingSphere(new Cesium.BoundingSphere(t),{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(i.heading||0),Cesium.Math.toRadians(i.pitch||-60),i.range||1e4)}),t instanceof Array){var n=new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(t[0],t[1],t[2]));e.camera.flyToBoundingSphere(n,{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(i.heading||0),Cesium.Math.toRadians(i.pitch||-60),i.range||1e4)})}},me.getCameraView=function(i){if(i=i||window.viewer,!i){console.log("util.getCameraView缺少viewer对象");return}var e=i.camera,t=e.position,n=e.heading,s=e.pitch,o=e.roll,r=Cesium.Cartographic.fromCartesian(t),l={x:Cesium.Math.toDegrees(r.longitude),y:Cesium.Math.toDegrees(r.latitude),z:r.height,heading:Cesium.Math.toDegrees(n),pitch:Cesium.Math.toDegrees(s),roll:Cesium.Math.toDegrees(o)};return l},me.setCameraView=function(i,e){if(e=e||window.viewer,!e){console.log("util.setCameraView缺少viewer对象");return}if(i){var t=i.destination||Cesium.Cartesian3.fromDegrees(i.x,i.y,i.z);e.camera.flyTo({destination:t,orientation:{heading:Cesium.Math.toRadians(i.heading||0),pitch:Cesium.Math.toRadians(i.pitch||0),roll:Cesium.Math.toRadians(i.roll||0)},duration:i.duration===void 0?3:i.duration,complete:i.complete})}},me.computeAreaOfTriangle=function(i,e,t){if(!i||!e||!t)return console.log("传入坐标有误!"),0;var n=Cesium.Cartesian3.distance(i,e),s=Cesium.Cartesian3.distance(e,t),o=Cesium.Cartesian3.distance(t,i),r=(n+s+o)/2;return Math.sqrt(r*(r-n)*(r-s)*(r-o))};class vt{constructor(e,t){this.viewer=e,this.style=t||{},this.objId=+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.handler=void 0,this.modifyHandler=void 0,this.type="",this.positions=[],this.state=null,this.prompt=null,this.controlPoints=[],this.modifyPoint=null,this.entity=null,this.pointStyle={},this.promptStyle=this.style.prompt||{show:!0},this.properties={},this.clientScale=1}getCatesian3FromPX(e){if(e=this.transpx(e),this.viewer.scene.mode===Cesium.SceneMode.SCENE2D){let o=this.viewer.camera.getPickRay(e),r=null;return o&&(r=this.viewer.scene.globe.pick(o,this.viewer.scene)),r||(r=this.viewer.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),r}let t=this.viewer.scene.drillPick(e);this.viewer.scene.render();let n,s=!1;for(let o=0;o<t.length;o++)if(t[o]&&t[o].primitive&&t[o].primitive instanceof Cesium.Cesium3DTileset){s=!0;break}if(s)n=this.viewer.scene.pickPosition(e);else{let o=this.viewer.camera.getPickRay(e);if(!o)return null;n=this.viewer.scene.globe.pick(o,this.viewer.scene)}return n}setClientScale(e){e=e||1,this.clientScale=e}transpx(e){return{x:e.x/(this.clientScale||1),y:e.y/(this.clientScale||1)}}getEntity(){return this.entity}getPositions(e){return e?me.cartesiansToLnglats(this.positions,this.viewer):this.positions}getLnglats(){return me.cartesiansToLnglats(this.positions,this.viewer)}setOwnProp(e){this.entity&&(this.entity.ownProp=e)}remove(){this.entity&&(this.state="no",this.viewer.entities.remove(this.entity),this.entity=null)}setVisible(e){this.entity&&(this.entity.show=e)}forbidDrawWorld(e){this.viewer.scene.screenSpaceCameraController.enableRotate=!e,this.viewer.scene.screenSpaceCameraController.enableTilt=!e,this.viewer.scene.screenSpaceCameraController.enableTranslate=!e,this.viewer.scene.screenSpaceCameraController.enableInputs=!e}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.positions=[],this.style=null;for(var e=0;e<this.controlPoints.length;e++){var t=this.controlPoints[e];this.viewer.entities.remove(t)}this.controlPoints=[],this.modifyPoint=null,this.prompt&&(this.prompt.destroy(),this.prompt=null),this.state="no",this.forbidDrawWorld(!1)}startEdit(e){if(this.state=="startEdit"||this.state=="editing"||!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this;for(let n=0;n<t.controlPoints.length;n++){let s=t.controlPoints[n];s&&(s.show=!0)}this.entity.show=!0,this.modifyHandler.setInputAction(function(n){if(!t.entity)return;let s=t.viewer.scene.pick(n.position);Cesium.defined(s)&&s.id&&(s.id.objId||(t.modifyPoint=s.id),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(n){if(t.positions.length<1||!t.modifyPoint)return;let s=t.getCatesian3FromPX(n.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.position.setValue(s),t.positions[t.modifyPoint.wz]=s,t.state="editing",e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(n){t.modifyPoint&&(t.modifyPoint=null,t.forbidDrawWorld(!1),t.state="editing")},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){for(let t=0;t<this.controlPoints.length;t++){let n=this.controlPoints[t];n&&(n.show=!1)}this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}endCreate(){}done(){}createPoint(e){if(!e)return;this.pointStyle.color=this.pointStyle.color||Cesium.Color.CORNFLOWERBLUE,this.pointStyle.outlineColor=this.pointStyle.color||Cesium.Color.CORNFLOWERBLUE;let t=this.pointStyle.color instanceof Cesium.Color?this.pointStyle.color:Cesium.Color.fromCssColorString(this.pointStyle.color);t=t.withAlpha(this.pointStyle.colorAlpha||1);let n=this.pointStyle.outlineColor instanceof Cesium.Color?this.pointStyle.outlineColor:Cesium.Color.fromCssColorString(this.pointStyle.outlineColor);return n=n.withAlpha(this.pointStyle.outlineColorAlpha||1),this.viewer.entities.add({position:e,point:{pixelSize:this.pointStyle.property||10,color:t,outlineWidth:this.pointStyle.outlineWidth||0,outlineColor:n,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:!1})}transfromLineMaterial(e){if(!e)return;let t={};if(e instanceof Cesium.Color){let n=e.color.getValue();t.colorAlpha=n.alpha,t.colorHex=new Cesium.Color(n.red,n.green,n.blue,1).toCssHexString()}return t}transfromGonMaterial(e){if(!e)return;let t={};if(e instanceof Cesium.Color){let n=e.color.getValue();t.colorAlpha=n.alpha,t.colorHex=new Cesium.Color(n.red,n.green,n.blue,1).toCssHexString()}return t}setAttr(e){this.properties.attr=e||{}}getAttr(){return this.properties.attr}zoomTo(){this.entity&&this.viewer.zoomTo(this.entity)}}const AC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABHNCSVQICAgIfAhkiAAAAptJREFUOE+FVD1oU1EYvecVCU5acHFqsggKSlUcdDGZuvhToeAgYuIuaUcHMZ0c2+JuAg4dKrS6iFPiooMUAyqCS5PFTVpBKJKa4/nez817yateeOTm3vOd75zv3u/C5QySx50b3HMO89oupyBdzTvOHawBR3t5sRhfJH+tiqiu9X4UDJH80Tc169ywGCeZcY7CDZaB6b00hyckd6WKbW2WFLQoYCtPga0JW40I3Y6wt4T1alOE382OBuaBk7l20gnIHQkoyEFA5/YrQClUGhKS/YZ+FmVpVhuejNzXemhfwU4BWAUKywlxRBoYfguYkWohosXBruY14JS3Sf6Ik1CJpqRkaAe0ovSyeGJrRPrNiJr6ziu+K8LPCqBqdraYtdRPMms/GmRPxNiTGiP3g/ykcrELnKuKcNtAPeBCKHkU/EUKgw5wWvsJ4VcLFPbMGOG2HdBN4GJJhO9UVMju5VaacHxOfjClsux0AJd8kkj5+7LdEOAKRNgWoYEqGVBWbVvqoTpRiSsTicUhQidC0ZBvjFAXdE4WJwe5qUM7ovtmmGtmbWKQr0UYiHDOCF9JmdXwulTkgddj8O2JrkrQ5EuJQRW4URThhv2pAwvT+YTNotaLQO0fJXlhTaFTXrBTXlfA0CypPndy6vPU6nMVeOAvdDox+Tx0IA4V8G4n7pRnVht7XbRYi1swCiOfyIF7DDzMeUia1v8ftd8H7lvipPVs47dZOqb+1I2v+ReEbMSWGxnLZBgTPyYFK8molyMlK9aXpk6krgHU1/JqGmPN5qaipJplYMm7ytiISA9kn7LvevpVzwZSRmWnlAb6WNWeqX6r66SXacm78ZbHlahuChhaj1uL6TH146dmSsIW8ChTggRx6N06zO7/1v8CLeIaJJK0e+4AAAAASUVORK5CYII=";class yC extends vt{constructor(e,t){super(e,t),this.type="billboard",this.viewer=e;let n={verticalOrigin:Cesium.VerticalOrigin.BOTTOM,scale:1};this.style=Object.assign({},n,t||{}),this.entity=null,this.style.hasOwnProperty("image")||console.warn("CreateBillboard: 未在 style 中指定 image,后续将使用回退图或占位图。"),this.position=null,this._defaultFallback=AC,this.prompt=null,this.modifyHandler=null,this._globalMouseUpHandler=null,this._isDragging=!1,this._editPickedEntity=null,this.controlPoints=[],this.modifyPoint=null,this._isScaling=!1,this._fileInput=null}_preloadImage(e,t=7e3){return new Promise((n,s)=>{if(!e)return s(new Error("empty url"));try{const o=new window.Image;o.crossOrigin="anonymous";let r=!1;const l=()=>{r||(r=!0,clearTimeout(d),n(o))},c=h=>{r||(r=!0,clearTimeout(d),s(new Error("image load error: "+e)))};o.onload=l,o.onerror=c;const d=setTimeout(()=>{r||(r=!0,o.onload=o.onerror=null,s(new Error("image load timeout: "+e)))},t);o.src=e}catch(o){s(o)}})}createBillboard(e){if(!e)return;const t=this.style.fallbackImage||this._defaultFallback,n=this.viewer.entities.add({position:e,billboard:{image:t,scale:this.style.scale||1,pixelOffset:this.style.pixelOffset,heightReference:this.style.heightReference==null?Cesium.HeightReference.CLAMP_TO_GROUND:Number(this.style.heightReference),verticalOrigin:Cesium.VerticalOrigin.BOTTOM,color:this.style.color?this.style.color instanceof Cesium.Color?this.style.color.withAlpha(this.style.colorAlpha||1):Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1):Cesium.Color.WHITE}});n.objId=this.objId;const s=this.style.image;if(s)this._preloadImage(s,7e3).then(o=>{try{n.billboard.image=o,this.style.image=s}catch(r){console.warn("CreateBillboard: set billboard image element failed, fallback to url string",r);try{n.billboard.image=s}catch{}}try{this.viewer.scene.requestRender()}catch{}}).catch(o=>{console.error("CreateBillboard: image load failed:",o.message," URL:",s," 使用回退图:",t);try{this.viewer.scene.requestRender()}catch{}});else try{this.viewer.scene.requestRender()}catch{}return this.position=e.clone(),this.entity=n,n}updateBillboardImage(e){if(!this.entity||!this.entity.billboard)return;const t=this.style.fallbackImage||this._defaultFallback;if(!e){try{this.entity.billboard.image=t}catch{}this.style.image=t;try{this.viewer.scene.requestRender()}catch{}return}try{this.entity.billboard.image=t}catch{}this._preloadImage(e,7e3).then(n=>{try{this.entity.billboard.image=n}catch(s){console.warn("CreateBillboard: set billboard image element failed, fallback to url string",s);try{this.entity.billboard.image=e}catch{}}this.style.image=e;try{this.viewer.scene.requestRender()}catch{}}).catch(n=>{console.error("CreateBillboard: updateBillboardImage failed to load:",n.message," URL:",e);try{this.entity.billboard.image=t}catch{}this.style.image=t;try{this.viewer.scene.requestRender()}catch{}})}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){let s=t.getCatesian3FromPX(n.position,t.viewer);if(s){if(t.position=s.clone(),t.entity=t.createBillboard(t.position),t.handler){try{t.handler.destroy()}catch{}t.handler=null}if(t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}t.state="endCreate",e&&e(t.entity)}},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){t.prompt&&t.prompt.update&&t.prompt.update(n.endPosition,"单击新增"),t.state="creating"},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){let e=this;if(e.handler){try{e.handler.destroy()}catch{}e.handler=null}if(e.prompt){try{e.prompt.destroy()}catch{}e.prompt=null}e.state="endCreate"}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let n=null;e instanceof Cesium.Cartesian3?n=e.clone():n=Cesium.Cartesian3.fromDegrees(Number(e[0]),Number(e[1]),Number(e[2]||0)),n&&(this.position=n.clone(),this.entity=this.createBillboard(this.position),t&&t(this.entity),this.state="endCreate")}setStyle(e){if(!e)return;let t=this.entity&&this.entity.billboard;if(t){if(e.image!=null&&this.updateBillboardImage(e.image),e.heightReference!=null){let n=1;e.heightReference==!0?n=1:n=Number(e.heightReference);try{t.heightReference=n}catch{}}if(e.scale!=null)try{t.scale=Number(e.scale)}catch{}if(e.color){let n=e.color instanceof Cesium.Color?e.color:Cesium.Color.fromCssColorString(e.color);n=n.withAlpha(e.colorAlpha||1);try{t.color=n}catch{}}}this.style=Object.assign(this.style,e)}getStyle(){let e={},t=this.entity&&this.entity.billboard;if(e.image=this.style.image,t&&t.heightReference)try{let n=t.heightReference.getValue();e.heightReference=Number(n)}catch{}if(t&&t.scale)try{e.scale=t.scale.getValue()}catch{}if(t&&t.color)try{let n=t.color.getValue();e.colorAlpha=n.alpha,e.color=new Cesium.Color(n.red,n.green,n.blue,1).toCssHexString()}catch{}return e}startEdit(e){if(this._cleanupEditState(),!this.entity)return;this.state="startEdit",this.controlPoints=[],this.showControlPoints(),this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);let t=this,n=null,s=!1;const o=()=>{if(s){if(s=!1,t.entity&&Cesium.defined(t.entity.position))try{t.position=t.entity.position.getValue(Cesium.JulianDate.now()).clone()}catch(r){console.warn("更新位置引用失败:",r)}n=null,t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}t.state="editing"}};window.addEventListener("mouseup",o,!0),this._globalMouseUpHandler=o,this.modifyHandler.setInputAction(function(r){const l=t.viewer.scene.pick(r.position);if(Cesium.defined(l)&&l.id){if(l.id===t.entity){n=l.id,s=!0,t._isDragging=!0,t._editPickedEntity=n,t.modifyPoint=null;try{t.forbidDrawWorld(!0)}catch{}}else if(t.controlPoints.includes(l.id)){t.modifyPoint=l.id,s=!0,t._isDragging=!0,n=t.entity;try{t.forbidDrawWorld(!0)}catch{}}}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(r){if(!s)return;let l=t.getCatesian3FromPX(r.endPosition,t.viewer);if(l){if(Cesium.defined(n)){try{n.position.setValue(l)}catch{n.position=l}t.position=l.clone(),t.controlPoints&&t.controlPoints.length>0&&t.controlPoints.forEach(c=>{try{c.position.setValue(l)}catch(d){console.warn("更新控制点位置失败:",d);try{c.position=l.clone()}catch(h){console.error("重新设置控制点位置失败:",h)}}})}t.state="editing",e&&e()}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){if(s){if(s=!1,t.entity&&Cesium.defined(t.entity.position))try{t.position=t.entity.position.getValue(Cesium.JulianDate.now()).clone()}catch(r){console.warn("更新位置引用失败:",r)}t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}t.state="editing"}},Cesium.ScreenSpaceEventType.LEFT_UP),this.modifyHandler.setInputAction(function(){if(t._isScaling){t._isScaling=!1,t._isDragging=!1,t._scalingControlPoint=null,delete t._initialScale,delete t._initialMousePosition,t.viewer.canvas.style.cursor="",t._hideScaleHint();try{t.forbidDrawWorld(!1)}catch{}}if(s){s=!1,t._isDragging=!1,t._editPickedEntity=null,t.modifyPoint=null;try{t.forbidDrawWorld(!1)}catch{}}if(t.hideControlPoints(),t.modifyHandler){try{t.modifyHandler.destroy()}catch{}t.modifyHandler=null}t._globalMouseUpHandler&&(window.removeEventListener("mouseup",t._globalMouseUpHandler,!0),t._globalMouseUpHandler=null),t.state="endEdit"},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.modifyHandler.setInputAction(function(r){const l=t.viewer.scene.pick(r.position);Cesium.defined(l)&&l.id===t.entity&&t._handleDoubleClick()},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}createControlPoint(e){return e?this.viewer.entities.add({position:e,point:{pixelSize:8,color:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}}):null}createYellowControlPoint(e){if(!e)return null;const t=this.viewer.entities.add({position:e,point:{pixelSize:10,color:Cesium.Color.YELLOW,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}});return t.isYellowControl=!0,t}createScaleControlPoint(e,t){if(!e)return null;let n=Cesium.Color.GREEN;t==="bottomLeft"&&(n=Cesium.Color.BLUE);const s=this.viewer.entities.add({position:e,point:{pixelSize:10,color:n,outlineColor:Cesium.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.MAX_VALUE}});return s.isScaleControl=!0,s.corner=t,s}_calculateSpecialPosition(e){return this._calculateCornerPosition(e,"bottomRight")}_calculateCornerPosition(e,t){if(!e)return null;const s=50*(this.style.scale||1),o=this.viewer.camera,r=new Cesium.Cartesian3,l=new Cesium.Cartesian3,c=new Cesium.Cartesian3;Cesium.Cartesian3.clone(o.direction,r),Cesium.Cartesian3.clone(o.right,l),Cesium.Cartesian3.clone(o.up,c),Cesium.Cartesian3.normalize(r,r),Cesium.Cartesian3.normalize(l,l),Cesium.Cartesian3.normalize(c,c);const d=new Cesium.Cartesian3;Cesium.Cartesian3.multiplyByScalar(l,s,d),Cesium.Cartesian3.multiplyByScalar(c,s,c),Cesium.Cartesian3.add(d,c,d);const h=new Cesium.Ray(e,r),f=this.viewer.scene.globe.pick(h,this.viewer.scene),u=Cesium.Cartesian3.distance(e,f||e)*.001;return Cesium.Cartesian3.multiplyByScalar(d,u,d),Cesium.Cartesian3.add(e,d,new Cesium.Cartesian3)}showControlPoints(){if(this.controlPoints=this.controlPoints||[],this._isDragging){this.position&&this.controlPoints.length>0&&this.controlPoints.forEach(e=>{try{e.position.setValue(this.position)}catch{try{e.position=this.position.clone()}catch(n){console.warn("更新拖拽中控制点位置失败:",n)}}});return}if(this.controlPoints.length>0&&([...this.controlPoints].forEach(t=>{try{this.viewer&&this.viewer.entities&&t&&this.viewer.entities.remove(t)}catch(n){console.warn("移除控制点失败:",n)}}),this.controlPoints.length=0),this.position&&this.viewer&&!this._isDragging){const e=this.createControlPoint(this.position);e&&(e.wz=0,this.controlPoints.push(e))}}hideControlPoints(){this.controlPoints&&Array.isArray(this.controlPoints)&&this.controlPoints.length>0?([...this.controlPoints].forEach(t=>{try{this.viewer&&this.viewer.entities&&t&&this.viewer.entities.remove(t)}catch(n){console.warn("移除控制点失败:",n)}}),this.controlPoints.length=0):(!this.controlPoints||!Array.isArray(this.controlPoints))&&(this.controlPoints=[]),this.topRightControlPoint=null,this.bottomLeftControlPoint=null,this.scaleControlPoint=null,this.modifyPoint=null}endEdit(e){if(this.hideControlPoints(),this.modifyHandler){try{this.modifyHandler.destroy()}catch{}this.modifyHandler=null}if(this._globalMouseUpHandler){try{window.removeEventListener("mouseup",this._globalMouseUpHandler,!0)}catch{}this._globalMouseUpHandler=null}try{this.forbidDrawWorld(!1)}catch{}this.viewer&&this.viewer.canvas&&(this.viewer.canvas.style.cursor=""),this._isDragging=!1,this._editPickedEntity=null,this.modifyPoint=null,this.state="endEdit",e&&e(this.entity)}_cleanupEditState(){if(this._globalMouseUpHandler){try{window.removeEventListener("mouseup",this._globalMouseUpHandler,!0)}catch{}this._globalMouseUpHandler=null}if(this.modifyHandler){try{this.modifyHandler.destroy()}catch{}this.modifyHandler=null}this.controlPoints=this.controlPoints||[],this.hideControlPoints(),this._isDragging=!1,this._editPickedEntity=null,this.modifyPoint=null;try{this.forbidDrawWorld(!1)}catch{}}_showScaleHint(e){this._scaleHintElement||(this._scaleHintElement=document.createElement("div"),this._scaleHintElement.style.position="absolute",this._scaleHintElement.style.background="rgba(0, 0, 0, 0.7)",this._scaleHintElement.style.color="white",this._scaleHintElement.style.padding="4px 8px",this._scaleHintElement.style.borderRadius="4px",this._scaleHintElement.style.fontSize="12px",this._scaleHintElement.style.pointerEvents="none",this._scaleHintElement.style.zIndex="10000",document.body.appendChild(this._scaleHintElement)),this._scaleHintElement.textContent=`缩放: ${e.toFixed(2)}x`,this._scaleHintElement.style.left=`${window.event.clientX+10}px`,this._scaleHintElement.style.top=`${window.event.clientY-30}px`,this._scaleHintElement.style.display="block"}_hideScaleHint(){this._scaleHintElement&&(this._scaleHintElement.style.display="none")}move(e){if(!this.entity)return;let t=null;e instanceof Cesium.Cartesian3?t=e:t=Cesium.Cartesian3.fromDegrees(Number(e[0]),Number(e[1]),Number(e[2]||0));try{this.entity.position.setValue(t.clone())}catch{this.entity.position=t.clone()}this.position=t.clone(),this.state="editing"}_createFileInput(){if(this._fileInput)return this._fileInput;const e=document.createElement("input");return e.type="file",e.accept="image/*",e.style.display="none",e.onchange=t=>{this._handleFileUpload(t)},document.body.appendChild(e),this._fileInput=e,e}_handleFileUpload(e){const t=e.target.files[0];if(!t)return;if(!t.type.match("image.*")){console.warn("请选择有效的图片文件");return}const n=new FileReader;n.onload=s=>{this.updateBillboardImage(s.target.result),this._fileInput&&(this._fileInput.value="")},n.onerror=s=>{console.error("文件读取失败:",s)},n.readAsDataURL(t)}_handleDoubleClick(){this._createFileInput().click()}editImage(e){return e?(this.updateBillboardImage(e),!0):(console.warn("CreateBillboard.editImage: 未提供有效的图片URL"),!1)}remove(){try{this.endEdit()}catch{}if(this.entity){this.state="no";try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}}getPositions(e){return e?me.cartesianToLnglat(this.position,this.viewer):this.position}getLnglats(){return this.getPositions(!0)}setPosition(e){let t=null;e instanceof Cesium.Cartesian3?t=e:t=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0);try{this.entity.position.setValue(t.clone())}catch{this.entity.position=t.clone()}this.position=t.clone()}destroy(){try{this.endEdit()}catch{}if(this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}this.position=null,this.state="no",this._isDragging=!1,this._editPickedEntity=null}}class EC extends vt{constructor(e,t){super(e,t),this.type="circle",this.viewer=e,this.style=t||{},this.center=null,this.radiusPoint=null,this.radiusPointEntity=null,this.entity=null,this.handler=null,this.modifyHandler=null,this.modifyPoint=null,this._dragStartCart=null,this._dragStartCartCarto=null,this.pointsCount=64}start(e){!this.prompt&&this.promptStyle?.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate",this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.handler.setInputAction(function(n){const s=t.getCatesian3FromPX(n.position,t.viewer,[]);s&&(t.entity?(t.endCreate(),e&&e(t.entity)):(t.center=s.clone(),t.radiusPoint=s.clone(),t.entity=t._createPolyline(),t.radiusPointEntity=t.createPoint(t.radiusPoint),t.radiusPointEntity.typeAttr="radius",t.radiusPointEntity.show=!1))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!t.entity){t.prompt?.update(n.endPosition,"单击开始绘制");return}t.prompt?.update(n.endPosition,"单击结束");const s=t.getCatesian3FromPX(n.endPosition,t.viewer,[]);s&&(t.radiusPoint=s.clone(),t._updatePolyline(),t._updateAuxPoints(),t.state="creating")},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){this.handler?.destroy(),this.handler=null,this.radiusPointEntity&&(this.radiusPointEntity.show=!1),this.prompt?.destroy(),this.prompt=null,this.state="endCreate"}startEdit(e){if(!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.radiusPointEntity&&(this.radiusPointEntity.show=!0),this.modifyHandler.setInputAction(function(n){const s=t.viewer.scene.pick(n.position);if(!s?.id)return;t.modifyPoint=s.id;const o=t.getCatesian3FromPX(n.position,t.viewer,[t.entity,t.modifyPoint]);o&&(t._dragStartCart=o,t._dragStartCartCarto=Cesium.Ellipsoid.WGS84.cartesianToCartographic(o),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(n){if(!t.modifyPoint)return;const s=t.getCatesian3FromPX(n.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.typeAttr==="radius"&&(t.radiusPoint=s.clone()),t._updatePolyline(),t._updateAuxPoints(),e&&e(),t.state="editing")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){t.modifyPoint=null,t._dragStartCart=null,t._dragStartCartCarto=null,t.forbidDrawWorld(!1),t._updatePolyline(),e&&e(t.entity),t.state="editing"},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.radiusPointEntity&&(this.radiusPointEntity.show=!1),this.modifyHandler?.destroy(),this.modifyHandler=null,this.forbidDrawWorld(!1),this.state="endEdit",e&&e(this.entity)}_createPolyline(){const e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(()=>e._buildCirclePositions(),!1),width:this.style.outlineWidth||this.style.width||5,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color||"#00FF00"),clampToGround:!1}});return t._plotInstance=this,t.objId=this.objId,t}_updatePolyline(){if(!this.entity)return;const e=this._buildCirclePositions();try{const t=this.entity.polyline.positions;if(t&&typeof t.getValue=="function")return;if(t&&typeof t.setValue=="function"){t.setValue(e);return}this.entity.polyline.positions=e}catch{this.entity.polyline.positions=e}}_buildCirclePositions(){if(!this.center||!this.radiusPoint)return[];const e=[],t=Cesium.Ellipsoid.WGS84,n=t.cartesianToCartographic(this.center),s=t.cartesianToCartographic(this.radiusPoint),o=Math.abs(s.longitude-n.longitude),r=Math.abs(s.latitude-n.latitude);for(let l=0;l<=this.pointsCount;l++){const c=l/this.pointsCount*Math.PI*2,d=n.longitude+o*Math.cos(c),h=n.latitude+r*Math.sin(c);e.push(Cesium.Cartesian3.fromRadians(d,h))}return e}_updateAuxPoints(){!this.radiusPoint||!this.radiusPointEntity||(this.radiusPointEntity.position=this.radiusPoint)}syncFromEntity(){if(!this.entity||!this.center||!this.radiusPoint)return;const e=this.center,t=this.entity._centerCoord;if(!t)return;const n=t.x-e.x,s=t.y-e.y,o=t.z-e.z;this.center=new Cesium.Cartesian3(this.center.x+n,this.center.y+s,this.center.z+o),this.radiusPoint=new Cesium.Cartesian3(this.radiusPoint.x+n,this.radiusPoint.y+s,this.radiusPoint.z+o);const r=this.entity.objId,l=this.entity._plotInstance;this.radiusPointEntity&&this.viewer.entities.remove(this.radiusPointEntity),this.radiusPointEntity=null,this.viewer.entities.remove(this.entity),this.entity=this._createPolyline(),this.entity._plotInstance=l,this.entity.objId=r,this.radiusPointEntity=this.createPoint(this.radiusPoint),this.radiusPointEntity.typeAttr="radius",this.radiusPointEntity.show=this.state==="editing"}updatePositions(e){if(!e||e.length<1)return!1;try{if(!this.center||!this.radiusPoint)return!1;let t;if(e[0]instanceof Cesium.Cartesian3)t=e[0];else return!1;this.center=Cesium.Cartesian3.add(this.center,t,new Cesium.Cartesian3),this.radiusPoint=Cesium.Cartesian3.add(this.radiusPoint,t,new Cesium.Cartesian3),this._updatePolyline(),this._updateAuxPoints();try{this.viewer.scene.requestRender()}catch{}return!0}catch(t){return console.warn("Failed to update circle positions:",t),!1}}getPositions(e){return e?me.cartesiansToLnglats([this.center,this.radiusPoint],this.viewer):[this.center,this.radiusPoint]}getStyle(){const e=this.entity.polyline,t=e.material.color.getValue();return{color:new Cesium.Color(t.red,t.green,t.blue,1).toCssHexString(),colorAlpha:t.alpha,outlineWidth:e.width.getValue()}}setStyle(e){if(!this.entity)return;const t={...this.style,...e};let n=t.color instanceof Cesium.Color?t.color:Cesium.Color.fromCssColorString(t.color||"#00FF00");t.colorAlpha!=null&&(n=n.withAlpha(t.colorAlpha)),this.entity.polyline.material=n,this.entity.polyline.width=t.outlineWidth||t.width||5,this.style=t}destroy(){try{this.handler?.destroy(),this.modifyHandler?.destroy(),this.entity&&this.viewer.entities.remove(this.entity),this.entity=null,this.radiusPointEntity&&this.viewer.entities.remove(this.radiusPointEntity),this.radiusPointEntity=null,this.prompt?.destroy(),this.prompt=null}catch{}}_manageRadiusPointEntity(){this.radiusPointEntity?this.radiusPoint&&(this.radiusPointEntity.position=this.radiusPoint):(this.radiusPointEntity=this.createPoint(this.radiusPoint),this.radiusPointEntity&&(this.radiusPointEntity.typeAttr="radius",this.radiusPointEntity.show=!1))}createByPositions(e,t){try{if(!e||e.length===0)return console.error("createByPositions: positions array is empty or undefined"),t&&t(null),this;const n=e[0]instanceof Cesium.Cartesian3?e:me.lnglatsToCartesians(e);if(!n||n.length===0)return console.error("createByPositions: failed to convert positions to Cartesian3"),t&&t(null),this;if(n.length>=2)this.center=Cesium.Cartesian3.clone(n[0]),this.radiusPoint=Cesium.Cartesian3.clone(n[1]);else if(n.length===1)this.center=Cesium.Cartesian3.clone(n[0]),this._createDefaultRadiusPoint();else return console.error("createByPositions: invalid positions array"),t&&t(null),this;this.entity?this._updatePolyline():this.entity=this._createPolyline(),this._manageRadiusPointEntity(),this._updateAuxPoints(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch(s){console.error("requestRender error:",s)}return t&&t(this.entity),this}catch(n){return console.error("createByPositions error:",n),t&&t(null),this}}}class CC extends vt{constructor(e,t){if(super(e,t),this.type="gltfModel",t=t||{},this.viewer=e,!t.uri){console.warn("请输入模型地址!");return}let n={heading:0,pitch:0,roll:0,minimumPixelSize:24,maximumScale:120};this.style=Object.assign(n,t||{}),this.modelUri=t.uri,this.entity=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){let s=t.getCatesian3FromPX(n.position,t.viewer);s&&(t.entity.position=s,t.position=s.clone()),t.endCreate(),e&&e(t.entity)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){t.prompt.update(n.endPosition,"单击新增"),t.state="creating";let s=t.getCatesian3FromPX(n.endPosition,t.viewer,[t.entity]);s&&(t.entity?t.entity.position=s:t.entity=t.createGltfModel(s.clone()))},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}createByPositions(e,t){e&&(this.state="startCreate",e instanceof Cesium.Cartesian3?this.position=e:this.position=Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]||0),this.entity=this.createGltfModel(this.position),t(this.entity),this.state="endCreate")}startEdit(e){if(this.state=="startEdit"||this.state=="editing")return;this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this,n;this.state="startEdit",this.modifyHandler.setInputAction(function(s){let o=t.viewer.scene.pick(s.position);Cesium.defined(o)&&o.id&&(n=o.id,t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(s){if(!n)return;let o=t.getCatesian3FromPX(s.endPosition,t.viewer,[t.entity]);o&&(t.entity&&(t.entity.position.setValue(o),t.position=o.clone()),t.state="editing",e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(s){n&&(t.forbidDrawWorld(!1),t.modifyHandler&&(t.modifyHandler.destroy(),t.modifyHandler=null),t.state="editing")},Cesium.ScreenSpaceEventType.LEFT_UP)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.prompt&&(e.prompt.destroy(),e.prompt=null)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}endEdit(e){this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}createGltfModel(e){if(!e)return;let t=Cesium.Math.toRadians(this.style.heading),n=Cesium.Math.toRadians(this.style.pitch),s=Cesium.Math.toRadians(this.style.roll),o=new Cesium.HeadingPitchRoll(t,n,s),r=Cesium.Transforms.headingPitchRollQuaternion(e,o),l=this.viewer.entities.add({position:e,orientation:r,model:{uri:this.modelUri,minimumPixelSize:this.style.minimumPixelSize,maximumScale:this.style.maximumScale,scale:this.style.scale||1,heightReference:this.style.heightReference}});return l.objId=this.objId,l}getPositions(e){return e?me.cartesianToLnglat(this.position,this.viewer):this.position}getStyle(){let e={},t=this.entity.model;e.minimumPixelSize=t.minimumPixelSize.getValue();let n=this.entity.orientation.getValue(),s=this.entity.position.getValue(this.viewer.clock.currentTime),o=me.oreatationToHpr(s.clone(),n,!0)||{};e.heading=(o.heading||0)<360?o.heading+360:o.heading,e.pitch=o.pitch||0,e.roll=o.roll||0,e.scale=t.scale.getValue(),e.uri=t.uri.getValue();let r=this.entity.heightReference&&this.entity.heightReference.getValue();return r!=null&&(e.heightReference=Number(r)),e}setStyle(e){e&&(this.setOrientation(e.heading,e.pitch,e.roll),this.entity.model.scale.setValue(e.scale==null?1:e.scale),e.uri&&this.entity.model.uri.setValue(e.uri),e.heightReference!=null&&this.entity.model.heightReference.setValue(Number(e.heightReference)),this.style=Object.assign(this.style,e))}setOrientation(e,t,n){e=e||0,t=t||0,n=n||0,this.style.heading=e,this.style.pitch=t,this.style.roll=n;var s=Cesium.Math.toRadians(e||0),o=Cesium.Math.toRadians(t||0),r=Cesium.Math.toRadians(n||0),l=new Cesium.HeadingPitchRoll(s,o,r),c=this.entity.position._value,d=Cesium.Transforms.headingPitchRollQuaternion(c,l);this.entity&&(this.entity.orientation=d)}remove(){this.entity&&(this.state="no",this.viewer.entities.remove(this.entity),this.entity=null)}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.style=null,this.prompt&&(this.prompt.destroy(),this.prompt=null)}}String.prototype.codePointAt||(function(){var i=(function(){try{var t={},n=Object.defineProperty,s=n(t,t,t)&&n}catch{}return s})(),e=function(t){if(this==null)throw TypeError();var n=String(this),s=n.length,o=t?Number(t):0;if(o!=o&&(o=0),!(o<0||o>=s)){var r=n.charCodeAt(o),l;return r>=55296&&r<=56319&&s>o+1&&(l=n.charCodeAt(o+1),l>=56320&&l<=57343)?(r-55296)*1024+l-56320+65536:r}};i?i(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e})();function Ti(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Jo,bc;function vC(){if(bc)return Jo;bc=1;var i=0,e=-3;function t(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function n(_,E){this.source=_,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=E,this.destLen=0,this.ltree=new t,this.dtree=new t}var s=new t,o=new t,r=new Uint8Array(30),l=new Uint16Array(30),c=new Uint8Array(30),d=new Uint16Array(30),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new t,m=new Uint8Array(320);function u(_,E,w,D){var F,U;for(F=0;F<w;++F)_[F]=0;for(F=0;F<30-w;++F)_[F+w]=F/w|0;for(U=D,F=0;F<30;++F)E[F]=U,U+=1<<_[F]}function g(_,E){var w;for(w=0;w<7;++w)_.table[w]=0;for(_.table[7]=24,_.table[8]=152,_.table[9]=112,w=0;w<24;++w)_.trans[w]=256+w;for(w=0;w<144;++w)_.trans[24+w]=w;for(w=0;w<8;++w)_.trans[168+w]=280+w;for(w=0;w<112;++w)_.trans[176+w]=144+w;for(w=0;w<5;++w)E.table[w]=0;for(E.table[5]=32,w=0;w<32;++w)E.trans[w]=w}var A=new Uint16Array(16);function p(_,E,w,D){var F,U;for(F=0;F<16;++F)_.table[F]=0;for(F=0;F<D;++F)_.table[E[w+F]]++;for(_.table[0]=0,U=0,F=0;F<16;++F)A[F]=U,U+=_.table[F];for(F=0;F<D;++F)E[w+F]&&(_.trans[A[E[w+F]]++]=F)}function y(_){_.bitcount--||(_.tag=_.source[_.sourceIndex++],_.bitcount=7);var E=_.tag&1;return _.tag>>>=1,E}function C(_,E,w){if(!E)return w;for(;_.bitcount<24;)_.tag|=_.source[_.sourceIndex++]<<_.bitcount,_.bitcount+=8;var D=_.tag&65535>>>16-E;return _.tag>>>=E,_.bitcount-=E,D+w}function I(_,E){for(;_.bitcount<24;)_.tag|=_.source[_.sourceIndex++]<<_.bitcount,_.bitcount+=8;var w=0,D=0,F=0,U=_.tag;do D=2*D+(U&1),U>>>=1,++F,w+=E.table[F],D-=E.table[F];while(D>=0);return _.tag=U,_.bitcount-=F,E.trans[w+D]}function P(_,E,w){var D,F,U,R,b,v;for(D=C(_,5,257),F=C(_,5,1),U=C(_,4,4),R=0;R<19;++R)m[R]=0;for(R=0;R<U;++R){var x=C(_,3,0);m[h[R]]=x}for(p(f,m,0,19),b=0;b<D+F;){var N=I(_,f);switch(N){case 16:var O=m[b-1];for(v=C(_,2,3);v;--v)m[b++]=O;break;case 17:for(v=C(_,3,3);v;--v)m[b++]=0;break;case 18:for(v=C(_,7,11);v;--v)m[b++]=0;break;default:m[b++]=N;break}}p(E,m,0,D),p(w,m,D,F)}function k(_,E,w){for(;;){var D=I(_,E);if(D===256)return i;if(D<256)_.dest[_.destLen++]=D;else{var F,U,R,b;for(D-=257,F=C(_,r[D],l[D]),U=I(_,w),R=_.destLen-C(_,c[U],d[U]),b=R;b<R+F;++b)_.dest[_.destLen++]=_.dest[b]}}}function M(_){for(var E,w,D;_.bitcount>8;)_.sourceIndex--,_.bitcount-=8;if(E=_.source[_.sourceIndex+1],E=256*E+_.source[_.sourceIndex],w=_.source[_.sourceIndex+3],w=256*w+_.source[_.sourceIndex+2],E!==(~w&65535))return e;for(_.sourceIndex+=4,D=E;D;--D)_.dest[_.destLen++]=_.source[_.sourceIndex++];return _.bitcount=0,i}function B(_,E){var w=new n(_,E),D,F,U;do{switch(D=y(w),F=C(w,2,0),F){case 0:U=M(w);break;case 1:U=k(w,s,o);break;case 2:P(w,w.ltree,w.dtree),U=k(w,w.ltree,w.dtree);break;default:U=e}if(U!==i)throw new Error("Data error")}while(!D);return w.destLen<w.dest.length?typeof w.dest.slice=="function"?w.dest.slice(0,w.destLen):w.dest.subarray(0,w.destLen):w.dest}return g(s,o),u(r,l,4,3),u(c,d,2,1),r[28]=0,l[28]=258,Jo=B,Jo}var bC=vC();const wC=Ti(bC);function Pi(i,e,t,n,s){return Math.pow(1-s,3)*i+3*Math.pow(1-s,2)*s*e+3*(1-s)*Math.pow(s,2)*t+Math.pow(s,3)*n}function Ut(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}Ut.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},Ut.prototype.addPoint=function(i,e){typeof i=="number"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=i,this.x2=i),i<this.x1&&(this.x1=i),i>this.x2&&(this.x2=i)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},Ut.prototype.addX=function(i){this.addPoint(i,null)},Ut.prototype.addY=function(i){this.addPoint(null,i)},Ut.prototype.addBezier=function(i,e,t,n,s,o,r,l){const c=[i,e],d=[t,n],h=[s,o],f=[r,l];this.addPoint(i,e),this.addPoint(r,l);for(let m=0;m<=1;m++){const u=6*c[m]-12*d[m]+6*h[m],g=-3*c[m]+9*d[m]-9*h[m]+3*f[m],A=3*d[m]-3*c[m];if(g===0){if(u===0)continue;const I=-A/u;0<I&&I<1&&(m===0&&this.addX(Pi(c[m],d[m],h[m],f[m],I)),m===1&&this.addY(Pi(c[m],d[m],h[m],f[m],I)));continue}const p=Math.pow(u,2)-4*A*g;if(p<0)continue;const y=(-u+Math.sqrt(p))/(2*g);0<y&&y<1&&(m===0&&this.addX(Pi(c[m],d[m],h[m],f[m],y)),m===1&&this.addY(Pi(c[m],d[m],h[m],f[m],y)));const C=(-u-Math.sqrt(p))/(2*g);0<C&&C<1&&(m===0&&this.addX(Pi(c[m],d[m],h[m],f[m],C)),m===1&&this.addY(Pi(c[m],d[m],h[m],f[m],C)))}},Ut.prototype.addQuad=function(i,e,t,n,s,o){const r=i+.6666666666666666*(t-i),l=e+2/3*(n-e),c=r+1/3*(s-i),d=l+1/3*(o-e);this.addBezier(i,e,r,l,c,d,s,o)};function Ne(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}Ne.prototype.moveTo=function(i,e){this.commands.push({type:"M",x:i,y:e})},Ne.prototype.lineTo=function(i,e){this.commands.push({type:"L",x:i,y:e})},Ne.prototype.curveTo=Ne.prototype.bezierCurveTo=function(i,e,t,n,s,o){this.commands.push({type:"C",x1:i,y1:e,x2:t,y2:n,x:s,y:o})},Ne.prototype.quadTo=Ne.prototype.quadraticCurveTo=function(i,e,t,n){this.commands.push({type:"Q",x1:i,y1:e,x:t,y:n})},Ne.prototype.close=Ne.prototype.closePath=function(){this.commands.push({type:"Z"})},Ne.prototype.extend=function(i){if(i.commands)i=i.commands;else if(i instanceof Ut){const e=i;this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),this.close();return}Array.prototype.push.apply(this.commands,i)},Ne.prototype.getBoundingBox=function(){const i=new Ut;let e=0,t=0,n=0,s=0;for(let o=0;o<this.commands.length;o++){const r=this.commands[o];switch(r.type){case"M":i.addPoint(r.x,r.y),e=n=r.x,t=s=r.y;break;case"L":i.addPoint(r.x,r.y),n=r.x,s=r.y;break;case"Q":i.addQuad(n,s,r.x1,r.y1,r.x,r.y),n=r.x,s=r.y;break;case"C":i.addBezier(n,s,r.x1,r.y1,r.x2,r.y2,r.x,r.y),n=r.x,s=r.y;break;case"Z":n=e,s=t;break;default:throw new Error("Unexpected path command "+r.type)}}return i.isEmpty()&&i.addPoint(0,0),i},Ne.prototype.draw=function(i){i.beginPath();for(let e=0;e<this.commands.length;e+=1){const t=this.commands[e];t.type==="M"?i.moveTo(t.x,t.y):t.type==="L"?i.lineTo(t.x,t.y):t.type==="C"?i.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?i.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&i.closePath()}this.fill&&(i.fillStyle=this.fill,i.fill()),this.stroke&&(i.strokeStyle=this.stroke,i.lineWidth=this.strokeWidth,i.stroke())},Ne.prototype.toPathData=function(i){i=i!==void 0?i:2;function e(s){return Math.round(s)===s?""+Math.round(s):s.toFixed(i)}function t(){let s="";for(let o=0;o<arguments.length;o+=1){const r=arguments[o];r>=0&&o>0&&(s+=" "),s+=e(r)}return s}let n="";for(let s=0;s<this.commands.length;s+=1){const o=this.commands[s];o.type==="M"?n+="M"+t(o.x,o.y):o.type==="L"?n+="L"+t(o.x,o.y):o.type==="C"?n+="C"+t(o.x1,o.y1,o.x2,o.y2,o.x,o.y):o.type==="Q"?n+="Q"+t(o.x1,o.y1,o.x,o.y):o.type==="Z"&&(n+="Z")}return n},Ne.prototype.toSVG=function(i){let e='<path d="';return e+=this.toPathData(i),e+='"',this.fill&&this.fill!=="black"&&(this.fill===null?e+=' fill="none"':e+=' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>",e},Ne.prototype.toDOMElement=function(i){const e=this.toPathData(i),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",e),t};function wc(i){throw new Error(i)}function Ic(i,e){i||wc(e)}const le={fail:wc,argument:Ic,assert:Ic},Sc=32768,xc=2147483648,_i={},J={},oe={};function dt(i){return function(){return i}}J.BYTE=function(i){return le.argument(i>=0&&i<=255,"Byte value should be between 0 and 255."),[i]},oe.BYTE=dt(1),J.CHAR=function(i){return[i.charCodeAt(0)]},oe.CHAR=dt(1),J.CHARARRAY=function(i){const e=[];for(let t=0;t<i.length;t+=1)e[t]=i.charCodeAt(t);return e},oe.CHARARRAY=function(i){return i.length},J.USHORT=function(i){return[i>>8&255,i&255]},oe.USHORT=dt(2),J.SHORT=function(i){return i>=Sc&&(i=-(2*Sc-i)),[i>>8&255,i&255]},oe.SHORT=dt(2),J.UINT24=function(i){return[i>>16&255,i>>8&255,i&255]},oe.UINT24=dt(3),J.ULONG=function(i){return[i>>24&255,i>>16&255,i>>8&255,i&255]},oe.ULONG=dt(4),J.LONG=function(i){return i>=xc&&(i=-(2*xc-i)),[i>>24&255,i>>16&255,i>>8&255,i&255]},oe.LONG=dt(4),J.FIXED=J.ULONG,oe.FIXED=oe.ULONG,J.FWORD=J.SHORT,oe.FWORD=oe.SHORT,J.UFWORD=J.USHORT,oe.UFWORD=oe.USHORT,J.LONGDATETIME=function(i){return[0,0,0,0,i>>24&255,i>>16&255,i>>8&255,i&255]},oe.LONGDATETIME=dt(8),J.TAG=function(i){return le.argument(i.length===4,"Tag should be exactly 4 ASCII characters."),[i.charCodeAt(0),i.charCodeAt(1),i.charCodeAt(2),i.charCodeAt(3)]},oe.TAG=dt(4),J.Card8=J.BYTE,oe.Card8=oe.BYTE,J.Card16=J.USHORT,oe.Card16=oe.USHORT,J.OffSize=J.BYTE,oe.OffSize=oe.BYTE,J.SID=J.USHORT,oe.SID=oe.USHORT,J.NUMBER=function(i){return i>=-107&&i<=107?[i+139]:i>=108&&i<=1131?(i=i-108,[(i>>8)+247,i&255]):i>=-1131&&i<=-108?(i=-i-108,[(i>>8)+251,i&255]):i>=-32768&&i<=32767?J.NUMBER16(i):J.NUMBER32(i)},oe.NUMBER=function(i){return J.NUMBER(i).length},J.NUMBER16=function(i){return[28,i>>8&255,i&255]},oe.NUMBER16=dt(3),J.NUMBER32=function(i){return[29,i>>24&255,i>>16&255,i>>8&255,i&255]},oe.NUMBER32=dt(5),J.REAL=function(i){let e=i.toString();const t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){const o=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(i*o)/o).toString()}let n="";for(let o=0,r=e.length;o<r;o+=1){const l=e[o];l==="e"?n+=e[++o]==="-"?"c":"b":l==="."?n+="a":l==="-"?n+="e":n+=l}n+=n.length&1?"f":"ff";const s=[30];for(let o=0,r=n.length;o<r;o+=2)s.push(parseInt(n.substr(o,2),16));return s},oe.REAL=function(i){return J.REAL(i).length},J.NAME=J.CHARARRAY,oe.NAME=oe.CHARARRAY,J.STRING=J.CHARARRAY,oe.STRING=oe.CHARARRAY,_i.UTF8=function(i,e,t){const n=[],s=t;for(let o=0;o<s;o++,e+=1)n[o]=i.getUint8(e);return String.fromCharCode.apply(null,n)},_i.UTF16=function(i,e,t){const n=[],s=t/2;for(let o=0;o<s;o++,e+=2)n[o]=i.getUint16(e);return String.fromCharCode.apply(null,n)},J.UTF16=function(i){const e=[];for(let t=0;t<i.length;t+=1){const n=i.charCodeAt(t);e[e.length]=n>>8&255,e[e.length]=n&255}return e},oe.UTF16=function(i){return i.length*2};const Zo={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};_i.MACSTRING=function(i,e,t,n){const s=Zo[n];if(s===void 0)return;let o="";for(let r=0;r<t;r++){const l=i.getUint8(e+r);l<=127?o+=String.fromCharCode(l):o+=s[l&127]}return o};const ms=typeof WeakMap=="function"&&new WeakMap;let gs;const IC=function(i){if(!gs){gs={};for(let s in Zo)gs[s]=new String(s)}const e=gs[i];if(e===void 0)return;if(ms){const s=ms.get(e);if(s!==void 0)return s}const t=Zo[i];if(t===void 0)return;const n={};for(let s=0;s<t.length;s++)n[t.charCodeAt(s)]=s+128;return ms&&ms.set(e,n),n};J.MACSTRING=function(i,e){const t=IC(e);if(t===void 0)return;const n=[];for(let s=0;s<i.length;s++){let o=i.charCodeAt(s);if(o>=128&&(o=t[o],o===void 0))return;n[s]=o}return n},oe.MACSTRING=function(i,e){const t=J.MACSTRING(i,e);return t!==void 0?t.length:0};function ea(i){return i>=-128&&i<=127}function SC(i,e,t){let n=0;const s=i.length;for(;e<s&&n<64&&i[e]===0;)++e,++n;return t.push(128|n-1),e}function xC(i,e,t){let n=0;const s=i.length;let o=e;for(;o<s&&n<64;){const r=i[o];if(!ea(r)||r===0&&o+1<s&&i[o+1]===0)break;++o,++n}t.push(n-1);for(let r=e;r<o;++r)t.push(i[r]+256&255);return o}function MC(i,e,t){let n=0;const s=i.length;let o=e;for(;o<s&&n<64;){const r=i[o];if(r===0||ea(r)&&o+1<s&&ea(i[o+1]))break;++o,++n}t.push(64|n-1);for(let r=e;r<o;++r){const l=i[r];t.push(l+65536>>8&255,l+256&255)}return o}J.VARDELTAS=function(i){let e=0;const t=[];for(;e<i.length;){const n=i[e];n===0?e=SC(i,e,t):n>=-128&&n<=127?e=xC(i,e,t):e=MC(i,e,t)}return t},J.INDEX=function(i){let e=1;const t=[e],n=[];for(let l=0;l<i.length;l+=1){const c=J.OBJECT(i[l]);Array.prototype.push.apply(n,c),e+=c.length,t.push(e)}if(n.length===0)return[0,0];const s=[],o=1+Math.floor(Math.log(e)/Math.log(2))/8|0,r=[void 0,J.BYTE,J.USHORT,J.UINT24,J.ULONG][o];for(let l=0;l<t.length;l+=1){const c=r(t[l]);Array.prototype.push.apply(s,c)}return Array.prototype.concat(J.Card16(i.length),J.OffSize(o),s,n)},oe.INDEX=function(i){return J.INDEX(i).length},J.DICT=function(i){let e=[];const t=Object.keys(i),n=t.length;for(let s=0;s<n;s+=1){const o=parseInt(t[s],0),r=i[o];e=e.concat(J.OPERAND(r.value,r.type)),e=e.concat(J.OPERATOR(o))}return e},oe.DICT=function(i){return J.DICT(i).length},J.OPERATOR=function(i){return i<1200?[i]:[12,i-1200]},J.OPERAND=function(i,e){let t=[];if(Array.isArray(e))for(let n=0;n<e.length;n+=1)le.argument(i.length===e.length,"Not enough arguments given for type"+e),t=t.concat(J.OPERAND(i[n],e[n]));else if(e==="SID")t=t.concat(J.NUMBER(i));else if(e==="offset")t=t.concat(J.NUMBER32(i));else if(e==="number")t=t.concat(J.NUMBER(i));else if(e==="real")t=t.concat(J.REAL(i));else throw new Error("Unknown operand type "+e);return t},J.OP=J.BYTE,oe.OP=oe.BYTE;const ps=typeof WeakMap=="function"&&new WeakMap;J.CHARSTRING=function(i){if(ps){const n=ps.get(i);if(n!==void 0)return n}let e=[];const t=i.length;for(let n=0;n<t;n+=1){const s=i[n];e=e.concat(J[s.type](s.value))}return ps&&ps.set(i,e),e},oe.CHARSTRING=function(i){return J.CHARSTRING(i).length},J.OBJECT=function(i){const e=J[i.type];return le.argument(e!==void 0,"No encoding function for type "+i.type),e(i.value)},oe.OBJECT=function(i){const e=oe[i.type];return le.argument(e!==void 0,"No sizeOf function for type "+i.type),e(i.value)},J.TABLE=function(i){let e=[];const t=i.fields.length,n=[],s=[];for(let o=0;o<t;o+=1){const r=i.fields[o],l=J[r.type];le.argument(l!==void 0,"No encoding function for field type "+r.type+" ("+r.name+")");let c=i[r.name];c===void 0&&(c=r.value);const d=l(c);r.type==="TABLE"?(s.push(e.length),e=e.concat([0,0]),n.push(d)):e=e.concat(d)}for(let o=0;o<n.length;o+=1){const r=s[o],l=e.length;le.argument(l<65536,"Table "+i.tableName+" too big."),e[r]=l>>8,e[r+1]=l&255,e=e.concat(n[o])}return e},oe.TABLE=function(i){let e=0;const t=i.fields.length;for(let n=0;n<t;n+=1){const s=i.fields[n],o=oe[s.type];le.argument(o!==void 0,"No sizeOf function for field type "+s.type+" ("+s.name+")");let r=i[s.name];r===void 0&&(r=s.value),e+=o(r),s.type==="TABLE"&&(e+=2)}return e},J.RECORD=J.TABLE,oe.RECORD=oe.TABLE,J.LITERAL=function(i){return i},oe.LITERAL=function(i){return i.length};function Ue(i,e,t){for(let n=0;n<e.length;n+=1){const s=e[n];this[s.name]=s.value}if(this.tableName=i,this.fields=e,t){const n=Object.keys(t);for(let s=0;s<n.length;s+=1){const o=n[s],r=t[o];this[o]!==void 0&&(this[o]=r)}}}Ue.prototype.encode=function(){return J.TABLE(this)},Ue.prototype.sizeOf=function(){return oe.TABLE(this)};function pn(i,e,t){t===void 0&&(t=e.length);const n=new Array(e.length+1);n[0]={name:i+"Count",type:"USHORT",value:t};for(let s=0;s<e.length;s++)n[s+1]={name:i+s,type:"USHORT",value:e[s]};return n}function ta(i,e,t){const n=e.length,s=new Array(n+1);s[0]={name:i+"Count",type:"USHORT",value:n};for(let o=0;o<n;o++)s[o+1]={name:i+o,type:"TABLE",value:t(e[o],o)};return s}function As(i,e,t){const n=e.length;let s=[];s[0]={name:i+"Count",type:"USHORT",value:n};for(let o=0;o<n;o++)s=s.concat(t(e[o],o));return s}function ys(i){i.format===1?Ue.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(pn("glyph",i.glyphs))):le.assert(!1,"Can't create coverage table format 2 yet.")}ys.prototype=Object.create(Ue.prototype),ys.prototype.constructor=ys;function Es(i){Ue.call(this,"scriptListTable",As("scriptRecord",i,function(e,t){const n=e.script;let s=n.defaultLangSys;return le.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new Ue("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new Ue("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(pn("featureIndex",s.featureIndexes)))}].concat(As("langSys",n.langSysRecords,function(o,r){const l=o.langSys;return[{name:"langSysTag"+r,type:"TAG",value:o.tag},{name:"langSys"+r,type:"TABLE",value:new Ue("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:l.reqFeatureIndex}].concat(pn("featureIndex",l.featureIndexes)))}]})))}]}))}Es.prototype=Object.create(Ue.prototype),Es.prototype.constructor=Es;function Cs(i){Ue.call(this,"featureListTable",As("featureRecord",i,function(e,t){const n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new Ue("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(pn("lookupListIndex",n.lookupListIndexes)))}]}))}Cs.prototype=Object.create(Ue.prototype),Cs.prototype.constructor=Cs;function vs(i,e){Ue.call(this,"lookupListTable",ta("lookup",i,function(t){let n=e[t.lookupType];return le.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new Ue("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(ta("subtable",t.subtables,n)))}))}vs.prototype=Object.create(Ue.prototype),vs.prototype.constructor=vs;const ne={Table:Ue,Record:Ue,Coverage:ys,ScriptList:Es,FeatureList:Cs,LookupList:vs,ushortList:pn,tableList:ta,recordList:As};function Mc(i,e){return i.getUint8(e)}function bs(i,e){return i.getUint16(e,!1)}function BC(i,e){return i.getInt16(e,!1)}function ia(i,e){return i.getUint32(e,!1)}function Bc(i,e){const t=i.getInt16(e,!1),n=i.getUint16(e+2,!1);return t+n/65535}function TC(i,e){let t="";for(let n=e;n<e+4;n+=1)t+=String.fromCharCode(i.getInt8(n));return t}function PC(i,e,t){let n=0;for(let s=0;s<t;s+=1)n<<=8,n+=i.getUint8(e+s);return n}function _C(i,e,t){const n=[];for(let s=e;s<t;s+=1)n.push(i.getUint8(s));return n}function DC(i){let e="";for(let t=0;t<i.length;t+=1)e+=String.fromCharCode(i[t]);return e}const kC={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function H(i,e){this.data=i,this.offset=e,this.relativeOffset=0}H.prototype.parseByte=function(){const i=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,i},H.prototype.parseChar=function(){const i=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,i},H.prototype.parseCard8=H.prototype.parseByte,H.prototype.parseUShort=function(){const i=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,i},H.prototype.parseCard16=H.prototype.parseUShort,H.prototype.parseSID=H.prototype.parseUShort,H.prototype.parseOffset16=H.prototype.parseUShort,H.prototype.parseShort=function(){const i=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,i},H.prototype.parseF2Dot14=function(){const i=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,i},H.prototype.parseULong=function(){const i=ia(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,i},H.prototype.parseOffset32=H.prototype.parseULong,H.prototype.parseFixed=function(){const i=Bc(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,i},H.prototype.parseString=function(i){const e=this.data,t=this.offset+this.relativeOffset;let n="";this.relativeOffset+=i;for(let s=0;s<i;s++)n+=String.fromCharCode(e.getUint8(t+s));return n},H.prototype.parseTag=function(){return this.parseString(4)},H.prototype.parseLongDateTime=function(){let i=ia(this.data,this.offset+this.relativeOffset+4);return i-=2082844800,this.relativeOffset+=8,i},H.prototype.parseVersion=function(i){const e=bs(this.data,this.offset+this.relativeOffset),t=bs(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,i===void 0&&(i=4096),e+t/i/10},H.prototype.skip=function(i,e){e===void 0&&(e=1),this.relativeOffset+=kC[i]*e},H.prototype.parseULongList=function(i){i===void 0&&(i=this.parseULong());const e=new Array(i),t=this.data;let n=this.offset+this.relativeOffset;for(let s=0;s<i;s++)e[s]=t.getUint32(n),n+=4;return this.relativeOffset+=i*4,e},H.prototype.parseOffset16List=H.prototype.parseUShortList=function(i){i===void 0&&(i=this.parseUShort());const e=new Array(i),t=this.data;let n=this.offset+this.relativeOffset;for(let s=0;s<i;s++)e[s]=t.getUint16(n),n+=2;return this.relativeOffset+=i*2,e},H.prototype.parseShortList=function(i){const e=new Array(i),t=this.data;let n=this.offset+this.relativeOffset;for(let s=0;s<i;s++)e[s]=t.getInt16(n),n+=2;return this.relativeOffset+=i*2,e},H.prototype.parseByteList=function(i){const e=new Array(i),t=this.data;let n=this.offset+this.relativeOffset;for(let s=0;s<i;s++)e[s]=t.getUint8(n++);return this.relativeOffset+=i,e},H.prototype.parseList=function(i,e){e||(e=i,i=this.parseUShort());const t=new Array(i);for(let n=0;n<i;n++)t[n]=e.call(this);return t},H.prototype.parseList32=function(i,e){e||(e=i,i=this.parseULong());const t=new Array(i);for(let n=0;n<i;n++)t[n]=e.call(this);return t},H.prototype.parseRecordList=function(i,e){e||(e=i,i=this.parseUShort());const t=new Array(i),n=Object.keys(e);for(let s=0;s<i;s++){const o={};for(let r=0;r<n.length;r++){const l=n[r],c=e[l];o[l]=c.call(this)}t[s]=o}return t},H.prototype.parseRecordList32=function(i,e){e||(e=i,i=this.parseULong());const t=new Array(i),n=Object.keys(e);for(let s=0;s<i;s++){const o={};for(let r=0;r<n.length;r++){const l=n[r],c=e[l];o[l]=c.call(this)}t[s]=o}return t},H.prototype.parseStruct=function(i){if(typeof i=="function")return i.call(this);{const e=Object.keys(i),t={};for(let n=0;n<e.length;n++){const s=e[n],o=i[s];t[s]=o.call(this)}return t}},H.prototype.parseValueRecord=function(i){if(i===void 0&&(i=this.parseUShort()),i===0)return;const e={};return i&1&&(e.xPlacement=this.parseShort()),i&2&&(e.yPlacement=this.parseShort()),i&4&&(e.xAdvance=this.parseShort()),i&8&&(e.yAdvance=this.parseShort()),i&16&&(e.xPlaDevice=void 0,this.parseShort()),i&32&&(e.yPlaDevice=void 0,this.parseShort()),i&64&&(e.xAdvDevice=void 0,this.parseShort()),i&128&&(e.yAdvDevice=void 0,this.parseShort()),e},H.prototype.parseValueRecordList=function(){const i=this.parseUShort(),e=this.parseUShort(),t=new Array(e);for(let n=0;n<e;n++)t[n]=this.parseValueRecord(i);return t},H.prototype.parsePointer=function(i){const e=this.parseOffset16();if(e>0)return new H(this.data,this.offset+e).parseStruct(i)},H.prototype.parsePointer32=function(i){const e=this.parseOffset32();if(e>0)return new H(this.data,this.offset+e).parseStruct(i)},H.prototype.parseListOfLists=function(i){const e=this.parseOffset16List(),t=e.length,n=this.relativeOffset,s=new Array(t);for(let o=0;o<t;o++){const r=e[o];if(r===0){s[o]=void 0;continue}if(this.relativeOffset=r,i){const l=this.parseOffset16List(),c=new Array(l.length);for(let d=0;d<l.length;d++)this.relativeOffset=r+l[d],c[d]=i.call(this);s[o]=c}else s[o]=this.parseUShortList()}return this.relativeOffset=n,s},H.prototype.parseCoverage=function(){const i=this.offset+this.relativeOffset,e=this.parseUShort(),t=this.parseUShort();if(e===1)return{format:1,glyphs:this.parseUShortList(t)};if(e===2){const n=new Array(t);for(let s=0;s<t;s++)n[s]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+i.toString(16)+": Coverage format must be 1 or 2.")},H.prototype.parseClassDef=function(){const i=this.offset+this.relativeOffset,e=this.parseUShort();if(e===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(e===2)return{format:2,ranges:this.parseRecordList({start:H.uShort,end:H.uShort,classId:H.uShort})};throw new Error("0x"+i.toString(16)+": ClassDef format must be 1 or 2.")},H.list=function(i,e){return function(){return this.parseList(i,e)}},H.list32=function(i,e){return function(){return this.parseList32(i,e)}},H.recordList=function(i,e){return function(){return this.parseRecordList(i,e)}},H.recordList32=function(i,e){return function(){return this.parseRecordList32(i,e)}},H.pointer=function(i){return function(){return this.parsePointer(i)}},H.pointer32=function(i){return function(){return this.parsePointer32(i)}},H.tag=H.prototype.parseTag,H.byte=H.prototype.parseByte,H.uShort=H.offset16=H.prototype.parseUShort,H.uShortList=H.prototype.parseUShortList,H.uLong=H.offset32=H.prototype.parseULong,H.uLongList=H.prototype.parseULongList,H.struct=H.prototype.parseStruct,H.coverage=H.prototype.parseCoverage,H.classDef=H.prototype.parseClassDef;const Tc={reserved:H.uShort,reqFeatureIndex:H.uShort,featureIndexes:H.uShortList};H.prototype.parseScriptList=function(){return this.parsePointer(H.recordList({tag:H.tag,script:H.pointer({defaultLangSys:H.pointer(Tc),langSysRecords:H.recordList({tag:H.tag,langSys:H.pointer(Tc)})})}))||[]},H.prototype.parseFeatureList=function(){return this.parsePointer(H.recordList({tag:H.tag,feature:H.pointer({featureParams:H.offset16,lookupListIndexes:H.uShortList})}))||[]},H.prototype.parseLookupList=function(i){return this.parsePointer(H.list(H.pointer(function(){const e=this.parseUShort();le.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");const t=this.parseUShort(),n=t&16;return{lookupType:e,lookupFlag:t,subtables:this.parseList(H.pointer(i[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},H.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){const i=this.parseUShort(),e=this.parseUShort();return le.argument(i===1&&e<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:H.offset32,featureTableSubstitutionOffset:H.offset32})})||[]};const te={getByte:Mc,getCard8:Mc,getUShort:bs,getCard16:bs,getShort:BC,getULong:ia,getFixed:Bc,getTag:TC,getOffset:PC,getBytes:_C,bytesToString:DC,Parser:H};function NC(i,e){e.parseUShort(),i.length=e.parseULong(),i.language=e.parseULong();let t;i.groupCount=t=e.parseULong(),i.glyphIndexMap={};for(let n=0;n<t;n+=1){const s=e.parseULong(),o=e.parseULong();let r=e.parseULong();for(let l=s;l<=o;l+=1)i.glyphIndexMap[l]=r,r++}}function RC(i,e,t,n,s){i.length=e.parseUShort(),i.language=e.parseUShort();let o;i.segCount=o=e.parseUShort()>>1,e.skip("uShort",3),i.glyphIndexMap={};const r=new te.Parser(t,n+s+14),l=new te.Parser(t,n+s+16+o*2),c=new te.Parser(t,n+s+16+o*4),d=new te.Parser(t,n+s+16+o*6);let h=n+s+16+o*8;for(let f=0;f<o-1;f+=1){let m;const u=r.parseUShort(),g=l.parseUShort(),A=c.parseShort(),p=d.parseUShort();for(let y=g;y<=u;y+=1)p!==0?(h=d.offset+d.relativeOffset-2,h+=p,h+=(y-g)*2,m=te.getUShort(t,h),m!==0&&(m=m+A&65535)):m=y+A&65535,i.glyphIndexMap[y]=m}}function FC(i,e){const t={};t.version=te.getUShort(i,e),le.argument(t.version===0,"cmap table version should be 0."),t.numTables=te.getUShort(i,e+2);let n=-1;for(let o=t.numTables-1;o>=0;o-=1){const r=te.getUShort(i,e+4+o*8),l=te.getUShort(i,e+4+o*8+2);if(r===3&&(l===0||l===1||l===10)||r===0&&(l===0||l===1||l===2||l===3||l===4)){n=te.getULong(i,e+4+o*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");const s=new te.Parser(i,e+n);if(t.format=s.parseUShort(),t.format===12)NC(t,s);else if(t.format===4)RC(t,s,i,e,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function LC(i,e,t){i.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function OC(i){i.segments.push({end:65535,start:65535,delta:1,offset:0})}function GC(i){let e=!0,t;for(t=i.length-1;t>0;t-=1)if(i.get(t).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}let n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);const s=new ne.Table("cmap",n);for(s.segments=[],t=0;t<i.length;t+=1){const u=i.get(t);for(let g=0;g<u.unicodes.length;g+=1)LC(s,u.unicodes[g],t);s.segments=s.segments.sort(function(g,A){return g.start-A.start})}OC(s);const o=s.segments.length;let r=0,l=[],c=[],d=[],h=[],f=[],m=[];for(t=0;t<o;t+=1){const u=s.segments[t];u.end<=65535&&u.start<=65535?(l=l.concat({name:"end_"+t,type:"USHORT",value:u.end}),c=c.concat({name:"start_"+t,type:"USHORT",value:u.start}),d=d.concat({name:"idDelta_"+t,type:"SHORT",value:u.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:u.offset}),u.glyphId!==void 0&&(f=f.concat({name:"glyph_"+t,type:"USHORT",value:u.glyphId}))):r+=1,!e&&u.glyphIndex!==void 0&&(m=m.concat({name:"cmap12Start_"+t,type:"ULONG",value:u.start}),m=m.concat({name:"cmap12End_"+t,type:"ULONG",value:u.end}),m=m.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:u.glyphIndex}))}if(s.segCountX2=(o-r)*2,s.searchRange=Math.pow(2,Math.floor(Math.log(o-r)/Math.log(2)))*2,s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(l),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(c),s.fields=s.fields.concat(d),s.fields=s.fields.concat(h),s.fields=s.fields.concat(f),s.cmap4Length=14+l.length*2+2+c.length*2+d.length*2+h.length*2+f.length*2,!e){const u=16+m.length*4;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:u},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:m.length/3}]),s.fields=s.fields.concat(m)}return s}const Pc={parse:FC,make:GC},ws=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],UC=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],VC=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],ni=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function _c(i){this.font=i}_c.prototype.charToGlyphIndex=function(i){const e=i.codePointAt(0),t=this.font.glyphs;if(t)for(let n=0;n<t.length;n+=1){const s=t.get(n);for(let o=0;o<s.unicodes.length;o+=1)if(s.unicodes[o]===e)return n}return null};function Dc(i){this.cmap=i}Dc.prototype.charToGlyphIndex=function(i){return this.cmap.glyphIndexMap[i.codePointAt(0)]||0};function Is(i,e){this.encoding=i,this.charset=e}Is.prototype.charToGlyphIndex=function(i){const e=i.codePointAt(0),t=this.encoding[e];return this.charset.indexOf(t)};function na(i){switch(i.version){case 1:this.names=ni.slice();break;case 2:this.names=new Array(i.numberOfGlyphs);for(let e=0;e<i.numberOfGlyphs;e++)i.glyphNameIndex[e]<ni.length?this.names[e]=ni[i.glyphNameIndex[e]]:this.names[e]=i.names[i.glyphNameIndex[e]-ni.length];break;case 2.5:this.names=new Array(i.numberOfGlyphs);for(let e=0;e<i.numberOfGlyphs;e++)this.names[e]=ni[e+i.glyphNameIndex[e]];break;case 3:this.names=[];break;default:this.names=[];break}}na.prototype.nameToGlyphIndex=function(i){return this.names.indexOf(i)},na.prototype.glyphIndexToName=function(i){return this.names[i]};function QC(i){let e;const t=i.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){const o=n[s],r=t[o];e=i.glyphs.get(r),e.addUnicode(parseInt(o))}for(let s=0;s<i.glyphs.length;s+=1)e=i.glyphs.get(s),i.cffEncoding?i.isCIDFont?e.name="gid"+s:e.name=i.cffEncoding.charset[s]:i.glyphNames.names&&(e.name=i.glyphNames.glyphIndexToName(s))}function HC(i,e,t,n,s){i.beginPath(),i.moveTo(e,t),i.lineTo(n,s),i.stroke()}const si={line:HC};function YC(i,e){let t=e||new Ne;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function at(i){this.bindConstructorValues(i)}at.prototype.bindConstructorValues=function(i){this.index=i.index||0,this.name=i.name||null,this.unicode=i.unicode||void 0,this.unicodes=i.unicodes||i.unicode!==void 0?[i.unicode]:[],i.xMin&&(this.xMin=i.xMin),i.yMin&&(this.yMin=i.yMin),i.xMax&&(this.xMax=i.xMax),i.yMax&&(this.yMax=i.yMax),i.advanceWidth&&(this.advanceWidth=i.advanceWidth),Object.defineProperty(this,"path",YC(this,i.path))},at.prototype.addUnicode=function(i){this.unicodes.length===0&&(this.unicode=i),this.unicodes.push(i)},at.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},at.prototype.getPath=function(i,e,t,n,s){i=i!==void 0?i:0,e=e!==void 0?e:0,t=t!==void 0?t:72;let o,r;n||(n={});let l=n.xScale,c=n.yScale;if(n.hinting&&s&&s.hinting&&(r=this.path&&s.hinting.exec(this,t)),r)o=s.hinting.getCommands(r),i=Math.round(i),e=Math.round(e),l=c=1;else{o=this.path.commands;const h=1/this.path.unitsPerEm*t;l===void 0&&(l=h),c===void 0&&(c=h)}const d=new Ne;for(let h=0;h<o.length;h+=1){const f=o[h];f.type==="M"?d.moveTo(i+f.x*l,e+-f.y*c):f.type==="L"?d.lineTo(i+f.x*l,e+-f.y*c):f.type==="Q"?d.quadraticCurveTo(i+f.x1*l,e+-f.y1*c,i+f.x*l,e+-f.y*c):f.type==="C"?d.curveTo(i+f.x1*l,e+-f.y1*c,i+f.x2*l,e+-f.y2*c,i+f.x*l,e+-f.y*c):f.type==="Z"&&d.closePath()}return d},at.prototype.getContours=function(){if(this.points===void 0)return[];const i=[];let e=[];for(let t=0;t<this.points.length;t+=1){const n=this.points[t];e.push(n),n.lastPointOfContour&&(i.push(e),e=[])}return le.argument(e.length===0,"There are still points left in the current contour."),i},at.prototype.getMetrics=function(){const i=this.path.commands,e=[],t=[];for(let s=0;s<i.length;s+=1){const o=i[s];o.type!=="Z"&&(e.push(o.x),t.push(o.y)),(o.type==="Q"||o.type==="C")&&(e.push(o.x1),t.push(o.y1)),o.type==="C"&&(e.push(o.x2),t.push(o.y2))}const n={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(n.xMin)||(n.xMin=0),isFinite(n.xMax)||(n.xMax=this.advanceWidth),isFinite(n.yMin)||(n.yMin=0),isFinite(n.yMax)||(n.yMax=0),n.rightSideBearing=this.advanceWidth-n.leftSideBearing-(n.xMax-n.xMin),n},at.prototype.draw=function(i,e,t,n,s){this.getPath(e,t,n,s).draw(i)},at.prototype.drawPoints=function(i,e,t,n){function s(d,h,f,m){const u=Math.PI*2;i.beginPath();for(let g=0;g<d.length;g+=1)i.moveTo(h+d[g].x*m,f+d[g].y*m),i.arc(h+d[g].x*m,f+d[g].y*m,2,0,u,!1);i.closePath(),i.fill()}e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24;const o=1/this.path.unitsPerEm*n,r=[],l=[],c=this.path;for(let d=0;d<c.commands.length;d+=1){const h=c.commands[d];h.x!==void 0&&r.push({x:h.x,y:-h.y}),h.x1!==void 0&&l.push({x:h.x1,y:-h.y1}),h.x2!==void 0&&l.push({x:h.x2,y:-h.y2})}i.fillStyle="blue",s(r,e,t,o),i.fillStyle="red",s(l,e,t,o)},at.prototype.drawMetrics=function(i,e,t,n){let s;e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:24,s=1/this.path.unitsPerEm*n,i.lineWidth=1,i.strokeStyle="black",si.line(i,e,-1e4,e,1e4),si.line(i,-1e4,t,1e4,t);const o=this.xMin||0;let r=this.yMin||0;const l=this.xMax||0;let c=this.yMax||0;const d=this.advanceWidth||0;i.strokeStyle="blue",si.line(i,e+o*s,-1e4,e+o*s,1e4),si.line(i,e+l*s,-1e4,e+l*s,1e4),si.line(i,-1e4,t+-r*s,1e4,t+-r*s),si.line(i,-1e4,t+-c*s,1e4,t+-c*s),i.strokeStyle="green",si.line(i,e+d*s,-1e4,e+d*s,1e4)};function Ss(i,e,t){Object.defineProperty(i,e,{get:function(){return i.path,i[t]},set:function(n){i[t]=n},enumerable:!0,configurable:!0})}function sa(i,e){if(this.font=i,this.glyphs={},Array.isArray(e))for(let t=0;t<e.length;t++)this.glyphs[t]=e[t];this.length=e&&e.length||0}sa.prototype.get=function(i){return typeof this.glyphs[i]=="function"&&(this.glyphs[i]=this.glyphs[i]()),this.glyphs[i]},sa.prototype.push=function(i,e){this.glyphs[i]=e,this.length++};function zC(i,e){return new at({index:e,font:i})}function jC(i,e,t,n,s,o){return function(){const r=new at({index:e,font:i});return r.path=function(){t(r,n,s);const l=o(i.glyphs,r);return l.unitsPerEm=i.unitsPerEm,l},Ss(r,"xMin","_xMin"),Ss(r,"xMax","_xMax"),Ss(r,"yMin","_yMin"),Ss(r,"yMax","_yMax"),r}}function WC(i,e,t,n){return function(){const s=new at({index:e,font:i});return s.path=function(){const o=t(i,s,n);return o.unitsPerEm=i.unitsPerEm,o},s}}const Di={GlyphSet:sa,glyphLoader:zC,ttfGlyphLoader:jC,cffGlyphLoader:WC};function kc(i,e){if(i===e)return!0;if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t+=1)if(!kc(i[t],e[t]))return!1;return!0}else return!1}function oa(i){let e;return i.length<1240?e=107:i.length<33900?e=1131:e=32768,e}function Vt(i,e,t){const n=[],s=[],o=te.getCard16(i,e);let r,l;if(o!==0){const c=te.getByte(i,e+2);r=e+(o+1)*c+2;let d=e+3;for(let h=0;h<o+1;h+=1)n.push(te.getOffset(i,d,c)),d+=c;l=r+n[o]}else l=e+2;for(let c=0;c<n.length-1;c+=1){let d=te.getBytes(i,r+n[c],r+n[c+1]);t&&(d=t(d)),s.push(d)}return{objects:s,startOffset:e,endOffset:l}}function $C(i){let e="";const n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=i.parseByte(),o=s>>4,r=s&15;if(o===15||(e+=n[o],r===15))break;e+=n[r]}return parseFloat(e)}function KC(i,e){let t,n,s,o;if(e===28)return t=i.parseByte(),n=i.parseByte(),t<<8|n;if(e===29)return t=i.parseByte(),n=i.parseByte(),s=i.parseByte(),o=i.parseByte(),t<<24|n<<16|s<<8|o;if(e===30)return $C(i);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=i.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=i.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function qC(i){const e={};for(let t=0;t<i.length;t+=1){const n=i[t][0],s=i[t][1];let o;if(s.length===1?o=s[0]:o=s,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=o}return e}function Nc(i,e,t){e=e!==void 0?e:0;const n=new te.Parser(i,e),s=[];let o=[];for(t=t!==void 0?t:i.length;n.relativeOffset<t;){let r=n.parseByte();r<=21?(r===12&&(r=1200+n.parseByte()),s.push([r,o]),o=[]):o.push(KC(n,r))}return qC(s)}function An(i,e){return e<=390?e=ws[e]:e=i[e-391],e}function Rc(i,e,t){const n={};let s;for(let o=0;o<e.length;o+=1){const r=e[o];if(Array.isArray(r.type)){const l=[];l.length=r.type.length;for(let c=0;c<r.type.length;c++)s=i[r.op]!==void 0?i[r.op][c]:void 0,s===void 0&&(s=r.value!==void 0&&r.value[c]!==void 0?r.value[c]:null),r.type[c]==="SID"&&(s=An(t,s)),l[c]=s;n[r.name]=l}else s=i[r.op],s===void 0&&(s=r.value!==void 0?r.value:null),r.type==="SID"&&(s=An(t,s)),n[r.name]=s}return n}function XC(i,e){const t={};return t.formatMajor=te.getCard8(i,e),t.formatMinor=te.getCard8(i,e+1),t.size=te.getCard8(i,e+2),t.offsetSize=te.getCard8(i,e+3),t.startOffset=e,t.endOffset=e+4,t}const Fc=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Lc=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function JC(i,e){const t=Nc(i,0,i.byteLength);return Rc(t,Fc,e)}function Oc(i,e,t,n){const s=Nc(i,e,t);return Rc(s,Lc,n)}function Gc(i,e,t,n){const s=[];for(let o=0;o<t.length;o+=1){const r=new DataView(new Uint8Array(t[o]).buffer),l=JC(r,n);l._subrs=[],l._subrsBias=0;const c=l.private[0],d=l.private[1];if(c!==0&&d!==0){const h=Oc(i,d+e,c,n);if(l._defaultWidthX=h.defaultWidthX,l._nominalWidthX=h.nominalWidthX,h.subrs!==0){const f=d+h.subrs,m=Vt(i,f+e);l._subrs=m.objects,l._subrsBias=oa(l._subrs)}l._privateDict=h}s.push(l)}return s}function ZC(i,e,t,n){let s,o;const r=new te.Parser(i,e);t-=1;const l=[".notdef"],c=r.parseCard8();if(c===0)for(let d=0;d<t;d+=1)s=r.parseSID(),l.push(An(n,s));else if(c===1)for(;l.length<=t;){s=r.parseSID(),o=r.parseCard8();for(let d=0;d<=o;d+=1)l.push(An(n,s)),s+=1}else if(c===2)for(;l.length<=t;){s=r.parseSID(),o=r.parseCard16();for(let d=0;d<=o;d+=1)l.push(An(n,s)),s+=1}else throw new Error("Unknown charset format "+c);return l}function ev(i,e,t){let n;const s={},o=new te.Parser(i,e),r=o.parseCard8();if(r===0){const l=o.parseCard8();for(let c=0;c<l;c+=1)n=o.parseCard8(),s[n]=c}else if(r===1){const l=o.parseCard8();n=1;for(let c=0;c<l;c+=1){const d=o.parseCard8(),h=o.parseCard8();for(let f=d;f<=d+h;f+=1)s[f]=n,n+=1}}else throw new Error("Unknown encoding format "+r);return new Is(s,t)}function tv(i,e,t){let n,s,o,r;const l=new Ne,c=[];let d=0,h=!1,f=!1,m=0,u=0,g,A,p,y;if(i.isCIDFont){const M=i.tables.cff.topDict._fdSelect[e.index],B=i.tables.cff.topDict._fdArray[M];g=B._subrs,A=B._subrsBias,p=B._defaultWidthX,y=B._nominalWidthX}else g=i.tables.cff.topDict._subrs,A=i.tables.cff.topDict._subrsBias,p=i.tables.cff.topDict._defaultWidthX,y=i.tables.cff.topDict._nominalWidthX;let C=p;function I(M,B){f&&l.closePath(),l.moveTo(M,B),f=!0}function P(){let M;M=c.length%2!==0,M&&!h&&(C=c.shift()+y),d+=c.length>>1,c.length=0,h=!0}function k(M){let B,_,E,w,D,F,U,R,b,v,x,N,O=0;for(;O<M.length;){let Q=M[O];switch(O+=1,Q){case 1:P();break;case 3:P();break;case 4:c.length>1&&!h&&(C=c.shift()+y,h=!0),u+=c.pop(),I(m,u);break;case 5:for(;c.length>0;)m+=c.shift(),u+=c.shift(),l.lineTo(m,u);break;case 6:for(;c.length>0&&(m+=c.shift(),l.lineTo(m,u),c.length!==0);)u+=c.shift(),l.lineTo(m,u);break;case 7:for(;c.length>0&&(u+=c.shift(),l.lineTo(m,u),c.length!==0);)m+=c.shift(),l.lineTo(m,u);break;case 8:for(;c.length>0;)n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r+c.shift(),l.curveTo(n,s,o,r,m,u);break;case 10:D=c.pop()+A,F=g[D],F&&k(F);break;case 11:return;case 12:switch(Q=M[O],O+=1,Q){case 35:n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),U=o+c.shift(),R=r+c.shift(),b=U+c.shift(),v=R+c.shift(),x=b+c.shift(),N=v+c.shift(),m=x+c.shift(),u=N+c.shift(),c.shift(),l.curveTo(n,s,o,r,U,R),l.curveTo(b,v,x,N,m,u);break;case 34:n=m+c.shift(),s=u,o=n+c.shift(),r=s+c.shift(),U=o+c.shift(),R=r,b=U+c.shift(),v=r,x=b+c.shift(),N=u,m=x+c.shift(),l.curveTo(n,s,o,r,U,R),l.curveTo(b,v,x,N,m,u);break;case 36:n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),U=o+c.shift(),R=r,b=U+c.shift(),v=r,x=b+c.shift(),N=v+c.shift(),m=x+c.shift(),l.curveTo(n,s,o,r,U,R),l.curveTo(b,v,x,N,m,u);break;case 37:n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),U=o+c.shift(),R=r+c.shift(),b=U+c.shift(),v=R+c.shift(),x=b+c.shift(),N=v+c.shift(),Math.abs(x-m)>Math.abs(N-u)?m=x+c.shift():u=N+c.shift(),l.curveTo(n,s,o,r,U,R),l.curveTo(b,v,x,N,m,u);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+Q),c.length=0}break;case 14:c.length>0&&!h&&(C=c.shift()+y,h=!0),f&&(l.closePath(),f=!1);break;case 18:P();break;case 19:case 20:P(),O+=d+7>>3;break;case 21:c.length>2&&!h&&(C=c.shift()+y,h=!0),u+=c.pop(),m+=c.pop(),I(m,u);break;case 22:c.length>1&&!h&&(C=c.shift()+y,h=!0),m+=c.pop(),I(m,u);break;case 23:P();break;case 24:for(;c.length>2;)n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r+c.shift(),l.curveTo(n,s,o,r,m,u);m+=c.shift(),u+=c.shift(),l.lineTo(m,u);break;case 25:for(;c.length>6;)m+=c.shift(),u+=c.shift(),l.lineTo(m,u);n=m+c.shift(),s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r+c.shift(),l.curveTo(n,s,o,r,m,u);break;case 26:for(c.length%2&&(m+=c.shift());c.length>0;)n=m,s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o,u=r+c.shift(),l.curveTo(n,s,o,r,m,u);break;case 27:for(c.length%2&&(u+=c.shift());c.length>0;)n=m+c.shift(),s=u,o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r,l.curveTo(n,s,o,r,m,u);break;case 28:B=M[O],_=M[O+1],c.push((B<<24|_<<16)>>16),O+=2;break;case 29:D=c.pop()+i.gsubrsBias,F=i.gsubrs[D],F&&k(F);break;case 30:for(;c.length>0&&(n=m,s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r+(c.length===1?c.shift():0),l.curveTo(n,s,o,r,m,u),c.length!==0);)n=m+c.shift(),s=u,o=n+c.shift(),r=s+c.shift(),u=r+c.shift(),m=o+(c.length===1?c.shift():0),l.curveTo(n,s,o,r,m,u);break;case 31:for(;c.length>0&&(n=m+c.shift(),s=u,o=n+c.shift(),r=s+c.shift(),u=r+c.shift(),m=o+(c.length===1?c.shift():0),l.curveTo(n,s,o,r,m,u),c.length!==0);)n=m,s=u+c.shift(),o=n+c.shift(),r=s+c.shift(),m=o+c.shift(),u=r+(c.length===1?c.shift():0),l.curveTo(n,s,o,r,m,u);break;default:Q<32?console.log("Glyph "+e.index+": unknown operator "+Q):Q<247?c.push(Q-139):Q<251?(B=M[O],O+=1,c.push((Q-247)*256+B+108)):Q<255?(B=M[O],O+=1,c.push(-(Q-251)*256-B-108)):(B=M[O],_=M[O+1],E=M[O+2],w=M[O+3],O+=4,c.push((B<<24|_<<16|E<<8|w)/65536))}}}return k(t),e.advanceWidth=C,l}function iv(i,e,t,n){const s=[];let o;const r=new te.Parser(i,e),l=r.parseCard8();if(l===0)for(let c=0;c<t;c++){if(o=r.parseCard8(),o>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+n+")");s.push(o)}else if(l===3){const c=r.parseCard16();let d=r.parseCard16();if(d!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+d);let h;for(let f=0;f<c;f++){if(o=r.parseCard8(),h=r.parseCard16(),o>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+n+")");if(h>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+h);for(;d<h;d++)s.push(o);d=h}if(h!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+h)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return s}function nv(i,e,t){t.tables.cff={};const n=XC(i,e),s=Vt(i,n.endOffset,te.bytesToString),o=Vt(i,s.endOffset),r=Vt(i,o.endOffset,te.bytesToString),l=Vt(i,r.endOffset);t.gsubrs=l.objects,t.gsubrsBias=oa(t.gsubrs);const c=Gc(i,e,o.objects,r.objects);if(c.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+c.length);const d=c[0];if(t.tables.cff.topDict=d,d._privateDict&&(t.defaultWidthX=d._privateDict.defaultWidthX,t.nominalWidthX=d._privateDict.nominalWidthX),d.ros[0]!==void 0&&d.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){let g=d.fdArray,A=d.fdSelect;if(g===0||A===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");g+=e;const p=Vt(i,g),y=Gc(i,e,p.objects,r.objects);d._fdArray=y,A+=e,d._fdSelect=iv(i,A,t.numGlyphs,y.length)}const h=e+d.private[1],f=Oc(i,h,d.private[0],r.objects);if(t.defaultWidthX=f.defaultWidthX,t.nominalWidthX=f.nominalWidthX,f.subrs!==0){const g=h+f.subrs,A=Vt(i,g);t.subrs=A.objects,t.subrsBias=oa(t.subrs)}else t.subrs=[],t.subrsBias=0;const m=Vt(i,e+d.charStrings);t.nGlyphs=m.objects.length;const u=ZC(i,e+d.charset,t.nGlyphs,r.objects);d.encoding===0?t.cffEncoding=new Is(UC,u):d.encoding===1?t.cffEncoding=new Is(VC,u):t.cffEncoding=ev(i,e+d.encoding,u),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new Di.GlyphSet(t);for(let g=0;g<t.nGlyphs;g+=1){const A=m.objects[g];t.glyphs.push(g,Di.cffGlyphLoader(t,g,tv,A))}}function Uc(i,e){let t,n=ws.indexOf(i);return n>=0&&(t=n),n=e.indexOf(i),n>=0?t=n+ws.length:(t=ws.length+e.length,e.push(i)),t}function sv(){return new ne.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function ov(i){const e=new ne.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(let t=0;t<i.length;t+=1)e.names.push({name:"name_"+t,type:"NAME",value:i[t]});return e}function Vc(i,e,t){const n={};for(let s=0;s<i.length;s+=1){const o=i[s];let r=e[o.name];r!==void 0&&!kc(r,o.value)&&(o.type==="SID"&&(r=Uc(r,t)),n[o.op]={name:o.name,type:o.type,value:r})}return n}function Qc(i,e){const t=new ne.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Vc(Fc,i,e),t}function Hc(i){const e=new ne.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:i}],e}function av(i){const e=new ne.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(let t=0;t<i.length;t+=1)e.strings.push({name:"string_"+t,type:"STRING",value:i[t]});return e}function rv(){return new ne.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function lv(i,e){const t=new ne.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let n=0;n<i.length;n+=1){const s=i[n],o=Uc(s,e);t.fields.push({name:"glyph_"+n,type:"SID",value:o})}return t}function cv(i){const e=[],t=i.path;e.push({name:"width",type:"NUMBER",value:i.advanceWidth});let n=0,s=0;for(let o=0;o<t.commands.length;o+=1){let r,l,c=t.commands[o];if(c.type==="Q"){const d=.3333333333333333,h=2/3;c={type:"C",x:c.x,y:c.y,x1:d*n+h*c.x1,y1:d*s+h*c.y1,x2:d*c.x+h*c.x1,y2:d*c.y+h*c.y1}}if(c.type==="M")r=Math.round(c.x-n),l=Math.round(c.y-s),e.push({name:"dx",type:"NUMBER",value:r}),e.push({name:"dy",type:"NUMBER",value:l}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(c.x),s=Math.round(c.y);else if(c.type==="L")r=Math.round(c.x-n),l=Math.round(c.y-s),e.push({name:"dx",type:"NUMBER",value:r}),e.push({name:"dy",type:"NUMBER",value:l}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(c.x),s=Math.round(c.y);else if(c.type==="C"){const d=Math.round(c.x1-n),h=Math.round(c.y1-s),f=Math.round(c.x2-c.x1),m=Math.round(c.y2-c.y1);r=Math.round(c.x-c.x2),l=Math.round(c.y-c.y2),e.push({name:"dx1",type:"NUMBER",value:d}),e.push({name:"dy1",type:"NUMBER",value:h}),e.push({name:"dx2",type:"NUMBER",value:f}),e.push({name:"dy2",type:"NUMBER",value:m}),e.push({name:"dx",type:"NUMBER",value:r}),e.push({name:"dy",type:"NUMBER",value:l}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(c.x),s=Math.round(c.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function dv(i){const e=new ne.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let t=0;t<i.length;t+=1){const n=i.get(t),s=cv(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:s})}return e}function hv(i,e){const t=new ne.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Vc(Lc,i,e),t}function uv(i,e){const t=new ne.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),n=1/e.unitsPerEm,s={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o={},r=[];let l;for(let f=1;f<i.length;f+=1)l=i.get(f),r.push(l.name);const c=[];t.header=sv(),t.nameIndex=ov([e.postScriptName]);let d=Qc(s,c);t.topDictIndex=Hc(d),t.globalSubrIndex=rv(),t.charsets=lv(r,c),t.charStringsIndex=dv(i),t.privateDict=hv(o,c),t.stringIndex=av(c);const h=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return s.charset=h,s.encoding=0,s.charStrings=s.charset+t.charsets.sizeOf(),s.private[1]=s.charStrings+t.charStringsIndex.sizeOf(),d=Qc(s,c),t.topDictIndex=Hc(d),t}const Yc={parse:nv,make:uv};function fv(i,e){const t={},n=new te.Parser(i,e);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),le.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function mv(i){const e=Math.round(new Date().getTime()/1e3)+2082844800;let t=e;return i.createdTimestamp&&(t=i.createdTimestamp+2082844800),new ne.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:t},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],i)}const zc={parse:fv,make:mv};function gv(i,e){const t={},n=new te.Parser(i,e);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function pv(i){return new ne.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],i)}const jc={parse:gv,make:pv};function Av(i,e,t,n,s){let o,r;const l=new te.Parser(i,e);for(let c=0;c<n;c+=1){c<t&&(o=l.parseUShort(),r=l.parseShort());const d=s.get(c);d.advanceWidth=o,d.leftSideBearing=r}}function yv(i){const e=new ne.Table("hmtx",[]);for(let t=0;t<i.length;t+=1){const n=i.get(t),s=n.advanceWidth||0,o=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:s}),e.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:o})}return e}const Wc={parse:Av,make:yv};function Ev(i){const e=new ne.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:i.length}]);let t="";const n=12+i.length*4;for(let s=0;s<i.length;++s){let o=t.indexOf(i[s]);o<0&&(o=t.length,t+=i[s]),e.fields.push({name:"offset "+s,type:"USHORT",value:n+o}),e.fields.push({name:"length "+s,type:"USHORT",value:i[s].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),e}function Cv(i,e){const t=new te.Parser(i,e),n=t.parseULong();le.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);const s=t.parseULong(),o=[];for(let r=0;r<s;r++){let l="";const c=e+t.parseUShort(),d=t.parseUShort();for(let h=c;h<c+d;++h)l+=String.fromCharCode(i.getInt8(h));o.push(l)}return o}const $c={make:Ev,parse:Cv};function vv(i,e){const t={},n=new te.Parser(i,e);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function bv(i){return new ne.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:i}])}const Kc={parse:vv,make:bv},qc=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Xc={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},wv={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Jc={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"};function Iv(i,e,t){switch(i){case 0:if(e===65535)return"und";if(t)return t[e];break;case 1:return Xc[e];case 3:return Jc[e]}}const aa="utf-16",Sv={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},xv={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"};function Zc(i,e,t){switch(i){case 0:return aa;case 1:return xv[t]||Sv[e];case 3:if(e===1||e===10)return aa;break}}function Mv(i,e,t){const n={},s=new te.Parser(i,e),o=s.parseUShort(),r=s.parseUShort(),l=s.offset+s.parseUShort();for(let c=0;c<r;c++){const d=s.parseUShort(),h=s.parseUShort(),f=s.parseUShort(),m=s.parseUShort(),u=qc[m]||m,g=s.parseUShort(),A=s.parseUShort(),p=Iv(d,f,t),y=Zc(d,h,f);if(y!==void 0&&p!==void 0){let C;if(y===aa?C=_i.UTF16(i,l+A,g):C=_i.MACSTRING(i,l+A,g,y),C){let I=n[u];I===void 0&&(I=n[u]={}),I[p]=C}}}return o===1&&s.parseUShort(),n}function ra(i){const e={};for(let t in i)e[i[t]]=parseInt(t);return e}function ed(i,e,t,n,s,o){return new ne.Record("NameRecord",[{name:"platformID",type:"USHORT",value:i},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:s},{name:"offset",type:"USHORT",value:o}])}function Bv(i,e){const t=i.length,n=e.length-t+1;e:for(let s=0;s<n;s++)for(;s<n;s++){for(let o=0;o<t;o++)if(e[s+o]!==i[o])continue e;return s}return-1}function td(i,e){let t=Bv(i,e);if(t<0){t=e.length;let n=0;const s=i.length;for(;n<s;++n)e.push(i[n])}return t}function Tv(i,e){let t;const n=[],s={},o=ra(qc);for(let f in i){let m=o[f];if(m===void 0&&(m=f),t=parseInt(m),isNaN(t))throw new Error('Name table entry "'+f+'" does not exist, see nameTableNames for complete list.');s[t]=i[f],n.push(t)}const r=ra(Xc),l=ra(Jc),c=[],d=[];for(let f=0;f<n.length;f++){t=n[f];const m=s[t];for(let u in m){const g=m[u];let A=1,p=r[u],y=wv[p];const C=Zc(A,y,p);let I=J.MACSTRING(g,C);I===void 0&&(A=0,p=e.indexOf(u),p<0&&(p=e.length,e.push(u)),y=4,I=J.UTF16(g));const P=td(I,d);c.push(ed(A,y,p,t,I.length,P));const k=l[u];if(k!==void 0){const M=J.UTF16(g),B=td(M,d);c.push(ed(3,1,k,t,M.length,B))}}}c.sort(function(f,m){return f.platformID-m.platformID||f.encodingID-m.encodingID||f.languageID-m.languageID||f.nameID-m.nameID});const h=new ne.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+c.length*12}]);for(let f=0;f<c.length;f++)h.fields.push({name:"record_"+f,type:"RECORD",value:c[f]});return h.fields.push({name:"strings",type:"LITERAL",value:d}),h}const id={parse:Mv,make:Tv},la=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function Pv(i){for(let e=0;e<la.length;e+=1){const t=la[e];if(i>=t.begin&&i<t.end)return e}return-1}function _v(i,e){const t={},n=new te.Parser(i,e);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(let s=0;s<10;s++)t.panose[s]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function Dv(i){return new ne.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],i)}const ca={parse:_v,make:Dv,unicodeRanges:la,getUnicodeRange:Pv};function kv(i,e){const t={},n=new te.Parser(i,e);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=ni.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(let s=0;s<t.numberOfGlyphs;s++)t.glyphNameIndex[s]=n.parseUShort();t.names=[];for(let s=0;s<t.numberOfGlyphs;s++)if(t.glyphNameIndex[s]>=ni.length){const o=n.parseChar();t.names.push(n.parseString(o))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(let s=0;s<t.numberOfGlyphs;s++)t.offset[s]=n.parseChar();break}return t}function Nv(){return new ne.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}const nd={parse:kv,make:Nv},ht=new Array(9);ht[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(H.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(H.coverage),substitute:this.parseOffset16List()};le.assert(!1,"0x"+e.toString(16)+": lookup type 1 format must be 1 or 2.")},ht[2]=function(){const e=this.parseUShort();return le.argument(e===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(H.coverage),sequences:this.parseListOfLists()}},ht[3]=function(){const e=this.parseUShort();return le.argument(e===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(H.coverage),alternateSets:this.parseListOfLists()}},ht[4]=function(){const e=this.parseUShort();return le.argument(e===1,"GSUB ligature table identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(H.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};const ki={sequenceIndex:H.uShort,lookupListIndex:H.uShort};ht[5]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(H.coverage),ruleSets:this.parseListOfLists(function(){const n=this.parseUShort(),s=this.parseUShort();return{input:this.parseUShortList(n-1),lookupRecords:this.parseRecordList(s,ki)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(H.coverage),classDef:this.parsePointer(H.classDef),classSets:this.parseListOfLists(function(){const n=this.parseUShort(),s=this.parseUShort();return{classes:this.parseUShortList(n-1),lookupRecords:this.parseRecordList(s,ki)}})};if(t===3){const n=this.parseUShort(),s=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,H.pointer(H.coverage)),lookupRecords:this.parseRecordList(s,ki)}}le.assert(!1,"0x"+e.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},ht[6]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(H.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ki)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(H.coverage),backtrackClassDef:this.parsePointer(H.classDef),inputClassDef:this.parsePointer(H.classDef),lookaheadClassDef:this.parsePointer(H.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(ki)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(H.pointer(H.coverage)),inputCoverage:this.parseList(H.pointer(H.coverage)),lookaheadCoverage:this.parseList(H.pointer(H.coverage)),lookupRecords:this.parseRecordList(ki)};le.assert(!1,"0x"+e.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},ht[7]=function(){const e=this.parseUShort();le.argument(e===1,"GSUB Extension Substitution subtable identifier-format must be 1");const t=this.parseUShort(),n=new H(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:ht[t].call(n)}},ht[8]=function(){const e=this.parseUShort();return le.argument(e===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:e,coverage:this.parsePointer(H.coverage),backtrackCoverage:this.parseList(H.pointer(H.coverage)),lookaheadCoverage:this.parseList(H.pointer(H.coverage)),substitutes:this.parseUShortList()}};function Rv(i,e){e=e||0;const t=new H(i,e),n=t.parseVersion(1);return le.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ht)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ht),variations:t.parseFeatureVariationsList()}}const xs=new Array(9);xs[1]=function(e){return e.substFormat===1?new ne.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ne.Coverage(e.coverage)},{name:"deltaGlyphID",type:"USHORT",value:e.deltaGlyphId}]):new ne.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new ne.Coverage(e.coverage)}].concat(ne.ushortList("substitute",e.substitute)))},xs[3]=function(e){return le.assert(e.substFormat===1,"Lookup type 3 substFormat must be 1."),new ne.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ne.Coverage(e.coverage)}].concat(ne.tableList("altSet",e.alternateSets,function(t){return new ne.Table("alternateSetTable",ne.ushortList("alternate",t))})))},xs[4]=function(e){return le.assert(e.substFormat===1,"Lookup type 4 substFormat must be 1."),new ne.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new ne.Coverage(e.coverage)}].concat(ne.tableList("ligSet",e.ligatureSets,function(t){return new ne.Table("ligatureSetTable",ne.tableList("ligature",t,function(n){return new ne.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(ne.ushortList("component",n.components,n.components.length+1)))}))})))};function Fv(i){return new ne.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ne.ScriptList(i.scripts)},{name:"features",type:"TABLE",value:new ne.FeatureList(i.features)},{name:"lookups",type:"TABLE",value:new ne.LookupList(i.lookups,xs)}])}const sd={parse:Rv,make:Fv};function Lv(i,e){const t=new te.Parser(i,e),n=t.parseULong();le.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();const s=t.parseULong(),o={};for(let r=0;r<s;r++){const l=t.parseTag(),c=t.parseULong(),d=t.parseULong(),h=_i.UTF8(i,e+c,d);o[l]=h}return o}function Ov(i){const e=Object.keys(i).length;let t="";const n=16+e*12,s=new ne.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(let o in i){const r=t.length;t+=i[o],s.fields.push({name:"tag "+o,type:"TAG",value:o}),s.fields.push({name:"offset "+o,type:"ULONG",value:n+r}),s.fields.push({name:"length "+o,type:"ULONG",value:i[o].length})}return s.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),s}const od={parse:Lv,make:Ov};function ad(i){return Math.log(i)/Math.log(2)|0}function da(i){for(;i.length%4!==0;)i.push(0);let e=0;for(let t=0;t<i.length;t+=4)e+=(i[t]<<24)+(i[t+1]<<16)+(i[t+2]<<8)+i[t+3];return e%=Math.pow(2,32),e}function rd(i,e,t,n){return new ne.Record("Table Record",[{name:"tag",type:"TAG",value:i!==void 0?i:""},{name:"checkSum",type:"ULONG",value:e!==void 0?e:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function ld(i){const e=new ne.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=i,e.numTables=i.length;const t=Math.pow(2,ad(e.numTables));e.searchRange=16*t,e.entrySelector=ad(t),e.rangeShift=e.numTables*16-e.searchRange;const n=[],s=[];let o=e.sizeOf()+rd().sizeOf()*e.numTables;for(;o%4!==0;)o+=1,s.push({name:"padding",type:"BYTE",value:0});for(let r=0;r<i.length;r+=1){const l=i[r];le.argument(l.tableName.length===4,"Table name"+l.tableName+" is invalid.");const c=l.sizeOf(),d=rd(l.tableName,da(l.encode()),o,c);for(n.push({name:d.tag+" Table Record",type:"RECORD",value:d}),s.push({name:l.tableName+" table",type:"RECORD",value:l}),o+=c,le.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!==0;)o+=1,s.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(r,l){return r.value.tag>l.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(s),e}function cd(i,e,t){for(let n=0;n<e.length;n+=1){const s=i.charToGlyphIndex(e[n]);if(s>0)return i.glyphs.get(s).getMetrics()}return t}function Gv(i){let e=0;for(let t=0;t<i.length;t+=1)e+=i[t];return e/i.length}function Uv(i){const e=[],t=[],n=[],s=[],o=[],r=[],l=[];let c,d=0,h=0,f=0,m=0,u=0;for(let T=0;T<i.glyphs.length;T+=1){const S=i.glyphs.get(T),G=S.unicode|0;if(isNaN(S.advanceWidth))throw new Error("Glyph "+S.name+" ("+T+"): advanceWidth is not a number.");(c>G||c===void 0)&&G>0&&(c=G),d<G&&(d=G);const Y=ca.getUnicodeRange(G);if(Y<32)h|=1<<Y;else if(Y<64)f|=1<<Y-32;else if(Y<96)m|=1<<Y-64;else if(Y<123)u|=1<<Y-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(S.name===".notdef")continue;const q=S.getMetrics();e.push(q.xMin),t.push(q.yMin),n.push(q.xMax),s.push(q.yMax),r.push(q.leftSideBearing),l.push(q.rightSideBearing),o.push(S.advanceWidth)}const g={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:Gv(o),minLeftSideBearing:Math.min.apply(null,r),maxLeftSideBearing:Math.max.apply(null,r),minRightSideBearing:Math.min.apply(null,l)};g.ascender=i.ascender,g.descender=i.descender;const A=zc.make({flags:3,unitsPerEm:i.unitsPerEm,xMin:g.xMin,yMin:g.yMin,xMax:g.xMax,yMax:g.yMax,lowestRecPPEM:3,createdTimestamp:i.createdTimestamp}),p=jc.make({ascender:g.ascender,descender:g.descender,advanceWidthMax:g.advanceWidthMax,minLeftSideBearing:g.minLeftSideBearing,minRightSideBearing:g.minRightSideBearing,xMaxExtent:g.maxLeftSideBearing+(g.xMax-g.xMin),numberOfHMetrics:i.glyphs.length}),y=Kc.make(i.glyphs.length),C=ca.make({xAvgCharWidth:Math.round(g.advanceWidthAvg),usWeightClass:i.tables.os2.usWeightClass,usWidthClass:i.tables.os2.usWidthClass,usFirstCharIndex:c,usLastCharIndex:d,ulUnicodeRange1:h,ulUnicodeRange2:f,ulUnicodeRange3:m,ulUnicodeRange4:u,fsSelection:i.tables.os2.fsSelection,sTypoAscender:g.ascender,sTypoDescender:g.descender,sTypoLineGap:0,usWinAscent:g.yMax,usWinDescent:Math.abs(g.yMin),ulCodePageRange1:1,sxHeight:cd(i,"xyvw",{yMax:Math.round(g.ascender/2)}).yMax,sCapHeight:cd(i,"HIKLEFJMNTZBDPRAGOQSUVWXY",g).yMax,usDefaultChar:i.hasChar(" ")?32:0,usBreakChar:i.hasChar(" ")?32:0}),I=Wc.make(i.glyphs),P=Pc.make(i.glyphs),k=i.getEnglishName("fontFamily"),M=i.getEnglishName("fontSubfamily"),B=k+" "+M;let _=i.getEnglishName("postScriptName");_||(_=k.replace(/\s/g,"")+"-"+M);const E={};for(let T in i.names)E[T]=i.names[T];E.uniqueID||(E.uniqueID={en:i.getEnglishName("manufacturer")+":"+B}),E.postScriptName||(E.postScriptName={en:_}),E.preferredFamily||(E.preferredFamily=i.names.fontFamily),E.preferredSubfamily||(E.preferredSubfamily=i.names.fontSubfamily);const w=[],D=id.make(E,w),F=w.length>0?$c.make(w):void 0,U=nd.make(),R=Yc.make(i.glyphs,{version:i.getEnglishName("version"),fullName:B,familyName:k,weightName:M,postScriptName:_,unitsPerEm:i.unitsPerEm,fontBBox:[0,g.yMin,g.ascender,g.advanceWidthMax]}),b=i.metas&&Object.keys(i.metas).length>0?od.make(i.metas):void 0,v=[A,p,y,C,D,P,U,R,I];F&&v.push(F),i.tables.gsub&&v.push(sd.make(i.tables.gsub)),b&&v.push(b);const x=ld(v),N=x.encode(),O=da(N),Q=x.fields;let L=!1;for(let T=0;T<Q.length;T+=1)if(Q[T].name==="head table"){Q[T].value.checkSumAdjustment=2981146554-O,L=!0;break}if(!L)throw new Error("Could not find head table with checkSum to adjust.");return x}const Vv={make:ld,fontToTable:Uv,computeCheckSum:da};function ha(i,e){let t=0,n=i.length-1;for(;t<=n;){const s=t+n>>>1,o=i[s].tag;if(o===e)return s;o<e?t=s+1:n=s-1}return-t-1}function dd(i,e){let t=0,n=i.length-1;for(;t<=n;){const s=t+n>>>1,o=i[s];if(o===e)return s;o<e?t=s+1:n=s-1}return-t-1}function hd(i,e){let t,n=0,s=i.length-1;for(;n<=s;){const o=n+s>>>1;t=i[o];const r=t.start;if(r===e)return t;r<e?n=o+1:s=o-1}if(n>0)return t=i[n-1],e>t.end?0:t}function yn(i,e){this.font=i,this.tableName=e}yn.prototype={searchTag:ha,binSearch:dd,getTable:function(i){let e=this.font.tables[this.tableName];return!e&&i&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){let i=this.getTable();return i?i.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){let i=this.getTable();if(!i)return;let e=!1;for(let t=0;t<i.scripts.length;t++){const n=i.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(e=!0)}if(e)return"latn"},getScriptTable:function(i,e){const t=this.getTable(e);if(t){i=i||"DFLT";const n=t.scripts,s=ha(t.scripts,i);if(s>=0)return n[s].script;if(e){const o={tag:i,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-s,0,o),o.script}}},getLangSysTable:function(i,e,t){const n=this.getScriptTable(i,t);if(n){if(!e||e==="dflt"||e==="DFLT")return n.defaultLangSys;const s=ha(n.langSysRecords,e);if(s>=0)return n.langSysRecords[s].langSys;if(t){const o={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-s,0,o),o.langSys}}},getFeatureTable:function(i,e,t,n){const s=this.getLangSysTable(i,e,n);if(s){let o;const r=s.featureIndexes,l=this.font.tables[this.tableName].features;for(let c=0;c<r.length;c++)if(o=l[r[c]],o.tag===t)return o.feature;if(n){const c=l.length;return le.assert(c===0||t>=l[c-1].tag,"Features must be added in alphabetical order."),o={tag:t,feature:{params:0,lookupListIndexes:[]}},l.push(o),r.push(c),o.feature}}},getLookupTables:function(i,e,t,n,s){const o=this.getFeatureTable(i,e,t,s),r=[];if(o){let l;const c=o.lookupListIndexes,d=this.font.tables[this.tableName].lookups;for(let h=0;h<c.length;h++)l=d[c[h]],l.lookupType===n&&r.push(l);if(r.length===0&&s){l={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};const h=d.length;return d.push(l),c.push(h),[l]}}return r},getGlyphClass:function(i,e){switch(i.format){case 1:return i.startGlyph<=e&&e<i.startGlyph+i.classes.length?i.classes[e-i.startGlyph]:0;case 2:const t=hd(i.ranges,e);return t?t.classId:0}},getCoverageIndex:function(i,e){switch(i.format){case 1:const t=dd(i.glyphs,e);return t>=0?t:-1;case 2:const n=hd(i.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(i){if(i.format===1)return i.glyphs;{const e=[],t=i.ranges;for(let n=0;n<t.length;n++){const s=t[n],o=s.start,r=s.end;for(let l=o;l<=r;l++)e.push(l)}return e}}};function En(i){yn.call(this,i,"gpos")}En.prototype=yn.prototype,En.prototype.init=function(){const i=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(i)},En.prototype.getKerningValue=function(i,e,t){for(let n=0;n<i.length;n++){const s=i[n].subtables;for(let o=0;o<s.length;o++){const r=s[o],l=this.getCoverageIndex(r.coverage,e);if(!(l<0))switch(r.posFormat){case 1:let c=r.pairSets[l];for(let m=0;m<c.length;m++){let u=c[m];if(u.secondGlyph===t)return u.value1&&u.value1.xAdvance||0}break;case 2:const d=this.getGlyphClass(r.classDef1,e),h=this.getGlyphClass(r.classDef2,t),f=r.classRecords[d][h];return f.value1&&f.value1.xAdvance||0}}}return 0},En.prototype.getKerningTables=function(i,e){if(this.font.tables.gpos)return this.getLookupTables(i,e,"kern",2)};function ut(i){yn.call(this,i,"gsub")}function Qv(i,e){const t=i.length;if(t!==e.length)return!1;for(let n=0;n<t;n++)if(i[n]!==e[n])return!1;return!0}function ud(i,e,t){const n=i.subtables;for(let s=0;s<n.length;s++){const o=n[s];if(o.substFormat===e)return o}if(t)return n.push(t),t}ut.prototype=yn.prototype,ut.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},ut.prototype.getSingle=function(i,e,t){const n=[],s=this.getLookupTables(e,t,i,1);for(let o=0;o<s.length;o++){const r=s[o].subtables;for(let l=0;l<r.length;l++){const c=r[l],d=this.expandCoverage(c.coverage);let h;if(c.substFormat===1){const f=c.deltaGlyphId;for(h=0;h<d.length;h++){const m=d[h];n.push({sub:m,by:m+f})}}else{const f=c.substitute;for(h=0;h<d.length;h++)n.push({sub:d[h],by:f[h]})}}}return n},ut.prototype.getAlternates=function(i,e,t){const n=[],s=this.getLookupTables(e,t,i,3);for(let o=0;o<s.length;o++){const r=s[o].subtables;for(let l=0;l<r.length;l++){const c=r[l],d=this.expandCoverage(c.coverage),h=c.alternateSets;for(let f=0;f<d.length;f++)n.push({sub:d[f],by:h[f]})}}return n},ut.prototype.getLigatures=function(i,e,t){const n=[],s=this.getLookupTables(e,t,i,4);for(let o=0;o<s.length;o++){const r=s[o].subtables;for(let l=0;l<r.length;l++){const c=r[l],d=this.expandCoverage(c.coverage),h=c.ligatureSets;for(let f=0;f<d.length;f++){const m=d[f],u=h[f];for(let g=0;g<u.length;g++){const A=u[g];n.push({sub:[m].concat(A.components),by:A.ligGlyph})}}}}return n},ut.prototype.addSingle=function(i,e,t,n){const s=this.getLookupTables(t,n,i,1,!0)[0],o=ud(s,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});le.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);const r=e.sub;let l=this.binSearch(o.coverage.glyphs,r);l<0&&(l=-1-l,o.coverage.glyphs.splice(l,0,r),o.substitute.splice(l,0,0)),o.substitute[l]=e.by},ut.prototype.addAlternate=function(i,e,t,n){const s=this.getLookupTables(t,n,i,3,!0)[0],o=ud(s,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});le.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);const r=e.sub;let l=this.binSearch(o.coverage.glyphs,r);l<0&&(l=-1-l,o.coverage.glyphs.splice(l,0,r),o.alternateSets.splice(l,0,0)),o.alternateSets[l]=e.by},ut.prototype.addLigature=function(i,e,t,n){const s=this.getLookupTables(t,n,i,4,!0)[0];let o=s.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},s.subtables[0]=o),le.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);const r=e.sub[0],l=e.sub.slice(1),c={ligGlyph:e.by,components:l};let d=this.binSearch(o.coverage.glyphs,r);if(d>=0){const h=o.ligatureSets[d];for(let f=0;f<h.length;f++)if(Qv(h[f].components,l))return;h.push(c)}else d=-1-d,o.coverage.glyphs.splice(d,0,r),o.ligatureSets.splice(d,0,[c])},ut.prototype.getFeature=function(i,e,t){if(/ss\d\d/.test(i))return this.getSingle(i,e,t);switch(i){case"aalt":case"salt":return this.getSingle(i,e,t).concat(this.getAlternates(i,e,t));case"dlig":case"liga":case"rlig":return this.getLigatures(i,e,t)}},ut.prototype.add=function(i,e,t,n){if(/ss\d\d/.test(i))return this.addSingle(i,e,t,n);switch(i){case"aalt":case"salt":return typeof e.by=="number"?this.addSingle(i,e,t,n):this.addAlternate(i,e,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(i,e,t,n)}};function Hv(){return typeof window<"u"}function Yv(i){const e=new ArrayBuffer(i.length),t=new Uint8Array(e);for(let n=0;n<i.length;++n)t[n]=i[n];return e}function zv(i){const e=new Buffer(i.byteLength),t=new Uint8Array(i);for(let n=0;n<e.length;++n)e[n]=t[n];return e}function Ni(i,e){if(!i)throw e}function fd(i,e,t,n,s){let o;return(e&n)>0?(o=i.parseByte(),(e&s)===0&&(o=-o),o=t+o):(e&s)>0?o=t:o=t+i.parseShort(),o}function jv(i,e,t){const n=new te.Parser(e,t);i.numberOfContours=n.parseShort(),i._xMin=n.parseShort(),i._yMin=n.parseShort(),i._xMax=n.parseShort(),i._yMax=n.parseShort();let s,o;if(i.numberOfContours>0){const r=i.endPointIndices=[];for(let c=0;c<i.numberOfContours;c+=1)r.push(n.parseUShort());i.instructionLength=n.parseUShort(),i.instructions=[];for(let c=0;c<i.instructionLength;c+=1)i.instructions.push(n.parseByte());const l=r[r.length-1]+1;s=[];for(let c=0;c<l;c+=1)if(o=n.parseByte(),s.push(o),(o&8)>0){const d=n.parseByte();for(let h=0;h<d;h+=1)s.push(o),c+=1}if(le.argument(s.length===l,"Bad flags."),r.length>0){const c=[];let d;if(l>0){for(let m=0;m<l;m+=1)o=s[m],d={},d.onCurve=!!(o&1),d.lastPointOfContour=r.indexOf(m)>=0,c.push(d);let h=0;for(let m=0;m<l;m+=1)o=s[m],d=c[m],d.x=fd(n,o,h,2,16),h=d.x;let f=0;for(let m=0;m<l;m+=1)o=s[m],d=c[m],d.y=fd(n,o,f,4,32),f=d.y}i.points=c}else i.points=[]}else if(i.numberOfContours===0)i.points=[];else{i.isComposite=!0,i.points=[],i.components=[];let r=!0;for(;r;){s=n.parseUShort();const l={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(s&1)>0?(s&2)>0?(l.dx=n.parseShort(),l.dy=n.parseShort()):l.matchedPoints=[n.parseUShort(),n.parseUShort()]:(s&2)>0?(l.dx=n.parseChar(),l.dy=n.parseChar()):l.matchedPoints=[n.parseByte(),n.parseByte()],(s&8)>0?l.xScale=l.yScale=n.parseF2Dot14():(s&64)>0?(l.xScale=n.parseF2Dot14(),l.yScale=n.parseF2Dot14()):(s&128)>0&&(l.xScale=n.parseF2Dot14(),l.scale01=n.parseF2Dot14(),l.scale10=n.parseF2Dot14(),l.yScale=n.parseF2Dot14()),i.components.push(l),r=!!(s&32)}if(s&256){i.instructionLength=n.parseUShort(),i.instructions=[];for(let l=0;l<i.instructionLength;l+=1)i.instructions.push(n.parseByte())}}}function ua(i,e){const t=[];for(let n=0;n<i.length;n+=1){const s=i[n],o={x:e.xScale*s.x+e.scale01*s.y+e.dx,y:e.scale10*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};t.push(o)}return t}function Wv(i){const e=[];let t=[];for(let n=0;n<i.length;n+=1){const s=i[n];t.push(s),s.lastPointOfContour&&(e.push(t),t=[])}return le.argument(t.length===0,"There are still points left in the current contour."),e}function md(i){const e=new Ne;if(!i)return e;const t=Wv(i);for(let n=0;n<t.length;++n){const s=t[n];let o=null,r=s[s.length-1],l=s[0];if(r.onCurve)e.moveTo(r.x,r.y);else if(l.onCurve)e.moveTo(l.x,l.y);else{const c={x:(r.x+l.x)*.5,y:(r.y+l.y)*.5};e.moveTo(c.x,c.y)}for(let c=0;c<s.length;++c)if(o=r,r=l,l=s[(c+1)%s.length],r.onCurve)e.lineTo(r.x,r.y);else{let d=l;o.onCurve||((r.x+o.x)*.5,(r.y+o.y)*.5),l.onCurve||(d={x:(r.x+l.x)*.5,y:(r.y+l.y)*.5}),e.quadraticCurveTo(r.x,r.y,d.x,d.y)}e.closePath()}return e}function $v(i,e){if(e.isComposite)for(let t=0;t<e.components.length;t+=1){const n=e.components[t],s=i.get(n.glyphIndex);if(s.getPath(),s.points){let o;if(n.matchedPoints===void 0)o=ua(s.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>s.points.length-1)throw Error("Matched points out of range in "+e.name);const r=e.points[n.matchedPoints[0]];let l=s.points[n.matchedPoints[1]];const c={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};l=ua([l],c)[0],c.dx=r.x-l.x,c.dy=r.y-l.y,o=ua(s.points,c)}e.points=e.points.concat(o)}}return md(e.points)}function Kv(i,e,t,n){const s=new Di.GlyphSet(n);for(let o=0;o<t.length-1;o+=1){const r=t[o],l=t[o+1];r!==l?s.push(o,Di.ttfGlyphLoader(n,o,jv,i,e+r,$v)):s.push(o,Di.glyphLoader(n,o))}return s}const gd={getPath:md,parse:Kv};let pd,oi,Ad,fa;function yd(i){this.font=i,this.getCommands=function(e){return gd.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function qv(i){return i}function Ed(i){return Math.sign(i)*Math.round(Math.abs(i))}function Xv(i){return Math.sign(i)*Math.round(Math.abs(i*2))/2}function Jv(i){return Math.sign(i)*(Math.round(Math.abs(i)+.5)-.5)}function Zv(i){return Math.sign(i)*Math.ceil(Math.abs(i))}function eb(i){return Math.sign(i)*Math.floor(Math.abs(i))}const Cd=function(i){const e=this.srPeriod;let t=this.srPhase;const n=this.srThreshold;let s=1;return i<0&&(i=-i,s=-1),i+=n-t,i=Math.trunc(i/e)*e,i+=t,i<0?t*s:i*s},bt={x:1,y:0,axis:"x",distance:function(i,e,t,n){return(t?i.xo:i.x)-(n?e.xo:e.x)},interpolate:function(i,e,t,n){let s,o,r,l,c,d,h;if(!n||n===this){if(s=i.xo-e.xo,o=i.xo-t.xo,c=e.x-e.xo,d=t.x-t.xo,r=Math.abs(s),l=Math.abs(o),h=r+l,h===0){i.x=i.xo+(c+d)/2;return}i.x=i.xo+(c*l+d*r)/h;return}if(s=n.distance(i,e,!0,!0),o=n.distance(i,t,!0,!0),c=n.distance(e,e,!1,!0),d=n.distance(t,t,!1,!0),r=Math.abs(s),l=Math.abs(o),h=r+l,h===0){bt.setRelative(i,i,(c+d)/2,n,!0);return}bt.setRelative(i,i,(c*l+d*r)/h,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(i,e,t,n,s){if(!n||n===this){i.x=(s?e.xo:e.x)+t;return}const o=s?e.xo:e.x,r=s?e.yo:e.y,l=o+t*n.x,c=r+t*n.y;i.x=l+(i.y-c)/n.normalSlope},slope:0,touch:function(i){i.xTouched=!0},touched:function(i){return i.xTouched},untouch:function(i){i.xTouched=!1}},Mt={x:0,y:1,axis:"y",distance:function(i,e,t,n){return(t?i.yo:i.y)-(n?e.yo:e.y)},interpolate:function(i,e,t,n){let s,o,r,l,c,d,h;if(!n||n===this){if(s=i.yo-e.yo,o=i.yo-t.yo,c=e.y-e.yo,d=t.y-t.yo,r=Math.abs(s),l=Math.abs(o),h=r+l,h===0){i.y=i.yo+(c+d)/2;return}i.y=i.yo+(c*l+d*r)/h;return}if(s=n.distance(i,e,!0,!0),o=n.distance(i,t,!0,!0),c=n.distance(e,e,!1,!0),d=n.distance(t,t,!1,!0),r=Math.abs(s),l=Math.abs(o),h=r+l,h===0){Mt.setRelative(i,i,(c+d)/2,n,!0);return}Mt.setRelative(i,i,(c*l+d*r)/h,n,!0)},normalSlope:0,setRelative:function(i,e,t,n,s){if(!n||n===this){i.y=(s?e.yo:e.y)+t;return}const o=s?e.xo:e.x,r=s?e.yo:e.y,l=o+t*n.x,c=r+t*n.y;i.y=c+n.normalSlope*(i.x-l)},slope:Number.POSITIVE_INFINITY,touch:function(i){i.yTouched=!0},touched:function(i){return i.yTouched},untouch:function(i){i.yTouched=!1}};Object.freeze(bt),Object.freeze(Mt);function Cn(i,e){this.x=i,this.y=e,this.axis=void 0,this.slope=e/i,this.normalSlope=-i/e,Object.freeze(this)}Cn.prototype.distance=function(i,e,t,n){return this.x*bt.distance(i,e,t,n)+this.y*Mt.distance(i,e,t,n)},Cn.prototype.interpolate=function(i,e,t,n){let s,o,r,l,c,d,h;if(r=n.distance(i,e,!0,!0),l=n.distance(i,t,!0,!0),s=n.distance(e,e,!1,!0),o=n.distance(t,t,!1,!0),c=Math.abs(r),d=Math.abs(l),h=c+d,h===0){this.setRelative(i,i,(s+o)/2,n,!0);return}this.setRelative(i,i,(s*d+o*c)/h,n,!0)},Cn.prototype.setRelative=function(i,e,t,n,s){n=n||this;const o=s?e.xo:e.x,r=s?e.yo:e.y,l=o+t*n.x,c=r+t*n.y,d=n.normalSlope,h=this.slope,f=i.x,m=i.y;i.x=(h*f-d*l+c-m)/(h-d),i.y=h*(i.x-f)+m},Cn.prototype.touch=function(i){i.xTouched=!0,i.yTouched=!0};function vn(i,e){const t=Math.sqrt(i*i+e*e);return i/=t,e/=t,i===1&&e===0?bt:i===0&&e===1?Mt:new Cn(i,e)}function Bt(i,e,t,n){this.x=this.xo=Math.round(i*64)/64,this.y=this.yo=Math.round(e*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Bt.prototype.nextTouched=function(i){let e=this.nextPointOnContour;for(;!i.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},Bt.prototype.prevTouched=function(i){let e=this.prevPointOnContour;for(;!i.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};const bn=Object.freeze(new Bt(0,0)),tb={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Qt(i,e){switch(this.env=i,this.stack=[],this.prog=e,i){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=bt,this.round=Ed}}yd.prototype.exec=function(i,e){if(typeof e!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;const t=this.font;let n=this._prepState;if(!n||n.ppem!==e){let s=this._fpgmState;if(!s){Qt.prototype=tb,s=this._fpgmState=new Qt("fpgm",t.tables.fpgm),s.funcs=[],s.font=t,V.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{oi(s)}catch(r){console.log("Hinting error in FPGM:"+r),this._errorState=3;return}}Qt.prototype=s,n=this._prepState=new Qt("prep",t.tables.prep),n.ppem=e;const o=t.tables.cvt;if(o){const r=n.cvt=new Array(o.length),l=e/t.unitsPerEm;for(let c=0;c<o.length;c++)r[c]=o[c]*l}else n.cvt=[];V.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{oi(n)}catch(r){this._errorState<2&&console.log("Hinting error in PREP:"+r),this._errorState=2}}if(!(this._errorState>1))try{return Ad(i,n)}catch(s){this._errorState<1&&(console.log("Hinting error:"+s),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}},Ad=function(i,e){const t=e.ppem/e.font.unitsPerEm,n=t;let s=i.components,o,r,l;if(Qt.prototype=e,!s)l=new Qt("glyf",i.instructions),V.DEBUG&&(console.log("---EXEC GLYPH---"),l.step=-1),fa(i,l,t,n),r=l.gZone;else{const c=e.font;r=[],o=[];for(let d=0;d<s.length;d++){const h=s[d],f=c.glyphs.get(h.glyphIndex);l=new Qt("glyf",f.instructions),V.DEBUG&&(console.log("---EXEC COMP "+d+"---"),l.step=-1),fa(f,l,t,n);const m=Math.round(h.dx*t),u=Math.round(h.dy*n),g=l.gZone,A=l.contours;for(let y=0;y<g.length;y++){const C=g[y];C.xTouched=C.yTouched=!1,C.xo=C.x=C.x+m,C.yo=C.y=C.y+u}const p=r.length;r.push.apply(r,g);for(let y=0;y<A.length;y++)o.push(A[y]+p)}i.instructions&&!l.inhibitGridFit&&(l=new Qt("glyf",i.instructions),l.gZone=l.z0=l.z1=l.z2=r,l.contours=o,r.push(new Bt(0,0),new Bt(Math.round(i.advanceWidth*t),0)),V.DEBUG&&(console.log("---EXEC COMPOSITE---"),l.step=-1),oi(l),r.length-=2)}return r},fa=function(i,e,t,n){const s=i.points||[],o=s.length,r=e.gZone=e.z0=e.z1=e.z2=[],l=e.contours=[];let c;for(let f=0;f<o;f++)c=s[f],r[f]=new Bt(c.x*t,c.y*n,c.lastPointOfContour,c.onCurve);let d,h;for(let f=0;f<o;f++)c=r[f],d||(d=c,l.push(f)),c.lastPointOfContour?(c.nextPointOnContour=d,d.prevPointOnContour=c,d=void 0):(h=r[f+1],c.nextPointOnContour=h,h.prevPointOnContour=c);if(!e.inhibitGridFit){if(V.DEBUG){console.log("PROCESSING GLYPH",e.stack);for(let f=0;f<o;f++)console.log(f,r[f].x,r[f].y)}if(r.push(new Bt(0,0),new Bt(Math.round(i.advanceWidth*t),0)),oi(e),r.length-=2,V.DEBUG){console.log("FINISHED GLYPH",e.stack);for(let f=0;f<o;f++)console.log(f,r[f].x,r[f].y)}}},oi=function(i){let e=i.prog;if(!e)return;const t=e.length;let n;for(i.ip=0;i.ip<t;i.ip++){if(V.DEBUG&&i.step++,n=pd[e[i.ip]],!n)throw new Error("unknown instruction: 0x"+Number(e[i.ip]).toString(16));n(i)}};function Ms(i){const e=i.tZone=new Array(i.gZone.length);for(let t=0;t<e.length;t++)e[t]=new Bt(0,0)}function vd(i,e){const t=i.prog;let n=i.ip,s=1,o;do if(o=t[++n],o===88)s++;else if(o===89)s--;else if(o===64)n+=t[n+1]+1;else if(o===65)n+=2*t[n+1]+1;else if(o>=176&&o<=183)n+=o-176+1;else if(o>=184&&o<=191)n+=(o-184+1)*2;else if(e&&s===1&&o===27)break;while(s>0);i.ip=n}function bd(i,e){V.DEBUG&&console.log(e.step,"SVTCA["+i.axis+"]"),e.fv=e.pv=e.dpv=i}function wd(i,e){V.DEBUG&&console.log(e.step,"SPVTCA["+i.axis+"]"),e.pv=e.dpv=i}function Id(i,e){V.DEBUG&&console.log(e.step,"SFVTCA["+i.axis+"]"),e.fv=i}function Sd(i,e){const t=e.stack,n=t.pop(),s=t.pop(),o=e.z2[n],r=e.z1[s];V.DEBUG&&console.log("SPVTL["+i+"]",n,s);let l,c;i?(l=o.y-r.y,c=r.x-o.x):(l=r.x-o.x,c=r.y-o.y),e.pv=e.dpv=vn(l,c)}function xd(i,e){const t=e.stack,n=t.pop(),s=t.pop(),o=e.z2[n],r=e.z1[s];V.DEBUG&&console.log("SFVTL["+i+"]",n,s);let l,c;i?(l=o.y-r.y,c=r.x-o.x):(l=r.x-o.x,c=r.y-o.y),e.fv=vn(l,c)}function ib(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"SPVFS[]",t,n),i.pv=i.dpv=vn(n,t)}function nb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"SPVFS[]",t,n),i.fv=vn(n,t)}function sb(i){const e=i.stack,t=i.pv;V.DEBUG&&console.log(i.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function ob(i){const e=i.stack,t=i.fv;V.DEBUG&&console.log(i.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function ab(i){i.fv=i.pv,V.DEBUG&&console.log(i.step,"SFVTPV[]")}function rb(i){const e=i.stack,t=e.pop(),n=e.pop(),s=e.pop(),o=e.pop(),r=e.pop(),l=i.z0,c=i.z1,d=l[t],h=l[n],f=c[s],m=c[o],u=i.z2[r];V.DEBUG&&console.log("ISECT[], ",t,n,s,o,r);const g=d.x,A=d.y,p=h.x,y=h.y,C=f.x,I=f.y,P=m.x,k=m.y,M=(g-p)*(I-k)-(A-y)*(C-P),B=g*y-A*p,_=C*k-I*P;u.x=(B*(C-P)-_*(g-p))/M,u.y=(B*(I-k)-_*(A-y))/M}function lb(i){i.rp0=i.stack.pop(),V.DEBUG&&console.log(i.step,"SRP0[]",i.rp0)}function cb(i){i.rp1=i.stack.pop(),V.DEBUG&&console.log(i.step,"SRP1[]",i.rp1)}function db(i){i.rp2=i.stack.pop(),V.DEBUG&&console.log(i.step,"SRP2[]",i.rp2)}function hb(i){const e=i.stack.pop();switch(V.DEBUG&&console.log(i.step,"SZP0[]",e),i.zp0=e,e){case 0:i.tZone||Ms(i),i.z0=i.tZone;break;case 1:i.z0=i.gZone;break;default:throw new Error("Invalid zone pointer")}}function ub(i){const e=i.stack.pop();switch(V.DEBUG&&console.log(i.step,"SZP1[]",e),i.zp1=e,e){case 0:i.tZone||Ms(i),i.z1=i.tZone;break;case 1:i.z1=i.gZone;break;default:throw new Error("Invalid zone pointer")}}function fb(i){const e=i.stack.pop();switch(V.DEBUG&&console.log(i.step,"SZP2[]",e),i.zp2=e,e){case 0:i.tZone||Ms(i),i.z2=i.tZone;break;case 1:i.z2=i.gZone;break;default:throw new Error("Invalid zone pointer")}}function mb(i){const e=i.stack.pop();switch(V.DEBUG&&console.log(i.step,"SZPS[]",e),i.zp0=i.zp1=i.zp2=e,e){case 0:i.tZone||Ms(i),i.z0=i.z1=i.z2=i.tZone;break;case 1:i.z0=i.z1=i.z2=i.gZone;break;default:throw new Error("Invalid zone pointer")}}function gb(i){i.loop=i.stack.pop(),V.DEBUG&&console.log(i.step,"SLOOP[]",i.loop)}function pb(i){V.DEBUG&&console.log(i.step,"RTG[]"),i.round=Ed}function Ab(i){V.DEBUG&&console.log(i.step,"RTHG[]"),i.round=Jv}function yb(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"SMD[]",e),i.minDis=e/64}function Eb(i){V.DEBUG&&console.log(i.step,"ELSE[]"),vd(i,!1)}function Cb(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"JMPR[]",e),i.ip+=e-1}function vb(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"SCVTCI[]",e),i.cvCutIn=e/64}function bb(i){const e=i.stack;V.DEBUG&&console.log(i.step,"DUP[]"),e.push(e[e.length-1])}function ma(i){V.DEBUG&&console.log(i.step,"POP[]"),i.stack.pop()}function wb(i){V.DEBUG&&console.log(i.step,"CLEAR[]"),i.stack.length=0}function Ib(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"SWAP[]"),e.push(t),e.push(n)}function Sb(i){const e=i.stack;V.DEBUG&&console.log(i.step,"DEPTH[]"),e.push(e.length)}function xb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"LOOPCALL[]",t,n);const s=i.ip,o=i.prog;i.prog=i.funcs[t];for(let r=0;r<n;r++)oi(i),V.DEBUG&&console.log(++i.step,r+1<n?"next loopcall":"done loopcall",r);i.ip=s,i.prog=o}function Mb(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"CALL[]",e);const t=i.ip,n=i.prog;i.prog=i.funcs[e],oi(i),i.ip=t,i.prog=n,V.DEBUG&&console.log(++i.step,"returning from",e)}function Bb(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"CINDEX[]",t),e.push(e[e.length-t])}function Tb(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"MINDEX[]",t),e.push(e.splice(e.length-t,1)[0])}function Pb(i){if(i.env!=="fpgm")throw new Error("FDEF not allowed here");const e=i.stack,t=i.prog;let n=i.ip;const s=e.pop(),o=n;for(V.DEBUG&&console.log(i.step,"FDEF[]",s);t[++n]!==45;);i.ip=n,i.funcs[s]=t.slice(o+1,n)}function Md(i,e){const t=e.stack.pop(),n=e.z0[t],s=e.fv,o=e.pv;V.DEBUG&&console.log(e.step,"MDAP["+i+"]",t);let r=o.distance(n,bn);i&&(r=e.round(r)),s.setRelative(n,bn,r,o),s.touch(n),e.rp0=e.rp1=t}function Bd(i,e){const t=e.z2,n=t.length-2;let s,o,r;V.DEBUG&&console.log(e.step,"IUP["+i.axis+"]");for(let l=0;l<n;l++)s=t[l],!i.touched(s)&&(o=s.prevTouched(i),o!==s&&(r=s.nextTouched(i),o===r&&i.setRelative(s,s,i.distance(o,o,!1,!0),i,!0),i.interpolate(s,o,r,i)))}function Td(i,e){const t=e.stack,n=i?e.rp1:e.rp2,s=(i?e.z0:e.z1)[n],o=e.fv,r=e.pv;let l=e.loop;const c=e.z2;for(;l--;){const d=t.pop(),h=c[d],f=r.distance(s,s,!1,!0);o.setRelative(h,h,f,r),o.touch(h),V.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-l)+": ":"")+"SHP["+(i?"rp1":"rp2")+"]",d)}e.loop=1}function Pd(i,e){const t=e.stack,n=i?e.rp1:e.rp2,s=(i?e.z0:e.z1)[n],o=e.fv,r=e.pv,l=t.pop(),c=e.z2[e.contours[l]];let d=c;V.DEBUG&&console.log(e.step,"SHC["+i+"]",l);const h=r.distance(s,s,!1,!0);do d!==s&&o.setRelative(d,d,h,r),d=d.nextPointOnContour;while(d!==c)}function _d(i,e){const t=e.stack,n=i?e.rp1:e.rp2,s=(i?e.z0:e.z1)[n],o=e.fv,r=e.pv,l=t.pop();V.DEBUG&&console.log(e.step,"SHZ["+i+"]",l);let c;switch(l){case 0:c=e.tZone;break;case 1:c=e.gZone;break;default:throw new Error("Invalid zone")}let d;const h=r.distance(s,s,!1,!0),f=c.length-2;for(let m=0;m<f;m++)d=c[m],o.setRelative(d,d,h,r)}function _b(i){const e=i.stack;let t=i.loop;const n=i.fv,s=e.pop()/64,o=i.z2;for(;t--;){const r=e.pop(),l=o[r];V.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-t)+": ":"")+"SHPIX[]",r,s),n.setRelative(l,l,s),n.touch(l)}i.loop=1}function Db(i){const e=i.stack,t=i.rp1,n=i.rp2;let s=i.loop;const o=i.z0[t],r=i.z1[n],l=i.fv,c=i.dpv,d=i.z2;for(;s--;){const h=e.pop(),f=d[h];V.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-s)+": ":"")+"IP[]",h,t,"<->",n),l.interpolate(f,o,r,c),l.touch(f)}i.loop=1}function Dd(i,e){const t=e.stack,n=t.pop()/64,s=t.pop(),o=e.z1[s],r=e.z0[e.rp0],l=e.fv,c=e.pv;l.setRelative(o,r,n,c),l.touch(o),V.DEBUG&&console.log(e.step,"MSIRP["+i+"]",n,s),e.rp1=e.rp0,e.rp2=s,i&&(e.rp0=s)}function kb(i){const e=i.stack,t=i.rp0,n=i.z0[t];let s=i.loop;const o=i.fv,r=i.pv,l=i.z1;for(;s--;){const c=e.pop(),d=l[c];V.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-s)+": ":"")+"ALIGNRP[]",c),o.setRelative(d,n,0,r),o.touch(d)}i.loop=1}function Nb(i){V.DEBUG&&console.log(i.step,"RTDG[]"),i.round=Xv}function kd(i,e){const t=e.stack,n=t.pop(),s=t.pop(),o=e.z0[s],r=e.fv,l=e.pv;let c=e.cvt[n];V.DEBUG&&console.log(e.step,"MIAP["+i+"]",n,"(",c,")",s);let d=l.distance(o,bn);i&&(Math.abs(d-c)<e.cvCutIn&&(d=c),d=e.round(d)),r.setRelative(o,bn,d,l),e.zp0===0&&(o.xo=o.x,o.yo=o.y),r.touch(o),e.rp0=e.rp1=s}function Rb(i){const e=i.prog;let t=i.ip;const n=i.stack,s=e[++t];V.DEBUG&&console.log(i.step,"NPUSHB[]",s);for(let o=0;o<s;o++)n.push(e[++t]);i.ip=t}function Fb(i){let e=i.ip;const t=i.prog,n=i.stack,s=t[++e];V.DEBUG&&console.log(i.step,"NPUSHW[]",s);for(let o=0;o<s;o++){let r=t[++e]<<8|t[++e];r&32768&&(r=-((r^65535)+1)),n.push(r)}i.ip=e}function Lb(i){const e=i.stack;let t=i.store;t||(t=i.store=[]);const n=e.pop(),s=e.pop();V.DEBUG&&console.log(i.step,"WS",n,s),t[s]=n}function Ob(i){const e=i.stack,t=i.store,n=e.pop();V.DEBUG&&console.log(i.step,"RS",n);const s=t&&t[n]||0;e.push(s)}function Gb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"WCVTP",t,n),i.cvt[n]=t/64}function Ub(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"RCVT",t),e.push(i.cvt[t]*64)}function Nd(i,e){const t=e.stack,n=t.pop(),s=e.z2[n];V.DEBUG&&console.log(e.step,"GC["+i+"]",n),t.push(e.dpv.distance(s,bn,i,!1)*64)}function Rd(i,e){const t=e.stack,n=t.pop(),s=t.pop(),o=e.z1[n],r=e.z0[s],l=e.dpv.distance(r,o,i,i);V.DEBUG&&console.log(e.step,"MD["+i+"]",n,s,"->",l),e.stack.push(Math.round(l*64))}function Vb(i){V.DEBUG&&console.log(i.step,"MPPEM[]"),i.stack.push(i.ppem)}function Qb(i){V.DEBUG&&console.log(i.step,"FLIPON[]"),i.autoFlip=!0}function Hb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"LT[]",t,n),e.push(n<t?1:0)}function Yb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"LTEQ[]",t,n),e.push(n<=t?1:0)}function zb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"GT[]",t,n),e.push(n>t?1:0)}function jb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"GTEQ[]",t,n),e.push(n>=t?1:0)}function Wb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"EQ[]",t,n),e.push(t===n?1:0)}function $b(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"NEQ[]",t,n),e.push(t!==n?1:0)}function Kb(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function qb(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function Xb(i){let e=i.stack.pop();V.DEBUG&&console.log(i.step,"IF[]",e),e||(vd(i,!0),V.DEBUG&&console.log(i.step,"EIF[]"))}function Jb(i){V.DEBUG&&console.log(i.step,"EIF[]")}function Zb(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"AND[]",t,n),e.push(t&&n?1:0)}function ew(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"OR[]",t,n),e.push(t||n?1:0)}function tw(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"NOT[]",t),e.push(t?0:1)}function ga(i,e){const t=e.stack,n=t.pop(),s=e.fv,o=e.pv,r=e.ppem,l=e.deltaBase+(i-1)*16,c=e.deltaShift,d=e.z0;V.DEBUG&&console.log(e.step,"DELTAP["+i+"]",n,t);for(let h=0;h<n;h++){const f=t.pop(),m=t.pop();if(l+((m&240)>>4)!==r)continue;let g=(m&15)-8;g>=0&&g++,V.DEBUG&&console.log(e.step,"DELTAPFIX",f,"by",g*c);const A=d[f];s.setRelative(A,A,g*c,o)}}function iw(i){const t=i.stack.pop();V.DEBUG&&console.log(i.step,"SDB[]",t),i.deltaBase=t}function nw(i){const t=i.stack.pop();V.DEBUG&&console.log(i.step,"SDS[]",t),i.deltaShift=Math.pow(.5,t)}function sw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"ADD[]",t,n),e.push(n+t)}function ow(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"SUB[]",t,n),e.push(n-t)}function aw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"DIV[]",t,n),e.push(n*64/t)}function rw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"MUL[]",t,n),e.push(n*t/64)}function lw(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"ABS[]",t),e.push(Math.abs(t))}function cw(i){const e=i.stack;let t=e.pop();V.DEBUG&&console.log(i.step,"NEG[]",t),e.push(-t)}function dw(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function hw(i){const e=i.stack,t=e.pop();V.DEBUG&&console.log(i.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function Bs(i,e){const t=e.stack,n=t.pop();V.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(n/64)*64)}function uw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"WCVTF[]",t,n),i.cvt[n]=t*i.ppem/i.font.unitsPerEm}function pa(i,e){const t=e.stack,n=t.pop(),s=e.ppem,o=e.deltaBase+(i-1)*16,r=e.deltaShift;V.DEBUG&&console.log(e.step,"DELTAC["+i+"]",n,t);for(let l=0;l<n;l++){const c=t.pop(),d=t.pop();if(o+((d&240)>>4)!==s)continue;let f=(d&15)-8;f>=0&&f++;const m=f*r;V.DEBUG&&console.log(e.step,"DELTACFIX",c,"by",m),e.cvt[c]+=m}}function fw(i){let e=i.stack.pop();V.DEBUG&&console.log(i.step,"SROUND[]",e),i.round=Cd;let t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(i.srPeriod=t,e&48){case 0:i.srPhase=0;break;case 16:i.srPhase=.25*t;break;case 32:i.srPhase=.5*t;break;case 48:i.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?i.srThreshold=0:i.srThreshold=(e/8-.5)*t}function mw(i){let e=i.stack.pop();V.DEBUG&&console.log(i.step,"S45ROUND[]",e),i.round=Cd;let t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(i.srPeriod=t,e&48){case 0:i.srPhase=0;break;case 16:i.srPhase=.25*t;break;case 32:i.srPhase=.5*t;break;case 48:i.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?i.srThreshold=0:i.srThreshold=(e/8-.5)*t}function gw(i){V.DEBUG&&console.log(i.step,"ROFF[]"),i.round=qv}function pw(i){V.DEBUG&&console.log(i.step,"RUTG[]"),i.round=Zv}function Aw(i){V.DEBUG&&console.log(i.step,"RDTG[]"),i.round=eb}function yw(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"SCANCTRL[]",e)}function Fd(i,e){const t=e.stack,n=t.pop(),s=t.pop(),o=e.z2[n],r=e.z1[s];V.DEBUG&&console.log(e.step,"SDPVTL["+i+"]",n,s);let l,c;i?(l=o.y-r.y,c=r.x-o.x):(l=r.x-o.x,c=r.y-o.y),e.dpv=vn(l,c)}function Ew(i){const e=i.stack,t=e.pop();let n=0;V.DEBUG&&console.log(i.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),e.push(n)}function Cw(i){const e=i.stack,t=e.pop(),n=e.pop(),s=e.pop();V.DEBUG&&console.log(i.step,"ROLL[]"),e.push(n),e.push(t),e.push(s)}function vw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"MAX[]",t,n),e.push(Math.max(n,t))}function bw(i){const e=i.stack,t=e.pop(),n=e.pop();V.DEBUG&&console.log(i.step,"MIN[]",t,n),e.push(Math.min(n,t))}function ww(i){const e=i.stack.pop();V.DEBUG&&console.log(i.step,"SCANTYPE[]",e)}function Iw(i){const e=i.stack.pop();let t=i.stack.pop();switch(V.DEBUG&&console.log(i.step,"INSTCTRL[]",e,t),e){case 1:i.inhibitGridFit=!!t;return;case 2:i.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ht(i,e){const t=e.stack,n=e.prog;let s=e.ip;V.DEBUG&&console.log(e.step,"PUSHB["+i+"]");for(let o=0;o<i;o++)t.push(n[++s]);e.ip=s}function Yt(i,e){let t=e.ip;const n=e.prog,s=e.stack;V.DEBUG&&console.log(e.ip,"PUSHW["+i+"]");for(let o=0;o<i;o++){let r=n[++t]<<8|n[++t];r&32768&&(r=-((r^65535)+1)),s.push(r)}e.ip=t}function Z(i,e,t,n,s,o){const r=o.stack,l=i&&r.pop(),c=r.pop(),d=o.rp0,h=o.z0[d],f=o.z1[c],m=o.minDis,u=o.fv,g=o.dpv;let A,p,y,C;p=A=g.distance(f,h,!0,!0),y=p>=0?1:-1,p=Math.abs(p),i&&(C=o.cvt[l],n&&Math.abs(p-C)<o.cvCutIn&&(p=C)),t&&p<m&&(p=m),n&&(p=o.round(p)),u.setRelative(f,h,y*p,g),u.touch(f),V.DEBUG&&console.log(o.step,(i?"MIRP[":"MDRP[")+(e?"M":"m")+(t?">":"_")+(n?"R":"_")+(s===0?"Gr":s===1?"Bl":s===2?"Wh":"")+"]",i?l+"("+o.cvt[l]+","+C+")":"",c,"(d =",A,"->",y*p,")"),o.rp1=o.rp0,o.rp2=c,e&&(o.rp0=c)}pd=[bd.bind(void 0,Mt),bd.bind(void 0,bt),wd.bind(void 0,Mt),wd.bind(void 0,bt),Id.bind(void 0,Mt),Id.bind(void 0,bt),Sd.bind(void 0,0),Sd.bind(void 0,1),xd.bind(void 0,0),xd.bind(void 0,1),ib,nb,sb,ob,ab,rb,lb,cb,db,hb,ub,fb,mb,gb,pb,Ab,yb,Eb,Cb,vb,void 0,void 0,bb,ma,wb,Ib,Sb,Bb,Tb,void 0,void 0,void 0,xb,Mb,Pb,void 0,Md.bind(void 0,0),Md.bind(void 0,1),Bd.bind(void 0,Mt),Bd.bind(void 0,bt),Td.bind(void 0,0),Td.bind(void 0,1),Pd.bind(void 0,0),Pd.bind(void 0,1),_d.bind(void 0,0),_d.bind(void 0,1),_b,Db,Dd.bind(void 0,0),Dd.bind(void 0,1),kb,Nb,kd.bind(void 0,0),kd.bind(void 0,1),Rb,Fb,Lb,Ob,Gb,Ub,Nd.bind(void 0,0),Nd.bind(void 0,1),void 0,Rd.bind(void 0,0),Rd.bind(void 0,1),Vb,void 0,Qb,void 0,void 0,Hb,Yb,zb,jb,Wb,$b,Kb,qb,Xb,Jb,Zb,ew,tw,ga.bind(void 0,1),iw,nw,sw,ow,aw,rw,lw,cw,dw,hw,Bs.bind(void 0,0),Bs.bind(void 0,1),Bs.bind(void 0,2),Bs.bind(void 0,3),void 0,void 0,void 0,void 0,uw,ga.bind(void 0,2),ga.bind(void 0,3),pa.bind(void 0,1),pa.bind(void 0,2),pa.bind(void 0,3),fw,mw,void 0,void 0,gw,void 0,pw,Aw,ma,ma,void 0,void 0,void 0,void 0,void 0,yw,Fd.bind(void 0,0),Fd.bind(void 0,1),Ew,void 0,Cw,vw,bw,ww,Iw,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Ht.bind(void 0,1),Ht.bind(void 0,2),Ht.bind(void 0,3),Ht.bind(void 0,4),Ht.bind(void 0,5),Ht.bind(void 0,6),Ht.bind(void 0,7),Ht.bind(void 0,8),Yt.bind(void 0,1),Yt.bind(void 0,2),Yt.bind(void 0,3),Yt.bind(void 0,4),Yt.bind(void 0,5),Yt.bind(void 0,6),Yt.bind(void 0,7),Yt.bind(void 0,8),Z.bind(void 0,0,0,0,0,0),Z.bind(void 0,0,0,0,0,1),Z.bind(void 0,0,0,0,0,2),Z.bind(void 0,0,0,0,0,3),Z.bind(void 0,0,0,0,1,0),Z.bind(void 0,0,0,0,1,1),Z.bind(void 0,0,0,0,1,2),Z.bind(void 0,0,0,0,1,3),Z.bind(void 0,0,0,1,0,0),Z.bind(void 0,0,0,1,0,1),Z.bind(void 0,0,0,1,0,2),Z.bind(void 0,0,0,1,0,3),Z.bind(void 0,0,0,1,1,0),Z.bind(void 0,0,0,1,1,1),Z.bind(void 0,0,0,1,1,2),Z.bind(void 0,0,0,1,1,3),Z.bind(void 0,0,1,0,0,0),Z.bind(void 0,0,1,0,0,1),Z.bind(void 0,0,1,0,0,2),Z.bind(void 0,0,1,0,0,3),Z.bind(void 0,0,1,0,1,0),Z.bind(void 0,0,1,0,1,1),Z.bind(void 0,0,1,0,1,2),Z.bind(void 0,0,1,0,1,3),Z.bind(void 0,0,1,1,0,0),Z.bind(void 0,0,1,1,0,1),Z.bind(void 0,0,1,1,0,2),Z.bind(void 0,0,1,1,0,3),Z.bind(void 0,0,1,1,1,0),Z.bind(void 0,0,1,1,1,1),Z.bind(void 0,0,1,1,1,2),Z.bind(void 0,0,1,1,1,3),Z.bind(void 0,1,0,0,0,0),Z.bind(void 0,1,0,0,0,1),Z.bind(void 0,1,0,0,0,2),Z.bind(void 0,1,0,0,0,3),Z.bind(void 0,1,0,0,1,0),Z.bind(void 0,1,0,0,1,1),Z.bind(void 0,1,0,0,1,2),Z.bind(void 0,1,0,0,1,3),Z.bind(void 0,1,0,1,0,0),Z.bind(void 0,1,0,1,0,1),Z.bind(void 0,1,0,1,0,2),Z.bind(void 0,1,0,1,0,3),Z.bind(void 0,1,0,1,1,0),Z.bind(void 0,1,0,1,1,1),Z.bind(void 0,1,0,1,1,2),Z.bind(void 0,1,0,1,1,3),Z.bind(void 0,1,1,0,0,0),Z.bind(void 0,1,1,0,0,1),Z.bind(void 0,1,1,0,0,2),Z.bind(void 0,1,1,0,0,3),Z.bind(void 0,1,1,0,1,0),Z.bind(void 0,1,1,0,1,1),Z.bind(void 0,1,1,0,1,2),Z.bind(void 0,1,1,0,1,3),Z.bind(void 0,1,1,1,0,0),Z.bind(void 0,1,1,1,0,1),Z.bind(void 0,1,1,1,0,2),Z.bind(void 0,1,1,1,0,3),Z.bind(void 0,1,1,1,1,0),Z.bind(void 0,1,1,1,1,1),Z.bind(void 0,1,1,1,1,2),Z.bind(void 0,1,1,1,1,3)];const Sw=Array.from||(i=>i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[]);function pe(i){i=i||{},i.empty||(Ni(i.familyName,"When creating a new Font object, familyName is required."),Ni(i.styleName,"When creating a new Font object, styleName is required."),Ni(i.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ni(i.ascender,"When creating a new Font object, ascender is required."),Ni(i.descender,"When creating a new Font object, descender is required."),Ni(i.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:i.familyName||" "},fontSubfamily:{en:i.styleName||" "},fullName:{en:i.fullName||i.familyName+" "+i.styleName},postScriptName:{en:i.postScriptName||(i.familyName+i.styleName).replace(/\s/g,"")},designer:{en:i.designer||" "},designerURL:{en:i.designerURL||" "},manufacturer:{en:i.manufacturer||" "},manufacturerURL:{en:i.manufacturerURL||" "},license:{en:i.license||" "},licenseURL:{en:i.licenseURL||" "},version:{en:i.version||"Version 0.1"},description:{en:i.description||" "},copyright:{en:i.copyright||" "},trademark:{en:i.trademark||" "}},this.unitsPerEm=i.unitsPerEm||1e3,this.ascender=i.ascender,this.descender=i.descender,this.createdTimestamp=i.createdTimestamp,this.tables={os2:{usWeightClass:i.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:i.widthClass||this.usWidthClasses.MEDIUM,fsSelection:i.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Di.GlyphSet(this,i.glyphs||[]),this.encoding=new _c(this),this.position=new En(this),this.substitution=new ut(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new yd(this)}})}pe.prototype.hasChar=function(i){return this.encoding.charToGlyphIndex(i)!==null},pe.prototype.charToGlyphIndex=function(i){return this.encoding.charToGlyphIndex(i)},pe.prototype.charToGlyph=function(i){const e=this.charToGlyphIndex(i);let t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},pe.prototype.stringToGlyphs=function(i,e){e=e||this.defaultRenderOptions;const t=Sw(i),n=[];for(let l=0;l<t.length;l+=1){const c=t[l];n.push(this.charToGlyphIndex(c))}let s=n.length;if(e.features){const l=e.script||this.substitution.getDefaultScriptName();let c=[];e.features.liga&&(c=c.concat(this.substitution.getFeature("liga",l,e.language))),e.features.rlig&&(c=c.concat(this.substitution.getFeature("rlig",l,e.language)));for(let d=0;d<s;d+=1)for(let h=0;h<c.length;h++){const f=c[h],m=f.sub,u=m.length;let g=0;for(;g<u&&m[g]===n[d+g];)g++;g===u&&(n.splice(d,u,f.by),s=s-u+1)}}const o=new Array(s),r=this.glyphs.get(0);for(let l=0;l<s;l+=1)o[l]=this.glyphs.get(n[l])||r;return o},pe.prototype.nameToGlyphIndex=function(i){return this.glyphNames.nameToGlyphIndex(i)},pe.prototype.nameToGlyph=function(i){const e=this.nameToGlyphIndex(i);let t=this.glyphs.get(e);return t||(t=this.glyphs.get(0)),t},pe.prototype.glyphIndexToName=function(i){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(i):""},pe.prototype.getKerningValue=function(i,e){i=i.index||i,e=e.index||e;const t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,i,e):this.kerningPairs[i+","+e]||0},pe.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},pe.prototype.forEachGlyph=function(i,e,t,n,s,o){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,s=s||this.defaultRenderOptions;const r=1/this.unitsPerEm*n,l=this.stringToGlyphs(i,s);let c;if(s.kerning){const d=s.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(d,s.language)}for(let d=0;d<l.length;d+=1){const h=l[d];if(o.call(this,h,e,t,n,s),h.advanceWidth&&(e+=h.advanceWidth*r),s.kerning&&d<l.length-1){const f=c?this.position.getKerningValue(c,h.index,l[d+1].index):this.getKerningValue(h,l[d+1]);e+=f*r}s.letterSpacing?e+=s.letterSpacing*n:s.tracking&&(e+=s.tracking/1e3*n)}return e},pe.prototype.getPath=function(i,e,t,n,s){const o=new Ne;return this.forEachGlyph(i,e,t,n,s,function(r,l,c,d){const h=r.getPath(l,c,d,s,this);o.extend(h)}),o},pe.prototype.getPaths=function(i,e,t,n,s){const o=[];return this.forEachGlyph(i,e,t,n,s,function(r,l,c,d){const h=r.getPath(l,c,d,s,this);o.push(h)}),o},pe.prototype.getAdvanceWidth=function(i,e,t){return this.forEachGlyph(i,0,0,e,t,function(){})},pe.prototype.draw=function(i,e,t,n,s,o){this.getPath(e,t,n,s,o).draw(i)},pe.prototype.drawPoints=function(i,e,t,n,s,o){this.forEachGlyph(e,t,n,s,o,function(r,l,c,d){r.drawPoints(i,l,c,d)})},pe.prototype.drawMetrics=function(i,e,t,n,s,o){this.forEachGlyph(e,t,n,s,o,function(r,l,c,d){r.drawMetrics(i,l,c,d)})},pe.prototype.getEnglishName=function(i){const e=this.names[i];if(e)return e.en},pe.prototype.validate=function(){const i=this;function e(n,s){}function t(n){const s=i.getEnglishName(n);s&&s.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0},pe.prototype.toTables=function(){return Vv.fontToTable(this)},pe.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},pe.prototype.toArrayBuffer=function(){const e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let s=0;s<e.length;s++)n[s]=e[s];return t},pe.prototype.download=function(i){const e=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");i=i||e.replace(/\s/g,"")+"-"+t+".otf";const n=this.toArrayBuffer();if(Hv())if(window.URL=window.URL||window.webkitURL,window.URL){const s=new DataView(n),o=new Blob([s],{type:"font/opentype"});let r=document.createElement("a");r.href=window.URL.createObjectURL(o),r.download=i;let l=document.createEvent("MouseEvents");l.initEvent("click",!0,!1),r.dispatchEvent(l)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{const s=require("fs"),o=zv(n);s.writeFileSync(i,o)}},pe.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},pe.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},pe.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function Ld(i,e){const t=JSON.stringify(i);let n=256;for(let s in e){let o=parseInt(s);if(!(!o||o<256)){if(JSON.stringify(e[s])===t)return o;n<=o&&(n=o+1)}}return e[n]=i,n}function xw(i,e,t){const n=Ld(e.name,t);return[{name:"tag_"+i,type:"TAG",value:e.tag},{name:"minValue_"+i,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+i,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+i,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+i,type:"USHORT",value:0},{name:"nameID_"+i,type:"USHORT",value:n}]}function Mw(i,e,t){const n={},s=new te.Parser(i,e);return n.tag=s.parseTag(),n.minValue=s.parseFixed(),n.defaultValue=s.parseFixed(),n.maxValue=s.parseFixed(),s.skip("uShort",1),n.name=t[s.parseUShort()]||{},n}function Bw(i,e,t,n){const s=Ld(e.name,n),o=[{name:"nameID_"+i,type:"USHORT",value:s},{name:"flags_"+i,type:"USHORT",value:0}];for(let r=0;r<t.length;++r){const l=t[r].tag;o.push({name:"axis_"+i+" "+l,type:"FIXED",value:e.coordinates[l]<<16})}return o}function Tw(i,e,t,n){const s={},o=new te.Parser(i,e);s.name=n[o.parseUShort()]||{},o.skip("uShort",1),s.coordinates={};for(let r=0;r<t.length;++r)s.coordinates[t[r].tag]=o.parseFixed();return s}function Pw(i,e){const t=new ne.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:i.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:i.instances.length},{name:"instanceSize",type:"USHORT",value:4+i.axes.length*4}]);t.offsetToData=t.sizeOf();for(let n=0;n<i.axes.length;n++)t.fields=t.fields.concat(xw(n,i.axes[n],e));for(let n=0;n<i.instances.length;n++)t.fields=t.fields.concat(Bw(n,i.instances[n],i.axes,e));return t}function _w(i,e,t){const n=new te.Parser(i,e),s=n.parseULong();le.argument(s===65536,"Unsupported fvar table version.");const o=n.parseOffset16();n.skip("uShort",1);const r=n.parseUShort(),l=n.parseUShort(),c=n.parseUShort(),d=n.parseUShort(),h=[];for(let u=0;u<r;u++)h.push(Mw(i,e+o+u*l,t));const f=[],m=e+o+r*l;for(let u=0;u<c;u++)f.push(Tw(i,m+u*d,h,t));return{axes:h,instances:f}}const Dw={make:Pw,parse:_w},ft=new Array(10);ft[1]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(H.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(H.coverage),values:this.parseValueRecordList()};le.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},ft[2]=function(){const e=this.offset+this.relativeOffset,t=this.parseUShort();le.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");const n=this.parsePointer(H.coverage),s=this.parseUShort(),o=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:o,pairSets:this.parseList(H.pointer(H.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(s),value2:this.parseValueRecord(o)}})))};if(t===2){const r=this.parsePointer(H.classDef),l=this.parsePointer(H.classDef),c=this.parseUShort(),d=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:s,valueFormat2:o,classDef1:r,classDef2:l,class1Count:c,class2Count:d,classRecords:this.parseList(c,H.list(d,function(){return{value1:this.parseValueRecord(s),value2:this.parseValueRecord(o)}}))}}},ft[3]=function(){return{error:"GPOS Lookup 3 not supported"}},ft[4]=function(){return{error:"GPOS Lookup 4 not supported"}},ft[5]=function(){return{error:"GPOS Lookup 5 not supported"}},ft[6]=function(){return{error:"GPOS Lookup 6 not supported"}},ft[7]=function(){return{error:"GPOS Lookup 7 not supported"}},ft[8]=function(){return{error:"GPOS Lookup 8 not supported"}},ft[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function kw(i,e){e=e||0;const t=new H(i,e),n=t.parseVersion(1);return le.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ft)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ft),variations:t.parseFeatureVariationsList()}}const Nw=new Array(10);function Rw(i){return new ne.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new ne.ScriptList(i.scripts)},{name:"features",type:"TABLE",value:new ne.FeatureList(i.features)},{name:"lookups",type:"TABLE",value:new ne.LookupList(i.lookups,Nw)}])}const Fw={parse:kw,make:Rw};function Lw(i){const e={};i.skip("uShort");const t=i.parseUShort();le.argument(t===0,"Unsupported kern sub-table version."),i.skip("uShort",2);const n=i.parseUShort();i.skip("uShort",3);for(let s=0;s<n;s+=1){const o=i.parseUShort(),r=i.parseUShort(),l=i.parseShort();e[o+","+r]=l}return e}function Ow(i){const e={};i.skip("uShort"),i.parseULong()>1&&console.warn("Only the first kern subtable is supported."),i.skip("uLong");const s=i.parseUShort()&255;if(i.skip("uShort"),s===0){const o=i.parseUShort();i.skip("uShort",3);for(let r=0;r<o;r+=1){const l=i.parseUShort(),c=i.parseUShort(),d=i.parseShort();e[l+","+c]=d}}return e}function Gw(i,e){const t=new te.Parser(i,e),n=t.parseUShort();if(n===0)return Lw(t);if(n===1)return Ow(t);throw new Error("Unsupported kern table version ("+n+").")}const Uw={parse:Gw};function Vw(i,e,t,n){const s=new te.Parser(i,e),o=n?s.parseUShort:s.parseULong,r=[];for(let l=0;l<t+1;l+=1){let c=o.call(s);n&&(c*=2),r.push(c)}return r}const Qw={parse:Vw};function Hw(i,e){require("fs").readFile(i,function(n,s){if(n)return e(n.message);e(null,Yv(s))})}function Yw(i,e){const t=new XMLHttpRequest;t.open("get",i,!0),t.responseType="arraybuffer",t.onload=function(){return t.response?e(null,t.response):e("Font could not be loaded: "+t.statusText)},t.onerror=function(){e("Font could not be loaded")},t.send()}function Od(i,e){const t=[];let n=12;for(let s=0;s<e;s+=1){const o=te.getTag(i,n),r=te.getULong(i,n+4),l=te.getULong(i,n+8),c=te.getULong(i,n+12);t.push({tag:o,checksum:r,offset:l,length:c,compression:!1}),n+=16}return t}function zw(i,e){const t=[];let n=44;for(let s=0;s<e;s+=1){const o=te.getTag(i,n),r=te.getULong(i,n+4),l=te.getULong(i,n+8),c=te.getULong(i,n+12);let d;l<c?d="WOFF":d=!1,t.push({tag:o,offset:r,compression:d,compressedLength:l,length:c}),n+=20}return t}function Pe(i,e){if(e.compression==="WOFF"){const t=new Uint8Array(i.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(wC(t,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}else return{data:i,offset:e.offset}}function jw(i){let e,t;const n=new pe({empty:!0}),s=new DataView(i,0);let o,r=[];const l=te.getTag(s,0);if(l==="\0\0\0"||l==="true"||l==="typ1")n.outlinesFormat="truetype",o=te.getUShort(s,4),r=Od(s,o);else if(l==="OTTO")n.outlinesFormat="cff",o=te.getUShort(s,4),r=Od(s,o);else if(l==="wOFF"){const k=te.getTag(s,4);if(k==="\0\0\0")n.outlinesFormat="truetype";else if(k==="OTTO")n.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);o=te.getUShort(s,12),r=zw(s,o)}else throw new Error("Unsupported OpenType signature "+l);let c,d,h,f,m,u,g,A,p,y,C;for(let k=0;k<o;k+=1){const M=r[k];let B;switch(M.tag){case"cmap":B=Pe(s,M),n.tables.cmap=Pc.parse(B.data,B.offset),n.encoding=new Dc(n.tables.cmap);break;case"cvt ":B=Pe(s,M),C=new te.Parser(B.data,B.offset),n.tables.cvt=C.parseShortList(M.length/2);break;case"fvar":d=M;break;case"fpgm":B=Pe(s,M),C=new te.Parser(B.data,B.offset),n.tables.fpgm=C.parseByteList(M.length);break;case"head":B=Pe(s,M),n.tables.head=zc.parse(B.data,B.offset),n.unitsPerEm=n.tables.head.unitsPerEm,e=n.tables.head.indexToLocFormat;break;case"hhea":B=Pe(s,M),n.tables.hhea=jc.parse(B.data,B.offset),n.ascender=n.tables.hhea.ascender,n.descender=n.tables.hhea.descender,n.numberOfHMetrics=n.tables.hhea.numberOfHMetrics;break;case"hmtx":u=M;break;case"ltag":B=Pe(s,M),t=$c.parse(B.data,B.offset);break;case"maxp":B=Pe(s,M),n.tables.maxp=Kc.parse(B.data,B.offset),n.numGlyphs=n.tables.maxp.numGlyphs;break;case"name":p=M;break;case"OS/2":B=Pe(s,M),n.tables.os2=ca.parse(B.data,B.offset);break;case"post":B=Pe(s,M),n.tables.post=nd.parse(B.data,B.offset),n.glyphNames=new na(n.tables.post);break;case"prep":B=Pe(s,M),C=new te.Parser(B.data,B.offset),n.tables.prep=C.parseByteList(M.length);break;case"glyf":h=M;break;case"loca":A=M;break;case"CFF ":c=M;break;case"kern":g=M;break;case"GPOS":f=M;break;case"GSUB":m=M;break;case"meta":y=M;break}}const I=Pe(s,p);if(n.tables.name=id.parse(I.data,I.offset,t),n.names=n.tables.name,h&&A){const k=e===0,M=Pe(s,A),B=Qw.parse(M.data,M.offset,n.numGlyphs,k),_=Pe(s,h);n.glyphs=gd.parse(_.data,_.offset,B,n)}else if(c){const k=Pe(s,c);Yc.parse(k.data,k.offset,n)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");const P=Pe(s,u);if(Wc.parse(P.data,P.offset,n.numberOfHMetrics,n.numGlyphs,n.glyphs),QC(n),g){const k=Pe(s,g);n.kerningPairs=Uw.parse(k.data,k.offset)}else n.kerningPairs={};if(f){const k=Pe(s,f);n.tables.gpos=Fw.parse(k.data,k.offset),n.position.init()}if(m){const k=Pe(s,m);n.tables.gsub=sd.parse(k.data,k.offset)}if(d){const k=Pe(s,d);n.tables.fvar=Dw.parse(k.data,k.offset,n.names)}if(y){const k=Pe(s,y);n.tables.meta=od.parse(k.data,k.offset),n.metas=n.tables.meta}return n}function Ww(i,e){(typeof window>"u"?Hw:Yw)(i,function(s,o){if(s)return e(s);let r;try{r=jw(o)}catch(l){return e(l,null)}return e(null,r)})}const Aa=1e-12;function wn(i){if(!Array.isArray(i)||i.length===0)return i||[];const e=i[0],t=i[i.length-1];if(!e||!t||e.length<2||t.length<2)return i;const n=e[0]??0,s=e[1]??0,o=t[0]??0,r=t[1]??0;return(Math.abs(n-o)>Aa||Math.abs(s-r)>Aa)&&i.push([n,s]),i}function ai(i){let e=0;if(!i)return 0;for(let t=0;t<i.length-1;t++){const n=i[t],s=i[t+1];if(!n||!s)continue;const o=n[0]??0,r=n[1]??0,l=s[0]??0,c=s[1]??0;e+=o*c-l*r}return e/2}function Ts(i,e=Aa){const t=[];if(!i)return t;for(const n of i){if(!n||n.length<2)continue;const s=t[t.length-1],o=n[0]??0,r=n[1]??0;if(!s){t.push([o,r]);continue}const l=s[0]??0,c=s[1]??0;(Math.abs(o-l)>e||Math.abs(r-c)>e)&&t.push([o,r])}return t}function $w(i,e,t,n,s=16){const o=[],r=i?.[0]??0,l=i?.[1]??0,c=t?.[0]??0,d=t?.[1]??0,h=n?.[0]??0,f=n?.[1]??0,m=e?.[0]??0,u=e?.[1]??0;for(let g=0;g<=s;g++){const A=g/s,p=1-A,y=p*p*p*r+3*p*p*A*c+3*p*A*A*h+A*A*A*m,C=p*p*p*l+3*p*p*A*d+3*p*A*A*f+A*A*A*u;o.push([y,C])}return o}function Gd(i,e){if(!i||!e)return!1;const t=i[0]??0,n=i[1]??0;let s=!1;for(let o=0,r=e.length-1;o<e.length;r=o++){const l=e[o],c=e[r];if(!l||!c)continue;const d=l[0]??0,h=l[1]??0,f=c[0]??0,m=c[1]??0;h>n!=m>n&&t<(f-d)*(n-h)/(m-h+0)+d&&(s=!s)}return s}function ya(i){return i?(ai(i)<0&&i.reverse(),wn(i),i):[]}function Kw(i){return i?(ai(i)>0&&i.reverse(),wn(i),i):[]}function Ud(i,e=16){if(!i||!Array.isArray(i.commands))return[];const t=[];let n=[];for(const s of i.commands){let o=function(l){const c=l.x!==void 0?l.x:0,d=l.y!==void 0?-l.y:0;return[c,d]};const r=s.type;if(r==="M")n.length&&t.push(Ts(n)),n=[o(s)];else if(r==="L")n.push(o(s));else if(r==="Q"){const c=n[n.length-1]||o(s),d=[],h=s.x??0,f=s.y??0,m=s.x1??0,u=s.y1??0,g=c[0]??0,A=c[1]??0;for(let p=1;p<=e;p++){const y=p/e,C=1-y,I=C*C*g+2*C*y*m+y*y*h,P=C*C*A+2*C*y*u+y*y*-f;d.push([I,P])}d.length?n.push(...d):n.push(o(s))}else if(r==="C"){const c=n[n.length-1]||o(s),d=[s.x1||0,-(s.y1||0)],h=[s.x2||0,-(s.y2||0)],f=[s.x||0,-(s.y||0)],m=$w(c,f,d,h,e);m.length>1?n.push(...m.slice(1)):n.push(f)}else r==="Z"||r==="z"?(n.length&&t.push(Ts(n)),n=[]):s.x!==void 0&&s.y!==void 0&&n.push(o(s))}return n.length&&t.push(Ts(n)),t.map(s=>wn(s)).filter(s=>s&&s.length>=4)}function Ea(i,e){if(!i)return null;const t=i.map(n=>wn(n.slice()));return{type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:{...e.properties||{},rings:t.length,polygons:1}}}function qw(i,e,t={}){t=Object.assign({sampleSegments:16,simplifyTolerance:0,epsArea:1e-24,debug:!1,scale:1,widthScale:.6,fillWinding:"auto"},t||{scale:1});const n=!!t.debug;if(!i||!i.geometry||!Array.isArray(i.geometry.coordinates))return{type:"FeatureCollection",features:[]};const s=i.geometry.coordinates,o=i.properties||{},r=o.text||o.label||"",l=o.rotation??0,c=t.sampleSegments||16,d=t.epsArea||1e-24,f=o.height/.9||1,m=(t.scale||1)*f,u=-l*Math.PI/180,g=Math.cos(u),A=Math.sin(u),p=o.attachmentPoint||"bottom-left",y=[];if(!e||typeof e.getPaths!="function")return{type:"FeatureCollection",features:y};const C=e.getPaths(r,0,0,t.fontSize||1)||[];let I=[];for(const F of C){const U=Ud(F,c);for(const R of U)if(R)for(const b of R)b&&I.push(b)}let P=1/0,k=1/0,M=-1/0,B=-1/0;for(const F of I){if(!F)continue;const U=F[0]??0,R=F[1]??0;P=Math.min(P,U),k=Math.min(k,R),M=Math.max(M,U),B=Math.max(B,R)}const _=M-P,E=B-k;let w=0,D=0;switch(p){case"top-left":w=0,D=-E;break;case"top-center":w=-_/2,D=E;break;case"top-right":w=-_,D=E;break;case"center-left":w=0,D=E/2;break;case"center":w=-_/2,D=E/2;break;case"center-right":w=-_,D=E/2;break;case"bottom-left":w=0,D=0;break;case"bottom-center":w=-_/2,D=0;break;case"bottom-right":w=-_,D=0;break;default:w=0,D=0}for(const F of C){const U=Ud(F,c);if(!U||U.length===0)continue;const R=U.map(O=>{if(!O)return[];const Q=O.map(L=>{if(!L)return[0,0];let T=(L[0]??0)+w,S=(L[1]??0)+D;T=T*(t.widthScale||.6);const G=T*g-S*A,Y=T*A+S*g;return[s[0]+G*m,s[1]+Y*m]});return wn(Ts(Q))}).filter(O=>O&&O.length>=4&&Math.abs(ai(O))>d);if(R.length===0)continue;let b=1;if(t.fillWinding==="positive")b=1;else if(t.fillWinding==="negative")b=-1;else{let O=0,Q=-1;for(let S=0;S<R.length;S++){const G=R[S];if(!G)continue;const Y=ai(G);Math.abs(Y)>Q&&(Q=Math.abs(Y),O=S)}const L=R[O],T=L?ai(L):0;b=T>=0?1:-1,n&&console.log("[simple] auto fillSign=",b,"largest signed area=",T)}const v=R.map((O,Q)=>({idx:Q,ring:O,signedArea:ai(O),absArea:Math.abs(ai(O))}));for(const O of v)O.isFilled=O.signedArea*b>0,n&&console.log("[simple] ring",O.idx,"signedArea=",O.signedArea.toExponential(),"isFilled=",O.isFilled);const x=v.filter(O=>O.isFilled).sort((O,Q)=>O.absArea-Q.absArea),N=v.filter(O=>!O.isFilled).sort((O,Q)=>Q.absArea-O.absArea);for(const O of x)O.holes=[];for(const O of N){const Q=(function(T){let S=0,G=0;if(!T||T.length===0)return[0,0];for(const Y of T)Y&&(S+=Y[0]??0,G+=Y[1]??0);return[S/T.length,G/T.length]})(O.ring);let L=null;for(const T of x)Gd(Q,T.ring)&&(L===null||T.absArea<L.absArea&&T.idx<O.idx||T.absArea>L.absArea&&T.idx<O.idx&&N.length==1)&&(L=T);if(L){if(L.absArea<O.absArea&&N.length>1)for(const T of x)Gd(Q,T.ring)&&T.absArea>O.absArea&&T.holes.push(O.ring);else L.holes.push(O.ring);O.assigned=!0}else O.assigned=!1,n&&console.log("[simple] hole not assigned idx=",O.idx)}for(const O of x){const Q=ya(O.ring.slice()),L=(O.holes||[]).map(T=>Kw(T.slice()));y.push(Ea([Q,...L],i))}for(const O of N)O.assigned||y.push(Ea([ya(O.ring.slice())],i));if(x.length===0)for(const O of v)y.push(Ea([ya(O.ring.slice())],i))}return{type:"FeatureCollection",features:y}}class Xw extends vt{constructor(e,t){super(e,t),this.type="label",this._centerCoord=null,this._plotInstance=this,this.fontUrl="https://leiting.chenxisoft.com/resource/font/HanaMinA.ttf",this.labelText="点击编辑文本",this.fontSize=10,this.color="#ff0000",this.polygonEntities=[],t&&(this.fontSize=t.fontSize||this.fontSize,this.color=t.color||this.color,this.labelText=t.text||this.labelText)}start(e){this.startCreate(e)}startCreate(e){try{this.state="creating",this.forbidDrawWorld(!0);const t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium,n=this;if(!t){console.error("无法获取Cesium对象");return}this.handler&&this.handler.destroy(),this.handler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(s){if(!s||!s.position)return;let o=n.getCatesian3FromPX(s.position);o&&(n.positions=[o],n._centerCoord=o,n.createLabel(o,function(){n.endCreate(e)}))},t.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(s){if(!s||!s.position)return;n.getCatesian3FromPX(s.position)&&n.state},t.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(s){!s||!s.position||n.endCreate()},t.ScreenSpaceEventType.RIGHT_CLICK)}catch(t){console.error("启动创建标签功能时出错:",t),e&&e(null)}}createLabel(e,t){const n=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium,s=this;if(!e){console.error("创建标签时位置参数无效"),t&&t();return}if(!n){console.error("创建标签时无法获取Cesium对象"),t&&t();return}this.clearPolygonEntities(),Ww(this.fontUrl,(o,r)=>{try{if(o){console.error("加载字体失败:",o),t&&t();return}const l=n.Cartographic.fromCartesian(e),c=n.Math.toDegrees(l.longitude),d=n.Math.toDegrees(l.latitude),h={type:"Feature",geometry:{type:"Point",coordinates:[c,d]},properties:{text:s.labelText||"",rotation:0}},f={sampleSegments:16,fontSize:s.fontSize,scale:10},m=qw(h,r,f);if(!m||!m.features||!Array.isArray(m.features)){console.error("文本转换为多边形失败"),t&&t();return}s.drawGeoJsonLocal(m,[c,d],1,r),s.entity={_centerCoord:s._centerCoord,_plotInstance:s._plotInstance,position:e,label:{text:s.labelText},updatePosition:function(u){s.updatePositions([u])},getPosition:function(){return s._centerCoord},type:s.type,objId:s.objId,isDraggable:!0,setPosition:function(u){s._centerCoord=u,s.positions[0]=u,s.createLabel(u)}},s.addClickEditHandler(),t&&t()}catch(l){console.error("创建文本标签时发生错误:",l);try{s.clearPolygonEntities()}catch(c){console.error("清理标签多边形实体时出错:",c)}t&&t()}})}drawGeoJsonLocal(e,t,n=1,s){try{const o=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!e||!t||!Array.isArray(t)||t.length!==2){console.error("drawGeoJsonLocal: 参数无效");return}const r=t[0],l=t[1],c=o.Cartesian3.fromDegrees(r,l,0),d=o.Transforms.eastNorthUpToFixedFrame(c),h=n*1;this.clearPolygonEntities();let f=[];for(const I of e.features||[]){if(!I||!I.geometry||I.geometry.type!=="Polygon")continue;const P=I.geometry.coordinates||[];for(const k of P)k&&Array.isArray(k)&&(f=f.concat(k))}let m=1/0,u=1/0,g=-1/0,A=-1/0;for(const I of f)Array.isArray(I)&&I.length>=2&&(m=Math.min(m,I[0]),u=Math.min(u,I[1]),g=Math.max(g,I[0]),A=Math.max(A,I[1]));const p=(m+g)/2,y=(u+A)/2,C=I=>{const P=(I[0]-p)*h,k=(I[1]-y)*h,M=new o.Cartesian3(P,k,0);return o.Matrix4.multiplyByPoint(d,M,new o.Cartesian3)};for(const I of e.features||[]){if(!I||!I.geometry||I.geometry.type!=="Polygon")continue;const P=I.geometry.coordinates||[];if(P.length>0)try{const k=P[0]||[];if(k.length===0)continue;const M=k.map(C);let B;if(P.length>1){const E=P.slice(1).map(w=>!w||!Array.isArray(w)||w.length===0?null:new o.PolygonHierarchy(w.map(C))).filter(Boolean);B=new o.PolygonHierarchy(M,E)}else B=new o.PolygonHierarchy(M);const _=this.viewer.entities.add({polygon:{hierarchy:B,material:o.Color.fromCssColorString(this.color||"#000000"),outline:!1},_labelOwner:this.objId});this.polygonEntities.push(_)}catch(k){console.warn("创建多边形实体时出错:",k);continue}}}catch(o){console.error("drawGeoJsonLocal: 发生错误:",o)}}clearPolygonEntities(){for(let e of this.polygonEntities)this.viewer.entities.remove(e);this.polygonEntities=[]}addClickEditHandler(){const e=this,t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!t){console.error("添加点击编辑事件时无法获取Cesium对象");return}this.editHandler&&(this.editHandler.destroy(),this.editHandler=null),this.editHandler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.editHandler.setInputAction(function(n){if(!n||!n.position)return;const s=e.viewer.scene.pick(n.position);t.defined(s)&&s.id&&s.id._labelOwner===e.objId&&(n.preventDefault(),e.editText())},t.ScreenSpaceEventType.LEFT_CLICK),this.editHandler.setInputAction(function(n){if(!n||!n.position)return;const s=e.viewer.scene.pick(n.position);t.defined(s)&&s.id&&s.id._labelOwner===e.objId&&(n.preventDefault(),e.openStyleEditor())},t.ScreenSpaceEventType.RIGHT_CLICK)}editText(){const e=this;(function(n,s){const o=document.createElement("div");o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.backgroundColor="rgba(0, 0, 0, 0.5)",o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.zIndex="10000";const r=document.createElement("div");r.style.backgroundColor="white",r.style.padding="20px",r.style.borderRadius="5px",r.style.width="500px",r.style.maxWidth="90vw",r.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.2)";const l=document.createElement("h3");l.textContent="编辑文本",l.style.marginTop="0";const c=document.createElement("textarea");c.value=n,c.style.width="100%",c.style.height="150px",c.style.marginBottom="10px",c.style.fontSize="14px",c.style.padding="8px",c.style.boxSizing="border-box";const d=document.createElement("div");d.style.display="flex",d.style.justifyContent="flex-end",d.style.gap="10px";const h=document.createElement("button");h.textContent="取消",h.addEventListener("click",function(){document.body.removeChild(o),s(null)});const f=document.createElement("button");f.textContent="确认",f.addEventListener("click",function(){document.body.removeChild(o),s(c.value)}),d.appendChild(h),d.appendChild(f),r.appendChild(l),r.appendChild(c),r.appendChild(d),o.appendChild(r),document.body.appendChild(o),c.focus();const m=function(u){u.key==="Escape"&&(document.body.removeChild(o),document.removeEventListener("keydown",m),s(null))};document.addEventListener("keydown",m)})(this.labelText,function(n){n!==null&&(e.labelText=n||"点击编辑文本",e._centerCoord&&e.createLabel(e._centerCoord))})}endCreate(e){try{this.state="endCreate",this.handler&&(this.handler.destroy(),this.handler=null),this.forbidDrawWorld(!1),this.entity&&!this.entity.objId&&(this.entity.objId=this.objId),e&&e(this.entity)}catch(t){console.error("结束创建标签时出错:",t),e&&e(null)}}updatePositions(e){try{if(!e||!e.length){console.warn("更新标签位置时参数无效");return}if(!(window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium)){console.error("更新标签位置时无法获取Cesium对象");return}this.positions=e,this._centerCoord=e[0],this.entity&&(this.entity.position=e[0]),this.createLabel(e[0])}catch(t){console.error("更新标签位置时出错:",t)}}moveEntity(e){try{const t=window.Cesium||this.viewer._cesiumWidget.cesium||this.viewer.scene.cesium;if(!t){console.error("移动实体时无法获取Cesium对象");return}if(!e||!this._centerCoord)return;const n=t.Cartesian3.add(this._centerCoord,e,new t.Cartesian3);this.updatePositions([n])}catch(t){console.error("移动实体时出错:",t)}}setStyle(e){e&&(e.color&&(this.color=e.color),e.fontSize&&(this.fontSize=e.fontSize),e.text!==void 0&&(this.labelText=e.text),this._centerCoord&&this.createLabel(this._centerCoord))}openStyleEditor(){const e=this;(function(n,s){const o=document.createElement("div");o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.backgroundColor="rgba(0, 0, 0, 0.5)",o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.zIndex="10000";const r=document.createElement("div");r.style.backgroundColor="white",r.style.padding="20px",r.style.borderRadius="5px",r.style.width="400px",r.style.maxWidth="90vw",r.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.2)";const l=document.createElement("h3");l.textContent="编辑样式",l.style.marginTop="0";const c=document.createElement("div");c.style.marginBottom="15px";const d=document.createElement("label");d.textContent="文本颜色: ",d.style.display="block",d.style.marginBottom="5px";const h=document.createElement("input");h.type="color",h.value=n.color,h.style.width="50px",c.appendChild(d),c.appendChild(h);const f=document.createElement("div");f.style.marginBottom="15px";const m=document.createElement("label");m.textContent="字体大小: ",m.style.display="block",m.style.marginBottom="5px";const u=document.createElement("input");u.type="number",u.value=n.fontSize,u.min="8",u.max="200",u.step="1",u.style.width="100%",u.style.padding="5px",u.style.boxSizing="border-box",f.appendChild(m),f.appendChild(u);const g=document.createElement("div");g.style.display="flex",g.style.justifyContent="flex-end",g.style.gap="10px",g.style.marginTop="20px";const A=document.createElement("button");A.textContent="取消",A.addEventListener("click",function(){document.body.removeChild(o),s(null)});const p=document.createElement("button");p.textContent="确认",p.addEventListener("click",function(){document.body.removeChild(o),s({color:h.value,fontSize:parseInt(u.value)})}),g.appendChild(A),g.appendChild(p),r.appendChild(l),r.appendChild(c),r.appendChild(f),r.appendChild(g),o.appendChild(r),document.body.appendChild(o);const y=function(C){C.key==="Escape"&&(document.body.removeChild(o),document.removeEventListener("keydown",y),s(null))};document.addEventListener("keydown",y)})(this.getStyle(),function(n){n&&e.setStyle(n)})}getStyle(){return{color:this.color,fontSize:this.fontSize,text:this.labelText}}destroy(){try{try{this.clearPolygonEntities()}catch(e){console.warn("清理标签多边形实体时出错:",e)}if(this.handler){try{this.handler.destroy()}catch(e){console.warn("销毁事件处理器时出错:",e)}this.handler=null}if(this.editHandler){try{this.editHandler.destroy()}catch(e){console.warn("销毁编辑事件处理器时出错:",e)}this.editHandler=null}this._centerCoord=null,this._plotInstance=null,this.entity=null,this.positions=null,this.objId=null;try{super.destroy()}catch(e){console.warn("调用父类destroy方法时出错:",e)}}catch(e){console.error("销毁CreateLabel对象时发生错误:",e)}}syncFromEntity(){this.entity&&this.entity.position&&(this._centerCoord=this.entity.position,this._plotInstance=this)}getEntityPositions(){return this.positions}calculateCenter(){return this._centerCoord}}class Jw extends vt{constructor(e,t){super(e,t),this.type="point",this.viewer=e;let n={color:Cesium.Color.AQUA,pixelSize:10,outlineWidth:1};this.style=Object.assign(n,t||{}),this.position=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){let s=t.getCatesian3FromPX(n.position,t.viewer);s&&(t.entity=t.createPoint(s),t.position=s,t.handler&&(t.handler.destroy(),t.handler=null),t.prompt&&(t.prompt.destroy(),t.prompt=null),t.state="endCreate",e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){t.prompt.update(n.endPosition,"单击新增"),t.state="creating"},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){let e=this;e.handler&&(e.handler.destroy(),e.handler=null),e.prompt&&(e.prompt.destroy(),e.prompt=null),e.state="endCreate"}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.destroy():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let n=e instanceof Cesium.Cartesian3?e:Cesium.Cartesian3.fromDegrees(e[0],e[1],e[2]);this.position=n,n&&(this.entity=this.createPoint(n),t&&t(this.entity),this.state="endCreate")}setStyle(e){if(e){if(e.color){let t=Cesium.Color.fromCssColorString(e.color||"#ffff00");t=t.withAlpha(e.colorAlpha),this.entity.point.color=t}if(this.entity.point.outlineWidth=Number(e.outlineWidth),e.outlineColor){let t=Cesium.Color.fromCssColorString(e.outlineColor||"#000000");t=t.withAlpha(e.outlineColorAlpha),this.entity.point.outlineColor=t}this.entity.point.heightReference=Number(e.heightReference),this.entity.point.pixelSize=Number(e.pixelSize),this.style=Object.assign(this.style,e)}}getStyle(){let e={},t=this.entity.point,n=t.color.getValue();e.colorAlpha=n.alpha,e.color=new Cesium.Color(n.red,n.green,n.blue,1).toCssHexString(),e.outlineWidth=t.outlineWidth._value;let s=t.outlineColor.getValue();return e.outlineColorAlpha=s.alpha,e.outlineColor=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString(),t.heightReference!=null&&(e.heightReference=t.heightReference.getValue()),e.pixelSize=Number(t.pixelSize),e}getPositions(e){return e?me.cartesianToLnglat(this.position):this.position}getLnglats(){return this.getPositions(!0)}startEdit(e){if(this.state=="startEdit"||this.state=="editing"||!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));let t=this,n;this.modifyHandler.setInputAction(function(s){let o=t.viewer.scene.pick(s.position);Cesium.defined(o)&&o.id&&(n=o.id,t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(s){if(!n)return;let o=t.getCatesian3FromPX(s.endPosition,t.viewer);o&&(t.entity&&(t.entity.position.setValue(o),t.position=o,t.state="editing"),e&&e())},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(s){n&&(t.forbidDrawWorld(!1),t.modifyHandler&&(t.modifyHandler.destroy(),t.modifyHandler=null,t.state="editing"))},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null,e&&e(this.entity)),this.forbidDrawWorld(!1),this.state="endEdit"}createPoint(e){if(!e)return;let t=this.viewer.entities.add({position:e,point:{color:this.style.color instanceof Cesium.Color?this.style.color:this.style.color?Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1):Cesium.Color.WHITE,outlineColor:this.style.outlineColor instanceof Cesium.Color?this.style.outlineColor:this.style.outlineColor?Cesium.Color.fromCssColorString(this.style.outlineColor).withAlpha(this.style.outlineColorAlpha||1):Cesium.Color.BLACK,outlineWidth:this.style.outlineWidth||4,pixelSize:this.style.pixelSize||20,disableDepthTestDistance:Number.MAX_VALUE}});return t.objId=this.objId,t}}class Zw extends vt{constructor(e,t){super(e,t),this.type="polygon",this.viewer=e,this.entity=null,this.polyline=null;let n={outlineColor:"#000000",outlineWidth:2};this.style=Object.assign(n,t||{}),this.outline=null}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){let s=t.getCatesian3FromPX(n.position,t.viewer,[]);if(!s||(t.movePush&&(t.positions.pop(),t.movePush=!1),t.positions.some(l=>Math.abs(l.x-s.x)<1e-6&&Math.abs(l.y-s.y)<1e-6&&Math.abs(l.z-s.z)<1e-6)))return;t.positions.push(s);let r=t.createPoint(s);r.wz=t.positions.length-1,t.controlPoints.push(r)},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(t.positions.length<1){t.prompt.update(n.endPosition,"单击开始绘制"),t.state="startCreate";return}t.prompt&&t.prompt.update(n.endPosition,"双击结束,右键取消上一步");let s=t.getCatesian3FromPX(n.endPosition,t.viewer,[]);t.positions.length>=1&&(t.state="creating",t.movePush?t.positions[t.positions.length-1]=s:(t.positions.push(s),t.movePush=!0),t.positions.length==2&&(Cesium.defined(t.polyline)||(t.polyline=t.createPolyline())),t.positions.length==3&&(Cesium.defined(t.entity)||(t.entity=t.createPolygon(t.style),!t.style.outline&&t.polyline&&(t.polyline.show=!1),t.entity.objId=t.objId)))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){t.entity&&(t.positions.splice(t.positions.length-2,1),t.viewer.entities.remove(t.controlPoints.pop()),t.positions.length==2&&t.entity&&(t.viewer.entities.remove(t.entity),t.entity=null,t.polyline&&(t.polyline.show=!0)),t.positions.length==1&&(t.polyline&&(t.viewer.entities.remove(t.polyline),t.polyline=null),t.prompt&&t.prompt.update(n.endPosition,"单击开始绘制"),t.positions=[],t.movePush=!1))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.handler.setInputAction(function(n){t.entity&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.movePush=!1,e.prompt&&(e.prompt.destroy(),e.prompt=null),e.viewer.trackedEntity=void 0,e.viewer.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.positions.length<=2&&this.movePush==!0?this.destroy():this.endCreate():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e)return;this.state="startCreate";let n=e[0]instanceof Cesium.Cartesian3?e:me.lnglatsToCartesians(e);if(n){this.entity=this.createPolygon(),this.polyline=this.createPolyline(),this.polyline.show=this.style.outline,this.positions=n;for(let s=0;s<n.length;s++){let o=n[s],r=Cesium.Cartographic.fromCartesian(n[s]),l=this.createPoint(o);l.point.heightReference=this.style.heightReference,l.ctgc=r,l.wz=this.controlPoints.length,this.controlPoints.push(l)}this.state="endCreate",this.entity.objId=this.objId,t&&t(this.entity)}}getStyle(){if(!this.entity)return;let e={},t=this.entity.polygon;if(t.material instanceof Cesium.ColorMaterialProperty){e.material="common";let s=t.material.color.getValue();e.colorAlpha=s.alpha,e.color=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString()}if(e.fill=t.fill?t.fill.getValue():!1,t.heightReference){let s=t.heightReference.getValue();e.heightReference=Number(s)}let n=this.polyline.polyline;if(n&&this.polyline.show){e.outlineWidth=n.width.getValue(),e.outline=!0;let s=n.material.color.getValue();e.outlineColorAlpha=s.alpha,e.outlineColor=new Cesium.Color(s.red,s.green,s.blue,1).toCssHexString()}else e.outline=!1;return e}setStyle(e){if(!e)return;this.polyline.show=e.outline;let t=this.polyline.polyline;t.width=e.outlineWidth,this.polyline.clampToGround=!!e.heightReference;let s=(e.outlineColor instanceof Cesium.Color?e.outlineColor:Cesium.Color.fromCssColorString(e.outlineColor)).withAlpha(e.outlineColorAlpha||1);t.material=s,e.heightReference!=null&&(this.entity.polygon.heightReference=Number(e.heightReference));let r=(e.color instanceof Cesium.Color?e.color:Cesium.Color.fromCssColorString(e.color)).withAlpha(e.colorAlpha||1);this.entity.polygon.material=r,e.fill!=null&&(this.entity.polygon.fill=e.fill),this.style=Object.assign(this.style,e)}createPolygon(){let e=this;this.style.color=this.style.color||Cesium.Color.WHITE,this.style.outlineColor=this.style.outlineColor||Cesium.Color.BLACK;let t={polygon:{hierarchy:new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(e.positions)},!1),heightReference:Number(this.style.heightReference),show:!0,fill:this.style.fill==null?!0:this.style.fill,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color).withAlpha(this.style.colorAlpha||1)}};return this.style.heightReference||(t.polygon.height=0,t.polygon.perPositionHeight=!0),this.viewer.entities.add(t)}createPolyline(){let e=this;return this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions.concat(e.positions[0])},!1),clampToGround:!!this.style.heightReference,material:this.style.outlineColor instanceof Cesium.Color?this.style.outlineColor:Cesium.Color.fromCssColorString(this.style.outlineColor).withAlpha(this.style.outlineColorAlpha||1),width:this.style.outlineWidth||1}})}destroy(){this.handler&&(this.handler.destroy(),this.handler=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.entity&&(this.viewer.entities.remove(this.entity),this.entity=null),this.polyline&&(this.viewer.entities.remove(this.polyline),this.polyline=null),this.positions=[],this.style=null,this.modifyPoint&&(this.viewer.entities.remove(this.modifyPoint),this.modifyPoint=null);for(let e=0;e<this.controlPoints.length;e++){let t=this.controlPoints[e];this.viewer.entities.remove(t)}this.controlPoints=[],this.state="no",this.prompt&&this.prompt.destroy(),this.polyline&&(this.polyline=null,this.viewer.entities.remove(this.polyline)),this.forbidDrawWorld(!1)}}class e2 extends vt{constructor(e,t){super(e,t),this.type="rectangle",this.viewer=e,this.style=t||{},this.leftup=null,this.rightdown=null,this.leftdownPoint=null,this.rightupPoint=null,this.entity=null,this.handler=null,this.modifyHandler=null,this.modifyPoint=null,this._dragStartCart=null,this._dragStartCartCarto=null}start(e){!this.prompt&&this.promptStyle?.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate",this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.handler.setInputAction(function(n){const s=t.getCatesian3FromPX(n.position,t.viewer,[]);if(s)if(t.entity)t.endCreate(),e&&e(t.entity);else{t.leftup=s.clone(),t.rightdown=s.clone(),t.entity=t._createPolyline();const o=t._calcCornerCartesian("leftdown"),r=t._calcCornerCartesian("rightup");t.leftdownPoint=t.createPoint(o),t.leftdownPoint.typeAttr="leftdown",t.leftdownPoint.show=!1,t.rightupPoint=t.createPoint(r),t.rightupPoint.typeAttr="rightup",t.rightupPoint.show=!1}},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(!t.entity){t.prompt?.update(n.endPosition,"单击开始绘制");return}t.prompt?.update(n.endPosition,"单击结束");const s=t.getCatesian3FromPX(n.endPosition,t.viewer,[]);s&&(t.rightdown=s.clone(),t._updatePolyline(),t._updateAuxPoints(),t.state="creating")},Cesium.ScreenSpaceEventType.MOUSE_MOVE)}endCreate(){this.handler?.destroy(),this.handler=null,this.leftdownPoint&&(this.leftdownPoint.show=!1),this.rightupPoint&&(this.rightupPoint.show=!1),this.prompt?.destroy(),this.prompt=null,this.state="endCreate"}startEdit(e){if(!this.entity)return;this.state="startEdit",this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));const t=this;this.leftdownPoint&&(this.leftdownPoint.show=!0),this.rightupPoint&&(this.rightupPoint.show=!0),this.modifyHandler.setInputAction(function(n){const s=t.viewer.scene.pick(n.position);if(!s?.id)return;t.modifyPoint=s.id;const o=t.getCatesian3FromPX(n.position,t.viewer,[t.entity,t.modifyPoint]);o&&(t._dragStartCart=o,t._dragStartCartCarto=Cesium.Ellipsoid.WGS84.cartesianToCartographic(o),t.forbidDrawWorld(!0))},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(n){if(!t.modifyPoint)return;const s=t.getCatesian3FromPX(n.endPosition,t.viewer,[t.entity,t.modifyPoint]);s&&(t.modifyPoint.typeAttr==="leftdown"?t._dragCorner(s,"leftdown"):t.modifyPoint.typeAttr==="rightup"&&t._dragCorner(s,"rightup"),t._updatePolyline(),t._updateAuxPoints(),e&&e(),t.state="editing")},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(){t.modifyPoint=null,t._dragStartCart=null,t._dragStartCartCarto=null,t.forbidDrawWorld(!1),t._updatePolyline(),e&&e(t.entity),t.state="editing"},Cesium.ScreenSpaceEventType.LEFT_UP)}endEdit(e){this.leftdownPoint&&(this.leftdownPoint.show=!1),this.rightupPoint&&(this.rightupPoint.show=!1),this.modifyHandler?.destroy(),this.modifyHandler=null,this.forbidDrawWorld(!1),this.state="endEdit",e&&e(this.entity)}_createPolyline(){const e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(()=>e._buildRectPositions(),!1),width:this.style.outlineWidth||this.style.width||5,material:this.style.color instanceof Cesium.Color?this.style.color:Cesium.Color.fromCssColorString(this.style.color||"#00FF00"),clampToGround:!1}});return t._plotInstance=this,t.objId=this.objId,t}_updatePolyline(){if(!this.entity)return;const e=this._buildRectPositions();try{const t=this.entity.polyline.positions;if(t&&typeof t.getValue=="function")return;if(t&&typeof t.setValue=="function"){t.setValue(e);return}this.entity.polyline.positions=e}catch{this.entity.polyline.positions=e}}_buildRectPositions(){if(!this.leftup||!this.rightdown)return[];const e=this._calcCornerCartesian("leftdown"),t=this.leftup,n=this._calcCornerCartesian("rightup"),s=this.rightdown;return[e,s,n,t,e]}_calcCornerCartesian(e){const t=Cesium.Ellipsoid.WGS84,n=t.cartesianToCartographic(this.leftup),s=t.cartesianToCartographic(this.rightdown),o=Math.min(n.longitude,s.longitude),r=Math.max(n.longitude,s.longitude),l=Math.min(n.latitude,s.latitude),c=Math.max(n.latitude,s.latitude);if(e==="leftdown")return Cesium.Cartesian3.fromRadians(o,l);if(e==="rightup")return Cesium.Cartesian3.fromRadians(r,c)}_updateAuxPoints(){if(!this.leftup||!this.rightdown)return;const e=this._calcCornerCartesian("leftdown"),t=this._calcCornerCartesian("rightup");this.leftdownPoint&&(this.leftdownPoint.position=e),this.rightupPoint&&(this.rightupPoint.position=t)}_dragCorner(e,t){const n=Cesium.Ellipsoid.WGS84,s=n.cartesianToCartographic(this.leftup),o=n.cartesianToCartographic(this.rightdown);let r=Math.min(s.longitude,o.longitude),l=Math.max(s.longitude,o.longitude),c=Math.min(s.latitude,o.latitude),d=Math.max(s.latitude,o.latitude);const h=n.cartesianToCartographic(e);t==="leftdown"?(r=h.longitude,c=h.latitude):(l=h.longitude,d=h.latitude),this.leftup=Cesium.Cartesian3.fromRadians(r,d),this.rightdown=Cesium.Cartesian3.fromRadians(l,c)}syncFromEntity(){if(!this.entity||!this.leftup||!this.rightdown)return;const e=Cesium.Cartesian3.midpoint(this.leftup,this.rightdown,new Cesium.Cartesian3),t=this.entity._centerCoord;if(!t)return;const n=t.x-e.x,s=t.y-e.y,o=t.z-e.z;this.leftup=new Cesium.Cartesian3(this.leftup.x+n,this.leftup.y+s,this.leftup.z+o),this.rightdown=new Cesium.Cartesian3(this.rightdown.x+n,this.rightdown.y+s,this.rightdown.z+o);const r=this.entity.objId,l=this.entity._plotInstance;this.leftdownPoint&&this.viewer.entities.remove(this.leftdownPoint),this.rightupPoint&&this.viewer.entities.remove(this.rightupPoint),this.leftdownPoint=this.rightupPoint=null,this.viewer.entities.remove(this.entity),this.entity=this._createPolyline(),this.entity._plotInstance=l,this.entity.objId=r;const c=this._calcCornerCartesian("leftdown"),d=this._calcCornerCartesian("rightup");this.leftdownPoint=this.createPoint(c),this.leftdownPoint.typeAttr="leftdown",this.leftdownPoint.show=this.state==="editing",this.rightupPoint=this.createPoint(d),this.rightupPoint.typeAttr="rightup",this.rightupPoint.show=this.state==="editing"}updatePositions(e){if(!e||e.length<1)return!1;try{if(!this.leftup||!this.rightdown)return!1;let t;if(e[0]instanceof Cesium.Cartesian3)t=e[0];else return!1;this.leftup=Cesium.Cartesian3.add(this.leftup,t,new Cesium.Cartesian3),this.rightdown=Cesium.Cartesian3.add(this.rightdown,t,new Cesium.Cartesian3),this._updatePolyline(),this._updateAuxPoints();try{this.viewer.scene.requestRender()}catch{}return!0}catch(t){return console.warn("Failed to update rectangle positions:",t),!1}}getPositions(e){return e?me.cartesiansToLnglats([this.leftup,this.rightdown],this.viewer):[this.leftup,this.rightdown]}getStyle(){const e=this.entity.polyline,t=e.material.color.getValue();return{color:new Cesium.Color(t.red,t.green,t.blue,1).toCssHexString(),colorAlpha:t.alpha,outlineWidth:e.width.getValue()}}setStyle(e){if(!this.entity)return;const t={...this.style,...e};let n=t.color instanceof Cesium.Color?t.color:Cesium.Color.fromCssColorString(t.color||"#00FF00");t.colorAlpha!=null&&(n=n.withAlpha(t.colorAlpha)),this.entity.polyline.material=n,this.entity.polyline.width=t.outlineWidth||t.width||5,this.style=t}destroy(){try{this.handler?.destroy(),this.modifyHandler?.destroy(),this.entity&&this.viewer.entities.remove(this.entity),this.entity=null,this.leftdownPoint&&this.viewer.entities.remove(this.leftdownPoint),this.rightupPoint&&this.viewer.entities.remove(this.rightupPoint),this.leftdownPoint=this.rightupPoint=null,this.prompt?.destroy(),this.prompt=null}catch{}}createByPositions(e,t){if(!e||e.length<2)return!1;const n=e[0]instanceof Cesium.Cartesian3?e:me.lnglatsToCartesians(e);if(!n||n.length<2)return!1;if(n.length===2)this.leftup=Cesium.Cartesian3.clone(n[0]),this.rightdown=Cesium.Cartesian3.clone(n[1]);else if(n.length>=4){let s=1/0,o=1/0,r=-1/0,l=-1/0;n.forEach(c=>{const d=Cesium.Ellipsoid.WGS84.cartesianToCartographic(c);d&&(s=Math.min(s,d.longitude),o=Math.min(o,d.latitude),r=Math.max(r,d.longitude),l=Math.max(l,d.latitude))}),this.leftup=Cesium.Cartesian3.fromRadians(s,l),this.rightdown=Cesium.Cartesian3.fromRadians(r,o)}if(this.entity?this._updatePolyline():this.entity=this._createPolyline(),!this.leftdownPoint){const s=this._calcCornerCartesian("leftdown");this.leftdownPoint=this.createPoint(s),this.leftdownPoint.typeAttr="leftdown",this.leftdownPoint.show=!1}if(!this.rightupPoint){const s=this._calcCornerCartesian("rightup");this.rightupPoint=this.createPoint(s),this.rightupPoint.typeAttr="rightup",this.rightupPoint.show=!1}this._updateAuxPoints(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch(s){console.error("requestRender error:",s)}return t&&t(this.entity),!0}}class t2 extends vt{constructor(e,t){super(e,t),t=t||{},this.movePush=!1,this.type="polyline",this.maxPointNum=t.maxPointNum||Number.MAX_VALUE}updatePositions(e){if(!e||e.length<1)return!1;let t=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);return t?(this.positions=t,this.updateControlPoints(),!0):!1}updateControlPoints(){for(let e=0;e<this.controlPoints.length;e++)this.viewer.entities.remove(this.controlPoints[e]);this.controlPoints=[];for(let e=0;e<this.positions.length;e++){let t=this.positions[e],n=this.createPoint(t);this.style.clampToGround&&(n.point.heightReference=1),n.wz=this.controlPoints.length,this.controlPoints.push(n)}}start(e){!this.prompt&&this.promptStyle.show&&(this.prompt=new Gt(this.viewer,this.promptStyle)),this.state="startCreate";let t=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(n){let s=t.getCatesian3FromPX(n.position,t.viewer,[t.entity]);if(!s)return;t.movePush&&(t.positions.pop(),t.movePush=!1),t.positions.push(s);let o=t.createPoint(s);o.wz=t.positions.length-1,t.controlPoints.push(o),t.positions.length==t.maxPointNum&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(n){if(t.state="creating",t.positions.length<1){t.prompt.update(n.endPosition,"单击开始绘制"),t.state="startCreate";return}t.prompt.update(n.endPosition,"右键取消上一步,双击结束");let s=t.getCatesian3FromPX(n.endPosition,t.viewer,[t.entity]);s&&(t.movePush?t.positions[t.positions.length-1]=s:(t.positions.push(s),t.movePush=!0),t.positions.length==2&&(Cesium.defined(t.entity)||(t.entity=t.createPolyline())))},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){t.entity&&(t.positions.splice(t.positions.length-2,1),t.viewer.entities.remove(t.controlPoints.pop()),t.positions.length==1&&(t.entity&&(t.viewer.entities.remove(t.entity),t.entity=null),t.prompt.update(n.endPosition,"单击开始绘制"),t.movePush=!1,t.positions=[]))},Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.handler.setInputAction(function(n){t.entity&&(t.endCreate(),e&&e(t.entity))},Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}endCreate(){let e=this;e.state="endCreate",e.handler&&(e.handler.destroy(),e.handler=null),e.positions.pop(),e.viewer.entities.remove(e.controlPoints.pop()),e.prompt&&(e.prompt.destroy(),e.prompt=null),e.viewer.trackedEntity=void 0,e.viewer.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY)}done(){this.state=="startCreate"?this.destroy():this.state=="creating"?this.positions.length<=2&&this.movePush==!0?this.destroy():this.endCreate():(this.state=="startEdit"||this.state=="editing")&&this.endEdit()}createByPositions(e,t){if(!e||e.length<1)return;this.state="startCreate";let n=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);if(n){this.entity=this.createPolyline(this.style),this.positions=n,t&&t(this.entity);for(let s=0;s<n.length;s++){let o=n[s],r=this.createPoint(o);this.style.clampToGround&&(r.point.heightReference=1),r.wz=this.controlPoints.length,this.controlPoints.push(r)}this.state="endCreate"}}setStyle(e){if(!e)return;let t=this.getMaterial(e.material,e);this.entity.polyline.material=t,this.entity.polyline.clampToGround=!!e.clampToGround,e.width&&(this.entity.polyline.width=e.width||3),this.style=Object.assign(this.style,e)}getStyle(){if(!this.entity)return;let e={},t=this.entity.polyline;this.style.animateType!=null&&(e.animateType=this.style.animateType,e.image=this.style.image,e.duration=this.style.duration),t.material instanceof Cesium.ColorMaterialProperty?e.material="common":(e.material="flowline",t.material instanceof animate.FlowLineMaterial,e.duration=t.material._duration,e.image=t.material.url);let n=t.material.color.getValue();e.colorAlpha=n.alpha,e.color=new Cesium.Color(n.red,n.green,n.blue,1).toCssHexString(),e.width=t.width._value;let s=t.clampToGround?t.clampToGround.getValue():!1;return e.clampToGround=!!s,e}createPolyline(){let e=this,t=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions},!1),show:!0,material:this.getMaterial(this.style.animateType,this.style),width:this.style.width||3,clampToGround:this.style.clampToGround}});return t.objId=this.objId,t}getMaterial(e,t){t=t||{};let n=null,s=t.color||Cesium.Color.WHITE;return s=s instanceof Cesium.Color?s:Cesium.Color.fromCssColorString(t.color),s=s.withAlpha(t.colorAlpha||1),e=="flowline"||e=="flyline"||(n=s),n}updatePositions(e){if(!e||e.length<1)return!1;let t=e[0]instanceof Cesium.Cartesian3?e:util.lnglatsToCartesians(e);return t?(this.positions=t,this.updateControlPoints(),!0):!1}updateControlPoints(){for(let e=0;e<this.controlPoints.length;e++)this.viewer.entities.remove(this.controlPoints[e]);this.controlPoints=[];for(let e=0;e<this.positions.length;e++){let t=this.positions[e],n=this.createPoint(t);this.style.clampToGround&&(n.point.heightReference=1),n.wz=this.controlPoints.length,this.controlPoints.push(n)}}getPositions(e){return e?util.cartesiansToLnglats(this.positions,this.viewer):this.positions}}class i2 extends vt{constructor(e,t={}){super(e,t),this.type="freehandLine",this.maxPositions=t.maxPositions||1e4,this.minDistance=t.minDistance||2,this.renderInterval=t.renderInterval||30,this.style=Object.assign({smoothness:2,angleThreshold:3,curveResolution:3},t||{}),this.positions=[],this._stagingBuffer=[],this._flushScheduled=!1,this._flushRAF=null,this._lastFlushTime=0,this.isDrawing=!1,this.handler=null,this.startPointEntity=null,this.entity=null,this.lastAddPosition=null}start(e){if(this.state==="creating"||this.state==="startCreate")return;if(this.state="startCreate",this.positions=[],this._stagingBuffer.length=0,this._lastFlushTime=0,this.isDrawing=!1,this.lastAddPosition=null,this._cancelFlush(),!this.prompt&&this.promptStyle&&this.promptStyle.show&&Promise.resolve().then(()=>vc).then(({default:n})=>{this.prompt=new n(this.viewer,this.promptStyle)}),this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.startPointEntity){try{this.viewer.entities.remove(this.startPointEntity)}catch{}this.startPointEntity=null}this.entity=this.createFreehandLine();const t=this;this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(n){t.state="creating",t.isDrawing=!0,t.forbidDrawWorld(!0),t.positions=[],t._stagingBuffer.length=0,t.lastAddPosition=null;let s=t._fastPick(n.position);if(!s){t.isDrawing=!1;return}const o=Cesium.Cartesian3.clone(s);if(t._pushToStaging(o),t.lastAddPosition=o,t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t.startPointEntity=t.viewer.entities.add({position:o,point:{pixelSize:6,color:Cesium.Color.RED,outlineColor:Cesium.Color.WHITE,outlineWidth:1}}),t._scheduleFlush(!0)},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(function(n){if(!t.isDrawing){t.prompt&&n&&n.endPosition&&t.prompt.update(n.endPosition,"单击开始绘制");return}if(t.prompt&&n&&n.endPosition&&t.prompt.update(n.endPosition,"松键结束"),!n||!n.endPosition||t.positions.length+t._stagingBuffer.length>=t.maxPositions)return;let s=t._fastPick(n.endPosition);if(!s||t.lastAddPosition&&Cesium.Cartesian3.distance(t.lastAddPosition,s)<=t.minDistance)return;const o=Cesium.Cartesian3.clone(s);t._pushToStaging(o),t.lastAddPosition=o,t._scheduleFlush()},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(n){if(t.isDrawing){if(t.prompt&&t.prompt.update(null,"单击结束绘制"),t.isDrawing=!1,t.forbidDrawWorld(!1),t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t._scheduleFlush(!0),t.endCreate(e)}},Cesium.ScreenSpaceEventType.LEFT_UP),this.handler.setInputAction(function(n){if(t.isDrawing){if(t.prompt&&t.prompt.update(null,"单击结束绘制"),t.isDrawing=!1,t.forbidDrawWorld(!1),t.startPointEntity){try{t.viewer.entities.remove(t.startPointEntity)}catch{}t.startPointEntity=null}t._scheduleFlush(!0),t.endCreate(e)}},Cesium.ScreenSpaceEventType.RIGHT_DOWN)}_pushToStaging(e){this._stagingBuffer.push(e)}_scheduleFlush(e=!1){if(this._flushRAF){e&&(this._forceImmediate=!0);return}this._forceImmediate=e||!1;const t=this,n=function(){t._flushRAF=null;const s=performance.now();(t._forceImmediate||s-t._lastFlushTime>=t.renderInterval)&&(t._flushToPositions(),t._lastFlushTime=s),t._forceImmediate=!1};this._flushRAF=requestAnimationFrame(n)}_cancelFlush(){if(this._flushRAF){try{cancelAnimationFrame(this._flushRAF)}catch{}this._flushRAF=null}this._forceImmediate=!1}_fastPick(e){if(this.viewer.scene.mode===Cesium.SceneMode.SCENE2D){const n=this.viewer.camera.getPickRay(e);let s=null;return n&&(s=this.viewer.scene.globe.pick(n,this.viewer.scene)),s||(s=this.viewer.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),s}let t=null;try{t=this.viewer.scene.pickPosition(e)}catch{}if(!t){const n=this.viewer.camera.getPickRay(e);n&&(t=this.viewer.scene.globe.pick(n,this.viewer.scene))}return t}_flushToPositions(){if(!this._stagingBuffer||this._stagingBuffer.length===0)return;const e=this._stagingBuffer;this._stagingBuffer=[];const t=Math.max(0,Math.min(2,Number(this.style.smoothness||1)));let n=e;if(t>0){const l=(h,f)=>{if(!h||h.length<2)return h;f=Math.max(1,f|0);const m=[h[0]],u=h.length;for(let g=0;g<u-1;g++){const A=g>0?h[g-1]:h[g],p=h[g],y=h[g+1],C=g+2<u?h[g+2]:h[g+1];for(let I=1;I<f;I++){const P=I/f,k=P*P,M=k*P,B=-.5*A.x+1.5*p.x-1.5*y.x+.5*C.x,_=-.5*A.y+1.5*p.y-1.5*y.y+.5*C.y,E=-.5*A.z+1.5*p.z-1.5*y.z+.5*C.z,w=A.x-2.5*p.x+2*y.x-.5*C.x,D=A.y-2.5*p.y+2*y.y-.5*C.y,F=A.z-2.5*p.z+2*y.z-.5*C.z,U=-.5*A.x+.5*y.x,R=-.5*A.y+.5*y.y,b=-.5*A.z+.5*y.z,v=p.x,x=p.y,N=p.z,O=B*M+w*k+U*P+v,Q=_*M+D*k+R*P+x,L=E*M+F*k+b*P+N;m.push(new Cesium.Cartesian3(O,Q,L))}m.push(y)}return m},c=Math.max(1,Number(this.style.curveResolution)||1);n.length<200&&c>1&&(n=l(n,c));const d=h=>{if(!h||h.length<2)return h;const f=[];f.push(h[0]);for(let m=0;m<h.length-1;m++){const u=h[m],g=h[m+1],A=new Cesium.Cartesian3(u.x*.75+g.x*.25,u.y*.75+g.y*.25,u.z*.75+g.z*.25),p=new Cesium.Cartesian3(u.x*.25+g.x*.75,u.y*.25+g.y*.75,u.z*.25+g.z*.75);f.push(A),f.push(p)}return f.push(h[h.length-1]),f};n=n.slice(),n.length<300&&(n=d(n),t===2&&n.length<300&&(n=d(n)))}const s=(Number(this.style.angleThreshold)||6)*(Math.PI/180),o=this.positions,r=(l,c,d,h)=>{if(!l||!c||!d)return!1;const f=c.x-l.x,m=c.y-l.y,u=c.z-l.z,g=d.x-c.x,A=d.y-c.y,p=d.z-c.z,y=Math.hypot(f,m,u),C=Math.hypot(g,A,p);if(y===0||C===0)return!1;const I=(f*g+m*A+u*p)/(y*C),P=Math.max(-1,Math.min(1,I)),k=Math.acos(P);return Math.abs(k)<=h};for(let l=0;l<n.length;l++){const c=n[l];if(o.length===0){o.push(Cesium.Cartesian3.clone(c));continue}const d=o[o.length-1];if(!(Cesium.Cartesian3.distance(d,c)<=this.minDistance*.5)){if(o.length>=2){const f=o[o.length-2],m=o[o.length-1],u=c;if(r(f,m,u,s)){o.pop(),o.push(Cesium.Cartesian3.clone(u));continue}}if(o.push(Cesium.Cartesian3.clone(c)),o.length>this.maxPositions){const f=o.length-this.maxPositions;f>0&&o.splice(0,f)}}}try{this.viewer.scene.requestRender()}catch{}}endCreate(e){if(this.state==="endCreate")return;if(this.state="endCreate",this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}if(this._flushToPositions(),this._cancelFlush(),!this.positions||this.positions.length<2){if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}e&&e(null);return}const t=this.positions.map(n=>Cesium.Cartesian3.clone(n));this.positions=t;try{this.viewer.scene.requestRender()}catch{}e&&e(this.entity)}done(e){this.isDrawing&&(this.isDrawing=!1,this.forbidDrawWorld(!1),this.endCreate(e))}createFreehandLine(){const e=this,t=this.getMaterial(this.style.animateType,this.style),n=this.viewer.entities.add({polyline:{positions:new Cesium.CallbackProperty(function(){return e.positions||[]},!1),show:!0,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1}});return n.objId=this.objId||null,this.entity=n,n}getMaterial(e,t){t=t||{};try{let n=t.color||Cesium.Color.RED;typeof n=="string"&&(n=Cesium.Color.fromCssColorString(n));const s=t.colorAlpha!==void 0?t.colorAlpha:1;return n=n.withAlpha(s),n}catch{return Cesium.Color.RED}}updatePositions(e){if(!e||e.length<1)return!1;try{let t=[];if(e[0]instanceof Cesium.Cartesian3?t=e.map(n=>Cesium.Cartesian3.clone(n)):t=me&&me.lnglatsToCartesians?me.lnglatsToCartesians(e):e,!t||t.length===0)return!1;this.positions=t.map(n=>Cesium.Cartesian3.clone(n)),this._stagingBuffer.length=0;try{this.viewer.scene.requestRender()}catch{}return!0}catch{return!1}}setStyle(e){if(!e||(this.style=Object.assign(this.style||{},e),!this.entity||!this.entity.polyline))return;const t=this.getMaterial(this.style.animateType,this.style);try{this.entity.polyline.material=t}catch{}if(e.width!==void 0)try{this.entity.polyline.width=e.width}catch{}if(e.clampToGround!==void 0)try{this.entity.polyline.clampToGround=!!e.clampToGround}catch{}}createByPositions(e,t){if(!e||e.length<1)return!1;const n=e[0]instanceof Cesium.Cartesian3?e:me.lnglatsToCartesians(e);if(!n||n.length<1)return!1;this.positions=n.map(s=>Cesium.Cartesian3.clone(s)),this.entity||this.createFreehandLine(),this.state="endCreate";try{this.viewer.scene.requestRender()}catch{}return t&&t(this.entity),!0}destroy(){if(this._cancelFlush(),this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this.entity){try{this.viewer.entities.remove(this.entity)}catch{}this.entity=null}if(this.startPointEntity){try{this.viewer.entities.remove(this.startPointEntity)}catch{}this.startPointEntity=null}this.positions=[],this._stagingBuffer=[],this.isDrawing=!1;try{this.endCreate()}catch{}}}class n2 extends vt{constructor(e,t={}){if(!e)throw new Error("CreateArrow requires viewer");if(super(e,t),this.type="arrow",this.style=t||{},this.arrowAngle=t.arrowAngle||Math.PI/6,this.positions=[],this.lineEntity=null,this.arrowEntity=null,this.controlPoints=[],this.handler=null,this._finalized=!1,this._editRenderHandler=null,this.Cesium=this._getCesium(),!this.Cesium)throw new Error("Cesium not found")}_getCesium(){return typeof window<"u"&&window.Cesium?window.Cesium:typeof Cesium<"u"?Cesium:this.viewer&&this.viewer.constructor&&this.viewer.constructor.Cesium?this.viewer.constructor.Cesium:null}start(e){if(!this.viewer||!this.Cesium)return e&&e(null),this;if(this.state==="creating"||this.state==="startCreate")return this;this.state="startCreate",this._cleanup(!1),!this.prompt&&this.promptStyle&&this.promptStyle.show&&Promise.resolve().then(()=>vc).then(({default:n})=>{this.prompt=new n(this.viewer,this.promptStyle)}).catch(()=>{});try{this.forbidDrawWorld(!0)}catch{}const t=this;return this.handler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(function(n){if(t.state==="startCreate"){t.state="creating",t._finalized=!1;let s=t.getCatesian3FromPX(n.position);if(!s)return;t.positions=[t.Cesium.Cartesian3.clone(s),t.Cesium.Cartesian3.clone(s)],t._createLineEntity(),t._createArrowEntity(),t._createControlPoints(),t.prompt&&n&&n.position&&t.prompt.update(n.position,"再次单击完成绘制")}else if(t.state==="creating"){if(t.state="endCreate",t._finalized=!0,t._finalizeEntities(),t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}if(t.handler){try{t.handler.destroy()}catch{}t.handler=null}try{t.forbidDrawWorld(!1)}catch{}e&&e(t.entity||t.lineEntity)}try{t.viewer.scene.requestRender()}catch{}},this.Cesium.ScreenSpaceEventType.LEFT_DOWN),this.handler.setInputAction(function(n){if(t.state==="startCreate"){t.prompt&&n&&n.endPosition&&t.prompt.update(n.endPosition,"单击开始绘制");return}if(t.state==="creating"){let s=t.getCatesian3FromPX(n.endPosition);if(!s)return;if(t.positions[1]=s,t.controlPoints[1])try{t.controlPoints[1].position.setValue(s)}catch{}try{t.viewer.scene.requestRender()}catch{}}},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(){if(t.state==="creating"){if(t.state="endCreate",t._finalized=!1,t.lineEntity){try{t.viewer.entities.remove(t.lineEntity)}catch{}t.lineEntity=null}if(t.arrowEntity){try{t.viewer.entities.remove(t.arrowEntity)}catch{}t.arrowEntity=null}t.controlPoints.length&&(t.controlPoints.forEach(n=>{try{t.viewer.entities.remove(n)}catch{}}),t.controlPoints=[])}if(t.prompt){try{t.prompt.destroy()}catch{}t.prompt=null}if(t.handler){try{t.handler.destroy()}catch{}t.handler=null}try{t.forbidDrawWorld(!1)}catch{}e&&e(null)},this.Cesium.ScreenSpaceEventType.RIGHT_DOWN),this}_computeArrowPositions(e,t){if(!e||!t)return[];const n=this.Cesium.Cartesian3.distance(e,t);if(n<=1e-6)return[];const s=this.style.arrowLengthFactor!==void 0?this.style.arrowLengthFactor:.15,o=this.style.arrowMinSize!==void 0?this.style.arrowMinSize:1.5,r=this.style.arrowMaxSize!==void 0?this.style.arrowMaxSize:Number.MAX_VALUE;let l=this.style.arrowFixedSize!==void 0?this.style.arrowFixedSize:n*s;l<o&&(l=o),l>r&&(l=r);const c=this.Cesium.Cartesian3.subtract(t,e,new this.Cesium.Cartesian3);this.Cesium.Cartesian3.normalize(c,c);const d=this.Cesium.Transforms.eastNorthUpToFixedFrame(t),h=this.Cesium.Matrix4.getColumn(d,2,new this.Cesium.Cartesian3),f=new this.Cesium.Cartesian3(c.x-h.x*this.Cesium.Cartesian3.dot(c,h),c.y-h.y*this.Cesium.Cartesian3.dot(c,h),c.z-h.z*this.Cesium.Cartesian3.dot(c,h));let m;this.Cesium.Cartesian3.magnitudeSquared(f)<1e-6?m=this.Cesium.Matrix4.getColumn(d,0,new this.Cesium.Cartesian3):(this.Cesium.Cartesian3.normalize(f,f),m=this.Cesium.Cartesian3.cross(h,f,new this.Cesium.Cartesian3),this.Cesium.Cartesian3.normalize(m,m));const u=this.Cesium.Cartesian3.multiplyByScalar(c,-l,new this.Cesium.Cartesian3),g=this.Cesium.Cartesian3.add(t,u,new this.Cesium.Cartesian3),A=this.style.arrowWidthScale!==void 0?this.style.arrowWidthScale:1,p=Math.sin(this.arrowAngle)*l*A,y=this.Cesium.Cartesian3.multiplyByScalar(m,p,new this.Cesium.Cartesian3),C=this.Cesium.Cartesian3.multiplyByScalar(m,-p,new this.Cesium.Cartesian3),I=this.Cesium.Cartesian3.add(g,y,new this.Cesium.Cartesian3),P=this.Cesium.Cartesian3.add(g,C,new this.Cesium.Cartesian3);return[t,I,P,t]}_createLineEntity(){if(this.lineEntity){try{this.viewer.entities.remove(this.lineEntity)}catch{}this.lineEntity=null}const e=this,t=this._getMaterial(),n=new this.Cesium.CallbackProperty(function(){return!e.positions||e.positions.length<2?[]:[e.positions[0],e.positions[1]]},!1);this.lineEntity=this.viewer.entities.add({polyline:{positions:n,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1},objId:this.objId}),this.entity=this.lineEntity}_createArrowEntity(){if(this.arrowEntity){try{this.viewer.entities.remove(this.arrowEntity)}catch{}this.arrowEntity=null}const e=this,t=this._getMaterial(),n=new this.Cesium.CallbackProperty(function(){if(!e.positions||e.positions.length<2)return[];const s=e.positions[0],o=e.positions[1];return e._computeArrowPositions(s,o)},!1);this.arrowEntity=this.viewer.entities.add({polyline:{positions:n,material:t,width:this.style.width||3,clampToGround:!!this.style.clampToGround||!1},objId:this.objId}),console.log("this.arrowEntity",this.arrowEntity)}_createControlPoints(){if(this.controlPoints&&this.controlPoints.length&&(this.controlPoints.forEach(e=>{try{this.viewer.entities.remove(e)}catch{}}),this.controlPoints=[]),!(!this.positions||this.positions.length<2))for(let e=0;e<2;e++)try{const t=this.createPoint(this.positions[e]);t.wz=e,this.controlPoints.push(t)}catch{}}_finalizeEntities(){if(this.lineEntity&&this.lineEntity.polyline)try{const e=this.Cesium.Cartesian3.clone(this.positions[0]),t=this.Cesium.Cartesian3.clone(this.positions[1]);this.lineEntity.polyline.positions=[e,t]}catch{}if(this.arrowEntity&&this.arrowEntity.polyline)try{const e=this.positions[0],t=this.positions[1];this.arrowEntity.polyline.positions=this._computeArrowPositions(e,t)}catch{}this.entity=this.lineEntity,this.entity&&(this.entity.arrowEntity=this.arrowEntity,this.entity.positions=[this.positions[0],this.positions[1]],this.positions=[this.positions[0],this.positions[1]]);try{this.viewer.scene.requestRender()}catch{}}startEdit(e){super.startEdit(e),(!this.controlPoints||this.controlPoints.length<2)&&this._createControlPoints();for(let t=0;t<this.controlPoints.length;t++)try{this.controlPoints[t].show=!0}catch{}if(this.lineEntity&&this.lineEntity.polyline)try{const t=this;this.lineEntity.polyline.positions=new this.Cesium.CallbackProperty(function(){return!t.positions||t.positions.length<2?[]:[t.positions[0],t.positions[1]]},!1)}catch{}if(this.arrowEntity&&this.arrowEntity.polyline)try{const t=this;this.arrowEntity.polyline.positions=new this.Cesium.CallbackProperty(function(){if(!t.positions||t.positions.length<2)return[];const n=t.positions[0],s=t.positions[1];return t._computeArrowPositions(n,s)},!1)}catch{}if(!this._editRenderHandler){this._editRenderHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);const t=this;this._editRenderHandler.setInputAction(function(n){if(t.modifyPoint)try{t.viewer.scene.requestRender()}catch{}},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}endEdit(e){if(super.endEdit(e),this._editRenderHandler){try{this._editRenderHandler.destroy()}catch{}this._editRenderHandler=null}this._finalized=!0,this._finalizeEntities()}createByPositions(e,t){if(!e||e.length<2)return!1;let n=e[0],s=e[1];if(!(n instanceof this.Cesium.Cartesian3))if(Array.isArray(n)&&n.length>=2)n=this.Cesium.Cartesian3.fromDegrees(n[0],n[1]),s=this.Cesium.Cartesian3.fromDegrees(s[0],s[1]);else return!1;return this.positions=[this.Cesium.Cartesian3.clone(n),this.Cesium.Cartesian3.clone(s)],this._createLineEntity(),this._createArrowEntity(),this._createControlPoints(),this._finalized=!0,this._finalizeEntities(),this.state="endCreate",t&&t(this.entity||this.lineEntity),!0}updatePositions(e){if(!e||e.length<2)return!1;let t=e[0],n=e[1];if(!(t instanceof this.Cesium.Cartesian3))if(Array.isArray(t)&&t.length>=2)t=this.Cesium.Cartesian3.fromDegrees(t[0],t[1]),n=this.Cesium.Cartesian3.fromDegrees(n[0],n[1]);else return!1;return this.positions=[this.Cesium.Cartesian3.clone(t),this.Cesium.Cartesian3.clone(n)],this.lineEntity||this._createLineEntity(),this.arrowEntity||this._createArrowEntity(),this._createControlPoints(),this._finalized=!0,this._finalizeEntities(),!0}setStyle(e){if(!e)return;this.style=Object.assign(this.style||{},e),e.arrowAngle!==void 0&&(this.arrowAngle=e.arrowAngle);const t=this._getMaterial();if(this.lineEntity&&this.lineEntity.polyline){try{this.lineEntity.polyline.material=t}catch{}if(e.width!==void 0)try{this.lineEntity.polyline.width=e.width}catch{}}if(this.arrowEntity&&this.arrowEntity.polyline)try{this.arrowEntity.polyline.material=t}catch{}}endCreate(e){if(this.state!=="endCreate"){if(this.state="endCreate",this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}if(this._finalized=!0,this._finalizeEntities(),this.handler){try{this.handler.destroy()}catch{}this.handler=null}try{this.forbidDrawWorld(!1)}catch{}e&&e(this.entity||this.lineEntity)}}done(e){this.isDrawing&&(this.isDrawing=!1,this.endCreate(e))}getEntity(){return this.entity||this.lineEntity}destroy(){this._cleanup(!0),this.state=null}_cleanup(e=!0){if(this.handler){try{this.handler.destroy()}catch{}this.handler=null}if(this._editRenderHandler){try{this._editRenderHandler.destroy()}catch{}this._editRenderHandler=null}if(e){if(this.lineEntity){try{this.viewer.entities.remove(this.lineEntity)}catch{}this.lineEntity=null}if(this.arrowEntity){try{this.viewer.entities.remove(this.arrowEntity)}catch{}this.arrowEntity=null}this.controlPoints&&this.controlPoints.length&&(this.controlPoints.forEach(t=>{try{this.viewer.entities.remove(t)}catch{}}),this.controlPoints=[]),this.entity=null}if(this.prompt){try{this.prompt.destroy()}catch{}this.prompt=null}this.positions=[],this.isDrawing=!1,this._finalized=!1;try{this.forbidDrawWorld(!1)}catch{}}_getMaterial(){try{let e=this.style.color||this.Cesium.Color.RED;typeof e=="string"&&(e=this.Cesium.Color.fromCssColorString(e));const t=this.style.colorAlpha!==void 0?this.style.colorAlpha:1;return e.withAlpha(t)}catch{return this.Cesium.Color.RED}}}class s2{constructor(e,t){if(!e){console.warn("缺少必要参数!--viewer");return}if(t=t||{},this.viewer=e,this.Cesium=window.Cesium||window.cesium,this.entityObjArr=[],this.handler=null,!this.Cesium){console.error("Cesium实例未找到!");return}this.removeHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.startEditFun=null,this.endEditFun=null,this.removeFun=null,this.editingFun=void 0,this.deleteEntityObj=null,this.bindEdit(),this.bindRemove(),this.canEdit=t.canEdit==null?!0:t.canEdit,this.fireEdit=t.fireEdit==null?!0:t.fireEdit,this.nowDrawEntityObj=null,this.nowEditEntityObj=null}on(e,t){e=="startEdit"&&(this.startEditFun=t),e=="endEdit"&&(this.endEditFun=t),e=="remove"&&(this.removeFun=t),e=="endCreate"&&(this.endCreateFun=t),e=="editing"&&(this.editingFun=t)}openEdit(){this.canEdit=!0}closeEdit(){this.endEdit(),this.canEdit=!1}start(e){if(!e||!e.type)return;e.id=e.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));let t=this;this.endEdit(),this.nowDrawEntityObj&&(this.nowDrawEntityObj.state=="startCreate"||this.nowDrawEntityObj.state=="creating")&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null);let n=this.createByType(e);if(n)return n.attr=e||{},n.start(function(s){t.nowDrawEntityObj=void 0,t.entityObjArr.push(n),e.success&&e.success(n,s),t.endCreateFun&&t.endCreateFun(n,s),e.show==!1&&n.setVisible(!1),t.canEdit&&t.fireEdit&&(n.startEdit(function(){t.editingFun&&t.editingFun(n,n.entity)}),t.nowEditEntityObj=n,t.startEditFun&&t.startEditFun(n,s))}),this.nowDrawEntityObj=n,n}end(){this.nowDrawEntityObj}startEditOne(e){if(!this.canEdit)return;this.nowEditEntityObj&&(this.nowEditEntityObj.endEdit(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=null);let t=this;e&&(e.startEdit(function(){t.editingFun&&t.editingFun(e,e.entity)}),this.startEditFun&&this.startEditFun(e,e.getEntity()),this.nowEditEntityObj=e)}updateOneStyle(e,t){e&&e.setStyle(t)}createByPositions(e){if(e=e||{},e||(e={}),!e.positions)return;e.id=e.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));let t=this,n=this.createByType(e);if(n)return n.attr=e,n.createByPositions(e.positions,function(s){t.entityObjArr.push(n),n.setStyle(e.style),e.success&&e.success(n,s),t.endCreateFun&&t.endCreateFun(n,s),e.show==!1&&n.setVisible(!1),t.canEdit&&t.fireEdit&&(n.startEdit(function(){t.editingFun&&t.editingFun(n,n.entity)}),t.startEditFun&&t.startEditFun(n,s),t.nowEditEntityObj=n)}),n}createByGeojson(e){let{features:t}=e,n=[];for(let s=0;s<t.length;s++){let o=t[s];const{properties:r,geometry:l}=o;let c=r.plotType;const d=l.type,h=l.coordinates;let f=[],m="";switch(d){case"LineString":f=me.lnglatsToCartesians(h),m="polyline";break;case"Polygon":f=me.lnglatsToCartesians(h[0]),m="polygon";break;case"Point":f=me.lnglatsToCartesians([h])[0],m=c;break}this.fireEdit=!1;let u=this.createByPositions({type:m,styleType:c,positions:f,style:r.style});u&&n.push(u)}return n}toGeojson(){let e={type:"FeatureCollection",features:[]};if(this.entityObjArr.length==0)return null;for(let t=0;t<this.entityObjArr.length;t++){let n=this.entityObjArr[t],s=n.getPositions(!0),o=[];for(let d=0;d<s.length;d++)o.push([s[d][0],s[d][1]]);let r=n.getStyle(),l=this.transType(n.type),c={type:"Feature",properties:{plotType:n.type,style:r},geometry:{type:l,coordinates:[]}};switch(l){case"Polygon":c.geometry.coordinates=[o];break;case"Point":c.geometry.coordinates=o;break;case"LineString":c.geometry.coordinates=o;break}c.properties=Object.assign(c.properties,n.properties),e.features.push(c)}return e}transType(e){let t="";switch(e){case"polyline":t="LineString";break;case"polygon":t="Polygon";break;case"point":case"gltfModel":case"label":case"billboard":t="Point";break;default:t=e}return t}destroy(){this.nowEditEntityObj&&(this.nowEditEntityObj.destroy(),this.nowEditEntityObj=null),this.nowDrawEntityObj&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].destroy();this.entityObjArr=[],this.nowEditEntityObj=null,this.handler&&(this.handler.destroy(),this.handler=null),this.removeHandler&&(this.removeHandler.destroy(),this.removeHandler=null)}removeOne(e){e&&e&&(e.state!="endCreate"||e.state!="endEdit"?e.destroy():this.removeByObjId(e.objId))}removeAll(){this.nowDrawEntityObj&&(this.nowDrawEntityObj.destroy(),this.nowDrawEntityObj=null),this.nowEditEntityObj&&(this.nowEditEntityObj.destroy(),this.nowEditEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].destroy();this.entityObjArr=[],this.nowEditEntityObj=null}hasEntityObj(e){return e?this.getEntityObjByObjId(e.objId)!={}:!1}removeByObjId(e){let t=this.getEntityObjByObjId(e);this.entityObjArr.splice(t.index,1),this.removeFun&&this.removeFun(t.entityObj,t.entityObj.getEntity()),t.entityObj&&t.entityObj.destroy()}removeById(e){let t=this.getEntityObjById(e);this.entityObjArr.splice(t.index,1),this.removeFun&&this.removeFun(t.entityObj,t.entityObj.getEntity()),t.entityObj&&t.entityObj.destroy()}zoomToByObjId(e){let t=this.getEntityObjByObjId(e);t.entityObj&&t.entityObj.zoomTo()}getEntityObjByField(e,t){let n={};if(t)for(let s=0;s<this.entityObjArr.length;s++){let o=this.entityObjArr[s];if(o.attr[e]==t){n.entityObj=o,n.index=s;break}}else for(let s=0;s<this.entityObjArr.length;s++){let o=this.entityObjArr[s];if(o.attr.id==e){n.entityObj=o,n.index=s;break}}return n}setVisible(e,t){let n=this.getEntityObjByField("id",e);n.entityObj&&n.entityObj.setVisible(t)}getEntityObjByObjId(e){if(!e)return;let t={};for(let n=0;n<this.entityObjArr.length;n++){let s=this.entityObjArr[n];if(s.objId==e){t.entityObj=s,t.index=n;break}}return t}getEntityObjById(e){if(!e)return;let t={};for(let n=0;n<this.entityObjArr.length;n++){let s=this.entityObjArr[n];if(s.attr.id==e){t.entityObj=s,t.index=n;break}}return t}bindEdit(){let e=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){if(!e.canEdit||e.nowDrawEntityObj)return;const n=e.viewer.scene.drillPick(t.position)||[];let s=-1,o;for(let r=0;r<n.length&&s===-1;r++){const l=n[r].id;if(l){for(let c=0;c<e.entityObjArr.length;c++)if(l.objId==e.entityObjArr[c].objId&&e.entityObjArr[c].state!="startCreate"&&e.entityObjArr[c].state!="creating"){s=c,o=l;break}}}s!==-1?(e.nowEditEntityObj&&(e.nowEditEntityObj.endEdit(),e.endEditFun&&e.endEditFun(e.nowEditEntityObj,e.nowEditEntityObj.getEntity()),e.nowEditEntityObj=null),e.entityObjArr[s].startEdit(function(){e.editingFun&&e.editingFun(e.nowEditEntityObj,e.nowEditEntityObj.entity)}),e.startEditFun&&e.startEditFun(e.entityObjArr[s],o),e.nowEditEntityObj=e.entityObjArr[s]):e.nowEditEntityObj&&(e.nowEditEntityObj.endEdit(),e.endEditFun&&e.endEditFun(e.nowEditEntityObj,e.nowEditEntityObj.getEntity()),e.nowEditEntityObj=void 0)},Cesium.ScreenSpaceEventType.LEFT_CLICK)}bindRemove(){let e=this;this.handler||(this.handler=new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){if(!e.canEdit||e.nowDrawEntityObj)return;const n=e.viewer.scene.drillPick(t.position)||[];let s;for(let o=0;o<n.length;o++){const r=n[o].id;if(r){for(let l=0;l<e.entityObjArr.length;l++)if(r.objId==e.entityObjArr[l].objId){s=r.objId;break}if(s)break}}s&&e.createDelteDom(t.position,s)},Cesium.ScreenSpaceEventType.RIGHT_CLICK)}createDelteDom(e,t){if(!t)return;let n=window.document.createElement("span");n.style.background="rgba(0,0,0,0.5)",n.style.position="absolute",n.style.color="white",n.style.left=e.x+10+"px",n.style.top=e.y+10+"px",n.style.padding="4px",n.style.cursor="pointer",n.id="easy3d-plot-delete",n.setAttribute("objId",t),n.innerHTML="删除",window.document.getElementById(this.viewer.container.id).appendChild(n);const o=window.document.getElementById("easy3d-plot-delete");if(!o)return;let r=this;o.addEventListener("click",l=>{let c=n.getAttribute("objId");r.removeByObjId(c)}),document.addEventListener("click",function(){o.remove()})}endEdit(){this.nowEditEntityObj&&(this.nowEditEntityObj.endEdit(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=null);for(let e=0;e<this.entityObjArr.length;e++)this.entityObjArr[e].endEdit()}done(){this.nowEditEntityObj&&(this.nowEditEntityObj.done(),this.endEditFun&&this.endEditFun(this.nowEditEntityObj,this.nowEditEntityObj.getEntity()),this.nowEditEntityObj=void 0),this.nowDrawEntityObj&&(this.nowDrawEntityObj.done(),this.entityObjArr.push(this.nowDrawEntityObj),this.endCreateFun&&this.endCreateFun(this.nowDrawEntityObj,this.nowDrawEntityObj.getEntity()),this.nowDrawEntityObj=void 0)}getEntityObjArr(){return this.entityObjArr}createByType(e){let t,n="";return e=e||{},e.type=="polyline"&&(t=new t2(this.viewer,e.style),n="折线_"),e.type=="freehandLine"&&(t=new i2(this.viewer,e.style),n="手绘线_"),e.type=="polygon"&&(t=new Zw(this.viewer,e.style),n="面_"),e.type=="billboard"&&(t=new yC(this.viewer,e.style),n="图标_"),(e.type=="circle"||e.type=="ellipse")&&(t=new EC(this.viewer,e.style),n="圆_"),e.type=="rectangle"&&(t=new e2(this.viewer,e.style),n="矩形_"),e.type=="gltfModel"&&(t=new CC(this.viewer,e.style),n="模型_"),e.type=="point"&&(t=new Jw(this.viewer,e.style),n="点_"),e.type=="label"&&(t=new Xw(this.viewer,e.style),n="文字_"),e.type=="arrow"&&(t=new n2(this.viewer,e.style)),t&&(t.name=n+new Date().getTime()),t}}class Vd{viewer;Cesium;drawTool;flatTool;tileset;tilesets;flatTools;selectedEntityObj;selectionOutline;centerHandle;_dragHandler;_listeners;currentColor;currentWidth;originalDoubleClickAction=null;constructor({viewer:e,cesium:t}){window.Cesium=t,this.viewer=e,this.Cesium=t,this.drawTool=null,this.flatTool=null,this.tileset=null,this.tilesets=null,this.flatTools=null,this.selectedEntityObj=null,this.selectionOutline=null,this.centerHandle=null,this._dragHandler=null,this._listeners=[],this.currentColor=this.Cesium.Color.fromCssColorString("#ff0000"),this.currentWidth=1,this.originalDoubleClickAction=this.viewer.screenSpaceEventHandler.getInputAction(this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.viewer.screenSpaceEventHandler.removeInputAction(this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.initDrawTool()}setCurrentColor(e){typeof e=="string"?this.currentColor=this.Cesium.Color.fromCssColorString(e):this.currentColor=e}setCurrentWidth(e){this.currentWidth=e}initDrawTool(){this.drawTool||(this.drawTool=new s2(this.viewer,{canEdit:!0,fireEdit:!0}),this.drawTool.on("startEdit",(e,t)=>{this.selectedEntityObj=e,this.showEntityOutline(e)}),this.drawTool.on("endEdit",(e,t)=>{this.selectedEntityObj=null,this.hideEntityOutline()}),this.drawTool.on("remove",(e,t)=>{this.selectedEntityObj===e&&(this.selectedEntityObj=null,this.hideEntityOutline())}))}showEntityOutline(e){this.hideEntityOutline(),!(!e||!e.getEntity())&&this.createCenterHandle(e)}hideEntityOutline(){if(this.selectionOutline){try{this.viewer.entities.remove(this.selectionOutline)}catch{}this.selectionOutline=null}if(this.centerHandle){try{this.viewer.entities.remove(this.centerHandle)}catch{}this.centerHandle=null}if(this._dragHandler){try{this._dragHandler.destroy()}catch{}this._dragHandler=null}}createCenterHandle(e){if(!e||!e.getEntity())return;if(this.centerHandle){try{this.viewer.entities.remove(this.centerHandle)}catch{}this.centerHandle=null}const t=e.getEntity();let n=null;if(t._plotInstance&&typeof t._plotInstance.syncFromEntity=="function")try{t._plotInstance.syncFromEntity();const s=t._plotInstance;s.leftup&&s.rightdown&&(n=this.Cesium.Cartesian3.midpoint(s.leftup,s.rightdown,new this.Cesium.Cartesian3))}catch(s){console.warn("plotInstance.syncFromEntity failed",s)}if(!n){if(e.positions&&e.positions.length)n=this.calculateCenter(e.positions);else if(t.position&&t.position.getValue)n=t.position.getValue();else if(t.polyline&&t.polyline.positions&&t.polyline.positions.getValue){const s=t.polyline.positions.getValue();n=this.calculateCenter(s)}else if(t.polygon&&t.polygon.hierarchy&&t.polygon.hierarchy.getValue){const s=t.polygon.hierarchy.getValue().positions;n=this.calculateCenter(s)}else if(t.rectangle&&t.rectangle.coordinates&&t.rectangle.coordinates.getValue)try{const s=t.rectangle.coordinates.getValue(),o=(s.west+s.east)/2,r=(s.south+s.north)/2;n=this.Cesium.Cartesian3.fromRadians(o,r,0)}catch{}}n&&(this.centerHandle=this.viewer.entities.add({position:n,point:{pixelSize:10,color:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLUE,outlineWidth:2}}),this.addDragHandler(e,n))}calculateCenter(e){if(!e||e.length===0)return null;const t=e.map(r=>r);let n=0,s=0,o=0;for(let r=0;r<t.length;r++)n+=t[r].x,s+=t[r].y,o+=t[r].z;return new this.Cesium.Cartesian3(n/t.length,s/t.length,o/t.length)}getEntityPositions(e){const t=e.getEntity();if(e.positions&&Array.isArray(e.positions))return e.positions.slice();if(t.polyline&&t.polyline.positions&&t.polyline.positions.getValue){const n=t.polyline.positions.getValue();return Array.isArray(n)?n.slice():[]}if(t.polygon&&t.polygon.hierarchy&&t.polygon.hierarchy.getValue){const n=t.polygon.hierarchy.getValue();return n&&n.positions?n.positions.slice():[]}if(t.position&&t.position.getValue)return[t.position.getValue()];if(t.rectangle&&t.rectangle.coordinates&&t.rectangle.coordinates.getValue){const n=t.rectangle.coordinates.getValue();return[this.Cesium.Cartesian3.fromDegrees(n.west,n.south),this.Cesium.Cartesian3.fromDegrees(n.east,n.south),this.Cesium.Cartesian3.fromDegrees(n.east,n.north),this.Cesium.Cartesian3.fromDegrees(n.west,n.north)]}return[]}addDragHandler(e,t){if(console.log("移动线段"),this._dragHandler){try{this._dragHandler.destroy()}catch{}this._dragHandler=null}let n=!1,s,o=0;const r=16,l=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);this._dragHandler=l;const c=d=>{let h;try{h=this.viewer.scene.pickPosition(d)}catch{}if(!this.Cesium.defined(h)){const f=this.viewer.camera.getPickRay(d);f&&(h=this.viewer.scene.globe.pick(f,this.viewer.scene))}return this.Cesium.defined(h)||(h=this.viewer.scene.camera.pickEllipsoid(d,this.viewer.scene.globe.ellipsoid)),h};l.setInputAction(d=>{let h=!1;const f=this.viewer.scene.drillPick(d.position)||[];for(let m=0;m<f.length;m++){const u=f[m].id;if(u&&u===this.centerHandle){h=!0;break}}if(h){n=!0;const m=c(d.position);this.Cesium.defined(m)&&(s=m.clone()),o=performance.now(),this.viewer.scene.screenSpaceCameraController.enableRotate=!1,this.viewer.scene.screenSpaceCameraController.enableTranslate=!1,this.viewer.scene.screenSpaceCameraController.enableZoom=!1,this.viewer.scene.screenSpaceCameraController.enableTilt=!1,this.viewer.scene.screenSpaceCameraController.enableLook=!1}},this.Cesium.ScreenSpaceEventType.LEFT_DOWN),l.setInputAction(d=>{if(!n||!this.Cesium.defined(s))return;const h=performance.now();if(h-o<r)return;o=h;const f=c(d.endPosition);if(!this.Cesium.defined(f))return;const m=this.Cesium.Cartesian3.subtract(f,s,new this.Cesium.Cartesian3);if(this.centerHandle&&this.centerHandle.position&&this.centerHandle.position.setValue){const u=this.centerHandle.position.getValue(this.Cesium.JulianDate.now());if(u){const g=this.Cesium.Cartesian3.add(u,m,new this.Cesium.Cartesian3);this.centerHandle.position.setValue(g)}}this.moveEntity(e,m);try{this.viewer.scene.requestRender()}catch{}s=f.clone()},this.Cesium.ScreenSpaceEventType.MOUSE_MOVE),l.setInputAction(()=>{if(n){n=!1,this.viewer.scene.screenSpaceCameraController.enableRotate=!0,this.viewer.scene.screenSpaceCameraController.enableTranslate=!0,this.viewer.scene.screenSpaceCameraController.enableZoom=!0,this.viewer.scene.screenSpaceCameraController.enableTilt=!0,this.viewer.scene.screenSpaceCameraController.enableLook=!0;const d=e.getEntity();if(d.state="done",d&&d.rectangle&&d.rectangle.coordinates)try{const h=d.rectangle.coordinates.getValue?d.rectangle.coordinates.getValue():d.rectangle.coordinates;h&&d.rectangle.coordinates.setValue(h)}catch(h){console.warn("Failed to refresh rectangle coordinates",h)}e&&this.selectedEntityObj!==e&&this.showEntityOutline(e)}},this.Cesium.ScreenSpaceEventType.LEFT_UP)}moveEntity(e,t){const n=e.getEntity();if(!n)return;const s=o=>this.Cesium.Cartesian3.add(o,t,new this.Cesium.Cartesian3);if(n.position){const o=n.position.getValue?n.position.getValue():n.position,r=s(o);n.position.setValue?n.position.setValue(r):n.position=r,n.state="moving",e.positions&&e.positions.length===1&&(e.positions[0]=r);return}if(n.polyline){if(n._plotInstance&&n._plotInstance.type==="rectangle"&&typeof n._plotInstance.updatePositions=="function")try{const l=new this.Cesium.Cartesian3(t.x,t.y,t.z);if(n._plotInstance.updatePositions([l]))return}catch(l){console.warn("Failed to update rectangle positions:",l)}if(n._plotInstance&&n._plotInstance.type==="circle"&&typeof n._plotInstance.updatePositions=="function")try{const l=new this.Cesium.Cartesian3(t.x,t.y,t.z);if(n._plotInstance.updatePositions([l]))return}catch(l){console.warn("Failed to update circle positions:",l)}const r=(e.positions&&Array.isArray(e.positions)?e.positions:n.polyline.positions.getValue?n.polyline.positions.getValue():[]).map(l=>s(l));if(e.updatePositions&&typeof e.updatePositions=="function")e.updatePositions(r);else if(e.positions&&Array.isArray(e.positions)&&(e.positions=r),n.polyline&&n.polyline.positions)try{n.polyline.positions instanceof this.Cesium.CallbackProperty||(n.polyline.positions=r)}catch{n.polyline.positions=r}}}startFreehandLine(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"freehandLine",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t,smoothness:2,minDistance:.01,angleThreshold:.8,renderInterval:16,curveResolution:3},e)})}startArrow(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"arrow",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t},e)})}startStraightLine(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"polyline",style:Object.assign({color:this.currentColor,width:this.currentWidth,clampToGround:!t},e)})}startEllipse(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"circle",style:Object.assign({color:this.currentColor.withAlpha(1),outlineColor:this.currentColor,outlineWidth:this.currentWidth,outline:!0,fill:!1,clampToGround:!t},e)})}startImage(e,t){this.initDrawTool();const n=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"billboard",style:Object.assign({image:e,width:t&&t.width?t.width:50,height:t&&t.height?t.height:50,clampToGround:!n},t)})}startRectangle(e={}){this.initDrawTool();const t=this.viewer.scene.mode===this.Cesium.SceneMode.SCENE2D;return this.drawTool.start({type:"rectangle",style:Object.assign({color:this.currentColor.withAlpha(1),outlineColor:this.currentColor,outlineWidth:this.currentWidth,clampToGround:!t},e)})}clearAll(){this.drawTool&&this.drawTool.removeAll(),this.hideEntityOutline()}destroy(){this.clearAll(),this.originalDoubleClickAction&&(this.viewer.screenSpaceEventHandler.setInputAction(this.originalDoubleClickAction,this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.originalDoubleClickAction=null)}getAllEntities(){return this.drawTool&&typeof this.drawTool.getEntityObjArr=="function"?this.drawTool.getEntityObjArr():[]}saveAnnotations(){try{const e=this.getAllEntities(),t={freehand:[],arrow:[],text:[],image:[],polyline:[],rectangle:[],ellipse:[],other:[]};e.forEach(o=>{if(o&&typeof o=="object"){const r=o.type||o.constructor&&o.constructor.name,l={type:r,style:{}};switch(!0){case["freehandLine","CreateFreehandLine","polyline","CreatePolyline","arrow","CreateArrow"].includes(r):l.id=o.objId||o.id||Date.now().toString(),o.style&&(l.style={color:o.style.color,width:o.style.width,opacity:o.style.opacity,...o.style}),o.positions&&Array.isArray(o.positions)&&(l.positions=o.positions.map(c=>c&&typeof c=="object"&&c.x!==void 0&&c.y!==void 0&&c.z!==void 0?{x:c.x,y:c.y,z:c.z}:c)),["freehandLine","CreateFreehandLine"].includes(r)&&(l.isEdit=o.isEdit!==void 0?o.isEdit:!0,l.isFreehand=!0);break;case["rectangle","CreateRectangle"].includes(r):try{l.id=o.objId||o.id||Date.now().toString();let c=[];if(o.positions&&Array.isArray(o.positions)&&o.positions.length)c=o.positions.map(d=>({x:d.x,y:d.y,z:d.z}));else{const d=o.getEntity?o.getEntity():o;if(d)try{if(d.polyline&&d.polyline.positions&&d.polyline.positions.getValue){const h=d.polyline.positions.getValue(this.viewer.clock.currentTime);Array.isArray(h)&&(c=h.map(f=>({x:f.x,y:f.y,z:f.z})))}else if(d.rectangle&&d.rectangle.coordinates&&d.rectangle.coordinates.getValue){const h=d.rectangle.coordinates.getValue(this.viewer.clock.currentTime);c=[{west:h.west,south:h.south,east:h.east,north:h.north}]}}catch{}}o.style&&(l.style=Object.assign({},o.style)),c&&c.length&&(l.positions=c)}catch{}break;case["ellipse","CreateEllipse","circle","CreateCircle"].includes(r):try{l.id=o.objId||o.id||Date.now().toString();let c=[];const d=o.getEntity?o.getEntity():o;if(d&&d._plotInstance&&d._plotInstance.type==="circle"&&d._plotInstance.center&&d._plotInstance.radiusPoint){const h=d._plotInstance;c=[{x:h.center.x,y:h.center.y,z:h.center.z},{x:h.radiusPoint.x,y:h.radiusPoint.y,z:h.radiusPoint.z}]}else if(o.positions&&Array.isArray(o.positions)&&o.positions.length)c=o.positions.map(h=>({x:h.x,y:h.y,z:h.z}));else if(d)try{if(d.polyline&&d.polyline.positions&&d.polyline.positions.getValue){const h=d.polyline.positions.getValue(this.viewer.clock.currentTime);Array.isArray(h)&&(c=h.map(f=>({x:f.x,y:f.y,z:f.z})))}else if(d.ellipse&&d.ellipse.center&&d.ellipse.center.getValue&&d.ellipse.semiMajorAxis&&d.ellipse.semiMajorAxis.getValue){const h=d.ellipse.center.getValue(this.viewer.clock.currentTime),f=d.ellipse.semiMajorAxis.getValue(this.viewer.clock.currentTime);if(h&&f){const m={x:h.x,y:h.y,z:h.z||0},u={x:m.x+f,y:m.y,z:m.z};c=[m,u]}}}catch{}o.style&&(l.style=Object.assign({},o.style)),c&&c.length&&(l.positions=c)}catch{}break;case["label","CreateLabel"].includes(r):if(o.style)l.style=Object.assign({},o.style);else try{const c=o.getEntity?o.getEntity():o;if(c&&c.label){const d={};try{const h=c.label.fillColor&&c.label.fillColor.getValue?c.label.fillColor.getValue(this.viewer.clock.currentTime):c.label.fillColor;h&&(d.color=h)}catch{}c.label.font&&(d.font=c.label.font),l.style=d}}catch{}if(o.text)l.text=o.text;else try{const c=o.getEntity?o.getEntity():o;if(c&&c.label&&c.label.text){const d=c.label.text.getValue?c.label.text.getValue(this.viewer.clock.currentTime):c.label.text;d&&(l.text=d)}}catch{}if(o.position)l.position=o.position;else try{const c=o.getEntity?o.getEntity():o;if(c&&c.position&&c.position.getValue){const d=c.position.getValue(this.viewer.clock.currentTime);d&&(l.position={x:d.x,y:d.y,z:d.z})}}catch{}break;case["billboard","CreateBillboard"].includes(r):if(o.style)l.style=Object.assign({},o.style);else try{const c=o.getEntity?o.getEntity():o;if(c&&c.billboard){const d={};try{const h=c.billboard.image&&c.billboard.image.getValue?c.billboard.image.getValue(this.viewer.clock.currentTime):c.billboard.image;if(h){if(typeof h=="string")d.image=h;else if(h&&h.src)try{const f=h;if(typeof document<"u"&&f instanceof HTMLImageElement){const m=document.createElement("canvas");m.width=f.naturalWidth||f.width||1,m.height=f.naturalHeight||f.height||1;const u=m.getContext("2d");u?(u.drawImage(f,0,0),d.image=m.toDataURL()):d.image=f.src}else d.image=h.src}catch{d.image=h.src}}}catch{}c.billboard.width&&(d.width=c.billboard.width),c.billboard.height&&(d.height=c.billboard.height),l.style=d}}catch{}if(o.position)l.position=o.position;else try{const c=o.getEntity?o.getEntity():o;if(c&&c.position&&c.position.getValue){const d=c.position.getValue(this.viewer.clock.currentTime);d&&(l.position={x:d.x,y:d.y,z:d.z})}}catch{}break;default:o.style&&(l.style=o.style),o.position&&(l.position=o.position);break}switch(!0){case["freehandLine","CreateFreehandLine"].includes(r):t.freehand.push(l);break;case["arrow","CreateArrow"].includes(r):t.arrow.push(l);break;case["label","CreateLabel"].includes(r):t.text.push(l);break;case["billboard","CreateBillboard"].includes(r):t.image.push(l);break;case["polyline","CreatePolyline"].includes(r):t.polyline.push(l);break;case["rectangle","CreateRectangle"].includes(r):t.rectangle.push(l);break;case["ellipse","CreateEllipse","circle","CreateCircle"].includes(r):t.ellipse.push(l);break;default:t.other.push(l)}}});const n={version:"1.0",exportTime:new Date().toISOString(),totalEntities:e.length,annotations:t},s=JSON.stringify(n);return console.log("标注数据已按类型分类保存,只包含重绘所需信息:",s),s}catch(e){return console.error("保存标注失败:",e),!1}}loadAnnotations(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(!t.annotations)return console.error("标注数据格式错误,缺少annotations字段"),!1;const n=t.annotations;let s=0;const o=(r,l)=>{Array.isArray(r)&&r.forEach(c=>{if(c.style){if(c.style.color&&typeof c.style.color=="object"){const d=c.style.color;c.style.color=`rgba(${Math.round(d.red*255)}, ${Math.round(d.green*255)}, ${Math.round(d.blue*255)}, ${d.alpha||1})`}if(c.style.outlineColor&&typeof c.style.outlineColor=="object"){const d=c.style.outlineColor;c.style.outlineColor=`rgba(${Math.round(d.red*255)}, ${Math.round(d.green*255)}, ${Math.round(d.blue*255)}, ${d.alpha||1})`}}switch(l){case"freehand":case"polyline":case"arrow":if(c.positions&&c.positions.length>0){const d=c.positions.map(m=>m&&typeof m=="object"?new this.Cesium.Cartesian3(m.x,m.y,m.z):m),h={type:l==="freehand"?"freehandLine":l,style:c.style||{},positions:d,id:c.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))},f=this.drawTool.createByPositions(h);if(f&&f.getEntity()){s++,f.isEdit=!0;const m=f.getEntity();m&&!m._plotInstance&&(m._plotInstance=f),m&&!m.objId&&(m.objId=f.objId),console.log(`Loaded ${l} entity with objId: ${f.objId}`)}}break;case"rectangle":{try{if(c.positions&&c.positions.length){let d=[];if(c.positions[0]&&c.positions[0].x!==void 0)d=c.positions.map(h=>new this.Cesium.Cartesian3(h.x,h.y,h.z!==void 0?h.z:0));else if(c.positions[0]&&c.positions[0].west!==void 0){const h=c.positions[0];d=[this.Cesium.Cartesian3.fromRadians(h.west,h.south),this.Cesium.Cartesian3.fromRadians(h.east,h.south),this.Cesium.Cartesian3.fromRadians(h.east,h.north),this.Cesium.Cartesian3.fromRadians(h.west,h.north),this.Cesium.Cartesian3.fromRadians(h.west,h.south)]}if(d.length){const h=JSON.parse(JSON.stringify(c.style||{}));if(h.color&&typeof h.color=="string"&&!h.color.startsWith("rgba"))try{const u=JSON.parse(h.color);u.red!==void 0&&(h.color=`rgba(${Math.round(u.red*255)}, ${Math.round(u.green*255)}, ${Math.round(u.blue*255)}, ${u.alpha||1})`)}catch{}const f={type:"rectangle",positions:d,style:h,id:c.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let m=null;try{m=this.drawTool.createByPositions(f)}catch(u){console.warn("drawTool.createByPositions(rectangle) failed",u)}if(m){s++,m.isEdit=!0;const u=m.getEntity?m.getEntity():m.entity||m;u&&(u._plotInstance=m,u.objId=m.objId||c.id,u.pickable=!0,u.polyline&&(u.polyline.pickWidth=10),console.log(`Loaded rectangle entity with objId: ${u.objId}, color: ${h.color}`))}}}}catch(d){console.warn("load rectangle failed",d)}break}case"text":if(c.position){const d=c.text||"文字标注",h={type:"label",style:c.style||{},text:d,position:new this.Cesium.Cartesian3(c.position.x,c.position.y,c.position.z||0)};h.style.fontSize||(h.style.fontSize=14),h.style.fontFamily||(h.style.fontFamily="Arial");let f;try{!h.positions&&h.position&&(h.positions=h.position),f=this.drawTool.createByPositions(h),!f&&this.drawTool.startText&&(console.log("使用startText创建文字"),this.drawTool.startText(h.style),this.drawTool.currentEntity&&(this.drawTool.currentEntity.text=d,this.drawTool.currentEntity.position=h.position,f=this.drawTool.currentEntity))}catch(m){console.log("创建文字失败",m)}if(!f)try{const m=this.viewer.entities.add({position:h.position,label:Object.assign({text:d,font:h.style&&h.style.font||"14pt Source Han Sans CN",fillColor:h.style&&h.style.fillColor||this.Cesium.Color.WHITE,outlineColor:h.style&&h.style.outlineColor||this.Cesium.Color.BLACK,outlineWidth:h.style&&h.style.outlineWidth||2,verticalOrigin:h.style&&h.style.verticalOrigin||this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:h.style&&h.style.pixelOffset||new this.Cesium.Cartesian2(0,-10)},h.style&&h.style.label?h.style.label:{})}),u={getEntity:()=>m,entity:m,style:h.style||{},type:"label",objId:c.id||`label_${Date.now()}_${Math.random().toFixed(3)}`,isEdit:!0,destroy:()=>this.viewer.entities.remove(m)};try{m.objId=u.objId}catch{}this.drawTool&&(this.drawTool.entityObjArr||(this.drawTool.entityObjArr=[]),this.drawTool.entityObjArr.push(u)),f=u}catch(m){console.warn("回退创建文字实体失败",m)}f&&(s++,f.isEdit=!0)}break;case"image":if(c.position){const d={type:"billboard",style:c.style||{},position:new this.Cesium.Cartesian3(c.position.x,c.position.y,c.position.z||0)};d.style.image||(console.log("使用默认图片占位符"),d.style.image="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDUwIDUwIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNlNTMyMzIiLz48L3N2Zz4="),d.style.width||(d.style.width=50),d.style.height||(d.style.height=50);let h;try{!d.positions&&d.position&&(d.positions=d.position),h=this.drawTool.createByPositions(d),!h&&this.drawTool.startImage&&(console.log("使用startImage创建图片"),this.drawTool.startImage(d.style.image,d.style),this.drawTool.currentEntity&&(this.drawTool.currentEntity.position=d.position,h=this.drawTool.currentEntity))}catch(f){console.log("创建图片失败",f)}if(!h)try{const f=d.style&&d.style.image?d.style.image:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MCIgaGVpZ2h0PSI1MCIgdmlld0JveD0iMCAwIDUwIDUwIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNlNTMyMzIiLz48L3N2Zz4=",m=this.viewer.entities.add({position:d.position,billboard:{image:f,width:d.style&&d.style.width?d.style.width:50,height:d.style&&d.style.height?d.style.height:50,verticalOrigin:d.style&&d.style.verticalOrigin||this.Cesium.VerticalOrigin.CENTER,scale:d.style&&d.style.scale||1}}),u={getEntity:()=>m,entity:m,style:d.style||{},type:"billboard",objId:c.id||`billboard_${Date.now()}_${Math.random().toFixed(3)}`,isEdit:!0,destroy:()=>this.viewer.entities.remove(m)};try{m.objId=u.objId}catch{}this.drawTool&&(this.drawTool.entityObjArr||(this.drawTool.entityObjArr=[]),this.drawTool.entityObjArr.push(u)),h=u}catch(f){console.warn("回退创建图片实体失败",f)}h&&(s++,h.isEdit=!0)}break;case"ellipse":case"circle":{try{const d=JSON.parse(JSON.stringify(c.style||{}));if(d.color&&typeof d.color=="string"&&!d.color.startsWith("rgba"))try{const m=JSON.parse(d.color);m.red!==void 0&&(d.color=`rgba(${Math.round(m.red*255)}, ${Math.round(m.green*255)}, ${Math.round(m.blue*255)}, ${m.alpha||1})`)}catch{}let h=[],f=!1;if(c.positions&&c.positions.length&&(c.positions[0]&&c.positions[0].x!==void 0&&(h=c.positions.map(m=>new this.Cesium.Cartesian3(m.x,m.y,m.z!==void 0?m.z:0))),h.length)){const m={type:l,positions:h,style:d,id:c.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let u=null;try{if(u=this.drawTool.createByPositions(m),u){s++,u.isEdit=!0;const g=u.getEntity?u.getEntity():u.entity||u;g&&(g._plotInstance=u,g.objId=u.objId||c.id,g.pickable=!0,g.polyline&&(g.polyline.pickWidth=10),console.log(`Loaded ${l} entity with objId: ${g.objId} using positions`)),f=!0}}catch(g){console.warn(`drawTool.createByPositions(${l}) failed`,g)}}if(!f&&c.center&&c.radius)try{const m=new this.Cesium.Cartesian3(c.center.x,c.center.y,c.center.z||0),u=this.Cesium.Cartesian3.add(m,new this.Cesium.Cartesian3(c.radius,0,0),new this.Cesium.Cartesian3),A={type:l,positions:[m,u],style:d,id:c.id||+(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0))};let p=null;try{if(p=this.drawTool.createByPositions(A),p){s++,p.isEdit=!0;const y=p.getEntity?p.getEntity():p.entity||p;y&&(y._plotInstance=p,y.objId=p.objId||c.id,y.pickable=!0,y.polyline&&(y.polyline.pickWidth=10),console.log(`Loaded ${l} entity with objId: ${y.objId} using center and radius`))}}catch(y){console.warn(`drawTool.createByPositions(${l}) with center/radius failed`,y)}}catch(m){console.warn(`Fallback creation for ${l} failed`,m)}}catch(d){console.warn(`load ${l} failed`,d)}break}default:console.log(`尝试加载未知类型实体: ${l}`);break}})};return Object.keys(n).forEach(r=>{o(n[r],r)}),console.log(`成功加载 ${s} 个标注实体`),this.drawTool&&typeof this.drawTool.bindEdit=="function"&&this.drawTool.bindEdit(),!0}catch(t){return console.error("加载标注失败:",t),!1}}changeEntityColor(e){try{if(!this.selectedEntityObj)return!1;if(this.selectedEntityObj.setStyle&&typeof this.selectedEntityObj.setStyle=="function")try{return this.selectedEntityObj.setStyle({color:e}),console.log("通过实体对象的setStyle方法修改颜色成功"),!0}catch(s){console.warn("通过setStyle修改颜色失败,尝试直接修改实体:",s)}const t=this.selectedEntityObj.getEntity();if(!t)return!1;let n;try{n=this.Cesium.Color.fromCssColorString(e)}catch(s){console.warn("Invalid color format:",e,s),n=e}if(t.polyline)try{t.polyline.material=new this.Cesium.ColorMaterialProperty(n)}catch{t.polyline.material=n}else if(t.polygon)try{t.polygon.material=new this.Cesium.ColorMaterialProperty(n)}catch{t.polygon.material=n}else if(t.rectangle){const s=t.rectangle.outline,o=t.rectangle.outlineWidth;try{t.rectangle.material=new this.Cesium.ColorMaterialProperty(n)}catch{t.rectangle.material=n}t.rectangle.outlineColor=n,s!==void 0&&(t.rectangle.outline=s),o!==void 0&&(t.rectangle.outlineWidth=o)}else if(t.ellipse||t.circle){const s=t.ellipse||t.circle,o=s.outline,r=s.outlineColor,l=s.outlineWidth;s.material=n,o!==void 0&&(s.outline=o),r!==void 0&&(s.outlineColor=r),l!==void 0&&(s.outlineWidth=l)}return!0}catch(t){return console.error("changeEntityColor failed",t),!1}}changeColor(e){return this.changeEntityColor(e)}setLineWidth(e){if(!this.selectedEntityObj)return!1;const t=this.selectedEntityObj.getEntity();let n=2;if(typeof e=="number")n=e;else switch(e){case"thin":n=2;break;case"medium":n=4;break;case"thick":n=8;break}if(t.polyline)t.polyline.width=n;else if(t.polygon&&t.polygon.outline)t.polygon.outlineWidth=n;else if(t.rectangle&&t.rectangle.outline)t.rectangle.outlineWidth=n;else if((t.ellipse||t.circle)&&(t.ellipse?.outline||t.circle?.outline)){const s=t.ellipse||t.circle;s.outlineWidth=n}return!0}changeWidth(e){return this.setLineWidth(e)}deleteSelectedEntity(){if(!this.selectedEntityObj)return!1;if(typeof this.drawTool.removeOne=="function")this.drawTool.removeOne(this.selectedEntityObj);else if(typeof this.drawTool.remove=="function")this.drawTool.remove(this.selectedEntityObj);else return console.error("No remove method found on drawTool"),!1;return this.selectedEntityObj=null,this.hideEntityOutline(),!0}}class Ca{viewer;cesium;handler=null;measureEntities=[];originalDoubleClickAction=null;onMeasure=()=>{};activePoints=[];floatingPoint=null;activeShape=null;type=null;unit="m";cursorPosition=null;isSnapping=!1;snapIndicator=null;isMobile=!1;lastTapTime=0;tapTimeout=null;originalPickEnabled=!0;constructor({viewer:e,cesium:t}){this.viewer=e,this.cesium=t,this.isMobile="ontouchstart"in window||navigator.maxTouchPoints>0;const n=this.cesium;this.originalDoubleClickAction=this.viewer.screenSpaceEventHandler.getInputAction(n.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.viewer.screenSpaceEventHandler.removeInputAction(n.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}setUnit(e){this.unit=e}setSnapping(e){this.isSnapping=e,!e&&this.snapIndicator&&(this.viewer.entities.remove(this.snapIndicator),this.snapIndicator=null)}start(e){const t=this.cesium;this.clearActive(),this.type=e,this.viewer.scene&&this.viewer.scene.screenSpaceCameraController&&(this.originalPickEnabled=this.viewer.scene.screenSpaceCameraController.enableInputs),this.handler=new t.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.handler.setInputAction(n=>{if(this.isMobile&&this.type==="area"){const s=Date.now(),o=s-this.lastTapTime;if(this.lastTapTime=s,o<300&&o>0){this.tapTimeout&&(clearTimeout(this.tapTimeout),this.tapTimeout=null),this.finish();return}this.tapTimeout=setTimeout(()=>{const r=this.getPickPosition(n.position);r&&this.addPoint(r),this.tapTimeout=null},300)}else{const s=this.getPickPosition(n.position);s&&this.addPoint(s)}},t.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(n=>{const s=this.getPickPosition(n.endPosition);s&&(this.cursorPosition=s,this.updateFloatingPoint(s))},t.ScreenSpaceEventType.MOUSE_MOVE),this.type==="area"&&!this.isMobile&&this.handler.setInputAction(()=>{this.finish()},t.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}addPoint(e){const t=this.cesium;this.activePoints.push(e);const n=this.viewer.entities.add({position:e,point:{pixelSize:8,color:t.Color.YELLOW,outlineColor:t.Color.BLACK,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(this.measureEntities.push(n),this.type==="distance"){if(this.activePoints.length===1)this.onMeasure(null),this.activeShape=this.viewer.entities.add({polyline:{positions:new t.CallbackProperty(()=>{if(this.activePoints.length===0)return[];const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}}),this.measureEntities.push(this.activeShape);else if(this.activePoints.length===2){const s=this.activePoints[0],o=this.activePoints[1];this.activeShape&&(this.viewer.entities.remove(this.activeShape),this.activeShape=null);const r=this.viewer.entities.add({polyline:{positions:[s,o],width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}});this.measureEntities.push(r);const l=t.Cartesian3.distance(s,o),c=t.Cartesian3.midpoint(s,o,new t.Cartesian3);this.addLabel(c,this.formatDistance(l));const d=t.Transforms.eastNorthUpToFixedFrame(s),h=t.Matrix4.inverse(d,new t.Matrix4),f=t.Matrix4.multiplyByPoint(h,o,new t.Cartesian3),m=f.x,u=f.y,g=f.z,A=t.Matrix4.getColumn(d,0,new t.Cartesian3),p=t.Matrix4.getColumn(d,1,new t.Cartesian3),y=t.Cartesian3.multiplyByScalar(A,m,new t.Cartesian3),C=t.Cartesian3.add(s,y,new t.Cartesian3),I=t.Cartesian3.multiplyByScalar(p,u,new t.Cartesian3),P=t.Cartesian3.add(C,I,new t.Cartesian3);if(this.viewer.scene.mode!==t.SceneMode.SCENE2D){const k=this.viewer.entities.add({polyline:{positions:[s,C],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.RED}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(1,0,0,.5)})}}),M=this.viewer.entities.add({polyline:{positions:[C,P],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.GREEN}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(0,1,0,.5)})}}),B=this.viewer.entities.add({polyline:{positions:[P,o],width:2,material:new t.PolylineDashMaterialProperty({color:t.Color.BLUE}),depthFailMaterial:new t.PolylineDashMaterialProperty({color:new t.Color(0,0,1,.5)})}});this.measureEntities.push(k,M,B)}this.onMeasure({type:"distance",dx:m,dy:u,dz:g,dist:l}),this.activePoints=[]}}else if(this.type==="angle"){if(this.activePoints.length===1)this.onMeasure(null);else if(this.activePoints.length===2)this.activeShape=this.viewer.entities.add({polyline:{positions:new t.CallbackProperty(()=>{if(this.activePoints.length<2)return[];const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}}),this.measureEntities.push(this.activeShape);else if(this.activePoints.length===3){const s=this.activePoints[0],o=this.activePoints[1],r=this.activePoints[2];if(this.activeShape){this.viewer.entities.remove(this.activeShape);const c=this.viewer.entities.add({polyline:{positions:[s,o,r],width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW}});this.measureEntities.push(c)}const l=this.calculateAngle(s,o,r);this.addLabel(o,`${l.toFixed(1)}°`),this.onMeasure({type:"angle",angle:l}),this.finish()}}else this.type==="area"&&this.activePoints.length===1&&(this.onMeasure(null),this.activeShape=this.viewer.entities.add({polygon:{hierarchy:new t.CallbackProperty(()=>{if(this.activePoints.length===0)return new t.PolygonHierarchy([]);const s=[...this.activePoints];return this.cursorPosition&&s.push(this.cursorPosition),new t.PolygonHierarchy(s)},!1),material:t.Color.YELLOW.withAlpha(.3),perPositionHeight:!0,outline:!0,outlineColor:t.Color.YELLOW,outlineWidth:2},polyline:{positions:new t.CallbackProperty(()=>{const s=[...this.activePoints];return this.cursorPosition&&(s.push(this.cursorPosition),s.push(s[0])),s},!1),width:2,material:t.Color.YELLOW,depthFailMaterial:t.Color.YELLOW,clampToGround:!1}}),this.measureEntities.push(this.activeShape))}updateFloatingPoint(e){const t=this.cesium;this.floatingPoint||(this.floatingPoint=this.viewer.entities.add({position:new t.CallbackProperty(()=>this.cursorPosition,!1),point:{pixelSize:5,color:t.Color.RED,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))}finish(){const e=this.cesium;if(this.type==="distance"&&this.activePoints.length>1){let t=0;for(let s=0;s<this.activePoints.length-1;s++)t+=e.Cartesian3.distance(this.activePoints[s],this.activePoints[s+1]);const n=this.activePoints[this.activePoints.length-1];this.addLabel(n,`Total: ${this.formatDistance(t)}`)}else if(this.type==="area"&&this.activePoints.length>=3){const t=this.calculateArea(this.activePoints),n=this.calculateCenter(this.activePoints);this.addLabel(n,`面积: ${this.formatArea(t)}`),this.onMeasure({type:"area",area:t})}this.clearActive()}clearAll(){this.clear(),this.onMeasure(null)}clear(){this.clearActive(),this.measureEntities.forEach(e=>this.viewer.entities.remove(e)),this.measureEntities=[]}stop(){this.clearActive(),this.onMeasure(null)}destroy(){if(this.clear(),this.originalDoubleClickAction){const e=this.cesium;this.viewer.screenSpaceEventHandler.setInputAction(this.originalDoubleClickAction,e.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.originalDoubleClickAction=null}}clearActive(){const e=this.cesium;if(this.handler&&(this.handler.destroy(),this.handler=null),this.tapTimeout&&(clearTimeout(this.tapTimeout),this.tapTimeout=null),this.lastTapTime=0,this.viewer.scene&&this.viewer.scene.screenSpaceCameraController&&!this.originalPickEnabled&&(this.viewer.scene.screenSpaceCameraController.enableInputs=!0),this.floatingPoint&&(this.viewer.entities.remove(this.floatingPoint),this.floatingPoint=null),this.snapIndicator&&(this.viewer.entities.remove(this.snapIndicator),this.snapIndicator=null),this.activeShape){if(this.type==="distance"){const t=[...this.activePoints];this.viewer.entities.remove(this.activeShape);const n=this.viewer.entities.add({polyline:{positions:t,width:2,material:e.Color.YELLOW,depthFailMaterial:e.Color.YELLOW}});this.measureEntities.push(n)}else if(this.type==="area"){const t=[...this.activePoints];this.viewer.entities.remove(this.activeShape);const n=this.viewer.entities.add({polygon:{hierarchy:new e.PolygonHierarchy(t),material:e.Color.YELLOW.withAlpha(.3),perPositionHeight:!0,outline:!0,outlineColor:e.Color.YELLOW,outlineWidth:2},polyline:{positions:[...t,t[0]],width:2,material:e.Color.YELLOW,depthFailMaterial:e.Color.YELLOW}});this.measureEntities.push(n)}this.activeShape=null}this.activePoints=[],this.type=null,this.cursorPosition=null}getPickPosition(e){const t=this.cesium;let n;try{n=this.viewer.scene.pickPosition(e)}catch{}if(!n||!t.defined(n)){const s=this.viewer.camera.getPickRay(e);s&&(n=this.viewer.scene.globe.pick(s,this.viewer.scene))}if((!n||!t.defined(n))&&(n=this.viewer.scene.camera.pickEllipsoid(e,this.viewer.scene.globe.ellipsoid)),!n||!t.defined(n))return null;if(this.isSnapping){const s=this.snapToVertex(e);if(s)n=s;else{const o=this.snapTo3DTileFeature(e);o&&(n=o)}}return this.isSnapping&&(this.snapIndicator||(this.snapIndicator=this.viewer.entities.add({position:new t.CallbackProperty(()=>this.cursorPosition,!1),point:{pixelSize:10,color:t.Color.GREEN.withAlpha(.5),outlineColor:t.Color.GREEN,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))),n}snapTo3DTileFeature(e){const t=this.cesium,n=10,s=[{x:0,y:0},{x:-n,y:0},{x:n,y:0},{x:0,y:-n},{x:0,y:n},{x:-n,y:-n},{x:n,y:-n},{x:-n,y:n},{x:n,y:n}];for(let o=0;o<s.length;o++){const r=s[o];if(!r)continue;const l=new t.Cartesian2(e.x+r.x,e.y+r.y);let c=null;try{c=this.viewer.scene.pick(l)}catch{}if(t.defined(c)&&(c instanceof t.Cesium3DTileFeature||c.primitive&&c.primitive instanceof t.PointPrimitive))try{const d=this.viewer.scene.pickPosition(l);if(d)return d}catch{}}return null}snapToVertex(e){const t=this.cesium,n=this.viewer.entities.values;let s=20,o=null;for(let r=0;r<n.length;r++){const l=n[r];if(!l.show)continue;let c=[];if(l.polyline&&l.polyline.positions){const d=l.polyline.positions.getValue(t.JulianDate.now());d&&(c=d)}else if(l.polygon&&l.polygon.hierarchy){const d=l.polygon.hierarchy.getValue(t.JulianDate.now());d&&d.positions&&(c=d.positions)}else if(l.position){const d=l.position.getValue(t.JulianDate.now());d&&(c=[d])}else if(l.rectangle&&l.rectangle.coordinates){const d=l.rectangle.coordinates.getValue(t.JulianDate.now());d&&(c=[t.Cartesian3.fromRadians(d.west,d.south),t.Cartesian3.fromRadians(d.east,d.south),t.Cartesian3.fromRadians(d.east,d.north),t.Cartesian3.fromRadians(d.west,d.north)])}for(let d=0;d<c.length;d++){const h=c[d];try{const f=this.viewer.scene.cartesianToCanvasCoordinates(h);if(f){const m=t.Cartesian2.distance(f,e);m<s&&(s=m,o=h)}}catch{}}}return o}addLabel(e,t){const n=this.cesium,s=this.viewer.entities.add({position:e,label:{text:t,font:"14px sans-serif",fillColor:n.Color.WHITE,style:n.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:n.VerticalOrigin.BOTTOM,pixelOffset:new n.Cartesian2(0,-10),disableDepthTestDistance:Number.POSITIVE_INFINITY,showBackground:!0,backgroundColor:new n.Color(0,0,0,.5)}});this.measureEntities.push(s)}formatDistance(e){return this.unit==="mm"?`${(e*1e3).toFixed(0)}mm`:this.unit==="cm"?`${(e*100).toFixed(1)}cm`:`${e.toFixed(2)}m`}calculateAngle(e,t,n){const s=this.cesium,o=s.Cartesian3.subtract(e,t,new s.Cartesian3),r=s.Cartesian3.subtract(n,t,new s.Cartesian3);s.Cartesian3.normalize(o,o),s.Cartesian3.normalize(r,r);const l=s.Cartesian3.dot(o,r),c=Math.max(-1,Math.min(1,l)),d=Math.acos(c);return s.Math.toDegrees(d)}calculateArea(e){const t=this.cesium;if(e.length<3)return 0;const n=e[0],s=new t.Cartesian3(0,0,0);for(let o=1;o<e.length-1;o++){const r=e[o],l=e[o+1],c=t.Cartesian3.subtract(r,n,new t.Cartesian3),d=t.Cartesian3.subtract(l,n,new t.Cartesian3),h=t.Cartesian3.cross(c,d,new t.Cartesian3);t.Cartesian3.add(s,h,s)}return t.Cartesian3.magnitude(s)*.5}calculateCenter(e){const t=this.cesium;if(!e||e.length===0)return null;let n=0,s=0,o=0;for(let r=0;r<e.length;r++)n+=e[r].x,s+=e[r].y,o+=e[r].z;return new t.Cartesian3(n/e.length,s/e.length,o/e.length)}formatArea(e){return e>1e6?`${(e/1e6).toFixed(2)} km²`:`${e.toFixed(2)} m²`}}const _e=a.reactive({visible:!1,type:"info",title:"",description:"",closable:!1,showIcon:!0,duration:3});let Be=null,Qd=null,Hd=!1,va=null,Ps=null,ba=null;function o2(){if(Ps||typeof document>"u")return;const i=`
30
33
  .tech-alert-wrapper {
31
34
  position: absolute;
32
35
  top: 20px;
@@ -95,7 +98,7 @@
95
98
  from { transform: rotate(0deg); }
96
99
  to { transform: rotate(360deg); }
97
100
  }
98
- `;di=document.createElement("style"),di.textContent=n,document.head.appendChild(di)}function by(){if(ll)return;Ey(),Ce=document.createElement("div"),Ce.className="tech-alert-wrapper",(Fs||document.body).appendChild(Ce);const e={setup(){return()=>ve.visible?o.h(ie.Alert,{class:`tech-alert tech-alert-${ve.type}`,message:ve.title,description:ve.description,showIcon:ve.showIcon,closable:ve.closable,onClose:()=>{ve.visible=!1}},{icon:()=>ve.type==="loading"?o.h(qt.LoadingOutlined):ve.type==="success"?o.h(qt.CheckCircleOutlined):ve.type==="error"?o.h(qt.CloseCircleOutlined):ve.type==="warning"?o.h(qt.ExclamationCircleOutlined):o.h(qt.InfoCircleOutlined)}):null}};al=o.createVNode(e),o.render(al,Ce),ll=!0}function Cn(n){by(),Ns&&clearTimeout(Ns),ve.type=n.type||"info",ve.title=n.title||"",ve.description=n.description||"",ve.closable=n.closable??!1,ve.showIcon=n.showIcon??!0,ve.visible=!0;const e=n.container||Fs;Ce&&(e?(Ce.parentNode!==e&&e.appendChild(Ce),Ce.style.position="absolute",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"):(Ce.parentNode!==document.body&&document.body.appendChild(Ce),Ce.style.position="fixed",Ce.style.top="20px",Ce.style.left="50%",Ce.style.transform="translateX(-50%)"));const t=n.duration??(ve.type==="loading"?0:3);t>0&&(Ns=setTimeout(()=>{ve.visible=!1},t*1e3))}const ce={setContainer:n=>{Fs=n,Ce&&n&&Ce.parentNode!==n&&(n.appendChild(Ce),Ce.style.position="absolute")},info:(n,e,t,i)=>Cn({type:"info",title:n,description:e,duration:t,container:i}),success:(n,e,t,i)=>Cn({type:"success",title:n,description:e,duration:t,container:i}),error:(n,e,t,i)=>Cn({type:"error",title:n,description:e,duration:t,container:i}),warning:(n,e,t,i)=>Cn({type:"warning",title:n,description:e,duration:t,container:i}),loading:(n,e,t)=>Cn({type:"loading",title:n,description:e,duration:0,container:t}),close:()=>{ve.visible=!1}};class wy{cesium;viewer;events=new jn;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const i=this.cesium.Color.fromCssColorString(e);i?(this.viewer.scene.backgroundColor=i,this.viewer.scene.globe.baseColor=i):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),i=new Promise((s,r)=>setTimeout(()=>r(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,i])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(i){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",i),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const i=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),i.enableZoomInertia=!1,i.enableTilt=!1,i.enableLook=!1,i.enableCollisionDetection=!1,i.inertiaSpin=0,i.inertiaZoom=0,i.inertiaTranslate=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null),this.viewer.resolutionScale=1,this.viewer.scene.postProcessStages&&this.viewer.scene.postProcessStages.fxaa&&(this.viewer.scene.postProcessStages.fxaa.enabled=!1);let s=window.devicePixelRatio;this.viewer.resolutionScale=s,this.viewer.scene.postProcessStages.fxaa.enabled=!1,this.viewer.scene.highDynamicRange=!1,this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const i=Date.now();this.lastBaseMapRequestId=i;const s=this.viewer.imageryLayers,r=[];if(e==="tianditu"){const a=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",c=t?.layerType||"img_w",l=c.split("_"),d=l[0]||"img",h=l[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const p=f?`${f}_${h}`:"";r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${c}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&p&&r.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${p}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${a}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const a=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const c=this.cesium.ArcGisMapServerImageryProvider.fromUrl(a,{enablePickFeatures:!1}),l=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([c,l]);r.push(d)}else r.push(new this.cesium.ArcGisMapServerImageryProvider({url:a,enablePickFeatures:!1}))}catch(c){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",c),r.push(new this.cesium.UrlTemplateImageryProvider({url:`${a}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==i){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),r.forEach(a=>s.addImageryProvider(a))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),r=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,a=await fetch(r);if(!a.ok)throw new Error(`HTTP ${a.status}`);return await a.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const i=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=i}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,i=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,r=e.contrast!==void 0?e.contrast:1,a=e.saturation!==void 0?e.saturation:1,c=t.scene.primitives,l=c.length,d=!!i.CustomShader;for(let h=0;h<l;++h){const f=c.get(h);if(f instanceof i.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",r),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",a);else{const p=new i.CustomShader({uniforms:{u_brightness:{type:i.UniformType.FLOAT,value:s},u_contrast:{type:i.UniformType.FLOAT,value:r},u_saturation:{type:i.UniformType.FLOAT,value:a}},fragmentShaderText:`
101
+ `;Ps=document.createElement("style"),Ps.textContent=i,document.head.appendChild(Ps)}function a2(){if(Hd)return;o2(),Be=document.createElement("div"),Be.className="tech-alert-wrapper",(ba||document.body).appendChild(Be);const e={setup(){return()=>_e.visible?a.h(se.Alert,{class:`tech-alert tech-alert-${_e.type}`,message:_e.title,description:_e.description,showIcon:_e.showIcon,closable:_e.closable,onClose:()=>{_e.visible=!1}},{icon:()=>_e.type==="loading"?a.h(Li.LoadingOutlined):_e.type==="success"?a.h(Li.CheckCircleOutlined):_e.type==="error"?a.h(Li.CloseCircleOutlined):_e.type==="warning"?a.h(Li.ExclamationCircleOutlined):a.h(Li.InfoCircleOutlined)}):null}};Qd=a.createVNode(e),a.render(Qd,Be),Hd=!0}function In(i){a2(),va&&clearTimeout(va),_e.type=i.type||"info",_e.title=i.title||"",_e.description=i.description||"",_e.closable=i.closable??!1,_e.showIcon=i.showIcon??!0,_e.visible=!0;const e=i.container||ba;Be&&(e?(Be.parentNode!==e&&e.appendChild(Be),Be.style.position="absolute",Be.style.top="20px",Be.style.left="50%",Be.style.transform="translateX(-50%)"):(Be.parentNode!==document.body&&document.body.appendChild(Be),Be.style.position="fixed",Be.style.top="20px",Be.style.left="50%",Be.style.transform="translateX(-50%)"));const t=i.duration??(_e.type==="loading"?0:3);t>0&&(va=setTimeout(()=>{_e.visible=!1},t*1e3))}const ce={setContainer:i=>{ba=i,Be&&i&&Be.parentNode!==i&&(i.appendChild(Be),Be.style.position="absolute")},info:(i,e,t,n)=>In({type:"info",title:i,description:e,duration:t,container:n}),success:(i,e,t,n)=>In({type:"success",title:i,description:e,duration:t,container:n}),error:(i,e,t,n)=>In({type:"error",title:i,description:e,duration:t,container:n}),warning:(i,e,t,n)=>In({type:"warning",title:i,description:e,duration:t,container:n}),loading:(i,e,t)=>In({type:"loading",title:i,description:e,duration:0,container:t}),close:()=>{_e.visible=!1}};class r2{cesium;viewer;events=new Ki;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const n=this.cesium.Color.fromCssColorString(e);n?(this.viewer.scene.backgroundColor=n,this.viewer.scene.globe.baseColor=n):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),n=new Promise((s,o)=>setTimeout(()=>o(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,n])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(n){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",n),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const n=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),n.enableZoomInertia=!1,n.enableTilt=!1,n.enableLook=!1,n.enableCollisionDetection=!1,n.inertiaSpin=0,n.inertiaZoom=0,n.inertiaTranslate=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null),this.viewer.resolutionScale=1,this.viewer.scene.postProcessStages&&this.viewer.scene.postProcessStages.fxaa&&(this.viewer.scene.postProcessStages.fxaa.enabled=!1);let s=window.devicePixelRatio;this.viewer.resolutionScale=s,this.viewer.scene.postProcessStages.fxaa.enabled=!1,this.viewer.scene.highDynamicRange=!1,this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const n=Date.now();this.lastBaseMapRequestId=n;const s=this.viewer.imageryLayers,o=[];if(e==="tianditu"){const r=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",l=t?.layerType||"img_w",c=l.split("_"),d=c[0]||"img",h=c[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const m=f?`${f}_${h}`:"";o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${l}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&m&&o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${m}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const r=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const l=this.cesium.ArcGisMapServerImageryProvider.fromUrl(r,{enablePickFeatures:!1}),c=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([l,c]);o.push(d)}else o.push(new this.cesium.ArcGisMapServerImageryProvider({url:r,enablePickFeatures:!1}))}catch(l){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",l),o.push(new this.cesium.UrlTemplateImageryProvider({url:`${r}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==n){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),o.forEach(r=>s.addImageryProvider(r))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),o=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const n=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=n}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,n=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,o=e.contrast!==void 0?e.contrast:1,r=e.saturation!==void 0?e.saturation:1,l=t.scene.primitives,c=l.length,d=!!n.CustomShader;for(let h=0;h<c;++h){const f=l.get(h);if(f instanceof n.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",o),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",r);else{const m=new n.CustomShader({uniforms:{u_brightness:{type:n.UniformType.FLOAT,value:s},u_contrast:{type:n.UniformType.FLOAT,value:o},u_saturation:{type:n.UniformType.FLOAT,value:r}},fragmentShaderText:`
99
102
  void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
100
103
  // 1. 亮度 (Brightness) - RGB 乘法
101
104
  material.diffuse *= u_brightness;
@@ -115,4 +118,4 @@
115
118
  // 通常不需要 clamp,除非开启 HDR 后期望超亮,但负值需要避免
116
119
  material.diffuse = max(material.diffuse, vec3(0.0));
117
120
  }
118
- `});p.isModelAdjustment=!0,f.customShader=p}else e.brightness!==void 0&&e.brightness!==1&&!f.style&&(f.style=new i.Cesium3DTileStyle({color:`color('white') * ${e.brightness}`}))}}setModelBrightness(e){this.setModelColorAdjustment({brightness:e})}_defaultSkyBox=null;_updateLightDirection=e=>{e.light instanceof this.cesium.DirectionalLight&&(e.light.direction=e.camera.directionWC)};setEnvironmentMapEnable(e){this.is2d||(e?(this.viewer.scene.light=new this.cesium.DirectionalLight({direction:this.viewer.scene.camera.directionWC}),this.viewer.scene.preRender.addEventListener(this._updateLightDirection)):(this._defaultSkyBox&&(this.viewer.scene.skyBox=this._defaultSkyBox),this.viewer.scene.preRender.removeEventListener(this._updateLightDirection),this.viewer.scene.light=new this.cesium.SunLight),this.viewer.scene.imageBasedLighting&&(this.viewer.scene.imageBasedLighting.imageBasedLightingFactor=e?new this.cesium.Cartesian2(2,2):new this.cesium.Cartesian2(1,1)))}setAmbientOcclusion(e){if(this.is2d)return;const t=this.viewer.scene;if(!t||!t.postProcessStages||!t.postProcessStages.ambientOcclusion)return;const i=t.postProcessStages.ambientOcclusion;i.enabled=e,e&&(i.uniforms.ambientOcclusionOnly=!1,i.uniforms.intensity=3,i.uniforms.bias=.1,i.uniforms.lengthCap=.03,i.uniforms.stepSize=1,i.uniforms.blurStepSize=.86)}setCollisionDetection(e){if(this.is2d){this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1;return}const t=this.viewer.scene.screenSpaceCameraController;t.enableCollisionDetection=e,e||t.minimumZoomDistance<1&&(t.minimumZoomDistance=1)}_customZoomHandler=null;setHeightBasedZoom(e){const t=this.viewer.scene.screenSpaceCameraController,i=this.cesium;if(this.viewer.camera.frustum.near=1e-4,this.viewer.camera.frustum.far=1e8,e||(this.viewer.camera.frustum.near=.1),this._customZoomHandler&&(this._customZoomHandler.destroy(),this._customZoomHandler=null),!e){t.zoomEventTypes.includes(i.CameraEventType.WHEEL)||t.zoomEventTypes.push(i.CameraEventType.WHEEL);return}t.zoomEventTypes=t.zoomEventTypes.filter(r=>r!==i.CameraEventType.WHEEL),this._customZoomHandler=new i.ScreenSpaceEventHandler(this.viewer.scene.canvas);let s=null;this._customZoomHandler.setInputAction(r=>{s=r.endPosition},i.ScreenSpaceEventType.MOUSE_MOVE),this._customZoomHandler.setInputAction(r=>{const a=this.viewer.camera,c=a.positionCartographic.height,l=Math.sign(r);if(c<.15&&l>0){ce.info("无法继续放大");return}const d=.3;let h=0;if(l>0){const m=c-1;h=m>0?m*d:0}else h=c*d;h=Math.max(.1,h),console.log(c);let f=null;if(!s)f=a.direction;else{const m=a.getPickRay(s);if(m){let E=this.viewer.scene.pickPosition(s);if(!E){const A=i.IntersectionTests.rayEllipsoid(m,this.viewer.scene.globe.ellipsoid);A&&(E=i.Ray.getPoint(m,A.start))}if(E){const A=i.Cartesian3.subtract(E,a.position,new i.Cartesian3);f=i.Cartesian3.normalize(A,new i.Cartesian3)}else f=a.direction}else f=a.direction}const p=l>0?h:-h*2,u=i.Cartesian3.multiplyByScalar(f,p,new i.Cartesian3);a.position=i.Cartesian3.add(a.position,u,new i.Cartesian3)},i.ScreenSpaceEventType.WHEEL)}setMouseHabit(e){if(this.is2d)return;const t=this.viewer.scene.screenSpaceCameraController;t.enableTranslate=!0,t.enableRotate=!0,t.enableZoom=!0,t.enableTilt=!0,t.enableLook=!1,t.lookEventTypes=[],e===1?(t.rotateEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.MIDDLE_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.LEFT_DRAG]):(t.rotateEventTypes=[this.cesium.CameraEventType.LEFT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.MIDDLE_DRAG])}}class vy{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}getCameraView(){const e=this.viewer.camera;return{position:{x:e.position.x,y:e.position.y,z:e.position.z},destination:{x:e.position.x,y:e.position.y,z:e.position.z},orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},duration:1}}flyToCameraView(e){const{position:t,orientation:i,duration:s}=e,r=new this.cesium.Cartesian3(t.x,t.y,t.z),a=new this.cesium.HeadingPitchRoll(i.heading,i.pitch,i.roll);!s||s<=0?this.viewer.camera.setView({destination:r,orientation:a}):this.viewer.camera.flyTo({destination:r,orientation:a,duration:s})}getCurrentCameraPositionAndTarget(){const e=this.getCameraView();return{position:e.position,target:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll},duration:e.duration}}setCameraView(e){const t=e.target||e.orientation||{},i=e.destination||e.position||{};this.flyToCameraView({position:{x:Number(i.x),y:Number(i.y),z:Number(i.z)},destination:{x:Number(i.x),y:Number(i.y),z:Number(i.z)},orientation:{heading:Number(t.heading||0),pitch:Number(t.pitch||0),roll:Number(t.roll||0)},duration:e.duration})}flyToLonLatHeight(e,t,i,s=1){const r=this.cesium.Cartesian3.fromDegrees(e,t,i),a={heading:this.cesium.Math.toRadians(0),pitch:this.cesium.Math.toRadians(-90),roll:0};!s||s<=0?this.viewer.camera.setView({destination:r,orientation:a}):this.viewer.camera.flyTo({destination:r,orientation:a,duration:s})}}function Iy(n){const{container:e,appContext:t,methods:i,viewerOptions:s,options:r,callbacks:a}=n,c=new jn,l=window.Cesium;if(!l)throw new Error("Cesium is not loaded");e.id=`cesium-container-${Ap()}`;const d={animation:!1,timeline:!1,infoBox:!1,homeButton:!1,fullscreenButton:!1,sceneModePicker:!1,navigationHelpButton:!1,geocoder:!1,baseLayerPicker:!1,selectionIndicator:!1,heightBasedZoom:!0,creditContainer:document.createElement("div"),contextOptions:{webgl:{alpha:!0,antialias:!0,msaaLevel:4}}},h=t?.config?.globalProperties?.$leitingBimOptions,f={...d,...h?.viewerOptions??{},...s??{}},p=new l.Viewer(e,f);p.camera.setView({destination:l.Cartesian3.fromDegrees(108,32,1e7),orientation:{heading:l.Math.toRadians(0),pitch:l.Math.toRadians(-90),roll:0}});let u=i;if(!u&&h&&(h.methods||(h.methods={}),u=h.methods),u){const m=new Dp({cesium:l,viewer:p,options:r,callbacks:a}),E=new Lr({cesium:l,viewer:p}),A=new wy({cesium:l,viewer:p}),b=new kp({cesium:l,viewer:p}),w=new vy({cesium:l,viewer:p});let I;const D=new Ps({cesium:l,viewer:p});r&&(r.globe!==void 0&&A.setGlobeEnvironmentVisible(r.globe),r.terrain!==void 0&&A.setTerrainEnable(r.terrain),r.depthTest!==void 0&&A.setDepthTestEnable(r.depthTest),r.mapProvider&&r.mode!=="2d"&&A.changeBaseMap(r.mapProvider,{token:r.tiandituToken,layerType:r.tiandituLayerType,showAnnotation:r.tiandituShowLabel,url:r.arcgisUrl}),r.shadows!==void 0&&A.setShadowsEnable(r.shadows),r.environmentMap!==void 0&&A.setEnvironmentMapEnable(r.environmentMap),r.ambientOcclusion!==void 0&&A.setAmbientOcclusion(r.ambientOcclusion),r.time!==void 0&&A.setTime(r.time),r.brightness!==void 0&&A.setModelBrightness(r.brightness),r.backgroundColor!==void 0&&A.setBackgroundColor(r.backgroundColor),r.collision!==void 0&&A.setCollisionDetection(r.collision),r.mouseHabit!==void 0&&A.setMouseHabit(r.mouseHabit),r.heightBasedZoom!==void 0&&A.setHeightBasedZoom(r.heightBasedZoom)),r&&r.mode==="2d"&&(console.log("InitMap: Setting CAD Mode 2D"),A.setCadMode("2d"),I=new rl({cesium:l,viewer:p})),E.events.on("tilesetLoaded",g=>{m.baseCompt.attachTileset(g,m.baseCompt.selectedColor),m.baseSection.attachTileset(g,g.leiting?.model?.modelId),u&&u.tilesLoad3dTiles&&u.tilesLoad3dTiles(g),r?.tilesLoad3dTiles&&r.tilesLoad3dTiles(g.leiting)}),E.events.on("loadingStatus",g=>{u&&u.onLoadingStatus&&u.onLoadingStatus(g)}),E.events.on("mountAll3Dtiles",({modelList:g})=>{r?.mountAll3Dtiles&&r.mountAll3Dtiles(g),u?.mountAll3Dtiles&&u.mountAll3Dtiles(g)}),E.events.on("updateModels",({modelList:g})=>{r?.updateModels&&r.updateModels(g),u?.updateModels&&u.updateModels(g)}),b.events.on("mountAllCad",g=>{r?.mountAllCad&&r.mountAllCad(g),u?.mountAllCad&&u.mountAllCad(g)}),m.baseCompt.loadNodeDetailsForModel=g=>E.loadNodeDetailsForModel(g),m.baseCompt.selectionChange(g=>{g.length!==0&&(r?.selectionChange&&r.selectionChange(g),u?.selectionChange&&u.selectionChange(g))}),u.onSearchComponent=g=>{r?.searchComponent&&r.searchComponent(g),u?.searchComponent&&u.searchComponent(g)};const N=u.saveRegion;u.saveRegion=g=>{r?.saveRegion&&r.saveRegion(g),N&&N!==r?.saveRegion&&N(g)};const S=u.saveCadCalibration;u.saveCadCalibration=g=>{r?.saveCadCalibration&&r.saveCadCalibration(g),S&&S!==r?.saveCadCalibration&&S(g)};const B=u.saveCadRegion;u.saveCadRegion=g=>{r?.saveCadRegion&&r.saveCadRegion(g),B&&B!==r?.saveCadRegion&&B(g)},u.getCesium=()=>l,u.getViewer=()=>p,u.getAnnotationInstance=()=>I,u.getMeasureInstance=()=>D,u.flyToCamera=g=>{w.setCameraView(g)},u.flyToLonLatHeight=(g,R,x,M=1)=>{w.flyToLonLatHeight(g,R,x,M)},u.flyTo=u.flyToCamera,u.getCameraState=()=>w.getCameraView(),u.getCameraInfo=u.getCameraState,u.restoreCameraState=g=>w.flyToCameraView(g),u.flyToCameraView=u.restoreCameraState,u.getCameraPositionTarget=()=>w.getCurrentCameraPositionAndTarget(),u.getCurrentCameraPositionAndTarget=u.getCameraPositionTarget,u.setCameraLookAt=g=>w.setCameraView(g),u.setCameraView=u.setCameraLookAt,u.setCanvasBackground=g=>A.setBackgroundColor(g),u.setBackgroundColor=u.setCanvasBackground,u.setAntiAliasing=g=>m.enableCesiumFXAA(g),u.enableCesiumFXAA=u.setAntiAliasing,u.setSceneVisibility=g=>m.setSceneOptions(g),u.setSceneOptions=u.setSceneVisibility,u.addDebugPoint=(g,R,x=0)=>{p.entities.add({position:l.Cartesian3.fromDegrees(g,R,x),point:{pixelSize:10,color:l.Color.RED}})},u.addPoint=u.addDebugPoint,u.toggleDebugLabels=()=>m.enableTestLabel(),u.enableTestLabel=u.toggleDebugLabels,u.captureScreenshot=()=>{const g=p.scene.canvas;return p.render(),g.toDataURL("image/png")},u.getImageBase64=u.captureScreenshot,u.captureDomScreenshot=(g,R)=>m.getSnapDomSImageBase64(g,R),u.getSnapDomSImageBase64=u.captureDomScreenshot,u.addModels=g=>E.addModels(g),u.add3DtilesModel=u.addModels,u.addObliquePhotography=g=>E.addOSGB(g),u.addOSGB=u.addObliquePhotography,u.adjustOSGBModelMatrix=g=>E.updateOSGBMatrix(g),u.updateOSGBMatrix=u.adjustOSGBModelMatrix,u.setModelVisibility=g=>E.showModels(g),u.showModels=u.setModelVisibility,u.showTileset=u.setModelVisibility,u.removeModels=g=>E.deleteModels(g),u.deleteModels=u.removeModels,u.clearAllModels=()=>{E.deleteAllModels(),c.emit("deleteAllModels")},u.deleteAllModelList=u.clearAllModels,u.deleteAllModels=u.clearAllModels,u.flyToModel=g=>E.flyToTileset(g),u.flyToTileset=u.flyToModel,u.flyToByModelId=u.flyToModel,u.setModelBrightness=g=>m.updateModelEffect(g),u.updateModelEffect=u.setModelBrightness,u.getAllTilesets=()=>E.getMapTileset(),u.getMapTileset=u.getAllTilesets,u.getCurrentModelId=()=>E.getBIMmodelId(),u.getBIMmodelId=u.getCurrentModelId,u.getLoadedModels=()=>E.getModelList(),u.getModelList=u.getLoadedModels,u.loadModelStructure=async g=>{const R=typeof g=="string"?g:g?.modelId;if(!R){console.warn("loadModelStructure: modelId is required");return}return await E.loadTreeForModel(R)},u.loadTreeForModel=u.loadModelStructure,u.loadModelDetails=async g=>{const R=typeof g=="string"?g:g?.modelId;if(!R){console.warn("loadModelDetails: modelId is required");return}return await E.loadNodeDetailsForModel(R)},u.loadNodeDetailsForModel=u.loadModelDetails,u._loadNodeDetailsForModel=async g=>{const R=typeof g=="string"?g:g?.modelId;if(!R){console.warn("loadModelDetails: modelId is required");return}return await E._loadNodeDetailsForModel(R)},u.setMapTileset=g=>E.setMapTileset(g),u.setCurrentModelId=g=>E.setBIMmodelId(g),u.setBIMmodelId=u.setCurrentModelId,u.setModelList=g=>E.setModelList(g),u.highlightComponents=(g,R={})=>m.baseCompt.setSelectColorUserModelCpt(g,R),u.setSelectColorUserModelCpt=u.highlightComponents,m.baseCompt.setLoadNodeDetailsCallback(g=>E.loadNodeDetailsForModel(g)),u.highlightAllComponents=(g,R)=>m.baseCompt.setAllSelectColorUserModelCpt(g,R),u.setAllSelectColorUserModelCpt=u.highlightAllComponents,u.setSelectColorUserModelCptByClear=(g,R)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g.selectCpts,R??{rank:0})},u.clearSelectColorUserModelCpt=()=>m.baseCompt.clearAllHaveSelected(),u.selectComponents=(g,R)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g,R??{rank:0})},u.setSelecteds=u.selectComponents,u.setSelectionColor=(g,R,x,M)=>m.baseCompt.setSelectedColorRgba(g,R,x,M),u.setSelectedColor=u.setSelectionColor,u.clearSelection=()=>m.baseCompt.clearAllHaveSelected(),u.clearAllHaveSelected=u.clearSelection,u.getSelectedComponents=g=>m.baseCompt.getSelected(g),u.getSelected=u.getSelectedComponents,u.onSelectionChange=g=>{m.baseCompt.selectionChange(g)},u.selectionChange=u.onSelectionChange,u.flyToComponents=g=>m.baseCompt.flyToObjects(g),u.flyToObjects=u.flyToComponents,u.setConstructionData=async g=>{if(g&&Array.isArray(g)){const R=new Set;g.forEach(x=>{x.mergeCpts&&Array.isArray(x.mergeCpts)&&x.mergeCpts.forEach(M=>{M.modelId&&R.add(M.modelId)})}),R.size>0&&await Promise.all(Array.from(R).map(x=>u.loadNodeDetailsForModel(x)))}m.baseCompt.setAllConstructionProgressTracking(g)},u.setAllConstructionProgressTracking=u.setConstructionData,u.startConstructionSimulation=()=>m.baseCompt.enableConstructionProgressTracking(),u.enableAllConstructionProgressTracking=u.startConstructionSimulation,u.stopConstructionSimulation=()=>m.baseCompt.disableConstructionProgressTracking(),u.disableConstructionProgressTracking=u.stopConstructionSimulation,u.disableAllConstructionProgressTracking=u.stopConstructionSimulation,u.resetConstructionSimulation=()=>m.baseCompt.freshConstructionProgressTracking(),u.freshConstructionProgressTracking=u.resetConstructionSimulation,u.restartConstructionSimulation=()=>m.baseCompt.reStartAnimation(),u.reStartAnimation=u.restartConstructionSimulation,u.resumeFlyTo=()=>m.baseCompt.resumeFlyTo(),u.pauseConstructionSimulation=()=>m.baseCompt.pauseFlyTo(),u.pauseFlyTo=u.pauseConstructionSimulation,u.pauseAnimation=u.pauseConstructionSimulation,u.resumeConstructionSimulation=()=>m.baseCompt.resumeFlyTo(),u.resumeAnimation=u.resumeConstructionSimulation,u.setComponentsVisibility=async g=>await m.baseCompt.setComponentVisibility(g),u.setElementsListVisible=u.setComponentsVisibility,u.setAllComponentsVisibility=async g=>await m.baseCompt.setAllComponentsVisibility(g),u.setAllElementsVisible=u.setAllComponentsVisibility,u.isolateComponents=g=>m.baseCompt.isolateComponentVisibility(g),u.isolateComponentVisibility=u.isolateComponents,u.getComponentsByVisibility=g=>m.baseCompt._getComponentsByVisibility(g),u.getShowCpts=g=>m.baseCompt.getComponentsByVisibility(g),u.getElementsVisible=g=>m.baseCompt.getComponentsByVisibility(g),u.setComponentVisibility=u.setComponentsVisibility,u.enableSectioning=(g,R)=>m.baseSection.open(g,R),u.openSection=u.enableSectioning,u.disableSectioning=g=>m.baseSection.close(g),u.closeSection=u.disableSectioning,u.updateSectionBox=g=>m.baseSection.updateRange(g),u.updateSectionRange=u.updateSectionBox,u.getSectionBox=()=>m.baseSection.getRange(),u.getSectionRange=u.getSectionBox,u.fitSectionToModel=()=>m.baseSection.fitToModels(),u.fitToModels=u.fitSectionToModel,u.setSectionBoxVisibility=g=>m.baseSection.setBoxVisibility(g),u.startFirstPersonMode=()=>{m.baseCompt.disableSelection(),m.basePlayer.openPlayer()},u.openPlayer=u.startFirstPersonMode,u.startCameraRoam=()=>{m.baseCompt.disableSelection(),m.basePlayer.openCameraRoam()},u.stopFirstPersonMode=()=>{m.basePlayer.closePlayer(),m.baseCompt.enableSelection()},u.closePlayer=u.stopFirstPersonMode,u.setPlayerPosition=g=>m.basePlayer.setPersonPosition(g),u.setPersonPosition=u.setPlayerPosition,u.setPlayerDefaultPosition=()=>m.basePlayer.setDefaultPosition(),u.setWalkSpeed=g=>m.basePlayer.setSpeed({speed:g}),u.setPlayerSpeed=u.setWalkSpeed,u.setPlayerConfig=g=>m.basePlayer.setParams(g),u.setPlayerParams=u.setPlayerConfig,u.setPlayerAction=(g,R)=>m.basePlayer.setMoveState(g,R),u.setPlayerMoveState=u.setPlayerAction,u.bindPlayerControls=g=>m.basePlayer.bindUiKeys(g),u.bindPlayerUiKeys=u.bindPlayerControls,u.setGlobeVisibility=g=>A.setGlobeEnvironmentVisible(g),u.setGlobeEnvironmentVisible=u.setGlobeVisibility,u.setTerrainVisibility=g=>A.setTerrainEnable(g),u.setTerrainEnable=u.setTerrainVisibility,u.setDepthTest=g=>A.setDepthTestEnable(g),u.setDepthTestEnable=u.setDepthTest,u.setBaseMap=(g,R)=>A.changeBaseMap(g,R),u.changeBaseMap=u.setBaseMap,u.setWorldTime=g=>A.setTime(g),u.setTime=u.setWorldTime,u.setGisOptions=g=>{g.globe!==void 0&&A.setGlobeEnvironmentVisible(g.globe),g.elevation!==void 0&&A.setTerrainEnable(g.elevation),g.depthTestAgainstTerrain!==void 0&&A.setDepthTestEnable(g.depthTestAgainstTerrain),g.rendering!==void 0&&A.setAmbientOcclusion(g.rendering)},u.setShadowVisibility=g=>A.setShadowsEnable(g),u.setShadowsEnable=u.setShadowVisibility,u.setEnvironmentMapVisibility=g=>A.setEnvironmentMapEnable(g),u.setEnvironmentMapEnable=u.setEnvironmentMapVisibility,u.setAOVisibility=g=>A.setAmbientOcclusion(g),u.setAmbientOcclusion=u.setAOVisibility,u.setBackgroundColor=g=>A.setGlobeColor(g),u.setGlobeColor=u.setBackgroundColor,u.setModelBrightness=g=>A.setModelBrightness(g),u.adjustModelColor=g=>A.setModelColorAdjustment(g),u.setModelColorAdjustment=u.adjustModelColor,u.setShadowIntensity=g=>{A.setShadowDarkness?A.setShadowDarkness(g):console.warn("baseSetting.setShadowDarkness is not available. Please reload the page.")},u.setShadowDarkness=u.setShadowIntensity,u.switchSceneMode=async g=>{const R=g?"2d":"3d";await A.setCadMode(R),g&&!I&&(I=new rl({cesium:l,viewer:p}),u.setGlobeVisibility(!0)),c.emit("setMode",R)},u.setSceneMode=u.switchSceneMode,u.set2d=g=>u.switchSceneMode(g),u.is2dMode=()=>A.is2d,u.setMouseControlMode=g=>A.setMouseHabit(g),u.setMouseHabit=u.setMouseControlMode,u.setCollisionEnabled=g=>A.setCollisionDetection(g),u.setCollisionDetection=u.setCollisionEnabled,u.searchAndLocate=(g,R)=>A.searchLocation(g,R),u.searchLocation=u.searchAndLocate,u.getConfigure=()=>(console.warn("getConfigure is not initialized. Please ensure LeitingSetting component is mounted."),{}),u.setConfigure=g=>{console.warn("setConfigure is not initialized. Please ensure LeitingSetting component is mounted.",g)},u.addCadModel=g=>{const R={...g};return R.files&&!R.fileNames&&(R.fileNames=R.files),R.fileNames||(R.fileNames=[]),b.addDxfModel(R)},u.addDxfModel=u.addCadModel,u.deleteCad=g=>b.deleteCad(g),u.deleteAllCad=()=>b.deleteAllCad(),u.showCadModel=g=>b.showJson(g),u.showGeoJson=g=>b.showJson(g),u.showDxfModel=u.showCadModel,u.showCadLayer=g=>b.showJsonByLayer(g),u.showDxfLayer=u.showCadLayer,u.flyToCadModel=(g={})=>b.flyToCadModel(g),u.getCadModels=g=>b.getDxfModels(g),u.getDxfModels=u.getCadModels,u.getCadLayers=g=>b.getMapLayers(g),u.getDxfLayers=u.getCadLayers,u.getCadModelId=()=>b.getModelId(),u.setCadOpen=g=>b.setDxfOpen(g),u.setDxfOpen=u.setCadOpen,u.getCadOpen=()=>b.getDxfOpen(),u.getDxfOpen=u.getCadOpen,u.adjustCadModel=g=>b.adjustingModelByCad(g),u.adjustingModelByCad=u.adjustCadModel,u.saveAnnotations=()=>{let g=null;return I&&(g=I.saveAnnotations()),r?.saveAnnotations&&r.saveAnnotations(g),g},u.loadAnnotations=g=>I?I.loadAnnotations(g):!1,u.flyToTopView=()=>{b.flyToCadModel()},u.menuEvents=c,u.addMenuItems=g=>{c.emit("insertMenu",g)},u.insertMenu=u.addMenuItems,u.filterMenuItems=g=>{c.emit("setMenuListFilter",g)},u.setMenuListFilter=u.filterMenuItems,u.setMenuVisibility=g=>{c.emit("showMenu",g)},u.showMenu=u.setMenuVisibility,u.setPanelVisibility=(g,R)=>{c.emit("setMenuActive",g,R)},u.setMenuActive=u.setPanelVisibility,u.addContextMenuItems=g=>{console.warn("addContextMenuItems is not initialized yet. Please wait for LeitingBIM component to mount.",g)},u.insertContextMenu=u.addContextMenuItems,u.removeContextMenuItems=g=>{console.warn("removeContextMenuItems is not initialized yet.",g)},u.deleteContextMenu=u.removeContextMenuItems,u.closeContextMenu=()=>{console.warn("closeContextMenu is not initialized yet.")},u.hideContextMenu=u.closeContextMenu,u.getModelTree=()=>{const g=[],R=E.getMapTileset();return Object.keys(R).forEach(x=>{const M=R[x];if(M&&M.leiting&&M.leiting.tree){const L=M.leiting.tree;Array.isArray(L)?g.push(...L):g.push(L)}}),g},u.getTree=u.getModelTree,u.getAllComponentDetails=()=>{const g=E.getMapTileset(),R={},x=[];try{Object.keys(g).forEach(M=>{const L=g[M];if(!L||!L.leiting)return;const V=L.leiting,k=V.node,C=V.model.formData,y=V.box;if(!k||!k.nodeExtras)return;const v=V.model.modelId;R[v]=k.nodeExtras;const P=k.nodeExtras.element;if(!P)return;const F=y?y.center:{x:0,y:0,z:0};Object.values(P).forEach(U=>{if(U.box3)try{const O=l.Quaternion.fromAxisAngle(l.Cartesian3.UNIT_Z,l.Math.toRadians(C.totalRotation||0)),T=l.Matrix4.fromRotationTranslation(l.Matrix3.fromQuaternion(O),new l.Cartesian3(0,0,0)),_=l.Cartesian3.fromDegrees(C.longitude,C.latitude,C.height),H=l.Transforms.eastNorthUpToFixedFrame(_);l.Matrix4.multiply(H,T,H);const j=new l.Cartesian3(F.x,F.y,0),X=new l.Cartesian3;l.Matrix4.multiplyByPoint(H,j,X);const Z=l.Cartographic.fromCartesian(X),re=U.box3?.Center?.x||0,se=U.box3?.Center?.y||0,oe=U.box3?.Center?.z||0,ye=new l.Cartesian3(-F.x+re,-F.y+se,0+oe),Ie=l.Matrix4.fromTranslation(ye),Ee=l.Matrix4.clone(Ie);l.Matrix4.multiply(T,Ee,Ee);const xe=l.Cartesian3.fromDegrees(Z.longitude/Math.PI*180,Z.latitude/Math.PI*180,C.height),Te=l.Transforms.eastNorthUpToFixedFrame(xe);l.Matrix4.multiply(Te,Ee,Te);const _e=l.Cartographic.fromCartesian(new l.Cartesian3(Te[12],Te[13],Te[14]));U.box3.cartographic={longitude:_e.longitude/Math.PI*180,latitude:_e.latitude/Math.PI*180,height:_e.height};const z={id:U.uniqueId,billboard:[{theme:"Tag9999",position:[U.box3.cartographic.longitude,U.box3.cartographic.latitude,U.box3.cartographic.height],options:{text:U.name}}]};x.push(z)}catch(O){console.warn("Error calculating component position:",O)}})})}catch(M){console.error("getAllComponents error:",M)}return R},u.getAllComponents=u.getAllComponentDetails,u.getComponentInfoList=async g=>{if(!Array.isArray(g))return[];const R=E.getMapTileset(),x=[],M=[],L={};g.forEach(k=>{const y=R[k.modelId]?.leiting?.model?.dbName;y&&k.elementId&&M.push({dbName:y,elementId:k.elementId,modelId:k.modelId})});const V=new Set;if(g.forEach(k=>{const C=R[k.modelId],y=`${k.modelId}_${k.elementId}`;L[y]||C&&C.leiting&&!C.leiting?.node?.nodeExtras&&C.leiting.model?.nodeUrl&&V.add(k.modelId)}),V.size>0&&E._loadNodeDetailsForModel)try{const k=Array.from(V).map(C=>E._loadNodeDetailsForModel(C));await Promise.all(k)}catch(k){console.error("Failed to load node details in getComponentInfoList",k)}try{g.forEach(k=>{const C=k.modelId,y=k.elementId,v=R[C];if(!v||!v.leiting)return;const P=`${C}_${y}`,F=L[P];let U=null;if(F)U=F;else{const O=v.leiting.node?.nodeExtras?.element||v.leiting.node?.nodeExtras;O&&O[y]&&(U=JSON.parse(JSON.stringify(O[y])))}if(U){if(U.elementId=y,U.modelId=C,U.box3&&!U.box3.cartographic)try{const O=v.leiting,T=O.model.formData,_=O.box,H=_?_.center:{x:0,y:0,z:0},j=l.Quaternion.fromAxisAngle(l.Cartesian3.UNIT_Z,l.Math.toRadians(T.totalRotation||0)),X=l.Matrix4.fromRotationTranslation(l.Matrix3.fromQuaternion(j),new l.Cartesian3(0,0,0)),Z=l.Cartesian3.fromDegrees(T.longitude,T.latitude,T.height),re=l.Transforms.eastNorthUpToFixedFrame(Z);l.Matrix4.multiply(re,X,re);const se=new l.Cartesian3(H.x,H.y,0),oe=new l.Cartesian3;l.Matrix4.multiplyByPoint(re,se,oe);const ye=l.Cartographic.fromCartesian(oe),Ie=U.box3?.Center?.x||0,Ee=U.box3?.Center?.y||0,xe=U.box3?.Center?.z||0,Te=new l.Cartesian3(-H.x+Ie,-H.y+Ee,0+xe),_e=l.Matrix4.fromTranslation(Te),z=l.Matrix4.clone(_e);l.Matrix4.multiply(X,z,z);const Y=l.Cartesian3.fromDegrees(ye.longitude/Math.PI*180,ye.latitude/Math.PI*180,T.height),K=l.Transforms.eastNorthUpToFixedFrame(Y);l.Matrix4.multiply(K,z,K);const Pe=l.Cartographic.fromCartesian(new l.Cartesian3(K[12],K[13],K[14]));U.box3.cartographic={longitude:Pe.longitude/Math.PI*180,latitude:Pe.latitude/Math.PI*180,height:Pe.height}}catch(O){console.warn("Error calculating component position:",O)}x.push(U)}})}catch(k){console.error("getComponentInfoList processing error:",k)}return x},u.getCptInfos=u.getComponentInfoList,u.baseCompt=m.baseCompt,u.setTeleportTarget=g=>{u.onSetTeleportTarget&&u.onSetTeleportTarget(g)},window.Methods=u}return console.log("methods",u),{Cesium:l,viewer:p,methods:u,menuEvents:c}}function Rs(n){return o.getCurrentScope()?(o.onScopeDispose(n),!0):!1}function Ls(n){return typeof n=="function"?n():o.unref(n)}const By=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xy=Object.prototype.toString,Sy=n=>xy.call(n)==="[object Object]",Ty=()=>{};function My(n){return o.getCurrentInstance()}function cl(n,e=!0,t){My()?o.onMounted(n,t):e?n():o.nextTick(n)}function kt(n){var e;const t=Ls(n);return(e=t?.$el)!=null?e:t}const En=By?window:void 0;function Dy(...n){let e,t,i,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,i,s]=n,e=En):[e,t,i,s]=n,!e)return Ty;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const r=[],a=()=>{r.forEach(h=>h()),r.length=0},c=(h,f,p,u)=>(h.addEventListener(f,p,u),()=>h.removeEventListener(f,p,u)),l=o.watch(()=>[kt(e),Ls(s)],([h,f])=>{if(a(),!h)return;const p=Sy(f)?{...f}:f;r.push(...t.flatMap(u=>i.map(m=>c(h,u,m,p))))},{immediate:!0,flush:"post"}),d=()=>{l(),a()};return Rs(d),d}function ky(){const n=o.ref(!1),e=o.getCurrentInstance();return e&&o.onMounted(()=>{n.value=!0},e),n}function dl(n){const e=ky();return o.computed(()=>(e.value,!!n()))}function ul(n,e={}){const{window:t=En}=e,i=dl(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let s;const r=o.ref(!1),a=d=>{r.value=d.matches},c=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",a):s.removeListener(a))},l=o.watchEffect(()=>{i.value&&(c(),s=t.matchMedia(Ls(n)),"addEventListener"in s?s.addEventListener("change",a):s.addListener(a),r.value=s.matches)});return Rs(()=>{l(),c(),s=void 0}),r}function Py(n,e,t={}){const{window:i=En,...s}=t;let r;const a=dl(()=>i&&"ResizeObserver"in i),c=()=>{r&&(r.disconnect(),r=void 0)},l=o.computed(()=>Array.isArray(n)?n.map(f=>kt(f)):[kt(n)]),d=o.watch(l,f=>{if(c(),a.value&&i){r=new ResizeObserver(e);for(const p of f)p&&r.observe(p,s)}},{immediate:!0,flush:"post"}),h=()=>{c(),d()};return Rs(h),{isSupported:a,stop:h}}function Ny(n,e={width:0,height:0},t={}){const{window:i=En,box:s="content-box"}=t,r=o.computed(()=>{var f,p;return(p=(f=kt(n))==null?void 0:f.namespaceURI)==null?void 0:p.includes("svg")}),a=o.ref(e.width),c=o.ref(e.height),{stop:l}=Py(n,([f])=>{const p=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const u=kt(n);if(u){const m=u.getBoundingClientRect();a.value=m.width,c.value=m.height}}else if(p){const u=Array.isArray(p)?p:[p];a.value=u.reduce((m,{inlineSize:E})=>m+E,0),c.value=u.reduce((m,{blockSize:E})=>m+E,0)}else a.value=f.contentRect.width,c.value=f.contentRect.height},t);cl(()=>{const f=kt(n);f&&(a.value="offsetWidth"in f?f.offsetWidth:e.width,c.value="offsetHeight"in f?f.offsetHeight:e.height)});const d=o.watch(()=>kt(n),f=>{a.value=f?e.width:0,c.value=f?e.height:0});function h(){l(),d()}return{width:a,height:c,stop:h}}function hl(n={}){const{window:e=En,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0}=n,a=o.ref(t),c=o.ref(i),l=()=>{e&&(r?(a.value=e.innerWidth,c.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,c.value=e.document.documentElement.clientHeight))};if(l(),cl(l),Dy("resize",l,{passive:!0}),s){const d=ul("(orientation: portrait)");o.watch(d,()=>l())}return{width:a,height:c}}function ui(){const{width:n,height:e}=hl(),t=ul("(pointer: coarse)"),i=o.ref(!1),s=o.ref(!1),r=o.ref(!0),a=o.ref("other"),c=o.ref("other"),l=o.ref("medium"),d=o.ref("portrait"),h=()=>{const m=navigator.userAgent.toLowerCase(),E=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i,A=navigator;if("userAgentData"in navigator&&A.userAgentData?.mobile!==void 0)return A.userAgentData.mobile||E.test(m);if(E.test(m))return!0;const b=/windows nt/i.test(m),w=/macintosh|mac os x/i.test(m)&&!/mobile/i.test(m),I=/linux/i.test(m)&&!/android/i.test(m);return!1},f=()=>{const m=navigator.userAgent.toLowerCase();i.value=h(),s.value=n.value>=768&&n.value<1024&&t.value,r.value=!i.value,/iphone|ipad|ipod/i.test(m)?a.value="ios":/android/i.test(m)?a.value="android":/win/i.test(m)?a.value="windows":/mac/i.test(m)?a.value="macos":/linux/i.test(m)&&(a.value="linux"),/safari/i.test(m)&&!/chrome/i.test(m)?c.value="safari":/chrome/i.test(m)?c.value="chrome":/firefox/i.test(m)?c.value="firefox":/edge/i.test(m)&&(c.value="edge"),n.value<576?l.value="small":n.value<1024?l.value="medium":l.value="large",d.value=n.value>e.value?"landscape":"portrait"},p=()=>{f()};o.onMounted(()=>{f(),window.addEventListener("resize",p),window.addEventListener("orientationchange",p)}),o.onUnmounted(()=>{window.removeEventListener("resize",p),window.removeEventListener("orientationchange",p)});const u=()=>({isMobile:i.value,isTablet:s.value,isDesktop:r.value,isTouchDevice:t.value,os:a.value,browser:c.value,screenSize:l.value,orientation:d.value});return{isMobile:o.readonly(i),isTablet:o.readonly(s),isDesktop:o.readonly(r),isTouchDevice:o.readonly(t),os:o.readonly(a),browser:o.readonly(c),screenSize:o.readonly(l),orientation:o.readonly(d),width:n,height:e,info:u}}const Fy={class:"title"},Ry={class:"actions"},Ly={class:"card-body"},Oy=o.defineComponent({__name:"LeitingDraggableCard",props:{visible:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},title:{type:String,default:"Title"},initialPosition:{type:Object,default:()=>({x:0,y:0})},width:{type:[Number,String],default:300},minWidth:{type:Number,default:200},fullHeight:{type:Boolean,default:!1},align:{type:String,default:""}},emits:["update:visible","update:open","close"],setup(n,{emit:e}){const t=n,i=o.inject("leiting-theme",o.ref("dark")),{isMobile:s}=ui(),r=e,a=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:B=>{r("update:visible",B),r("update:open",B)}}),c=o.ref(null),l=o.ref(t.initialPosition?.x||0),d=o.ref(t.initialPosition?.y||0),h=o.ref(t.width),f=o.ref(t.fullHeight?"100%":"600px");o.watch(()=>t.fullHeight,B=>{B?f.value="100%":f.value==="100%"&&(f.value="600px")});const{height:p}=hl();o.watch(p,()=>{t.fullHeight&&(f.value="100%")});const u=o.ref(!1),m=B=>{u.value=!0,B.preventDefault(),B.stopPropagation();const g=B.clientX,R=B.clientY,x=typeof h.value=="number"?h.value:c.value?.offsetWidth||0,M=typeof f.value=="number"?f.value:c.value?.offsetHeight||0,L=k=>{if(!u.value)return;k.preventDefault();const C=k.clientX-g,y=k.clientY-R,v=x+C,P=M+y;v>100&&(h.value=v),P>100&&(f.value=P)},V=()=>{u.value=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",V)};document.addEventListener("mousemove",L),document.addEventListener("mouseup",V)},E=o.computed(()=>({left:`${l.value}px`,top:`${d.value}px`,width:typeof h.value=="number"?`${h.value}px`:h.value,height:typeof f.value=="number"?`${f.value}px`:f.value,position:"absolute",zIndex:2e3})),A=()=>{o.nextTick(()=>{if(c.value){const B=c.value.offsetParent||document.body,g=B.clientWidth,R=B.clientHeight,x=typeof h.value=="number"?h.value:c.value.offsetWidth||350,M=typeof f.value=="number"?f.value:c.value.offsetHeight||600;l.value+x>g&&(l.value=Math.max(0,g-x-20)),d.value+M>R&&(d.value=Math.max(0,R-M-20)),l.value<0&&(l.value=0),d.value<0&&(d.value=0)}})},b=o.ref(!1),w=B=>{if(B.target.closest(".close-btn")||B.target.closest(".actions"))return;b.value=!0,B.preventDefault(),B.stopPropagation();const g=B.clientX,R=B.clientY,x=l.value,M=d.value,L=k=>{if(!b.value)return;k.preventDefault();const C=k.clientX-g,y=k.clientY-R;l.value=x+C,d.value=M+y},V=()=>{b.value=!1,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",V),A()};document.addEventListener("mousemove",L),document.addEventListener("mouseup",V)},I=()=>{o.nextTick(()=>{if(t.align&&c.value){const B=c.value.offsetParent||document.body,g=typeof h.value=="number"?h.value:c.value.offsetWidth||350;t.align==="right"?l.value=Math.max(0,B.clientWidth-g-20):t.align==="center"&&(l.value=Math.max(0,(B.clientWidth-g)/2))}A()})};o.onMounted(()=>{t.align?I():A()}),o.watch(a,B=>{B&&(t.align?I():A())});const D=()=>{a.value=!1,r("close")},N=B=>{if(B.target.closest(".close-btn")||B.target.closest(".actions")||B.touches.length!==1)return;b.value=!0,B.preventDefault(),B.stopPropagation();const g=B.touches[0],R=g?.clientX??0,x=g?.clientY??0,M=l.value,L=d.value,V=C=>{if(!b.value||C.touches.length!==1)return;C.preventDefault();const y=C.touches[0],v=(y?.clientX??0)-R,P=(y?.clientY??0)-x;l.value=M+v,d.value=L+P},k=()=>{b.value=!1,document.removeEventListener("touchmove",V),document.removeEventListener("touchend",k),A()};document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",k)},S=B=>{if(B.touches.length!==1)return;u.value=!0,B.preventDefault(),B.stopPropagation();const g=B.touches[0],R=g?.clientX??0,x=g?.clientY??0,M=typeof h.value=="number"?h.value:c.value?.offsetWidth||0,L=typeof f.value=="number"?f.value:c.value?.offsetHeight||0,V=C=>{if(!u.value||C.touches.length!==1)return;C.preventDefault();const y=C.touches[0],v=(y?.clientX??0)-R,P=(y?.clientY??0)-x,F=M+v,U=L+P;F>100&&(h.value=F),U>100&&(f.value=U)},k=()=>{u.value=!1,document.removeEventListener("touchmove",V),document.removeEventListener("touchend",k)};document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",k)};return(B,g)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"cardRef",ref:c,class:o.normalizeClass(["draggable-card leiting-scroll",["leiting-theme-"+o.unref(i)]]),style:o.normalizeStyle(E.value)},[o.createElementVNode("div",{ref:"headerRef",class:"card-header",onMousedown:w,onTouchstart:N},[o.createElementVNode("span",Fy,o.toDisplayString(n.title),1),o.createElementVNode("div",Ry,[o.renderSlot(B.$slots,"header-extra",{},void 0,!0),o.createElementVNode("span",{class:"close-btn",onClick:D},"×")])],544),o.createElementVNode("div",Ly,[o.renderSlot(B.$slots,"default",{},void 0,!0)]),o.unref(s)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"resize-handle",onMousedown:m,onTouchstart:S},[...g[0]||(g[0]=[o.createElementVNode("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"currentColor"},[o.createElementVNode("path",{d:"M10 10 L10 2 L2 10 Z"})],-1)])],32))],6)),[[o.vShow,a.value]])}}),ge=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},Le=ge(Oy,[["__scopeId","data-v-4d38393b"]]);function fl(n){const e=o.ref([]),t=o.ref([]),i=o.ref([]),s=o.ref(""),r=o.ref(!0);o.watch(()=>o.unref(n),f=>{if(!f||f.length===0)return;const p=[],u=(A,b)=>{A.forEach(w=>{const I=w.id||w.key||w.$id,D=w.modelId||b;D&&(w.modelId=D),I&&p.push(I),w.children&&w.children.length>0&&u(w.children,D)})};u(f);const m=new Set(i.value);let E=!1;p.forEach(A=>{m.has(A)||(m.add(A),E=!0)}),E&&(i.value=Array.from(m))},{immediate:!0,deep:!0});const a=o.computed(()=>{const f=o.unref(n);if(!f)return[];const p=[],u=(m,E)=>{m.forEach(A=>{const b=A.id||A.key||A.$id,w=A.name||A.title;p.push({key:b,title:w,parentKey:E}),A.children&&A.children.length>0&&u(A.children,b)})};return u(f),p}),c=f=>{e.value=f,r.value=!1},l=f=>{i.value=f},d=f=>{t.value=f},h=f=>a.value.find(u=>u.key===f)?.parentKey;return o.watch(s,f=>{if(!f)return;const u=a.value.filter(E=>E.title&&E.title.toLowerCase().includes(f.toLowerCase())).map(E=>E.parentKey),m=new Set;u.forEach(E=>{let A=E;for(;A;)m.add(A),A=h(A)}),e.value=[...m],r.value=!0}),{expandedKeys:e,selectedKeys:t,checkedKeys:i,searchValue:s,autoExpandParent:r,onExpand:c,onCheck:l,onSelect:d}}const Uy={class:"search-box"},_y={key:0},Qy={style:{color:"#f50"}},Vy={key:1},Gy={key:1,class:"empty-tip"},hi=ge(o.defineComponent({__name:"LeitingTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"构件树"},width:{type:[Number,String],default:320},treeData:{type:Array,default:()=>[]},initialPosition:{type:Object,default:()=>({x:0,y:0})},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close","select","check"],setup(n,{emit:e}){const t=ie.Input.Search,i=ie.Tree,s=n,r=e,a=o.inject("leiting-theme",o.ref("dark")),c=o.inject("leitingMethods"),l=x=>{c?.value?.onSearchComponent&&c.value.onSearchComponent(x)},d=o.computed({get:()=>s.open!==void 0?s.open:s.visible,set:x=>{r("update:visible",x),r("update:open",x)}}),h=o.ref(null),{height:f}=Ny(h),p=o.computed(()=>f.value||300),u=o.ref({children:"children",title:"name",key:"id"}),m=o.ref([]),{expandedKeys:E,selectedKeys:A,checkedKeys:b,searchValue:w,autoExpandParent:I}=fl(o.toRef(s,"treeData")),D=(x,M)=>{if(!M)return x;const L=M.toLowerCase();return x.reduce((V,k)=>{const y=(k.name||k.title||"").toLowerCase().includes(L);if(k.children&&k.children.length>0){const v=D(k.children,M);(v.length>0||y)&&V.push({...k,children:v})}else y&&V.push({...k});return V},[])};o.watch([()=>s.treeData,w],([x,M])=>{x?m.value=D(x,M||""):m.value=[]},{immediate:!0,deep:!0});const N=x=>{E.value=x,I.value=!1},S=x=>{const M=[],L=V=>{if(!V.children||V.children.length===0){const C=V.element_Id;V.modelId&&C&&M.push({modelId:V.modelId,elementId:C})}else V.children.forEach(L)};return L(x),M},B=(x,M)=>{b.value=x,r("check",x,M);const L=[],V=new Set(x.map(C=>String(C))),k=C=>{for(let y=0;y<C.length;y++){const v=C[y];if(!v.children||v.children.length===0){if(!V.has(String(v.id))){const U=v.element_Id;v.modelId&&U&&L.push({modelId:v.modelId,elementId:U,show:!1})}}else v.children&&k(v.children)}};s.treeData&&k(s.treeData),c?.value?.setComponentVisibility&&c.value.setComponentVisibility(L),c?.value?.onTreeCheck&&c.value.onTreeCheck(x,M)},g=(x,M)=>{if(A.value=x,r("select",x,M),M.selected){const L=S(M.node);L.length>0&&c?.value?.flyToObjects&&c.value.flyToObjects({selectCpts:L})}c?.value?.onTreeSelect&&c.value.onTreeSelect(x,M)},R=()=>{r("update:visible",!1),r("close")};return(x,M)=>(o.openBlock(),o.createBlock(Le,{visible:d.value,"onUpdate:visible":M[1]||(M[1]=L=>d.value=L),title:n.title,"initial-position":n.initialPosition,"full-height":n.fullHeight,onClose:R},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["leiting-tree-container",[`theme-${o.unref(a)}`]])},[o.createElementVNode("div",Uy,[o.createVNode(o.unref(t),{value:o.unref(w),"onUpdate:value":M[0]||(M[0]=L=>o.isRef(w)?w.value=L:null),placeholder:"搜索构件","allow-clear":"","enter-button":"",onSearch:l},null,8,["value"])]),o.createElementVNode("div",{class:"tree-wrapper",ref_key:"treeWrapperRef",ref:h},[m.value&&m.value.length?(o.openBlock(),o.createBlock(o.unref(i),{key:0,"tree-data":m.value,"field-names":u.value,height:p.value,"expanded-keys":o.unref(E),"auto-expand-parent":o.unref(I),"selected-keys":o.unref(A),"checked-keys":o.unref(b),checkable:"","block-node":"",onExpand:N,onSelect:g,onCheck:B},{title:o.withCtx(({name:L,title:V})=>[(L||V)&&o.unref(w)&&(L||V).toLowerCase().indexOf(o.unref(w).toLowerCase())>-1?(o.openBlock(),o.createElementBlock("span",_y,[o.createTextVNode(o.toDisplayString((L||V).substr(0,(L||V).toLowerCase().indexOf(o.unref(w).toLowerCase())))+" ",1),o.createElementVNode("span",Qy,o.toDisplayString(o.unref(w)),1),o.createTextVNode(" "+o.toDisplayString((L||V).substr((L||V).toLowerCase().indexOf(o.unref(w).toLowerCase())+o.unref(w).length)),1)])):(o.openBlock(),o.createElementBlock("span",Vy,o.toDisplayString(L||V),1))]),_:1},8,["tree-data","field-names","height","expanded-keys","auto-expand-parent","selected-keys","checked-keys"])):(o.openBlock(),o.createElementBlock("div",Gy,"暂无数据"))],512)],2)]),_:1},8,["visible","title","initial-position","full-height"]))}}),[["__scopeId","data-v-3748c20d"]]),Hy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",fi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAERSURBVDhPvZTrEYIwEISTCrQD6EA7gA60AylBK1Aq0A7ECrQDoQPsADrACuLuTMJkIiHxjzezgyR7H3d5KJVSqRAigcaQUjYYX2JgZY/P/O4lEgYYFo7pgPcc2kSCBoIUzDeo0klPPEsNYlX7AKzA/M6ASrRzYoIGG5DAOCvzBvzMOxqQazSgLLI1QdAW5jWpUAPV0AVKIc7FRCuNy7RkWozJtj1BED7ANbpDXHhffFXUwUnZwRYp7qw7Rx8/lLkV9R4QD2w1A8pjW3sA4h5au+pXEBS76P8D6Ut9/nXXaiRQdnBXqBfEC+4GdzSxW5v6F7CTeHnbCVCBsWIE+RYVrdF4DSz6OwgiADDexbmT3X0A4fSDfDjUugcAAAAASUVORK5CYII=",Yy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",zy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHDSURBVDhPlZOxL0NRFIe9ECubhehoIIjJ1HYwCkIiJpUQEkN1YZBobU0kFKNI3iTGYrDRv0BIhLXCYpCwiO35fs25zWva98JNvpz37j33d8+551yvLWIEQXDG0izMe55XjvJz816MUJG1LVuvYJcQrEb5xwkV2JSHGfAhgBJiu63E4oSUzpRtusa+wBooKkWnKOujQYh7SbCShQx0m9cpds4iOseOw7BFmUPwU341IQT2MaOQgi9QND+wiqNnBxT4X7SIbrAqhNI9wiUvJ+W8A99wDEWdwrw25iVkkenAEb5LkIQPuIMJWJGQoriFd+iBCkhc8zUhfJSm7mva5l3aadubDgtpMgGKpB/eoBfuQZFoPNhBj9gTaC3kKkEEGXPswF7Y5rLro1AW8UI6GmelmAzfkUWlNaWt6/iT0DOOA5bqoSuzHfIvofATqSJQb8KoiJbtPi6x2dA9FPjXE1F/uZKrv3IwCFcNqVmoPlal7QJ9q/wZCbk7Ioo9/tehE9q1r0nIxNQbG4YEXdkVjQ5J2OZXbB88gVrgQIJNj9aaT4LboPK7J6O0Ktb1KYtc/aYxGff6h3AYY6Nvzk2GQ1WQTVj4BST70jYaqceXAAAAAElFTkSuQmCC",Wy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",jy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",Ky="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEcSURBVDhPrZSNDYIwEIXpBOIGjMAIOIE4AbgBGwAbOIJu4Aa4gW4gI+gE9b3mjjSmibSR5ALX3H33W4y1Ns+yrIe0EH7HPC8YnyGjAegkEB5cYyiwrdWXIEc1xnSREGcuiTQEWeg7gG4+CMcl9ALnLkvogwScv+wq6FMQJJCJDgBtBcSAI3QClwe2YZAHcY2Ho4kGAVLA6U5/CEvdp4KYhesFhBPpCZIAz6jStHhproJcHyAHbb5nF+6RZ8CsGslIQaHp/gSxRzlApU4GugPxNuDN/eNarAJxapUPgm8rQ9C1SAI9AOGiHhGApSdnRN8FshbEiLwiLI1rMUM6zSQ0tX9c2lp/Iw0iMIPU38iFIN1mTmOjKa98vyWB4QM5XQnvsbFsyAAAAABJRU5ErkJggg==",$y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",Xy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",qy={class:"menu-container"},Jy=["onClick","title"],Zy={class:"menu-icon"},e0=["src","alt"],t0={key:3,style:{"font-size":"12px"}},n0={key:0,class:"sub-menu"},i0=["onClick"],bn=o.defineComponent({__name:"LeitingMenu",props:{visible:{type:Boolean,default:!0},activeIds:{type:Array,default:()=>[]},is2d:{type:Boolean,default:!1},customItems:{type:Array,default:()=>[]}},emits:["action"],setup(n,{emit:e}){const t=n,i=o.inject("leiting-theme",o.ref("dark")),s=o.inject("leiting-menu-size",o.ref("medium")),r=o.inject("leitingMethods",o.ref({})),a=o.computed(()=>i.value||i),c=o.computed(()=>s.value||s),l=o.ref([{ID:"home",title:"主视角",src:Hy,key:"homeView"},{ID:"tree",title:"目录树",src:fi,key:"componentTree"},{ID:"cadLayer",title:"图层",src:fi,key:"cadLayer"},{ID:"measure",title:"量算",src:Yy,key:"measurement"},{ID:"section",title:"剖切",src:zy,key:"section"},{ID:"roam",title:"人物漫游",src:Wy,key:"roam"},{ID:"info",title:"构件信息",src:jy,key:"componentInfo"},{ID:"cadPosition",title:"调整位置",src:Ky,key:"cadPosition"},{ID:"annotation",title:"标注",src:Xy,key:"annotation"},{ID:"setting",title:"设置",src:$y,key:"setting"}]),d=o.ref([]),h=o.ref([...t.activeIds]);o.watch(()=>t.activeIds,D=>{h.value=[...D]},{deep:!0});const f=o.computed(()=>t.visible);r.value&&r.value.menuEvents&&(r.value.menuEvents.on("setMenuListFilter",D=>{d.value=D}),r.value.menuEvents.on("setMenuActive",(D,N)=>{N?h.value.includes(D)||h.value.push(D):h.value=h.value.filter(S=>S!==D)}));const p=o.computed(()=>{let D=l.value;if(t.is2d){const N=["homeView","measurement","cadLayer","annotation"];D=D.filter(S=>S.key&&N.includes(S.key))}else{const N=["cadLayer","cadPosition","annotation"];D=D.filter(S=>!S.key||!N.includes(S.key))}if(d.value.length>0&&(D=D.filter(N=>!N.key||!d.value.includes(N.key))),t.customItems&&t.customItems.length>0){const N=t.customItems.map(S=>({...S,key:S.ID,src:S.src||S.icon}));return[...D,...N]}return D}),u=e,m=D=>{const N=["homeView"];if(D.key&&N.includes(D.key))h.value.includes(D.ID)||(h.value.push(D.ID),setTimeout(()=>{const B=h.value.indexOf(D.ID);B>-1&&h.value.splice(B,1)},1e3));else{const B=h.value.indexOf(D.ID);B>-1?h.value.splice(B,1):h.value.push(D.ID)}const S=h.value.includes(D.ID);D.func&&D.func(D),D.key&&u("action",D.key,S)},E=D=>{d.value=D},A=D=>{console.log("LeitingMenu received showMenu event:",D)},b=(D,N)=>{const S=p.value.find(B=>B.ID===D||B.key===D);if(S){const B=h.value.indexOf(S.ID);N&&B===-1?h.value.push(S.ID):!N&&B>-1&&h.value.splice(B,1)}};let w=null;const I=()=>{r.value?.menuEvents&&(w&&(w.off("setMenuListFilter",E),w.off("showMenu",A),w.off("setMenuActive",b)),w=r.value.menuEvents,w.on("setMenuListFilter",E),w.on("showMenu",A),w.on("setMenuActive",b))};return o.onMounted(()=>{I()}),o.onUnmounted(()=>{w&&(w.off("setMenuListFilter",E),w.off("showMenu",A),w.off("setMenuActive",b))}),o.watch(r,()=>{I()},{deep:!0}),(D,N)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["leiting-menu-wrapper",["leiting-theme-"+a.value,"size-"+c.value]])},[o.createElementVNode("div",qy,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,S=>(o.openBlock(),o.createElementBlock("div",{key:S.ID,class:o.normalizeClass(["menu-item",{active:h.value.includes(S.ID)}]),onClick:B=>m(S),title:S.title},[o.createElementVNode("div",Zy,[S.src?(o.openBlock(),o.createElementBlock("img",{key:0,src:S.src,alt:S.title},null,8,e0)):typeof S.icon=="object"?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(S.icon),{key:1})):typeof S.icon=="string"?(o.openBlock(),o.createElementBlock("i",{key:2,class:o.normalizeClass(["iconfont",`icon-${S.icon}`])},null,2)):(o.openBlock(),o.createElementBlock("span",t0,o.toDisplayString(S.title.substring(0,2)),1))]),S.children&&S.children.length>0?(o.openBlock(),o.createElementBlock("div",n0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(S.children,B=>(o.openBlock(),o.createElementBlock("div",{key:B.ID,class:o.normalizeClass(["sub-menu-item",{active:h.value.includes(B.ID)}]),onClick:o.withModifiers(g=>m(B),["stop"])},o.toDisplayString(B.title),11,i0))),128))])):o.createCommentVNode("",!0)],10,Jy))),128))])],2)),[[o.vShow,f.value]])}}),s0={class:"leiting-section-content"},o0={class:"section-form-item"},r0={class:"radio-group"},a0={class:"section-form-item"},l0={class:"switch-container"},c0={class:"switch"},d0={class:"status-text"},u0={class:"section-form-item slider-item"},h0={class:"slider-wrapper"},f0={class:"section-form-item slider-item"},p0={class:"slider-wrapper"},m0={class:"section-form-item slider-item"},g0={class:"slider-wrapper"},A0={class:"section-form-item table-item"},y0={class:"model-table-container"},C0={class:"model-table"},E0={width:"40"},b0=["checked"],w0=["onClick"],v0=["value"],I0={class:"model-name"},wn=ge(o.defineComponent({__name:"LeitingSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"剖切控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:k=>{i("update:visible",k),i("update:open",k)}}),a=o.ref("Box"),c=o.ref(!1),l=o.ref([]),d=o.ref([]),h=o.computed(()=>d.value.length===0?!1:d.value.every(k=>l.value.includes(k.modelId))),f=k=>{k.target.checked?l.value=d.value.map(y=>y.modelId):l.value=[],R()},p=o.ref([-10,10]),u=o.ref([-10,10]),m=o.ref([-10,10]),E=o.ref([-100,100]),A=o.ref([-100,100]),b=o.ref([-100,100]);let w=!1;const I=k=>{w=!0;const{targetZPlus:C,targetZMinus:y,targetXPlus:v,targetXMinus:P,targetYPlus:F,targetYMinus:U}=k;m.value=[-y,C],p.value=[-P,v],u.value=[-U,F],setTimeout(()=>{w=!1},100)},D=()=>{w||l.value.length===0||!s?.value?.updateSectionRange||s.value.updateSectionRange({targetZPlus:m.value[1],targetZMinus:-m.value[0],targetXPlus:p.value[1],targetXMinus:-p.value[0],targetYPlus:u.value[1],targetYMinus:-u.value[0]})},N=()=>{s?.value?.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(c.value)},S=k=>{if(!s?.value?.getMapTileset||!s?.value?.openSection)return;const y=s.value.getMapTileset()[k];if(y&&y.leiting?.box){const{min:v,max:P}=y.leiting.box,F=(P.x-v.x)/2,U=(P.y-v.y)/2,O=(P.z-v.z)/2;l.value.length<=1&&(E.value=[-F*2,F*2],A.value=[-U*2,U*2],b.value=[-O*2,O*2],p.value=[-F,F],u.value=[-U,U],m.value=[-O,O],s.value.updateSectionRange&&s.value.updateSectionRange({targetZPlus:O,targetZMinus:O,targetXPlus:F,targetXMinus:F,targetYPlus:U,targetYMinus:U})),s.value.openSection(k,{moveCallBack:I}),s.value.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(c.value)}},B=k=>{const C=l.value.indexOf(k);C>-1?l.value.splice(C,1):l.value.push(k),R()};let g=[];const R=()=>{const k=l.value.filter(y=>!g.includes(y)),C=g.filter(y=>!l.value.includes(y));k.forEach(y=>S(y)),C.forEach(y=>{s?.value?.closeSection&&s.value.closeSection(y)}),g=[...l.value]},x=()=>{},M=()=>{r.value=!1,i("close")},L=()=>{c.value=!1,l.value=[],g=[],p.value=[-10,10],u.value=[-10,10],m.value=[-10,10],E.value=[-100,100],A.value=[-100,100],b.value=[-100,100]};o.watch(()=>t.visible,k=>{k?V():(s?.value?.closeSection&&s.value.closeSection(),L())});const V=()=>{s?.value&&typeof s.value.getModelList=="function"&&(d.value=s.value.getModelList()||[],d.value.length>0&&l.value.length===0&&(l.value=[d.value[0].modelId],g=[...l.value]),t.visible&&l.value.length>0&&(c.value=!0,l.value.forEach(k=>S(k))))};return o.watch(()=>s?.value,()=>{V()},{immediate:!0,deep:!0}),o.onMounted(()=>{V()}),(k,C)=>(o.openBlock(),o.createBlock(Le,{visible:r.value,title:"剖切分析","full-height":n.fullHeight,"onUpdate:visible":M},{default:o.withCtx(()=>[o.createElementVNode("div",s0,[o.createElementVNode("div",o0,[C[8]||(C[8]=o.createElementVNode("span",{class:"label"},"模式",-1)),o.createElementVNode("div",r0,[o.createElementVNode("label",{class:o.normalizeClass(["radio-item",{active:a.value==="Box"}])},[o.withDirectives(o.createElementVNode("input",{type:"radio",value:"Box","onUpdate:modelValue":C[0]||(C[0]=y=>a.value=y),onChange:x},null,544),[[o.vModelRadio,a.value]]),C[7]||(C[7]=o.createTextVNode(" 剖切盒 ",-1))],2)])]),o.createElementVNode("div",a0,[C[10]||(C[10]=o.createElementVNode("span",{class:"label"},"显示",-1)),o.createElementVNode("div",l0,[o.createElementVNode("label",c0,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":C[1]||(C[1]=y=>c.value=y),onChange:N},null,544),[[o.vModelCheckbox,c.value]]),C[9]||(C[9]=o.createElementVNode("span",{class:"slider round"},null,-1))]),o.createElementVNode("span",d0,o.toDisplayString(c.value?"显示":"隐藏"),1)])]),o.createElementVNode("div",u0,[C[11]||(C[11]=o.createElementVNode("span",{class:"label"},"X 轴",-1)),o.createElementVNode("div",h0,[o.createVNode(o.unref(ie.Slider),{value:p.value,"onUpdate:value":C[2]||(C[2]=y=>p.value=y),range:"",min:E.value[0],max:E.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),o.createElementVNode("div",f0,[C[12]||(C[12]=o.createElementVNode("span",{class:"label"},"Y 轴",-1)),o.createElementVNode("div",p0,[o.createVNode(o.unref(ie.Slider),{value:u.value,"onUpdate:value":C[3]||(C[3]=y=>u.value=y),range:"",min:A.value[0],max:A.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),o.createElementVNode("div",m0,[C[13]||(C[13]=o.createElementVNode("span",{class:"label"},"Z 轴",-1)),o.createElementVNode("div",g0,[o.createVNode(o.unref(ie.Slider),{value:m.value,"onUpdate:value":C[4]||(C[4]=y=>m.value=y),range:"",min:b.value[0],max:b.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),o.createElementVNode("div",A0,[C[15]||(C[15]=o.createElementVNode("span",{class:"label"},"模型",-1)),o.createElementVNode("div",y0,[o.createElementVNode("table",C0,[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",E0,[o.createElementVNode("input",{type:"checkbox",checked:h.value,onChange:f},null,40,b0)]),C[14]||(C[14]=o.createElementVNode("th",null,"名称",-1))])]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,y=>(o.openBlock(),o.createElementBlock("tr",{key:y.modelId,class:o.normalizeClass({selected:l.value.includes(y.modelId)}),onClick:v=>B(y.modelId)},[o.createElementVNode("td",null,[o.withDirectives(o.createElementVNode("input",{type:"checkbox",value:y.modelId,"onUpdate:modelValue":C[5]||(C[5]=v=>l.value=v),onClick:C[6]||(C[6]=o.withModifiers(()=>{},["stop"])),onChange:R},null,40,v0),[[o.vModelCheckbox,l.value]])]),o.createElementVNode("td",I0,o.toDisplayString(y.modelName),1)],10,w0))),128))])])])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-ee4d9a12"]]),B0={class:"leiting-player-content"},x0={class:"player-form-item"},S0={class:"switch-container"},T0={class:"switch"},M0={class:"status-text"},D0={class:"player-form-item"},k0={class:"switch-container"},P0={class:"switch"},N0={class:"status-text"},F0={class:"player-form-item"},R0={class:"switch-container"},L0={class:"switch"},O0={class:"status-text"},U0={class:"player-form-item slider-item"},_0={class:"slider-wrapper"},Q0={class:"value-text"},V0={class:"instructions"},G0={class:"key-map"},H0={class:"key-row"},Y0={class:"key-row"},z0={class:"key-row"},W0={class:"key-row"},j0={class:"key-row"},K0={class:"key-row"},vn=ge(o.defineComponent({__name:"LeitingPlayer",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"漫游控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.ref(!1),a=o.ref(!1),c=o.ref(!0),l=o.ref(5),d=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:S=>{i("update:visible",S),i("update:open",S)}}),h=o.ref(null),f=o.ref(null),p=o.ref(null),u=o.ref(null),m=o.ref(null),E=o.ref(null),A=()=>{r.value?w():I()},b=()=>{s?.value?.setPlayerParams&&s.value.setPlayerParams({gravityTest:a.value,collisionTest:c.value})},w=async()=>{s?.value?.openPlayer&&(await s.value.openPlayer(),s.value.setPlayerSpeed&&s.value.setPlayerSpeed(l.value),b(),s.value.bindPlayerUiKeys&&(await o.nextTick(),s.value.bindPlayerUiKeys({moveFront:h.value,moveBack:f.value,moveLeft:p.value,moveRight:u.value,moveUp:m.value,moveDown:E.value})))},I=()=>{s?.value?.closePlayer&&s.value.closePlayer()},D=()=>{s?.value?.setPlayerSpeed&&s.value.setPlayerSpeed(l.value)},N=()=>{d.value=!1,i("close")};return o.watch(()=>t.visible,S=>{S?(r.value=!0,s?.value?w():setTimeout(()=>{s?.value&&w()},100)):r.value&&(r.value=!1,I())},{immediate:!0}),(S,B)=>(o.openBlock(),o.createBlock(Le,{title:n.title,visible:d.value,"full-height":n.fullHeight,"onUpdate:visible":N},{default:o.withCtx(()=>[o.createElementVNode("div",B0,[o.createElementVNode("div",x0,[B[5]||(B[5]=o.createElementVNode("span",{class:"label"},"启用",-1)),o.createElementVNode("div",S0,[o.createElementVNode("label",T0,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[0]||(B[0]=g=>r.value=g),onChange:A},null,544),[[o.vModelCheckbox,r.value]]),B[4]||(B[4]=o.createElementVNode("span",{class:"slider round"},null,-1))]),o.createElementVNode("span",M0,o.toDisplayString(r.value?"开启":"关闭"),1)])]),o.createElementVNode("div",D0,[B[7]||(B[7]=o.createElementVNode("span",{class:"label"},"重力",-1)),o.createElementVNode("div",k0,[o.createElementVNode("label",P0,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[1]||(B[1]=g=>a.value=g),onChange:b},null,544),[[o.vModelCheckbox,a.value]]),B[6]||(B[6]=o.createElementVNode("span",{class:"slider round"},null,-1))]),o.createElementVNode("span",N0,o.toDisplayString(a.value?"开启":"关闭"),1)])]),o.createElementVNode("div",F0,[B[9]||(B[9]=o.createElementVNode("span",{class:"label"},"碰撞",-1)),o.createElementVNode("div",R0,[o.createElementVNode("label",L0,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[2]||(B[2]=g=>c.value=g),onChange:b},null,544),[[o.vModelCheckbox,c.value]]),B[8]||(B[8]=o.createElementVNode("span",{class:"slider round"},null,-1))]),o.createElementVNode("span",O0,o.toDisplayString(c.value?"开启":"关闭"),1)])]),o.createElementVNode("div",U0,[B[10]||(B[10]=o.createElementVNode("span",{class:"label"},"速度",-1)),o.createElementVNode("div",_0,[o.createVNode(o.unref(ie.Slider),{value:l.value,"onUpdate:value":B[3]||(B[3]=g=>l.value=g),min:1,max:10,step:1,onChange:D},null,8,["value"])]),o.createElementVNode("span",Q0,o.toDisplayString(l.value),1)]),B[19]||(B[19]=o.createElementVNode("div",{class:"divider"},null,-1)),o.createElementVNode("div",V0,[B[18]||(B[18]=o.createElementVNode("div",{class:"instruction-title"},"操作说明",-1)),o.createElementVNode("div",G0,[o.createElementVNode("div",H0,[o.createElementVNode("span",{class:"key",ref_key:"btnFront",ref:h},"W",512),B[11]||(B[11]=o.createTextVNode(" 前进 ",-1))]),o.createElementVNode("div",Y0,[o.createElementVNode("span",{class:"key",ref_key:"btnBack",ref:f},"S",512),B[12]||(B[12]=o.createTextVNode(" 后退 ",-1))]),o.createElementVNode("div",z0,[o.createElementVNode("span",{class:"key",ref_key:"btnLeft",ref:p},"A",512),B[13]||(B[13]=o.createTextVNode(" 左移 ",-1))]),o.createElementVNode("div",W0,[o.createElementVNode("span",{class:"key",ref_key:"btnRight",ref:u},"D",512),B[14]||(B[14]=o.createTextVNode(" 右移 ",-1))]),o.createElementVNode("div",j0,[o.createElementVNode("span",{class:"key",ref_key:"btnUp",ref:m},"Q",512),B[15]||(B[15]=o.createTextVNode(" 上升 ",-1))]),o.createElementVNode("div",K0,[o.createElementVNode("span",{class:"key",ref_key:"btnDown",ref:E},"E",512),B[16]||(B[16]=o.createTextVNode(" 下降 ",-1))]),B[17]||(B[17]=o.createElementVNode("div",{class:"key-row"},[o.createElementVNode("span",{class:"mouse-icon"},"🖱️"),o.createTextVNode(" 按住左键拖拽旋转视角 ")],-1))])])])]),_:1},8,["title","visible","full-height"]))}}),[["__scopeId","data-v-ff3f266e"]]),$0={class:"info-content"},X0={key:0,class:"component-title"},In=ge(o.defineComponent({__name:"LeitingInfo",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.ref([]),a=o.ref(!1),c=o.ref([]),l=o.ref([]),d=o.ref(0),h=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:b=>{i("update:visible",b),i("update:open",b)}}),f=()=>{h.value=!1},p=b=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[b]||b,u=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],m=async b=>{const w=++d.value;if(l.value=b,!b||b.length===0){r.value=[];return}if(!h.value)return;let I=b;b.length>10&&(ce.warning(`选中构件数量过多(${b.length}个),仅显示前10个`),I=b.slice(0,10));const D=s?.value;let N=D?.getMapTileset?D.getMapTileset():{};a.value=!0;const S=[],B={};I.forEach(x=>{const L=N[x.modelId]?.leiting?.model?.dbName;L&&x.elementId&&S.push({dbName:L,elementId:x.elementId,modelId:x.modelId})});const g=new Set;if(I.forEach(x=>{const M=N[x.modelId],L=`${x.modelId}_${x.elementId}`;B[L]||M&&M.leiting&&!M.leiting?.node?.nodeExtras&&M.leiting.model?.nodeUrl&&g.add(x.modelId)}),g.size>0&&D?._loadNodeDetailsForModel)try{const x=Array.from(g).map(M=>D._loadNodeDetailsForModel(M));await Promise.all(x)}catch(x){console.error("Failed to load node details",x)}if(w!==d.value)return;N=D?.getMapTileset?D.getMapTileset():{};const R=[];I.forEach((x,M)=>{const V=N[x.modelId]?.leiting||{},k=B[`${x.modelId}_${x.elementId}`];let C={modelName:V.model?.modelId||x.modelId};C.elementID||(C.elementID=x.elementId);let y=null;if(k)y=k;else{const F=V.node?.nodeExtras?.element||V.node?.nodeExtras;if(F){const U=C.elementID;F[U]&&(y=F[U])}}y&&y.box3&&(C.length=`${y.box3.length?.toFixed(2)||0}米`,C.width=`${y.box3.width?.toFixed(2)||0}米`,C.height=`${y.box3.height?.toFixed(2)||0}米`);const v=[];y&&(y.name&&(C.elementName=y.name),y.categoryName&&(C.categoryName=y.categoryName),y.familySymbolName&&(C.familySymbolName=y.familySymbolName),y.levelName&&(C.levelName=y.levelName));const P={};if(u.forEach(F=>{C[F]!==void 0&&(P[F]=C[F])}),v.push({name:"基础信息",params:P}),y){const F=Array.isArray(y)?y:Array.isArray(y?.parameters)?y.parameters:null;if(F){if(F.flat().forEach(O=>{if(O&&O.GroupName&&Array.isArray(O.Parameters)){const T={};O.Parameters.forEach(_=>{_.name&&(T[_.name]=_.value??"")}),Object.keys(T).length>0&&v.push({name:O.GroupName,params:T})}}),!Array.isArray(y)){const{parameters:O,...T}=y,_={};Object.keys(T).forEach(H=>{!u.includes(H)&&H!=="uniqueId"&&typeof T[H]!="object"&&(_[H]=T[H])}),Object.keys(_).length>0&&v.push({name:"其他属性",params:_})}}else{let U=!1;if(Object.keys(y).forEach(O=>{y[O]&&typeof y[O]=="object"&&!Array.isArray(y[O])&&(U=!0,v.push({name:O,params:y[O]}))}),!U){const O={};Object.keys(y).forEach(T=>{if(!u.includes(T)&&T!=="batchId"){const _=y[T];typeof _=="string"&&_.length>500?O[T]=_.substring(0,500)+"...":O[T]=_}}),Object.keys(O).length>0&&v.push({name:"属性",params:O})}}}R.push({id:M,title:`${C.modelName}${C.elementName?` - ${C.elementName}`:""}`,groups:v})}),r.value=R,w===d.value&&(a.value=!1),R.length>0?c.value=[`${R[0].id}-基础信息`]:c.value=[]};let E=!1;const A=()=>{if(E)return;const b=s?.value;b&&b.selectionChange&&(b.selectionChange(m),E=!0)};return o.watch(()=>s?.value,()=>{A()},{deep:!0,immediate:!0}),o.watch(h,b=>{b&&l.value.length>0&&m(l.value)}),o.onMounted(()=>{A()}),(b,w)=>(o.openBlock(),o.createBlock(Le,{visible:h.value,title:"构件详情",width:350,align:"right","initial-position":{x:0,y:0},"full-height":n.fullHeight,onClose:f,"onUpdate:visible":w[1]||(w[1]=I=>h.value=I),class:"base-info-card"},{default:o.withCtx(()=>[o.createElementVNode("div",$0,[o.createVNode(o.unref(ie.Spin),{spinning:a.value},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,I=>(o.openBlock(),o.createElementBlock("div",{key:I.id,class:"component-block"},[r.value.length>1?(o.openBlock(),o.createElementBlock("div",X0,o.toDisplayString(I.title),1)):o.createCommentVNode("",!0),o.createVNode(o.unref(ie.Collapse),{activeKey:c.value,"onUpdate:activeKey":w[0]||(w[0]=D=>c.value=D),ghost:"","expand-icon-position":"end"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.groups,D=>(o.openBlock(),o.createBlock(o.unref(ie.CollapsePanel),{key:`${I.id}-${D.name}`,header:D.name},{default:o.withCtx(()=>[o.createVNode(o.unref(ie.Descriptions),{size:"small",bordered:"",column:1,labelStyle:{width:"100px",background:"rgba(255,255,255,0.05)",color:"#aaa"},contentStyle:{color:"#fff"}},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(D.params,(N,S)=>(o.openBlock(),o.createBlock(o.unref(ie.DescriptionsItem),{key:S,label:p(String(S))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(N),1)]),_:2},1032,["label"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128))]),_:2},1032,["activeKey"])]))),128))]),_:1},8,["spinning"])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-375a1f55"]]);class pl{viewer;Cesium;pickHandler=null;bimEntityId="";mapEntityId="";constructor(e,t){this.viewer=e,this.Cesium=t}removeMarker(e){if(!this.viewer)return;const t=e==="BIM"?this.bimEntityId:this.mapEntityId;t&&(this.viewer.entities.removeById(t),e==="BIM"?this.bimEntityId="":this.mapEntityId="")}clearMarkers(){this.removeMarker("BIM"),this.removeMarker("MAP")}addMarker(e,t){if(!this.viewer||!this.Cesium)return;this.removeMarker(e);const i=`adjust-marker-${e}-${Date.now()}`;e==="BIM"?this.bimEntityId=i:this.mapEntityId=i,this.viewer.entities.add({id:i,position:this.Cesium.Cartesian3.fromDegrees(t.longitude,t.latitude,t.height),point:{pixelSize:10,color:e==="BIM"?this.Cesium.Color.RED:this.Cesium.Color.ORANGE,outlineColor:this.Cesium.Color.WHITE,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:`${e==="BIM"?"BIM":"地图"}标记点`,font:"14pt sans-serif",style:this.Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:new this.Cesium.Cartesian2(0,-10),fillColor:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLACK,backgroundColor:new this.Cesium.Color(.1,.1,.1,.8),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}registerPickHandler(e){this.destroyPickHandler(),!(!this.Cesium||!this.viewer)&&(this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pickHandler.setInputAction(t=>{let i;try{i=this.viewer.scene.pickPosition(t.position)}catch(s){console.warn("pickPosition failed:",s)}if(!i){const s=this.viewer.camera.getPickRay(t.position);i=this.viewer.scene.globe.pick(s,this.viewer.scene)}if(i||(i=this.viewer.camera.pickEllipsoid(t.position,this.viewer.scene.globe.ellipsoid)),i){const s=this.Cesium.Cartographic.fromCartesian(i),r=this.Cesium.Math.toDegrees(s.longitude),a=this.Cesium.Math.toDegrees(s.latitude),c=s.height;e({longitude:r,latitude:a,height:c})}},this.Cesium.ScreenSpaceEventType.LEFT_CLICK,this.Cesium.KeyboardEventModifier.SHIFT))}destroyPickHandler(){this.pickHandler&&(this.pickHandler.destroy(),this.pickHandler=null)}calculateOffset(e,t){return{dLon:t.longitude-e.longitude,dLat:t.latitude-e.latitude,dHeight:t.height-e.height}}}const q0={class:"adjust-panel"},J0={class:"control-panel"},Z0={class:"form-item"},eC={class:"radio-group"},tC={class:"form-item"},nC={class:"radio-group"},iC={class:"form-item"},sC={class:"value"},oC={class:"param-row"},rC={class:"param-row"},aC={class:"param-row"},lC={class:"param-row"},cC={class:"param-row"},dC={class:"param-row"},uC={class:"param-row"},hC={class:"button-grid"},fC={key:1,class:"pick-mode-ui"},pC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},mC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},gC=["checked"],AC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},yC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},CC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},EC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},bC=["checked"],wC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},vC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},IC={class:"list-panel"},BC={class:"list-header"},xC={class:"col-check"},SC=["checked"],TC={class:"list-body"},MC={class:"col-check"},DC=["onUpdate:modelValue"],kC={class:"col-index"},PC=["title"],NC={class:"col-main"},FC=["checked","onChange"],Bn=ge(o.defineComponent({__name:"LeitingPosition",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close","save"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=o.computed({get:()=>i.open!==void 0?i.open:i.visible,set:O=>{s("update:visible",O),s("update:open",O)}}),a=o.inject("leitingMethods"),c=o.ref("BIM"),l=o.ref("param"),d=o.ref(""),h=o.ref([]),f=o.ref("BIM"),p=o.ref(null),u=o.ref(null),m=o.ref(null),E=()=>(!m.value&&a?.value?.getViewer&&a?.value?.getCesium&&(m.value=new pl(a.value.getViewer(),a.value.getCesium())),m.value),A=()=>{E()?.clearMarkers(),p.value=null,u.value=null},b=(O,T)=>{O==="BIM"?p.value=T:u.value=T,E()?.addMarker(O,T),ce.success(`${O==="BIM"?"BIM":"地图"}标记点已添加`)},w=()=>{E()?.registerPickHandler(O=>{b(f.value,O)})},I=()=>{E()?.destroyPickHandler()},D=()=>{if(!p.value||!u.value){ce.warning("请先选择BIM标记点和地图标记点");return}if(!d.value){ce.warning("请先选择主模型");return}const O=E();let T=0,_=0,H=0;if(O){const{dLon:j,dLat:X,dHeight:Z}=O.calculateOffset(p.value,u.value);T=j,_=X,H=Z}else T=u.value.longitude-p.value.longitude,_=u.value.latitude-p.value.latitude,H=u.value.height-p.value.height;S.value.longitude+=T,S.value.latitude+=_,S.value.height+=H,y(d.value,{longitude:S.value.longitude,latitude:S.value.latitude,height:S.value.height}),ce.success("位置已调整")};o.watch(()=>l.value,O=>{O==="pick"?w():I()}),e({addMarker:b,setModelType:O=>{(O==="BIM"||O==="OSGB")&&(c.value=O)}});const S=o.ref({longitude:0,latitude:0,lonlat:1e-6,heightDistance:1,rotation:30,totalRotation:0,height:0,X:0,Y:0,Z:0}),B=o.computed(()=>{const O=h.value.find(T=>T.modelId===d.value);return O?O.modelName:""}),g=o.computed(()=>x.value.length>0&&x.value.every(O=>O.selected)),R=()=>{r.value=!1,s("close")},x=o.computed(()=>h.value.filter(O=>O.type===c.value)),M=O=>{const T=O.target.checked;x.value.forEach(_=>_.selected=T)},L=()=>{if(!a?.value)return;const O=a.value,T=O.getMapTileset?O.getMapTileset():{},_=[];if(Object.keys(T).forEach(H=>{const X=T[H].leiting||{};X.model&&_.push({modelId:X.model.modelId,modelName:X.model.modelName,selected:!1,formData:X.model.formData||{},dbName:X.model.dbName,url:X.model.url,type:X.model.type||"BIM"})}),h.value=_,_.length>0){const H=O.getBIMmodelId?O.getBIMmodelId():"";H&&_.find(j=>j.modelId===H)?k(H):k(_[0].modelId),_.forEach(j=>j.selected=!0)}},V=()=>{ce.info("拖动右下角标,可显示模型列表",void 0,2)},k=O=>{d.value=O;const T=h.value.find(_=>_.modelId===O);T&&T.formData&&Object.keys(S.value).forEach(_=>{T.formData[_]!==void 0&&(S.value[_]=T.formData[_])})},C=O=>a?.value?.getMapTileset?a.value.getMapTileset()[O]:null,y=(O,T)=>{const _=C(O),H=a.value.getCesium();if(_&&H){if(_.leiting?.model){_.leiting.model.formData={..._.leiting.model.formData,...T};const j=h.value.find(X=>X.modelId===O);j&&(j.formData=_.leiting.model.formData)}_i({Cesium:H,tileset:_})}},v=O=>{if(!d.value)return;const _=h.value.find(X=>X.modelId===d.value)?.formData?.[O]??0,H=S.value[O],j=H-_;y(d.value,{[O]:H}),j!==0&&x.value.filter(Z=>Z.selected&&Z.modelId!==d.value).forEach(Z=>{const se=(Z.formData?.[O]??0)+j;y(Z.modelId,{[O]:se})})},P=O=>{const T=x.value.filter(X=>X.selected);if(T.length===0){ce.warning("请先选择要调整的模型");return}const{lonlat:_,heightDistance:H,rotation:j}=S.value;T.forEach(X=>{const Z={...X.formData};switch(O){case"north":Z.latitude+=_;break;case"south":Z.latitude-=_;break;case"east":Z.longitude+=_;break;case"west":Z.longitude-=_;break;case"up":Z.height+=H;break;case"down":Z.height-=H;break;case"rotateLeft":Z.totalRotation=(Z.totalRotation||0)+j;break;case"rotateRight":Z.totalRotation=(Z.totalRotation||0)-j;break}X.modelId===d.value&&(Z.lonlat=_,Z.heightDistance=H,Z.rotation=j,Object.assign(S.value,Z)),y(X.modelId,Z)})},F=()=>{if(!d.value){ce.warning("请先选择主模型");return}const O=C(d.value);if(!O||!a?.value?.getViewer)return;const T=a.value.getViewer(),_=a.value.getCesium(),H=O.boundingSphere;T.camera.flyToBoundingSphere(H,{offset:new _.HeadingPitchRange(0,_.Math.toRadians(-90),H.radius*2),duration:1.5})},U=()=>{a?.value?.saveRegion?(a.value.saveRegion(h.value),s("save",o.unref(h))):(console.log("Save models:",h.value),ce.warning("未找到保存接口,数据已打印控制台"))};return o.watch(()=>i.visible,O=>{O?(L(),V(),l.value==="pick"&&w()):(I(),A())}),o.onMounted(()=>{i.visible&&(L(),V(),l.value==="pick"&&w())}),(O,T)=>(o.openBlock(),o.createBlock(Le,{visible:r.value,title:"调整位置(调整前可选择正北俯视)","full-height":n.fullHeight,width:260,"onUpdate:visible":T[25]||(T[25]=_=>r.value=_),onClose:R,onSave:U,class:"base-position-card"},{default:o.withCtx(()=>[o.createElementVNode("div",q0,[o.createElementVNode("div",J0,[o.createElementVNode("div",Z0,[T[26]||(T[26]=o.createElementVNode("label",null,"模型类型:",-1)),o.createElementVNode("div",eC,[o.createElementVNode("span",{class:o.normalizeClass({active:c.value==="BIM"}),onClick:T[0]||(T[0]=_=>c.value="BIM")},"BIM模型",2),o.createElementVNode("span",{class:o.normalizeClass({active:c.value==="OSGB"}),onClick:T[1]||(T[1]=_=>c.value="OSGB")},"倾斜摄影",2)])]),o.createElementVNode("div",tC,[T[27]||(T[27]=o.createElementVNode("label",null,"调整操作:",-1)),o.createElementVNode("div",nC,[o.createElementVNode("span",{class:o.normalizeClass({active:l.value==="param"}),onClick:T[2]||(T[2]=_=>l.value="param")},"参数模式",2),o.createElementVNode("span",{class:o.normalizeClass({active:l.value==="pick"}),onClick:T[3]||(T[3]=_=>l.value="pick")},"地图点选",2)])]),o.createElementVNode("div",iC,[T[28]||(T[28]=o.createElementVNode("label",null,"当前主模型:",-1)),o.createElementVNode("span",sC,o.toDisplayString(B.value||"未选择"),1)]),T[42]||(T[42]=o.createElementVNode("div",{class:"separator"},null,-1)),l.value==="param"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[T[36]||(T[36]=o.createElementVNode("div",{class:"group-header"},"当前状态",-1)),o.createElementVNode("div",oC,[T[29]||(T[29]=o.createElementVNode("label",null,"经度(东西):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[4]||(T[4]=_=>S.value.longitude=_),onChange:T[5]||(T[5]=_=>v("longitude")),step:"0.000001"},null,544),[[o.vModelText,S.value.longitude,void 0,{number:!0}]])]),o.createElementVNode("div",rC,[T[30]||(T[30]=o.createElementVNode("label",null,"纬度(南北):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[6]||(T[6]=_=>S.value.latitude=_),onChange:T[7]||(T[7]=_=>v("latitude")),step:"0.000001"},null,544),[[o.vModelText,S.value.latitude,void 0,{number:!0}]])]),o.createElementVNode("div",aC,[T[31]||(T[31]=o.createElementVNode("label",null,"高度(m):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[8]||(T[8]=_=>S.value.height=_),onChange:T[9]||(T[9]=_=>v("height")),step:"0.1"},null,544),[[o.vModelText,S.value.height,void 0,{number:!0}]])]),o.createElementVNode("div",lC,[T[32]||(T[32]=o.createElementVNode("label",null,"累计旋转(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[10]||(T[10]=_=>S.value.totalRotation=_),onChange:T[11]||(T[11]=_=>v("totalRotation")),step:"1"},null,544),[[o.vModelText,S.value.totalRotation,void 0,{number:!0}]])]),T[37]||(T[37]=o.createElementVNode("div",{class:"separator"},null,-1)),T[38]||(T[38]=o.createElementVNode("div",{class:"group-header"},"调整步长",-1)),o.createElementVNode("div",cC,[T[33]||(T[33]=o.createElementVNode("label",null,"经纬步长(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[12]||(T[12]=_=>S.value.lonlat=_),step:"0.000001"},null,512),[[o.vModelText,S.value.lonlat,void 0,{number:!0}]])]),o.createElementVNode("div",dC,[T[34]||(T[34]=o.createElementVNode("label",null,"高度步长(m):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[13]||(T[13]=_=>S.value.heightDistance=_),step:"0.1"},null,512),[[o.vModelText,S.value.heightDistance,void 0,{number:!0}]])]),o.createElementVNode("div",uC,[T[35]||(T[35]=o.createElementVNode("label",null,"旋转步长(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":T[14]||(T[14]=_=>S.value.rotation=_),step:"1"},null,512),[[o.vModelText,S.value.rotation,void 0,{number:!0}]])]),o.createElementVNode("div",hC,[o.createElementVNode("button",{onClick:T[15]||(T[15]=_=>P("rotateLeft"))},"左转"),o.createElementVNode("button",{onClick:T[16]||(T[16]=_=>P("north"))},"北移"),o.createElementVNode("button",{onClick:T[17]||(T[17]=_=>P("rotateRight"))},"右转"),o.createElementVNode("button",{onClick:T[18]||(T[18]=_=>P("west"))},"西移"),o.createElementVNode("button",{onClick:T[19]||(T[19]=_=>P("south"))},"南移"),o.createElementVNode("button",{onClick:T[20]||(T[20]=_=>P("east"))},"东移"),o.createElementVNode("button",{onClick:T[21]||(T[21]=_=>P("up"))},"上移"),o.createElementVNode("button",{onClick:T[22]||(T[22]=_=>P("down"))},"下移"),o.createElementVNode("button",{onClick:F,class:"primary-btn"},"正北俯视"),o.createElementVNode("button",{onClick:U,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):l.value==="pick"?(o.openBlock(),o.createElementBlock("div",fC,[o.createElementVNode("div",pC,[o.createElementVNode("div",mC,[o.createElementVNode("div",{onClick:T[23]||(T[23]=_=>f.value="BIM"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[o.createElementVNode("input",{type:"radio",checked:f.value==="BIM",style:{"margin-right":"5px"}},null,8,gC),T[39]||(T[39]=o.createElementVNode("span",{style:{"font-weight":"bold"}},"BIM标记点:",-1))]),p.value?(o.openBlock(),o.createElementBlock("div",AC,[o.createElementVNode("div",null,"经度:"+o.toDisplayString(p.value.longitude.toFixed(10)),1),o.createElementVNode("div",null,"纬度:"+o.toDisplayString(p.value.latitude.toFixed(10)),1)])):(o.openBlock(),o.createElementBlock("div",yC,"未选择"))])]),o.createElementVNode("div",CC,[o.createElementVNode("div",EC,[o.createElementVNode("div",{onClick:T[24]||(T[24]=_=>f.value="MAP"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[o.createElementVNode("input",{type:"radio",checked:f.value==="MAP",style:{"margin-right":"5px"}},null,8,bC),T[40]||(T[40]=o.createElementVNode("span",{style:{"font-weight":"bold"}},"地图标记点:",-1))]),u.value?(o.openBlock(),o.createElementBlock("div",wC,[o.createElementVNode("div",null,"经度:"+o.toDisplayString(u.value.longitude.toFixed(10)),1),o.createElementVNode("div",null,"纬度:"+o.toDisplayString(u.value.latitude.toFixed(10)),1)])):(o.openBlock(),o.createElementBlock("div",vC,"未选择"))])]),o.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[o.createElementVNode("button",{onClick:D},"调整位置"),o.createElementVNode("button",{onClick:U},"保存")]),T[41]||(T[41]=o.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[o.createElementVNode("div",null,"操作指南:"),o.createElementVNode("div",null,"1. 勾选上方 BIM 或 地图 标记点选项。"),o.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),o.createElementVNode("div",null,"3. 采集两点后,点击“调整位置”进行校准。")],-1))])):o.createCommentVNode("",!0)]),o.createElementVNode("div",IC,[o.createElementVNode("div",BC,[o.createElementVNode("div",xC,[o.createElementVNode("input",{type:"checkbox",checked:g.value,onChange:M},null,40,SC)]),T[43]||(T[43]=o.createElementVNode("div",{class:"col-index"},"序号",-1)),T[44]||(T[44]=o.createElementVNode("div",{class:"col-name"},"名称",-1)),T[45]||(T[45]=o.createElementVNode("div",{class:"col-main"},"主模型",-1))]),o.createElementVNode("div",TC,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(x.value,(_,H)=>(o.openBlock(),o.createElementBlock("div",{key:_.modelId,class:o.normalizeClass(["list-item",{active:_.modelId===d.value}])},[o.createElementVNode("div",MC,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":j=>_.selected=j},null,8,DC),[[o.vModelCheckbox,_.selected]])]),o.createElementVNode("div",kC,o.toDisplayString(H+1),1),o.createElementVNode("div",{class:"col-name",title:_.modelName},o.toDisplayString(_.modelName),9,PC),o.createElementVNode("div",NC,[o.createElementVNode("input",{type:"radio",name:"mainModel",checked:_.modelId===d.value,onChange:j=>k(_.modelId)},null,40,FC)])],2))),128))])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-9737215c"]]);function pi(){return pi=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},pi.apply(null,arguments)}const RC={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},LC={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},ml={lang:pi({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},RC),timePickerLocale:pi({},LC)};ml.lang.ok="确定";var mi={exports:{}},OC=mi.exports,gl;function Al(){return gl||(gl=1,(function(n,e){(function(t,i){n.exports=i()})(OC,(function(){var t=1e3,i=6e4,s=36e5,r="millisecond",a="second",c="minute",l="hour",d="day",h="week",f="month",p="quarter",u="year",m="date",E="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var C=["th","st","nd","rd"],y=k%100;return"["+k+(C[(y-20)%10]||C[y]||C[0])+"]"}},I=function(k,C,y){var v=String(k);return!v||v.length>=C?k:""+Array(C+1-v.length).join(y)+k},D={s:I,z:function(k){var C=-k.utcOffset(),y=Math.abs(C),v=Math.floor(y/60),P=y%60;return(C<=0?"+":"-")+I(v,2,"0")+":"+I(P,2,"0")},m:function k(C,y){if(C.date()<y.date())return-k(y,C);var v=12*(y.year()-C.year())+(y.month()-C.month()),P=C.clone().add(v,f),F=y-P<0,U=C.clone().add(v+(F?-1:1),f);return+(-(v+(y-P)/(F?P-U:U-P))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:f,y:u,w:h,d,D:m,h:l,m:c,s:a,ms:r,Q:p}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},N="en",S={};S[N]=w;var B="$isDayjsObject",g=function(k){return k instanceof L||!(!k||!k[B])},R=function k(C,y,v){var P;if(!C)return N;if(typeof C=="string"){var F=C.toLowerCase();S[F]&&(P=F),y&&(S[F]=y,P=F);var U=C.split("-");if(!P&&U.length>1)return k(U[0])}else{var O=C.name;S[O]=C,P=O}return!v&&P&&(N=P),P||!v&&N},x=function(k,C){if(g(k))return k.clone();var y=typeof C=="object"?C:{};return y.date=k,y.args=arguments,new L(y)},M=D;M.l=R,M.i=g,M.w=function(k,C){return x(k,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var L=(function(){function k(y){this.$L=R(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[B]=!0}var C=k.prototype;return C.parse=function(y){this.$d=(function(v){var P=v.date,F=v.utc;if(P===null)return new Date(NaN);if(M.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var U=P.match(A);if(U){var O=U[2]-1||0,T=(U[7]||"0").substring(0,3);return F?new Date(Date.UTC(U[1],O,U[3]||1,U[4]||0,U[5]||0,U[6]||0,T)):new Date(U[1],O,U[3]||1,U[4]||0,U[5]||0,U[6]||0,T)}}return new Date(P)})(y),this.init()},C.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},C.$utils=function(){return M},C.isValid=function(){return this.$d.toString()!==E},C.isSame=function(y,v){var P=x(y);return this.startOf(v)<=P&&P<=this.endOf(v)},C.isAfter=function(y,v){return x(y)<this.startOf(v)},C.isBefore=function(y,v){return this.endOf(v)<x(y)},C.$g=function(y,v,P){return M.u(y)?this[v]:this.set(P,y)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(y,v){var P=this,F=!!M.u(v)||v,U=M.p(y),O=function(se,oe){var ye=M.w(P.$u?Date.UTC(P.$y,oe,se):new Date(P.$y,oe,se),P);return F?ye:ye.endOf(d)},T=function(se,oe){return M.w(P.toDate()[se].apply(P.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(oe)),P)},_=this.$W,H=this.$M,j=this.$D,X="set"+(this.$u?"UTC":"");switch(U){case u:return F?O(1,0):O(31,11);case f:return F?O(1,H):O(0,H+1);case h:var Z=this.$locale().weekStart||0,re=(_<Z?_+7:_)-Z;return O(F?j-re:j+(6-re),H);case d:case m:return T(X+"Hours",0);case l:return T(X+"Minutes",1);case c:return T(X+"Seconds",2);case a:return T(X+"Milliseconds",3);default:return this.clone()}},C.endOf=function(y){return this.startOf(y,!1)},C.$set=function(y,v){var P,F=M.p(y),U="set"+(this.$u?"UTC":""),O=(P={},P[d]=U+"Date",P[m]=U+"Date",P[f]=U+"Month",P[u]=U+"FullYear",P[l]=U+"Hours",P[c]=U+"Minutes",P[a]=U+"Seconds",P[r]=U+"Milliseconds",P)[F],T=F===d?this.$D+(v-this.$W):v;if(F===f||F===u){var _=this.clone().set(m,1);_.$d[O](T),_.init(),this.$d=_.set(m,Math.min(this.$D,_.daysInMonth())).$d}else O&&this.$d[O](T);return this.init(),this},C.set=function(y,v){return this.clone().$set(y,v)},C.get=function(y){return this[M.p(y)]()},C.add=function(y,v){var P,F=this;y=Number(y);var U=M.p(v),O=function(H){var j=x(F);return M.w(j.date(j.date()+Math.round(H*y)),F)};if(U===f)return this.set(f,this.$M+y);if(U===u)return this.set(u,this.$y+y);if(U===d)return O(1);if(U===h)return O(7);var T=(P={},P[c]=i,P[l]=s,P[a]=t,P)[U]||1,_=this.$d.getTime()+y*T;return M.w(_,this)},C.subtract=function(y,v){return this.add(-1*y,v)},C.format=function(y){var v=this,P=this.$locale();if(!this.isValid())return P.invalidDate||E;var F=y||"YYYY-MM-DDTHH:mm:ssZ",U=M.z(this),O=this.$H,T=this.$m,_=this.$M,H=P.weekdays,j=P.months,X=P.meridiem,Z=function(oe,ye,Ie,Ee){return oe&&(oe[ye]||oe(v,F))||Ie[ye].slice(0,Ee)},re=function(oe){return M.s(O%12||12,oe,"0")},se=X||function(oe,ye,Ie){var Ee=oe<12?"AM":"PM";return Ie?Ee.toLowerCase():Ee};return F.replace(b,(function(oe,ye){return ye||(function(Ie){switch(Ie){case"YY":return String(v.$y).slice(-2);case"YYYY":return M.s(v.$y,4,"0");case"M":return _+1;case"MM":return M.s(_+1,2,"0");case"MMM":return Z(P.monthsShort,_,j,3);case"MMMM":return Z(j,_);case"D":return v.$D;case"DD":return M.s(v.$D,2,"0");case"d":return String(v.$W);case"dd":return Z(P.weekdaysMin,v.$W,H,2);case"ddd":return Z(P.weekdaysShort,v.$W,H,3);case"dddd":return H[v.$W];case"H":return String(O);case"HH":return M.s(O,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return se(O,T,!0);case"A":return se(O,T,!1);case"m":return String(T);case"mm":return M.s(T,2,"0");case"s":return String(v.$s);case"ss":return M.s(v.$s,2,"0");case"SSS":return M.s(v.$ms,3,"0");case"Z":return U}return null})(oe)||U.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(y,v,P){var F,U=this,O=M.p(v),T=x(y),_=(T.utcOffset()-this.utcOffset())*i,H=this-T,j=function(){return M.m(U,T)};switch(O){case u:F=j()/12;break;case f:F=j();break;case p:F=j()/3;break;case h:F=(H-_)/6048e5;break;case d:F=(H-_)/864e5;break;case l:F=H/s;break;case c:F=H/i;break;case a:F=H/t;break;default:F=H}return P?F:M.a(F)},C.daysInMonth=function(){return this.endOf(f).$D},C.$locale=function(){return S[this.$L]},C.locale=function(y,v){if(!y)return this.$L;var P=this.clone(),F=R(y,v,!0);return F&&(P.$L=F),P},C.clone=function(){return M.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},k})(),V=L.prototype;return x.prototype=V,[["$ms",r],["$s",a],["$m",c],["$H",l],["$W",d],["$M",f],["$y",u],["$D",m]].forEach((function(k){V[k[1]]=function(C){return this.$g(C,k[0],k[1])}})),x.extend=function(k,C){return k.$i||(k(C,L,x),k.$i=!0),x},x.locale=R,x.isDayjs=g,x.unix=function(k){return x(1e3*k)},x.en=S[N],x.Ls=S,x.p={},x}))})(mi)),mi.exports}var UC=Al();const Ke=Yt(UC);var gi={exports:{}},_C=gi.exports,yl;function QC(){return yl||(yl=1,(function(n,e){(function(t,i){n.exports=i(Al())})(_C,(function(t){function i(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var s=i(t),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,c){return c==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,c){var l=100*a+c;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return s.default.locale(r,null,!0),r}))})(gi)),gi.exports}QC();var Ai={exports:{}},VC=Ai.exports,Cl;function GC(){return Cl||(Cl=1,(function(n,e){(function(t,i){n.exports=i()})(VC,(function(){return function(t,i,s){var r=i.prototype,a=function(f){return f&&(f.indexOf?f:f.s)},c=function(f,p,u,m,E){var A=f.name?f:f.$locale(),b=a(A[p]),w=a(A[u]),I=b||w.map((function(N){return N.slice(0,m)}));if(!E)return I;var D=A.weekStart;return I.map((function(N,S){return I[(S+(D||0))%7]}))},l=function(){return s.Ls[s.locale()]},d=function(f,p){return f.formats[p]||(function(u){return u.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(m,E,A){return E||A.slice(1)}))})(f.formats[p.toUpperCase()])},h=function(){var f=this;return{months:function(p){return p?p.format("MMMM"):c(f,"months")},monthsShort:function(p){return p?p.format("MMM"):c(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(p){return p?p.format("dddd"):c(f,"weekdays")},weekdaysMin:function(p){return p?p.format("dd"):c(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(p){return p?p.format("ddd"):c(f,"weekdaysShort","weekdays",3)},longDateFormat:function(p){return d(f.$locale(),p)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return h.bind(this)()},s.localeData=function(){var f=l();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(p){return d(f,p)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return c(l(),"months")},s.monthsShort=function(){return c(l(),"monthsShort","months",3)},s.weekdays=function(f){return c(l(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return c(l(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return c(l(),"weekdaysMin","weekdays",2,f)}}}))})(Ai)),Ai.exports}var HC=GC();const YC=Yt(HC);var yi={exports:{}},zC=yi.exports,El;function WC(){return El||(El=1,(function(n,e){(function(t,i){n.exports=i()})(zC,(function(){return function(t,i){i.prototype.weekday=function(s){var r=this.$locale().weekStart||0,a=this.$W,c=(a<r?a+7:a)-r;return this.$utils().u(s)?c:this.subtract(c,"day").add(s,"day")}}}))})(yi)),yi.exports}var jC=WC();const KC=Yt(jC);var Ci={exports:{}},$C=Ci.exports,bl;function XC(){return bl||(bl=1,(function(n,e){(function(t,i){n.exports=i()})($C,(function(){var t="week",i="year";return function(s,r,a){var c=r.prototype;c.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=a(this).startOf(i).add(1,i).date(d),f=a(this).endOf(t);if(h.isBefore(f))return 1}var p=a(this).startOf(i).date(d).startOf(t).subtract(1,"millisecond"),u=this.diff(p,t,!0);return u<0?a(this).startOf("week").week():Math.ceil(u)},c.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(Ci)),Ci.exports}var qC=XC();const JC=Yt(qC);var Ei={exports:{}},ZC=Ei.exports,wl;function eE(){return wl||(wl=1,(function(n,e){(function(t,i){n.exports=i()})(ZC,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,r=/\d\d/,a=/\d\d?/,c=/\d*[^-_:/,()\s\d]+/,l={},d=function(A){return(A=+A)+(A>68?1900:2e3)},h=function(A){return function(b){this[A]=+b}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(A){(this.zone||(this.zone={})).offset=(function(b){if(!b||b==="Z")return 0;var w=b.match(/([+-]|\d\d)/g),I=60*w[1]+(+w[2]||0);return I===0?0:w[0]==="+"?-I:I})(A)}],p=function(A){var b=l[A];return b&&(b.indexOf?b:b.s.concat(b.f))},u=function(A,b){var w,I=l.meridiem;if(I){for(var D=1;D<=24;D+=1)if(A.indexOf(I(D,0,b))>-1){w=D>12;break}}else w=A===(b?"pm":"PM");return w},m={A:[c,function(A){this.afternoon=u(A,!1)}],a:[c,function(A){this.afternoon=u(A,!0)}],Q:[s,function(A){this.month=3*(A-1)+1}],S:[s,function(A){this.milliseconds=100*+A}],SS:[r,function(A){this.milliseconds=10*+A}],SSS:[/\d{3}/,function(A){this.milliseconds=+A}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[r,h("day")],Do:[c,function(A){var b=l.ordinal,w=A.match(/\d+/);if(this.day=w[0],b)for(var I=1;I<=31;I+=1)b(I).replace(/\[|\]/g,"")===A&&(this.day=I)}],w:[a,h("week")],ww:[r,h("week")],M:[a,h("month")],MM:[r,h("month")],MMM:[c,function(A){var b=p("months"),w=(p("monthsShort")||b.map((function(I){return I.slice(0,3)}))).indexOf(A)+1;if(w<1)throw new Error;this.month=w%12||w}],MMMM:[c,function(A){var b=p("months").indexOf(A)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,h("year")],YY:[r,function(A){this.year=d(A)}],YYYY:[/\d{4}/,h("year")],Z:f,ZZ:f};function E(A){var b,w;b=A,w=l&&l.formats;for(var I=(A=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,M,L){var V=L&&L.toUpperCase();return M||w[L]||t[L]||w[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(k,C,y){return C||y.slice(1)}))}))).match(i),D=I.length,N=0;N<D;N+=1){var S=I[N],B=m[S],g=B&&B[0],R=B&&B[1];I[N]=R?{regex:g,parser:R}:S.replace(/^\[|\]$/g,"")}return function(x){for(var M={},L=0,V=0;L<D;L+=1){var k=I[L];if(typeof k=="string")V+=k.length;else{var C=k.regex,y=k.parser,v=x.slice(V),P=C.exec(v)[0];y.call(M,P),x=x.replace(P,"")}}return(function(F){var U=F.afternoon;if(U!==void 0){var O=F.hours;U?O<12&&(F.hours+=12):O===12&&(F.hours=0),delete F.afternoon}})(M),M}}return function(A,b,w){w.p.customParseFormat=!0,A&&A.parseTwoDigitYear&&(d=A.parseTwoDigitYear);var I=b.prototype,D=I.parse;I.parse=function(N){var S=N.date,B=N.utc,g=N.args;this.$u=B;var R=g[1];if(typeof R=="string"){var x=g[2]===!0,M=g[3]===!0,L=x||M,V=g[2];M&&(V=g[2]),l=this.$locale(),!x&&V&&(l=w.Ls[V]),this.$d=(function(v,P,F,U){try{if(["x","X"].indexOf(P)>-1)return new Date((P==="X"?1e3:1)*v);var O=E(P)(v),T=O.year,_=O.month,H=O.day,j=O.hours,X=O.minutes,Z=O.seconds,re=O.milliseconds,se=O.zone,oe=O.week,ye=new Date,Ie=H||(T||_?1:ye.getDate()),Ee=T||ye.getFullYear(),xe=0;T&&!_||(xe=_>0?_-1:ye.getMonth());var Te,_e=j||0,z=X||0,Y=Z||0,K=re||0;return se?new Date(Date.UTC(Ee,xe,Ie,_e,z,Y,K+60*se.offset*1e3)):F?new Date(Date.UTC(Ee,xe,Ie,_e,z,Y,K)):(Te=new Date(Ee,xe,Ie,_e,z,Y,K),oe&&(Te=U(Te).week(oe).toDate()),Te)}catch{return new Date("")}})(S,R,B,w),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),L&&S!=this.format(R)&&(this.$d=new Date("")),l={}}else if(R instanceof Array)for(var k=R.length,C=1;C<=k;C+=1){g[1]=R[C-1];var y=w.apply(this,g);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}C===k&&(this.$d=new Date(""))}else D.call(this,N)}}}))})(Ei)),Ei.exports}var tE=eE();const nE=Yt(tE),iE={class:"setting-panel"},sE={class:"tabs-header"},oE={class:"tab-content"},rE={key:0,class:"section"},aE={class:"setting-item"},lE={class:"setting-item"},cE={class:"setting-item"},dE={key:1,class:"section"},uE={class:"tabs-header",style:{"margin-bottom":"8px"}},hE={key:0},fE={class:"setting-item column"},pE={class:"setting-item column"},mE={class:"setting-item"},gE={key:1},AE={class:"setting-item column"},yE={class:"setting-item column",style:{"margin-top":"12px","border-top":"1px solid rgba(255,255,255,0.1)","padding-top":"8px"}},CE={class:"search-box"},EE={key:2,class:"section"},bE={class:"setting-item"},wE={key:0,class:"setting-item column"},vE={class:"sub-label"},IE={class:"setting-item"},BE={class:"setting-item"},xE={class:"setting-item column"},SE={class:"setting-item column"},TE={class:"sub-label"},ME={class:"setting-item column"},DE={class:"sub-label"},kE={class:"setting-item column"},PE={class:"sub-label"},NE={class:"setting-item column"},FE={style:{display:"flex",gap:"8px","margin-bottom":"8px"}},RE=["onClick","title"],LE={style:{display:"flex",gap:"8px","align-items":"center"}},OE={key:3,class:"section"},UE={class:"setting-item"},_E={class:"setting-item column"},xn=ge(o.defineComponent({__name:"LeitingSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean,default:!1},tiandituToken:{type:String,default:""},initialConfig:{type:Object,default:()=>({})}},emits:["update:visible","update:open","close"],setup(n,{emit:e}){Ke.locale("zh-cn"),Ke.extend(YC),Ke.extend(KC),Ke.extend(JC),Ke.extend(nE);const t=ie.Switch,i=ie.Radio.Group,s=ie.Radio,r=ie.Input,a=ie.Slider,c=ie.Select,l=ie.Select.Option,d=ie.DatePicker,h=n,f=e,p=o.inject("leitingMethods"),u=o.computed({get:()=>h.open!==void 0?h.open:h.visible,set:C=>{f("update:visible",C),f("update:open",C)}}),m=o.ref("GIS"),E=o.reactive({globe:!1,terrain:!1,depthTest:!1}),A=o.reactive({provider:"tianditu",tianditu:{token:"c25f14fb6bd4397cf8fe45144ff768d6",layerType:"img_w",showLabel:!1},arcgis:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},baseMap:"tianditu"}),b=o.reactive({shadows:!1,shadowDarkness:.7,environmentMap:!1,ambientOcclusion:!1,time:Ke("2025-06-22 10:00"),brightness:1.5,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),w=o.reactive({collision:!1,habit:0}),I=C=>{C&&(C.globe!==void 0&&(E.globe=C.globe),C.terrain!==void 0&&(E.terrain=C.terrain),C.depthTest!==void 0&&(E.depthTest=C.depthTest),C.mapProvider!==void 0&&(A.provider=C.mapProvider),C.tiandituLayerType!==void 0&&(A.tianditu.layerType=C.tiandituLayerType),C.tiandituShowLabel!==void 0&&(A.tianditu.showLabel=C.tiandituShowLabel),C.arcgisUrl!==void 0&&(A.arcgis.url=C.arcgisUrl),C.shadows!==void 0&&(b.shadows=C.shadows),C.shadowDarkness!==void 0&&(b.shadowDarkness=C.shadowDarkness),C.environmentMap!==void 0&&(b.environmentMap=C.environmentMap),C.ambientOcclusion!==void 0&&(b.ambientOcclusion=C.ambientOcclusion),C.time!==void 0&&(typeof C.time=="number"?b.time=Ke().startOf("day").add(C.time,"hour"):b.time=Ke(C.time)),C.brightness!==void 0&&(b.brightness=C.brightness),C.contrast!==void 0&&(b.contrast=C.contrast),C.saturation!==void 0&&(b.saturation=C.saturation),C.backgroundColor!==void 0&&(b.backgroundColor=C.backgroundColor),C.collision!==void 0&&(w.collision=C.collision),C.mouseHabit!==void 0&&(w.habit=C.mouseHabit))};o.watch(()=>h.initialConfig,C=>{I(C)},{deep:!0,immediate:!0});const D=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],N=[{label:"全球影像地图服务(墨卡托)",value:"img_w"},{label:"全球影像地图服务(经纬度)",value:"img_c"},{label:"全球矢量地图服务(墨卡托)",value:"vec_w"},{label:"全球矢量地图服务(经纬度)",value:"vec_c"},{label:"全球地形晕渲服务(墨卡托)",value:"ter_w"},{label:"全球地形晕渲服务(经纬度)",value:"ter_c"}],S=()=>{const C=A.provider,y={};C==="tianditu"?(y.token=A.tianditu.token,y.layerType=A.tianditu.layerType,y.showAnnotation=A.tianditu.showLabel):C==="arcgis"&&(y.url=A.arcgis.url),p.value?.changeBaseMap?.(C,y)};o.watch(()=>A.provider,S),o.watch(()=>A.tianditu.layerType,S),o.watch(()=>A.tianditu.showLabel,S),o.watch(()=>A.tianditu.token,_n(S,1e3)),o.watch(()=>A.arcgis.url,_n(S,1e3)),o.onMounted(()=>{h.tiandituToken&&(A.tianditu.token=h.tiandituToken)}),o.watch(()=>E.globe,C=>p.value?.setGlobeEnvironmentVisible?.(C)),o.watch(()=>E.terrain,C=>p.value?.setTerrainEnable?.(C)),o.watch(()=>E.depthTest,C=>p.value?.setDepthTestEnable?.(C)),o.watch(()=>p?.value,C=>{if(C){if(C.getConfigure=()=>({globe:E.globe,terrain:E.terrain,depthTest:E.depthTest,mapProvider:A.provider,tiandituLayerType:A.tianditu.layerType,tiandituShowLabel:A.tianditu.showLabel,arcgisUrl:A.arcgis.url,shadows:b.shadows,shadowDarkness:b.shadowDarkness,environmentMap:b.environmentMap,ambientOcclusion:b.ambientOcclusion,time:Ke.isDayjs(b.time)?b.time.format("YYYY-MM-DD HH:mm"):b.time,brightness:b.brightness,contrast:b.contrast,saturation:b.saturation,backgroundColor:b.backgroundColor,collision:w.collision,mouseHabit:w.habit}),C.setConfigure=y=>{I(y)},C.setBackgroundColor&&b.backgroundColor&&C.setBackgroundColor(b.backgroundColor),C.setGlobeEnvironmentVisible&&C.setGlobeEnvironmentVisible(E.globe),C.setShadowsEnable&&C.setShadowsEnable(b.shadows),C.setShadowDarkness&&C.setShadowDarkness(b.shadowDarkness),C.setEnvironmentMapEnable&&C.setEnvironmentMapEnable(b.environmentMap),C.setAmbientOcclusion&&C.setAmbientOcclusion(b.ambientOcclusion),C.setTime){const y=Ke.isDayjs(b.time)?b.time.toDate():new Date;C.setTime(y)}C.setModelBrightness&&C.setModelBrightness(b.brightness),C.setCollisionDetection&&C.setCollisionDetection(w.collision),C.setMouseHabit&&C.setMouseHabit(w.habit),C.changeBaseMap&&A.baseMap&&C.changeBaseMap(A.baseMap,{token:A.tianditu.token,layerType:A.tianditu.layerType,showAnnotation:A.tianditu.showLabel,url:A.arcgis.url})}},{immediate:!0});const B=o.computed({get:()=>{const C=b.backgroundColor;return/^#[0-9A-Fa-f]{6}$/.test(C)?C:"#ffffff"},set:C=>{b.backgroundColor=C}}),g=o.ref(""),R=o.ref(!1),x=o.ref([]);o.watch(()=>E.globe,C=>p.value?.setGlobeEnvironmentVisible?.(C)),o.watch(()=>E.terrain,C=>p.value?.setTerrainEnable?.(C)),o.watch(()=>A.baseMap,C=>{p.value?.changeBaseMap?.(C,{token:h.tiandituToken})}),o.watch(()=>b.shadows,C=>p.value?.setShadowsEnable?.(C)),o.watch(()=>b.shadowDarkness,C=>p.value?.setShadowDarkness?.(C)),o.watch(()=>b.environmentMap,C=>p.value?.setEnvironmentMapEnable?.(C)),o.watch(()=>b.ambientOcclusion,C=>p.value?.setAmbientOcclusion?.(C)),o.watch(()=>b.time,C=>{const y=Ke.isDayjs(C)?C.toDate():new Date;p.value?.setTime?.(y)}),o.watch(()=>[b.brightness,b.contrast,b.saturation],([C,y,v])=>{const P=p.value;P?.setModelColorAdjustment?P.setModelColorAdjustment({brightness:C,contrast:y,saturation:v}):P?.setModelBrightness?.(C)}),o.watch(()=>b.backgroundColor,C=>{if(p.value?.setBackgroundColor)p.value.setBackgroundColor(C);else{const y=document.querySelector(".cesium-viewer");y&&(y.style.background=C)}}),o.watch(()=>w.collision,C=>p.value?.setCollisionDetection?.(C)),o.watch(()=>w.habit,C=>p.value?.setMouseHabit?.(C));const M=C=>{if(C?.pois&&Array.isArray(C.pois)&&C.pois.length>0){const y=C.pois[0],v=y.lonlat.split(/[, ]/).map(Number);if(v.length>=2&&!isNaN(v[0])&&!isNaN(v[1]))return{name:y.name,lon:v[0],lat:v[1],raw:y}}if(C?.area&&C.area.lonlat){const y=C.area,v=y.lonlat.split(/[, ]/).map(Number);if(v.length>=2&&!isNaN(v[0])&&!isNaN(v[1]))return{name:y.name,lon:v[0],lat:v[1],raw:y}}return null},V=_n(async()=>{const C=(g.value||"").trim();if(!C)return;const y=h.tiandituToken||"c25f14fb6bd4397cf8fe45144ff768d6";R.value=!0,x.value=[];try{if(p.value?.searchLocation){const v=await p.value.searchLocation(C,y),P=M(v);P&&(x.value=[P],ce.success(`找到:${P.name||""}`),p.value.flyToLonLatHeight(P.lon,P.lat,5e3))}else{const P=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(JSON.stringify({keyWord:C,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}))}&type=query&tk=${encodeURIComponent(y)}`,F=await fetch(P);if(!F.ok)throw new Error(`HTTP ${F.status}`);const U=await F.json(),O=M(U);O&&(x.value=[O],ce.success(`找到:${O.name||""}`),p.value?.flyToLonLatHeight?.(O.lon,O.lat,5e3))}}catch(v){console.error("tianditu search error",v)}finally{R.value=!1}},800);o.watch(g,()=>{V()});const k=()=>{u.value=!1,f("close")};return o.onMounted(()=>{}),(C,y)=>(o.openBlock(),o.createBlock(Le,{visible:u.value,title:"设置","full-height":n.fullHeight,onClose:k,"onUpdate:visible":y[26]||(y[26]=v=>u.value=v)},{default:o.withCtx(()=>[o.createElementVNode("div",iE,[o.createElementVNode("div",sE,[o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:m.value==="GIS"}]),onClick:y[0]||(y[0]=v=>m.value="GIS")},"GIS",2),o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:m.value==="MAP"}]),onClick:y[1]||(y[1]=v=>m.value="MAP")},"地图",2),o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:m.value==="RENDER"}]),onClick:y[2]||(y[2]=v=>m.value="RENDER")},"渲染",2),o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:m.value==="MOUSE"}]),onClick:y[3]||(y[3]=v=>m.value="MOUSE")},"鼠标",2)]),o.createElementVNode("div",oE,[m.value==="GIS"?(o.openBlock(),o.createElementBlock("div",rE,[o.createElementVNode("div",aE,[y[27]||(y[27]=o.createElementVNode("span",null,"地球 (含大气/日月/星空)",-1)),o.createVNode(o.unref(t),{checked:E.globe,"onUpdate:checked":y[4]||(y[4]=v=>E.globe=v),size:"small"},null,8,["checked"])]),o.createElementVNode("div",lE,[y[28]||(y[28]=o.createElementVNode("span",null,"地形 (高程)",-1)),o.createVNode(o.unref(t),{checked:E.terrain,"onUpdate:checked":y[5]||(y[5]=v=>E.terrain=v),size:"small"},null,8,["checked"])]),o.createElementVNode("div",cE,[y[29]||(y[29]=o.createElementVNode("span",null,"地形遮挡",-1)),o.createVNode(o.unref(t),{checked:E.depthTest,"onUpdate:checked":y[6]||(y[6]=v=>E.depthTest=v),size:"small"},null,8,["checked"])])])):o.createCommentVNode("",!0),m.value==="MAP"?(o.openBlock(),o.createElementBlock("div",dE,[o.createElementVNode("div",uE,[o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:A.provider==="tianditu"}]),onClick:y[7]||(y[7]=v=>A.provider="tianditu")},"天地图",2),o.createElementVNode("div",{class:o.normalizeClass(["tab-item",{active:A.provider==="arcgis"}]),onClick:y[8]||(y[8]=v=>A.provider="arcgis")},"ArcGIS",2)]),A.provider==="tianditu"?(o.openBlock(),o.createElementBlock("div",hE,[o.createElementVNode("div",fE,[y[30]||(y[30]=o.createElementVNode("div",{class:"sub-label"},"Token",-1)),o.createVNode(o.unref(r),{value:A.tianditu.token,"onUpdate:value":y[9]||(y[9]=v=>A.tianditu.token=v),size:"small",placeholder:"输入天地图Token"},null,8,["value"])]),o.createElementVNode("div",pE,[y[31]||(y[31]=o.createElementVNode("div",{class:"sub-label"},"地图风格",-1)),o.createVNode(o.unref(c),{value:A.tianditu.layerType,"onUpdate:value":y[10]||(y[10]=v=>A.tianditu.layerType=v),size:"small",style:{width:"100%"}},{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(N,v=>o.createVNode(o.unref(l),{key:v.value,value:v.value},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(v.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),o.createElementVNode("div",mE,[y[32]||(y[32]=o.createElementVNode("span",null,"叠加注记",-1)),o.createVNode(o.unref(t),{checked:A.tianditu.showLabel,"onUpdate:checked":y[11]||(y[11]=v=>A.tianditu.showLabel=v),size:"small"},null,8,["checked"])])])):o.createCommentVNode("",!0),A.provider==="arcgis"?(o.openBlock(),o.createElementBlock("div",gE,[o.createElementVNode("div",AE,[y[33]||(y[33]=o.createElementVNode("div",{class:"sub-label"},"服务地址",-1)),o.createVNode(o.unref(r),{value:A.arcgis.url,"onUpdate:value":y[12]||(y[12]=v=>A.arcgis.url=v),size:"small",placeholder:"输入ArcGIS MapServer地址"},null,8,["value"])])])):o.createCommentVNode("",!0),o.createElementVNode("div",yE,[y[34]||(y[34]=o.createElementVNode("div",{class:"sub-label"},"位置搜索 (天地图)",-1)),o.createElementVNode("div",CE,[o.createVNode(o.unref(r),{value:g.value,"onUpdate:value":y[13]||(y[13]=v=>g.value=v),placeholder:"输入地名搜索",size:"small","allow-clear":""},null,8,["value"])])])])):o.createCommentVNode("",!0),m.value==="RENDER"?(o.openBlock(),o.createElementBlock("div",EE,[o.createElementVNode("div",bE,[y[35]||(y[35]=o.createElementVNode("span",null,"阴影",-1)),o.createVNode(o.unref(t),{checked:b.shadows,"onUpdate:checked":y[14]||(y[14]=v=>b.shadows=v),size:"small"},null,8,["checked"])]),b.shadows?(o.openBlock(),o.createElementBlock("div",wE,[o.createElementVNode("div",vE,"阴影暗度 ("+o.toDisplayString(b.shadowDarkness.toFixed(2))+")",1),o.createVNode(o.unref(a),{value:b.shadowDarkness,"onUpdate:value":y[15]||(y[15]=v=>b.shadowDarkness=v),min:0,max:1,step:.05,size:"small"},null,8,["value"])])):o.createCommentVNode("",!0),o.createElementVNode("div",IE,[y[36]||(y[36]=o.createElementVNode("span",null,"环境贴图 (HDR)",-1)),o.createVNode(o.unref(t),{checked:b.environmentMap,"onUpdate:checked":y[16]||(y[16]=v=>b.environmentMap=v),size:"small"},null,8,["checked"])]),o.createElementVNode("div",BE,[y[37]||(y[37]=o.createElementVNode("span",null,"环境光遮蔽 (AO)",-1)),o.createVNode(o.unref(t),{checked:b.ambientOcclusion,"onUpdate:checked":y[17]||(y[17]=v=>b.ambientOcclusion=v),size:"small"},null,8,["checked"])]),o.createElementVNode("div",xE,[y[38]||(y[38]=o.createElementVNode("div",{class:"sub-label"},"日期时间",-1)),o.createVNode(o.unref(d),{value:b.time,"onUpdate:value":y[18]||(y[18]=v=>b.time=v),"show-time":"",locale:o.unref(ml),format:"YYYY-MM-DD HH:mm",size:"small",style:{width:"100%"}},null,8,["value","locale"])]),o.createElementVNode("div",SE,[o.createElementVNode("div",TE,"模型亮度 ("+o.toDisplayString(b.brightness.toFixed(1))+")",1),o.createVNode(o.unref(a),{value:b.brightness,"onUpdate:value":y[19]||(y[19]=v=>b.brightness=v),min:0,max:5,step:.1,size:"small"},null,8,["value"])]),o.createElementVNode("div",ME,[o.createElementVNode("div",DE,"模型对比度 ("+o.toDisplayString(b.contrast.toFixed(1))+")",1),o.createVNode(o.unref(a),{value:b.contrast,"onUpdate:value":y[20]||(y[20]=v=>b.contrast=v),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),o.createElementVNode("div",kE,[o.createElementVNode("div",PE,"模型饱和度 ("+o.toDisplayString(b.saturation.toFixed(1))+")",1),o.createVNode(o.unref(a),{value:b.saturation,"onUpdate:value":y[21]||(y[21]=v=>b.saturation=v),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),o.createElementVNode("div",NE,[y[39]||(y[39]=o.createElementVNode("div",{class:"sub-label"},"背景颜色",-1)),o.createElementVNode("div",FE,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(D,(v,P)=>o.createElementVNode("div",{key:P,style:o.normalizeStyle({background:v,width:"32px",height:"24px",borderRadius:"2px",cursor:"pointer",border:"1px solid #d9d9d9",flexShrink:0}),onClick:F=>b.backgroundColor=v,title:"预设 "+(P+1)},null,12,RE)),64))]),o.createElementVNode("div",LE,[o.withDirectives(o.createElementVNode("input",{type:"color","onUpdate:modelValue":y[22]||(y[22]=v=>B.value=v),style:{width:"40px",height:"24px",padding:"0",border:"1px solid #d9d9d9"}},null,512),[[o.vModelText,B.value]]),o.createVNode(o.unref(r),{value:b.backgroundColor,"onUpdate:value":y[23]||(y[23]=v=>b.backgroundColor=v),size:"small",style:{flex:"1"},placeholder:"CSS 颜色值"},null,8,["value"])])])])):o.createCommentVNode("",!0),m.value==="MOUSE"?(o.openBlock(),o.createElementBlock("div",OE,[o.createElementVNode("div",UE,[y[40]||(y[40]=o.createElementVNode("span",null,"碰撞检测",-1)),o.createVNode(o.unref(t),{checked:w.collision,"onUpdate:checked":y[24]||(y[24]=v=>w.collision=v),size:"small"},null,8,["checked"])]),o.createElementVNode("div",_E,[y[43]||(y[43]=o.createElementVNode("div",{class:"sub-label"},"操作习惯",-1)),o.createVNode(o.unref(i),{value:w.habit,"onUpdate:value":y[25]||(y[25]=v=>w.habit=v),size:"small"},{default:o.withCtx(()=>[o.createVNode(o.unref(s),{value:0},{default:o.withCtx(()=>[...y[41]||(y[41]=[o.createTextVNode("默认 (中键旋转)",-1)])]),_:1}),o.createVNode(o.unref(s),{value:1},{default:o.withCtx(()=>[...y[42]||(y[42]=[o.createTextVNode("习惯1 (左键旋转)",-1)])]),_:1})]),_:1},8,["value"])])])):o.createCommentVNode("",!0)])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-79494025"]]),QE={class:"cad-layer-panel"},VE={class:"layer-list-container"},GE={class:"list-header"},HE={class:"col-check"},YE=["checked"],zE={class:"list-body"},WE={class:"col-check"},jE=["checked","onChange"],KE={class:"col-index"},$E=["title"],XE={class:"col-color"},qE=["value"],JE={key:0,class:"empty-text"},ZE=ge(o.defineComponent({__name:"LeitingCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods",o.ref({})),r=o.ref(""),a=o.ref([]),c=()=>{s.value&&s.value.getDxfModels&&(a.value=s.value.getDxfModels().map(w=>({modelId:w.modelId,modelName:w.modelName}))||[])},l=o.computed(()=>a.value.map(w=>({value:w.modelId,label:w.modelName}))),d=o.ref([]),h=o.ref([]),f=o.computed(()=>d.value.length>0&&h.value.length===d.value.length),p=({modelId:w})=>{if(d.value=[],h.value=[],s.value&&s.value.getDxfLayers){const I=s.value.getDxfLayers({modelId:w});I&&Object.keys(I).forEach((D,N)=>{I[D].length&&(d.value.push({index:N+1,layerName:D,layerColor:I[D][0].color||"#ffffff",key:D}),h.value.push(D))})}},u=w=>{r.value=w,p({modelId:w})},m=w=>{w.target.checked?h.value=d.value.map(D=>D.key):h.value=[],A()},E=(w,I)=>{I.target.checked?h.value.includes(w)||h.value.push(w):h.value=h.value.filter(N=>N!==w),A()},A=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:r.value,show:!0,layers:h.value}),s.value.getDxfLayers)){const w=s.value.getDxfLayers({modelId:r.value});if(w){const I=Object.keys(w).filter(D=>!h.value.includes(D));s.value.showDxfLayer({modelId:r.value,show:!1,layers:I})}}},b=()=>{i("update:visible",!1),i("handleCloseCardByCadCard")};return o.watch(()=>t.visible,w=>{w&&(c(),t.currentModelId?(r.value=t.currentModelId,p({modelId:t.currentModelId})):l.value.length>0&&(r.value=l.value[0]?.value,p({modelId:r.value})))}),o.watch(()=>t.currentModelId,w=>{w&&t.visible&&(r.value=w,p({modelId:w}))}),(w,I)=>(o.openBlock(),o.createBlock(Le,{visible:n.visible,title:"CAD图层","onUpdate:visible":I[3]||(I[3]=D=>w.$emit("update:visible",D)),onClose:b,width:360,align:"right","initial-position":{x:0,y:60}},{"header-extra":o.withCtx(()=>[o.createElementVNode("div",{class:"header-select-container",onMousedown:I[2]||(I[2]=o.withModifiers(()=>{},["stop"]))},[I[4]||(I[4]=o.createElementVNode("span",{class:"header-label"},"图纸:",-1)),o.createVNode(o.unref(ie.Select),{value:r.value,"onUpdate:value":I[0]||(I[0]=D=>r.value=D),options:l.value,onChange:I[1]||(I[1]=D=>u(D)),placeholder:"选择模型",style:{width:"140px"},bordered:!1,class:"custom-header-select",popupClassName:"leiting-select-dropdown",size:"small"},null,8,["value","options"])],32)]),default:o.withCtx(()=>[o.createElementVNode("div",QE,[o.createElementVNode("div",VE,[o.createElementVNode("div",GE,[o.createElementVNode("div",HE,[o.createElementVNode("input",{type:"checkbox",checked:f.value,onChange:m},null,40,YE)]),I[5]||(I[5]=o.createElementVNode("div",{class:"col-index"},"序号",-1)),I[6]||(I[6]=o.createElementVNode("div",{class:"col-name"},"图层名称",-1)),I[7]||(I[7]=o.createElementVNode("div",{class:"col-color"},"颜色",-1))]),o.createElementVNode("div",zE,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,D=>(o.openBlock(),o.createElementBlock("div",{key:D.key,class:"list-item"},[o.createElementVNode("div",WE,[o.createElementVNode("input",{type:"checkbox",checked:h.value.includes(D.key),onChange:N=>E(D.key,N)},null,40,jE)]),o.createElementVNode("div",KE,o.toDisplayString(D.index),1),o.createElementVNode("div",{class:"col-name",title:D.layerName},o.toDisplayString(D.layerName),9,$E),o.createElementVNode("div",XE,[o.createElementVNode("input",{type:"color",value:D.layerColor,disabled:""},null,8,qE)])]))),128)),d.value.length===0?(o.openBlock(),o.createElementBlock("div",JE,"暂无数据")):o.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-a4db4977"]]),eb={class:"adjust-panel"},tb={class:"control-panel"},nb={class:"form-item"},ib={class:"radio-group"},sb={class:"form-item"},ob=["title"],rb={class:"param-row"},ab=["step"],lb={class:"param-row"},cb=["step"],db={class:"param-row"},ub=["step"],hb={class:"param-row"},fb=["step"],pb={class:"param-row"},mb=["step"],gb={class:"param-row"},Ab=["step"],yb={class:"param-row"},Cb=["step"],Eb={class:"button-grid"},bb={key:1,class:"pick-mode-ui"},wb=["onClick"],vb=["checked"],Ib={style:{"font-size":"12px",color:"#aaa","padding-left":"10px"}},Bb={class:"param-row"},xb={style:{width:"40px"}},Sb=["onUpdate:modelValue"],Tb={class:"param-row"},Mb={style:{width:"40px"}},Db=["onUpdate:modelValue"],kb={class:"param-row"},Pb={style:{width:"40px"}},Nb=["onUpdate:modelValue"],Fb={class:"list-panel"},Rb={class:"list-header"},Lb={class:"col-check"},Ob=["checked"],Ub={class:"list-body"},_b={class:"col-check"},Qb=["onUpdate:modelValue"],Vb={class:"col-index"},Gb=["title"],Hb={class:"col-main"},Yb=["checked","onChange"],zb={key:0,style:{padding:"10px","text-align":"center",color:"#999"}},Wb=ge(o.defineComponent({__name:"LeitingCadPosition",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","handleSavingByCadCard","clearBimPointList","save"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=o.inject("leitingMethods"),a=o.ref([]),c=o.ref(""),l=o.computed(()=>a.value.length>0&&a.value.every(y=>y.selected)),d=o.ref("param"),h=o.ref("bimPoint1"),f=o.ref(null),p=o.ref("bimPoint1"),u=o.reactive({bimPoint1:{longitude:void 0,latitude:void 0,type:"CAD标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0},bimPoint2:{longitude:void 0,latitude:void 0,type:"地图标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0}}),m=o.ref(1e-6),E=o.reactive({modelId:"",longitude:0,latitude:0,distance:1e-6,rotation:1,totalRotation:0,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0}),A=o.computed(()=>{const y=a.value.find(v=>v.modelId===c.value);return y?y.modelName:""}),b=()=>{s("update:visible",!1)},w=()=>(!f.value&&r?.value?.getViewer&&r?.value?.getCesium&&(f.value=new pl(r.value.getViewer(),r.value.getCesium())),f.value),I=()=>{w()?.clearMarkers(),u.bimPoint1.longitude=void 0,u.bimPoint1.latitude=void 0,u.bimPoint1.height=void 0,u.bimPoint2.longitude=void 0,u.bimPoint2.latitude=void 0,u.bimPoint2.height=void 0},D=y=>{const v=h.value,P=u[v];if(P){P.longitude=y.longitude,P.latitude=y.latitude,P.height=y.height;const F=v==="bimPoint1"?"BIM":"MAP";w()?.addMarker(F,y),ce.success(`${P.type}已添加`)}},N=()=>{w()?.registerPickHandler(y=>{D(y)})},S=()=>{w()?.destroyPickHandler()},B=y=>{d.value=y,y!=="pick"&&s("clearBimPointList")};o.watch(()=>d.value,y=>{y==="pick"?N():S()}),o.onUnmounted(()=>{S()});const g=()=>{if(!r?.value?.getDxfModels)return;const y=r.value.getDxfModels();if(Array.isArray(y)?a.value=y.map(v=>({modelId:v.modelId,modelName:v.modelName,formData:v.formData||{},selected:!1,tileset:v})):a.value=[],a.value.length>0){const v=r.value.getCadModelId?r.value.getCadModelId():"";v&&a.value.find(P=>P.modelId===v)?R(v):R(a.value[0].modelId),a.value.forEach(P=>P.selected=!0)}},R=y=>{c.value=y;const v=a.value.find(P=>P.modelId===y);v&&v.formData&&Object.keys(E).forEach(P=>{v.formData[P]!==void 0&&(E[P]=v.formData[P])})},x=(y,v)=>{if(!r?.value?.adjustingModelByCad)return;const P=a.value.find(F=>F.modelId===y);P&&P.tileset&&(P.formData={...P.formData,...v},P.tileset.formData=P.formData,r.value.adjustingModelByCad({...P.formData,tileset:P.tileset}))},M=y=>{if(!c.value)return;const v=E[y];x(c.value,{[y]:v})},L=y=>{const v=a.value.filter(O=>O.selected);if(v.length===0){ce.warning("请先选择要调整的模型");return}const{distance:P,heightDistance:F,rotation:U}=E;v.forEach(O=>{const T={...O.formData};switch(y){case"north":T.latitude+=P;break;case"south":T.latitude-=P;break;case"east":T.longitude+=P;break;case"west":T.longitude-=P;break;case"up":T.height+=F;break;case"down":T.height-=F;break;case"rotateLeft":T.totalRotation=(T.totalRotation||0)-U;break;case"rotateRight":T.totalRotation=(T.totalRotation||0)+U;break}O.modelId===c.value&&Object.assign(E,T),x(O.modelId,T)})},V=y=>{const v=y.target.checked;a.value.forEach(P=>P.selected=v)},k=()=>{s("handleSavingByCadCard",a.value),s("save",a.value)},C=()=>{const y=u.bimPoint1,v=u.bimPoint2;if(y.longitude===void 0||v.longitude===void 0){ce.warning("请先完成点选操作");return}const P=a.value.filter(_=>_.selected);if(P.length===0){ce.warning("请先选择要调整的模型");return}let F=0,U=0,O=0;const T=w();if(T){const{dLon:_,dLat:H,dHeight:j}=T.calculateOffset(y,v);F=_,U=H,O=j}else F=v.longitude-y.longitude,U=v.latitude-y.latitude,O=v.height-y.height;P.forEach(_=>{const H={..._.formData};H.longitude+=F,H.latitude+=U,H.height+=O,_.modelId===c.value&&Object.assign(E,H),x(_.modelId,H)}),ce.success("位置已调整")};return o.watch(()=>i.visible,y=>{y?g():(S(),I())}),o.onMounted(()=>{i.visible&&g()}),e({setBIMPointsList:({longitude:y,latitude:v,height:P})=>{u[p.value].longitude=y,u[p.value].latitude=v,u[p.value].height=P},addGltfOr3dTilesModelList:y=>{console.warn("addGltfOr3dTilesModelList is deprecated, use internal loading")}}),(y,v)=>(o.openBlock(),o.createBlock(Le,{visible:i.visible,title:"Cad校准",width:282,height:600,"onUpdate:visible":v[21]||(v[21]=P=>s("update:visible",P)),onClose:b},{default:o.withCtx(()=>[o.createElementVNode("div",eb,[o.createElementVNode("div",tb,[o.createElementVNode("div",nb,[v[22]||(v[22]=o.createElementVNode("label",null,"调整操作:",-1)),o.createElementVNode("div",ib,[o.createElementVNode("span",{class:o.normalizeClass({active:d.value==="param"}),onClick:v[0]||(v[0]=P=>B("param"))},"参数模式",2),o.createElementVNode("span",{class:o.normalizeClass({active:d.value==="pick"}),onClick:v[1]||(v[1]=P=>B("pick"))},"地图点选",2)])]),o.createElementVNode("div",sb,[v[23]||(v[23]=o.createElementVNode("label",null,"当前主模型:",-1)),o.createElementVNode("span",{class:"value",title:A.value},o.toDisplayString(A.value||"未选择"),9,ob)]),v[35]||(v[35]=o.createElementVNode("div",{class:"separator"},null,-1)),d.value==="param"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[v[31]||(v[31]=o.createElementVNode("div",{class:"group-header"},"当前状态",-1)),o.createElementVNode("div",rb,[v[24]||(v[24]=o.createElementVNode("label",null,"经度(东西):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[2]||(v[2]=P=>E.longitude=P),onChange:v[3]||(v[3]=P=>M("longitude")),step:m.value},null,40,ab),[[o.vModelText,E.longitude,void 0,{number:!0}]])]),o.createElementVNode("div",lb,[v[25]||(v[25]=o.createElementVNode("label",null,"纬度(南北):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[4]||(v[4]=P=>E.latitude=P),onChange:v[5]||(v[5]=P=>M("latitude")),step:m.value},null,40,cb),[[o.vModelText,E.latitude,void 0,{number:!0}]])]),o.createElementVNode("div",db,[v[26]||(v[26]=o.createElementVNode("label",null,"高度(m):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[6]||(v[6]=P=>E.height=P),onChange:v[7]||(v[7]=P=>M("height")),step:m.value},null,40,ub),[[o.vModelText,E.height,void 0,{number:!0}]])]),o.createElementVNode("div",hb,[v[27]||(v[27]=o.createElementVNode("label",null,"累计旋转(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[8]||(v[8]=P=>E.totalRotation=P),onChange:v[9]||(v[9]=P=>M("totalRotation")),step:m.value},null,40,fb),[[o.vModelText,E.totalRotation,void 0,{number:!0}]])]),v[32]||(v[32]=o.createElementVNode("div",{class:"separator"},null,-1)),v[33]||(v[33]=o.createElementVNode("div",{class:"group-header"},"调整步长",-1)),o.createElementVNode("div",pb,[v[28]||(v[28]=o.createElementVNode("label",null,"经纬步长(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[10]||(v[10]=P=>E.distance=P),step:m.value},null,8,mb),[[o.vModelText,E.distance,void 0,{number:!0}]])]),o.createElementVNode("div",gb,[v[29]||(v[29]=o.createElementVNode("label",null,"高度步长(m):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[11]||(v[11]=P=>E.heightDistance=P),step:m.value},null,8,Ab),[[o.vModelText,E.heightDistance,void 0,{number:!0}]])]),o.createElementVNode("div",yb,[v[30]||(v[30]=o.createElementVNode("label",null,"旋转步长(°):",-1)),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":v[12]||(v[12]=P=>E.rotation=P),step:m.value},null,8,Cb),[[o.vModelText,E.rotation,void 0,{number:!0}]])]),o.createElementVNode("div",Eb,[o.createElementVNode("button",{onClick:v[13]||(v[13]=P=>L("rotateLeft"))},"左转"),o.createElementVNode("button",{onClick:v[14]||(v[14]=P=>L("north"))},"北移"),o.createElementVNode("button",{onClick:v[15]||(v[15]=P=>L("rotateRight"))},"右转"),o.createElementVNode("button",{onClick:v[16]||(v[16]=P=>L("west"))},"西移"),o.createElementVNode("button",{onClick:v[17]||(v[17]=P=>L("south"))},"南移"),o.createElementVNode("button",{onClick:v[18]||(v[18]=P=>L("east"))},"东移"),o.createElementVNode("button",{onClick:v[19]||(v[19]=P=>L("up"))},"上移"),o.createElementVNode("button",{onClick:v[20]||(v[20]=P=>L("down"))},"下移"),o.createElementVNode("button",{onClick:k,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):(o.openBlock(),o.createElementBlock("div",bb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u,(P,F)=>(o.openBlock(),o.createElementBlock("div",{key:F,class:"form-item",style:{display:"block","margin-bottom":"15px"}},[o.createElementVNode("div",{style:{"font-weight":"bold","margin-bottom":"5px",cursor:"pointer",display:"flex","align-items":"center"},onClick:U=>h.value=F},[o.createElementVNode("input",{type:"radio",checked:h.value===F,style:{"margin-right":"5px"}},null,8,vb),o.createTextVNode(" "+o.toDisplayString(P.type)+": ",1)],8,wb),o.createElementVNode("div",Ib,[o.createElementVNode("div",Bb,[o.createElementVNode("label",xb,o.toDisplayString(P.longitudeText),1),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":U=>P.longitude=U,readonly:"",style:{width:"100px"}},null,8,Sb),[[o.vModelText,P.longitude,void 0,{number:!0}]])]),o.createElementVNode("div",Tb,[o.createElementVNode("label",Mb,o.toDisplayString(P.latitudeText),1),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":U=>P.latitude=U,readonly:"",style:{width:"100px"}},null,8,Db),[[o.vModelText,P.latitude,void 0,{number:!0}]])]),o.createElementVNode("div",kb,[o.createElementVNode("label",Pb,o.toDisplayString(P.heightText),1),o.withDirectives(o.createElementVNode("input",{type:"number","onUpdate:modelValue":U=>P.height=U,readonly:"",style:{width:"100px"}},null,8,Nb),[[o.vModelText,P.height,void 0,{number:!0}]])])])]))),128)),o.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[o.createElementVNode("button",{onClick:C,class:"primary-btn"},"应用校准"),o.createElementVNode("button",{onClick:k},"保存")]),v[34]||(v[34]=o.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[o.createElementVNode("div",null,"操作指南:"),o.createElementVNode("div",null,"1. 勾选上方 CAD 或 地图 标记点选项。"),o.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),o.createElementVNode("div",null,"3. 采集两点后,点击“应用校准”进行校准。")],-1))]))]),o.createElementVNode("div",Fb,[o.createElementVNode("div",Rb,[o.createElementVNode("div",Lb,[o.createElementVNode("input",{type:"checkbox",checked:l.value,onChange:V},null,40,Ob)]),v[36]||(v[36]=o.createElementVNode("div",{class:"col-index"},"序号",-1)),v[37]||(v[37]=o.createElementVNode("div",{class:"col-name"},"名称",-1)),v[38]||(v[38]=o.createElementVNode("div",{class:"col-main"},"主模型",-1))]),o.createElementVNode("div",Ub,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(P,F)=>(o.openBlock(),o.createElementBlock("div",{key:P.modelId,class:o.normalizeClass(["list-item",{active:P.modelId===c.value}])},[o.createElementVNode("div",_b,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":U=>P.selected=U},null,8,Qb),[[o.vModelCheckbox,P.selected]])]),o.createElementVNode("div",Vb,o.toDisplayString(F+1),1),o.createElementVNode("div",{class:"col-name",title:P.modelName},o.toDisplayString(P.modelName),9,Gb),o.createElementVNode("div",Hb,[o.createElementVNode("input",{type:"radio",name:"mainModel",checked:P.modelId===c.value,onChange:U=>R(P.modelId)},null,40,Yb)])],2))),128)),a.value.length===0?(o.openBlock(),o.createElementBlock("div",zb,"暂无数据")):o.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-e8abd49d"]]),jb={class:"annotation-content"},Kb={class:"annotation-tools"},$b={class:"annotation-controls"},Xb={class:"control-group",title:"颜色"},qb={class:"tool-item color-tool"},Jb={class:"control-group line-width-container",title:"线宽"},Zb=["onClick"],ew={class:"option-label"},tw=ge(o.defineComponent({__name:"LeitingAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.ref(""),a=o.ref("#ff0000"),c=o.ref(1),l=o.ref(!1),d=o.ref(null),h=o.ref(null),f=o.ref({top:"0px",left:"0px"}),p=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],u=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,m=()=>{i("update:visible",!1)},E=B=>{r.value=B;const g=u();if(g)switch(B){case"freehandLine":g.startFreehandLine();break;case"arrow":g.startArrow();break;case"straightLine":g.startStraightLine();break;case"rectangle":g.startRectangle();break;case"ellipse":g.startEllipse();break}},A=()=>{const B=u();B&&(B.setCurrentColor(a.value),B.changeColor(a.value))},b=()=>{if(!l.value&&d.value){const B=d.value.getBoundingClientRect();f.value={top:`${B.top}px`,left:`${B.right+8}px`}}l.value=!l.value},w=B=>{c.value=B,l.value=!1;const g=u();g&&(g.setCurrentWidth(B),g.changeWidth(B))},I=()=>{const B=u();B&&B.deleteSelectedEntity()},D=()=>{const B=u();B&&B.clearAll()},N=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const B=u();B&&B.saveAnnotations()},S=B=>{const g=B.target,R=d.value&&d.value.contains(g),x=h.value&&h.value.contains(g);!R&&!x&&(l.value=!1)};return o.onMounted(()=>{document.addEventListener("click",S)}),o.onUnmounted(()=>{document.removeEventListener("click",S)}),(B,g)=>(o.openBlock(),o.createBlock(Le,{visible:t.visible,title:"标注",width:70,"min-width":70,height:480,"onUpdate:visible":g[6]||(g[6]=R=>i("update:visible",R)),onClose:m},{default:o.withCtx(()=>[o.createElementVNode("div",jb,[o.createElementVNode("div",Kb,[o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:r.value==="freehandLine"}]),onClick:g[0]||(g[0]=R=>E("freehandLine")),title:"手绘线"},[...g[7]||(g[7]=[o.createElementVNode("div",{class:"tool-icon"},"✏️",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:r.value==="arrow"}]),onClick:g[1]||(g[1]=R=>E("arrow")),title:"箭头"},[...g[8]||(g[8]=[o.createElementVNode("div",{class:"tool-icon"},"↗️",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:r.value==="straightLine"}]),onClick:g[2]||(g[2]=R=>E("straightLine")),title:"直线"},[...g[9]||(g[9]=[o.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:r.value==="rectangle"}]),onClick:g[3]||(g[3]=R=>E("rectangle")),title:"矩形"},[...g[10]||(g[10]=[o.createElementVNode("div",{class:"tool-icon"},"▭",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:r.value==="ellipse"}]),onClick:g[4]||(g[4]=R=>E("ellipse")),title:"椭圆"},[...g[11]||(g[11]=[o.createElementVNode("div",{class:"tool-icon"},"⭕",-1)])],2)]),g[13]||(g[13]=o.createElementVNode("div",{class:"separator"},null,-1)),o.createElementVNode("div",$b,[o.createElementVNode("div",Xb,[o.createElementVNode("div",qb,[o.createElementVNode("div",{class:"color-swatch",style:o.normalizeStyle({backgroundColor:a.value})},null,4),o.withDirectives(o.createElementVNode("input",{type:"color","onUpdate:modelValue":g[5]||(g[5]=R=>a.value=R),onChange:A,class:"color-input-overlay"},null,544),[[o.vModelText,a.value]])])]),o.createElementVNode("div",Jb,[o.createElementVNode("div",{ref_key:"lineWidthBtnRef",ref:d,class:"tool-item",onClick:o.withModifiers(b,["stop"])},[o.createElementVNode("div",{class:"current-width-preview",style:o.normalizeStyle({height:c.value+"px",backgroundColor:"#fff"})},null,4)],512),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,class:"line-width-dropdown",style:o.normalizeStyle(f.value)},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(p,R=>o.createElementVNode("div",{key:R.value,class:o.normalizeClass(["line-width-option",{selected:c.value===R.value}]),onClick:o.withModifiers(x=>w(R.value),["stop"])},[o.createElementVNode("span",ew,o.toDisplayString(R.label),1),o.createElementVNode("div",{class:"line-preview",style:o.normalizeStyle({height:R.value+"px",backgroundColor:c.value===R.value?"#1890ff":"#ddd"})},null,4)],10,Zb)),64))],4)):o.createCommentVNode("",!0)]))]),g[12]||(g[12]=o.createElementVNode("div",{class:"separator"},null,-1)),o.createElementVNode("div",{class:"action-buttons"},[o.createElementVNode("button",{class:"control-btn",onClick:I,title:"删除选中"}," 🗑️ "),o.createElementVNode("button",{class:"control-btn",onClick:D,title:"清空"}," ❌ "),o.createElementVNode("button",{class:"control-btn",onClick:N,title:"保存"}," 💾 ")])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-3cfc8415"]]),nw={class:"measure-content"},iw={class:"measure-tools"},sw={key:0,class:"measure-results"},ow={class:"result-row"},rw={class:"result-value"},aw={class:"result-row"},lw={class:"result-value"},cw={class:"result-row"},dw={class:"result-value"},uw={class:"result-row"},hw={class:"result-value"},fw={key:1,class:"result-row"},pw={class:"result-value"},mw={key:2,class:"result-row"},gw={class:"result-value"},Aw={class:"measure-controls"},yw={class:"control-group",title:"单位"},Cw={class:"unit-display"},Ew=["onClick"],bw=ge(o.defineComponent({__name:"LeitingMeasurement",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods",o.ref({})),r=o.ref(null),a=o.ref(null),c=o.ref("m"),l=o.ref(!1),d=o.ref(null),h=o.ref(!1),f=o.ref({}),p=o.ref(null),u=[{label:"米 (m)",value:"m"},{label:"厘米 (cm)",value:"cm"},{label:"毫米 (mm)",value:"mm"}],m=B=>{const g=c.value;return g==="mm"?`${(B*1e3).toFixed(0)}mm`:g==="cm"?`${(B*100).toFixed(1)}cm`:`${B.toFixed(2)}m`},E=B=>B>1e6?`${(B/1e6).toFixed(2)} km²`:`${B.toFixed(2)} m²`,A=()=>{if(!r.value&&s.value?.getViewer){const B=s.value.getViewer(),g=s.value.getCesium();B&&g&&(r.value=new Ps({viewer:B,cesium:g}),r.value.setUnit(c.value),r.value.setSnapping(l.value),r.value.onMeasure=R=>{d.value=R})}},b=B=>{r.value||A(),a.value===B?(a.value=null,r.value?.stop(),s.value?.baseCompt?.enableSelection()):(a.value=B,r.value?.start(B),s.value?.baseCompt?.disableSelection())},w=B=>{c.value=B,h.value=!1},I=()=>{r.value&&(r.value.clearAll(),a.value=null,r.value.stop()),s.value?.baseCompt?.enableSelection()},D=()=>{i("update:visible",!1)},N=B=>{if(h.value){h.value=!1;return}const R=B.currentTarget.getBoundingClientRect();f.value={position:"fixed",top:`${R.top}px`,left:`${R.right+5}px`,zIndex:3e3},h.value=!0},S=B=>{h.value&&p.value&&!p.value.contains(B.target)&&(h.value=!1)};return o.onMounted(()=>{document.addEventListener("click",S),t.visible&&o.nextTick(()=>A())}),o.onUnmounted(()=>{document.removeEventListener("click",S),r.value&&r.value.destroy()}),o.watch(()=>t.visible,B=>{B?o.nextTick(()=>A()):r.value&&(r.value.stop(),a.value=null)}),o.watch(s,B=>{B&&B.getViewer&&!r.value&&t.visible&&A()}),o.watch(c,B=>{r.value&&r.value.setUnit(B)}),(B,g)=>(o.openBlock(),o.createBlock(Le,{visible:t.visible,title:"量算",width:70,"min-width":70,height:480,"onUpdate:visible":g[3]||(g[3]=R=>i("update:visible",R)),onClose:D},{default:o.withCtx(()=>[o.createElementVNode("div",nw,[o.createElementVNode("div",iw,[o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:a.value==="distance"}]),onClick:g[0]||(g[0]=R=>b("distance")),title:"距离测量"},[...g[4]||(g[4]=[o.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:a.value==="angle"}]),onClick:g[1]||(g[1]=R=>b("angle")),title:"角度测量"},[...g[5]||(g[5]=[o.createElementVNode("div",{class:"tool-icon"},"📐",-1)])],2),o.createElementVNode("div",{class:o.normalizeClass(["tool-item",{active:a.value==="area"}]),onClick:g[2]||(g[2]=R=>b("area")),title:"面积测量"},[...g[6]||(g[6]=[o.createElementVNode("div",{class:"tool-icon"},"🔳",-1)])],2)]),g[15]||(g[15]=o.createElementVNode("div",{class:"separator"},null,-1)),d.value?(o.openBlock(),o.createElementBlock("div",sw,[d.value.type==="distance"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",ow,[g[7]||(g[7]=o.createElementVNode("span",{class:"result-label"},"总长:",-1)),o.createElementVNode("span",rw,o.toDisplayString(m(d.value.dist)),1)]),o.createElementVNode("div",aw,[g[8]||(g[8]=o.createElementVNode("span",{class:"result-label",style:{color:"#ff4d4f"}},"ΔX:",-1)),o.createElementVNode("span",lw,o.toDisplayString(m(d.value.dx)),1)]),o.createElementVNode("div",cw,[g[9]||(g[9]=o.createElementVNode("span",{class:"result-label",style:{color:"#52c41a"}},"ΔY:",-1)),o.createElementVNode("span",dw,o.toDisplayString(m(d.value.dy)),1)]),o.createElementVNode("div",uw,[g[10]||(g[10]=o.createElementVNode("span",{class:"result-label",style:{color:"#1890ff"}},"ΔZ:",-1)),o.createElementVNode("span",hw,o.toDisplayString(m(d.value.dz)),1)])],64)):o.createCommentVNode("",!0),d.value.type==="angle"?(o.openBlock(),o.createElementBlock("div",fw,[g[11]||(g[11]=o.createElementVNode("span",{class:"result-label"},"角度:",-1)),o.createElementVNode("span",pw,o.toDisplayString(d.value.angle.toFixed(1))+"°",1)])):o.createCommentVNode("",!0),d.value.type==="area"?(o.openBlock(),o.createElementBlock("div",mw,[g[12]||(g[12]=o.createElementVNode("span",{class:"result-label"},"面积:",-1)),o.createElementVNode("span",gw,o.toDisplayString(E(d.value.area)),1)])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",Aw,[o.createElementVNode("div",yw,[o.createElementVNode("div",{class:"tool-item",onClick:o.withModifiers(N,["stop"])},[o.createElementVNode("div",Cw,o.toDisplayString(c.value),1)]),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[h.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"unitDropdownRef",ref:p,class:"unit-dropdown",style:o.normalizeStyle(f.value)},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(u,R=>o.createElementVNode("div",{key:R.value,class:o.normalizeClass(["unit-option",{selected:c.value===R.value}]),onClick:o.withModifiers(x=>w(R.value),["stop"])},o.toDisplayString(R.label),11,Ew)),64))],4)):o.createCommentVNode("",!0)]))]),g[14]||(g[14]=o.createElementVNode("div",{class:"separator"},null,-1)),o.createElementVNode("div",{class:"action-buttons"},[o.createElementVNode("div",{class:"tool-item control-btn",onClick:I,title:"清空"},[...g[13]||(g[13]=[o.createElementVNode("div",{class:"tool-icon"},"🗑️",-1)])])])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-8b1e070f"]]);function vl(){const n=o.ref(!1),e=o.reactive({x:0,y:0}),t=o.ref([]),i=o.ref(null);return{visible:n,position:e,items:t,contextData:i,show:(l,d,h)=>{l instanceof MouseEvent?(l.preventDefault(),e.x=l.clientX,e.y=l.clientY):(e.x=l.x,e.y=l.y),t.value=d,i.value=h,n.value=!0},hide:()=>{n.value=!1},addItem:l=>{t.value.push(l)},removeItem:l=>{t.value=t.value.filter(d=>d.id!==l)}}}const ww=["onClick","onTouchend"],vw={class:"menu-label"},Iw={key:0,class:"menu-arrow"},Bw=ge(o.defineComponent({__name:"LeitingContextMenu",props:{visible:{type:Boolean},position:{},items:{}},emits:["update:visible","action"],setup(n,{emit:e}){const t=n,i=e,{isMobile:s}=ui(),r=o.computed(()=>{let l=t.position.x,d=t.position.y;if(s.value){const f=t.items.length*48;l+200>window.innerWidth-16&&(l=window.innerWidth-200-16),d+f>window.innerHeight-16&&(d=window.innerHeight-f-16),d<16&&(d=16)}return{left:l+"px",top:d+"px"}}),a=l=>{l.disabled||(l.action&&l.action(),i("action",l),i("update:visible",!1))},c=()=>{t.visible&&i("update:visible",!1)};return o.onMounted(()=>{document.addEventListener("click",c),document.addEventListener("contextmenu",l=>{l.target.closest(".leiting-context-menu")||c()})}),o.onUnmounted(()=>{document.removeEventListener("click",c)}),(l,d)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["leiting-context-menu",{"mobile-style":o.unref(s)}]),style:o.normalizeStyle(r.value),onContextmenu:d[0]||(d[0]=o.withModifiers(()=>{},["prevent"]))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,h=>(o.openBlock(),o.createElementBlock("div",{key:h.id,class:o.normalizeClass(["menu-item",{"menu-divided":h.divided,"menu-disabled":h.disabled}]),onClick:f=>a(h),onTouchend:o.withModifiers(f=>a(h),["prevent"])},[o.createElementVNode("span",vw,o.toDisplayString(h.label),1),h.children?(o.openBlock(),o.createElementBlock("span",Iw,"▶")):o.createCommentVNode("",!0)],42,ww))),128))],38)),[[o.vShow,n.visible]])}}),[["__scopeId","data-v-62c220a6"]]),xw={class:"mobile-nav-root"},Sw={class:"nav-bar-container"},Tw={key:"sub-mode",class:"nav-inner sub-menu-wrapper"},Mw={class:"sub-icons-list"},Dw=["onClick"],kw=["innerHTML"],Pw={key:"main-mode",class:"nav-inner main-menu-wrapper"},Nw=["onClick"],Fw=["src","alt"],Il=ge(o.defineComponent({__name:"MobileBottomNav",props:{activeIds:{},is2d:{type:Boolean},customItems:{}},emits:["item-click","sub-item-click","clear-measure"],setup(n,{emit:e}){const t=n,i=e,s=o.ref(null),r=o.ref(null),a={measure:[{id:"distance",label:"距离",parentId:"measure",parentKey:"measurement"},{id:"angle",label:"角度",parentId:"measure",parentKey:"measurement"},{id:"area",label:"面积",parentId:"measure",parentKey:"measurement"},{id:"coordinate",label:"坐标",parentId:"measure",parentKey:"measurement"}],section:[{id:"box",label:"剖切盒",parentId:"section",parentKey:"section"},{id:"plane-x",label:"X轴",parentId:"section",parentKey:"section"},{id:"plane-y",label:"Y轴",parentId:"section",parentKey:"section"}]},c={distance:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 17l6-6 4 4 8-8"/><path d="M17 7h4v4"/></svg>',angle:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 20H4L14 4"/></svg>',area:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',coordinate:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20M2 12h20"/></svg>',box:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/></svg>'},l=A=>c[A]||c.box,d=o.ref([{ID:"home",title:"主视角",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"homeView"},{ID:"measure",title:"量算",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"measurement"},{ID:"roam",title:"漫游",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"roam"},{ID:"info",title:"信息",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"componentInfo"},{ID:"setting",title:"设置",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"setting"}]),h=o.ref([{ID:"home",title:"主视角",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"homeView"},{ID:"cadLayer",title:"CAD图层",src:fi,key:"cadLayer"},{ID:"annotation",title:"标注",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:me&&me.tagName.toUpperCase()==="SCRIPT"&&me.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"annotation"}]),f=o.computed(()=>{let b=[...t.is2d?h.value:d.value];return t.customItems&&(b=[...b,...t.customItems]),b}),p=o.computed(()=>s.value?a[s.value.ID]||[]:[]),u=A=>{if(a[A.ID]){if(A.ID==="measure"){i("item-click",A);return}if(s.value?.ID===A.ID)E();else{s.value=A,r.value=null;const b=a[A.ID];b&&b.length>0&&(r.value=b[0]?.id??null,setTimeout(()=>{i("sub-item-click",{parent:A,sub:b[0]})},50))}}else i("item-click",A)},m=A=>{r.value=A.id,i("sub-item-click",{parent:s.value,sub:A})},E=()=>{s.value=null,r.value=null};return(A,b)=>(o.openBlock(),o.createElementBlock("div",xw,[o.createElementVNode("nav",Sw,[o.createVNode(o.Transition,{name:"nav-mode-switch",mode:"out-in"},{default:o.withCtx(()=>[s.value?(o.openBlock(),o.createElementBlock("div",Tw,[o.createElementVNode("button",{class:"nav-back-icon",onClick:E},[...b[0]||(b[0]=[o.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3"},[o.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)])]),o.createElementVNode("div",Mw,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,w=>(o.openBlock(),o.createElementBlock("button",{key:w.id,class:o.normalizeClass(["sub-icon-box",{active:r.value===w.id}]),onClick:I=>m(w)},[o.createElementVNode("div",{class:"icon-svg",innerHTML:l(w.id)},null,8,kw)],10,Dw))),128))])])):(o.openBlock(),o.createElementBlock("div",Pw,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,w=>(o.openBlock(),o.createElementBlock("div",{key:w.ID,class:o.normalizeClass(["main-tab-item",{active:n.activeIds?.includes(w.ID)}]),onClick:I=>u(w)},[o.createElementVNode("img",{src:w.src,class:"tab-img",alt:w.title},null,8,Fw)],10,Nw))),128))]))]),_:1})])]))}}),[["__scopeId","data-v-976b4d8c"]]),Rw={key:1,class:"drawer-header"},Lw={class:"drawer-title"},Ow={class:"drawer-content"},Uw={key:2,class:"drawer-footer"},bi=ge(o.defineComponent({__name:"MobileDrawer",props:{visible:{type:Boolean},title:{},direction:{default:"bottom"},width:{default:"100%"},height:{default:"50vh"},showHandle:{type:Boolean,default:!1},closeOnOverlay:{type:Boolean,default:!0},maxHeight:{default:"60vh"}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=e,s=o.ref(null);let r=0,a=0;const c=o.computed(()=>{const u={};return t.direction==="right"||t.direction==="left"?(u.width=t.width,u.height="100%"):(u.width=t.width,u.height=t.height,u.maxHeight=t.maxHeight),u}),l=u=>{r=u.touches[0]?.clientY??0,s.value&&(s.value.style.transition="none")},d=u=>{if(!s.value)return;a=(u.touches[0]?.clientY??0)-r,a>0&&(s.value.style.transform=`translateY(${a}px)`)},h=()=>{s.value&&(s.value.style.transition="transform 300ms cubic-bezier(0.4, 0, 0.2, 1)",a>100?f():s.value.style.transform="",a=0)},f=()=>{i("update:visible",!1),i("close")},p=()=>{t.closeOnOverlay&&f()};return o.watch(()=>t.visible,u=>{u?document.body.style.overflow="hidden":document.body.style.overflow=""}),(u,m)=>(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"drawer-fade"},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:"mobile-drawer-overlay",onClick:o.withModifiers(p,["self"])},[o.createElementVNode("div",{class:o.normalizeClass(["mobile-drawer-panel",[`direction-${n.direction}`]]),style:o.normalizeStyle(c.value),onClick:m[0]||(m[0]=o.withModifiers(()=>{},["stop"])),ref_key:"panelRef",ref:s},[n.direction==="bottom"&&n.showHandle?(o.openBlock(),o.createElementBlock("div",{key:0,class:"drawer-handle",onTouchstart:l,onTouchmove:d,onTouchend:h},[...m[1]||(m[1]=[o.createElementVNode("div",{class:"handle-bar"},null,-1)])],32)):o.createCommentVNode("",!0),n.title||u.$slots.title?(o.openBlock(),o.createElementBlock("div",Rw,[o.renderSlot(u.$slots,"title",{},()=>[o.createElementVNode("span",Lw,o.toDisplayString(n.title),1)],!0),o.createElementVNode("button",{class:"drawer-close-btn",onClick:f},[...m[2]||(m[2]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[o.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])])):o.createCommentVNode("",!0),o.createElementVNode("div",Ow,[o.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(o.openBlock(),o.createElementBlock("div",Uw,[o.renderSlot(u.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],6)])):o.createCommentVNode("",!0)]),_:3})]))}}),[["__scopeId","data-v-66d9d696"]]),_w={class:"mobile-tree-container"},Qw={class:"search-section"},Vw={class:"search-inner"},Gw=["innerHTML"],Bl=ge(o.defineComponent({__name:"MobileTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},treeData:{default:()=>[]},initialCheckedKeys:{default:()=>[]}},emits:["update:visible","update:open","close","select","check","search"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:M=>{i("update:visible",M),i("update:open",M)}}),a={key:"id",title:"name",children:"children"},c=o.ref(""),l=o.ref([]),d=o.ref([]),h=o.ref(null),f=o.ref(300),p=o.ref(!1);let u=null;o.watch(()=>t.initialCheckedKeys,M=>{M&&M.length>0&&(d.value=[...M])},{immediate:!0}),o.watch(()=>t.treeData,M=>{if(!M||M.length===0)return;const L=[],V=(y,v)=>{for(let P=0;P<y.length;P++){const F=y[P],U=F.id||F.key||F.$id,O=F.modelId||v;O&&(F.modelId=O),U&&L.push(String(U)),F.children&&F.children.length>0&&V(F.children,O)}};V(M);const k=new Set(d.value);let C=!1;L.forEach(y=>{k.has(y)||(k.add(y),C=!0)}),C&&(d.value=Array.from(k),i("check",d.value))},{immediate:!0,deep:!0});const m=(M,L)=>{const V=[],k=C=>{for(let y=0;y<C.length;y++){const v=C[y],P=v.id||v.key;!v.children||v.children.length===0?!(P&&L.has(String(P)))&&v.modelId&&v.element_Id&&V.push({modelId:v.modelId,elementId:v.element_Id,show:!1}):v.children&&k(v.children)}};return k(M),V},E=o.computed(()=>{if(!c.value)return t.treeData;p.value=!0;const M=c.value.toLowerCase(),L=V=>{const k=[];for(let C=0;C<V.length;C++){const y=V[C],v=y.name||y.title||"",P=y.id||y.key,F=v.toLowerCase().includes(M);let U;y.children&&y.children.length>0&&(U=L(y.children)),(F||U&&U.length>0)&&k.push({key:String(P),title:v,children:U&&U.length>0?U:y.children?y.children:void 0,_raw:y,_searchMatched:F})}return k};return L(t.treeData)}),A=o.computed(()=>{if(!c.value)return[];const M=[],L=V=>{for(let k=0;k<V.length;k++){const C=V[k]?.children;C&&C.length>0&&(M.push(V[k]?.key),L(C))}};return L(E.value),M}),b=(M,L)=>c.value?(M||L||"").toLowerCase().includes(c.value.toLowerCase()):!1,w=M=>{if(!c.value)return M;const L=new RegExp(`(${c.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return M.replace(L,'<mark class="search-highlight">$1</mark>')},I=_n(M=>{const L=typeof M=="object"?M.target?.value??"":M;N(L)},200),D=M=>{N(M)},N=M=>{c.value=M||"",i("search",c.value),M&&o.nextTick(()=>{l.value=[...A.value]})},S=M=>{l.value=M},B=(M,L)=>{d.value=M,i("check",d.value);const V=new Set(M.map(C=>String(C))),k=m(t.treeData,V);s?.value?.setComponentVisibility&&s.value.setComponentVisibility(k),s?.value?.onTreeCheck&&s.value.onTreeCheck(M,L)},g=M=>{r.value=M},R=()=>{i("close")},x=()=>{h.value&&(f.value=h.value.clientHeight)};return o.onMounted(()=>{h.value&&(x(),u=new ResizeObserver(()=>{x()}),u.observe(h.value))}),o.onUnmounted(()=>{u&&(u.disconnect(),u=null)}),(M,L)=>(o.openBlock(),o.createBlock(bi,{visible:r.value,title:"目录树",direction:"bottom","show-handle":!1,class:"mobile-bim-drawer","onUpdate:visible":g,onClose:R},{title:o.withCtx(()=>[...L[1]||(L[1]=[o.createElementVNode("div",{class:"custom-drawer-header"},[o.createElementVNode("span",null,"目录树")],-1)])]),default:o.withCtx(()=>[o.createElementVNode("div",_w,[L[3]||(L[3]=o.createElementVNode("div",{class:"nav-tabs"},[o.createElementVNode("div",{class:"nav-tab-item active"},"构件")],-1)),o.createElementVNode("div",Qw,[o.createElementVNode("div",Vw,[o.createVNode(o.unref(ie.Input),{value:c.value,"onUpdate:value":L[0]||(L[0]=V=>c.value=V),placeholder:"搜索构件","allow-clear":"",class:"custom-search",onSearch:D,onChange:o.unref(I)},null,8,["value","onChange"])])]),o.createElementVNode("div",{class:"tree-content-wrapper",ref_key:"treeContentRef",ref:h},[E.value.length>0?(o.openBlock(),o.createBlock(o.unref(ie.Tree),{key:0,"tree-data":E.value,"field-names":a,"expanded-keys":l.value,"checked-keys":d.value,checkable:"","block-node":"",class:"bim-dark-tree",onExpand:S,onCheck:B},{switcherIcon:o.withCtx(({expanded:V})=>[o.createElementVNode("span",{class:o.normalizeClass(["switcher-icon",{"is-open":V}])},[...L[2]||(L[2]=[o.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[o.createElementVNode("path",{d:"M340.864 149.312l405.376 362.688-405.376 362.688z",fill:"currentColor"})],-1)])],2)]),title:o.withCtx(({name:V,title:k})=>[o.createElementVNode("span",{class:o.normalizeClass(["node-title",{"is-matched":b(V,k)}])},[o.createElementVNode("span",{innerHTML:w(V||k)},null,8,Gw)],2)]),_:1},8,["tree-data","expanded-keys","checked-keys","onExpand","onCheck"])):o.createCommentVNode("",!0)],512)])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-c2e8ecbe"]]),Hw={class:"tabs-header"},Yw=["onClick"],zw={class:"modal-content"},Ww={key:0,class:"setting-section"},jw={class:"setting-item"},Kw={class:"mobile-switch"},$w={class:"setting-item"},Xw={class:"mobile-switch"},qw={class:"setting-item"},Jw={class:"mobile-switch"},Zw={key:1,class:"setting-section"},ev={class:"setting-item"},tv={class:"mobile-switch"},nv={key:0,class:"setting-item column"},iv={class:"setting-label-row"},sv={class:"setting-value"},ov={class:"setting-item"},rv={class:"mobile-switch"},av={class:"setting-item"},lv={class:"mobile-switch"},cv={class:"setting-item column"},dv={class:"setting-label-row"},uv={class:"setting-value"},hv={class:"setting-item column"},fv={class:"setting-label-row"},pv={class:"setting-value"},mv={class:"setting-item column"},gv={class:"setting-label-row"},Av={class:"setting-value"},yv={class:"setting-item column"},Cv={style:{display:"flex",gap:"8px","margin-bottom":"8px","flex-wrap":"wrap"}},Ev=["onClick","title"],bv={style:{display:"flex",gap:"8px","align-items":"center"}},xl=ge(o.defineComponent({__name:"MobileSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["update:visible","update:open","close","change"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:u=>{i("update:visible",u),i("update:open",u)}}),a=[{id:"GIS",label:"GIS"},{id:"RENDER",label:"渲染"}],c=o.ref("GIS"),l=o.ref({globe:!1,terrain:!1,depthTest:!1}),d=o.ref({shadows:!1,shadowDarkness:.5,environmentMap:!0,ambientOcclusion:!1,brightness:1,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),h=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],f=()=>{p()},p=()=>{i("close"),i("change",{gis:l.value,render:d.value})};return o.watch(()=>l.value.globe,u=>{s?.value&&s.value.setGlobeEnvironmentVisible?.(u)}),o.watch(()=>l.value.terrain,u=>{s?.value&&s.value.setTerrainEnable?.(u)}),o.watch(()=>l.value.depthTest,u=>{s?.value&&s.value.setDepthTestEnable?.(u)}),o.watch(()=>d.value.shadows,u=>{s?.value&&s.value.setShadowsEnable?.(u)}),o.watch(()=>d.value.shadowDarkness,u=>{s?.value&&s.value.setShadowDarkness?.(u)}),o.watch(()=>d.value.environmentMap,u=>{s?.value&&s.value.setEnvironmentMapEnable?.(u)}),o.watch(()=>d.value.ambientOcclusion,u=>{s?.value&&s.value.setAmbientOcclusion?.(u)}),o.watch(()=>[d.value.brightness,d.value.contrast,d.value.saturation],([u,m,E])=>{const A=s?.value;A&&(A.setModelColorAdjustment?A.setModelColorAdjustment({brightness:u,contrast:m,saturation:E}):A.setModelBrightness?.(u))}),o.watch(()=>d.value.backgroundColor,u=>{s?.value&&s.value.setBackgroundColor?.(u)}),o.watch(()=>r.value,u=>{u?document.body.style.overflow="hidden":document.body.style.overflow=""}),(u,m)=>(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"setting-modal"},{default:o.withCtx(()=>[r.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"mobile-setting-overlay",onClick:f,onTouchmove:m[13]||(m[13]=o.withModifiers(()=>{},["prevent"]))},[o.createElementVNode("div",{class:"mobile-setting-modal",onClick:m[12]||(m[12]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",{class:"modal-header"},[m[15]||(m[15]=o.createElementVNode("span",{class:"modal-title"},"设置",-1)),o.createElementVNode("button",{class:"modal-close-btn",onClick:p},[...m[14]||(m[14]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[o.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),o.createElementVNode("div",Hw,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(a,E=>o.createElementVNode("button",{key:E.id,class:o.normalizeClass(["tab-btn",{active:c.value===E.id}]),onClick:A=>c.value=E.id},o.toDisplayString(E.label),11,Yw)),64))]),o.createElementVNode("div",zw,[c.value==="GIS"?(o.openBlock(),o.createElementBlock("div",Ww,[o.createElementVNode("div",jw,[m[17]||(m[17]=o.createElementVNode("span",{class:"setting-label"},"地球(含大气/日月/星空)",-1)),o.createElementVNode("label",Kw,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[0]||(m[0]=E=>l.value.globe=E)},null,512),[[o.vModelCheckbox,l.value.globe]]),m[16]||(m[16]=o.createElementVNode("span",{class:"slider"},null,-1))])]),o.createElementVNode("div",$w,[m[19]||(m[19]=o.createElementVNode("span",{class:"setting-label"},"地形",-1)),o.createElementVNode("label",Xw,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[1]||(m[1]=E=>l.value.terrain=E)},null,512),[[o.vModelCheckbox,l.value.terrain]]),m[18]||(m[18]=o.createElementVNode("span",{class:"slider"},null,-1))])]),o.createElementVNode("div",qw,[m[21]||(m[21]=o.createElementVNode("span",{class:"setting-label"},"地形遮挡",-1)),o.createElementVNode("label",Jw,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[2]||(m[2]=E=>l.value.depthTest=E)},null,512),[[o.vModelCheckbox,l.value.depthTest]]),m[20]||(m[20]=o.createElementVNode("span",{class:"slider"},null,-1))])])])):o.createCommentVNode("",!0),c.value==="RENDER"?(o.openBlock(),o.createElementBlock("div",Zw,[o.createElementVNode("div",ev,[m[23]||(m[23]=o.createElementVNode("span",{class:"setting-label"},"阴影",-1)),o.createElementVNode("label",tv,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[3]||(m[3]=E=>d.value.shadows=E)},null,512),[[o.vModelCheckbox,d.value.shadows]]),m[22]||(m[22]=o.createElementVNode("span",{class:"slider"},null,-1))])]),d.value.shadows?(o.openBlock(),o.createElementBlock("div",nv,[o.createElementVNode("div",iv,[m[24]||(m[24]=o.createElementVNode("span",{class:"setting-label"},"阴影暗度",-1)),o.createElementVNode("span",sv,o.toDisplayString(d.value.shadowDarkness.toFixed(2)),1)]),o.withDirectives(o.createElementVNode("input",{type:"range","onUpdate:modelValue":m[4]||(m[4]=E=>d.value.shadowDarkness=E),min:"0",max:"1",step:"0.05",class:"mobile-slider"},null,512),[[o.vModelText,d.value.shadowDarkness,void 0,{number:!0}]])])):o.createCommentVNode("",!0),o.createElementVNode("div",ov,[m[26]||(m[26]=o.createElementVNode("span",{class:"setting-label"},"环境贴图",-1)),o.createElementVNode("label",rv,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[5]||(m[5]=E=>d.value.environmentMap=E)},null,512),[[o.vModelCheckbox,d.value.environmentMap]]),m[25]||(m[25]=o.createElementVNode("span",{class:"slider"},null,-1))])]),o.createElementVNode("div",av,[m[28]||(m[28]=o.createElementVNode("span",{class:"setting-label"},"环境光遮蔽",-1)),o.createElementVNode("label",lv,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":m[6]||(m[6]=E=>d.value.ambientOcclusion=E)},null,512),[[o.vModelCheckbox,d.value.ambientOcclusion]]),m[27]||(m[27]=o.createElementVNode("span",{class:"slider"},null,-1))])]),o.createElementVNode("div",cv,[o.createElementVNode("div",dv,[m[29]||(m[29]=o.createElementVNode("span",{class:"setting-label"},"模型亮度",-1)),o.createElementVNode("span",uv,o.toDisplayString(d.value.brightness.toFixed(1)),1)]),o.withDirectives(o.createElementVNode("input",{type:"range","onUpdate:modelValue":m[7]||(m[7]=E=>d.value.brightness=E),min:"0",max:"5",step:"0.1",class:"mobile-slider"},null,512),[[o.vModelText,d.value.brightness,void 0,{number:!0}]])]),o.createElementVNode("div",hv,[o.createElementVNode("div",fv,[m[30]||(m[30]=o.createElementVNode("span",{class:"setting-label"},"模型对比度",-1)),o.createElementVNode("span",pv,o.toDisplayString(d.value.contrast.toFixed(1)),1)]),o.withDirectives(o.createElementVNode("input",{type:"range","onUpdate:modelValue":m[8]||(m[8]=E=>d.value.contrast=E),min:"0.5",max:"2",step:"0.1",class:"mobile-slider"},null,512),[[o.vModelText,d.value.contrast,void 0,{number:!0}]])]),o.createElementVNode("div",mv,[o.createElementVNode("div",gv,[m[31]||(m[31]=o.createElementVNode("span",{class:"setting-label"},"模型饱和度",-1)),o.createElementVNode("span",Av,o.toDisplayString(d.value.saturation.toFixed(1)),1)]),o.withDirectives(o.createElementVNode("input",{type:"range","onUpdate:modelValue":m[9]||(m[9]=E=>d.value.saturation=E),min:"0",max:"3",step:"0.1",class:"mobile-slider"},null,512),[[o.vModelText,d.value.saturation,void 0,{number:!0}]])]),o.createElementVNode("div",yv,[m[32]||(m[32]=o.createElementVNode("span",{class:"setting-label"},"背景颜色",-1)),o.createElementVNode("div",Cv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(h,(E,A)=>o.createElementVNode("div",{key:A,style:o.normalizeStyle({background:E,width:"60px",height:"40px",borderRadius:"6px",cursor:"pointer",border:"2px solid rgba(255,255,255,0.2)",flexShrink:0}),onClick:b=>d.value.backgroundColor=E,title:"预设 "+(A+1)},null,12,Ev)),64))]),o.createElementVNode("div",bv,[o.withDirectives(o.createElementVNode("input",{type:"color","onUpdate:modelValue":m[10]||(m[10]=E=>d.value.backgroundColor=E),style:{width:"50px",height:"36px",padding:"0",border:"1px solid rgba(255,255,255,0.3)","border-radius":"6px",cursor:"pointer"}},null,512),[[o.vModelText,d.value.backgroundColor]]),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":m[11]||(m[11]=E=>d.value.backgroundColor=E),type:"text",class:"mobile-input",placeholder:"CSS 颜色值",style:{flex:"1"}},null,512),[[o.vModelText,d.value.backgroundColor]])])])])):o.createCommentVNode("",!0)])])],32)):o.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-dcec8ca4"]]),wv={class:"mobile-section-container"},vv={class:"section-main"},Iv={class:"toggle-row"},Bv={class:"slider-section"},xv={class:"slider-header"},Sv={class:"slider-label"},Tv={class:"slider-value"},Mv={class:"quick-btns"},Dv={class:"section-models"},kv={class:"models-header"},Pv={class:"models-count"},Sl=ge(o.defineComponent({__name:"MobileSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modelList:{default:()=>[]}},emits:["update:visible","update:open","close","visibility-change","mode-change","axis-change","model-change"],setup(n,{emit:e}){const t=n,i=e,s=o.computed({get:()=>t.open!==void 0?t.open:t.visible,set:x=>{i("update:visible",x),i("update:open",x)}}),r=o.ref(!0),a=o.ref("Box"),c=o.ref("X"),l=o.ref([]),d=o.ref([0,100]),h=o.ref([0,100]),f=o.ref([0,100]),p=[{key:"X",label:"X轴"},{key:"Y",label:"Y轴"},{key:"Z",label:"Z轴"}],u=o.computed(()=>p.find(M=>M.key===c.value)?.label||""),m=o.computed({get:()=>{switch(c.value){case"X":return d.value[1];case"Y":return h.value[1];case"Z":return f.value[1];default:return 50}},set:x=>{switch(c.value){case"X":d.value[1]=x??0;break;case"Y":h.value[1]=x??0;break;case"Z":f.value[1]=x??0;break}}}),E=o.computed(()=>{switch(c.value){case"X":return[-50,50];case"Y":return[-50,50];case"Z":return[0,100];default:return[0,100]}}),A=o.computed(()=>m.value?.toFixed(1)??"0.0"),b=o.computed(()=>l.value.length===t.modelList.length),w=x=>{s.value=x},I=()=>{i("close")},D=()=>{i("visibility-change",r.value)},N=x=>{a.value=x,i("mode-change",x)},S=()=>{m.value=50,i("axis-change",c.value,50)},B=()=>{const x=E.value;m.value=x&&x.length>=2?(x[0]+x[1])/2:50,i("axis-change",c.value,m.value)},g=()=>{i("model-change",l.value)},R=()=>{b.value?l.value=[]:l.value=t.modelList.map(x=>x.modelId),i("model-change",l.value)};return(x,M)=>(o.openBlock(),o.createBlock(bi,{visible:s.value,title:"剖切分析",direction:"bottom","show-handle":!0,"onUpdate:visible":w,onClose:I},{default:o.withCtx(()=>[o.createElementVNode("div",wv,[o.createElementVNode("div",vv,[o.createElementVNode("div",Iv,[M[6]||(M[6]=o.createElementVNode("span",{class:"toggle-label"},"显示剖切盒",-1)),o.createVNode(o.unref(ie.Switch),{checked:r.value,"onUpdate:checked":M[0]||(M[0]=L=>r.value=L),onChange:D},null,8,["checked"])]),o.createVNode(o.unref(ie.RadioGroup),{value:a.value,"onUpdate:value":M[1]||(M[1]=L=>a.value=L),"button-style":"solid",class:"mode-selector",onChange:M[2]||(M[2]=L=>N(L.target.value))},{default:o.withCtx(()=>[o.createVNode(o.unref(ie.RadioButton),{value:"Box"},{default:o.withCtx(()=>[...M[7]||(M[7]=[o.createTextVNode("剖切盒",-1)])]),_:1})]),_:1},8,["value"]),o.createVNode(o.unref(ie.RadioGroup),{value:c.value,"onUpdate:value":M[3]||(M[3]=L=>c.value=L),"button-style":"solid",class:"axis-selector"},{default:o.withCtx(()=>[o.createVNode(o.unref(ie.RadioButton),{value:"X"},{default:o.withCtx(()=>[...M[8]||(M[8]=[o.createTextVNode("X轴",-1)])]),_:1}),o.createVNode(o.unref(ie.RadioButton),{value:"Y"},{default:o.withCtx(()=>[...M[9]||(M[9]=[o.createTextVNode("Y轴",-1)])]),_:1}),o.createVNode(o.unref(ie.RadioButton),{value:"Z"},{default:o.withCtx(()=>[...M[10]||(M[10]=[o.createTextVNode("Z轴",-1)])]),_:1})]),_:1},8,["value"]),o.createElementVNode("div",Bv,[o.createElementVNode("div",xv,[o.createElementVNode("span",Sv,o.toDisplayString(u.value)+" 轴范围",1),o.createElementVNode("span",Tv,o.toDisplayString(A.value),1)]),o.createVNode(o.unref(ie.Slider),{Value:m.value,"onUpdate:Value":M[4]||(M[4]=L=>m.value=L),min:E.value[0],max:E.value[1],step:.5,class:"section-slider"},null,8,["Value","min","max"]),o.createElementVNode("div",Mv,[o.createVNode(o.unref(ie.Button),{size:"small",onClick:S},{default:o.withCtx(()=>[...M[11]||(M[11]=[o.createTextVNode("重置",-1)])]),_:1}),o.createVNode(o.unref(ie.Button),{size:"small",onClick:B},{default:o.withCtx(()=>[...M[12]||(M[12]=[o.createTextVNode("居中",-1)])]),_:1})])])]),o.createElementVNode("div",Dv,[o.createElementVNode("div",kv,[M[13]||(M[13]=o.createElementVNode("span",{class:"models-title"},"选择模型",-1)),o.createElementVNode("span",Pv,o.toDisplayString(l.value.length)+"/"+o.toDisplayString(n.modelList.length),1)]),o.createVNode(o.unref(ie.CheckboxGroup),{value:l.value,"onUpdate:value":M[5]||(M[5]=L=>l.value=L),class:"models-list",onChange:g},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.modelList,L=>(o.openBlock(),o.createBlock(o.unref(ie.Checkbox),{key:L.modelId,value:L.modelId,class:"model-item"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(L.modelName),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),n.modelList.length>1?(o.openBlock(),o.createBlock(o.unref(ie.Button),{key:0,size:"small",type:"link",onClick:R},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value?"取消全选":"全选"),1)]),_:1})):o.createCommentVNode("",!0)])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-cdacec58"]]),Nv={key:0,class:"mobile-measure-root"},Fv={key:0,class:"result-card"},Rv={class:"card-header-row"},Lv={class:"result-main"},Ov={class:"type-label"},Uv={class:"value-highlight"},_v={key:0,class:"coords-grid"},Qv={class:"coord-item"},Vv={class:"coord-item"},Gv={class:"coord-item"},Hv={class:"measure-toolbar-container"},Yv={class:"tools-inner-row"},zv=["onClick"],Wv=["innerHTML"],Tl=ge(o.defineComponent({__name:"MobileMeasurement",props:{visible:{type:Boolean},defaultTool:{}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods");let r=null,a=!1;const c=o.ref(null),l=o.ref(null),d=o.computed(()=>t.visible&&c.value!==null),h=[{id:"distance",svg:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 17l6-6 4 4 8-8"/></svg>'},{id:"angle",svg:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 20H4L14 4"/></svg>'},{id:"area",svg:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/></svg>'}],f={distance:"距离",angle:"角度",area:"面积"},p=o.computed(()=>c.value?f[c.value]||"":l.value&&f[l.value.type]||""),u=o.computed(()=>{if(!l.value)return c.value==="distance"?"-- m":c.value==="angle"?"--°":c.value==="area"?"-- m²":"";const D=l.value;return D.type==="distance"?`${(D.dist??0).toFixed(3)} m`:D.type==="angle"?`${(D.angle??0).toFixed(2)}°`:D.type==="area"?`${(D.area??0).toFixed(2)} m²`:""}),m=o.computed(()=>l.value?.type||c.value),E=D=>D===void 0?"--":D.toFixed(3),A=()=>{if(r)return;const D=s?.value;D?.getViewer&&(r=new Ps({viewer:D.getViewer(),cesium:D.getCesium()}),r.onMeasure=N=>{a||(l.value=N)})},b=D=>{A(),c.value===D?(c.value=null,r?.stop(),s?.value?.baseCompt?.enableSelection()):(c.value=D,l.value=null,r?.start(D),s?.value?.baseCompt?.disableSelection())},w=()=>{r?.clearAll(),r?.stop(),c.value=null,l.value=null,s?.value?.baseCompt?.enableSelection()},I=()=>{w(),i("update:visible",!1),i("close")};return o.watch(()=>t.visible,D=>{D?(A(),t.defaultTool&&b(t.defaultTool)):w()}),o.onUnmounted(()=>{a=!0,r?.destroy()}),(D,N)=>(o.openBlock(),o.createBlock(o.Transition,{name:"measure-fade"},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",Nv,[o.createVNode(o.Transition,{name:"card-slide"},{default:o.withCtx(()=>[d.value?(o.openBlock(),o.createElementBlock("div",Fv,[o.createElementVNode("div",Rv,[o.createElementVNode("div",Lv,[o.createElementVNode("span",Ov,o.toDisplayString(p.value)+":",1),o.createElementVNode("span",Uv,o.toDisplayString(u.value),1)]),o.createElementVNode("button",{class:"clear-action-btn",onClick:w,title:"清空"},[...N[0]||(N[0]=[o.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[o.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),o.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])]),m.value==="distance"?(o.openBlock(),o.createElementBlock("div",_v,[o.createElementVNode("div",Qv,[N[1]||(N[1]=o.createElementVNode("span",{class:"label-x"},"X:",-1)),o.createTextVNode(" "+o.toDisplayString(E(l.value?.dx)),1)]),o.createElementVNode("div",Vv,[N[2]||(N[2]=o.createElementVNode("span",{class:"label-y"},"Y:",-1)),o.createTextVNode(" "+o.toDisplayString(E(l.value?.dy)),1)]),o.createElementVNode("div",Gv,[N[3]||(N[3]=o.createElementVNode("span",{class:"label-z"},"Z:",-1)),o.createTextVNode(" "+o.toDisplayString(E(l.value?.dz)),1)])])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),_:1}),o.createElementVNode("div",Hv,[o.createElementVNode("button",{class:"nav-back-icon",onClick:I},[...N[4]||(N[4]=[o.createElementVNode("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor","stroke-width":"3"},[o.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)])]),o.createElementVNode("div",Yv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(h,S=>o.createElementVNode("button",{key:S.id,class:o.normalizeClass(["sub-icon-box",{active:c.value===S.id}]),onClick:B=>b(S.id)},[o.createElementVNode("span",{class:"icon-svg",innerHTML:S.svg},null,8,Wv)],10,zv)),64))])])])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-7ff442b7"]]),jv={class:"joystick-base"},Kv={class:"control-panel"},$v={class:"ctrl-row zoom-row"},Xv={class:"zoom-label"},qv={class:"ctrl-grid"},Jv={class:"gravity-toggle"},Zv={class:"arrow-col"},Os=40,Ml=ge(o.defineComponent({__name:"MobilePlayer",props:{visible:{type:Boolean}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods");let r=!1;const a=o.ref(null),c=o.ref(0),l=o.ref(0),d=o.ref(!1),h=o.ref({x:0,y:0}),f=[.25,.5,1,2,4,8,16],p=o.ref(2),u=o.ref(!0);let m=null;const E=o.computed(()=>({transform:`translate(${c.value}px, ${l.value}px)`})),A=o.computed(()=>`${f[p.value]}X`),b=(O,T)=>{const _=[];return(Math.abs(O)>10||Math.abs(T)>10)&&(T<-10&&_.push("moveFront"),T>10&&_.push("moveBack"),O<-10&&_.push("moveLeft"),O>10&&_.push("moveRight")),_},w=()=>{r||["moveFront","moveBack","moveLeft","moveRight"].forEach(O=>{s?.value?.setPlayerAction?.(O,!1)})},I=O=>{if(r)return;["moveFront","moveBack","moveLeft","moveRight"].forEach(_=>{const H=O.includes(_);s?.value?.setPlayerAction?.(_,H)})},D=O=>{const T=O.touches[0],_=a.value.getBoundingClientRect();h.value={x:_.left+_.width/2,y:_.top+_.height/2},d.value=!0,T&&S(T.clientX,T.clientY)},N=O=>{if(!d.value)return;const T=O.touches[0];T&&S(T.clientX,T.clientY)},S=(O,T)=>{if(r)return;let _=O-h.value.x,H=T-h.value.y;const j=Math.sqrt(_*_+H*H);j>Os&&(_=_/j*Os,H=H/j*Os),c.value=_,l.value=H;const X=b(_,H);I(X)},B=()=>{d.value=!1,c.value=0,l.value=0,w()},g=()=>{M(),m=setInterval(()=>{p.value<f.length-1&&(p.value++,L())},150)},R=()=>{M(),m=setInterval(()=>{p.value>0&&(p.value--,L())},150)},x=()=>{M()},M=()=>{m&&(clearInterval(m),m=null)},L=()=>{r||s?.value?.setPlayerSpeed?.(f[p.value])},V=()=>{s?.value?.setPlayerAction?.("moveUp",!0)},k=()=>{s?.value?.setPlayerAction?.("moveUp",!1)},C=()=>{s?.value?.setPlayerAction?.("moveDown",!0)},y=()=>{s?.value?.setPlayerAction?.("moveDown",!1)},v=()=>{s?.value?.setPlayerParams?.({gravityTest:u.value,collisionTest:!0})},P=()=>{U(),i("update:visible",!1),i("close")},F=async()=>{if(!r)try{if(!s?.value){setTimeout(()=>F(),150);return}s.value.startCameraRoam&&s.value.startCameraRoam(),s.value.setPlayerSpeed?.(f[p.value])}catch(O){console.error("MobilePlayer startPlayer error:",O)}},U=()=>{w(),r||s?.value?.closePlayer?.(),M()};return o.watch(()=>t.visible,O=>{r||(O?F():U())},{immediate:!0}),o.onUnmounted(()=>{r=!0,U()}),(O,T)=>n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:"mobile-player-overlay",onTouchmove:T[1]||(T[1]=o.withModifiers(()=>{},["prevent"]))},[o.createElementVNode("button",{class:"player-exit-btn",onClick:P}," 退出 "),o.createElementVNode("div",{class:"joystick-zone",ref_key:"joystickRef",ref:a,onTouchstart:o.withModifiers(D,["prevent"]),onTouchmove:o.withModifiers(N,["prevent"]),onTouchend:o.withModifiers(B,["prevent"]),onTouchcancel:o.withModifiers(B,["prevent"])},[o.createElementVNode("div",jv,[o.createElementVNode("div",{class:"joystick-knob",style:o.normalizeStyle(E.value)},null,4)])],544),o.createElementVNode("div",Kv,[o.createElementVNode("div",$v,[o.createElementVNode("button",{class:"ctrl-btn ctrl-btn-sm",onTouchstart:o.withModifiers(R,["prevent"]),onTouchend:o.withModifiers(x,["prevent"])},"−",32),o.createElementVNode("span",Xv,o.toDisplayString(A.value),1),o.createElementVNode("button",{class:"ctrl-btn ctrl-btn-sm",onTouchstart:o.withModifiers(g,["prevent"]),onTouchend:o.withModifiers(x,["prevent"])},"+",32)]),o.createElementVNode("div",qv,[o.createElementVNode("label",Jv,[o.withDirectives(o.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":T[0]||(T[0]=_=>u.value=_),onChange:v},null,544),[[o.vModelCheckbox,u.value]]),T[2]||(T[2]=o.createElementVNode("span",{class:"toggle-checkbox"},null,-1)),T[3]||(T[3]=o.createElementVNode("span",{class:"toggle-label"},"重力",-1))]),o.createElementVNode("div",Zv,[o.createElementVNode("button",{class:"ctrl-btn ctrl-btn-arrow",onTouchstart:o.withModifiers(V,["prevent"]),onTouchend:o.withModifiers(k,["prevent"])},[...T[4]||(T[4]=[o.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"18 15 12 9 6 15"})],-1)])],32),o.createElementVNode("button",{class:"ctrl-btn ctrl-btn-arrow",onTouchstart:o.withModifiers(C,["prevent"]),onTouchend:o.withModifiers(y,["prevent"])},[...T[5]||(T[5]=[o.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1)])],32)])])])],32)):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-591ba29c"]]),eI={key:0,class:"mobile-info-sheet-wrapper"},tI={class:"info-body"},nI={key:0,class:"empty-hint"},iI={key:0,class:"component-title"},sI={class:"group-list"},oI=["onClick"],rI={class:"group-name"},aI={key:0,class:"group-content"},lI={class:"kv-key"},cI={class:"kv-value"},Dl=ge(o.defineComponent({__name:"MobileInfo",props:{visible:{type:Boolean}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.ref([]),a=o.ref(!1),c=o.ref(new Set),l=o.ref([]);let d=!1;const h=o.computed({get:()=>!!t.visible,set:N=>{i("update:visible",N)}}),f=N=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[N]||N,p=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],u=(N,S)=>`${N}__${S}`,m=(N,S)=>c.value.has(u(N,S)),E=(N,S)=>{const B=u(N,S);c.value.has(B)?c.value.delete(B):c.value.add(B)},A=()=>{const N=new Set;r.value.forEach(S=>{S.groups.forEach(B=>{N.add(u(S.id,B.name))})}),c.value=N},b=()=>{h.value=!1,i("close")},w=async N=>{if(d)return;if(l.value=N||[],!N||N.length===0){r.value=[];return}let S=N;N.length>10&&(ce.warning(`选中构件数量过多(${N.length}个),仅显示前10个`),S=N.slice(0,10));const B=s?.value;let g=B?.getMapTileset?B.getMapTileset():{};a.value=!0;const R=new Set;if(S.forEach(M=>{const L=g[M.modelId];L&&L.leiting&&!L.leiting?.node?.nodeExtras&&L.leiting.model?.nodeUrl&&R.add(M.modelId)}),R.size>0&&B?._loadNodeDetailsForModel)try{await Promise.all(Array.from(R).map(M=>B._loadNodeDetailsForModel(M)))}catch(M){console.error("Failed to load node details",M)}if(d)return;g=B?.getMapTileset?B.getMapTileset():{};const x=[];S.forEach((M,L)=>{const k=g[M.modelId]?.leiting||{};let C={modelName:k.model?.modelId||M.modelId};C.elementID||(C.elementID=M.elementId);let y=null;const v=k.node?.nodeExtras?.element||k.node?.nodeExtras;if(v){const U=C.elementID;v[U]&&(y=v[U])}y&&y.box3&&(C.length=`${y.box3.length?.toFixed(2)||0}米`,C.width=`${y.box3.width?.toFixed(2)||0}米`,C.height=`${y.box3.height?.toFixed(2)||0}米`);const P=[];y&&(y.name&&(C.elementName=y.name),y.categoryName&&(C.categoryName=y.categoryName),y.familySymbolName&&(C.familySymbolName=y.familySymbolName),y.levelName&&(C.levelName=y.levelName));const F={};if(p.forEach(U=>{C[U]!==void 0&&(F[U]=C[U])}),P.push({name:"基本属性",params:F}),y){const U=Array.isArray(y)?y:Array.isArray(y?.parameters)?y.parameters:null;if(U)U.flat().forEach(T=>{if(T&&T.GroupName&&Array.isArray(T.Parameters)){const _={};T.Parameters.forEach(H=>{H.name&&(_[H.name]=H.value??"")}),Object.keys(_).length>0&&P.push({name:T.GroupName,params:_})}});else{let O=!1;if(Object.keys(y).forEach(T=>{y[T]&&typeof y[T]=="object"&&!Array.isArray(y[T])&&(O=!0,P.push({name:T,params:y[T]}))}),!O){const T={};Object.keys(y).forEach(_=>{if(!p.includes(_)&&_!=="batchId"){const H=y[_];T[_]=typeof H=="string"&&H.length>500?H.substring(0,500)+"...":H}}),Object.keys(T).length>0&&P.push({name:"其他属性",params:T})}}}x.push({id:L,title:`${C.modelName}${C.elementName?` - ${C.elementName}`:""}`,groups:P})}),r.value=x,a.value=!1,!d&&x.length>0&&A()};let I=!1;const D=()=>{if(I)return;const N=s?.value;N&&N.selectionChange&&(N.selectionChange(w),I=!0)};return o.watch(()=>s?.value,()=>D(),{deep:!0,immediate:!0}),o.watch(h,N=>{N&&(D(),l.value.length>0&&w(l.value))}),o.onUnmounted(()=>{d=!0}),(N,S)=>(o.openBlock(),o.createBlock(o.Transition,{name:"info-slide"},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",eI,[o.createElementVNode("div",{class:"mobile-info-sheet",onTouchmove:S[0]||(S[0]=o.withModifiers(()=>{},["stop"])),onClick:S[1]||(S[1]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",{class:"info-header"},[S[3]||(S[3]=o.createElementVNode("span",{class:"info-title"},"构件详情",-1)),o.createElementVNode("button",{class:"info-close-btn",onClick:b},[...S[2]||(S[2]=[o.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),S[5]||(S[5]=o.createElementVNode("div",{class:"info-tabs"},[o.createElementVNode("span",{class:"tab-item active"},"属性")],-1)),o.createElementVNode("div",tI,[o.createVNode(o.unref(ie.Spin),{spinning:a.value},{default:o.withCtx(()=>[r.value.length===0&&!a.value?(o.openBlock(),o.createElementBlock("div",nI," 暂无数据 ")):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,B=>(o.openBlock(),o.createElementBlock("div",{key:B.id,class:"component-block"},[r.value.length>1?(o.openBlock(),o.createElementBlock("div",iI,o.toDisplayString(B.title),1)):o.createCommentVNode("",!0),o.createElementVNode("div",sI,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(B.groups,(g,R)=>(o.openBlock(),o.createElementBlock("div",{key:`${B.id}-${R}`,class:"group-item"},[o.createElementVNode("button",{class:o.normalizeClass(["group-header",{expanded:m(B.id,g.name)}]),onClick:x=>E(B.id,g.name)},[S[4]||(S[4]=o.createElementVNode("svg",{class:"arrow-icon",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"4 6 8 10 12 6"})],-1)),o.createElementVNode("span",rI,o.toDisplayString(g.name),1)],10,oI),o.createVNode(o.Transition,{name:"group-expand"},{default:o.withCtx(()=>[m(B.id,g.name)?(o.openBlock(),o.createElementBlock("div",aI,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.params,(x,M)=>(o.openBlock(),o.createElementBlock("div",{key:M,class:"kv-row"},[o.createElementVNode("span",lI,o.toDisplayString(f(String(M))),1),o.createElementVNode("span",cI,o.toDisplayString(x),1)]))),128))])):o.createCommentVNode("",!0)]),_:2},1024)]))),128))])]))),128))]),_:1},8,["spinning"])])],32)])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-c4855585"]]),dI={class:"mobile-cad-layer-container"},uI={class:"model-selector"},hI={class:"layer-list-container"},fI={class:"list-header"},pI={class:"col-check"},mI=["checked"],gI={class:"list-body"},AI=["onClick"],yI=["checked","onChange"],CI={class:"col-index"},EI=["title"],bI={class:"col-color"},wI={key:0,class:"empty-state"},vI=ge(o.defineComponent({__name:"MobileCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods",o.ref({})),r=o.ref(""),a=o.ref([]),c=o.computed({get:()=>t.visible,set:D=>i("update:visible",D)}),l=()=>{s.value&&s.value.getDxfModels&&(a.value=s.value.getDxfModels().map(D=>({modelId:D.modelId,modelName:D.modelName}))||[])},d=o.computed(()=>a.value.map(D=>({value:D.modelId,label:D.modelName}))),h=o.ref([]),f=o.ref([]),p=o.computed(()=>h.value.length>0&&f.value.length===h.value.length),u=({modelId:D})=>{if(h.value=[],f.value=[],s.value&&s.value.getDxfLayers){const N=s.value.getDxfLayers({modelId:D});N&&Object.keys(N).forEach((S,B)=>{N[S].length&&(h.value.push({index:B+1,layerName:S,layerColor:N[S][0].color||"#ffffff",key:S}),f.value.push(S))})}},m=D=>{r.value=D,u({modelId:D})},E=D=>{D.target.checked?f.value=h.value.map(S=>S.key):f.value=[],b()},A=(D,N)=>{N.target.checked?f.value.includes(D)||f.value.push(D):f.value=f.value.filter(B=>B!==D),b()},b=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:r.value,show:!0,layers:f.value}),s.value.getDxfLayers)){const D=s.value.getDxfLayers({modelId:r.value});if(D){const N=Object.keys(D).filter(S=>!f.value.includes(S));s.value.showDxfLayer({modelId:r.value,show:!1,layers:N})}}},w=D=>{c.value=D},I=()=>{i("update:visible",!1),i("handleCloseCardByCadCard")};return o.watch(()=>t.visible,D=>{D&&(l(),t.currentModelId?(r.value=t.currentModelId,u({modelId:t.currentModelId})):d.value.length>0&&(r.value=d.value[0]?.value,u({modelId:r.value})))}),o.watch(()=>t.currentModelId,D=>{D&&t.visible&&(r.value=D,u({modelId:D}))}),(D,N)=>(o.openBlock(),o.createBlock(bi,{visible:c.value,title:"CAD图层",direction:"bottom","show-handle":!0,height:"70vh",class:"mobile-cad-layer-drawer","onUpdate:visible":w,onClose:I},{default:o.withCtx(()=>[o.createElementVNode("div",dI,[o.createElementVNode("div",uI,[N[3]||(N[3]=o.createElementVNode("span",{class:"selector-label"},"图纸:",-1)),o.createVNode(o.unref(ie.Select),{value:r.value,"onUpdate:value":N[0]||(N[0]=S=>r.value=S),options:d.value,onChange:N[1]||(N[1]=S=>m(S)),placeholder:"选择模型",class:"mobile-model-select",popupClassName:"mobile-cad-select-dropdown",size:"large"},null,8,["value","options"])]),o.createElementVNode("div",hI,[o.createElementVNode("div",fI,[o.createElementVNode("div",pI,[o.createElementVNode("input",{type:"checkbox",checked:p.value,onChange:E,class:"mobile-checkbox"},null,40,mI)]),N[4]||(N[4]=o.createElementVNode("div",{class:"col-index"},"序号",-1)),N[5]||(N[5]=o.createElementVNode("div",{class:"col-name"},"图层名称",-1)),N[6]||(N[6]=o.createElementVNode("div",{class:"col-color"},"颜色",-1))]),o.createElementVNode("div",gI,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h.value,S=>(o.openBlock(),o.createElementBlock("div",{key:S.key,class:"list-item",onClick:B=>A(S.key,{target:{checked:!f.value.includes(S.key)}})},[o.createElementVNode("div",{class:"col-check",onClick:N[2]||(N[2]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("input",{type:"checkbox",checked:f.value.includes(S.key),onChange:B=>A(S.key,B),class:"mobile-checkbox"},null,40,yI)]),o.createElementVNode("div",CI,o.toDisplayString(S.index),1),o.createElementVNode("div",{class:"col-name",title:S.layerName},o.toDisplayString(S.layerName),9,EI),o.createElementVNode("div",bI,[o.createElementVNode("div",{class:"color-swatch",style:o.normalizeStyle({backgroundColor:S.layerColor})},null,4)])],8,AI))),128)),h.value.length===0?(o.openBlock(),o.createElementBlock("div",wI,[...N[7]||(N[7]=[o.createElementVNode("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[o.createElementVNode("path",{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),o.createElementVNode("p",null,"暂无图层信息",-1)])])):o.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-63da9a15"]]),II={class:"mobile-annotation-panel"},BI={class:"tools-section"},xI={class:"tools-grid"},SI={class:"style-section"},TI={class:"style-item"},MI={class:"color-picker-wrapper"},DI={class:"style-item"},kI={class:"line-width-options"},PI=["onClick"],NI={class:"width-label"},FI=ge(o.defineComponent({__name:"MobileAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(n,{emit:e}){const t=n,i=e,s=o.inject("leitingMethods"),r=o.ref(""),a=o.ref("#ff0000"),c=o.ref(3),l=o.computed({get:()=>t.visible,set:w=>i("update:visible",w)}),d=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],h=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,f=()=>{const w=h();if(w&&(typeof w.hideEntityOutline=="function"&&w.hideEntityOutline(),w.selectedEntityObj=null,w.drawTool&&typeof w.drawTool.deactivate=="function"))try{w.drawTool.deactivate()}catch(I){console.warn("Failed to deactivate drawTool:",I)}r.value="",i("update:visible",!1)},p=w=>{if(r.value===w){r.value="";return}r.value=w;const I=h();if(I)switch(w){case"freehandLine":I.startFreehandLine();break;case"arrow":I.startArrow();break;case"straightLine":I.startStraightLine();break;case"rectangle":I.startRectangle();break;case"ellipse":I.startEllipse();break}},u=()=>{const w=h();w&&(w.setCurrentColor(a.value),w.changeColor(a.value))},m=w=>{c.value=w;const I=h();I&&(I.setCurrentWidth(w),I.changeWidth(w))},E=()=>{const w=h();w&&w.deleteSelectedEntity()},A=()=>{const w=h();w&&w.clearAll()},b=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const w=h();w&&w.saveAnnotations()};return(w,I)=>(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"annotation-slide"},{default:o.withCtx(()=>[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"mobile-annotation-overlay",onClick:o.withModifiers(f,["self"])},[o.createElementVNode("div",II,[o.createElementVNode("div",{class:"panel-header"},[I[7]||(I[7]=o.createElementVNode("span",{class:"panel-title"},"标注",-1)),o.createElementVNode("button",{class:"panel-close-btn",onClick:f},[...I[6]||(I[6]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round"},[o.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),o.createElementVNode("div",BI,[I[13]||(I[13]=o.createElementVNode("div",{class:"section-label"},"绘图工具",-1)),o.createElementVNode("div",xI,[o.createElementVNode("button",{class:o.normalizeClass(["tool-btn",{active:r.value==="freehandLine"}]),onClick:I[0]||(I[0]=D=>p("freehandLine"))},[...I[8]||(I[8]=[o.createElementVNode("div",{class:"tool-icon"},"✏️",-1),o.createElementVNode("span",{class:"tool-label"},"手绘线",-1)])],2),o.createElementVNode("button",{class:o.normalizeClass(["tool-btn",{active:r.value==="arrow"}]),onClick:I[1]||(I[1]=D=>p("arrow"))},[...I[9]||(I[9]=[o.createElementVNode("div",{class:"tool-icon"},"↗️",-1),o.createElementVNode("span",{class:"tool-label"},"箭头",-1)])],2),o.createElementVNode("button",{class:o.normalizeClass(["tool-btn",{active:r.value==="straightLine"}]),onClick:I[2]||(I[2]=D=>p("straightLine"))},[...I[10]||(I[10]=[o.createElementVNode("div",{class:"tool-icon"},"📏",-1),o.createElementVNode("span",{class:"tool-label"},"直线",-1)])],2),o.createElementVNode("button",{class:o.normalizeClass(["tool-btn",{active:r.value==="rectangle"}]),onClick:I[3]||(I[3]=D=>p("rectangle"))},[...I[11]||(I[11]=[o.createElementVNode("div",{class:"tool-icon"},"▭",-1),o.createElementVNode("span",{class:"tool-label"},"矩形",-1)])],2),o.createElementVNode("button",{class:o.normalizeClass(["tool-btn",{active:r.value==="ellipse"}]),onClick:I[4]||(I[4]=D=>p("ellipse"))},[...I[12]||(I[12]=[o.createElementVNode("div",{class:"tool-icon"},"⭕",-1),o.createElementVNode("span",{class:"tool-label"},"椭圆",-1)])],2)])]),I[21]||(I[21]=o.createElementVNode("div",{class:"divider"},null,-1)),o.createElementVNode("div",SI,[I[16]||(I[16]=o.createElementVNode("div",{class:"section-label"},"样式设置",-1)),o.createElementVNode("div",TI,[I[14]||(I[14]=o.createElementVNode("span",{class:"style-label"},"颜色",-1)),o.createElementVNode("div",MI,[o.createElementVNode("div",{class:"color-preview",style:o.normalizeStyle({backgroundColor:a.value})},null,4),o.withDirectives(o.createElementVNode("input",{type:"color","onUpdate:modelValue":I[5]||(I[5]=D=>a.value=D),onChange:u,class:"color-input"},null,544),[[o.vModelText,a.value]])])]),o.createElementVNode("div",DI,[I[15]||(I[15]=o.createElementVNode("span",{class:"style-label"},"线宽",-1)),o.createElementVNode("div",kI,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(d,D=>o.createElementVNode("button",{key:D.value,class:o.normalizeClass(["width-btn",{active:c.value===D.value}]),onClick:N=>m(D.value)},[o.createElementVNode("div",{class:"width-line",style:o.normalizeStyle({height:D.value+"px",backgroundColor:c.value===D.value?"#00e5d1":"#fff"})},null,4),o.createElementVNode("span",NI,o.toDisplayString(D.label),1)],10,PI)),64))])])]),I[22]||(I[22]=o.createElementVNode("div",{class:"divider"},null,-1)),o.createElementVNode("div",{class:"action-section"},[I[20]||(I[20]=o.createElementVNode("div",{class:"section-label"},"操作",-1)),o.createElementVNode("div",{class:"action-grid"},[o.createElementVNode("button",{class:"action-btn delete-btn",onClick:E},[...I[17]||(I[17]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[o.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),o.createElementVNode("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})],-1),o.createElementVNode("span",null,"删除",-1)])]),o.createElementVNode("button",{class:"action-btn clear-btn",onClick:A},[...I[18]||(I[18]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[o.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1),o.createElementVNode("span",null,"清空",-1)])]),o.createElementVNode("button",{class:"action-btn save-btn",onClick:b},[...I[19]||(I[19]=[o.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[o.createElementVNode("path",{d:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"}),o.createElementVNode("polyline",{points:"17 21 17 13 7 13 7 21"}),o.createElementVNode("polyline",{points:"7 3 7 8 15 8"})],-1),o.createElementVNode("span",null,"保存",-1)])])])])])])):o.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-9b4979c4"]]),RI=["src"],wi=ge(o.defineComponent({__name:"LeitingBIM",props:{accessToken:{},cesiumUrl:{},cesiumCssUrl:{},methods:{},viewerOptions:{},treeProps:{},showTree:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!1},playerUrl:{default:"https://leiting.chenxisoft.com/resource/person/person.glb"},playerModelName:{default:"Person"},playerModelId:{default:"player_111"},playerScale:{default:.0032},tiandituToken:{default:"c25f14fb6bd4397cf8fe45144ff768d6"},globe:{type:Boolean,default:void 0},terrain:{type:Boolean,default:void 0},depthTest:{type:Boolean,default:void 0},mapProvider:{},tiandituLayerType:{},tiandituShowLabel:{type:Boolean,default:void 0},arcgisUrl:{},teleportTarget:{},shadows:{type:Boolean,default:void 0},environmentMap:{type:Boolean,default:void 0},ambientOcclusion:{type:Boolean,default:void 0},time:{},brightness:{},backgroundColor:{},collision:{type:Boolean,default:void 0},mouseHabit:{},mode:{default:"3d"},mountAll3Dtiles:{},mountAllCad:{},saveRegion:{},saveCadRegion:{},saveCadCalibration:{},selectionChange:{},searchComponent:{}},emits:["register","init","ready"],setup(n,{expose:e,emit:t}){const i=o.ref(),s=o.ref(),r=o.getCurrentInstance(),a=o.ref(!1),c=o.ref(""),l=o.ref({}),d=o.ref("3d"),{isMobile:h}=ui(),f=n,p={title:"构件树",treeData:[]},u=o.ref(!1),m=o.ref(!1),E=o.ref(!1),A=o.ref(!1),b=o.ref(!1),w=o.ref(!1),I=o.ref(!1),D=o.ref(!1),N=o.ref(!1),S=o.ref(!1),B=o.ref(null),{visible:g,position:R,items:x,show:M,hide:L}=vl(),V=o.ref([]),k=z=>{V.value.push(z)},C=z=>{V.value=V.value.filter(Y=>Y.id!==z)},y=o.ref([]),v=o.ref(""),P=o.ref(null),F=o.ref([]),U=o.reactive({tree:!1,section:!1,roam:!1,info:!1,adjustModel:!1,setting:!1,cadLayer:!1,cadPosition:!1,annotation:!1}),O=(z,Y)=>{z==="componentTree"&&(z="tree"),z==="componentInfo"&&(z="info"),z in U&&(U[z]=Y)},T=o.shallowRef({});o.provide("leitingMethods",T);const _=o.ref(f.showMenu),H=o.ref([]);o.watch(()=>f.showMenu,z=>{_.value=z},{immediate:!0}),o.watch(()=>f.mode,z=>{z&&T.value?.set2d&&T.value.set2d(z==="2d")});const j=o.ref("dark");o.provide("leiting-theme",j);const X=o.ref(f.teleportTarget);o.watch(()=>f.teleportTarget,z=>{X.value=z});const Z=o.ref([]),re=o.computed(()=>{const z=[];return u.value&&(z.push("tree"),z.push("componentTree")),m.value&&z.push("section"),E.value&&z.push("roam"),A.value&&(z.push("info"),z.push("componentInfo")),b.value&&z.push("adjust"),w.value&&z.push("setting"),I.value&&z.push("cadLayer"),D.value&&z.push("cadPosition"),N.value&&z.push("annotation"),S.value&&(z.push("measure"),z.push("measurement")),z.push(...Z.value),z}),se=o.ref(null),oe=(z,Y)=>{z==="componentTree"||z==="tree"?u.value=Y:z==="section"?m.value=Y:z==="roam"?E.value=Y:z==="componentInfo"||z==="info"?A.value=Y:z==="homeView"?T.value?.is2dMode?.()?T.value?.flyToTopView?.({}):T.value?.getBIMmodelId()?T.value?.flyToTileset?.({}):T.value?.getCadModelId()&&T.value?.flyToTopView?.({}):z==="adjustModel"?(b.value=Y,Y&&se.value&&se.value.setModelType("BIM")):z==="osgbAdjust"?(b.value=Y,Y&&se.value&&se.value.setModelType("OSGB")):z==="setting"?w.value=Y:z==="cadLayer"?I.value=Y:z==="cadPosition"?D.value=Y:z==="annotation"?N.value=Y:z==="measurement"?S.value=Y:Y?Z.value.includes(z)||Z.value.push(z):Z.value=Z.value.filter(K=>K!==z)},ye=z=>{const Y=z.key||z.ID;if(!Y)return;if(Y==="homeView"||Y==="home"){oe(Y,!0);return}if(Y==="measurement"){B.value="distance",S.value=!0;return}const K=!re.value.includes(z.ID);oe(Y,K)},Ie=z=>{const Y=z.sub;if(!Y)return;const K=Y.parentKey||z.parent?.key;K==="measurement"?(B.value=Y.id.replace("measure-",""),S.value=!0):K==="section"&&(m.value=!0)};o.watch(u,async z=>{if(z&&T.value?.loadTreeForModel&&T.value?.getMapTileset){const Y=T.value.getMapTileset(),K=Object.values(Y).map(async Pe=>{if(Pe.leiting&&Pe.leiting.model?.treeUrl){const Re=Pe.leiting.model.modelId;try{Pe.leiting?.node?.batchIdEIDInfos||await T.value.loadNodeDetailsForModel(Re);const He=await T.value.loadTreeForModel(Re);He&&(Array.isArray(He)?He:[He]).forEach($e=>{$e&&!F.value.find(Tn=>Tn.id===$e.id)&&($e.modelId=Re,F.value=[...F.value,$e])})}catch(He){console.warn(`Failed to lazy load tree for ${Re}`,He)}}});await Promise.all(K)}});const Ee=()=>{T.value&&(T.value.getDxfModels&&(y.value=T.value.getDxfModels()||[]),T.value.getCadModelId&&(v.value=T.value.getCadModelId()||""))};let xe;o.watch(I,z=>{z&&Ee()}),o.watch(D,z=>{z&&(Ee(),P.value&&y.value.length&&P.value.addGltfOr3dTilesModelList(y.value))});const Te=t,_e=z=>{T.value&&T.value.saveCadCalibration&&T.value.saveCadCalibration(z),T.value&&T.value.saveCadRegion&&T.value.saveCadRegion(z)};return o.onMounted(async()=>{if(s.value&&ce.setContainer(s.value),!!i.value)try{const z={...Ct,cesiumUrl:f.cesiumUrl||Ct.cesiumUrl,cesiumCssUrl:f.cesiumCssUrl||Ct.cesiumCssUrl,accessToken:f.accessToken||Si()||Ct.accessToken};await xi(z);const Y=f.accessToken||Si()||Ct.accessToken;Y&&(Cesium.Ion.defaultAccessToken=Y),a.value=!0,xe=async(Pe={},Re)=>{if(i.value){const{showMenu:He,showTree:Sn,globe:$e,terrain:Tn,depthTest:JI,mapProvider:ZI,tiandituLayerType:eB,tiandituShowLabel:tB,arcgisUrl:nB,shadows:iB,environmentMap:sB,ambientOcclusion:oB,time:rB,brightness:aB,backgroundColor:lB,collision:cB,mouseHabit:dB,heightBasedZoom:uB,mode:Pl,...it}=Pe||{},hB=f.showMenu!==void 0?f.showMenu:He!==void 0?He:!0;_.value=hB;const Ne=(J,be,Xe)=>J!==void 0?J:be!==void 0?be:Xe,Nl=Ne(f.globe,$e,!1),Fl=Ne(f.terrain,Tn,!1),Rl=Ne(f.depthTest,JI,!1),Ll=Ne(f.mapProvider,ZI,"tianditu"),Ol=Ne(f.tiandituLayerType,eB,"img_w"),Ul=Ne(f.tiandituShowLabel,tB,!1),_l=Ne(f.arcgisUrl,nB,"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),Ql=Ne(f.shadows,iB,!1),Vl=Ne(f.environmentMap,sB,!1),Gl=Ne(f.ambientOcclusion,oB,!1),Hl=Ne(f.time,rB,void 0),Yl=Ne(f.brightness,aB,1),Ii=f.mode||Pl||"3d";console.log("LeitingBIM Mode:",Ii,"Props:",f.mode,"Options:",Pl),d.value=Ii;const fB=Ii==="2d"?"#000000":"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)",zl=Ne(f.backgroundColor,lB,fB),Wl=Ne(f.collision,cB,!1),jl=Ne(f.mouseHabit,dB,0),Kl=Ne(f.heightBasedZoom,uB,!1);l.value={globe:Nl,terrain:Fl,depthTest:Rl,mapProvider:Ll,tiandituLayerType:Ol,tiandituShowLabel:Ul,arcgisUrl:_l,shadows:Ql,environmentMap:Vl,ambientOcclusion:Gl,time:Hl,brightness:Yl,backgroundColor:zl,collision:Wl,mouseHabit:jl,heightBasedZoom:Kl,useBrowserRecommendedResolution:!0};const Mn=Iy({container:i.value,appContext:r?.appContext,methods:{...T.value,handleMenuAction:oe,setCardFullHeight:O,onLoadingStatus:J=>{J?ce.loading(J,"",s.value):ce.close()},...it,tilesLoad3dTiles:async J=>{let be=J.leiting?.tree;const Xe=J.leiting?.model?.modelId;if(!be&&u.value&&T.value?.loadTreeForModel)try{be=await T.value.loadTreeForModel(Xe)}catch(kn){console.warn("Failed to lazy load tree",kn)}be&&(Array.isArray(be)?be:[be]).forEach(Nt=>{Nt&&!F.value.find(Xl=>Xl.id===Nt.id)&&(Nt.modelId=Xe,F.value=[...F.value,Nt])});const{brightness:Us,contrast:_s,saturation:lt}=Mn.methods.getConfigure();Mn.methods.setModelColorAdjustment({brightness:Us,contrast:_s,saturation:lt}),it.tilesLoad3dTiles?.(J)},mountAll3Dtiles:J=>{f.mountAll3Dtiles&&f.mountAll3Dtiles(J),it.mountAll3Dtiles?.(J)},updateModels:J=>{if(Array.isArray(J))if(J.length===0)F.value=[];else{const be=J.map(Xe=>Xe.modelId);F.value=F.value.filter(Xe=>be.includes(Xe.modelId))}},mountAllCad:J=>{if(Mn.methods.setModelBrightness){const be=f.brightness!==void 0?f.brightness:l.value.brightness;be!==void 0&&Mn.methods.setModelBrightness(be)}f.mountAllCad&&f.mountAllCad(J),it.mountAllCad?.(J)},saveRegion:J=>{f.saveRegion&&f.saveRegion(J),it.saveRegion?.(J)},saveCadRegion:J=>{f.saveCadRegion&&f.saveCadRegion(J),it.saveCadRegion?.(J)},saveCadCalibration:J=>{f.saveCadCalibration&&f.saveCadCalibration(J),it.saveCadCalibration?.(J)},selectionChange:J=>{f.selectionChange&&f.selectionChange(J),it.selectionChange?.(J)},onSearchComponent:J=>{f.searchComponent&&f.searchComponent(J),it.searchComponent?.(J)}},viewerOptions:f.viewerOptions,options:{...it,mode:Ii,playerUrl:f.playerUrl,playerModelName:f.playerModelName,playerModelId:f.playerModelId,playerScale:f.playerScale,globe:Nl,terrain:Fl,depthTest:Rl,mapProvider:Ll,tiandituLayerType:Ol,tiandituShowLabel:Ul,tiandituToken:f.tiandituToken,arcgisUrl:_l,shadows:Ql,environmentMap:Vl,ambientOcclusion:Gl,time:Hl,brightness:Yl,backgroundColor:zl,collision:Wl,mouseHabit:jl,heightBasedZoom:Kl},callbacks:{onLoading:J=>J?ce.loading(J,"",s.value):ce.close(),onSuccess:J=>ce.success(J,"",void 0,s.value),onError:J=>ce.error(J,"",void 0,s.value)}}),{Cesium:Pt,viewer:Xt,methods:Bi,menuEvents:Dn}=Mn,de=Bi;Dn.on("showMenu",J=>{_.value=J}),Dn.on("insertMenu",J=>{H.value=[...H.value,...J]}),Dn.on("setMenuActive",(J,be)=>{oe(J,be)}),T.value=de,Re&&(Re.value=de),Dn.on("setMode",J=>{d.value=J}),Dn.on("deleteAllModels",()=>{F.value=[]}),new Pt.ScreenSpaceEventHandler(Xt.scene.canvas).setInputAction(async J=>{if(L(),d.value==="2d")return;const be=Xt.scene.pick(J.position),Xe=Xt.container.getBoundingClientRect(),Us=Xe.left+J.position.x,_s=Xe.top+J.position.y,lt=[];if(Pt.defined(be)&&be instanceof Pt.Cesium3DTileFeature){const kn=de.baseCompt.getFeatureId(be),Nt=dn(be.tileset);de.baseCompt.hasSelectedFeaturesMap[Nt]?.some(Pn=>Pn.batchId===kn&&Pn.rank===0)||(await de.baseCompt.clearSelection(),await de.baseCompt.toggleMultiSelect(Nt,kn,de.baseCompt.selectedColor)),lt.push({id:"details",label:"构件详情",action:()=>{A.value=!0}}),lt.push({id:"hide",label:"隐藏选中构件",action:async()=>{const Nn=(await de.baseCompt.getSelected()).map(ct=>({elementId:ct.elementId,modelId:ct.modelId,show:!1}));de.baseCompt.setComponentVisibility(Nn)}}),lt.push({id:"translucent",label:"半透明选中构件",action:async()=>{const Nn=(await de.baseCompt.getSelected()).map(ct=>({elementId:ct.elementId,modelId:ct.modelId,rgba:{...ct.rgba,a:.3}}));await de.baseCompt.setSelectColorUserModelCpt(Nn,{rank:0})}}),lt.push({id:"isolate",label:"隔离选中构件",divided:!0,action:async()=>{await de.baseCompt.loadAllNodeDetailsForModel();const Nn=(await de.baseCompt.getSelected()).map(ct=>({elementId:ct.elementId,modelId:ct.modelId,show:!0}));de.isolateComponents(Nn)}})}lt.push({id:"showAll",label:"显示所有",action:async()=>{de.baseCompt.setAllComponentsVisibility(!0),await de.baseCompt.clearSelection()}}),lt.push(...V.value),M({x:Us,y:_s},lt)},Pt.ScreenSpaceEventType.RIGHT_CLICK),de.addContextMenuItems=k,de.insertContextMenu=de.addContextMenuItems,de.removeContextMenuItems=C,de.deleteContextMenu=de.removeContextMenuItems,de.closeContextMenu=L,de.hideContextMenu=de.closeContextMenu,de.onSetTeleportTarget=J=>{X.value=J},await o.nextTick();const $l=Pe?.onLoaded||Pe?.onloaded;$l&&$l({Cesium:Pt,viewer:Xt,methods:Bi}),Te("init",{Cesium:Pt,viewer:Xt,methods:Bi}),Te("ready",{Cesium:Pt,viewer:Xt,methods:Bi})}};let K=!1;Te("register",(Pe,Re)=>{K=!0,xe(Pe,Re)}),K||setTimeout(()=>{T.value.getViewer||xe()},0)}catch(z){c.value="Failed to load Cesium: "+(z.message||z),console.error(z)}}),o.onUnmounted(()=>{ce.setContainer(null)}),e({initMap:()=>T.value,initializeViewer:(z,Y)=>xe(z,Y)}),(z,Y)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["leiting-bim-container",[`theme-${j.value}`]]),onContextmenu:Y[28]||(Y[28]=o.withModifiers(()=>{},["prevent","stop"]))},[!a.value&&!c.value?(o.openBlock(),o.createBlock(o.unref(ie.Spin),{key:0,class:"loading",size:"large",tip:"加载基础组件中..."})):o.createCommentVNode("",!0),c.value?(o.openBlock(),o.createBlock(o.unref(ie.Alert),{key:1,class:"error",type:"error",message:c.value,"show-icon":""},null,8,["message"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"containerRef",ref:i,class:"cesium-viewer"},[o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(bn,{key:0,visible:_.value,"active-ids":re.value,"custom-items":H.value,onAction:oe,"is-2d":d.value==="2d"},null,8,["visible","active-ids","custom-items","is-2d"])),o.unref(h)&&!E.value&&!S.value?(o.openBlock(),o.createBlock(Il,{key:1,"active-ids":re.value,"is-2d":d.value==="2d",onItemClick:ye,onSubItemClick:Ie},null,8,["active-ids","is-2d"])):o.createCommentVNode("",!0),o.unref(h)&&n.showTree!==!1&&!E.value&&d.value!=="2d"?(o.openBlock(),o.createElementBlock("button",{key:2,class:o.normalizeClass(["mobile-float-tree-btn",{active:u.value}]),onClick:Y[0]||(Y[0]=K=>u.value=!u.value)},[o.createElementVNode("img",{src:o.unref(fi),class:"mobile-float-tree-icon",alt:"目录树"},null,8,RI)],2)):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.Teleport,{to:X.value||"body",disabled:!X.value},[o.createElementVNode("div",{ref_key:"uiOverlayRef",ref:s,class:"leiting-ui-overlay"},[o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(In,{key:0,visible:A.value,"full-height":U.info,"onUpdate:visible":Y[1]||(Y[1]=K=>A.value=K)},null,8,["visible","full-height"])),o.unref(h)?(o.openBlock(),o.createBlock(Dl,{key:1,visible:A.value,"onUpdate:visible":Y[2]||(Y[2]=K=>A.value=K),onClose:Y[3]||(Y[3]=()=>{A.value=!1})},null,8,["visible"])):o.createCommentVNode("",!0),o.createVNode(Bn,{ref_key:"LeitingPositionRef",ref:se,visible:b.value,"full-height":U.adjustModel,"onUpdate:visible":Y[4]||(Y[4]=K=>b.value=K)},null,8,["visible","full-height"]),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(xn,{key:2,visible:w.value,"full-height":U.setting,"tianditu-token":f.tiandituToken,"initial-config":l.value,"onUpdate:visible":Y[5]||(Y[5]=K=>w.value=K)},null,8,["visible","full-height","tianditu-token","initial-config"])),o.unref(h)?(o.openBlock(),o.createBlock(xl,{key:3,visible:w.value,"onUpdate:visible":Y[6]||(Y[6]=K=>w.value=K),onClose:Y[7]||(Y[7]=()=>{w.value=!1,Z.value=Z.value.filter(K=>K!=="setting")})},null,8,["visible"])):o.createCommentVNode("",!0),n.showTree!==!1&&!o.unref(h)?(o.openBlock(),o.createBlock(hi,o.mergeProps({key:4},{...p,...n.treeProps},{visible:u.value,"full-height":U.tree,"tree-data":F.value.length>0?F.value:n.treeProps?.treeData||[],"onUpdate:visible":Y[8]||(Y[8]=K=>{u.value=K})}),null,16,["visible","full-height","tree-data"])):o.createCommentVNode("",!0),n.showTree!==!1&&o.unref(h)?(o.openBlock(),o.createBlock(Bl,{key:5,visible:u.value,"tree-data":F.value.length>0?F.value:n.treeProps?.treeData||[],"onUpdate:visible":Y[9]||(Y[9]=K=>{u.value=K}),onClose:Y[10]||(Y[10]=()=>{u.value=!1})},null,8,["visible","tree-data"])):o.createCommentVNode("",!0),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(tw,{key:6,visible:N.value,"onUpdate:visible":Y[11]||(Y[11]=K=>N.value=K)},null,8,["visible"])),o.unref(h)?(o.openBlock(),o.createBlock(FI,{key:7,visible:N.value,"onUpdate:visible":Y[12]||(Y[12]=K=>N.value=K)},null,8,["visible"])):o.createCommentVNode("",!0),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(bw,{key:8,visible:S.value,"onUpdate:visible":Y[13]||(Y[13]=K=>S.value=K)},null,8,["visible"])),o.unref(h)?(o.openBlock(),o.createBlock(Tl,{key:9,visible:S.value,"default-tool":B.value,"onUpdate:visible":Y[14]||(Y[14]=K=>{S.value=K,K||(B.value=null)}),onClose:Y[15]||(Y[15]=()=>{S.value=!1,B.value=null})},null,8,["visible","default-tool"])):o.createCommentVNode("",!0),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(wn,{key:10,visible:m.value,"full-height":U.section,"onUpdate:visible":Y[16]||(Y[16]=K=>m.value=K)},null,8,["visible","full-height"])),o.unref(h)?(o.openBlock(),o.createBlock(Sl,{key:11,visible:m.value,"onUpdate:visible":Y[17]||(Y[17]=K=>m.value=K),onClose:Y[18]||(Y[18]=()=>{m.value=!1})},null,8,["visible"])):o.createCommentVNode("",!0),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(vn,{key:12,visible:E.value,"full-height":U.roam,"onUpdate:visible":Y[19]||(Y[19]=K=>E.value=K)},null,8,["visible","full-height"])),o.unref(h)?(o.openBlock(),o.createBlock(Ml,{key:13,visible:E.value,"onUpdate:visible":Y[20]||(Y[20]=K=>E.value=K),onClose:Y[21]||(Y[21]=()=>{E.value=!1})},null,8,["visible"])):o.createCommentVNode("",!0),o.unref(h)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ZE,{key:14,visible:I.value,"current-model-id":v.value,"onUpdate:visible":Y[22]||(Y[22]=K=>I.value=K),onHandleCloseCardByCadCard:Y[23]||(Y[23]=()=>{I.value=!1})},null,8,["visible","current-model-id"])),o.unref(h)?(o.openBlock(),o.createBlock(vI,{key:15,visible:I.value,"current-model-id":v.value,"onUpdate:visible":Y[24]||(Y[24]=K=>I.value=K),onHandleCloseCardByCadCard:Y[25]||(Y[25]=()=>{I.value=!1})},null,8,["visible","current-model-id"])):o.createCommentVNode("",!0),o.createVNode(Wb,{ref_key:"cadPositionRef",ref:P,visible:D.value,"onUpdate:visible":Y[26]||(Y[26]=K=>D.value=K),onSave:_e},null,8,["visible"]),o.createVNode(Bw,{visible:o.unref(g),position:o.unref(R),items:o.unref(x),"onUpdate:visible":Y[27]||(Y[27]=K=>g.value=K)},null,8,["visible","position","items"]),o.renderSlot(z.$slots,"default",o.normalizeProps(o.guardReactiveProps({methods:T.value,isReady:a.value})),void 0,!0)],512)],8,["to","disabled"]))],512)],34))}}),[["__scopeId","data-v-b4d657df"]]);function LI(n,e={}){const{tapDelay:t=300,doubleTapDelay:i=300,moveThreshold:s=10}=e;let r=0,a={x:0,y:0},c=0,l=0,d=null;const h=[],f=[],p=[],u={},m=x=>{const M=x.touches[0]||x.changedTouches[0];return{x:M?.clientX??0,y:M?.clientY??0}},E=x=>{const M=m(x);r=Date.now(),a=M,c=0,p.forEach(({handler:L,delay:V})=>{d=window.setTimeout(()=>{L(x),d=null},V)})},A=x=>{const M=m(x),L=M.x-a.x,V=M.y-a.y;c=Math.sqrt(L*L+V*V),d&&c>s&&(clearTimeout(d),d=null)},b=x=>{const M=Date.now()-r,L=m(x),V=L.x-a.x,k=L.y-a.y;d&&(clearTimeout(d),d=null);const C=M<t&&c<s;if(C&&Date.now()-l<i&&c<s?(f.forEach(P=>P(x)),l=0):C&&(h.forEach(P=>P(x)),l=Date.now()),c>50){const P=Math.abs(V),F=Math.abs(k);P>F?V>0&&u.right?u.right(x):V<0&&u.left&&u.left(x):k>0&&u.down?u.down(x):k<0&&u.up&&u.up(x)}},w=x=>{h.push(x)},I=x=>{f.push(x)},D=(x,M=500)=>{p.push({handler:x,delay:M})},N=x=>{u.left=x},S=x=>{u.right=x},B=x=>{u.up=x},g=x=>{u.down=x},R=()=>{d&&(clearTimeout(d),d=null),h.length=0,f.length=0,p.length=0,Object.keys(u).forEach(x=>{delete u[x]})};return o.onMounted(()=>{const x=n.value;x&&(x.addEventListener("touchstart",E,{passive:!1}),x.addEventListener("touchmove",A,{passive:!1}),x.addEventListener("touchend",b,{passive:!1}))}),o.onUnmounted(()=>{R();const x=n.value;x&&(x.removeEventListener("touchstart",E),x.removeEventListener("touchmove",A),x.removeEventListener("touchend",b))}),{onTap:w,onDoubleTap:I,onLongPress:D,onSwipeLeft:N,onSwipeRight:S,onSwipeUp:B,onSwipeDown:g,destroy:R}}function OI(n){const e=t=>{t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement||t.preventDefault()};return n.addEventListener("touchmove",e,{passive:!1}),()=>{n.removeEventListener("touchmove",e)}}function UI(){let n=0;const e=t=>{const i=Date.now();i-n<=300&&t.preventDefault(),n=i};return document.addEventListener("touchend",e,{passive:!1}),document.addEventListener("gesturestart",t=>t.preventDefault()),document.addEventListener("gesturechange",t=>t.preventDefault()),()=>{document.removeEventListener("touchend",e)}}function _I(n,e={}){const{delay:t=500,moveThreshold:i=10}=e,s=o.ref(!1);let r=null,a={x:0,y:0},c=!1;const l=u=>{if(u.touches.length!==1)return;u.preventDefault(),c=!0,s.value=!1;const m=u.touches[0];a={x:m?.clientX??0,y:m?.clientY??0},r=window.setTimeout(()=>{c&&(s.value=!0,n())},t)},d=u=>{if(!c||r===null)return;const m=u.touches[0],E=(m?.clientX??0)-a.x,A=(m?.clientY??0)-a.y;Math.sqrt(E*E+A*A)>i&&f()},h=()=>{c=!1,s.value=!1,r!==null&&(clearTimeout(r),r=null)},f=()=>{c=!1,s.value=!1,r!==null&&(clearTimeout(r),r=null)};return{isLongPressing:s,handlers:{onTouchStart:l,onTouchMove:d,onTouchEnd:h},start:l,end:h,cancel:f}}function QI(n,e,t={}){const{delay:i=500,moveThreshold:s=10}=t;let r=null,a={x:0,y:0};const c=h=>{if(h.touches.length!==1)return;h.preventDefault();const f=h.touches[0];a={x:f?.clientX??0,y:f?.clientY??0},r=window.setTimeout(()=>{e()},i)},l=h=>{if(r===null)return;const f=h.touches[0],p=(f?.clientX??0)-a.x,u=(f?.clientY??0)-a.y;Math.sqrt(p*p+u*u)>s&&(clearTimeout(r),r=null)},d=()=>{r!==null&&(clearTimeout(r),r=null)};return n.addEventListener("touchstart",c,{passive:!1}),n.addEventListener("touchmove",l,{passive:!1}),n.addEventListener("touchend",d),n.addEventListener("touchcancel",d),()=>{r!==null&&(clearTimeout(r),r=null),n.removeEventListener("touchstart",c),n.removeEventListener("touchmove",l),n.removeEventListener("touchend",d),n.removeEventListener("touchcancel",d)}}const VI={tapThreshold:10,doubleTapInterval:300,longPressDelay:500,panThreshold:20,pinchThreshold:.02};function GI(n={}){const e={...VI,...n},t=o.reactive({type:"none",startX:0,startY:0,currentX:0,currentY:0,deltaX:0,deltaY:0,scale:1,rotation:0,velocityX:0,velocityY:0,duration:0}),i=o.ref(!1),s=o.ref(!1),r=o.ref(!1);let a=0,c=0,l=null,d=0,h=1,f=0,p=null;const u={onTap:[],onDoubleTap:[],onLongPress:[],onPanStart:[],onPanMove:[],onPanEnd:[],onPinchStart:[],onPinchMove:[],onPinchEnd:[],onRotate:[]},m=k=>{if(k.length<2)return 0;const C=k[1].clientX-k[0].clientX,y=k[1].clientY-k[0].clientY;return Math.sqrt(C*C+y*y)},E=k=>k.length<2?0:Math.atan2(k[1].clientY-k[0].clientY,k[1].clientX-k[0].clientX)*(180/Math.PI);return{state:t,isActive:i,isPanning:s,isPinching:r,handlers:{onTouchStart:k=>{if(k.touches.length===1){const C=k.touches[0];p=C.identifier,a=Date.now(),t.startX=C.clientX,t.startY=C.clientY,t.currentX=C.clientX,t.currentY=C.clientY,t.deltaX=0,t.deltaY=0,i.value=!0,l=window.setTimeout(()=>{t.type="long-press",u.onLongPress.forEach(y=>y(k))},e.longPressDelay)}else k.touches.length===2&&(l&&(clearTimeout(l),l=null),r.value=!0,d=m(k.touches),h=1,f=E(k.touches),u.onPinchStart.forEach(C=>C(k)))},onTouchMove:k=>{if(k.touches.length===1&&p!==null){let C=null;for(let F=0;F<k.touches.length;F++)if(k.touches[F].identifier===p){C=k.touches[F];break}if(!C)return;const y=C.clientX-t.startX,v=C.clientY-t.startY;Math.sqrt(y*y+v*v)>e.panThreshold&&!s.value&&(s.value=!0,t.type="pan",l&&(clearTimeout(l),l=null),u.onPanStart.forEach(F=>F(k))),s.value&&(k.preventDefault(),t.deltaX=C.clientX-t.currentX,t.deltaY=C.clientY-t.currentY,t.currentX=C.clientX,t.currentY=C.clientY,t.velocityX=t.deltaX,t.velocityY=t.deltaY,u.onPanMove.forEach(F=>F(k)))}else if(k.touches.length===2&&r.value){k.preventDefault();const C=m(k.touches),y=E(k.touches),v=C/d;t.scale=h*v,t.rotation=y-f,u.onPinchMove.forEach(P=>P(k)),u.onRotate.forEach(P=>P(k))}},onTouchEnd:k=>{if(t.duration=Date.now()-a,l&&(clearTimeout(l),l=null),k.touches.length===0){if(s.value)t.type="pan",u.onPanEnd.forEach(C=>C(k));else if(r.value)u.onPinchEnd.forEach(C=>C(k));else if(t.type==="none"&&t.duration<300){const C=Date.now();C-c<e.doubleTapInterval?(t.type="double-tap",u.onDoubleTap.forEach(y=>y(k)),c=0):(t.type="tap",u.onTap.forEach(y=>y(k)),c=C)}s.value=!1,r.value=!1,i.value=!1,p=null,setTimeout(()=>{t.type="none",t.deltaX=0,t.deltaY=0,t.scale=1,t.rotation=0},50)}}},onTap:k=>{u.onTap.push(k)},onDoubleTap:k=>{u.onDoubleTap.push(k)},onLongPress:k=>{u.onLongPress.push(k)},onPanStart:k=>{u.onPanStart.push(k)},onPanMove:k=>{u.onPanMove.push(k)},onPanEnd:k=>{u.onPanEnd.push(k)},onPinchStart:k=>{u.onPinchStart.push(k)},onPinchMove:k=>{u.onPinchMove.push(k)},onPinchEnd:k=>{u.onPinchEnd.push(k)},onRotate:k=>{u.onRotate.push(k)}}}const vi={enableFpsLimit:!0,targetFps:30,enableResolutionScale:!0,resolutionScale:.75,enableLazyLoad:!0,lazyLoadDelay:200,enableModelLod:!0,modelQualityLevel:"medium",enablePostProcessing:!1,enableFxaa:!1,enableAmbientOcclusion:!1,enableShadows:!1,maxTextureSize:1024,enableDebounce:!0,debounceDelay:100};function HI(n={}){const e={...vi,...n};return{requestRenderMode:e.enableFpsLimit,maximumRenderTimeChange:e.enableFpsLimit?1e3/e.targetFps:void 0,scene3DOnly:!0,shouldAnimate:!0}}function YI(n={}){const e={...vi,...n};return{resolutionScale:e.enableResolutionScale?e.resolutionScale:1,targetFrameRate:e.enableFpsLimit?e.targetFps:void 0,sceneModePicker:!1,navigationHelpButton:!1,animation:!1,timeline:!1,fullscreenButton:!1,vrButton:!1,infoBox:!1,selectionIndicator:!1,shadows:e.enableShadows,skyAtmosphere:e.enablePostProcessing,fog:e.enablePostProcessing}}function zI(n={}){const e={...vi,...n},i={low:{maximumScreenSpaceError:64,skipScreenSpaceErrorFactor:256,skipLevels:8,baseScreenSpaceError:2048},medium:{maximumScreenSpaceError:48,skipScreenSpaceErrorFactor:128,skipLevels:5,baseScreenSpaceError:1024},high:{maximumScreenSpaceError:32,skipScreenSpaceErrorFactor:64,skipLevels:3,baseScreenSpaceError:512}}[e.modelQualityLevel];return{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:i.maximumScreenSpaceError,skipLevelOfDetail:e.enableModelLod,baseScreenSpaceError:i.baseScreenSpaceError,skipScreenSpaceErrorFactor:i.skipScreenSpaceErrorFactor,skipLevels:i.skipLevels,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*5,preloadWhenHidden:!0,preferLeaves:e.enableModelLod,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}}function WI(n=30){const e=o.ref(60),t=o.ref(!1);let i=0,s=0,r=0;const a=1e3/n,c=()=>{t.value=!0,i=performance.now(),r=i,s=0},l=()=>{if(!t.value)return!0;const h=performance.now(),f=h-i;return s++,h-r>=1e3&&(e.value=Math.round(s*1e3/(h-r)),s=0,r=h),f>=a?(i=h-f%a,!0):!1},d=()=>{t.value=!1};return o.onUnmounted(()=>{d()}),{fps:e,isControlling:t,startControl:c,stopControl:d,tick:l}}function jI(n,e){let t=null;const i=((...s)=>{t!==null&&clearTimeout(t),t=window.setTimeout(()=>{n(...s),t=null},e)});return i.cancel=()=>{t!==null&&(clearTimeout(t),t=null)},i}function KI(n,e){let t=!1;return((...s)=>{t||(n(...s),t=!0,setTimeout(()=>{t=!1},e))})}function $I(n,e=200){let t=null;const i=()=>{t!==null&&clearTimeout(t),t=window.setTimeout(()=>{n(),t=null},e)},s=()=>{t!==null&&(clearTimeout(t),t=null)};return o.onUnmounted(()=>{s()}),{load:i,cancel:s}}function kl(n){const e=o.ref(),t=o.ref(n.theme||"dark"),i=o.ref(n.menuSize||"medium");o.provide("leiting-theme",t),o.provide("leiting-menu-size",i);function s(c){o.onUnmounted(()=>{e.value=null}),c(n,e)}function r(){const c=o.unref(e);return c||console.error("未获取到leiting实例!"),c}const a=new Proxy({},{get(c,l){const d=r();if(!d)return;const h=d[l];return typeof h=="function"?h.bind(d):h},set(c,l,d){const h=r();return h?(h[l]=d,!0):!1}});return[s,a]}const XI=Ct,qI={install:(n,e)=>{if(n.component("LeitingBIM",wi),n.component("LeitingTree",hi),n.component("LeitingDraggableCard",Le),n.component("leiting-draggable-card",Le),n.component("LeitingMenu",bn),n.component("leiting-menu",bn),n.component("LeitingSection",wn),n.component("leiting-section",wn),n.component("LeitingPlayer",vn),n.component("leiting-player",vn),n.component("LeitingInfo",In),n.component("leiting-info",In),n.component("LeitingPosition",Bn),n.component("leiting-position",Bn),n.component("LeitingSetting",xn),n.component("leiting-setting",xn),!e)return;const t={...XI,...e};t.cesiumUrl&&xi(t).catch(i=>{console.error("[LeitingBim] Failed to load Cesium resources:",i)}),n.config.globalProperties.$leitingBimOptions=t}};Q.DEFAULT_CESIUM_CONFIG=Ct,Q.LeiTingBIM=wi,Q.LeiTingDraggableCard=Le,Q.LeiTingInfo=In,Q.LeiTingMenu=bn,Q.LeiTingPlayer=vn,Q.LeiTingPosition=Bn,Q.LeiTingSection=wn,Q.LeiTingSetting=xn,Q.LeiTingTree=hi,Q.LeitingBIM=wi,Q.LeitingDraggableCard=Le,Q.LeitingInfo=In,Q.LeitingMenu=bn,Q.LeitingPlayer=vn,Q.LeitingPosition=Bn,Q.LeitingSection=wn,Q.LeitingSetting=xn,Q.LeitingTree=hi,Q.MobileBottomNav=Il,Q.MobileDrawer=bi,Q.MobileInfo=Dl,Q.MobileMeasurement=Tl,Q.MobilePlayer=Ml,Q.MobileSection=Sl,Q.MobileSetting=xl,Q.MobileTree=Bl,Q.default=qI,Q.defaultMobileConfig=vi,Q.disableDoubleTapZoom=UI,Q.getAccessToken=Si,Q.getCesiumOptionsForMobile=HI,Q.getTilesetOptionsForMobile=zI,Q.getViewerOptionsForMobile=YI,Q.leitingBim=wi,Q.loadCesium=xi,Q.preventDefaultTouchEvents=OI,Q.useDebounce=jI,Q.useDevice=ui,Q.useFrameRateControl=WI,Q.useGestureDetection=GI,Q.useLazyLoad=$I,Q.useLeiTing=kl,Q.useLeiting=kl,Q.useLongPress=_I,Q.useLongPressOnElement=QI,Q.useModelTree=fl,Q.useRightContextMenu=vl,Q.useThrottle=KI,Q.useTouchEvents=LI,Q.waitForCesium=ec,Object.defineProperties(Q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
121
+ `});m.isModelAdjustment=!0,f.customShader=m}else e.brightness!==void 0&&e.brightness!==1&&!f.style&&(f.style=new n.Cesium3DTileStyle({color:`color('white') * ${e.brightness}`}))}}setModelBrightness(e){this.setModelColorAdjustment({brightness:e})}_defaultSkyBox=null;_updateLightDirection=e=>{e.light instanceof this.cesium.DirectionalLight&&(e.light.direction=e.camera.directionWC)};setEnvironmentMapEnable(e){this.is2d||(e?(this.viewer.scene.light=new this.cesium.DirectionalLight({direction:this.viewer.scene.camera.directionWC}),this.viewer.scene.preRender.addEventListener(this._updateLightDirection)):(this._defaultSkyBox&&(this.viewer.scene.skyBox=this._defaultSkyBox),this.viewer.scene.preRender.removeEventListener(this._updateLightDirection),this.viewer.scene.light=new this.cesium.SunLight),this.viewer.scene.imageBasedLighting&&(this.viewer.scene.imageBasedLighting.imageBasedLightingFactor=e?new this.cesium.Cartesian2(2,2):new this.cesium.Cartesian2(1,1)))}setAmbientOcclusion(e){if(this.is2d)return;const t=this.viewer.scene;if(!t||!t.postProcessStages||!t.postProcessStages.ambientOcclusion)return;const n=t.postProcessStages.ambientOcclusion;n.enabled=e,e&&(n.uniforms.ambientOcclusionOnly=!1,n.uniforms.intensity=3,n.uniforms.bias=.1,n.uniforms.lengthCap=.03,n.uniforms.stepSize=1,n.uniforms.blurStepSize=.86)}setCollisionDetection(e){if(this.is2d){this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1;return}const t=this.viewer.scene.screenSpaceCameraController;t.enableCollisionDetection=e,e||t.minimumZoomDistance<1&&(t.minimumZoomDistance=1)}_customZoomHandler=null;setHeightBasedZoom(e){const t=this.viewer.scene.screenSpaceCameraController,n=this.cesium;if(this.viewer.camera.frustum.near=1e-4,this.viewer.camera.frustum.far=1e8,e||(this.viewer.camera.frustum.near=.1),this._customZoomHandler&&(this._customZoomHandler.destroy(),this._customZoomHandler=null),!e){t.zoomEventTypes.includes(n.CameraEventType.WHEEL)||t.zoomEventTypes.push(n.CameraEventType.WHEEL);return}t.zoomEventTypes=t.zoomEventTypes.filter(o=>o!==n.CameraEventType.WHEEL),this._customZoomHandler=new n.ScreenSpaceEventHandler(this.viewer.scene.canvas);let s=null;this._customZoomHandler.setInputAction(o=>{s=o.endPosition},n.ScreenSpaceEventType.MOUSE_MOVE),this._customZoomHandler.setInputAction(o=>{const r=this.viewer.camera,l=r.positionCartographic.height,c=Math.sign(o);if(l<.15&&c>0){ce.info("无法继续放大");return}const d=.3;let h=0;if(c>0){const g=l-1;h=g>0?g*d:0}else h=l*d;h=Math.max(.1,h),console.log(l);let f=null;if(!s)f=r.direction;else{const g=r.getPickRay(s);if(g){let A=this.viewer.scene.pickPosition(s);if(!A){const p=n.IntersectionTests.rayEllipsoid(g,this.viewer.scene.globe.ellipsoid);p&&(A=n.Ray.getPoint(g,p.start))}if(A){const p=n.Cartesian3.subtract(A,r.position,new n.Cartesian3);f=n.Cartesian3.normalize(p,new n.Cartesian3)}else f=r.direction}else f=r.direction}const m=c>0?h:-h*2,u=n.Cartesian3.multiplyByScalar(f,m,new n.Cartesian3);r.position=n.Cartesian3.add(r.position,u,new n.Cartesian3)},n.ScreenSpaceEventType.WHEEL)}setMouseHabit(e){if(this.is2d)return;const t=this.viewer.scene.screenSpaceCameraController;t.enableTranslate=!0,t.enableRotate=!0,t.enableZoom=!0,t.enableTilt=!0,t.enableLook=!1,t.lookEventTypes=[],e===1?(t.rotateEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.MIDDLE_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.LEFT_DRAG]):(t.rotateEventTypes=[this.cesium.CameraEventType.LEFT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.MIDDLE_DRAG])}}class l2{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}getCameraView(){const e=this.viewer.camera;return{position:{x:e.position.x,y:e.position.y,z:e.position.z},destination:{x:e.position.x,y:e.position.y,z:e.position.z},orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},duration:1}}flyToCameraView(e){const{position:t,orientation:n,duration:s}=e,o=new this.cesium.Cartesian3(t.x,t.y,t.z),r=new this.cesium.HeadingPitchRoll(n.heading,n.pitch,n.roll);!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}getCurrentCameraPositionAndTarget(){const e=this.getCameraView();return{position:e.position,target:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll},duration:e.duration}}setCameraView(e){const t=e.target||e.orientation||{},n=e.destination||e.position||{};this.flyToCameraView({position:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},destination:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},orientation:{heading:Number(t.heading||0),pitch:Number(t.pitch||0),roll:Number(t.roll||0)},duration:e.duration})}flyToLonLatHeight(e,t,n,s=1){const o=this.cesium.Cartesian3.fromDegrees(e,t,n),r={heading:this.cesium.Math.toRadians(0),pitch:this.cesium.Math.toRadians(-90),roll:0};!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}}function c2(i){const{container:e,appContext:t,methods:n,viewerOptions:s,options:o,callbacks:r}=i,l=new Ki,c=window.Cesium;if(!c)throw new Error("Cesium is not loaded");e.id=`cesium-container-${Jp()}`;const d={animation:!1,timeline:!1,infoBox:!1,homeButton:!1,fullscreenButton:!1,sceneModePicker:!1,navigationHelpButton:!1,geocoder:!1,baseLayerPicker:!1,selectionIndicator:!1,heightBasedZoom:!0,creditContainer:document.createElement("div"),contextOptions:{webgl:{alpha:!0}}},h=t?.config?.globalProperties?.$leitingBimOptions,f={...d,...h?.viewerOptions??{},...s??{}},m=new c.Viewer(e,f);m.camera.setView({destination:c.Cartesian3.fromDegrees(108,32,1e7),orientation:{heading:c.Math.toRadians(0),pitch:c.Math.toRadians(-90),roll:0}});let u=n;if(!u&&h&&(h.methods||(h.methods={}),u=h.methods),u){const g=new h0({cesium:c,viewer:m,options:o,callbacks:r}),A=new Sl({cesium:c,viewer:m}),p=new r2({cesium:c,viewer:m}),y=new u0({cesium:c,viewer:m}),C=new pC({cesium:c,viewer:m}),I=new l2({cesium:c,viewer:m});let P;const k=new Ca({cesium:c,viewer:m});o&&(o.globe!==void 0&&p.setGlobeEnvironmentVisible(o.globe),o.terrain!==void 0&&p.setTerrainEnable(o.terrain),o.depthTest!==void 0&&p.setDepthTestEnable(o.depthTest),o.mapProvider&&o.mode!=="2d"&&p.changeBaseMap(o.mapProvider,{token:o.tiandituToken,layerType:o.tiandituLayerType,showAnnotation:o.tiandituShowLabel,url:o.arcgisUrl}),o.shadows!==void 0&&p.setShadowsEnable(o.shadows),o.environmentMap!==void 0&&p.setEnvironmentMapEnable(o.environmentMap),o.ambientOcclusion!==void 0&&p.setAmbientOcclusion(o.ambientOcclusion),o.time!==void 0&&p.setTime(o.time),o.brightness!==void 0&&p.setModelBrightness(o.brightness),o.backgroundColor!==void 0&&p.setBackgroundColor(o.backgroundColor),o.collision!==void 0&&p.setCollisionDetection(o.collision),o.mouseHabit!==void 0&&p.setMouseHabit(o.mouseHabit),o.heightBasedZoom!==void 0&&p.setHeightBasedZoom(o.heightBasedZoom)),o&&o.mode==="2d"&&(console.log("InitMap: Setting CAD Mode 2D"),p.setCadMode("2d"),P=new Vd({cesium:c,viewer:m})),A.events.on("tilesetLoaded",E=>{g.baseCompt.attachTileset(E,g.baseCompt.selectedColor),g.baseSection.attachTileset(E,E.leiting?.model?.modelId),u&&u.tilesLoad3dTiles&&u.tilesLoad3dTiles(E),o?.tilesLoad3dTiles&&o.tilesLoad3dTiles(E.leiting)}),A.events.on("loadingStatus",E=>{u&&u.onLoadingStatus&&u.onLoadingStatus(E)}),A.events.on("mountAll3Dtiles",({modelList:E})=>{o?.mountAll3Dtiles&&o.mountAll3Dtiles(E),u?.mountAll3Dtiles&&u.mountAll3Dtiles(E)}),A.events.on("updateModels",({modelList:E})=>{o?.updateModels&&o.updateModels(E),u?.updateModels&&u.updateModels(E)}),y.events.on("mountAllCad",E=>{o?.mountAllCad&&o.mountAllCad(E),u?.mountAllCad&&u.mountAllCad(E)}),C.events.on("mountAllGISCad",E=>{o?.mountAllGISCad&&o.mountAllGISCad(E),u?.mountAllGISCad&&u.mountAllGISCad(E)}),g.baseCompt.loadNodeDetailsForModel=E=>A.loadNodeDetailsForModel(E),g.baseCompt.selectionChange(E=>{E.length!==0&&(o?.selectionChange&&o.selectionChange(E),u?.selectionChange&&u.selectionChange(E))}),u.onSearchComponent=E=>{o?.searchComponent&&o.searchComponent(E),u?.searchComponent&&u.searchComponent(E)};const M=u.saveRegion;u.saveRegion=E=>{o?.saveRegion&&o.saveRegion(E),M&&M!==o?.saveRegion&&M(E)};const B=u.saveCadCalibration;u.saveCadCalibration=E=>{o?.saveCadCalibration&&o.saveCadCalibration(E),B&&B!==o?.saveCadCalibration&&B(E)};const _=u.saveCadRegion;u.saveCadRegion=E=>{o?.saveCadRegion&&o.saveCadRegion(E),_&&_!==o?.saveCadRegion&&_(E)},u.getCesium=()=>c,u.getViewer=()=>m,u.getAnnotationInstance=()=>P,u.getMeasureInstance=()=>k,u.flyToCamera=E=>{I.setCameraView(E)},u.flyToLonLatHeight=(E,w,D,F=1)=>{I.flyToLonLatHeight(E,w,D,F)},u.flyTo=u.flyToCamera,u.getCameraState=()=>I.getCameraView(),u.getCameraInfo=u.getCameraState,u.restoreCameraState=E=>I.flyToCameraView(E),u.flyToCameraView=u.restoreCameraState,u.getCameraPositionTarget=()=>I.getCurrentCameraPositionAndTarget(),u.getCurrentCameraPositionAndTarget=u.getCameraPositionTarget,u.setCameraLookAt=E=>I.setCameraView(E),u.setCameraView=u.setCameraLookAt,u.setCanvasBackground=E=>p.setBackgroundColor(E),u.setBackgroundColor=u.setCanvasBackground,u.setAntiAliasing=E=>g.enableCesiumFXAA(E),u.enableCesiumFXAA=u.setAntiAliasing,u.setSceneVisibility=E=>g.setSceneOptions(E),u.setSceneOptions=u.setSceneVisibility,u.addDebugPoint=(E,w,D=0)=>{m.entities.add({position:c.Cartesian3.fromDegrees(E,w,D),point:{pixelSize:10,color:c.Color.RED}})},u.addPoint=u.addDebugPoint,u.toggleDebugLabels=()=>g.enableTestLabel(),u.enableTestLabel=u.toggleDebugLabels,u.captureScreenshot=()=>{const E=m.scene.canvas;return m.render(),E.toDataURL("image/png")},u.getImageBase64=u.captureScreenshot,u.captureDomScreenshot=(E,w)=>g.getSnapDomSImageBase64(E,w),u.getSnapDomSImageBase64=u.captureDomScreenshot,u.addModels=E=>A.addModels(E),u.add3DtilesModel=u.addModels,u.addObliquePhotography=E=>A.addOSGB(E),u.addOSGB=u.addObliquePhotography,u.adjustOSGBModelMatrix=E=>A.updateOSGBMatrix(E),u.updateOSGBMatrix=u.adjustOSGBModelMatrix,u.setModelVisibility=E=>A.showModels(E),u.showModels=u.setModelVisibility,u.showTileset=u.setModelVisibility,u.removeModels=E=>A.deleteModels(E),u.deleteModels=u.removeModels,u.clearAllModels=()=>{A.deleteAllModels(),l.emit("deleteAllModels")},u.deleteAllModelList=u.clearAllModels,u.deleteAllModels=u.clearAllModels,u.flyToModel=E=>A.flyToTileset(E),u.flyToTileset=u.flyToModel,u.flyToByModelId=u.flyToModel,u.setModelBrightness=E=>g.updateModelEffect(E),u.updateModelEffect=u.setModelBrightness,u.getAllTilesets=()=>A.getMapTileset(),u.getMapTileset=u.getAllTilesets,u.getCurrentModelId=()=>A.getBIMmodelId(),u.getBIMmodelId=u.getCurrentModelId,u.getLoadedModels=()=>A.getModelList(),u.getModelList=u.getLoadedModels,u.loadModelStructure=async E=>{const w=typeof E=="string"?E:E?.modelId;if(!w){console.warn("loadModelStructure: modelId is required");return}return await A.loadTreeForModel(w)},u.loadTreeForModel=u.loadModelStructure,u.loadModelDetails=async E=>{const w=typeof E=="string"?E:E?.modelId;if(!w){console.warn("loadModelDetails: modelId is required");return}return await A.loadNodeDetailsForModel(w)},u.loadNodeDetailsForModel=u.loadModelDetails,u._loadNodeDetailsForModel=async E=>{const w=typeof E=="string"?E:E?.modelId;if(!w){console.warn("loadModelDetails: modelId is required");return}return await A._loadNodeDetailsForModel(w)},u.setMapTileset=E=>A.setMapTileset(E),u.setCurrentModelId=E=>A.setBIMmodelId(E),u.setBIMmodelId=u.setCurrentModelId,u.setModelList=E=>A.setModelList(E),u.highlightComponents=(E,w={})=>g.baseCompt.setSelectColorUserModelCpt(E,w),u.setSelectColorUserModelCpt=u.highlightComponents,g.baseCompt.setLoadNodeDetailsCallback(E=>A.loadNodeDetailsForModel(E)),u.highlightAllComponents=(E,w)=>g.baseCompt.setAllSelectColorUserModelCpt(E,w),u.setAllSelectColorUserModelCpt=u.highlightAllComponents,u.setSelectColorUserModelCptByClear=(E,w)=>{g.baseCompt.clearAllHaveSelected(),g.baseCompt.setSelectColorUserModelCpt(E.selectCpts,w??{rank:0})},u.clearSelectColorUserModelCpt=()=>g.baseCompt.clearAllHaveSelected(),u.selectComponents=(E,w)=>{g.baseCompt.clearAllHaveSelected(),g.baseCompt.setSelectColorUserModelCpt(E,w??{rank:0})},u.setSelecteds=u.selectComponents,u.setSelectionColor=(E,w,D,F)=>g.baseCompt.setSelectedColorRgba(E,w,D,F),u.setSelectedColor=u.setSelectionColor,u.clearSelection=()=>g.baseCompt.clearAllHaveSelected(),u.clearAllHaveSelected=u.clearSelection,u.getSelectedComponents=E=>g.baseCompt.getSelected(E),u.getSelected=u.getSelectedComponents,u.setClickToHighlightEnabled=E=>{g.baseCompt.clickToHighlightEnabled=E},u.getClickToHighlightEnabled=()=>g.baseCompt.clickToHighlightEnabled,u.onSelectionChange=E=>{g.baseCompt.selectionChange(E)},u.selectionChange=u.onSelectionChange,u.flyToComponents=E=>g.baseCompt.flyToObjects(E),u.flyToObjects=u.flyToComponents,u.setConstructionData=async E=>{if(E&&Array.isArray(E)){const w=new Set;E.forEach(D=>{D.mergeCpts&&Array.isArray(D.mergeCpts)&&D.mergeCpts.forEach(F=>{F.modelId&&w.add(F.modelId)})}),w.size>0&&await Promise.all(Array.from(w).map(D=>u.loadNodeDetailsForModel(D)))}g.baseCompt.setAllConstructionProgressTracking(E)},u.setAllConstructionProgressTracking=u.setConstructionData,u.startConstructionSimulation=()=>g.baseCompt.enableConstructionProgressTracking(),u.enableAllConstructionProgressTracking=u.startConstructionSimulation,u.stopConstructionSimulation=()=>g.baseCompt.disableConstructionProgressTracking(),u.disableConstructionProgressTracking=u.stopConstructionSimulation,u.disableAllConstructionProgressTracking=u.stopConstructionSimulation,u.resetConstructionSimulation=()=>g.baseCompt.freshConstructionProgressTracking(),u.freshConstructionProgressTracking=u.resetConstructionSimulation,u.restartConstructionSimulation=()=>g.baseCompt.reStartAnimation(),u.reStartAnimation=u.restartConstructionSimulation,u.resumeFlyTo=()=>g.baseCompt.resumeFlyTo(),u.pauseConstructionSimulation=()=>g.baseCompt.pauseFlyTo(),u.pauseFlyTo=u.pauseConstructionSimulation,u.pauseAnimation=u.pauseConstructionSimulation,u.resumeConstructionSimulation=()=>g.baseCompt.resumeFlyTo(),u.resumeAnimation=u.resumeConstructionSimulation,u.setComponentsVisibility=async E=>await g.baseCompt.setComponentVisibility(E),u.setElementsListVisible=u.setComponentsVisibility,u.setAllComponentsVisibility=async E=>await g.baseCompt.setAllComponentsVisibility(E),u.setAllElementsVisible=u.setAllComponentsVisibility,u.isolateComponents=E=>g.baseCompt.isolateComponentVisibility(E),u.isolateComponentVisibility=u.isolateComponents,u.getComponentsByVisibility=E=>g.baseCompt._getComponentsByVisibility(E),u.getShowCpts=E=>g.baseCompt.getComponentsByVisibility(E),u.getElementsVisible=E=>g.baseCompt.getComponentsByVisibility(E),u.setComponentVisibility=u.setComponentsVisibility,u.enableSectioning=(E,w)=>g.baseSection.open(E,w),u.openSection=u.enableSectioning,u.disableSectioning=E=>g.baseSection.close(E),u.closeSection=u.disableSectioning,u.updateSectionBox=E=>g.baseSection.updateRange(E),u.updateSectionRange=u.updateSectionBox,u.getSectionBox=()=>g.baseSection.getRange(),u.getSectionRange=u.getSectionBox,u.fitSectionToModel=()=>g.baseSection.fitToModels(),u.fitToModels=u.fitSectionToModel,u.setSectionBoxVisibility=E=>g.baseSection.setBoxVisibility(E),u.startFirstPersonMode=()=>{g.baseCompt.disableSelection(),g.basePlayer.openPlayer()},u.openPlayer=u.startFirstPersonMode,u.startCameraRoam=()=>{g.baseCompt.disableSelection(),g.basePlayer.openCameraRoam()},u.stopFirstPersonMode=()=>{g.basePlayer.closePlayer(),g.baseCompt.enableSelection()},u.closePlayer=u.stopFirstPersonMode,u.setPlayerPosition=E=>g.basePlayer.setPersonPosition(E),u.setPersonPosition=u.setPlayerPosition,u.setPlayerDefaultPosition=()=>g.basePlayer.setDefaultPosition(),u.setWalkSpeed=E=>g.basePlayer.setSpeed({speed:E}),u.setPlayerSpeed=u.setWalkSpeed,u.setPlayerConfig=E=>g.basePlayer.setParams(E),u.setPlayerParams=u.setPlayerConfig,u.setPlayerAction=(E,w)=>g.basePlayer.setMoveState(E,w),u.setPlayerMoveState=u.setPlayerAction,u.bindPlayerControls=E=>g.basePlayer.bindUiKeys(E),u.bindPlayerUiKeys=u.bindPlayerControls,u.setGlobeVisibility=E=>p.setGlobeEnvironmentVisible(E),u.setGlobeEnvironmentVisible=u.setGlobeVisibility,u.setTerrainVisibility=E=>p.setTerrainEnable(E),u.setTerrainEnable=u.setTerrainVisibility,u.setDepthTest=E=>p.setDepthTestEnable(E),u.setDepthTestEnable=u.setDepthTest,u.setBaseMap=(E,w)=>p.changeBaseMap(E,w),u.changeBaseMap=u.setBaseMap,u.setWorldTime=E=>p.setTime(E),u.setTime=u.setWorldTime,u.setGisOptions=E=>{E.globe!==void 0&&p.setGlobeEnvironmentVisible(E.globe),E.elevation!==void 0&&p.setTerrainEnable(E.elevation),E.depthTestAgainstTerrain!==void 0&&p.setDepthTestEnable(E.depthTestAgainstTerrain),E.rendering!==void 0&&p.setAmbientOcclusion(E.rendering)},u.setShadowVisibility=E=>p.setShadowsEnable(E),u.setShadowsEnable=u.setShadowVisibility,u.setEnvironmentMapVisibility=E=>p.setEnvironmentMapEnable(E),u.setEnvironmentMapEnable=u.setEnvironmentMapVisibility,u.setAOVisibility=E=>p.setAmbientOcclusion(E),u.setAmbientOcclusion=u.setAOVisibility,u.setBackgroundColor=E=>p.setGlobeColor(E),u.setGlobeColor=u.setBackgroundColor,u.setModelBrightness=E=>p.setModelBrightness(E),u.adjustModelColor=E=>p.setModelColorAdjustment(E),u.setModelColorAdjustment=u.adjustModelColor,u.setShadowIntensity=E=>{p.setShadowDarkness?p.setShadowDarkness(E):console.warn("baseSetting.setShadowDarkness is not available. Please reload the page.")},u.setShadowDarkness=u.setShadowIntensity,u.switchSceneMode=async E=>{const w=E?"2d":"3d";await p.setCadMode(w),E&&!P&&(P=new Vd({cesium:c,viewer:m}),u.setGlobeVisibility(!0)),l.emit("setMode",w)},u.setSceneMode=u.switchSceneMode,u.set2d=E=>u.switchSceneMode(E),u.is2dMode=()=>p.is2d,u.setMouseControlMode=E=>p.setMouseHabit(E),u.setMouseHabit=u.setMouseControlMode,u.setCollisionEnabled=E=>p.setCollisionDetection(E),u.setCollisionDetection=u.setCollisionEnabled,u.searchAndLocate=(E,w)=>p.searchLocation(E,w),u.searchLocation=u.searchAndLocate,u.getConfigure=()=>(console.warn("getConfigure is not initialized. Please ensure LeitingSetting component is mounted."),{}),u.setConfigure=E=>{console.warn("setConfigure is not initialized. Please ensure LeitingSetting component is mounted.",E)},u.addCadModel=E=>{const w={...E};return w.files&&!w.fileNames&&(w.fileNames=w.files),w.fileNames||(w.fileNames=[]),y.addDxfModel(w)},u.addDxfModel=u.addCadModel,u.addGISCadModel=E=>{const w={...E};return w.files&&!w.fileNames&&(w.fileNames=w.files),w.fileNames||(w.fileNames=[]),C.addGISCadModel(w)},u.showGISCadModel=E=>C.showJson(E),u.showGISCadLayer=E=>C.showJsonByLayer(E),u.deleteGISCad=E=>C.deleteCad(E),u.deleteAllGISCad=()=>C.deleteAllCad(),u.flyToGISCadModel=(E={})=>C.flyToCadModel(E),u.getGISCadModels=E=>C.getDxfModels(E),u.getGISCadLayers=E=>C.getMapLayers(E),u.getGISCadModelId=()=>C.getModelId(),u.getDefaultGISCadTransformConfig=()=>C.getDefaultCoordinateTransformConfig(),u.transformGISCadCoordinate=E=>C.transformCoordinate(E),u.beginEditGISCad=E=>C.beginEditGISCad(E),u.adjustGISCadModel=E=>C.adjustGISCadModel(E),u.commitEditGISCad=E=>C.commitEditGISCad(E),u.cancelEditGISCad=E=>C.cancelEditGISCad(E),u.deleteCad=E=>y.deleteCad(E),u.deleteAllCad=()=>y.deleteAllCad(),u.showCadModel=E=>y.showJson(E),u.showGeoJson=E=>y.showJson(E),u.showDxfModel=u.showCadModel,u.showCadLayer=E=>y.showJsonByLayer(E),u.showDxfLayer=u.showCadLayer,u.flyToCadModel=(E={})=>y.flyToCadModel(E),u.getCadModels=E=>y.getDxfModels(E),u.getDxfModels=u.getCadModels,u.getCadLayers=E=>y.getMapLayers(E),u.getDxfLayers=u.getCadLayers,u.getCadModelId=()=>y.getModelId(),u.setCadOpen=E=>y.setDxfOpen(E),u.setDxfOpen=u.setCadOpen,u.getCadOpen=()=>y.getDxfOpen(),u.getDxfOpen=u.getCadOpen,u.adjustCadModel=E=>y.adjustingModelByCad(E),u.adjustingModelByCad=u.adjustCadModel,u.saveAnnotations=()=>{let E=null;return P&&(E=P.saveAnnotations()),o?.saveAnnotations&&o.saveAnnotations(E),E},u.loadAnnotations=E=>P?P.loadAnnotations(E):!1,u.flyToTopView=()=>{y.flyToCadModel()},u.menuEvents=l,u.addMenuItems=E=>{l.emit("insertMenu",E)},u.insertMenu=u.addMenuItems,u.filterMenuItems=E=>{l.emit("setMenuListFilter",E)},u.setMenuListFilter=u.filterMenuItems,u.setMenuVisibility=E=>{l.emit("showMenu",E)},u.showMenu=u.setMenuVisibility,u.setPanelVisibility=(E,w)=>{l.emit("setMenuActive",E,w)},u.setMenuActive=u.setPanelVisibility,u.addContextMenuItems=E=>{console.warn("addContextMenuItems is not initialized yet. Please wait for LeitingBIM component to mount.",E)},u.insertContextMenu=u.addContextMenuItems,u.removeContextMenuItems=E=>{console.warn("removeContextMenuItems is not initialized yet.",E)},u.deleteContextMenu=u.removeContextMenuItems,u.closeContextMenu=()=>{console.warn("closeContextMenu is not initialized yet.")},u.hideContextMenu=u.closeContextMenu,u.getModelTree=()=>{const E=[],w=A.getMapTileset();return Object.keys(w).forEach(D=>{const F=w[D];if(F&&F.leiting&&F.leiting.tree){const U=F.leiting.tree;Array.isArray(U)?E.push(...U):E.push(U)}}),E},u.getTree=u.getModelTree,u.getAllComponentDetails=()=>{const E=A.getMapTileset(),w={},D=[];try{Object.keys(E).forEach(F=>{const U=E[F];if(!U||!U.leiting)return;const R=U.leiting,b=R.node,v=R.model.formData,x=R.box;if(!b||!b.nodeExtras)return;const N=R.model.modelId;w[N]=b.nodeExtras;const O=b.nodeExtras.element;if(!O)return;const Q=x?x.center:{x:0,y:0,z:0};Object.values(O).forEach(L=>{if(L.box3)try{const T=c.Quaternion.fromAxisAngle(c.Cartesian3.UNIT_Z,c.Math.toRadians(v.totalRotation||0)),S=c.Matrix4.fromRotationTranslation(c.Matrix3.fromQuaternion(T),new c.Cartesian3(0,0,0)),G=c.Cartesian3.fromDegrees(v.longitude,v.latitude,v.height),Y=c.Transforms.eastNorthUpToFixedFrame(G);c.Matrix4.multiply(Y,S,Y);const q=new c.Cartesian3(Q.x,Q.y,0),W=new c.Cartesian3;c.Matrix4.multiplyByPoint(Y,q,W);const re=c.Cartographic.fromCartesian(W),ae=L.box3?.Center?.x||0,de=L.box3?.Center?.y||0,he=L.box3?.Center?.z||0,ge=new c.Cartesian3(-Q.x+ae,-Q.y+de,0+he),De=c.Matrix4.fromTranslation(ge),Re=c.Matrix4.clone(De);c.Matrix4.multiply(S,Re,Re);const We=c.Cartesian3.fromDegrees(re.longitude/Math.PI*180,re.latitude/Math.PI*180,v.height),Ve=c.Transforms.eastNorthUpToFixedFrame(We);c.Matrix4.multiply(Ve,Re,Ve);const et=c.Cartographic.fromCartesian(new c.Cartesian3(Ve[12],Ve[13],Ve[14]));L.box3.cartographic={longitude:et.longitude/Math.PI*180,latitude:et.latitude/Math.PI*180,height:et.height};const $={id:L.uniqueId,billboard:[{theme:"Tag9999",position:[L.box3.cartographic.longitude,L.box3.cartographic.latitude,L.box3.cartographic.height],options:{text:L.name}}]};D.push($)}catch(T){console.warn("Error calculating component position:",T)}})})}catch(F){console.error("getAllComponents error:",F)}return w},u.getAllComponents=u.getAllComponentDetails,u.getComponentInfoList=async E=>{if(!Array.isArray(E))return[];const w=A.getMapTileset(),D=[],F=[],U={};E.forEach(b=>{const x=w[b.modelId]?.leiting?.model?.dbName;x&&b.elementId&&F.push({dbName:x,elementId:b.elementId,modelId:b.modelId})});const R=new Set;if(E.forEach(b=>{const v=w[b.modelId],x=`${b.modelId}_${b.elementId}`;U[x]||v&&v.leiting&&!v.leiting?.node?.nodeExtras&&v.leiting.model?.nodeUrl&&R.add(b.modelId)}),R.size>0&&A._loadNodeDetailsForModel)try{const b=Array.from(R).map(v=>A._loadNodeDetailsForModel(v));await Promise.all(b)}catch(b){console.error("Failed to load node details in getComponentInfoList",b)}try{E.forEach(b=>{const v=b.modelId,x=b.elementId,N=w[v];if(!N||!N.leiting)return;const O=`${v}_${x}`,Q=U[O];let L=null;if(Q)L=Q;else{const T=N.leiting.node?.nodeExtras?.element||N.leiting.node?.nodeExtras;T&&T[x]&&(L=JSON.parse(JSON.stringify(T[x])))}if(L){if(L.elementId=x,L.modelId=v,L.box3&&!L.box3.cartographic)try{const T=N.leiting,S=T.model.formData,G=T.box,Y=G?G.center:{x:0,y:0,z:0},q=c.Quaternion.fromAxisAngle(c.Cartesian3.UNIT_Z,c.Math.toRadians(S.totalRotation||0)),W=c.Matrix4.fromRotationTranslation(c.Matrix3.fromQuaternion(q),new c.Cartesian3(0,0,0)),re=c.Cartesian3.fromDegrees(S.longitude,S.latitude,S.height),ae=c.Transforms.eastNorthUpToFixedFrame(re);c.Matrix4.multiply(ae,W,ae);const de=new c.Cartesian3(Y.x,Y.y,0),he=new c.Cartesian3;c.Matrix4.multiplyByPoint(ae,de,he);const ge=c.Cartographic.fromCartesian(he),De=L.box3?.Center?.x||0,Re=L.box3?.Center?.y||0,We=L.box3?.Center?.z||0,Ve=new c.Cartesian3(-Y.x+De,-Y.y+Re,0+We),et=c.Matrix4.fromTranslation(Ve),$=c.Matrix4.clone(et);c.Matrix4.multiply(W,$,$);const z=c.Cartesian3.fromDegrees(ge.longitude/Math.PI*180,ge.latitude/Math.PI*180,S.height),ee=c.Transforms.eastNorthUpToFixedFrame(z);c.Matrix4.multiply(ee,$,ee);const ke=c.Cartographic.fromCartesian(new c.Cartesian3(ee[12],ee[13],ee[14]));L.box3.cartographic={longitude:ke.longitude/Math.PI*180,latitude:ke.latitude/Math.PI*180,height:ke.height}}catch(T){console.warn("Error calculating component position:",T)}D.push(L)}})}catch(b){console.error("getComponentInfoList processing error:",b)}return D},u.getCptInfos=u.getComponentInfoList,u.baseCompt=g.baseCompt,u.setTeleportTarget=E=>{u.onSetTeleportTarget&&u.onSetTeleportTarget(E)},window.Methods=u}return console.log("methods",u),{Cesium:c,viewer:m,methods:u,menuEvents:l}}function wa(i){return a.getCurrentScope()?(a.onScopeDispose(i),!0):!1}function Ia(i){return typeof i=="function"?i():a.unref(i)}const d2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const h2=Object.prototype.toString,u2=i=>h2.call(i)==="[object Object]",f2=()=>{};function m2(i){return a.getCurrentInstance()}function Yd(i,e=!0,t){m2()?a.onMounted(i,t):e?i():a.nextTick(i)}function ri(i){var e;const t=Ia(i);return(e=t?.$el)!=null?e:t}const Sn=d2?window:void 0;function g2(...i){let e,t,n,s;if(typeof i[0]=="string"||Array.isArray(i[0])?([t,n,s]=i,e=Sn):[e,t,n,s]=i,!e)return f2;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},l=(h,f,m,u)=>(h.addEventListener(f,m,u),()=>h.removeEventListener(f,m,u)),c=a.watch(()=>[ri(e),Ia(s)],([h,f])=>{if(r(),!h)return;const m=u2(f)?{...f}:f;o.push(...t.flatMap(u=>n.map(g=>l(h,u,g,m))))},{immediate:!0,flush:"post"}),d=()=>{c(),r()};return wa(d),d}function p2(){const i=a.ref(!1),e=a.getCurrentInstance();return e&&a.onMounted(()=>{i.value=!0},e),i}function zd(i){const e=p2();return a.computed(()=>(e.value,!!i()))}function jd(i,e={}){const{window:t=Sn}=e,n=zd(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let s;const o=a.ref(!1),r=d=>{o.value=d.matches},l=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",r):s.removeListener(r))},c=a.watchEffect(()=>{n.value&&(l(),s=t.matchMedia(Ia(i)),"addEventListener"in s?s.addEventListener("change",r):s.addListener(r),o.value=s.matches)});return wa(()=>{c(),l(),s=void 0}),o}function A2(i,e,t={}){const{window:n=Sn,...s}=t;let o;const r=zd(()=>n&&"ResizeObserver"in n),l=()=>{o&&(o.disconnect(),o=void 0)},c=a.computed(()=>Array.isArray(i)?i.map(f=>ri(f)):[ri(i)]),d=a.watch(c,f=>{if(l(),r.value&&n){o=new ResizeObserver(e);for(const m of f)m&&o.observe(m,s)}},{immediate:!0,flush:"post"}),h=()=>{l(),d()};return wa(h),{isSupported:r,stop:h}}function y2(i,e={width:0,height:0},t={}){const{window:n=Sn,box:s="content-box"}=t,o=a.computed(()=>{var f,m;return(m=(f=ri(i))==null?void 0:f.namespaceURI)==null?void 0:m.includes("svg")}),r=a.ref(e.width),l=a.ref(e.height),{stop:c}=A2(i,([f])=>{const m=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(n&&o.value){const u=ri(i);if(u){const g=u.getBoundingClientRect();r.value=g.width,l.value=g.height}}else if(m){const u=Array.isArray(m)?m:[m];r.value=u.reduce((g,{inlineSize:A})=>g+A,0),l.value=u.reduce((g,{blockSize:A})=>g+A,0)}else r.value=f.contentRect.width,l.value=f.contentRect.height},t);Yd(()=>{const f=ri(i);f&&(r.value="offsetWidth"in f?f.offsetWidth:e.width,l.value="offsetHeight"in f?f.offsetHeight:e.height)});const d=a.watch(()=>ri(i),f=>{r.value=f?e.width:0,l.value=f?e.height:0});function h(){c(),d()}return{width:r,height:l,stop:h}}function Wd(i={}){const{window:e=Sn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:o=!0}=i,r=a.ref(t),l=a.ref(n),c=()=>{e&&(o?(r.value=e.innerWidth,l.value=e.innerHeight):(r.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight))};if(c(),Yd(c),g2("resize",c,{passive:!0}),s){const d=jd("(orientation: portrait)");a.watch(d,()=>c())}return{width:r,height:l}}function _s(){const{width:i,height:e}=Wd(),t=jd("(pointer: coarse)"),n=a.ref(!1),s=a.ref(!1),o=a.ref(!0),r=a.ref("other"),l=a.ref("other"),c=a.ref("medium"),d=a.ref("portrait"),h=()=>{const g=navigator.userAgent.toLowerCase(),A=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile/i,p=navigator;if("userAgentData"in navigator&&p.userAgentData?.mobile!==void 0)return p.userAgentData.mobile||A.test(g);if(A.test(g))return!0;const y=/windows nt/i.test(g),C=/macintosh|mac os x/i.test(g)&&!/mobile/i.test(g),I=/linux/i.test(g)&&!/android/i.test(g);return!1},f=()=>{const g=navigator.userAgent.toLowerCase();n.value=h(),s.value=i.value>=768&&i.value<1024&&t.value,o.value=!n.value,/iphone|ipad|ipod/i.test(g)?r.value="ios":/android/i.test(g)?r.value="android":/win/i.test(g)?r.value="windows":/mac/i.test(g)?r.value="macos":/linux/i.test(g)&&(r.value="linux"),/safari/i.test(g)&&!/chrome/i.test(g)?l.value="safari":/chrome/i.test(g)?l.value="chrome":/firefox/i.test(g)?l.value="firefox":/edge/i.test(g)&&(l.value="edge"),i.value<576?c.value="small":i.value<1024?c.value="medium":c.value="large",d.value=i.value>e.value?"landscape":"portrait"},m=()=>{f()};a.onMounted(()=>{f(),window.addEventListener("resize",m),window.addEventListener("orientationchange",m)}),a.onUnmounted(()=>{window.removeEventListener("resize",m),window.removeEventListener("orientationchange",m)});const u=()=>({isMobile:n.value,isTablet:s.value,isDesktop:o.value,isTouchDevice:t.value,os:r.value,browser:l.value,screenSize:c.value,orientation:d.value});return{isMobile:a.readonly(n),isTablet:a.readonly(s),isDesktop:a.readonly(o),isTouchDevice:a.readonly(t),os:a.readonly(r),browser:a.readonly(l),screenSize:a.readonly(c),orientation:a.readonly(d),width:i,height:e,info:u}}const E2={class:"title"},C2={class:"actions"},v2={class:"card-body"},b2=a.defineComponent({__name:"LeitingDraggableCard",props:{visible:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},title:{type:String,default:"Title"},initialPosition:{type:Object,default:()=>({x:0,y:0})},width:{type:[Number,String],default:300},minWidth:{type:Number,default:200},fullHeight:{type:Boolean,default:!1},align:{type:String,default:""}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=a.inject("leiting-theme",a.ref("dark")),{isMobile:s}=_s(),o=e,r=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:B=>{o("update:visible",B),o("update:open",B)}}),l=a.ref(null),c=a.ref(t.initialPosition?.x||0),d=a.ref(t.initialPosition?.y||0),h=a.ref(t.width),f=a.ref(t.fullHeight?"100%":"600px");a.watch(()=>t.fullHeight,B=>{B?f.value="100%":f.value==="100%"&&(f.value="600px")});const{height:m}=Wd();a.watch(m,()=>{t.fullHeight&&(f.value="100%")});const u=a.ref(!1),g=B=>{u.value=!0,B.preventDefault(),B.stopPropagation();const _=B.clientX,E=B.clientY,w=typeof h.value=="number"?h.value:l.value?.offsetWidth||0,D=typeof f.value=="number"?f.value:l.value?.offsetHeight||0,F=R=>{if(!u.value)return;R.preventDefault();const b=R.clientX-_,v=R.clientY-E,x=w+b,N=D+v;x>100&&(h.value=x),N>100&&(f.value=N)},U=()=>{u.value=!1,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",U)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",U)},A=a.computed(()=>({left:`${c.value}px`,top:`${d.value}px`,width:typeof h.value=="number"?`${h.value}px`:h.value,height:typeof f.value=="number"?`${f.value}px`:f.value,position:"absolute",zIndex:2e3})),p=()=>{a.nextTick(()=>{if(l.value){const B=l.value.offsetParent||document.body,_=B.clientWidth,E=B.clientHeight,w=typeof h.value=="number"?h.value:l.value.offsetWidth||350,D=typeof f.value=="number"?f.value:l.value.offsetHeight||600;c.value+w>_&&(c.value=Math.max(0,_-w-20)),d.value+D>E&&(d.value=Math.max(0,E-D-20)),c.value<0&&(c.value=0),d.value<0&&(d.value=0)}})},y=a.ref(!1),C=B=>{if(B.target.closest(".close-btn")||B.target.closest(".actions"))return;y.value=!0,B.preventDefault(),B.stopPropagation();const _=B.clientX,E=B.clientY,w=c.value,D=d.value,F=R=>{if(!y.value)return;R.preventDefault();const b=R.clientX-_,v=R.clientY-E;c.value=w+b,d.value=D+v},U=()=>{y.value=!1,document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",U),p()};document.addEventListener("mousemove",F),document.addEventListener("mouseup",U)},I=()=>{a.nextTick(()=>{if(t.align&&l.value){const B=l.value.offsetParent||document.body,_=typeof h.value=="number"?h.value:l.value.offsetWidth||350;t.align==="right"?c.value=Math.max(0,B.clientWidth-_-20):t.align==="center"&&(c.value=Math.max(0,(B.clientWidth-_)/2))}p()})};a.onMounted(()=>{t.align?I():p()}),a.watch(r,B=>{B&&(t.align?I():p())});const P=()=>{r.value=!1,o("close")},k=B=>{if(B.target.closest(".close-btn")||B.target.closest(".actions")||B.touches.length!==1)return;y.value=!0,B.preventDefault(),B.stopPropagation();const _=B.touches[0],E=_?.clientX??0,w=_?.clientY??0,D=c.value,F=d.value,U=b=>{if(!y.value||b.touches.length!==1)return;b.preventDefault();const v=b.touches[0],x=(v?.clientX??0)-E,N=(v?.clientY??0)-w;c.value=D+x,d.value=F+N},R=()=>{y.value=!1,document.removeEventListener("touchmove",U),document.removeEventListener("touchend",R),p()};document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",R)},M=B=>{if(B.touches.length!==1)return;u.value=!0,B.preventDefault(),B.stopPropagation();const _=B.touches[0],E=_?.clientX??0,w=_?.clientY??0,D=typeof h.value=="number"?h.value:l.value?.offsetWidth||0,F=typeof f.value=="number"?f.value:l.value?.offsetHeight||0,U=b=>{if(!u.value||b.touches.length!==1)return;b.preventDefault();const v=b.touches[0],x=(v?.clientX??0)-E,N=(v?.clientY??0)-w,O=D+x,Q=F+N;O>100&&(h.value=O),Q>100&&(f.value=Q)},R=()=>{u.value=!1,document.removeEventListener("touchmove",U),document.removeEventListener("touchend",R)};document.addEventListener("touchmove",U,{passive:!1}),document.addEventListener("touchend",R)};return(B,_)=>a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref_key:"cardRef",ref:l,class:a.normalizeClass(["draggable-card leiting-scroll",["leiting-theme-"+a.unref(n)]]),style:a.normalizeStyle(A.value)},[a.createElementVNode("div",{ref:"headerRef",class:"card-header",onMousedown:C,onTouchstart:k},[a.createElementVNode("span",E2,a.toDisplayString(i.title),1),a.createElementVNode("div",C2,[a.renderSlot(B.$slots,"header-extra",{},void 0,!0),a.createElementVNode("span",{class:"close-btn",onClick:P},"×")])],544),a.createElementVNode("div",v2,[a.renderSlot(B.$slots,"default",{},void 0,!0)]),a.unref(s)?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:"resize-handle",onMousedown:g,onTouchstart:M},[..._[0]||(_[0]=[a.createElementVNode("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"currentColor"},[a.createElementVNode("path",{d:"M10 10 L10 2 L2 10 Z"})],-1)])],32))],6)),[[a.vShow,r.value]])}}),be=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},je=be(b2,[["__scopeId","data-v-4d38393b"]]);function $d(i){const e=a.ref([]),t=a.ref([]),n=a.ref([]),s=a.ref(""),o=a.ref(!0);a.watch(()=>a.unref(i),f=>{if(!f||f.length===0)return;const m=[],u=(p,y)=>{p.forEach(C=>{const I=C.id||C.key||C.$id,P=C.modelId||y;P&&(C.modelId=P),I&&m.push(I),C.children&&C.children.length>0&&u(C.children,P)})};u(f);const g=new Set(n.value);let A=!1;m.forEach(p=>{g.has(p)||(g.add(p),A=!0)}),A&&(n.value=Array.from(g))},{immediate:!0,deep:!0});const r=a.computed(()=>{const f=a.unref(i);if(!f)return[];const m=[],u=(g,A)=>{g.forEach(p=>{const y=p.id||p.key||p.$id,C=p.name||p.title;m.push({key:y,title:C,parentKey:A}),p.children&&p.children.length>0&&u(p.children,y)})};return u(f),m}),l=f=>{e.value=f,o.value=!1},c=f=>{n.value=f},d=f=>{t.value=f},h=f=>r.value.find(u=>u.key===f)?.parentKey;return a.watch(s,f=>{if(!f)return;const u=r.value.filter(A=>A.title&&A.title.toLowerCase().includes(f.toLowerCase())).map(A=>A.parentKey),g=new Set;u.forEach(A=>{let p=A;for(;p;)g.add(p),p=h(p)}),e.value=[...g],o.value=!0}),{expandedKeys:e,selectedKeys:t,checkedKeys:n,searchValue:s,autoExpandParent:o,onExpand:l,onCheck:c,onSelect:d}}const w2={class:"search-box"},I2={key:0},S2={style:{color:"#f50"}},x2={key:1},M2={key:1,class:"empty-tip"},Ds=be(a.defineComponent({__name:"LeitingTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"构件树"},width:{type:[Number,String],default:320},treeData:{type:Array,default:()=>[]},initialPosition:{type:Object,default:()=>({x:0,y:0})},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close","select","check"],setup(i,{emit:e}){const t=se.Input.Search,n=se.Tree,s=i,o=e,r=a.inject("leiting-theme",a.ref("dark")),l=a.inject("leitingMethods"),c=w=>{l?.value?.onSearchComponent&&l.value.onSearchComponent(w)},d=a.computed({get:()=>s.open!==void 0?s.open:s.visible,set:w=>{o("update:visible",w),o("update:open",w)}}),h=a.ref(null),{height:f}=y2(h),m=a.computed(()=>f.value||300),u=a.ref({children:"children",title:"name",key:"id"}),g=a.ref([]),{expandedKeys:A,selectedKeys:p,checkedKeys:y,searchValue:C,autoExpandParent:I}=$d(a.toRef(s,"treeData")),P=(w,D)=>{if(!D)return w;const F=D.toLowerCase();return w.reduce((U,R)=>{const v=(R.name||R.title||"").toLowerCase().includes(F);if(R.children&&R.children.length>0){const x=P(R.children,D);(x.length>0||v)&&U.push({...R,children:x})}else v&&U.push({...R});return U},[])};a.watch([()=>s.treeData,C],([w,D])=>{w?g.value=P(w,D||""):g.value=[]},{immediate:!0,deep:!0});const k=w=>{A.value=w,I.value=!1},M=w=>{const D=[],F=U=>{if(!U.children||U.children.length===0){const b=U.element_Id;U.modelId&&b&&D.push({modelId:U.modelId,elementId:b})}else U.children.forEach(F)};return F(w),D},B=(w,D)=>{y.value=w,o("check",w,D);const F=[],U=new Set(w.map(b=>String(b))),R=b=>{for(let v=0;v<b.length;v++){const x=b[v];if(!x.children||x.children.length===0){if(!U.has(String(x.id))){const Q=x.element_Id;x.modelId&&Q&&F.push({modelId:x.modelId,elementId:Q,show:!1})}}else x.children&&R(x.children)}};s.treeData&&R(s.treeData),l?.value?.setComponentVisibility&&l.value.setComponentVisibility(F),l?.value?.onTreeCheck&&l.value.onTreeCheck(w,D)},_=(w,D)=>{if(p.value=w,o("select",w,D),D.selected){const F=M(D.node);F.length>0&&l?.value?.flyToObjects&&l.value.flyToObjects({selectCpts:F})}l?.value?.onTreeSelect&&l.value.onTreeSelect(w,D)},E=()=>{o("update:visible",!1),o("close")};return(w,D)=>(a.openBlock(),a.createBlock(je,{visible:d.value,"onUpdate:visible":D[1]||(D[1]=F=>d.value=F),title:i.title,"initial-position":i.initialPosition,"full-height":i.fullHeight,onClose:E},{default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(["leiting-tree-container",[`theme-${a.unref(r)}`]])},[a.createElementVNode("div",w2,[a.createVNode(a.unref(t),{value:a.unref(C),"onUpdate:value":D[0]||(D[0]=F=>a.isRef(C)?C.value=F:null),placeholder:"搜索构件","allow-clear":"","enter-button":"",onSearch:c},null,8,["value"])]),a.createElementVNode("div",{class:"tree-wrapper",ref_key:"treeWrapperRef",ref:h},[g.value&&g.value.length?(a.openBlock(),a.createBlock(a.unref(n),{key:0,"tree-data":g.value,"field-names":u.value,height:m.value,"expanded-keys":a.unref(A),"auto-expand-parent":a.unref(I),"selected-keys":a.unref(p),"checked-keys":a.unref(y),checkable:"","block-node":"",onExpand:k,onSelect:_,onCheck:B},{title:a.withCtx(({name:F,title:U})=>[(F||U)&&a.unref(C)&&(F||U).toLowerCase().indexOf(a.unref(C).toLowerCase())>-1?(a.openBlock(),a.createElementBlock("span",I2,[a.createTextVNode(a.toDisplayString((F||U).substr(0,(F||U).toLowerCase().indexOf(a.unref(C).toLowerCase())))+" ",1),a.createElementVNode("span",S2,a.toDisplayString(a.unref(C)),1),a.createTextVNode(" "+a.toDisplayString((F||U).substr((F||U).toLowerCase().indexOf(a.unref(C).toLowerCase())+a.unref(C).length)),1)])):(a.openBlock(),a.createElementBlock("span",x2,a.toDisplayString(F||U),1))]),_:1},8,["tree-data","field-names","height","expanded-keys","auto-expand-parent","selected-keys","checked-keys"])):(a.openBlock(),a.createElementBlock("div",M2,"暂无数据"))],512)],2)]),_:1},8,["visible","title","initial-position","full-height"]))}}),[["__scopeId","data-v-3748c20d"]]),B2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",ks="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAERSURBVDhPvZTrEYIwEISTCrQD6EA7gA60AylBK1Aq0A7ECrQDoQPsADrACuLuTMJkIiHxjzezgyR7H3d5KJVSqRAigcaQUjYYX2JgZY/P/O4lEgYYFo7pgPcc2kSCBoIUzDeo0klPPEsNYlX7AKzA/M6ASrRzYoIGG5DAOCvzBvzMOxqQazSgLLI1QdAW5jWpUAPV0AVKIc7FRCuNy7RkWozJtj1BED7ANbpDXHhffFXUwUnZwRYp7qw7Rx8/lLkV9R4QD2w1A8pjW3sA4h5au+pXEBS76P8D6Ut9/nXXaiRQdnBXqBfEC+4GdzSxW5v6F7CTeHnbCVCBsWIE+RYVrdF4DSz6OwgiADDexbmT3X0A4fSDfDjUugcAAAAASUVORK5CYII=",T2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",P2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHDSURBVDhPlZOxL0NRFIe9ECubhehoIIjJ1HYwCkIiJpUQEkN1YZBobU0kFKNI3iTGYrDRv0BIhLXCYpCwiO35fs25zWva98JNvpz37j33d8+551yvLWIEQXDG0izMe55XjvJz816MUJG1LVuvYJcQrEb5xwkV2JSHGfAhgBJiu63E4oSUzpRtusa+wBooKkWnKOujQYh7SbCShQx0m9cpds4iOseOw7BFmUPwU341IQT2MaOQgi9QND+wiqNnBxT4X7SIbrAqhNI9wiUvJ+W8A99wDEWdwrw25iVkkenAEb5LkIQPuIMJWJGQoriFd+iBCkhc8zUhfJSm7mva5l3aadubDgtpMgGKpB/eoBfuQZFoPNhBj9gTaC3kKkEEGXPswF7Y5rLro1AW8UI6GmelmAzfkUWlNaWt6/iT0DOOA5bqoSuzHfIvofATqSJQb8KoiJbtPi6x2dA9FPjXE1F/uZKrv3IwCFcNqVmoPlal7QJ9q/wZCbk7Ioo9/tehE9q1r0nIxNQbG4YEXdkVjQ5J2OZXbB88gVrgQIJNj9aaT4LboPK7J6O0Ktb1KYtc/aYxGff6h3AYY6Nvzk2GQ1WQTVj4BST70jYaqceXAAAAAElFTkSuQmCC",_2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",D2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",Kd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEcSURBVDhPrZSNDYIwEIXpBOIGjMAIOIE4AbgBGwAbOIJu4Aa4gW4gI+gE9b3mjjSmibSR5ALX3H33W4y1Ns+yrIe0EH7HPC8YnyGjAegkEB5cYyiwrdWXIEc1xnSREGcuiTQEWeg7gG4+CMcl9ALnLkvogwScv+wq6FMQJJCJDgBtBcSAI3QClwe2YZAHcY2Ho4kGAVLA6U5/CEvdp4KYhesFhBPpCZIAz6jStHhproJcHyAHbb5nF+6RZ8CsGslIQaHp/gSxRzlApU4GugPxNuDN/eNarAJxapUPgm8rQ9C1SAI9AOGiHhGApSdnRN8FshbEiLwiLI1rMUM6zSQ0tX9c2lp/Iw0iMIPU38iFIN1mTmOjKa98vyWB4QM5XQnvsbFsyAAAAABJRU5ErkJggg==",k2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",N2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",R2={class:"menu-container"},F2=["onClick","title"],L2={class:"menu-icon"},O2=["src","alt"],G2={key:3,style:{"font-size":"12px"}},U2={key:0,class:"sub-menu"},V2=["onClick"],xn=a.defineComponent({__name:"LeitingMenu",props:{visible:{type:Boolean,default:!0},activeIds:{type:Array,default:()=>[]},is2d:{type:Boolean,default:!1},customItems:{type:Array,default:()=>[]}},emits:["action"],setup(i,{emit:e}){const t=i,n=a.inject("leiting-theme",a.ref("dark")),s=a.inject("leiting-menu-size",a.ref("medium")),o=a.inject("leitingMethods",a.ref({})),r=a.computed(()=>n.value||n),l=a.computed(()=>s.value||s),c=a.ref([{ID:"home",title:"主视角",src:B2,key:"homeView"},{ID:"tree",title:"目录树",src:ks,key:"componentTree"},{ID:"cadLayer",title:"图层",src:ks,key:"cadLayer"},{ID:"gisCadPosition",title:"GIS调整",src:Kd,key:"gisCadPosition"},{ID:"measure",title:"量算",src:T2,key:"measurement"},{ID:"section",title:"剖切",src:P2,key:"section"},{ID:"roam",title:"人物漫游",src:_2,key:"roam"},{ID:"info",title:"构件信息",src:D2,key:"componentInfo"},{ID:"cadPosition",title:"调整位置",src:Kd,key:"cadPosition"},{ID:"annotation",title:"标注",src:N2,key:"annotation"},{ID:"setting",title:"设置",src:k2,key:"setting"}]),d=a.ref([]),h=a.ref([...t.activeIds]);a.watch(()=>t.activeIds,P=>{h.value=[...P]},{deep:!0});const f=a.computed(()=>t.visible);o.value&&o.value.menuEvents&&(o.value.menuEvents.on("setMenuListFilter",P=>{d.value=P}),o.value.menuEvents.on("setMenuActive",(P,k)=>{k?h.value.includes(P)||h.value.push(P):h.value=h.value.filter(M=>M!==P)}));const m=a.computed(()=>{let P=c.value;if(t.is2d){const k=["homeView","measurement","cadLayer","gisCadPosition","annotation"];P=P.filter(M=>M.key&&k.includes(M.key))}else{const k=["cadLayer","cadPosition","gisCadPosition","annotation"];P=P.filter(M=>!M.key||!k.includes(M.key))}if(d.value.length>0&&(P=P.filter(k=>!k.key||!d.value.includes(k.key))),t.customItems&&t.customItems.length>0){const k=t.customItems.map(M=>({...M,key:M.ID,src:M.src||M.icon}));return[...P,...k]}return P}),u=e,g=P=>{const k=["homeView"];if(P.key&&k.includes(P.key))h.value.includes(P.ID)||(h.value.push(P.ID),setTimeout(()=>{const B=h.value.indexOf(P.ID);B>-1&&h.value.splice(B,1)},1e3));else{const B=h.value.indexOf(P.ID);B>-1?h.value.splice(B,1):h.value.push(P.ID)}const M=h.value.includes(P.ID);P.func&&P.func(P),P.key&&u("action",P.key,M)},A=P=>{d.value=P},p=P=>{console.log("LeitingMenu received showMenu event:",P)},y=(P,k)=>{const M=m.value.find(B=>B.ID===P||B.key===P);if(M){const B=h.value.indexOf(M.ID);k&&B===-1?h.value.push(M.ID):!k&&B>-1&&h.value.splice(B,1)}};let C=null;const I=()=>{o.value?.menuEvents&&(C&&(C.off("setMenuListFilter",A),C.off("showMenu",p),C.off("setMenuActive",y)),C=o.value.menuEvents,C.on("setMenuListFilter",A),C.on("showMenu",p),C.on("setMenuActive",y))};return a.onMounted(()=>{I()}),a.onUnmounted(()=>{C&&(C.off("setMenuListFilter",A),C.off("showMenu",p),C.off("setMenuActive",y))}),a.watch(o,()=>{I()},{deep:!0}),(P,k)=>a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["leiting-menu-wrapper",["leiting-theme-"+r.value,"size-"+l.value]])},[a.createElementVNode("div",R2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value,M=>(a.openBlock(),a.createElementBlock("div",{key:M.ID,class:a.normalizeClass(["menu-item",{active:h.value.includes(M.ID)}]),onClick:B=>g(M),title:M.title},[a.createElementVNode("div",L2,[M.src?(a.openBlock(),a.createElementBlock("img",{key:0,src:M.src,alt:M.title},null,8,O2)):typeof M.icon=="object"?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(M.icon),{key:1})):typeof M.icon=="string"?(a.openBlock(),a.createElementBlock("i",{key:2,class:a.normalizeClass(["iconfont",`icon-${M.icon}`])},null,2)):(a.openBlock(),a.createElementBlock("span",G2,a.toDisplayString(M.title.substring(0,2)),1))]),M.children&&M.children.length>0?(a.openBlock(),a.createElementBlock("div",U2,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(M.children,B=>(a.openBlock(),a.createElementBlock("div",{key:B.ID,class:a.normalizeClass(["sub-menu-item",{active:h.value.includes(B.ID)}]),onClick:a.withModifiers(_=>g(B),["stop"])},a.toDisplayString(B.title),11,V2))),128))])):a.createCommentVNode("",!0)],10,F2))),128))])],2)),[[a.vShow,f.value]])}}),Q2={class:"leiting-section-content"},H2={class:"section-form-item"},Y2={class:"radio-group"},z2={class:"section-form-item"},j2={class:"switch-container"},W2={class:"switch"},$2={class:"status-text"},K2={class:"section-form-item slider-item"},q2={class:"slider-wrapper"},X2={class:"section-form-item slider-item"},J2={class:"slider-wrapper"},Z2={class:"section-form-item slider-item"},eI={class:"slider-wrapper"},tI={class:"section-form-item table-item"},iI={class:"model-table-container"},nI={class:"model-table"},sI={width:"40"},oI=["checked"],aI=["onClick"],rI=["value"],lI={class:"model-name"},Mn=be(a.defineComponent({__name:"LeitingSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"剖切控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:R=>{n("update:visible",R),n("update:open",R)}}),r=a.ref("Box"),l=a.ref(!1),c=a.ref([]),d=a.ref([]),h=a.computed(()=>d.value.length===0?!1:d.value.every(R=>c.value.includes(R.modelId))),f=R=>{R.target.checked?c.value=d.value.map(v=>v.modelId):c.value=[],E()},m=a.ref([-10,10]),u=a.ref([-10,10]),g=a.ref([-10,10]),A=a.ref([-100,100]),p=a.ref([-100,100]),y=a.ref([-100,100]);let C=!1;const I=R=>{C=!0;const{targetZPlus:b,targetZMinus:v,targetXPlus:x,targetXMinus:N,targetYPlus:O,targetYMinus:Q}=R;g.value=[-v,b],m.value=[-N,x],u.value=[-Q,O],setTimeout(()=>{C=!1},100)},P=()=>{C||c.value.length===0||!s?.value?.updateSectionRange||s.value.updateSectionRange({targetZPlus:g.value[1],targetZMinus:-g.value[0],targetXPlus:m.value[1],targetXMinus:-m.value[0],targetYPlus:u.value[1],targetYMinus:-u.value[0]})},k=()=>{s?.value?.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)},M=R=>{if(!s?.value?.getMapTileset||!s?.value?.openSection)return;const v=s.value.getMapTileset()[R];if(v&&v.leiting?.box){const{min:x,max:N}=v.leiting.box,O=(N.x-x.x)/2,Q=(N.y-x.y)/2,L=(N.z-x.z)/2;c.value.length<=1&&(A.value=[-O*2,O*2],p.value=[-Q*2,Q*2],y.value=[-L*2,L*2],m.value=[-O,O],u.value=[-Q,Q],g.value=[-L,L],s.value.updateSectionRange&&s.value.updateSectionRange({targetZPlus:L,targetZMinus:L,targetXPlus:O,targetXMinus:O,targetYPlus:Q,targetYMinus:Q})),s.value.openSection(R,{moveCallBack:I}),s.value.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)}},B=R=>{const b=c.value.indexOf(R);b>-1?c.value.splice(b,1):c.value.push(R),E()};let _=[];const E=()=>{const R=c.value.filter(v=>!_.includes(v)),b=_.filter(v=>!c.value.includes(v));R.forEach(v=>M(v)),b.forEach(v=>{s?.value?.closeSection&&s.value.closeSection(v)}),_=[...c.value]},w=()=>{},D=()=>{o.value=!1,n("close")},F=()=>{l.value=!1,c.value=[],_=[],m.value=[-10,10],u.value=[-10,10],g.value=[-10,10],A.value=[-100,100],p.value=[-100,100],y.value=[-100,100]};a.watch(()=>t.visible,R=>{R?U():(s?.value?.closeSection&&s.value.closeSection(),F())});const U=()=>{s?.value&&typeof s.value.getModelList=="function"&&(d.value=s.value.getModelList()||[],d.value.length>0&&c.value.length===0&&(c.value=[d.value[0].modelId],_=[...c.value]),t.visible&&c.value.length>0&&(l.value=!0,c.value.forEach(R=>M(R))))};return a.watch(()=>s?.value,()=>{U()},{immediate:!0,deep:!0}),a.onMounted(()=>{U()}),(R,b)=>(a.openBlock(),a.createBlock(je,{visible:o.value,title:"剖切分析","full-height":i.fullHeight,"onUpdate:visible":D},{default:a.withCtx(()=>[a.createElementVNode("div",Q2,[a.createElementVNode("div",H2,[b[8]||(b[8]=a.createElementVNode("span",{class:"label"},"模式",-1)),a.createElementVNode("div",Y2,[a.createElementVNode("label",{class:a.normalizeClass(["radio-item",{active:r.value==="Box"}])},[a.withDirectives(a.createElementVNode("input",{type:"radio",value:"Box","onUpdate:modelValue":b[0]||(b[0]=v=>r.value=v),onChange:w},null,544),[[a.vModelRadio,r.value]]),b[7]||(b[7]=a.createTextVNode(" 剖切盒 ",-1))],2)])]),a.createElementVNode("div",z2,[b[10]||(b[10]=a.createElementVNode("span",{class:"label"},"显示",-1)),a.createElementVNode("div",j2,[a.createElementVNode("label",W2,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":b[1]||(b[1]=v=>l.value=v),onChange:k},null,544),[[a.vModelCheckbox,l.value]]),b[9]||(b[9]=a.createElementVNode("span",{class:"slider round"},null,-1))]),a.createElementVNode("span",$2,a.toDisplayString(l.value?"显示":"隐藏"),1)])]),a.createElementVNode("div",K2,[b[11]||(b[11]=a.createElementVNode("span",{class:"label"},"X 轴",-1)),a.createElementVNode("div",q2,[a.createVNode(a.unref(se.Slider),{value:m.value,"onUpdate:value":b[2]||(b[2]=v=>m.value=v),range:"",min:A.value[0],max:A.value[1],step:.1,onChange:P},null,8,["value","min","max"])])]),a.createElementVNode("div",X2,[b[12]||(b[12]=a.createElementVNode("span",{class:"label"},"Y 轴",-1)),a.createElementVNode("div",J2,[a.createVNode(a.unref(se.Slider),{value:u.value,"onUpdate:value":b[3]||(b[3]=v=>u.value=v),range:"",min:p.value[0],max:p.value[1],step:.1,onChange:P},null,8,["value","min","max"])])]),a.createElementVNode("div",Z2,[b[13]||(b[13]=a.createElementVNode("span",{class:"label"},"Z 轴",-1)),a.createElementVNode("div",eI,[a.createVNode(a.unref(se.Slider),{value:g.value,"onUpdate:value":b[4]||(b[4]=v=>g.value=v),range:"",min:y.value[0],max:y.value[1],step:.1,onChange:P},null,8,["value","min","max"])])]),a.createElementVNode("div",tI,[b[15]||(b[15]=a.createElementVNode("span",{class:"label"},"模型",-1)),a.createElementVNode("div",iI,[a.createElementVNode("table",nI,[a.createElementVNode("thead",null,[a.createElementVNode("tr",null,[a.createElementVNode("th",sI,[a.createElementVNode("input",{type:"checkbox",checked:h.value,onChange:f},null,40,oI)]),b[14]||(b[14]=a.createElementVNode("th",null,"名称",-1))])]),a.createElementVNode("tbody",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,v=>(a.openBlock(),a.createElementBlock("tr",{key:v.modelId,class:a.normalizeClass({selected:c.value.includes(v.modelId)}),onClick:x=>B(v.modelId)},[a.createElementVNode("td",null,[a.withDirectives(a.createElementVNode("input",{type:"checkbox",value:v.modelId,"onUpdate:modelValue":b[5]||(b[5]=x=>c.value=x),onClick:b[6]||(b[6]=a.withModifiers(()=>{},["stop"])),onChange:E},null,40,rI),[[a.vModelCheckbox,c.value]])]),a.createElementVNode("td",lI,a.toDisplayString(v.modelName),1)],10,aI))),128))])])])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-ee4d9a12"]]),cI={class:"leiting-player-content"},dI={class:"player-form-item"},hI={class:"switch-container"},uI={class:"switch"},fI={class:"status-text"},mI={class:"player-form-item"},gI={class:"switch-container"},pI={class:"switch"},AI={class:"status-text"},yI={class:"player-form-item"},EI={class:"switch-container"},CI={class:"switch"},vI={class:"status-text"},bI={class:"player-form-item slider-item"},wI={class:"slider-wrapper"},II={class:"value-text"},SI={class:"instructions"},xI={class:"key-map"},MI={class:"key-row"},BI={class:"key-row"},TI={class:"key-row"},PI={class:"key-row"},_I={class:"key-row"},DI={class:"key-row"},Bn=be(a.defineComponent({__name:"LeitingPlayer",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"漫游控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref(!1),r=a.ref(!1),l=a.ref(!0),c=a.ref(5),d=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:M=>{n("update:visible",M),n("update:open",M)}}),h=a.ref(null),f=a.ref(null),m=a.ref(null),u=a.ref(null),g=a.ref(null),A=a.ref(null),p=()=>{o.value?C():I()},y=()=>{s?.value?.setPlayerParams&&s.value.setPlayerParams({gravityTest:r.value,collisionTest:l.value})},C=async()=>{s?.value?.openPlayer&&(await s.value.openPlayer(),s.value.setPlayerSpeed&&s.value.setPlayerSpeed(c.value),y(),s.value.bindPlayerUiKeys&&(await a.nextTick(),s.value.bindPlayerUiKeys({moveFront:h.value,moveBack:f.value,moveLeft:m.value,moveRight:u.value,moveUp:g.value,moveDown:A.value})))},I=()=>{s?.value?.closePlayer&&s.value.closePlayer()},P=()=>{s?.value?.setPlayerSpeed&&s.value.setPlayerSpeed(c.value)},k=()=>{d.value=!1,n("close")};return a.watch(()=>t.visible,M=>{M?(o.value=!0,s?.value?C():setTimeout(()=>{s?.value&&C()},100)):o.value&&(o.value=!1,I())},{immediate:!0}),(M,B)=>(a.openBlock(),a.createBlock(je,{title:i.title,visible:d.value,"full-height":i.fullHeight,"onUpdate:visible":k},{default:a.withCtx(()=>[a.createElementVNode("div",cI,[a.createElementVNode("div",dI,[B[5]||(B[5]=a.createElementVNode("span",{class:"label"},"启用",-1)),a.createElementVNode("div",hI,[a.createElementVNode("label",uI,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[0]||(B[0]=_=>o.value=_),onChange:p},null,544),[[a.vModelCheckbox,o.value]]),B[4]||(B[4]=a.createElementVNode("span",{class:"slider round"},null,-1))]),a.createElementVNode("span",fI,a.toDisplayString(o.value?"开启":"关闭"),1)])]),a.createElementVNode("div",mI,[B[7]||(B[7]=a.createElementVNode("span",{class:"label"},"重力",-1)),a.createElementVNode("div",gI,[a.createElementVNode("label",pI,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[1]||(B[1]=_=>r.value=_),onChange:y},null,544),[[a.vModelCheckbox,r.value]]),B[6]||(B[6]=a.createElementVNode("span",{class:"slider round"},null,-1))]),a.createElementVNode("span",AI,a.toDisplayString(r.value?"开启":"关闭"),1)])]),a.createElementVNode("div",yI,[B[9]||(B[9]=a.createElementVNode("span",{class:"label"},"碰撞",-1)),a.createElementVNode("div",EI,[a.createElementVNode("label",CI,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[2]||(B[2]=_=>l.value=_),onChange:y},null,544),[[a.vModelCheckbox,l.value]]),B[8]||(B[8]=a.createElementVNode("span",{class:"slider round"},null,-1))]),a.createElementVNode("span",vI,a.toDisplayString(l.value?"开启":"关闭"),1)])]),a.createElementVNode("div",bI,[B[10]||(B[10]=a.createElementVNode("span",{class:"label"},"速度",-1)),a.createElementVNode("div",wI,[a.createVNode(a.unref(se.Slider),{value:c.value,"onUpdate:value":B[3]||(B[3]=_=>c.value=_),min:1,max:10,step:1,onChange:P},null,8,["value"])]),a.createElementVNode("span",II,a.toDisplayString(c.value),1)]),B[19]||(B[19]=a.createElementVNode("div",{class:"divider"},null,-1)),a.createElementVNode("div",SI,[B[18]||(B[18]=a.createElementVNode("div",{class:"instruction-title"},"操作说明",-1)),a.createElementVNode("div",xI,[a.createElementVNode("div",MI,[a.createElementVNode("span",{class:"key",ref_key:"btnFront",ref:h},"W",512),B[11]||(B[11]=a.createTextVNode(" 前进 ",-1))]),a.createElementVNode("div",BI,[a.createElementVNode("span",{class:"key",ref_key:"btnBack",ref:f},"S",512),B[12]||(B[12]=a.createTextVNode(" 后退 ",-1))]),a.createElementVNode("div",TI,[a.createElementVNode("span",{class:"key",ref_key:"btnLeft",ref:m},"A",512),B[13]||(B[13]=a.createTextVNode(" 左移 ",-1))]),a.createElementVNode("div",PI,[a.createElementVNode("span",{class:"key",ref_key:"btnRight",ref:u},"D",512),B[14]||(B[14]=a.createTextVNode(" 右移 ",-1))]),a.createElementVNode("div",_I,[a.createElementVNode("span",{class:"key",ref_key:"btnUp",ref:g},"Q",512),B[15]||(B[15]=a.createTextVNode(" 上升 ",-1))]),a.createElementVNode("div",DI,[a.createElementVNode("span",{class:"key",ref_key:"btnDown",ref:A},"E",512),B[16]||(B[16]=a.createTextVNode(" 下降 ",-1))]),B[17]||(B[17]=a.createElementVNode("div",{class:"key-row"},[a.createElementVNode("span",{class:"mouse-icon"},"🖱️"),a.createTextVNode(" 按住左键拖拽旋转视角 ")],-1))])])])]),_:1},8,["title","visible","full-height"]))}}),[["__scopeId","data-v-ff3f266e"]]),kI={class:"info-content"},NI={key:0,class:"component-title"},Tn=be(a.defineComponent({__name:"LeitingInfo",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref([]),r=a.ref(!1),l=a.ref([]),c=a.ref([]),d=a.ref(0),h=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:y=>{n("update:visible",y),n("update:open",y)}}),f=()=>{h.value=!1},m=y=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[y]||y,u=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],g=async y=>{const C=++d.value;if(c.value=y,!y||y.length===0){o.value=[];return}if(!h.value)return;let I=y;y.length>10&&(ce.warning(`选中构件数量过多(${y.length}个),仅显示前10个`),I=y.slice(0,10));const P=s?.value;let k=P?.getMapTileset?P.getMapTileset():{};r.value=!0;const M=[],B={};I.forEach(w=>{const F=k[w.modelId]?.leiting?.model?.dbName;F&&w.elementId&&M.push({dbName:F,elementId:w.elementId,modelId:w.modelId})});const _=new Set;if(I.forEach(w=>{const D=k[w.modelId],F=`${w.modelId}_${w.elementId}`;B[F]||D&&D.leiting&&!D.leiting?.node?.nodeExtras&&D.leiting.model?.nodeUrl&&_.add(w.modelId)}),_.size>0&&P?._loadNodeDetailsForModel)try{const w=Array.from(_).map(D=>P._loadNodeDetailsForModel(D));await Promise.all(w)}catch(w){console.error("Failed to load node details",w)}if(C!==d.value)return;k=P?.getMapTileset?P.getMapTileset():{};const E=[];I.forEach((w,D)=>{const U=k[w.modelId]?.leiting||{},R=B[`${w.modelId}_${w.elementId}`];let b={modelName:U.model?.modelId||w.modelId};b.elementID||(b.elementID=w.elementId);let v=null;if(R)v=R;else{const O=U.node?.nodeExtras?.element||U.node?.nodeExtras;if(O){const Q=b.elementID;O[Q]&&(v=O[Q])}}v&&v.box3&&(b.length=`${v.box3.length?.toFixed(2)||0}米`,b.width=`${v.box3.width?.toFixed(2)||0}米`,b.height=`${v.box3.height?.toFixed(2)||0}米`);const x=[];v&&(v.name&&(b.elementName=v.name),v.categoryName&&(b.categoryName=v.categoryName),v.familySymbolName&&(b.familySymbolName=v.familySymbolName),v.levelName&&(b.levelName=v.levelName));const N={};if(u.forEach(O=>{b[O]!==void 0&&(N[O]=b[O])}),x.push({name:"基础信息",params:N}),v){const O=Array.isArray(v)?v:Array.isArray(v?.parameters)?v.parameters:null;if(O){if(O.flat().forEach(L=>{if(L&&L.GroupName&&Array.isArray(L.Parameters)){const T={};L.Parameters.forEach(S=>{S.name&&(T[S.name]=S.value??"")}),Object.keys(T).length>0&&x.push({name:L.GroupName,params:T})}}),!Array.isArray(v)){const{parameters:L,...T}=v,S={};Object.keys(T).forEach(G=>{!u.includes(G)&&G!=="uniqueId"&&typeof T[G]!="object"&&(S[G]=T[G])}),Object.keys(S).length>0&&x.push({name:"其他属性",params:S})}}else{let Q=!1;if(Object.keys(v).forEach(L=>{v[L]&&typeof v[L]=="object"&&!Array.isArray(v[L])&&(Q=!0,x.push({name:L,params:v[L]}))}),!Q){const L={};Object.keys(v).forEach(T=>{if(!u.includes(T)&&T!=="batchId"){const S=v[T];typeof S=="string"&&S.length>500?L[T]=S.substring(0,500)+"...":L[T]=S}}),Object.keys(L).length>0&&x.push({name:"属性",params:L})}}}E.push({id:D,title:`${b.modelName}${b.elementName?` - ${b.elementName}`:""}`,groups:x})}),o.value=E,C===d.value&&(r.value=!1),E.length>0?l.value=[`${E[0].id}-基础信息`]:l.value=[]};let A=!1;const p=()=>{if(A)return;const y=s?.value;y&&y.selectionChange&&(y.selectionChange(g),A=!0)};return a.watch(()=>s?.value,()=>{p()},{deep:!0,immediate:!0}),a.watch(h,y=>{y&&c.value.length>0&&g(c.value)}),a.onMounted(()=>{p()}),(y,C)=>(a.openBlock(),a.createBlock(je,{visible:h.value,title:"构件详情",width:350,align:"right","initial-position":{x:0,y:0},"full-height":i.fullHeight,onClose:f,"onUpdate:visible":C[1]||(C[1]=I=>h.value=I),class:"base-info-card"},{default:a.withCtx(()=>[a.createElementVNode("div",kI,[a.createVNode(a.unref(se.Spin),{spinning:r.value},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,I=>(a.openBlock(),a.createElementBlock("div",{key:I.id,class:"component-block"},[o.value.length>1?(a.openBlock(),a.createElementBlock("div",NI,a.toDisplayString(I.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(se.Collapse),{activeKey:l.value,"onUpdate:activeKey":C[0]||(C[0]=P=>l.value=P),ghost:"","expand-icon-position":"end"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(I.groups,P=>(a.openBlock(),a.createBlock(a.unref(se.CollapsePanel),{key:`${I.id}-${P.name}`,header:P.name},{default:a.withCtx(()=>[a.createVNode(a.unref(se.Descriptions),{size:"small",bordered:"",column:1,labelStyle:{width:"100px",background:"rgba(255,255,255,0.05)",color:"#aaa"},contentStyle:{color:"#fff"}},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(P.params,(k,M)=>(a.openBlock(),a.createBlock(a.unref(se.DescriptionsItem),{key:M,label:m(String(M))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(k),1)]),_:2},1032,["label"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128))]),_:2},1032,["activeKey"])]))),128))]),_:1},8,["spinning"])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-375a1f55"]]);class Sa{viewer;Cesium;pickHandler=null;bimEntityId="";mapEntityId="";constructor(e,t){this.viewer=e,this.Cesium=t}removeMarker(e){if(!this.viewer)return;const t=e==="BIM"?this.bimEntityId:this.mapEntityId;t&&(this.viewer.entities.removeById(t),e==="BIM"?this.bimEntityId="":this.mapEntityId="")}clearMarkers(){this.removeMarker("BIM"),this.removeMarker("MAP")}addMarker(e,t){if(!this.viewer||!this.Cesium)return;this.removeMarker(e);const n=`adjust-marker-${e}-${Date.now()}`;e==="BIM"?this.bimEntityId=n:this.mapEntityId=n,this.viewer.entities.add({id:n,position:this.Cesium.Cartesian3.fromDegrees(t.longitude,t.latitude,t.height),point:{pixelSize:10,color:e==="BIM"?this.Cesium.Color.RED:this.Cesium.Color.ORANGE,outlineColor:this.Cesium.Color.WHITE,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:`${e==="BIM"?"BIM":"地图"}标记点`,font:"14pt sans-serif",style:this.Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:new this.Cesium.Cartesian2(0,-10),fillColor:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLACK,backgroundColor:new this.Cesium.Color(.1,.1,.1,.8),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}registerPickHandler(e){this.destroyPickHandler(),!(!this.Cesium||!this.viewer)&&(this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pickHandler.setInputAction(t=>{let n;try{n=this.viewer.scene.pickPosition(t.position)}catch(s){console.warn("pickPosition failed:",s)}if(!n){const s=this.viewer.camera.getPickRay(t.position);n=this.viewer.scene.globe.pick(s,this.viewer.scene)}if(n||(n=this.viewer.camera.pickEllipsoid(t.position,this.viewer.scene.globe.ellipsoid)),n){const s=this.Cesium.Cartographic.fromCartesian(n),o=this.Cesium.Math.toDegrees(s.longitude),r=this.Cesium.Math.toDegrees(s.latitude),l=s.height;e({longitude:o,latitude:r,height:l})}},this.Cesium.ScreenSpaceEventType.LEFT_CLICK,this.Cesium.KeyboardEventModifier.SHIFT))}destroyPickHandler(){this.pickHandler&&(this.pickHandler.destroy(),this.pickHandler=null)}calculateOffset(e,t){return{dLon:t.longitude-e.longitude,dLat:t.latitude-e.latitude,dHeight:t.height-e.height}}}const RI={class:"adjust-panel"},FI={class:"control-panel"},LI={class:"form-item"},OI={class:"radio-group"},GI={class:"form-item"},UI={class:"radio-group"},VI={class:"form-item"},QI={class:"value"},HI={class:"param-row"},YI={class:"param-row"},zI={class:"param-row"},jI={class:"param-row"},WI={class:"param-row"},$I={class:"param-row"},KI={class:"param-row"},qI={class:"button-grid"},XI={key:1,class:"pick-mode-ui"},JI={class:"form-item",style:{display:"block","margin-bottom":"15px"}},ZI={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},eS=["checked"],tS={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},iS={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},nS={class:"form-item",style:{display:"block","margin-bottom":"15px"}},sS={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},oS=["checked"],aS={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},rS={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},lS={class:"list-panel"},cS={class:"list-header"},dS={class:"col-check"},hS=["checked"],uS={class:"list-body"},fS={class:"col-check"},mS=["onUpdate:modelValue"],gS={class:"col-index"},pS=["title"],AS={class:"col-main"},yS=["checked","onChange"],Pn=be(a.defineComponent({__name:"LeitingPosition",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=a.computed({get:()=>n.open!==void 0?n.open:n.visible,set:L=>{s("update:visible",L),s("update:open",L)}}),r=a.inject("leitingMethods"),l=a.ref("BIM"),c=a.ref("param"),d=a.ref(""),h=a.ref([]),f=a.ref("BIM"),m=a.ref(null),u=a.ref(null),g=a.ref(null),A=()=>(!g.value&&r?.value?.getViewer&&r?.value?.getCesium&&(g.value=new Sa(r.value.getViewer(),r.value.getCesium())),g.value),p=()=>{A()?.clearMarkers(),m.value=null,u.value=null},y=(L,T)=>{L==="BIM"?m.value=T:u.value=T,A()?.addMarker(L,T),ce.success(`${L==="BIM"?"BIM":"地图"}标记点已添加`)},C=()=>{A()?.registerPickHandler(L=>{y(f.value,L)})},I=()=>{A()?.destroyPickHandler()},P=()=>{if(!m.value||!u.value){ce.warning("请先选择BIM标记点和地图标记点");return}if(!d.value){ce.warning("请先选择主模型");return}const L=A();let T=0,S=0,G=0;if(L){const{dLon:Y,dLat:q,dHeight:W}=L.calculateOffset(m.value,u.value);T=Y,S=q,G=W}else T=u.value.longitude-m.value.longitude,S=u.value.latitude-m.value.latitude,G=u.value.height-m.value.height;M.value.longitude+=T,M.value.latitude+=S,M.value.height+=G,v(d.value,{longitude:M.value.longitude,latitude:M.value.latitude,height:M.value.height}),ce.success("位置已调整")};a.watch(()=>c.value,L=>{L==="pick"?C():I()}),e({addMarker:y,setModelType:L=>{(L==="BIM"||L==="OSGB")&&(l.value=L)}});const M=a.ref({longitude:0,latitude:0,lonlat:1e-6,heightDistance:1,rotation:30,totalRotation:0,height:0,X:0,Y:0,Z:0}),B=a.computed(()=>{const L=h.value.find(T=>T.modelId===d.value);return L?L.modelName:""}),_=a.computed(()=>w.value.length>0&&w.value.every(L=>L.selected)),E=()=>{o.value=!1,s("close")},w=a.computed(()=>h.value.filter(L=>L.type===l.value)),D=L=>{const T=L.target.checked;w.value.forEach(S=>S.selected=T)},F=()=>{if(!r?.value)return;const L=r.value,T=L.getMapTileset?L.getMapTileset():{},S=[];if(Object.keys(T).forEach(G=>{const q=T[G].leiting||{};q.model&&S.push({modelId:q.model.modelId,modelName:q.model.modelName,selected:!1,formData:q.model.formData||{},dbName:q.model.dbName,url:q.model.url,type:q.model.type||"BIM"})}),h.value=S,S.length>0){const G=L.getBIMmodelId?L.getBIMmodelId():"";G&&S.find(Y=>Y.modelId===G)?R(G):R(S[0].modelId),S.forEach(Y=>Y.selected=!0)}},U=()=>{ce.info("拖动右下角标,可显示模型列表",void 0,2)},R=L=>{d.value=L;const T=h.value.find(S=>S.modelId===L);T&&T.formData&&Object.keys(M.value).forEach(S=>{T.formData[S]!==void 0&&(M.value[S]=T.formData[S])})},b=L=>r?.value?.getMapTileset?r.value.getMapTileset()[L]:null,v=(L,T)=>{const S=b(L),G=r.value.getCesium();if(S&&G){if(S.leiting?.model){S.leiting.model.formData={...S.leiting.model.formData,...T};const Y=h.value.find(q=>q.modelId===L);Y&&(Y.formData=S.leiting.model.formData)}oo({Cesium:G,tileset:S})}},x=L=>{if(!d.value)return;const S=h.value.find(q=>q.modelId===d.value)?.formData?.[L]??0,G=M.value[L],Y=G-S;v(d.value,{[L]:G}),Y!==0&&w.value.filter(W=>W.selected&&W.modelId!==d.value).forEach(W=>{const ae=(W.formData?.[L]??0)+Y;v(W.modelId,{[L]:ae})})},N=L=>{const T=w.value.filter(q=>q.selected);if(T.length===0){ce.warning("请先选择要调整的模型");return}const{lonlat:S,heightDistance:G,rotation:Y}=M.value;T.forEach(q=>{const W={...q.formData};switch(L){case"north":W.latitude+=S;break;case"south":W.latitude-=S;break;case"east":W.longitude+=S;break;case"west":W.longitude-=S;break;case"up":W.height+=G;break;case"down":W.height-=G;break;case"rotateLeft":W.totalRotation=(W.totalRotation||0)+Y;break;case"rotateRight":W.totalRotation=(W.totalRotation||0)-Y;break}q.modelId===d.value&&(W.lonlat=S,W.heightDistance=G,W.rotation=Y,Object.assign(M.value,W)),v(q.modelId,W)})},O=()=>{if(!d.value){ce.warning("请先选择主模型");return}const L=b(d.value);if(!L||!r?.value?.getViewer)return;const T=r.value.getViewer(),S=r.value.getCesium(),G=L.boundingSphere;T.camera.flyToBoundingSphere(G,{offset:new S.HeadingPitchRange(0,S.Math.toRadians(-90),G.radius*2),duration:1.5})},Q=()=>{r?.value?.saveRegion?(r.value.saveRegion(h.value),s("save",a.unref(h))):(console.log("Save models:",h.value),ce.warning("未找到保存接口,数据已打印控制台"))};return a.watch(()=>n.visible,L=>{L?(F(),U(),c.value==="pick"&&C()):(I(),p())}),a.onMounted(()=>{n.visible&&(F(),U(),c.value==="pick"&&C())}),(L,T)=>(a.openBlock(),a.createBlock(je,{visible:o.value,title:"调整位置(调整前可选择正北俯视)","full-height":i.fullHeight,width:260,"onUpdate:visible":T[25]||(T[25]=S=>o.value=S),onClose:E,onSave:Q,class:"base-position-card"},{default:a.withCtx(()=>[a.createElementVNode("div",RI,[a.createElementVNode("div",FI,[a.createElementVNode("div",LI,[T[26]||(T[26]=a.createElementVNode("label",null,"模型类型:",-1)),a.createElementVNode("div",OI,[a.createElementVNode("span",{class:a.normalizeClass({active:l.value==="BIM"}),onClick:T[0]||(T[0]=S=>l.value="BIM")},"BIM模型",2),a.createElementVNode("span",{class:a.normalizeClass({active:l.value==="OSGB"}),onClick:T[1]||(T[1]=S=>l.value="OSGB")},"倾斜摄影",2)])]),a.createElementVNode("div",GI,[T[27]||(T[27]=a.createElementVNode("label",null,"调整操作:",-1)),a.createElementVNode("div",UI,[a.createElementVNode("span",{class:a.normalizeClass({active:c.value==="param"}),onClick:T[2]||(T[2]=S=>c.value="param")},"参数模式",2),a.createElementVNode("span",{class:a.normalizeClass({active:c.value==="pick"}),onClick:T[3]||(T[3]=S=>c.value="pick")},"地图点选",2)])]),a.createElementVNode("div",VI,[T[28]||(T[28]=a.createElementVNode("label",null,"当前主模型:",-1)),a.createElementVNode("span",QI,a.toDisplayString(B.value||"未选择"),1)]),T[42]||(T[42]=a.createElementVNode("div",{class:"separator"},null,-1)),c.value==="param"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[T[36]||(T[36]=a.createElementVNode("div",{class:"group-header"},"当前状态",-1)),a.createElementVNode("div",HI,[T[29]||(T[29]=a.createElementVNode("label",null,"经度(东西):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[4]||(T[4]=S=>M.value.longitude=S),onChange:T[5]||(T[5]=S=>x("longitude")),step:"0.000001"},null,544),[[a.vModelText,M.value.longitude,void 0,{number:!0}]])]),a.createElementVNode("div",YI,[T[30]||(T[30]=a.createElementVNode("label",null,"纬度(南北):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[6]||(T[6]=S=>M.value.latitude=S),onChange:T[7]||(T[7]=S=>x("latitude")),step:"0.000001"},null,544),[[a.vModelText,M.value.latitude,void 0,{number:!0}]])]),a.createElementVNode("div",zI,[T[31]||(T[31]=a.createElementVNode("label",null,"高度(m):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[8]||(T[8]=S=>M.value.height=S),onChange:T[9]||(T[9]=S=>x("height")),step:"0.1"},null,544),[[a.vModelText,M.value.height,void 0,{number:!0}]])]),a.createElementVNode("div",jI,[T[32]||(T[32]=a.createElementVNode("label",null,"累计旋转(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[10]||(T[10]=S=>M.value.totalRotation=S),onChange:T[11]||(T[11]=S=>x("totalRotation")),step:"1"},null,544),[[a.vModelText,M.value.totalRotation,void 0,{number:!0}]])]),T[37]||(T[37]=a.createElementVNode("div",{class:"separator"},null,-1)),T[38]||(T[38]=a.createElementVNode("div",{class:"group-header"},"调整步长",-1)),a.createElementVNode("div",WI,[T[33]||(T[33]=a.createElementVNode("label",null,"经纬步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[12]||(T[12]=S=>M.value.lonlat=S),step:"0.000001"},null,512),[[a.vModelText,M.value.lonlat,void 0,{number:!0}]])]),a.createElementVNode("div",$I,[T[34]||(T[34]=a.createElementVNode("label",null,"高度步长(m):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[13]||(T[13]=S=>M.value.heightDistance=S),step:"0.1"},null,512),[[a.vModelText,M.value.heightDistance,void 0,{number:!0}]])]),a.createElementVNode("div",KI,[T[35]||(T[35]=a.createElementVNode("label",null,"旋转步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":T[14]||(T[14]=S=>M.value.rotation=S),step:"1"},null,512),[[a.vModelText,M.value.rotation,void 0,{number:!0}]])]),a.createElementVNode("div",qI,[a.createElementVNode("button",{onClick:T[15]||(T[15]=S=>N("rotateLeft"))},"左转"),a.createElementVNode("button",{onClick:T[16]||(T[16]=S=>N("north"))},"北移"),a.createElementVNode("button",{onClick:T[17]||(T[17]=S=>N("rotateRight"))},"右转"),a.createElementVNode("button",{onClick:T[18]||(T[18]=S=>N("west"))},"西移"),a.createElementVNode("button",{onClick:T[19]||(T[19]=S=>N("south"))},"南移"),a.createElementVNode("button",{onClick:T[20]||(T[20]=S=>N("east"))},"东移"),a.createElementVNode("button",{onClick:T[21]||(T[21]=S=>N("up"))},"上移"),a.createElementVNode("button",{onClick:T[22]||(T[22]=S=>N("down"))},"下移"),a.createElementVNode("button",{onClick:O,class:"primary-btn"},"正北俯视"),a.createElementVNode("button",{onClick:Q,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):c.value==="pick"?(a.openBlock(),a.createElementBlock("div",XI,[a.createElementVNode("div",JI,[a.createElementVNode("div",ZI,[a.createElementVNode("div",{onClick:T[23]||(T[23]=S=>f.value="BIM"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[a.createElementVNode("input",{type:"radio",checked:f.value==="BIM",style:{"margin-right":"5px"}},null,8,eS),T[39]||(T[39]=a.createElementVNode("span",{style:{"font-weight":"bold"}},"BIM标记点:",-1))]),m.value?(a.openBlock(),a.createElementBlock("div",tS,[a.createElementVNode("div",null,"经度:"+a.toDisplayString(m.value.longitude.toFixed(10)),1),a.createElementVNode("div",null,"纬度:"+a.toDisplayString(m.value.latitude.toFixed(10)),1)])):(a.openBlock(),a.createElementBlock("div",iS,"未选择"))])]),a.createElementVNode("div",nS,[a.createElementVNode("div",sS,[a.createElementVNode("div",{onClick:T[24]||(T[24]=S=>f.value="MAP"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[a.createElementVNode("input",{type:"radio",checked:f.value==="MAP",style:{"margin-right":"5px"}},null,8,oS),T[40]||(T[40]=a.createElementVNode("span",{style:{"font-weight":"bold"}},"地图标记点:",-1))]),u.value?(a.openBlock(),a.createElementBlock("div",aS,[a.createElementVNode("div",null,"经度:"+a.toDisplayString(u.value.longitude.toFixed(10)),1),a.createElementVNode("div",null,"纬度:"+a.toDisplayString(u.value.latitude.toFixed(10)),1)])):(a.openBlock(),a.createElementBlock("div",rS,"未选择"))])]),a.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[a.createElementVNode("button",{onClick:P},"调整位置"),a.createElementVNode("button",{onClick:Q},"保存")]),T[41]||(T[41]=a.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[a.createElementVNode("div",null,"操作指南:"),a.createElementVNode("div",null,"1. 勾选上方 BIM 或 地图 标记点选项。"),a.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),a.createElementVNode("div",null,"3. 采集两点后,点击“调整位置”进行校准。")],-1))])):a.createCommentVNode("",!0)]),a.createElementVNode("div",lS,[a.createElementVNode("div",cS,[a.createElementVNode("div",dS,[a.createElementVNode("input",{type:"checkbox",checked:_.value,onChange:D},null,40,hS)]),T[43]||(T[43]=a.createElementVNode("div",{class:"col-index"},"序号",-1)),T[44]||(T[44]=a.createElementVNode("div",{class:"col-name"},"名称",-1)),T[45]||(T[45]=a.createElementVNode("div",{class:"col-main"},"主模型",-1))]),a.createElementVNode("div",uS,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.value,(S,G)=>(a.openBlock(),a.createElementBlock("div",{key:S.modelId,class:a.normalizeClass(["list-item",{active:S.modelId===d.value}])},[a.createElementVNode("div",fS,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":Y=>S.selected=Y},null,8,mS),[[a.vModelCheckbox,S.selected]])]),a.createElementVNode("div",gS,a.toDisplayString(G+1),1),a.createElementVNode("div",{class:"col-name",title:S.modelName},a.toDisplayString(S.modelName),9,pS),a.createElementVNode("div",AS,[a.createElementVNode("input",{type:"radio",name:"mainModel",checked:S.modelId===d.value,onChange:Y=>R(S.modelId)},null,40,yS)])],2))),128))])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-9737215c"]]);function Ns(){return Ns=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Ns.apply(null,arguments)}const ES={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},CS={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},qd={lang:Ns({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},ES),timePickerLocale:Ns({},CS)};qd.lang.ok="确定";var Rs={exports:{}},vS=Rs.exports,Xd;function Jd(){return Xd||(Xd=1,(function(i,e){(function(t,n){i.exports=n()})(vS,(function(){var t=1e3,n=6e4,s=36e5,o="millisecond",r="second",l="minute",c="hour",d="day",h="week",f="month",m="quarter",u="year",g="date",A="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var b=["th","st","nd","rd"],v=R%100;return"["+R+(b[(v-20)%10]||b[v]||b[0])+"]"}},I=function(R,b,v){var x=String(R);return!x||x.length>=b?R:""+Array(b+1-x.length).join(v)+R},P={s:I,z:function(R){var b=-R.utcOffset(),v=Math.abs(b),x=Math.floor(v/60),N=v%60;return(b<=0?"+":"-")+I(x,2,"0")+":"+I(N,2,"0")},m:function R(b,v){if(b.date()<v.date())return-R(v,b);var x=12*(v.year()-b.year())+(v.month()-b.month()),N=b.clone().add(x,f),O=v-N<0,Q=b.clone().add(x+(O?-1:1),f);return+(-(x+(v-N)/(O?N-Q:Q-N))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:f,y:u,w:h,d,D:g,h:c,m:l,s:r,ms:o,Q:m}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},k="en",M={};M[k]=C;var B="$isDayjsObject",_=function(R){return R instanceof F||!(!R||!R[B])},E=function R(b,v,x){var N;if(!b)return k;if(typeof b=="string"){var O=b.toLowerCase();M[O]&&(N=O),v&&(M[O]=v,N=O);var Q=b.split("-");if(!N&&Q.length>1)return R(Q[0])}else{var L=b.name;M[L]=b,N=L}return!x&&N&&(k=N),N||!x&&k},w=function(R,b){if(_(R))return R.clone();var v=typeof b=="object"?b:{};return v.date=R,v.args=arguments,new F(v)},D=P;D.l=E,D.i=_,D.w=function(R,b){return w(R,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var F=(function(){function R(v){this.$L=E(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[B]=!0}var b=R.prototype;return b.parse=function(v){this.$d=(function(x){var N=x.date,O=x.utc;if(N===null)return new Date(NaN);if(D.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var Q=N.match(p);if(Q){var L=Q[2]-1||0,T=(Q[7]||"0").substring(0,3);return O?new Date(Date.UTC(Q[1],L,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,T)):new Date(Q[1],L,Q[3]||1,Q[4]||0,Q[5]||0,Q[6]||0,T)}}return new Date(N)})(v),this.init()},b.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},b.$utils=function(){return D},b.isValid=function(){return this.$d.toString()!==A},b.isSame=function(v,x){var N=w(v);return this.startOf(x)<=N&&N<=this.endOf(x)},b.isAfter=function(v,x){return w(v)<this.startOf(x)},b.isBefore=function(v,x){return this.endOf(x)<w(v)},b.$g=function(v,x,N){return D.u(v)?this[x]:this.set(N,v)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(v,x){var N=this,O=!!D.u(x)||x,Q=D.p(v),L=function(ae,de){var he=D.w(N.$u?Date.UTC(N.$y,de,ae):new Date(N.$y,de,ae),N);return O?he:he.endOf(d)},T=function(ae,de){return D.w(N.toDate()[ae].apply(N.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(de)),N)},S=this.$W,G=this.$M,Y=this.$D,q="set"+(this.$u?"UTC":"");switch(Q){case u:return O?L(1,0):L(31,11);case f:return O?L(1,G):L(0,G+1);case h:var W=this.$locale().weekStart||0,re=(S<W?S+7:S)-W;return L(O?Y-re:Y+(6-re),G);case d:case g:return T(q+"Hours",0);case c:return T(q+"Minutes",1);case l:return T(q+"Seconds",2);case r:return T(q+"Milliseconds",3);default:return this.clone()}},b.endOf=function(v){return this.startOf(v,!1)},b.$set=function(v,x){var N,O=D.p(v),Q="set"+(this.$u?"UTC":""),L=(N={},N[d]=Q+"Date",N[g]=Q+"Date",N[f]=Q+"Month",N[u]=Q+"FullYear",N[c]=Q+"Hours",N[l]=Q+"Minutes",N[r]=Q+"Seconds",N[o]=Q+"Milliseconds",N)[O],T=O===d?this.$D+(x-this.$W):x;if(O===f||O===u){var S=this.clone().set(g,1);S.$d[L](T),S.init(),this.$d=S.set(g,Math.min(this.$D,S.daysInMonth())).$d}else L&&this.$d[L](T);return this.init(),this},b.set=function(v,x){return this.clone().$set(v,x)},b.get=function(v){return this[D.p(v)]()},b.add=function(v,x){var N,O=this;v=Number(v);var Q=D.p(x),L=function(G){var Y=w(O);return D.w(Y.date(Y.date()+Math.round(G*v)),O)};if(Q===f)return this.set(f,this.$M+v);if(Q===u)return this.set(u,this.$y+v);if(Q===d)return L(1);if(Q===h)return L(7);var T=(N={},N[l]=n,N[c]=s,N[r]=t,N)[Q]||1,S=this.$d.getTime()+v*T;return D.w(S,this)},b.subtract=function(v,x){return this.add(-1*v,x)},b.format=function(v){var x=this,N=this.$locale();if(!this.isValid())return N.invalidDate||A;var O=v||"YYYY-MM-DDTHH:mm:ssZ",Q=D.z(this),L=this.$H,T=this.$m,S=this.$M,G=N.weekdays,Y=N.months,q=N.meridiem,W=function(de,he,ge,De){return de&&(de[he]||de(x,O))||ge[he].slice(0,De)},re=function(de){return D.s(L%12||12,de,"0")},ae=q||function(de,he,ge){var De=de<12?"AM":"PM";return ge?De.toLowerCase():De};return O.replace(y,(function(de,he){return he||(function(ge){switch(ge){case"YY":return String(x.$y).slice(-2);case"YYYY":return D.s(x.$y,4,"0");case"M":return S+1;case"MM":return D.s(S+1,2,"0");case"MMM":return W(N.monthsShort,S,Y,3);case"MMMM":return W(Y,S);case"D":return x.$D;case"DD":return D.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return W(N.weekdaysMin,x.$W,G,2);case"ddd":return W(N.weekdaysShort,x.$W,G,3);case"dddd":return G[x.$W];case"H":return String(L);case"HH":return D.s(L,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return ae(L,T,!0);case"A":return ae(L,T,!1);case"m":return String(T);case"mm":return D.s(T,2,"0");case"s":return String(x.$s);case"ss":return D.s(x.$s,2,"0");case"SSS":return D.s(x.$ms,3,"0");case"Z":return Q}return null})(de)||Q.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(v,x,N){var O,Q=this,L=D.p(x),T=w(v),S=(T.utcOffset()-this.utcOffset())*n,G=this-T,Y=function(){return D.m(Q,T)};switch(L){case u:O=Y()/12;break;case f:O=Y();break;case m:O=Y()/3;break;case h:O=(G-S)/6048e5;break;case d:O=(G-S)/864e5;break;case c:O=G/s;break;case l:O=G/n;break;case r:O=G/t;break;default:O=G}return N?O:D.a(O)},b.daysInMonth=function(){return this.endOf(f).$D},b.$locale=function(){return M[this.$L]},b.locale=function(v,x){if(!v)return this.$L;var N=this.clone(),O=E(v,x,!0);return O&&(N.$L=O),N},b.clone=function(){return D.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},R})(),U=F.prototype;return w.prototype=U,[["$ms",o],["$s",r],["$m",l],["$H",c],["$W",d],["$M",f],["$y",u],["$D",g]].forEach((function(R){U[R[1]]=function(b){return this.$g(b,R[0],R[1])}})),w.extend=function(R,b){return R.$i||(R(b,F,w),R.$i=!0),w},w.locale=E,w.isDayjs=_,w.unix=function(R){return w(1e3*R)},w.en=M[k],w.Ls=M,w.p={},w}))})(Rs)),Rs.exports}var bS=Jd();const mt=Ti(bS);var Fs={exports:{}},wS=Fs.exports,Zd;function IS(){return Zd||(Zd=1,(function(i,e){(function(t,n){i.exports=n(Jd())})(wS,(function(t){function n(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var s=n(t),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(r,l){return l==="W"?r+"周":r+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(r,l){var c=100*r+l;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return s.default.locale(o,null,!0),o}))})(Fs)),Fs.exports}IS();var Ls={exports:{}},SS=Ls.exports,eh;function xS(){return eh||(eh=1,(function(i,e){(function(t,n){i.exports=n()})(SS,(function(){return function(t,n,s){var o=n.prototype,r=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,m,u,g,A){var p=f.name?f:f.$locale(),y=r(p[m]),C=r(p[u]),I=y||C.map((function(k){return k.slice(0,g)}));if(!A)return I;var P=p.weekStart;return I.map((function(k,M){return I[(M+(P||0))%7]}))},c=function(){return s.Ls[s.locale()]},d=function(f,m){return f.formats[m]||(function(u){return u.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(g,A,p){return A||p.slice(1)}))})(f.formats[m.toUpperCase()])},h=function(){var f=this;return{months:function(m){return m?m.format("MMMM"):l(f,"months")},monthsShort:function(m){return m?m.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(m){return m?m.format("dddd"):l(f,"weekdays")},weekdaysMin:function(m){return m?m.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(m){return m?m.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(m){return d(f.$locale(),m)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return h.bind(this)()},s.localeData=function(){var f=c();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(m){return d(f,m)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return l(c(),"months")},s.monthsShort=function(){return l(c(),"monthsShort","months",3)},s.weekdays=function(f){return l(c(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return l(c(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return l(c(),"weekdaysMin","weekdays",2,f)}}}))})(Ls)),Ls.exports}var MS=xS();const BS=Ti(MS);var Os={exports:{}},TS=Os.exports,th;function PS(){return th||(th=1,(function(i,e){(function(t,n){i.exports=n()})(TS,(function(){return function(t,n){n.prototype.weekday=function(s){var o=this.$locale().weekStart||0,r=this.$W,l=(r<o?r+7:r)-o;return this.$utils().u(s)?l:this.subtract(l,"day").add(s,"day")}}}))})(Os)),Os.exports}var _S=PS();const DS=Ti(_S);var Gs={exports:{}},kS=Gs.exports,ih;function NS(){return ih||(ih=1,(function(i,e){(function(t,n){i.exports=n()})(kS,(function(){var t="week",n="year";return function(s,o,r){var l=o.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=r(this).startOf(n).add(1,n).date(d),f=r(this).endOf(t);if(h.isBefore(f))return 1}var m=r(this).startOf(n).date(d).startOf(t).subtract(1,"millisecond"),u=this.diff(m,t,!0);return u<0?r(this).startOf("week").week():Math.ceil(u)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(Gs)),Gs.exports}var RS=NS();const FS=Ti(RS);var Us={exports:{}},LS=Us.exports,nh;function OS(){return nh||(nh=1,(function(i,e){(function(t,n){i.exports=n()})(LS,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,o=/\d\d/,r=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},d=function(p){return(p=+p)+(p>68?1900:2e3)},h=function(p){return function(y){this[p]=+y}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(p){(this.zone||(this.zone={})).offset=(function(y){if(!y||y==="Z")return 0;var C=y.match(/([+-]|\d\d)/g),I=60*C[1]+(+C[2]||0);return I===0?0:C[0]==="+"?-I:I})(p)}],m=function(p){var y=c[p];return y&&(y.indexOf?y:y.s.concat(y.f))},u=function(p,y){var C,I=c.meridiem;if(I){for(var P=1;P<=24;P+=1)if(p.indexOf(I(P,0,y))>-1){C=P>12;break}}else C=p===(y?"pm":"PM");return C},g={A:[l,function(p){this.afternoon=u(p,!1)}],a:[l,function(p){this.afternoon=u(p,!0)}],Q:[s,function(p){this.month=3*(p-1)+1}],S:[s,function(p){this.milliseconds=100*+p}],SS:[o,function(p){this.milliseconds=10*+p}],SSS:[/\d{3}/,function(p){this.milliseconds=+p}],s:[r,h("seconds")],ss:[r,h("seconds")],m:[r,h("minutes")],mm:[r,h("minutes")],H:[r,h("hours")],h:[r,h("hours")],HH:[r,h("hours")],hh:[r,h("hours")],D:[r,h("day")],DD:[o,h("day")],Do:[l,function(p){var y=c.ordinal,C=p.match(/\d+/);if(this.day=C[0],y)for(var I=1;I<=31;I+=1)y(I).replace(/\[|\]/g,"")===p&&(this.day=I)}],w:[r,h("week")],ww:[o,h("week")],M:[r,h("month")],MM:[o,h("month")],MMM:[l,function(p){var y=m("months"),C=(m("monthsShort")||y.map((function(I){return I.slice(0,3)}))).indexOf(p)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[l,function(p){var y=m("months").indexOf(p)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[o,function(p){this.year=d(p)}],YYYY:[/\d{4}/,h("year")],Z:f,ZZ:f};function A(p){var y,C;y=p,C=c&&c.formats;for(var I=(p=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(w,D,F){var U=F&&F.toUpperCase();return D||C[F]||t[F]||C[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(R,b,v){return b||v.slice(1)}))}))).match(n),P=I.length,k=0;k<P;k+=1){var M=I[k],B=g[M],_=B&&B[0],E=B&&B[1];I[k]=E?{regex:_,parser:E}:M.replace(/^\[|\]$/g,"")}return function(w){for(var D={},F=0,U=0;F<P;F+=1){var R=I[F];if(typeof R=="string")U+=R.length;else{var b=R.regex,v=R.parser,x=w.slice(U),N=b.exec(x)[0];v.call(D,N),w=w.replace(N,"")}}return(function(O){var Q=O.afternoon;if(Q!==void 0){var L=O.hours;Q?L<12&&(O.hours+=12):L===12&&(O.hours=0),delete O.afternoon}})(D),D}}return function(p,y,C){C.p.customParseFormat=!0,p&&p.parseTwoDigitYear&&(d=p.parseTwoDigitYear);var I=y.prototype,P=I.parse;I.parse=function(k){var M=k.date,B=k.utc,_=k.args;this.$u=B;var E=_[1];if(typeof E=="string"){var w=_[2]===!0,D=_[3]===!0,F=w||D,U=_[2];D&&(U=_[2]),c=this.$locale(),!w&&U&&(c=C.Ls[U]),this.$d=(function(x,N,O,Q){try{if(["x","X"].indexOf(N)>-1)return new Date((N==="X"?1e3:1)*x);var L=A(N)(x),T=L.year,S=L.month,G=L.day,Y=L.hours,q=L.minutes,W=L.seconds,re=L.milliseconds,ae=L.zone,de=L.week,he=new Date,ge=G||(T||S?1:he.getDate()),De=T||he.getFullYear(),Re=0;T&&!S||(Re=S>0?S-1:he.getMonth());var We,Ve=Y||0,et=q||0,$=W||0,z=re||0;return ae?new Date(Date.UTC(De,Re,ge,Ve,et,$,z+60*ae.offset*1e3)):O?new Date(Date.UTC(De,Re,ge,Ve,et,$,z)):(We=new Date(De,Re,ge,Ve,et,$,z),de&&(We=Q(We).week(de).toDate()),We)}catch{return new Date("")}})(M,E,B,C),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),F&&M!=this.format(E)&&(this.$d=new Date("")),c={}}else if(E instanceof Array)for(var R=E.length,b=1;b<=R;b+=1){_[1]=E[b-1];var v=C.apply(this,_);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}b===R&&(this.$d=new Date(""))}else P.call(this,k)}}}))})(Us)),Us.exports}var GS=OS();const US=Ti(GS),VS={class:"setting-panel"},QS={class:"tabs-header"},HS={class:"tab-content"},YS={key:0,class:"section"},zS={class:"setting-item"},jS={class:"setting-item"},WS={class:"setting-item"},$S={key:1,class:"section"},KS={class:"tabs-header",style:{"margin-bottom":"8px"}},qS={key:0},XS={class:"setting-item column"},JS={class:"setting-item column"},ZS={class:"setting-item"},ex={key:1},tx={class:"setting-item column"},ix={class:"setting-item column",style:{"margin-top":"12px","border-top":"1px solid rgba(255,255,255,0.1)","padding-top":"8px"}},nx={class:"search-box"},sx={key:2,class:"section"},ox={class:"setting-item"},ax={key:0,class:"setting-item column"},rx={class:"sub-label"},lx={class:"setting-item"},cx={class:"setting-item"},dx={class:"setting-item column"},hx={class:"setting-item column"},ux={class:"sub-label"},fx={class:"setting-item column"},mx={class:"sub-label"},gx={class:"setting-item column"},px={class:"sub-label"},Ax={class:"setting-item column"},yx={style:{display:"flex",gap:"8px","margin-bottom":"8px"}},Ex=["onClick","title"],Cx={style:{display:"flex",gap:"8px","align-items":"center"}},vx={key:3,class:"section"},bx={class:"setting-item"},wx={class:"setting-item column"},_n=be(a.defineComponent({__name:"LeitingSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean,default:!1},tiandituToken:{type:String,default:""},initialConfig:{type:Object,default:()=>({})}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){mt.locale("zh-cn"),mt.extend(BS),mt.extend(DS),mt.extend(FS),mt.extend(US);const t=se.Switch,n=se.Radio.Group,s=se.Radio,o=se.Input,r=se.Slider,l=se.Select,c=se.Select.Option,d=se.DatePicker,h=i,f=e,m=a.inject("leitingMethods"),u=a.computed({get:()=>h.open!==void 0?h.open:h.visible,set:b=>{f("update:visible",b),f("update:open",b)}}),g=a.ref("GIS"),A=a.reactive({globe:!1,terrain:!1,depthTest:!1}),p=a.reactive({provider:"tianditu",tianditu:{token:"c25f14fb6bd4397cf8fe45144ff768d6",layerType:"img_w",showLabel:!1},arcgis:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},baseMap:"tianditu"}),y=a.reactive({shadows:!1,shadowDarkness:.7,environmentMap:!1,ambientOcclusion:!1,time:mt("2025-06-22 10:00"),brightness:1.5,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),C=a.reactive({collision:!1,habit:0}),I=b=>{b&&(b.globe!==void 0&&(A.globe=b.globe),b.terrain!==void 0&&(A.terrain=b.terrain),b.depthTest!==void 0&&(A.depthTest=b.depthTest),b.mapProvider!==void 0&&(p.provider=b.mapProvider),b.tiandituLayerType!==void 0&&(p.tianditu.layerType=b.tiandituLayerType),b.tiandituShowLabel!==void 0&&(p.tianditu.showLabel=b.tiandituShowLabel),b.arcgisUrl!==void 0&&(p.arcgis.url=b.arcgisUrl),b.shadows!==void 0&&(y.shadows=b.shadows),b.shadowDarkness!==void 0&&(y.shadowDarkness=b.shadowDarkness),b.environmentMap!==void 0&&(y.environmentMap=b.environmentMap),b.ambientOcclusion!==void 0&&(y.ambientOcclusion=b.ambientOcclusion),b.time!==void 0&&(typeof b.time=="number"?y.time=mt().startOf("day").add(b.time,"hour"):y.time=mt(b.time)),b.brightness!==void 0&&(y.brightness=b.brightness),b.contrast!==void 0&&(y.contrast=b.contrast),b.saturation!==void 0&&(y.saturation=b.saturation),b.backgroundColor!==void 0&&(y.backgroundColor=b.backgroundColor),b.collision!==void 0&&(C.collision=b.collision),b.mouseHabit!==void 0&&(C.habit=b.mouseHabit))};a.watch(()=>h.initialConfig,b=>{I(b)},{deep:!0,immediate:!0});const P=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],k=[{label:"全球影像地图服务(墨卡托)",value:"img_w"},{label:"全球影像地图服务(经纬度)",value:"img_c"},{label:"全球矢量地图服务(墨卡托)",value:"vec_w"},{label:"全球矢量地图服务(经纬度)",value:"vec_c"},{label:"全球地形晕渲服务(墨卡托)",value:"ter_w"},{label:"全球地形晕渲服务(经纬度)",value:"ter_c"}],M=()=>{const b=p.provider,v={};b==="tianditu"?(v.token=p.tianditu.token,v.layerType=p.tianditu.layerType,v.showAnnotation=p.tianditu.showLabel):b==="arcgis"&&(v.url=p.arcgis.url),m.value?.changeBaseMap?.(b,v)};a.watch(()=>p.provider,M),a.watch(()=>p.tianditu.layerType,M),a.watch(()=>p.tianditu.showLabel,M),a.watch(()=>p.tianditu.token,Qn(M,1e3)),a.watch(()=>p.arcgis.url,Qn(M,1e3)),a.onMounted(()=>{h.tiandituToken&&(p.tianditu.token=h.tiandituToken)}),a.watch(()=>A.globe,b=>m.value?.setGlobeEnvironmentVisible?.(b)),a.watch(()=>A.terrain,b=>m.value?.setTerrainEnable?.(b)),a.watch(()=>A.depthTest,b=>m.value?.setDepthTestEnable?.(b)),a.watch(()=>m?.value,b=>{if(b){if(b.getConfigure=()=>({globe:A.globe,terrain:A.terrain,depthTest:A.depthTest,mapProvider:p.provider,tiandituLayerType:p.tianditu.layerType,tiandituShowLabel:p.tianditu.showLabel,arcgisUrl:p.arcgis.url,shadows:y.shadows,shadowDarkness:y.shadowDarkness,environmentMap:y.environmentMap,ambientOcclusion:y.ambientOcclusion,time:mt.isDayjs(y.time)?y.time.format("YYYY-MM-DD HH:mm"):y.time,brightness:y.brightness,contrast:y.contrast,saturation:y.saturation,backgroundColor:y.backgroundColor,collision:C.collision,mouseHabit:C.habit}),b.setConfigure=v=>{I(v)},b.setBackgroundColor&&y.backgroundColor&&b.setBackgroundColor(y.backgroundColor),b.setGlobeEnvironmentVisible&&b.setGlobeEnvironmentVisible(A.globe),b.setShadowsEnable&&b.setShadowsEnable(y.shadows),b.setShadowDarkness&&b.setShadowDarkness(y.shadowDarkness),b.setEnvironmentMapEnable&&b.setEnvironmentMapEnable(y.environmentMap),b.setAmbientOcclusion&&b.setAmbientOcclusion(y.ambientOcclusion),b.setTime){const v=mt.isDayjs(y.time)?y.time.toDate():new Date;b.setTime(v)}b.setModelBrightness&&b.setModelBrightness(y.brightness),b.setCollisionDetection&&b.setCollisionDetection(C.collision),b.setMouseHabit&&b.setMouseHabit(C.habit),b.changeBaseMap&&p.baseMap&&b.changeBaseMap(p.baseMap,{token:p.tianditu.token,layerType:p.tianditu.layerType,showAnnotation:p.tianditu.showLabel,url:p.arcgis.url})}},{immediate:!0});const B=a.computed({get:()=>{const b=y.backgroundColor;return/^#[0-9A-Fa-f]{6}$/.test(b)?b:"#ffffff"},set:b=>{y.backgroundColor=b}}),_=a.ref(""),E=a.ref(!1),w=a.ref([]);a.watch(()=>A.globe,b=>m.value?.setGlobeEnvironmentVisible?.(b)),a.watch(()=>A.terrain,b=>m.value?.setTerrainEnable?.(b)),a.watch(()=>p.baseMap,b=>{m.value?.changeBaseMap?.(b,{token:h.tiandituToken})}),a.watch(()=>y.shadows,b=>m.value?.setShadowsEnable?.(b)),a.watch(()=>y.shadowDarkness,b=>m.value?.setShadowDarkness?.(b)),a.watch(()=>y.environmentMap,b=>m.value?.setEnvironmentMapEnable?.(b)),a.watch(()=>y.ambientOcclusion,b=>m.value?.setAmbientOcclusion?.(b)),a.watch(()=>y.time,b=>{const v=mt.isDayjs(b)?b.toDate():new Date;m.value?.setTime?.(v)}),a.watch(()=>[y.brightness,y.contrast,y.saturation],([b,v,x])=>{const N=m.value;N?.setModelColorAdjustment?N.setModelColorAdjustment({brightness:b,contrast:v,saturation:x}):N?.setModelBrightness?.(b)}),a.watch(()=>y.backgroundColor,b=>{if(m.value?.setBackgroundColor)m.value.setBackgroundColor(b);else{const v=document.querySelector(".cesium-viewer");v&&(v.style.background=b)}}),a.watch(()=>C.collision,b=>m.value?.setCollisionDetection?.(b)),a.watch(()=>C.habit,b=>m.value?.setMouseHabit?.(b));const D=b=>{if(b?.pois&&Array.isArray(b.pois)&&b.pois.length>0){const v=b.pois[0],x=v.lonlat.split(/[, ]/).map(Number);if(x.length>=2&&!isNaN(x[0])&&!isNaN(x[1]))return{name:v.name,lon:x[0],lat:x[1],raw:v}}if(b?.area&&b.area.lonlat){const v=b.area,x=v.lonlat.split(/[, ]/).map(Number);if(x.length>=2&&!isNaN(x[0])&&!isNaN(x[1]))return{name:v.name,lon:x[0],lat:x[1],raw:v}}return null},U=Qn(async()=>{const b=(_.value||"").trim();if(!b)return;const v=h.tiandituToken||"c25f14fb6bd4397cf8fe45144ff768d6";E.value=!0,w.value=[];try{if(m.value?.searchLocation){const x=await m.value.searchLocation(b,v),N=D(x);N&&(w.value=[N],ce.success(`找到:${N.name||""}`),m.value.flyToLonLatHeight(N.lon,N.lat,5e3))}else{const N=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(JSON.stringify({keyWord:b,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}))}&type=query&tk=${encodeURIComponent(v)}`,O=await fetch(N);if(!O.ok)throw new Error(`HTTP ${O.status}`);const Q=await O.json(),L=D(Q);L&&(w.value=[L],ce.success(`找到:${L.name||""}`),m.value?.flyToLonLatHeight?.(L.lon,L.lat,5e3))}}catch(x){console.error("tianditu search error",x)}finally{E.value=!1}},800);a.watch(_,()=>{U()});const R=()=>{u.value=!1,f("close")};return a.onMounted(()=>{}),(b,v)=>(a.openBlock(),a.createBlock(je,{visible:u.value,title:"设置","full-height":i.fullHeight,onClose:R,"onUpdate:visible":v[26]||(v[26]=x=>u.value=x)},{default:a.withCtx(()=>[a.createElementVNode("div",VS,[a.createElementVNode("div",QS,[a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:g.value==="GIS"}]),onClick:v[0]||(v[0]=x=>g.value="GIS")},"GIS",2),a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:g.value==="MAP"}]),onClick:v[1]||(v[1]=x=>g.value="MAP")},"地图",2),a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:g.value==="RENDER"}]),onClick:v[2]||(v[2]=x=>g.value="RENDER")},"渲染",2),a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:g.value==="MOUSE"}]),onClick:v[3]||(v[3]=x=>g.value="MOUSE")},"鼠标",2)]),a.createElementVNode("div",HS,[g.value==="GIS"?(a.openBlock(),a.createElementBlock("div",YS,[a.createElementVNode("div",zS,[v[27]||(v[27]=a.createElementVNode("span",null,"地球 (含大气/日月/星空)",-1)),a.createVNode(a.unref(t),{checked:A.globe,"onUpdate:checked":v[4]||(v[4]=x=>A.globe=x),size:"small"},null,8,["checked"])]),a.createElementVNode("div",jS,[v[28]||(v[28]=a.createElementVNode("span",null,"地形 (高程)",-1)),a.createVNode(a.unref(t),{checked:A.terrain,"onUpdate:checked":v[5]||(v[5]=x=>A.terrain=x),size:"small"},null,8,["checked"])]),a.createElementVNode("div",WS,[v[29]||(v[29]=a.createElementVNode("span",null,"地形遮挡",-1)),a.createVNode(a.unref(t),{checked:A.depthTest,"onUpdate:checked":v[6]||(v[6]=x=>A.depthTest=x),size:"small"},null,8,["checked"])])])):a.createCommentVNode("",!0),g.value==="MAP"?(a.openBlock(),a.createElementBlock("div",$S,[a.createElementVNode("div",KS,[a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:p.provider==="tianditu"}]),onClick:v[7]||(v[7]=x=>p.provider="tianditu")},"天地图",2),a.createElementVNode("div",{class:a.normalizeClass(["tab-item",{active:p.provider==="arcgis"}]),onClick:v[8]||(v[8]=x=>p.provider="arcgis")},"ArcGIS",2)]),p.provider==="tianditu"?(a.openBlock(),a.createElementBlock("div",qS,[a.createElementVNode("div",XS,[v[30]||(v[30]=a.createElementVNode("div",{class:"sub-label"},"Token",-1)),a.createVNode(a.unref(o),{value:p.tianditu.token,"onUpdate:value":v[9]||(v[9]=x=>p.tianditu.token=x),size:"small",placeholder:"输入天地图Token"},null,8,["value"])]),a.createElementVNode("div",JS,[v[31]||(v[31]=a.createElementVNode("div",{class:"sub-label"},"地图风格",-1)),a.createVNode(a.unref(l),{value:p.tianditu.layerType,"onUpdate:value":v[10]||(v[10]=x=>p.tianditu.layerType=x),size:"small",style:{width:"100%"}},{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(k,x=>a.createVNode(a.unref(c),{key:x.value,value:x.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(x.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),a.createElementVNode("div",ZS,[v[32]||(v[32]=a.createElementVNode("span",null,"叠加注记",-1)),a.createVNode(a.unref(t),{checked:p.tianditu.showLabel,"onUpdate:checked":v[11]||(v[11]=x=>p.tianditu.showLabel=x),size:"small"},null,8,["checked"])])])):a.createCommentVNode("",!0),p.provider==="arcgis"?(a.openBlock(),a.createElementBlock("div",ex,[a.createElementVNode("div",tx,[v[33]||(v[33]=a.createElementVNode("div",{class:"sub-label"},"服务地址",-1)),a.createVNode(a.unref(o),{value:p.arcgis.url,"onUpdate:value":v[12]||(v[12]=x=>p.arcgis.url=x),size:"small",placeholder:"输入ArcGIS MapServer地址"},null,8,["value"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",ix,[v[34]||(v[34]=a.createElementVNode("div",{class:"sub-label"},"位置搜索 (天地图)",-1)),a.createElementVNode("div",nx,[a.createVNode(a.unref(o),{value:_.value,"onUpdate:value":v[13]||(v[13]=x=>_.value=x),placeholder:"输入地名搜索",size:"small","allow-clear":""},null,8,["value"])])])])):a.createCommentVNode("",!0),g.value==="RENDER"?(a.openBlock(),a.createElementBlock("div",sx,[a.createElementVNode("div",ox,[v[35]||(v[35]=a.createElementVNode("span",null,"阴影",-1)),a.createVNode(a.unref(t),{checked:y.shadows,"onUpdate:checked":v[14]||(v[14]=x=>y.shadows=x),size:"small"},null,8,["checked"])]),y.shadows?(a.openBlock(),a.createElementBlock("div",ax,[a.createElementVNode("div",rx,"阴影暗度 ("+a.toDisplayString(y.shadowDarkness.toFixed(2))+")",1),a.createVNode(a.unref(r),{value:y.shadowDarkness,"onUpdate:value":v[15]||(v[15]=x=>y.shadowDarkness=x),min:0,max:1,step:.05,size:"small"},null,8,["value"])])):a.createCommentVNode("",!0),a.createElementVNode("div",lx,[v[36]||(v[36]=a.createElementVNode("span",null,"环境贴图 (HDR)",-1)),a.createVNode(a.unref(t),{checked:y.environmentMap,"onUpdate:checked":v[16]||(v[16]=x=>y.environmentMap=x),size:"small"},null,8,["checked"])]),a.createElementVNode("div",cx,[v[37]||(v[37]=a.createElementVNode("span",null,"环境光遮蔽 (AO)",-1)),a.createVNode(a.unref(t),{checked:y.ambientOcclusion,"onUpdate:checked":v[17]||(v[17]=x=>y.ambientOcclusion=x),size:"small"},null,8,["checked"])]),a.createElementVNode("div",dx,[v[38]||(v[38]=a.createElementVNode("div",{class:"sub-label"},"日期时间",-1)),a.createVNode(a.unref(d),{value:y.time,"onUpdate:value":v[18]||(v[18]=x=>y.time=x),"show-time":"",locale:a.unref(qd),format:"YYYY-MM-DD HH:mm",size:"small",style:{width:"100%"}},null,8,["value","locale"])]),a.createElementVNode("div",hx,[a.createElementVNode("div",ux,"模型亮度 ("+a.toDisplayString(y.brightness.toFixed(1))+")",1),a.createVNode(a.unref(r),{value:y.brightness,"onUpdate:value":v[19]||(v[19]=x=>y.brightness=x),min:0,max:5,step:.1,size:"small"},null,8,["value"])]),a.createElementVNode("div",fx,[a.createElementVNode("div",mx,"模型对比度 ("+a.toDisplayString(y.contrast.toFixed(1))+")",1),a.createVNode(a.unref(r),{value:y.contrast,"onUpdate:value":v[20]||(v[20]=x=>y.contrast=x),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),a.createElementVNode("div",gx,[a.createElementVNode("div",px,"模型饱和度 ("+a.toDisplayString(y.saturation.toFixed(1))+")",1),a.createVNode(a.unref(r),{value:y.saturation,"onUpdate:value":v[21]||(v[21]=x=>y.saturation=x),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),a.createElementVNode("div",Ax,[v[39]||(v[39]=a.createElementVNode("div",{class:"sub-label"},"背景颜色",-1)),a.createElementVNode("div",yx,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(P,(x,N)=>a.createElementVNode("div",{key:N,style:a.normalizeStyle({background:x,width:"32px",height:"24px",borderRadius:"2px",cursor:"pointer",border:"1px solid #d9d9d9",flexShrink:0}),onClick:O=>y.backgroundColor=x,title:"预设 "+(N+1)},null,12,Ex)),64))]),a.createElementVNode("div",Cx,[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":v[22]||(v[22]=x=>B.value=x),style:{width:"40px",height:"24px",padding:"0",border:"1px solid #d9d9d9"}},null,512),[[a.vModelText,B.value]]),a.createVNode(a.unref(o),{value:y.backgroundColor,"onUpdate:value":v[23]||(v[23]=x=>y.backgroundColor=x),size:"small",style:{flex:"1"},placeholder:"CSS 颜色值"},null,8,["value"])])])])):a.createCommentVNode("",!0),g.value==="MOUSE"?(a.openBlock(),a.createElementBlock("div",vx,[a.createElementVNode("div",bx,[v[40]||(v[40]=a.createElementVNode("span",null,"碰撞检测",-1)),a.createVNode(a.unref(t),{checked:C.collision,"onUpdate:checked":v[24]||(v[24]=x=>C.collision=x),size:"small"},null,8,["checked"])]),a.createElementVNode("div",wx,[v[43]||(v[43]=a.createElementVNode("div",{class:"sub-label"},"操作习惯",-1)),a.createVNode(a.unref(n),{value:C.habit,"onUpdate:value":v[25]||(v[25]=x=>C.habit=x),size:"small"},{default:a.withCtx(()=>[a.createVNode(a.unref(s),{value:0},{default:a.withCtx(()=>[...v[41]||(v[41]=[a.createTextVNode("默认 (中键旋转)",-1)])]),_:1}),a.createVNode(a.unref(s),{value:1},{default:a.withCtx(()=>[...v[42]||(v[42]=[a.createTextVNode("习惯1 (左键旋转)",-1)])]),_:1})]),_:1},8,["value"])])])):a.createCommentVNode("",!0)])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-79494025"]]),Ix={class:"cad-layer-panel"},Sx={class:"layer-list-container"},xx={class:"list-header"},Mx={class:"col-check"},Bx=["checked"],Tx={class:"list-body"},Px={class:"col-check"},_x=["checked","onChange"],Dx={class:"col-index"},kx=["title"],Nx={class:"col-color"},Rx=["value"],Fx={key:0,class:"empty-text"},Lx=be(a.defineComponent({__name:"LeitingCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods",a.ref({})),o=a.ref(""),r=a.ref([]),l=()=>{s.value&&s.value.getDxfModels&&(r.value=s.value.getDxfModels().map(C=>({modelId:C.modelId,modelName:C.modelName}))||[])},c=a.computed(()=>r.value.map(C=>({value:C.modelId,label:C.modelName}))),d=a.ref([]),h=a.ref([]),f=a.computed(()=>d.value.length>0&&h.value.length===d.value.length),m=({modelId:C})=>{if(d.value=[],h.value=[],s.value&&s.value.getDxfLayers){const I=s.value.getDxfLayers({modelId:C});I&&Object.keys(I).forEach((P,k)=>{I[P].length&&(d.value.push({index:k+1,layerName:P,layerColor:I[P][0].color||"#ffffff",key:P}),h.value.push(P))})}},u=C=>{o.value=C,m({modelId:C})},g=C=>{C.target.checked?h.value=d.value.map(P=>P.key):h.value=[],p()},A=(C,I)=>{I.target.checked?h.value.includes(C)||h.value.push(C):h.value=h.value.filter(k=>k!==C),p()},p=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:o.value,show:!0,layers:h.value}),s.value.getDxfLayers)){const C=s.value.getDxfLayers({modelId:o.value});if(C){const I=Object.keys(C).filter(P=>!h.value.includes(P));s.value.showDxfLayer({modelId:o.value,show:!1,layers:I})}}},y=()=>{n("update:visible",!1),n("handleCloseCardByCadCard")};return a.watch(()=>t.visible,C=>{C&&(l(),t.currentModelId?(o.value=t.currentModelId,m({modelId:t.currentModelId})):c.value.length>0&&(o.value=c.value[0]?.value,m({modelId:o.value})))}),a.watch(()=>t.currentModelId,C=>{C&&t.visible&&(o.value=C,m({modelId:C}))}),(C,I)=>(a.openBlock(),a.createBlock(je,{visible:i.visible,title:"CAD图层","onUpdate:visible":I[3]||(I[3]=P=>C.$emit("update:visible",P)),onClose:y,width:360,align:"right","initial-position":{x:0,y:60}},{"header-extra":a.withCtx(()=>[a.createElementVNode("div",{class:"header-select-container",onMousedown:I[2]||(I[2]=a.withModifiers(()=>{},["stop"]))},[I[4]||(I[4]=a.createElementVNode("span",{class:"header-label"},"图纸:",-1)),a.createVNode(a.unref(se.Select),{value:o.value,"onUpdate:value":I[0]||(I[0]=P=>o.value=P),options:c.value,onChange:I[1]||(I[1]=P=>u(P)),placeholder:"选择模型",style:{width:"140px"},bordered:!1,class:"custom-header-select",popupClassName:"leiting-select-dropdown",size:"small"},null,8,["value","options"])],32)]),default:a.withCtx(()=>[a.createElementVNode("div",Ix,[a.createElementVNode("div",Sx,[a.createElementVNode("div",xx,[a.createElementVNode("div",Mx,[a.createElementVNode("input",{type:"checkbox",checked:f.value,onChange:g},null,40,Bx)]),I[5]||(I[5]=a.createElementVNode("div",{class:"col-index"},"序号",-1)),I[6]||(I[6]=a.createElementVNode("div",{class:"col-name"},"图层名称",-1)),I[7]||(I[7]=a.createElementVNode("div",{class:"col-color"},"颜色",-1))]),a.createElementVNode("div",Tx,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,P=>(a.openBlock(),a.createElementBlock("div",{key:P.key,class:"list-item"},[a.createElementVNode("div",Px,[a.createElementVNode("input",{type:"checkbox",checked:h.value.includes(P.key),onChange:k=>A(P.key,k)},null,40,_x)]),a.createElementVNode("div",Dx,a.toDisplayString(P.index),1),a.createElementVNode("div",{class:"col-name",title:P.layerName},a.toDisplayString(P.layerName),9,kx),a.createElementVNode("div",Nx,[a.createElementVNode("input",{type:"color",value:P.layerColor,disabled:""},null,8,Rx)])]))),128)),d.value.length===0?(a.openBlock(),a.createElementBlock("div",Fx,"暂无数据")):a.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-a4db4977"]]),Ox={class:"adjust-panel"},Gx={class:"control-panel"},Ux={class:"form-item"},Vx={class:"radio-group"},Qx={class:"form-item"},Hx=["title"],Yx={class:"param-row"},zx=["step"],jx={class:"param-row"},Wx=["step"],$x={class:"param-row"},Kx=["step"],qx={class:"param-row"},Xx=["step"],Jx={class:"param-row"},Zx=["step"],eM={class:"param-row"},tM=["step"],iM={class:"param-row"},nM=["step"],sM={class:"button-grid"},oM={key:1,class:"pick-mode-ui"},aM=["onClick"],rM=["checked"],lM={style:{"font-size":"12px",color:"#aaa","padding-left":"10px"}},cM={class:"param-row"},dM={style:{width:"40px"}},hM=["onUpdate:modelValue"],uM={class:"param-row"},fM={style:{width:"40px"}},mM=["onUpdate:modelValue"],gM={class:"param-row"},pM={style:{width:"40px"}},AM=["onUpdate:modelValue"],yM={class:"list-panel"},EM={class:"list-header"},CM={class:"col-check"},vM=["checked"],bM={class:"list-body"},wM={class:"col-check"},IM=["onUpdate:modelValue"],SM={class:"col-index"},xM=["title"],MM={class:"col-main"},BM=["checked","onChange"],TM={key:0,style:{padding:"10px","text-align":"center",color:"#999"}},PM=be(a.defineComponent({__name:"LeitingCadPosition",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","handleSavingByCadCard","clearBimPointList","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=a.inject("leitingMethods"),r=a.ref([]),l=a.ref(""),c=a.computed(()=>r.value.length>0&&r.value.every(v=>v.selected)),d=a.ref("param"),h=a.ref("bimPoint1"),f=a.ref(null),m=a.ref("bimPoint1"),u=a.reactive({bimPoint1:{longitude:void 0,latitude:void 0,type:"CAD标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0},bimPoint2:{longitude:void 0,latitude:void 0,type:"地图标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0}}),g=a.ref(1e-6),A=a.reactive({modelId:"",longitude:0,latitude:0,distance:1e-6,rotation:1,totalRotation:0,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0}),p=a.computed(()=>{const v=r.value.find(x=>x.modelId===l.value);return v?v.modelName:""}),y=()=>{s("update:visible",!1)},C=()=>(!f.value&&o?.value?.getViewer&&o?.value?.getCesium&&(f.value=new Sa(o.value.getViewer(),o.value.getCesium())),f.value),I=()=>{C()?.clearMarkers(),u.bimPoint1.longitude=void 0,u.bimPoint1.latitude=void 0,u.bimPoint1.height=void 0,u.bimPoint2.longitude=void 0,u.bimPoint2.latitude=void 0,u.bimPoint2.height=void 0},P=v=>{const x=h.value,N=u[x];if(N){N.longitude=v.longitude,N.latitude=v.latitude,N.height=v.height;const O=x==="bimPoint1"?"BIM":"MAP";C()?.addMarker(O,v),ce.success(`${N.type}已添加`)}},k=()=>{C()?.registerPickHandler(v=>{P(v)})},M=()=>{C()?.destroyPickHandler()},B=v=>{d.value=v,v!=="pick"&&s("clearBimPointList")};a.watch(()=>d.value,v=>{v==="pick"?k():M()}),a.onUnmounted(()=>{M()});const _=()=>{if(!o?.value?.getDxfModels)return;const v=o.value.getDxfModels();if(Array.isArray(v)?r.value=v.map(x=>({modelId:x.modelId,modelName:x.modelName,formData:x.formData||{},selected:!1,tileset:x})):r.value=[],r.value.length>0){const x=o.value.getCadModelId?o.value.getCadModelId():"";x&&r.value.find(N=>N.modelId===x)?E(x):E(r.value[0].modelId),r.value.forEach(N=>N.selected=!0)}},E=v=>{l.value=v;const x=r.value.find(N=>N.modelId===v);x&&x.formData&&Object.keys(A).forEach(N=>{x.formData[N]!==void 0&&(A[N]=x.formData[N])})},w=(v,x)=>{if(!o?.value?.adjustingModelByCad)return;const N=r.value.find(O=>O.modelId===v);N&&N.tileset&&(N.formData={...N.formData,...x},N.tileset.formData=N.formData,o.value.adjustingModelByCad({...N.formData,tileset:N.tileset}))},D=v=>{if(!l.value)return;const x=A[v];w(l.value,{[v]:x})},F=v=>{const x=r.value.filter(L=>L.selected);if(x.length===0){ce.warning("请先选择要调整的模型");return}const{distance:N,heightDistance:O,rotation:Q}=A;x.forEach(L=>{const T={...L.formData};switch(v){case"north":T.latitude+=N;break;case"south":T.latitude-=N;break;case"east":T.longitude+=N;break;case"west":T.longitude-=N;break;case"up":T.height+=O;break;case"down":T.height-=O;break;case"rotateLeft":T.totalRotation=(T.totalRotation||0)-Q;break;case"rotateRight":T.totalRotation=(T.totalRotation||0)+Q;break}L.modelId===l.value&&Object.assign(A,T),w(L.modelId,T)})},U=v=>{const x=v.target.checked;r.value.forEach(N=>N.selected=x)},R=()=>{s("handleSavingByCadCard",r.value),s("save",r.value)},b=()=>{const v=u.bimPoint1,x=u.bimPoint2;if(v.longitude===void 0||x.longitude===void 0){ce.warning("请先完成点选操作");return}const N=r.value.filter(S=>S.selected);if(N.length===0){ce.warning("请先选择要调整的模型");return}let O=0,Q=0,L=0;const T=C();if(T){const{dLon:S,dLat:G,dHeight:Y}=T.calculateOffset(v,x);O=S,Q=G,L=Y}else O=x.longitude-v.longitude,Q=x.latitude-v.latitude,L=x.height-v.height;N.forEach(S=>{const G={...S.formData};G.longitude+=O,G.latitude+=Q,G.height+=L,S.modelId===l.value&&Object.assign(A,G),w(S.modelId,G)}),ce.success("位置已调整")};return a.watch(()=>n.visible,v=>{v?_():(M(),I())}),a.onMounted(()=>{n.visible&&_()}),e({setBIMPointsList:({longitude:v,latitude:x,height:N})=>{u[m.value].longitude=v,u[m.value].latitude=x,u[m.value].height=N},addGltfOr3dTilesModelList:v=>{console.warn("addGltfOr3dTilesModelList is deprecated, use internal loading")}}),(v,x)=>(a.openBlock(),a.createBlock(je,{visible:n.visible,title:"Cad校准",width:282,height:600,"onUpdate:visible":x[21]||(x[21]=N=>s("update:visible",N)),onClose:y},{default:a.withCtx(()=>[a.createElementVNode("div",Ox,[a.createElementVNode("div",Gx,[a.createElementVNode("div",Ux,[x[22]||(x[22]=a.createElementVNode("label",null,"调整操作:",-1)),a.createElementVNode("div",Vx,[a.createElementVNode("span",{class:a.normalizeClass({active:d.value==="param"}),onClick:x[0]||(x[0]=N=>B("param"))},"参数模式",2),a.createElementVNode("span",{class:a.normalizeClass({active:d.value==="pick"}),onClick:x[1]||(x[1]=N=>B("pick"))},"地图点选",2)])]),a.createElementVNode("div",Qx,[x[23]||(x[23]=a.createElementVNode("label",null,"当前主模型:",-1)),a.createElementVNode("span",{class:"value",title:p.value},a.toDisplayString(p.value||"未选择"),9,Hx)]),x[35]||(x[35]=a.createElementVNode("div",{class:"separator"},null,-1)),d.value==="param"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[x[31]||(x[31]=a.createElementVNode("div",{class:"group-header"},"当前状态",-1)),a.createElementVNode("div",Yx,[x[24]||(x[24]=a.createElementVNode("label",null,"经度(东西):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[2]||(x[2]=N=>A.longitude=N),onChange:x[3]||(x[3]=N=>D("longitude")),step:g.value},null,40,zx),[[a.vModelText,A.longitude,void 0,{number:!0}]])]),a.createElementVNode("div",jx,[x[25]||(x[25]=a.createElementVNode("label",null,"纬度(南北):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[4]||(x[4]=N=>A.latitude=N),onChange:x[5]||(x[5]=N=>D("latitude")),step:g.value},null,40,Wx),[[a.vModelText,A.latitude,void 0,{number:!0}]])]),a.createElementVNode("div",$x,[x[26]||(x[26]=a.createElementVNode("label",null,"高度(m):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[6]||(x[6]=N=>A.height=N),onChange:x[7]||(x[7]=N=>D("height")),step:g.value},null,40,Kx),[[a.vModelText,A.height,void 0,{number:!0}]])]),a.createElementVNode("div",qx,[x[27]||(x[27]=a.createElementVNode("label",null,"累计旋转(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[8]||(x[8]=N=>A.totalRotation=N),onChange:x[9]||(x[9]=N=>D("totalRotation")),step:g.value},null,40,Xx),[[a.vModelText,A.totalRotation,void 0,{number:!0}]])]),x[32]||(x[32]=a.createElementVNode("div",{class:"separator"},null,-1)),x[33]||(x[33]=a.createElementVNode("div",{class:"group-header"},"调整步长",-1)),a.createElementVNode("div",Jx,[x[28]||(x[28]=a.createElementVNode("label",null,"经纬步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[10]||(x[10]=N=>A.distance=N),step:g.value},null,8,Zx),[[a.vModelText,A.distance,void 0,{number:!0}]])]),a.createElementVNode("div",eM,[x[29]||(x[29]=a.createElementVNode("label",null,"高度步长(m):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[11]||(x[11]=N=>A.heightDistance=N),step:g.value},null,8,tM),[[a.vModelText,A.heightDistance,void 0,{number:!0}]])]),a.createElementVNode("div",iM,[x[30]||(x[30]=a.createElementVNode("label",null,"旋转步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":x[12]||(x[12]=N=>A.rotation=N),step:g.value},null,8,nM),[[a.vModelText,A.rotation,void 0,{number:!0}]])]),a.createElementVNode("div",sM,[a.createElementVNode("button",{onClick:x[13]||(x[13]=N=>F("rotateLeft"))},"左转"),a.createElementVNode("button",{onClick:x[14]||(x[14]=N=>F("north"))},"北移"),a.createElementVNode("button",{onClick:x[15]||(x[15]=N=>F("rotateRight"))},"右转"),a.createElementVNode("button",{onClick:x[16]||(x[16]=N=>F("west"))},"西移"),a.createElementVNode("button",{onClick:x[17]||(x[17]=N=>F("south"))},"南移"),a.createElementVNode("button",{onClick:x[18]||(x[18]=N=>F("east"))},"东移"),a.createElementVNode("button",{onClick:x[19]||(x[19]=N=>F("up"))},"上移"),a.createElementVNode("button",{onClick:x[20]||(x[20]=N=>F("down"))},"下移"),a.createElementVNode("button",{onClick:R,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):(a.openBlock(),a.createElementBlock("div",oM,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(u,(N,O)=>(a.openBlock(),a.createElementBlock("div",{key:O,class:"form-item",style:{display:"block","margin-bottom":"15px"}},[a.createElementVNode("div",{style:{"font-weight":"bold","margin-bottom":"5px",cursor:"pointer",display:"flex","align-items":"center"},onClick:Q=>h.value=O},[a.createElementVNode("input",{type:"radio",checked:h.value===O,style:{"margin-right":"5px"}},null,8,rM),a.createTextVNode(" "+a.toDisplayString(N.type)+": ",1)],8,aM),a.createElementVNode("div",lM,[a.createElementVNode("div",cM,[a.createElementVNode("label",dM,a.toDisplayString(N.longitudeText),1),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":Q=>N.longitude=Q,readonly:"",style:{width:"100px"}},null,8,hM),[[a.vModelText,N.longitude,void 0,{number:!0}]])]),a.createElementVNode("div",uM,[a.createElementVNode("label",fM,a.toDisplayString(N.latitudeText),1),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":Q=>N.latitude=Q,readonly:"",style:{width:"100px"}},null,8,mM),[[a.vModelText,N.latitude,void 0,{number:!0}]])]),a.createElementVNode("div",gM,[a.createElementVNode("label",pM,a.toDisplayString(N.heightText),1),a.withDirectives(a.createElementVNode("input",{type:"number","onUpdate:modelValue":Q=>N.height=Q,readonly:"",style:{width:"100px"}},null,8,AM),[[a.vModelText,N.height,void 0,{number:!0}]])])])]))),128)),a.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[a.createElementVNode("button",{onClick:b,class:"primary-btn"},"应用校准"),a.createElementVNode("button",{onClick:R},"保存")]),x[34]||(x[34]=a.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[a.createElementVNode("div",null,"操作指南:"),a.createElementVNode("div",null,"1. 勾选上方 CAD 或 地图 标记点选项。"),a.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),a.createElementVNode("div",null,"3. 采集两点后,点击“应用校准”进行校准。")],-1))]))]),a.createElementVNode("div",yM,[a.createElementVNode("div",EM,[a.createElementVNode("div",CM,[a.createElementVNode("input",{type:"checkbox",checked:c.value,onChange:U},null,40,vM)]),x[36]||(x[36]=a.createElementVNode("div",{class:"col-index"},"序号",-1)),x[37]||(x[37]=a.createElementVNode("div",{class:"col-name"},"名称",-1)),x[38]||(x[38]=a.createElementVNode("div",{class:"col-main"},"主模型",-1))]),a.createElementVNode("div",bM,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,(N,O)=>(a.openBlock(),a.createElementBlock("div",{key:N.modelId,class:a.normalizeClass(["list-item",{active:N.modelId===l.value}])},[a.createElementVNode("div",wM,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":Q=>N.selected=Q},null,8,IM),[[a.vModelCheckbox,N.selected]])]),a.createElementVNode("div",SM,a.toDisplayString(O+1),1),a.createElementVNode("div",{class:"col-name",title:N.modelName},a.toDisplayString(N.modelName),9,xM),a.createElementVNode("div",MM,[a.createElementVNode("input",{type:"radio",name:"mainModel",checked:N.modelId===l.value,onChange:Q=>E(N.modelId)},null,40,BM)])],2))),128)),r.value.length===0?(a.openBlock(),a.createElementBlock("div",TM,"暂无数据")):a.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-e8abd49d"]]),_M={class:"coord-transform-card"},DM={class:"param-row"},kM={class:"param-row"},NM={class:"param-row"},RM={class:"param-row"},FM={class:"param-row"},LM={class:"param-row"},OM={class:"param-row"},GM=be(a.defineComponent({__name:"LeitingGISCadCoordTransform",emits:["apply-transform"],setup(i,{emit:e}){const t=e,n=a.inject("leitingMethods"),s=a.ref("projectedToLonlat"),o=a.reactive({centralMeridian:117,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"}),r=()=>{const c=n?.value?.getDefaultGISCadTransformConfig?.()||{centralMeridian:117,latOrigin:0,scaleFactor:1,falseEasting:5e5,falseNorthing:0,ellipsoid:"GRS80"};Object.assign(o,c)},l=()=>{t("apply-transform",{direction:s.value,config:{...o}})};return r(),(c,d)=>(a.openBlock(),a.createElementBlock("div",_M,[a.createElementVNode("div",DM,[d[9]||(d[9]=a.createElementVNode("label",null,"转换方向:",-1)),a.createVNode(a.unref(se.Select),{value:s.value,"onUpdate:value":d[0]||(d[0]=h=>s.value=h),class:"custom-select",popupClassName:"leiting-select-dropdown",size:"small"},{default:a.withCtx(()=>[a.createVNode(a.unref(se.SelectOption),{value:"projectedToLonlat"},{default:a.withCtx(()=>[...d[7]||(d[7]=[a.createTextVNode("投影转经纬 (根据模型局部坐标)",-1)])]),_:1}),a.createVNode(a.unref(se.SelectOption),{value:"lonlatToProjected"},{default:a.withCtx(()=>[...d[8]||(d[8]=[a.createTextVNode("经纬转投影 (根据模型经纬度)",-1)])]),_:1})]),_:1},8,["value"])]),a.createElementVNode("div",kM,[d[10]||(d[10]=a.createElementVNode("label",null,"中央经线:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=h=>o.centralMeridian=h),type:"number"},null,512),[[a.vModelText,o.centralMeridian,void 0,{number:!0}]])]),a.createElementVNode("div",NM,[d[11]||(d[11]=a.createElementVNode("label",null,"纬度基线:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":d[2]||(d[2]=h=>o.latOrigin=h),type:"number"},null,512),[[a.vModelText,o.latOrigin,void 0,{number:!0}]])]),a.createElementVNode("div",RM,[d[12]||(d[12]=a.createElementVNode("label",null,"投影比例:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":d[3]||(d[3]=h=>o.scaleFactor=h),type:"number",step:"0.000001"},null,512),[[a.vModelText,o.scaleFactor,void 0,{number:!0}]])]),a.createElementVNode("div",FM,[d[13]||(d[13]=a.createElementVNode("label",null,"东偏移:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":d[4]||(d[4]=h=>o.falseEasting=h),type:"number"},null,512),[[a.vModelText,o.falseEasting,void 0,{number:!0}]])]),a.createElementVNode("div",LM,[d[14]||(d[14]=a.createElementVNode("label",null,"北偏移:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":d[5]||(d[5]=h=>o.falseNorthing=h),type:"number"},null,512),[[a.vModelText,o.falseNorthing,void 0,{number:!0}]])]),a.createElementVNode("div",OM,[d[19]||(d[19]=a.createElementVNode("label",null,"椭球体:",-1)),a.createVNode(a.unref(se.Select),{value:o.ellipsoid,"onUpdate:value":d[6]||(d[6]=h=>o.ellipsoid=h),class:"custom-select",popupClassName:"leiting-select-dropdown",size:"small"},{default:a.withCtx(()=>[a.createVNode(a.unref(se.SelectOption),{value:"GRS80"},{default:a.withCtx(()=>[...d[15]||(d[15]=[a.createTextVNode("CGCS2000 (GRS80)",-1)])]),_:1}),a.createVNode(a.unref(se.SelectOption),{value:"WGS84"},{default:a.withCtx(()=>[...d[16]||(d[16]=[a.createTextVNode("WGS84",-1)])]),_:1}),a.createVNode(a.unref(se.SelectOption),{value:"krass"},{default:a.withCtx(()=>[...d[17]||(d[17]=[a.createTextVNode("北京54 (Krassovsky)",-1)])]),_:1}),a.createVNode(a.unref(se.SelectOption),{value:"IAU76"},{default:a.withCtx(()=>[...d[18]||(d[18]=[a.createTextVNode("西安80 (IAU76)",-1)])]),_:1})]),_:1},8,["value"])]),a.createElementVNode("div",{class:"button-grid transform-actions"},[a.createElementVNode("button",{class:"primary-btn",onClick:l,style:{"grid-column":"span 2"}},"应用到选中模型"),a.createElementVNode("button",{onClick:r},"默认参数")]),d[20]||(d[20]=a.createElementVNode("div",{class:"instructions"},[a.createElementVNode("div",null,"操作指南:"),a.createElementVNode("div",null,"1. 在列表中勾选需要转换的模型。"),a.createElementVNode("div",null,"2. 配置对应坐标系的转换参数。"),a.createElementVNode("div",null,"3. 点击“应用到选中模型”进行批量转换预览。")],-1))]))}}),[["__scopeId","data-v-f7dac720"]]),UM={class:"adjust-panel"},VM={class:"control-panel"},QM={class:"form-item"},HM={class:"radio-group"},YM={class:"form-item"},zM=["title"],jM={class:"param-row"},WM=["step"],$M={class:"param-row"},KM=["step"],qM={class:"param-row"},XM=["step"],JM={class:"param-row"},ZM=["step"],eB={class:"param-row"},tB=["step"],iB={class:"param-row"},nB=["step"],sB={class:"param-row"},oB=["step"],aB={class:"param-row"},rB=["step"],lB={class:"param-row"},cB=["step"],dB={class:"button-grid"},hB={class:"action-buttons"},uB={key:1,class:"pick-mode-ui"},fB=["onClick"],mB=["checked","onChange"],gB={class:"pick-point-body"},pB={class:"param-row"},AB={class:"pick-label"},yB=["onUpdate:modelValue"],EB={class:"param-row"},CB={class:"pick-label"},vB=["onUpdate:modelValue"],bB={class:"param-row"},wB={class:"pick-label"},IB=["onUpdate:modelValue"],SB={class:"button-grid pick-button-grid"},xB={class:"list-panel"},MB={class:"list-header"},BB={class:"col-check"},TB=["checked"],PB={class:"list-body"},_B={class:"col-check"},DB=["onUpdate:modelValue"],kB={class:"col-index"},NB=["title"],RB={class:"col-main"},FB=["checked","onChange"],LB={key:0,class:"empty-text"},OB=be(a.defineComponent({__name:"LeitingGISCadPosition",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref(1e-6),r=a.ref([]),l=a.ref(""),c=a.ref("param"),d=a.ref("cadPoint"),h=a.ref(null),f=a.reactive({cadPoint:{longitude:void 0,latitude:void 0,height:void 0,type:"CAD标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程"},mapPoint:{longitude:void 0,latitude:void 0,height:void 0,type:"地图标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程"}}),m=a.reactive({modelId:"",longitude:0,latitude:0,height:0,totalRotation:0,scale:1,distance:1e-4,heightDistance:1,rotation:1,scaleStep:.1,localOriginX:0,localOriginY:0,clampToGround:!1}),u=a.computed(()=>r.value.length>0&&r.value.every(T=>T.selected)),g=a.computed(()=>r.value.find(T=>T.modelId===l.value)?.modelName||""),A=()=>(!h.value&&s?.value?.getViewer&&s?.value?.getCesium&&(h.value=new Sa(s.value.getViewer(),s.value.getCesium())),h.value),p=()=>{f.cadPoint.longitude=void 0,f.cadPoint.latitude=void 0,f.cadPoint.height=void 0,f.mapPoint.longitude=void 0,f.mapPoint.latitude=void 0,f.mapPoint.height=void 0},y=()=>{h.value?.clearMarkers(),p()},C=T=>{const S=d.value,G=f[S];G&&(G.longitude=T.longitude,G.latitude=T.latitude,G.height=T.height,A()?.addMarker(S==="cadPoint"?"BIM":"MAP",T),ce.success(`${G.type}已添加`))},I=()=>{A()?.registerPickHandler(S=>{C(S)})},P=()=>{h.value?.destroyPickHandler()},k=T=>{c.value=T},M=T=>{(T==="cadPoint"||T==="mapPoint")&&(d.value=T)},B=T=>{const S=T?.editingFormData||T?.formData||{};return{modelId:T?.modelId||"",longitude:Number(S.longitude??0),latitude:Number(S.latitude??0),height:Number(S.height??0),totalRotation:Number(S.totalRotation??0),scale:Math.max(1e-6,Number(S.scale??1)),distance:Number(S.distance??1e-6),heightDistance:Number(S.heightDistance??1),rotation:Number(S.rotation??1),scaleStep:Number(S.scaleStep??.1),localOriginX:Number(S.localOriginX??0),localOriginY:Number(S.localOriginY??0),transformConfig:S.transformConfig||void 0,transformDirection:S.transformDirection||void 0,clampToGround:S.clampToGround??!1}},_=()=>{const T=r.value.find(S=>S.modelId===l.value);T&&Object.assign(m,T.formData,{modelId:T.modelId})},E=()=>{if(!s?.value?.getGISCadModels){r.value=[];return}const T=new Map(r.value.map(W=>[W.modelId,W.selected])),S=s.value.getGISCadModels()||[];if(r.value=Array.isArray(S)?S.map(W=>({modelId:W.modelId,modelName:W.modelName,selected:T.get(W.modelId)??!0,runtimeModel:W,formData:B(W)})):[],!r.value.length){l.value="";return}const G=r.value[0];if(!G)return;const Y=s.value.getGISCadModelId?.()||l.value||G.modelId,q=r.value.find(W=>W.modelId===Y);l.value=q?.modelId||G.modelId,_()},w=T=>{l.value=T,_()},D=(T,S)=>{if(!s?.value?.adjustGISCadModel)return null;s.value.beginEditGISCad?.({modelId:T});const G=s.value.adjustGISCadModel({modelId:T,...S}),Y=r.value.find(q=>q.modelId===T);return Y&&G&&(Y.formData={...Y.formData,...G,modelId:T},Y.runtimeModel={...Y.runtimeModel,editingFormData:G,isEditing:!0}),T===l.value&&Object.assign(m,Y?.formData||m,{modelId:T}),G},F=T=>{if(!l.value)return;const S=r.value.find(W=>W.modelId===l.value);if(!S)return;if(T==="clampToGround"){const W=!!m[T];D(l.value,{[T]:W}),r.value.filter(re=>re.selected&&re.modelId!==l.value).forEach(re=>{D(re.modelId,{[T]:W})});return}const G=Number(m[T]),Y=Number(S.formData[T]),q=G-Y;D(l.value,{[T]:T==="scale"?Math.max(1e-6,G):G}),!(q===0||T==="scale")&&r.value.filter(W=>W.selected&&W.modelId!==l.value).forEach(W=>{D(W.modelId,{[T]:Number(W.formData[T])+q})})},U=T=>{const S=r.value.filter(G=>G.selected);if(!S.length){ce.warning("请先选择要调整的模型");return}S.forEach(G=>{const Y={...G.formData};switch(T){case"north":Y.latitude+=m.distance;break;case"south":Y.latitude-=m.distance;break;case"east":Y.longitude+=m.distance;break;case"west":Y.longitude-=m.distance;break;case"up":Y.height+=m.heightDistance;break;case"down":Y.height-=m.heightDistance;break;case"rotateLeft":Y.totalRotation-=m.rotation;break;case"rotateRight":Y.totalRotation+=m.rotation;break;case"scaleUp":Y.scale=Math.max(1e-6,Y.scale+m.scaleStep);break;case"scaleDown":Y.scale=Math.max(1e-6,Y.scale-m.scaleStep);break;default:return}Y.distance=m.distance,Y.heightDistance=m.heightDistance,Y.rotation=m.rotation,Y.scaleStep=m.scaleStep,D(G.modelId,Y)})},R=({direction:T,config:S})=>{const G=r.value.filter(W=>W.selected);if(!G.length){ce.warning("请先选择要转换的模型");return}if(!s?.value?.transformGISCadCoordinate){ce.warning("未找到 GIS CAD 坐标转换方法");return}let q=0;G.forEach(W=>{try{const re=Number(W.formData.localOriginX),ae=Number(W.formData.localOriginY);let de={longitude:W.formData.longitude,latitude:W.formData.latitude};const he=s?.value?.transformGISCadCoordinate;if(he){const ge=he({direction:T,...T==="projectedToLonlat"?{x:re,y:ae}:{longitude:W.formData.longitude,latitude:W.formData.latitude},config:{...S}});T==="projectedToLonlat"&&ge.longitude&&(de.longitude=ge.longitude,de.latitude=ge.latitude)}D(W.modelId,{transformConfig:{...S},transformDirection:T,longitude:de.longitude,latitude:de.latitude}),q++}catch(re){console.warn("Transform failed for model",W.modelId,re)}}),q>0?ce.success(`已成功转换 ${q} 个模型的坐标并重新加载,请预览后提交贴地`):ce.error("坐标转换失败,请检查参数或模型状态")},b=()=>{m.clampToGround=!m.clampToGround,F("clampToGround")},v=()=>{const T=f.cadPoint,S=f.mapPoint;if(T.longitude===void 0||T.latitude===void 0||T.height===void 0||S.longitude===void 0||S.latitude===void 0||S.height===void 0){ce.warning("请先完成 CAD 和地图点位采集");return}const Y=r.value.filter(ae=>ae.selected);if(!Y.length){ce.warning("请先选择要调整的模型");return}const{dLon:q,dLat:W,dHeight:re}=A()?.calculateOffset(T,S)||{dLon:S.longitude-T.longitude,dLat:S.latitude-T.latitude,dHeight:S.height-T.height};Y.forEach(ae=>{D(ae.modelId,{longitude:Number(ae.formData.longitude)+q,latitude:Number(ae.formData.latitude)+W,height:Number(ae.formData.height)+re})}),ce.success("点选校准预览已更新")},x=()=>{const T=r.value.filter(G=>G.selected);if(!T.length){ce.warning("请先选择要提交的模型");return}const S=[];T.forEach(G=>{const Y=s?.value?.commitEditGISCad?.({modelId:G.modelId});Y&&Y.formData&&S.push({modelId:Y.modelId,formData:Y.formData})}),E(),S.length>0&&s?.value?.onGISCadPositionChange&&s.value.onGISCadPositionChange(S),ce.success("GIS CAD 已提交为贴地结果")},N=()=>{r.value.forEach(T=>{s?.value?.cancelEditGISCad?.({modelId:T.modelId})})},O=()=>{if(!l.value){ce.warning("请先选择主模型");return}const T=r.value.find(W=>W.modelId===l.value);if(!T||!s?.value?.getViewer)return;const S=s.value.getViewer(),G=s.value.getCesium(),Y=T.runtimeModel;if(!Y){ce.warning("未找到模型运行时信息");return}const q=Y.isEditing?Y.previewRoot:Y.groundRoot||Y.root;if(q){const W=Y.isEditing?Y.editingFormData:Y.formData;if(W&&W.longitude!==void 0&&W.latitude!==void 0){const re=G.Cartesian3.fromDegrees(W.longitude,W.latitude,W.height||0);let ae=100;if(Y.bounds&&Y.bounds.rectangleDegrees){const he=Y.bounds.rectangleDegrees,ge=G.Cartesian3.fromDegrees((he.west+he.east)/2,(he.south+he.north)/2,0),De=G.Cartesian3.fromDegrees(he.east,he.north,0);ae=G.Cartesian3.distance(ge,De)}const de=new G.BoundingSphere(re,ae);S.camera.flyToBoundingSphere(de,{offset:new G.HeadingPitchRange(0,G.Math.toRadians(-90),de.radius*2),duration:1.5})}else S.flyTo(q,{offset:new G.HeadingPitchRange(0,G.Math.toRadians(-90),0),duration:1.5})}else ce.warning("未找到模型渲染对象")},Q=T=>{const S=T.target.checked;r.value.forEach(G=>{G.selected=S})},L=()=>{N(),P(),y(),n("update:visible",!1)};return a.watch(c,T=>{t.visible&&(T==="pick"?I():P())}),a.watch(()=>t.visible,T=>{T?(E(),c.value==="pick"&&I()):(P(),y(),N(),E())}),a.onMounted(()=>{t.visible&&(E(),c.value==="pick"&&I())}),a.onUnmounted(()=>{P(),y(),N()}),(T,S)=>(a.openBlock(),a.createBlock(je,{visible:t.visible,title:"GIS CAD 调整",width:340,"onUpdate:visible":S[27]||(S[27]=G=>n("update:visible",G)),onClose:L},{default:a.withCtx(()=>[a.createElementVNode("div",UM,[a.createElementVNode("div",VM,[a.createElementVNode("div",QM,[S[28]||(S[28]=a.createElementVNode("label",null,"调整操作:",-1)),a.createElementVNode("div",HM,[a.createElementVNode("span",{class:a.normalizeClass({active:c.value==="param"}),onClick:S[0]||(S[0]=G=>k("param"))}," 参数模式 ",2),a.createElementVNode("span",{class:a.normalizeClass({active:c.value==="pick"}),onClick:S[1]||(S[1]=G=>k("pick"))}," 地图点选 ",2),a.createElementVNode("span",{class:a.normalizeClass({active:c.value==="transform"}),onClick:S[2]||(S[2]=G=>k("transform"))}," 坐标转换 ",2)])]),a.createElementVNode("div",YM,[S[29]||(S[29]=a.createElementVNode("label",null,"当前主模型:",-1)),a.createElementVNode("span",{class:"value",title:g.value},a.toDisplayString(g.value||"未选择"),9,zM)]),S[43]||(S[43]=a.createElementVNode("div",{class:"separator"},null,-1)),c.value==="param"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[S[39]||(S[39]=a.createElementVNode("div",{class:"group-header"},"当前状态",-1)),a.createElementVNode("div",jM,[S[30]||(S[30]=a.createElementVNode("label",null,"经度(东西):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[3]||(S[3]=G=>m.longitude=G),type:"number",step:o.value,onChange:S[4]||(S[4]=G=>F("longitude"))},null,40,WM),[[a.vModelText,m.longitude,void 0,{number:!0}]])]),a.createElementVNode("div",$M,[S[31]||(S[31]=a.createElementVNode("label",null,"纬度(南北):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[5]||(S[5]=G=>m.latitude=G),type:"number",step:o.value,onChange:S[6]||(S[6]=G=>F("latitude"))},null,40,KM),[[a.vModelText,m.latitude,void 0,{number:!0}]])]),a.createElementVNode("div",qM,[S[32]||(S[32]=a.createElementVNode("label",null,"高度(m):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[7]||(S[7]=G=>m.height=G),type:"number",step:o.value,onChange:S[8]||(S[8]=G=>F("height"))},null,40,XM),[[a.vModelText,m.height,void 0,{number:!0}]])]),a.createElementVNode("div",JM,[S[33]||(S[33]=a.createElementVNode("label",null,"累计旋转(°):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[9]||(S[9]=G=>m.totalRotation=G),type:"number",step:o.value,onChange:S[10]||(S[10]=G=>F("totalRotation"))},null,40,ZM),[[a.vModelText,m.totalRotation,void 0,{number:!0}]])]),a.createElementVNode("div",eB,[S[34]||(S[34]=a.createElementVNode("label",null,"缩放比例:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[11]||(S[11]=G=>m.scale=G),type:"number",min:"0.000001",step:o.value,onChange:S[12]||(S[12]=G=>F("scale"))},null,40,tB),[[a.vModelText,m.scale,void 0,{number:!0}]])]),S[40]||(S[40]=a.createElementVNode("div",{class:"separator"},null,-1)),S[41]||(S[41]=a.createElementVNode("div",{class:"group-header"},"调整步长",-1)),a.createElementVNode("div",iB,[S[35]||(S[35]=a.createElementVNode("label",null,"经纬步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[13]||(S[13]=G=>m.distance=G),type:"number",step:o.value},null,8,nB),[[a.vModelText,m.distance,void 0,{number:!0}]])]),a.createElementVNode("div",sB,[S[36]||(S[36]=a.createElementVNode("label",null,"高度步长(m):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[14]||(S[14]=G=>m.heightDistance=G),type:"number",step:o.value},null,8,oB),[[a.vModelText,m.heightDistance,void 0,{number:!0}]])]),a.createElementVNode("div",aB,[S[37]||(S[37]=a.createElementVNode("label",null,"旋转步长(°):",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[15]||(S[15]=G=>m.rotation=G),type:"number",step:o.value},null,8,rB),[[a.vModelText,m.rotation,void 0,{number:!0}]])]),a.createElementVNode("div",lB,[S[38]||(S[38]=a.createElementVNode("label",null,"缩放步长:",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S[16]||(S[16]=G=>m.scaleStep=G),type:"number",step:o.value},null,8,cB),[[a.vModelText,m.scaleStep,void 0,{number:!0}]])]),a.createElementVNode("div",dB,[a.createElementVNode("button",{onClick:S[17]||(S[17]=G=>U("rotateLeft"))},"左转"),a.createElementVNode("button",{onClick:S[18]||(S[18]=G=>U("north"))},"北移"),a.createElementVNode("button",{onClick:S[19]||(S[19]=G=>U("rotateRight"))},"右转"),a.createElementVNode("button",{onClick:S[20]||(S[20]=G=>U("west"))},"西移"),a.createElementVNode("button",{onClick:S[21]||(S[21]=G=>U("south"))},"南移"),a.createElementVNode("button",{onClick:S[22]||(S[22]=G=>U("east"))},"东移"),a.createElementVNode("button",{onClick:S[23]||(S[23]=G=>U("up"))},"上移"),a.createElementVNode("button",{onClick:S[24]||(S[24]=G=>U("scaleDown"))},"缩小"),a.createElementVNode("button",{onClick:S[25]||(S[25]=G=>U("scaleUp"))},"放大"),a.createElementVNode("button",{onClick:S[26]||(S[26]=G=>U("down"))},"下移")]),a.createElementVNode("div",hB,[a.createElementVNode("button",{class:a.normalizeClass({"primary-btn":m.clampToGround}),onClick:b}," 贴地 ",2),a.createElementVNode("button",{onClick:x},"保存位置"),a.createElementVNode("button",{onClick:O},"正北俯视")])],64)):c.value==="pick"?(a.openBlock(),a.createElementBlock("div",uB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f,(G,Y)=>(a.openBlock(),a.createElementBlock("div",{key:Y,class:"pick-point-item"},[a.createElementVNode("div",{class:"pick-point-title",onClick:q=>M(Y)},[a.createElementVNode("input",{type:"radio",name:"gisCadPickPoint",checked:d.value===Y,onChange:q=>M(Y)},null,40,mB),a.createElementVNode("span",null,a.toDisplayString(G.type)+":",1)],8,fB),a.createElementVNode("div",gB,[a.createElementVNode("div",pB,[a.createElementVNode("label",AB,a.toDisplayString(G.longitudeText),1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":q=>G.longitude=q,type:"number",readonly:""},null,8,yB),[[a.vModelText,G.longitude,void 0,{number:!0}]])]),a.createElementVNode("div",EB,[a.createElementVNode("label",CB,a.toDisplayString(G.latitudeText),1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":q=>G.latitude=q,type:"number",readonly:""},null,8,vB),[[a.vModelText,G.latitude,void 0,{number:!0}]])]),a.createElementVNode("div",bB,[a.createElementVNode("label",wB,a.toDisplayString(G.heightText),1),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":q=>G.height=q,type:"number",readonly:""},null,8,IB),[[a.vModelText,G.height,void 0,{number:!0}]])])])]))),128)),a.createElementVNode("div",SB,[a.createElementVNode("button",{class:"primary-btn",onClick:v},"应用校准"),a.createElementVNode("button",{class:a.normalizeClass({"primary-btn":m.clampToGround}),onClick:b}," 贴地 ",2),a.createElementVNode("button",{onClick:O},"正北俯视")]),S[42]||(S[42]=a.createElementVNode("div",{class:"instructions"},[a.createElementVNode("div",null,"操作指南:"),a.createElementVNode("div",null,"1. 先选择上方 CAD 标记点或地图标记点。"),a.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),a.createElementVNode("div",null,"3. 采集两点后,点击“应用校准”进行预览。"),a.createElementVNode("div",null,"4. 确认结果后,点击“提交贴地”生效。")],-1))])):c.value==="transform"?(a.openBlock(),a.createBlock(GM,{key:2,onApplyTransform:R})):a.createCommentVNode("",!0)]),a.createElementVNode("div",xB,[a.createElementVNode("div",MB,[a.createElementVNode("div",BB,[a.createElementVNode("input",{type:"checkbox",checked:u.value,onChange:Q},null,40,TB)]),S[44]||(S[44]=a.createElementVNode("div",{class:"col-index"},"序号",-1)),S[45]||(S[45]=a.createElementVNode("div",{class:"col-name"},"名称",-1)),S[46]||(S[46]=a.createElementVNode("div",{class:"col-main"},"主模型",-1))]),a.createElementVNode("div",PB,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,(G,Y)=>(a.openBlock(),a.createElementBlock("div",{key:G.modelId,class:a.normalizeClass(["list-item",{active:G.modelId===l.value}])},[a.createElementVNode("div",_B,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":q=>G.selected=q,type:"checkbox"},null,8,DB),[[a.vModelCheckbox,G.selected]])]),a.createElementVNode("div",kB,a.toDisplayString(Y+1),1),a.createElementVNode("div",{class:"col-name",title:G.modelName},a.toDisplayString(G.modelName),9,NB),a.createElementVNode("div",RB,[a.createElementVNode("input",{checked:G.modelId===l.value,type:"radio",name:"gisCadMainModel",onChange:q=>w(G.modelId)},null,40,FB)])],2))),128)),r.value.length===0?(a.openBlock(),a.createElementBlock("div",LB,"暂无 GIS CAD 数据")):a.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-689bac33"]]),GB={class:"annotation-content"},UB={class:"annotation-tools"},VB={class:"annotation-controls"},QB={class:"control-group",title:"颜色"},HB={class:"tool-item color-tool"},YB={class:"control-group line-width-container",title:"线宽"},zB=["onClick"],jB={class:"option-label"},WB=be(a.defineComponent({__name:"LeitingAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref(""),r=a.ref("#ff0000"),l=a.ref(1),c=a.ref(!1),d=a.ref(null),h=a.ref(null),f=a.ref({top:"0px",left:"0px"}),m=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],u=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,g=()=>{n("update:visible",!1)},A=B=>{o.value=B;const _=u();if(_)switch(B){case"freehandLine":_.startFreehandLine();break;case"arrow":_.startArrow();break;case"straightLine":_.startStraightLine();break;case"rectangle":_.startRectangle();break;case"ellipse":_.startEllipse();break}},p=()=>{const B=u();B&&(B.setCurrentColor(r.value),B.changeColor(r.value))},y=()=>{if(!c.value&&d.value){const B=d.value.getBoundingClientRect();f.value={top:`${B.top}px`,left:`${B.right+8}px`}}c.value=!c.value},C=B=>{l.value=B,c.value=!1;const _=u();_&&(_.setCurrentWidth(B),_.changeWidth(B))},I=()=>{const B=u();B&&B.deleteSelectedEntity()},P=()=>{const B=u();B&&B.clearAll()},k=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const B=u();B&&B.saveAnnotations()},M=B=>{const _=B.target,E=d.value&&d.value.contains(_),w=h.value&&h.value.contains(_);!E&&!w&&(c.value=!1)};return a.onMounted(()=>{document.addEventListener("click",M)}),a.onUnmounted(()=>{document.removeEventListener("click",M)}),(B,_)=>(a.openBlock(),a.createBlock(je,{visible:t.visible,title:"标注",width:70,"min-width":70,height:480,"onUpdate:visible":_[6]||(_[6]=E=>n("update:visible",E)),onClose:g},{default:a.withCtx(()=>[a.createElementVNode("div",GB,[a.createElementVNode("div",UB,[a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:o.value==="freehandLine"}]),onClick:_[0]||(_[0]=E=>A("freehandLine")),title:"手绘线"},[..._[7]||(_[7]=[a.createElementVNode("div",{class:"tool-icon"},"✏️",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:o.value==="arrow"}]),onClick:_[1]||(_[1]=E=>A("arrow")),title:"箭头"},[..._[8]||(_[8]=[a.createElementVNode("div",{class:"tool-icon"},"↗️",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:o.value==="straightLine"}]),onClick:_[2]||(_[2]=E=>A("straightLine")),title:"直线"},[..._[9]||(_[9]=[a.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:o.value==="rectangle"}]),onClick:_[3]||(_[3]=E=>A("rectangle")),title:"矩形"},[..._[10]||(_[10]=[a.createElementVNode("div",{class:"tool-icon"},"▭",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:o.value==="ellipse"}]),onClick:_[4]||(_[4]=E=>A("ellipse")),title:"椭圆"},[..._[11]||(_[11]=[a.createElementVNode("div",{class:"tool-icon"},"⭕",-1)])],2)]),_[13]||(_[13]=a.createElementVNode("div",{class:"separator"},null,-1)),a.createElementVNode("div",VB,[a.createElementVNode("div",QB,[a.createElementVNode("div",HB,[a.createElementVNode("div",{class:"color-swatch",style:a.normalizeStyle({backgroundColor:r.value})},null,4),a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":_[5]||(_[5]=E=>r.value=E),onChange:p,class:"color-input-overlay"},null,544),[[a.vModelText,r.value]])])]),a.createElementVNode("div",YB,[a.createElementVNode("div",{ref_key:"lineWidthBtnRef",ref:d,class:"tool-item",onClick:a.withModifiers(y,["stop"])},[a.createElementVNode("div",{class:"current-width-preview",style:a.normalizeStyle({height:l.value+"px",backgroundColor:"#fff"})},null,4)],512),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[c.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,class:"line-width-dropdown",style:a.normalizeStyle(f.value)},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(m,E=>a.createElementVNode("div",{key:E.value,class:a.normalizeClass(["line-width-option",{selected:l.value===E.value}]),onClick:a.withModifiers(w=>C(E.value),["stop"])},[a.createElementVNode("span",jB,a.toDisplayString(E.label),1),a.createElementVNode("div",{class:"line-preview",style:a.normalizeStyle({height:E.value+"px",backgroundColor:l.value===E.value?"#1890ff":"#ddd"})},null,4)],10,zB)),64))],4)):a.createCommentVNode("",!0)]))]),_[12]||(_[12]=a.createElementVNode("div",{class:"separator"},null,-1)),a.createElementVNode("div",{class:"action-buttons"},[a.createElementVNode("button",{class:"control-btn",onClick:I,title:"删除选中"}," 🗑️ "),a.createElementVNode("button",{class:"control-btn",onClick:P,title:"清空"}," ❌ "),a.createElementVNode("button",{class:"control-btn",onClick:k,title:"保存"}," 💾 ")])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-3cfc8415"]]),$B={class:"measure-content"},KB={class:"measure-tools"},qB={key:0,class:"measure-results"},XB={class:"result-row"},JB={class:"result-value"},ZB={class:"result-row"},e4={class:"result-value"},t4={class:"result-row"},i4={class:"result-value"},n4={class:"result-row"},s4={class:"result-value"},o4={key:1,class:"result-row"},a4={class:"result-value"},r4={key:2,class:"result-row"},l4={class:"result-value"},c4={class:"measure-controls"},d4={class:"control-group",title:"单位"},h4={class:"unit-display"},u4=["onClick"],f4=be(a.defineComponent({__name:"LeitingMeasurement",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods",a.ref({})),o=a.ref(null),r=a.ref(null),l=a.ref("m"),c=a.ref(!1),d=a.ref(null),h=a.ref(!1),f=a.ref({}),m=a.ref(null),u=[{label:"米 (m)",value:"m"},{label:"厘米 (cm)",value:"cm"},{label:"毫米 (mm)",value:"mm"}],g=B=>{const _=l.value;return _==="mm"?`${(B*1e3).toFixed(0)}mm`:_==="cm"?`${(B*100).toFixed(1)}cm`:`${B.toFixed(2)}m`},A=B=>B>1e6?`${(B/1e6).toFixed(2)} km²`:`${B.toFixed(2)} m²`,p=()=>{if(!o.value&&s.value?.getViewer){const B=s.value.getViewer(),_=s.value.getCesium();B&&_&&(o.value=new Ca({viewer:B,cesium:_}),o.value.setUnit(l.value),o.value.setSnapping(c.value),o.value.onMeasure=E=>{d.value=E})}},y=B=>{o.value||p(),r.value===B?(r.value=null,o.value?.stop(),s.value?.baseCompt?.enableSelection()):(r.value=B,o.value?.start(B),s.value?.baseCompt?.disableSelection())},C=B=>{l.value=B,h.value=!1},I=()=>{o.value&&(o.value.clearAll(),r.value=null,o.value.stop()),s.value?.baseCompt?.enableSelection()},P=()=>{n("update:visible",!1)},k=B=>{if(h.value){h.value=!1;return}const E=B.currentTarget.getBoundingClientRect();f.value={position:"fixed",top:`${E.top}px`,left:`${E.right+5}px`,zIndex:3e3},h.value=!0},M=B=>{h.value&&m.value&&!m.value.contains(B.target)&&(h.value=!1)};return a.onMounted(()=>{document.addEventListener("click",M),t.visible&&a.nextTick(()=>p())}),a.onUnmounted(()=>{document.removeEventListener("click",M),o.value&&o.value.destroy()}),a.watch(()=>t.visible,B=>{B?a.nextTick(()=>p()):o.value&&(o.value.stop(),r.value=null)}),a.watch(s,B=>{B&&B.getViewer&&!o.value&&t.visible&&p()}),a.watch(l,B=>{o.value&&o.value.setUnit(B)}),(B,_)=>(a.openBlock(),a.createBlock(je,{visible:t.visible,title:"量算",width:70,"min-width":70,height:480,"onUpdate:visible":_[3]||(_[3]=E=>n("update:visible",E)),onClose:P},{default:a.withCtx(()=>[a.createElementVNode("div",$B,[a.createElementVNode("div",KB,[a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:r.value==="distance"}]),onClick:_[0]||(_[0]=E=>y("distance")),title:"距离测量"},[..._[4]||(_[4]=[a.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:r.value==="angle"}]),onClick:_[1]||(_[1]=E=>y("angle")),title:"角度测量"},[..._[5]||(_[5]=[a.createElementVNode("div",{class:"tool-icon"},"📐",-1)])],2),a.createElementVNode("div",{class:a.normalizeClass(["tool-item",{active:r.value==="area"}]),onClick:_[2]||(_[2]=E=>y("area")),title:"面积测量"},[..._[6]||(_[6]=[a.createElementVNode("div",{class:"tool-icon"},"🔳",-1)])],2)]),_[15]||(_[15]=a.createElementVNode("div",{class:"separator"},null,-1)),d.value?(a.openBlock(),a.createElementBlock("div",qB,[d.value.type==="distance"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",XB,[_[7]||(_[7]=a.createElementVNode("span",{class:"result-label"},"总长:",-1)),a.createElementVNode("span",JB,a.toDisplayString(g(d.value.dist)),1)]),a.createElementVNode("div",ZB,[_[8]||(_[8]=a.createElementVNode("span",{class:"result-label",style:{color:"#ff4d4f"}},"ΔX:",-1)),a.createElementVNode("span",e4,a.toDisplayString(g(d.value.dx)),1)]),a.createElementVNode("div",t4,[_[9]||(_[9]=a.createElementVNode("span",{class:"result-label",style:{color:"#52c41a"}},"ΔY:",-1)),a.createElementVNode("span",i4,a.toDisplayString(g(d.value.dy)),1)]),a.createElementVNode("div",n4,[_[10]||(_[10]=a.createElementVNode("span",{class:"result-label",style:{color:"#1890ff"}},"ΔZ:",-1)),a.createElementVNode("span",s4,a.toDisplayString(g(d.value.dz)),1)])],64)):a.createCommentVNode("",!0),d.value.type==="angle"?(a.openBlock(),a.createElementBlock("div",o4,[_[11]||(_[11]=a.createElementVNode("span",{class:"result-label"},"角度:",-1)),a.createElementVNode("span",a4,a.toDisplayString(d.value.angle.toFixed(1))+"°",1)])):a.createCommentVNode("",!0),d.value.type==="area"?(a.openBlock(),a.createElementBlock("div",r4,[_[12]||(_[12]=a.createElementVNode("span",{class:"result-label"},"面积:",-1)),a.createElementVNode("span",l4,a.toDisplayString(A(d.value.area)),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",c4,[a.createElementVNode("div",d4,[a.createElementVNode("div",{class:"tool-item",onClick:a.withModifiers(k,["stop"])},[a.createElementVNode("div",h4,a.toDisplayString(l.value),1)]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[h.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"unitDropdownRef",ref:m,class:"unit-dropdown",style:a.normalizeStyle(f.value)},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(u,E=>a.createElementVNode("div",{key:E.value,class:a.normalizeClass(["unit-option",{selected:l.value===E.value}]),onClick:a.withModifiers(w=>C(E.value),["stop"])},a.toDisplayString(E.label),11,u4)),64))],4)):a.createCommentVNode("",!0)]))]),_[14]||(_[14]=a.createElementVNode("div",{class:"separator"},null,-1)),a.createElementVNode("div",{class:"action-buttons"},[a.createElementVNode("div",{class:"tool-item control-btn",onClick:I,title:"清空"},[..._[13]||(_[13]=[a.createElementVNode("div",{class:"tool-icon"},"🗑️",-1)])])])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-8b1e070f"]]);function sh(){const i=a.ref(!1),e=a.reactive({x:0,y:0}),t=a.ref([]),n=a.ref(null);return{visible:i,position:e,items:t,contextData:n,show:(c,d,h)=>{c instanceof MouseEvent?(c.preventDefault(),e.x=c.clientX,e.y=c.clientY):(e.x=c.x,e.y=c.y),t.value=d,n.value=h,i.value=!0},hide:()=>{i.value=!1},addItem:c=>{t.value.push(c)},removeItem:c=>{t.value=t.value.filter(d=>d.id!==c)}}}const m4=["onClick","onTouchend"],g4={class:"menu-label"},p4={key:0,class:"menu-arrow"},A4=be(a.defineComponent({__name:"LeitingContextMenu",props:{visible:{type:Boolean},position:{},items:{}},emits:["update:visible","action"],setup(i,{emit:e}){const t=i,n=e,{isMobile:s}=_s(),o=a.computed(()=>{let c=t.position.x,d=t.position.y;if(s.value){const f=t.items.length*48;c+200>window.innerWidth-16&&(c=window.innerWidth-200-16),d+f>window.innerHeight-16&&(d=window.innerHeight-f-16),d<16&&(d=16)}return{left:c+"px",top:d+"px"}}),r=c=>{c.disabled||(c.action&&c.action(),n("action",c),n("update:visible",!1))},l=()=>{t.visible&&n("update:visible",!1)};return a.onMounted(()=>{document.addEventListener("click",l),document.addEventListener("contextmenu",c=>{c.target.closest(".leiting-context-menu")||l()})}),a.onUnmounted(()=>{document.removeEventListener("click",l)}),(c,d)=>a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["leiting-context-menu",{"mobile-style":a.unref(s)}]),style:a.normalizeStyle(o.value),onContextmenu:d[0]||(d[0]=a.withModifiers(()=>{},["prevent"]))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.items,h=>(a.openBlock(),a.createElementBlock("div",{key:h.id,class:a.normalizeClass(["menu-item",{"menu-divided":h.divided,"menu-disabled":h.disabled}]),onClick:f=>r(h),onTouchend:a.withModifiers(f=>r(h),["prevent"])},[a.createElementVNode("span",g4,a.toDisplayString(h.label),1),h.children?(a.openBlock(),a.createElementBlock("span",p4,"▶")):a.createCommentVNode("",!0)],42,m4))),128))],38)),[[a.vShow,i.visible]])}}),[["__scopeId","data-v-62c220a6"]]),y4={class:"mobile-nav-root"},E4={class:"nav-bar-container"},C4={key:"sub-mode",class:"nav-inner sub-menu-wrapper"},v4={class:"sub-icons-list"},b4=["onClick"],w4=["innerHTML"],I4={key:"main-mode",class:"nav-inner main-menu-wrapper"},S4=["onClick"],x4=["src","alt"],oh=be(a.defineComponent({__name:"MobileBottomNav",props:{activeIds:{},is2d:{type:Boolean},customItems:{}},emits:["item-click","sub-item-click","clear-measure"],setup(i,{emit:e}){const t=i,n=e,s=a.ref(null),o=a.ref(null),r={measure:[{id:"distance",label:"距离",parentId:"measure",parentKey:"measurement"},{id:"angle",label:"角度",parentId:"measure",parentKey:"measurement"},{id:"area",label:"面积",parentId:"measure",parentKey:"measurement"},{id:"coordinate",label:"坐标",parentId:"measure",parentKey:"measurement"}],section:[{id:"box",label:"剖切盒",parentId:"section",parentKey:"section"},{id:"plane-x",label:"X轴",parentId:"section",parentKey:"section"},{id:"plane-y",label:"Y轴",parentId:"section",parentKey:"section"}]},l={distance:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 17l6-6 4 4 8-8"/><path d="M17 7h4v4"/></svg>',angle:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 20H4L14 4"/></svg>',area:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',coordinate:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20M2 12h20"/></svg>',box:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/></svg>'},c=p=>l[p]||l.box,d=a.ref([{ID:"home",title:"主视角",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"homeView"},{ID:"measure",title:"量算",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"measurement"},{ID:"roam",title:"漫游",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"roam"},{ID:"info",title:"信息",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"componentInfo"},{ID:"setting",title:"设置",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"setting"}]),h=a.ref([{ID:"home",title:"主视角",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"homeView"},{ID:"cadLayer",title:"CAD图层",src:ks,key:"cadLayer"},{ID:"annotation",title:"标注",src:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:we&&we.tagName.toUpperCase()==="SCRIPT"&&we.src||new URL("leiting-bim.umd.js",document.baseURI).href).href,key:"annotation"}]),f=a.computed(()=>{let y=[...t.is2d?h.value:d.value];return t.customItems&&(y=[...y,...t.customItems]),y}),m=a.computed(()=>s.value?r[s.value.ID]||[]:[]),u=p=>{if(r[p.ID]){if(p.ID==="measure"){n("item-click",p);return}if(s.value?.ID===p.ID)A();else{s.value=p,o.value=null;const y=r[p.ID];y&&y.length>0&&(o.value=y[0]?.id??null,setTimeout(()=>{n("sub-item-click",{parent:p,sub:y[0]})},50))}}else n("item-click",p)},g=p=>{o.value=p.id,n("sub-item-click",{parent:s.value,sub:p})},A=()=>{s.value=null,o.value=null};return(p,y)=>(a.openBlock(),a.createElementBlock("div",y4,[a.createElementVNode("nav",E4,[a.createVNode(a.Transition,{name:"nav-mode-switch",mode:"out-in"},{default:a.withCtx(()=>[s.value?(a.openBlock(),a.createElementBlock("div",C4,[a.createElementVNode("button",{class:"nav-back-icon",onClick:A},[...y[0]||(y[0]=[a.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3"},[a.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)])]),a.createElementVNode("div",v4,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value,C=>(a.openBlock(),a.createElementBlock("button",{key:C.id,class:a.normalizeClass(["sub-icon-box",{active:o.value===C.id}]),onClick:I=>g(C)},[a.createElementVNode("div",{class:"icon-svg",innerHTML:c(C.id)},null,8,w4)],10,b4))),128))])])):(a.openBlock(),a.createElementBlock("div",I4,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f.value,C=>(a.openBlock(),a.createElementBlock("div",{key:C.ID,class:a.normalizeClass(["main-tab-item",{active:i.activeIds?.includes(C.ID)}]),onClick:I=>u(C)},[a.createElementVNode("img",{src:C.src,class:"tab-img",alt:C.title},null,8,x4)],10,S4))),128))]))]),_:1})])]))}}),[["__scopeId","data-v-2e30753b"]]),M4={key:1,class:"drawer-header"},B4={class:"drawer-title"},T4={class:"drawer-content"},P4={key:2,class:"drawer-footer"},Vs=be(a.defineComponent({__name:"MobileDrawer",props:{visible:{type:Boolean},title:{},direction:{default:"bottom"},width:{default:"100%"},height:{default:"50vh"},showHandle:{type:Boolean,default:!1},closeOnOverlay:{type:Boolean,default:!0},maxHeight:{default:"60vh"}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=a.ref(null);let o=0,r=0;const l=a.computed(()=>{const u={};return t.direction==="right"||t.direction==="left"?(u.width=t.width,u.height="100%"):(u.width=t.width,u.height=t.height,u.maxHeight=t.maxHeight),u}),c=u=>{o=u.touches[0]?.clientY??0,s.value&&(s.value.style.transition="none")},d=u=>{if(!s.value)return;r=(u.touches[0]?.clientY??0)-o,r>0&&(s.value.style.transform=`translateY(${r}px)`)},h=()=>{s.value&&(s.value.style.transition="transform 300ms cubic-bezier(0.4, 0, 0.2, 1)",r>100?f():s.value.style.transform="",r=0)},f=()=>{n("update:visible",!1),n("close")},m=()=>{t.closeOnOverlay&&f()};return a.watch(()=>t.visible,u=>{u?document.body.style.overflow="hidden":document.body.style.overflow=""}),(u,g)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(a.Transition,{name:"drawer-fade"},{default:a.withCtx(()=>[i.visible?(a.openBlock(),a.createElementBlock("div",{key:0,class:"mobile-drawer-overlay",onClick:a.withModifiers(m,["self"])},[a.createElementVNode("div",{class:a.normalizeClass(["mobile-drawer-panel",[`direction-${i.direction}`]]),style:a.normalizeStyle(l.value),onClick:g[0]||(g[0]=a.withModifiers(()=>{},["stop"])),ref_key:"panelRef",ref:s},[i.direction==="bottom"&&i.showHandle?(a.openBlock(),a.createElementBlock("div",{key:0,class:"drawer-handle",onTouchstart:c,onTouchmove:d,onTouchend:h},[...g[1]||(g[1]=[a.createElementVNode("div",{class:"handle-bar"},null,-1)])],32)):a.createCommentVNode("",!0),i.title||u.$slots.title?(a.openBlock(),a.createElementBlock("div",M4,[a.renderSlot(u.$slots,"title",{},()=>[a.createElementVNode("span",B4,a.toDisplayString(i.title),1)],!0),a.createElementVNode("button",{class:"drawer-close-btn",onClick:f},[...g[2]||(g[2]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])])):a.createCommentVNode("",!0),a.createElementVNode("div",T4,[a.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(a.openBlock(),a.createElementBlock("div",P4,[a.renderSlot(u.$slots,"footer",{},void 0,!0)])):a.createCommentVNode("",!0)],6)])):a.createCommentVNode("",!0)]),_:3})]))}}),[["__scopeId","data-v-66d9d696"]]),_4={class:"mobile-tree-container"},D4={class:"search-section"},k4={class:"search-inner"},N4=["innerHTML"],ah=be(a.defineComponent({__name:"MobileTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},treeData:{default:()=>[]},initialCheckedKeys:{default:()=>[]}},emits:["update:visible","update:open","close","select","check","search"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:D=>{n("update:visible",D),n("update:open",D)}}),r={key:"id",title:"name",children:"children"},l=a.ref(""),c=a.ref([]),d=a.ref([]),h=a.ref(null),f=a.ref(300),m=a.ref(!1);let u=null;a.watch(()=>t.initialCheckedKeys,D=>{D&&D.length>0&&(d.value=[...D])},{immediate:!0}),a.watch(()=>t.treeData,D=>{if(!D||D.length===0)return;const F=[],U=(v,x)=>{for(let N=0;N<v.length;N++){const O=v[N],Q=O.id||O.key||O.$id,L=O.modelId||x;L&&(O.modelId=L),Q&&F.push(String(Q)),O.children&&O.children.length>0&&U(O.children,L)}};U(D);const R=new Set(d.value);let b=!1;F.forEach(v=>{R.has(v)||(R.add(v),b=!0)}),b&&(d.value=Array.from(R),n("check",d.value))},{immediate:!0,deep:!0});const g=(D,F)=>{const U=[],R=b=>{for(let v=0;v<b.length;v++){const x=b[v],N=x.id||x.key;!x.children||x.children.length===0?!(N&&F.has(String(N)))&&x.modelId&&x.element_Id&&U.push({modelId:x.modelId,elementId:x.element_Id,show:!1}):x.children&&R(x.children)}};return R(D),U},A=a.computed(()=>{if(!l.value)return t.treeData;m.value=!0;const D=l.value.toLowerCase(),F=U=>{const R=[];for(let b=0;b<U.length;b++){const v=U[b],x=v.name||v.title||"",N=v.id||v.key,O=x.toLowerCase().includes(D);let Q;v.children&&v.children.length>0&&(Q=F(v.children)),(O||Q&&Q.length>0)&&R.push({key:String(N),title:x,children:Q&&Q.length>0?Q:v.children?v.children:void 0,_raw:v,_searchMatched:O})}return R};return F(t.treeData)}),p=a.computed(()=>{if(!l.value)return[];const D=[],F=U=>{for(let R=0;R<U.length;R++){const b=U[R]?.children;b&&b.length>0&&(D.push(U[R]?.key),F(b))}};return F(A.value),D}),y=(D,F)=>l.value?(D||F||"").toLowerCase().includes(l.value.toLowerCase()):!1,C=D=>{if(!l.value)return D;const F=new RegExp(`(${l.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return D.replace(F,'<mark class="search-highlight">$1</mark>')},I=Qn(D=>{const F=typeof D=="object"?D.target?.value??"":D;k(F)},200),P=D=>{k(D)},k=D=>{l.value=D||"",n("search",l.value),D&&a.nextTick(()=>{c.value=[...p.value]})},M=D=>{c.value=D},B=(D,F)=>{d.value=D,n("check",d.value);const U=new Set(D.map(b=>String(b))),R=g(t.treeData,U);s?.value?.setComponentVisibility&&s.value.setComponentVisibility(R),s?.value?.onTreeCheck&&s.value.onTreeCheck(D,F)},_=D=>{o.value=D},E=()=>{n("close")},w=()=>{h.value&&(f.value=h.value.clientHeight)};return a.onMounted(()=>{h.value&&(w(),u=new ResizeObserver(()=>{w()}),u.observe(h.value))}),a.onUnmounted(()=>{u&&(u.disconnect(),u=null)}),(D,F)=>(a.openBlock(),a.createBlock(Vs,{visible:o.value,title:"目录树",direction:"bottom","show-handle":!1,class:"mobile-bim-drawer","onUpdate:visible":_,onClose:E},{title:a.withCtx(()=>[...F[1]||(F[1]=[a.createElementVNode("div",{class:"custom-drawer-header"},[a.createElementVNode("span",null,"目录树")],-1)])]),default:a.withCtx(()=>[a.createElementVNode("div",_4,[F[3]||(F[3]=a.createElementVNode("div",{class:"nav-tabs"},[a.createElementVNode("div",{class:"nav-tab-item active"},"构件")],-1)),a.createElementVNode("div",D4,[a.createElementVNode("div",k4,[a.createVNode(a.unref(se.Input),{value:l.value,"onUpdate:value":F[0]||(F[0]=U=>l.value=U),placeholder:"搜索构件","allow-clear":"",class:"custom-search",onSearch:P,onChange:a.unref(I)},null,8,["value","onChange"])])]),a.createElementVNode("div",{class:"tree-content-wrapper",ref_key:"treeContentRef",ref:h},[A.value.length>0?(a.openBlock(),a.createBlock(a.unref(se.Tree),{key:0,"tree-data":A.value,"field-names":r,"expanded-keys":c.value,"checked-keys":d.value,checkable:"","block-node":"",class:"bim-dark-tree",onExpand:M,onCheck:B},{switcherIcon:a.withCtx(({expanded:U})=>[a.createElementVNode("span",{class:a.normalizeClass(["switcher-icon",{"is-open":U}])},[...F[2]||(F[2]=[a.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[a.createElementVNode("path",{d:"M340.864 149.312l405.376 362.688-405.376 362.688z",fill:"currentColor"})],-1)])],2)]),title:a.withCtx(({name:U,title:R})=>[a.createElementVNode("span",{class:a.normalizeClass(["node-title",{"is-matched":y(U,R)}])},[a.createElementVNode("span",{innerHTML:C(U||R)},null,8,N4)],2)]),_:1},8,["tree-data","expanded-keys","checked-keys","onExpand","onCheck"])):a.createCommentVNode("",!0)],512)])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-c2e8ecbe"]]),R4={class:"tabs-header"},F4=["onClick"],L4={class:"modal-content"},O4={key:0,class:"setting-section"},G4={class:"setting-item"},U4={class:"mobile-switch"},V4={class:"setting-item"},Q4={class:"mobile-switch"},H4={class:"setting-item"},Y4={class:"mobile-switch"},z4={key:1,class:"setting-section"},j4={class:"setting-item"},W4={class:"mobile-switch"},$4={key:0,class:"setting-item column"},K4={class:"setting-label-row"},q4={class:"setting-value"},X4={class:"setting-item"},J4={class:"mobile-switch"},Z4={class:"setting-item"},eT={class:"mobile-switch"},tT={class:"setting-item column"},iT={class:"setting-label-row"},nT={class:"setting-value"},sT={class:"setting-item column"},oT={class:"setting-label-row"},aT={class:"setting-value"},rT={class:"setting-item column"},lT={class:"setting-label-row"},cT={class:"setting-value"},dT={class:"setting-item column"},hT={style:{display:"flex",gap:"8px","margin-bottom":"8px","flex-wrap":"wrap"}},uT=["onClick","title"],fT={style:{display:"flex",gap:"8px","align-items":"center"}},rh=be(a.defineComponent({__name:"MobileSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["update:visible","update:open","close","change"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:u=>{n("update:visible",u),n("update:open",u)}}),r=[{id:"GIS",label:"GIS"},{id:"RENDER",label:"渲染"}],l=a.ref("GIS"),c=a.ref({globe:!1,terrain:!1,depthTest:!1}),d=a.ref({shadows:!1,shadowDarkness:.5,environmentMap:!0,ambientOcclusion:!1,brightness:1,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),h=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],f=()=>{m()},m=()=>{n("close"),n("change",{gis:c.value,render:d.value})};return a.watch(()=>c.value.globe,u=>{s?.value&&s.value.setGlobeEnvironmentVisible?.(u)}),a.watch(()=>c.value.terrain,u=>{s?.value&&s.value.setTerrainEnable?.(u)}),a.watch(()=>c.value.depthTest,u=>{s?.value&&s.value.setDepthTestEnable?.(u)}),a.watch(()=>d.value.shadows,u=>{s?.value&&s.value.setShadowsEnable?.(u)}),a.watch(()=>d.value.shadowDarkness,u=>{s?.value&&s.value.setShadowDarkness?.(u)}),a.watch(()=>d.value.environmentMap,u=>{s?.value&&s.value.setEnvironmentMapEnable?.(u)}),a.watch(()=>d.value.ambientOcclusion,u=>{s?.value&&s.value.setAmbientOcclusion?.(u)}),a.watch(()=>[d.value.brightness,d.value.contrast,d.value.saturation],([u,g,A])=>{const p=s?.value;p&&(p.setModelColorAdjustment?p.setModelColorAdjustment({brightness:u,contrast:g,saturation:A}):p.setModelBrightness?.(u))}),a.watch(()=>d.value.backgroundColor,u=>{s?.value&&s.value.setBackgroundColor?.(u)}),a.watch(()=>o.value,u=>{u?document.body.style.overflow="hidden":document.body.style.overflow=""}),(u,g)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(a.Transition,{name:"setting-modal"},{default:a.withCtx(()=>[o.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"mobile-setting-overlay",onClick:f,onTouchmove:g[13]||(g[13]=a.withModifiers(()=>{},["prevent"]))},[a.createElementVNode("div",{class:"mobile-setting-modal",onClick:g[12]||(g[12]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("div",{class:"modal-header"},[g[15]||(g[15]=a.createElementVNode("span",{class:"modal-title"},"设置",-1)),a.createElementVNode("button",{class:"modal-close-btn",onClick:m},[...g[14]||(g[14]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),a.createElementVNode("div",R4,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(r,A=>a.createElementVNode("button",{key:A.id,class:a.normalizeClass(["tab-btn",{active:l.value===A.id}]),onClick:p=>l.value=A.id},a.toDisplayString(A.label),11,F4)),64))]),a.createElementVNode("div",L4,[l.value==="GIS"?(a.openBlock(),a.createElementBlock("div",O4,[a.createElementVNode("div",G4,[g[17]||(g[17]=a.createElementVNode("span",{class:"setting-label"},"地球(含大气/日月/星空)",-1)),a.createElementVNode("label",U4,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[0]||(g[0]=A=>c.value.globe=A)},null,512),[[a.vModelCheckbox,c.value.globe]]),g[16]||(g[16]=a.createElementVNode("span",{class:"slider"},null,-1))])]),a.createElementVNode("div",V4,[g[19]||(g[19]=a.createElementVNode("span",{class:"setting-label"},"地形",-1)),a.createElementVNode("label",Q4,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[1]||(g[1]=A=>c.value.terrain=A)},null,512),[[a.vModelCheckbox,c.value.terrain]]),g[18]||(g[18]=a.createElementVNode("span",{class:"slider"},null,-1))])]),a.createElementVNode("div",H4,[g[21]||(g[21]=a.createElementVNode("span",{class:"setting-label"},"地形遮挡",-1)),a.createElementVNode("label",Y4,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[2]||(g[2]=A=>c.value.depthTest=A)},null,512),[[a.vModelCheckbox,c.value.depthTest]]),g[20]||(g[20]=a.createElementVNode("span",{class:"slider"},null,-1))])])])):a.createCommentVNode("",!0),l.value==="RENDER"?(a.openBlock(),a.createElementBlock("div",z4,[a.createElementVNode("div",j4,[g[23]||(g[23]=a.createElementVNode("span",{class:"setting-label"},"阴影",-1)),a.createElementVNode("label",W4,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[3]||(g[3]=A=>d.value.shadows=A)},null,512),[[a.vModelCheckbox,d.value.shadows]]),g[22]||(g[22]=a.createElementVNode("span",{class:"slider"},null,-1))])]),d.value.shadows?(a.openBlock(),a.createElementBlock("div",$4,[a.createElementVNode("div",K4,[g[24]||(g[24]=a.createElementVNode("span",{class:"setting-label"},"阴影暗度",-1)),a.createElementVNode("span",q4,a.toDisplayString(d.value.shadowDarkness.toFixed(2)),1)]),a.withDirectives(a.createElementVNode("input",{type:"range","onUpdate:modelValue":g[4]||(g[4]=A=>d.value.shadowDarkness=A),min:"0",max:"1",step:"0.05",class:"mobile-slider"},null,512),[[a.vModelText,d.value.shadowDarkness,void 0,{number:!0}]])])):a.createCommentVNode("",!0),a.createElementVNode("div",X4,[g[26]||(g[26]=a.createElementVNode("span",{class:"setting-label"},"环境贴图",-1)),a.createElementVNode("label",J4,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[5]||(g[5]=A=>d.value.environmentMap=A)},null,512),[[a.vModelCheckbox,d.value.environmentMap]]),g[25]||(g[25]=a.createElementVNode("span",{class:"slider"},null,-1))])]),a.createElementVNode("div",Z4,[g[28]||(g[28]=a.createElementVNode("span",{class:"setting-label"},"环境光遮蔽",-1)),a.createElementVNode("label",eT,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g[6]||(g[6]=A=>d.value.ambientOcclusion=A)},null,512),[[a.vModelCheckbox,d.value.ambientOcclusion]]),g[27]||(g[27]=a.createElementVNode("span",{class:"slider"},null,-1))])]),a.createElementVNode("div",tT,[a.createElementVNode("div",iT,[g[29]||(g[29]=a.createElementVNode("span",{class:"setting-label"},"模型亮度",-1)),a.createElementVNode("span",nT,a.toDisplayString(d.value.brightness.toFixed(1)),1)]),a.withDirectives(a.createElementVNode("input",{type:"range","onUpdate:modelValue":g[7]||(g[7]=A=>d.value.brightness=A),min:"0",max:"5",step:"0.1",class:"mobile-slider"},null,512),[[a.vModelText,d.value.brightness,void 0,{number:!0}]])]),a.createElementVNode("div",sT,[a.createElementVNode("div",oT,[g[30]||(g[30]=a.createElementVNode("span",{class:"setting-label"},"模型对比度",-1)),a.createElementVNode("span",aT,a.toDisplayString(d.value.contrast.toFixed(1)),1)]),a.withDirectives(a.createElementVNode("input",{type:"range","onUpdate:modelValue":g[8]||(g[8]=A=>d.value.contrast=A),min:"0.5",max:"2",step:"0.1",class:"mobile-slider"},null,512),[[a.vModelText,d.value.contrast,void 0,{number:!0}]])]),a.createElementVNode("div",rT,[a.createElementVNode("div",lT,[g[31]||(g[31]=a.createElementVNode("span",{class:"setting-label"},"模型饱和度",-1)),a.createElementVNode("span",cT,a.toDisplayString(d.value.saturation.toFixed(1)),1)]),a.withDirectives(a.createElementVNode("input",{type:"range","onUpdate:modelValue":g[9]||(g[9]=A=>d.value.saturation=A),min:"0",max:"3",step:"0.1",class:"mobile-slider"},null,512),[[a.vModelText,d.value.saturation,void 0,{number:!0}]])]),a.createElementVNode("div",dT,[g[32]||(g[32]=a.createElementVNode("span",{class:"setting-label"},"背景颜色",-1)),a.createElementVNode("div",hT,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(h,(A,p)=>a.createElementVNode("div",{key:p,style:a.normalizeStyle({background:A,width:"60px",height:"40px",borderRadius:"6px",cursor:"pointer",border:"2px solid rgba(255,255,255,0.2)",flexShrink:0}),onClick:y=>d.value.backgroundColor=A,title:"预设 "+(p+1)},null,12,uT)),64))]),a.createElementVNode("div",fT,[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":g[10]||(g[10]=A=>d.value.backgroundColor=A),style:{width:"50px",height:"36px",padding:"0",border:"1px solid rgba(255,255,255,0.3)","border-radius":"6px",cursor:"pointer"}},null,512),[[a.vModelText,d.value.backgroundColor]]),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":g[11]||(g[11]=A=>d.value.backgroundColor=A),type:"text",class:"mobile-input",placeholder:"CSS 颜色值",style:{flex:"1"}},null,512),[[a.vModelText,d.value.backgroundColor]])])])])):a.createCommentVNode("",!0)])])],32)):a.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-dcec8ca4"]]),mT={class:"mobile-section-container"},gT={class:"section-main"},pT={class:"toggle-row"},AT={class:"slider-section"},yT={class:"slider-header"},ET={class:"slider-label"},CT={class:"slider-value"},vT={class:"quick-btns"},bT={class:"section-models"},wT={class:"models-header"},IT={class:"models-count"},lh=be(a.defineComponent({__name:"MobileSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},modelList:{default:()=>[]}},emits:["update:visible","update:open","close","visibility-change","mode-change","axis-change","model-change"],setup(i,{emit:e}){const t=i,n=e,s=a.computed({get:()=>t.open!==void 0?t.open:t.visible,set:w=>{n("update:visible",w),n("update:open",w)}}),o=a.ref(!0),r=a.ref("Box"),l=a.ref("X"),c=a.ref([]),d=a.ref([0,100]),h=a.ref([0,100]),f=a.ref([0,100]),m=[{key:"X",label:"X轴"},{key:"Y",label:"Y轴"},{key:"Z",label:"Z轴"}],u=a.computed(()=>m.find(D=>D.key===l.value)?.label||""),g=a.computed({get:()=>{switch(l.value){case"X":return d.value[1];case"Y":return h.value[1];case"Z":return f.value[1];default:return 50}},set:w=>{switch(l.value){case"X":d.value[1]=w??0;break;case"Y":h.value[1]=w??0;break;case"Z":f.value[1]=w??0;break}}}),A=a.computed(()=>{switch(l.value){case"X":return[-50,50];case"Y":return[-50,50];case"Z":return[0,100];default:return[0,100]}}),p=a.computed(()=>g.value?.toFixed(1)??"0.0"),y=a.computed(()=>c.value.length===t.modelList.length),C=w=>{s.value=w},I=()=>{n("close")},P=()=>{n("visibility-change",o.value)},k=w=>{r.value=w,n("mode-change",w)},M=()=>{g.value=50,n("axis-change",l.value,50)},B=()=>{const w=A.value;g.value=w&&w.length>=2?(w[0]+w[1])/2:50,n("axis-change",l.value,g.value)},_=()=>{n("model-change",c.value)},E=()=>{y.value?c.value=[]:c.value=t.modelList.map(w=>w.modelId),n("model-change",c.value)};return(w,D)=>(a.openBlock(),a.createBlock(Vs,{visible:s.value,title:"剖切分析",direction:"bottom","show-handle":!0,"onUpdate:visible":C,onClose:I},{default:a.withCtx(()=>[a.createElementVNode("div",mT,[a.createElementVNode("div",gT,[a.createElementVNode("div",pT,[D[6]||(D[6]=a.createElementVNode("span",{class:"toggle-label"},"显示剖切盒",-1)),a.createVNode(a.unref(se.Switch),{checked:o.value,"onUpdate:checked":D[0]||(D[0]=F=>o.value=F),onChange:P},null,8,["checked"])]),a.createVNode(a.unref(se.RadioGroup),{value:r.value,"onUpdate:value":D[1]||(D[1]=F=>r.value=F),"button-style":"solid",class:"mode-selector",onChange:D[2]||(D[2]=F=>k(F.target.value))},{default:a.withCtx(()=>[a.createVNode(a.unref(se.RadioButton),{value:"Box"},{default:a.withCtx(()=>[...D[7]||(D[7]=[a.createTextVNode("剖切盒",-1)])]),_:1})]),_:1},8,["value"]),a.createVNode(a.unref(se.RadioGroup),{value:l.value,"onUpdate:value":D[3]||(D[3]=F=>l.value=F),"button-style":"solid",class:"axis-selector"},{default:a.withCtx(()=>[a.createVNode(a.unref(se.RadioButton),{value:"X"},{default:a.withCtx(()=>[...D[8]||(D[8]=[a.createTextVNode("X轴",-1)])]),_:1}),a.createVNode(a.unref(se.RadioButton),{value:"Y"},{default:a.withCtx(()=>[...D[9]||(D[9]=[a.createTextVNode("Y轴",-1)])]),_:1}),a.createVNode(a.unref(se.RadioButton),{value:"Z"},{default:a.withCtx(()=>[...D[10]||(D[10]=[a.createTextVNode("Z轴",-1)])]),_:1})]),_:1},8,["value"]),a.createElementVNode("div",AT,[a.createElementVNode("div",yT,[a.createElementVNode("span",ET,a.toDisplayString(u.value)+" 轴范围",1),a.createElementVNode("span",CT,a.toDisplayString(p.value),1)]),a.createVNode(a.unref(se.Slider),{Value:g.value,"onUpdate:Value":D[4]||(D[4]=F=>g.value=F),min:A.value[0],max:A.value[1],step:.5,class:"section-slider"},null,8,["Value","min","max"]),a.createElementVNode("div",vT,[a.createVNode(a.unref(se.Button),{size:"small",onClick:M},{default:a.withCtx(()=>[...D[11]||(D[11]=[a.createTextVNode("重置",-1)])]),_:1}),a.createVNode(a.unref(se.Button),{size:"small",onClick:B},{default:a.withCtx(()=>[...D[12]||(D[12]=[a.createTextVNode("居中",-1)])]),_:1})])])]),a.createElementVNode("div",bT,[a.createElementVNode("div",wT,[D[13]||(D[13]=a.createElementVNode("span",{class:"models-title"},"选择模型",-1)),a.createElementVNode("span",IT,a.toDisplayString(c.value.length)+"/"+a.toDisplayString(i.modelList.length),1)]),a.createVNode(a.unref(se.CheckboxGroup),{value:c.value,"onUpdate:value":D[5]||(D[5]=F=>c.value=F),class:"models-list",onChange:_},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.modelList,F=>(a.openBlock(),a.createBlock(a.unref(se.Checkbox),{key:F.modelId,value:F.modelId,class:"model-item"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(F.modelName),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),i.modelList.length>1?(a.openBlock(),a.createBlock(a.unref(se.Button),{key:0,size:"small",type:"link",onClick:E},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(y.value?"取消全选":"全选"),1)]),_:1})):a.createCommentVNode("",!0)])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-cdacec58"]]),ST={key:0,class:"mobile-measure-root"},xT={key:0,class:"result-card"},MT={class:"card-header-row"},BT={class:"result-main"},TT={class:"type-label"},PT={class:"value-highlight"},_T={key:0,class:"coords-grid"},DT={class:"coord-item"},kT={class:"coord-item"},NT={class:"coord-item"},RT={class:"measure-toolbar-container"},FT={class:"tools-inner-row"},LT=["onClick"],OT=["innerHTML"],ch=be(a.defineComponent({__name:"MobileMeasurement",props:{visible:{type:Boolean},defaultTool:{}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods");let o=null,r=!1;const l=a.ref(null),c=a.ref(null),d=a.computed(()=>t.visible&&l.value!==null),h=[{id:"distance",svg:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 17l6-6 4 4 8-8"/></svg>'},{id:"angle",svg:'<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 20H4L14 4"/></svg>'},{id:"area",svg:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/></svg>'}],f={distance:"距离",angle:"角度",area:"面积"},m=a.computed(()=>l.value?f[l.value]||"":c.value&&f[c.value.type]||""),u=a.computed(()=>{if(!c.value)return l.value==="distance"?"-- m":l.value==="angle"?"--°":l.value==="area"?"-- m²":"";const P=c.value;return P.type==="distance"?`${(P.dist??0).toFixed(3)} m`:P.type==="angle"?`${(P.angle??0).toFixed(2)}°`:P.type==="area"?`${(P.area??0).toFixed(2)} m²`:""}),g=a.computed(()=>c.value?.type||l.value),A=P=>P===void 0?"--":P.toFixed(3),p=()=>{if(o)return;const P=s?.value;P?.getViewer&&(o=new Ca({viewer:P.getViewer(),cesium:P.getCesium()}),o.onMeasure=k=>{r||(c.value=k)})},y=P=>{p(),l.value===P?(l.value=null,o?.stop(),s?.value?.baseCompt?.enableSelection()):(l.value=P,c.value=null,o?.start(P),s?.value?.baseCompt?.disableSelection())},C=()=>{o?.clearAll(),o?.stop(),l.value=null,c.value=null,s?.value?.baseCompt?.enableSelection()},I=()=>{C(),n("update:visible",!1),n("close")};return a.watch(()=>t.visible,P=>{P?(p(),t.defaultTool&&y(t.defaultTool)):C()}),a.onUnmounted(()=>{r=!0,o?.destroy()}),(P,k)=>(a.openBlock(),a.createBlock(a.Transition,{name:"measure-fade"},{default:a.withCtx(()=>[i.visible?(a.openBlock(),a.createElementBlock("div",ST,[a.createVNode(a.Transition,{name:"card-slide"},{default:a.withCtx(()=>[d.value?(a.openBlock(),a.createElementBlock("div",xT,[a.createElementVNode("div",MT,[a.createElementVNode("div",BT,[a.createElementVNode("span",TT,a.toDisplayString(m.value)+":",1),a.createElementVNode("span",PT,a.toDisplayString(u.value),1)]),a.createElementVNode("button",{class:"clear-action-btn",onClick:C,title:"清空"},[...k[0]||(k[0]=[a.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[a.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),a.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])]),g.value==="distance"?(a.openBlock(),a.createElementBlock("div",_T,[a.createElementVNode("div",DT,[k[1]||(k[1]=a.createElementVNode("span",{class:"label-x"},"X:",-1)),a.createTextVNode(" "+a.toDisplayString(A(c.value?.dx)),1)]),a.createElementVNode("div",kT,[k[2]||(k[2]=a.createElementVNode("span",{class:"label-y"},"Y:",-1)),a.createTextVNode(" "+a.toDisplayString(A(c.value?.dy)),1)]),a.createElementVNode("div",NT,[k[3]||(k[3]=a.createElementVNode("span",{class:"label-z"},"Z:",-1)),a.createTextVNode(" "+a.toDisplayString(A(c.value?.dz)),1)])])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",RT,[a.createElementVNode("button",{class:"nav-back-icon",onClick:I},[...k[4]||(k[4]=[a.createElementVNode("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor","stroke-width":"3"},[a.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)])]),a.createElementVNode("div",FT,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(h,M=>a.createElementVNode("button",{key:M.id,class:a.normalizeClass(["sub-icon-box",{active:l.value===M.id}]),onClick:B=>y(M.id)},[a.createElementVNode("span",{class:"icon-svg",innerHTML:M.svg},null,8,OT)],10,LT)),64))])])])):a.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-7ff442b7"]]),GT={class:"joystick-base"},UT={class:"control-panel"},VT={class:"ctrl-row zoom-row"},QT={class:"zoom-label"},HT={class:"ctrl-grid"},YT={class:"gravity-toggle"},zT={class:"arrow-col"},xa=40,dh=be(a.defineComponent({__name:"MobilePlayer",props:{visible:{type:Boolean}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods");let o=!1;const r=a.ref(null),l=a.ref(0),c=a.ref(0),d=a.ref(!1),h=a.ref({x:0,y:0}),f=[.25,.5,1,2,4,8,16],m=a.ref(2),u=a.ref(!0);let g=null;const A=a.computed(()=>({transform:`translate(${l.value}px, ${c.value}px)`})),p=a.computed(()=>`${f[m.value]}X`),y=(L,T)=>{const S=[];return(Math.abs(L)>10||Math.abs(T)>10)&&(T<-10&&S.push("moveFront"),T>10&&S.push("moveBack"),L<-10&&S.push("moveLeft"),L>10&&S.push("moveRight")),S},C=()=>{o||["moveFront","moveBack","moveLeft","moveRight"].forEach(L=>{s?.value?.setPlayerAction?.(L,!1)})},I=L=>{if(o)return;["moveFront","moveBack","moveLeft","moveRight"].forEach(S=>{const G=L.includes(S);s?.value?.setPlayerAction?.(S,G)})},P=L=>{const T=L.touches[0],S=r.value.getBoundingClientRect();h.value={x:S.left+S.width/2,y:S.top+S.height/2},d.value=!0,T&&M(T.clientX,T.clientY)},k=L=>{if(!d.value)return;const T=L.touches[0];T&&M(T.clientX,T.clientY)},M=(L,T)=>{if(o)return;let S=L-h.value.x,G=T-h.value.y;const Y=Math.sqrt(S*S+G*G);Y>xa&&(S=S/Y*xa,G=G/Y*xa),l.value=S,c.value=G;const q=y(S,G);I(q)},B=()=>{d.value=!1,l.value=0,c.value=0,C()},_=()=>{D(),g=setInterval(()=>{m.value<f.length-1&&(m.value++,F())},150)},E=()=>{D(),g=setInterval(()=>{m.value>0&&(m.value--,F())},150)},w=()=>{D()},D=()=>{g&&(clearInterval(g),g=null)},F=()=>{o||s?.value?.setPlayerSpeed?.(f[m.value])},U=()=>{s?.value?.setPlayerAction?.("moveUp",!0)},R=()=>{s?.value?.setPlayerAction?.("moveUp",!1)},b=()=>{s?.value?.setPlayerAction?.("moveDown",!0)},v=()=>{s?.value?.setPlayerAction?.("moveDown",!1)},x=()=>{s?.value?.setPlayerParams?.({gravityTest:u.value,collisionTest:!0})},N=()=>{Q(),n("update:visible",!1),n("close")},O=async()=>{if(!o)try{if(!s?.value){setTimeout(()=>O(),150);return}s.value.startCameraRoam&&s.value.startCameraRoam(),s.value.setPlayerSpeed?.(f[m.value])}catch(L){console.error("MobilePlayer startPlayer error:",L)}},Q=()=>{C(),o||s?.value?.closePlayer?.(),D()};return a.watch(()=>t.visible,L=>{o||(L?O():Q())},{immediate:!0}),a.onUnmounted(()=>{o=!0,Q()}),(L,T)=>i.visible?(a.openBlock(),a.createElementBlock("div",{key:0,class:"mobile-player-overlay",onTouchmove:T[1]||(T[1]=a.withModifiers(()=>{},["prevent"]))},[a.createElementVNode("button",{class:"player-exit-btn",onClick:N}," 退出 "),a.createElementVNode("div",{class:"joystick-zone",ref_key:"joystickRef",ref:r,onTouchstart:a.withModifiers(P,["prevent"]),onTouchmove:a.withModifiers(k,["prevent"]),onTouchend:a.withModifiers(B,["prevent"]),onTouchcancel:a.withModifiers(B,["prevent"])},[a.createElementVNode("div",GT,[a.createElementVNode("div",{class:"joystick-knob",style:a.normalizeStyle(A.value)},null,4)])],544),a.createElementVNode("div",UT,[a.createElementVNode("div",VT,[a.createElementVNode("button",{class:"ctrl-btn ctrl-btn-sm",onTouchstart:a.withModifiers(E,["prevent"]),onTouchend:a.withModifiers(w,["prevent"])},"−",32),a.createElementVNode("span",QT,a.toDisplayString(p.value),1),a.createElementVNode("button",{class:"ctrl-btn ctrl-btn-sm",onTouchstart:a.withModifiers(_,["prevent"]),onTouchend:a.withModifiers(w,["prevent"])},"+",32)]),a.createElementVNode("div",HT,[a.createElementVNode("label",YT,[a.withDirectives(a.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":T[0]||(T[0]=S=>u.value=S),onChange:x},null,544),[[a.vModelCheckbox,u.value]]),T[2]||(T[2]=a.createElementVNode("span",{class:"toggle-checkbox"},null,-1)),T[3]||(T[3]=a.createElementVNode("span",{class:"toggle-label"},"重力",-1))]),a.createElementVNode("div",zT,[a.createElementVNode("button",{class:"ctrl-btn ctrl-btn-arrow",onTouchstart:a.withModifiers(U,["prevent"]),onTouchend:a.withModifiers(R,["prevent"])},[...T[4]||(T[4]=[a.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[a.createElementVNode("polyline",{points:"18 15 12 9 6 15"})],-1)])],32),a.createElementVNode("button",{class:"ctrl-btn ctrl-btn-arrow",onTouchstart:a.withModifiers(b,["prevent"]),onTouchend:a.withModifiers(v,["prevent"])},[...T[5]||(T[5]=[a.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[a.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1)])],32)])])])],32)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-591ba29c"]]),jT={key:0,class:"mobile-info-sheet-wrapper"},WT={class:"info-body"},$T={key:0,class:"empty-hint"},KT={key:0,class:"component-title"},qT={class:"group-list"},XT=["onClick"],JT={class:"group-name"},ZT={key:0,class:"group-content"},e3={class:"kv-key"},t3={class:"kv-value"},hh=be(a.defineComponent({__name:"MobileInfo",props:{visible:{type:Boolean}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref([]),r=a.ref(!1),l=a.ref(new Set),c=a.ref([]);let d=!1;const h=a.computed({get:()=>!!t.visible,set:k=>{n("update:visible",k)}}),f=k=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[k]||k,m=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],u=(k,M)=>`${k}__${M}`,g=(k,M)=>l.value.has(u(k,M)),A=(k,M)=>{const B=u(k,M);l.value.has(B)?l.value.delete(B):l.value.add(B)},p=()=>{const k=new Set;o.value.forEach(M=>{M.groups.forEach(B=>{k.add(u(M.id,B.name))})}),l.value=k},y=()=>{h.value=!1,n("close")},C=async k=>{if(d)return;if(c.value=k||[],!k||k.length===0){o.value=[];return}let M=k;k.length>10&&(ce.warning(`选中构件数量过多(${k.length}个),仅显示前10个`),M=k.slice(0,10));const B=s?.value;let _=B?.getMapTileset?B.getMapTileset():{};r.value=!0;const E=new Set;if(M.forEach(D=>{const F=_[D.modelId];F&&F.leiting&&!F.leiting?.node?.nodeExtras&&F.leiting.model?.nodeUrl&&E.add(D.modelId)}),E.size>0&&B?._loadNodeDetailsForModel)try{await Promise.all(Array.from(E).map(D=>B._loadNodeDetailsForModel(D)))}catch(D){console.error("Failed to load node details",D)}if(d)return;_=B?.getMapTileset?B.getMapTileset():{};const w=[];M.forEach((D,F)=>{const R=_[D.modelId]?.leiting||{};let b={modelName:R.model?.modelId||D.modelId};b.elementID||(b.elementID=D.elementId);let v=null;const x=R.node?.nodeExtras?.element||R.node?.nodeExtras;if(x){const Q=b.elementID;x[Q]&&(v=x[Q])}v&&v.box3&&(b.length=`${v.box3.length?.toFixed(2)||0}米`,b.width=`${v.box3.width?.toFixed(2)||0}米`,b.height=`${v.box3.height?.toFixed(2)||0}米`);const N=[];v&&(v.name&&(b.elementName=v.name),v.categoryName&&(b.categoryName=v.categoryName),v.familySymbolName&&(b.familySymbolName=v.familySymbolName),v.levelName&&(b.levelName=v.levelName));const O={};if(m.forEach(Q=>{b[Q]!==void 0&&(O[Q]=b[Q])}),N.push({name:"基本属性",params:O}),v){const Q=Array.isArray(v)?v:Array.isArray(v?.parameters)?v.parameters:null;if(Q)Q.flat().forEach(T=>{if(T&&T.GroupName&&Array.isArray(T.Parameters)){const S={};T.Parameters.forEach(G=>{G.name&&(S[G.name]=G.value??"")}),Object.keys(S).length>0&&N.push({name:T.GroupName,params:S})}});else{let L=!1;if(Object.keys(v).forEach(T=>{v[T]&&typeof v[T]=="object"&&!Array.isArray(v[T])&&(L=!0,N.push({name:T,params:v[T]}))}),!L){const T={};Object.keys(v).forEach(S=>{if(!m.includes(S)&&S!=="batchId"){const G=v[S];T[S]=typeof G=="string"&&G.length>500?G.substring(0,500)+"...":G}}),Object.keys(T).length>0&&N.push({name:"其他属性",params:T})}}}w.push({id:F,title:`${b.modelName}${b.elementName?` - ${b.elementName}`:""}`,groups:N})}),o.value=w,r.value=!1,!d&&w.length>0&&p()};let I=!1;const P=()=>{if(I)return;const k=s?.value;k&&k.selectionChange&&(k.selectionChange(C),I=!0)};return a.watch(()=>s?.value,()=>P(),{deep:!0,immediate:!0}),a.watch(h,k=>{k&&(P(),c.value.length>0&&C(c.value))}),a.onUnmounted(()=>{d=!0}),(k,M)=>(a.openBlock(),a.createBlock(a.Transition,{name:"info-slide"},{default:a.withCtx(()=>[i.visible?(a.openBlock(),a.createElementBlock("div",jT,[a.createElementVNode("div",{class:"mobile-info-sheet",onTouchmove:M[0]||(M[0]=a.withModifiers(()=>{},["stop"])),onClick:M[1]||(M[1]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("div",{class:"info-header"},[M[3]||(M[3]=a.createElementVNode("span",{class:"info-title"},"构件详情",-1)),a.createElementVNode("button",{class:"info-close-btn",onClick:y},[...M[2]||(M[2]=[a.createElementVNode("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),M[5]||(M[5]=a.createElementVNode("div",{class:"info-tabs"},[a.createElementVNode("span",{class:"tab-item active"},"属性")],-1)),a.createElementVNode("div",WT,[a.createVNode(a.unref(se.Spin),{spinning:r.value},{default:a.withCtx(()=>[o.value.length===0&&!r.value?(a.openBlock(),a.createElementBlock("div",$T," 暂无数据 ")):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,B=>(a.openBlock(),a.createElementBlock("div",{key:B.id,class:"component-block"},[o.value.length>1?(a.openBlock(),a.createElementBlock("div",KT,a.toDisplayString(B.title),1)):a.createCommentVNode("",!0),a.createElementVNode("div",qT,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(B.groups,(_,E)=>(a.openBlock(),a.createElementBlock("div",{key:`${B.id}-${E}`,class:"group-item"},[a.createElementVNode("button",{class:a.normalizeClass(["group-header",{expanded:g(B.id,_.name)}]),onClick:w=>A(B.id,_.name)},[M[4]||(M[4]=a.createElementVNode("svg",{class:"arrow-icon",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[a.createElementVNode("polyline",{points:"4 6 8 10 12 6"})],-1)),a.createElementVNode("span",JT,a.toDisplayString(_.name),1)],10,XT),a.createVNode(a.Transition,{name:"group-expand"},{default:a.withCtx(()=>[g(B.id,_.name)?(a.openBlock(),a.createElementBlock("div",ZT,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(_.params,(w,D)=>(a.openBlock(),a.createElementBlock("div",{key:D,class:"kv-row"},[a.createElementVNode("span",e3,a.toDisplayString(f(String(D))),1),a.createElementVNode("span",t3,a.toDisplayString(w),1)]))),128))])):a.createCommentVNode("",!0)]),_:2},1024)]))),128))])]))),128))]),_:1},8,["spinning"])])],32)])):a.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-c4855585"]]),i3={class:"mobile-cad-layer-container"},n3={class:"model-selector"},s3={class:"layer-list-container"},o3={class:"list-header"},a3={class:"col-check"},r3=["checked"],l3={class:"list-body"},c3=["onClick"],d3=["checked","onChange"],h3={class:"col-index"},u3=["title"],f3={class:"col-color"},m3={key:0,class:"empty-state"},g3=be(a.defineComponent({__name:"MobileCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods",a.ref({})),o=a.ref(""),r=a.ref([]),l=a.computed({get:()=>t.visible,set:P=>n("update:visible",P)}),c=()=>{s.value&&s.value.getDxfModels&&(r.value=s.value.getDxfModels().map(P=>({modelId:P.modelId,modelName:P.modelName}))||[])},d=a.computed(()=>r.value.map(P=>({value:P.modelId,label:P.modelName}))),h=a.ref([]),f=a.ref([]),m=a.computed(()=>h.value.length>0&&f.value.length===h.value.length),u=({modelId:P})=>{if(h.value=[],f.value=[],s.value&&s.value.getDxfLayers){const k=s.value.getDxfLayers({modelId:P});k&&Object.keys(k).forEach((M,B)=>{k[M].length&&(h.value.push({index:B+1,layerName:M,layerColor:k[M][0].color||"#ffffff",key:M}),f.value.push(M))})}},g=P=>{o.value=P,u({modelId:P})},A=P=>{P.target.checked?f.value=h.value.map(M=>M.key):f.value=[],y()},p=(P,k)=>{k.target.checked?f.value.includes(P)||f.value.push(P):f.value=f.value.filter(B=>B!==P),y()},y=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:o.value,show:!0,layers:f.value}),s.value.getDxfLayers)){const P=s.value.getDxfLayers({modelId:o.value});if(P){const k=Object.keys(P).filter(M=>!f.value.includes(M));s.value.showDxfLayer({modelId:o.value,show:!1,layers:k})}}},C=P=>{l.value=P},I=()=>{n("update:visible",!1),n("handleCloseCardByCadCard")};return a.watch(()=>t.visible,P=>{P&&(c(),t.currentModelId?(o.value=t.currentModelId,u({modelId:t.currentModelId})):d.value.length>0&&(o.value=d.value[0]?.value,u({modelId:o.value})))}),a.watch(()=>t.currentModelId,P=>{P&&t.visible&&(o.value=P,u({modelId:P}))}),(P,k)=>(a.openBlock(),a.createBlock(Vs,{visible:l.value,title:"CAD图层",direction:"bottom","show-handle":!0,height:"70vh",class:"mobile-cad-layer-drawer","onUpdate:visible":C,onClose:I},{default:a.withCtx(()=>[a.createElementVNode("div",i3,[a.createElementVNode("div",n3,[k[3]||(k[3]=a.createElementVNode("span",{class:"selector-label"},"图纸:",-1)),a.createVNode(a.unref(se.Select),{value:o.value,"onUpdate:value":k[0]||(k[0]=M=>o.value=M),options:d.value,onChange:k[1]||(k[1]=M=>g(M)),placeholder:"选择模型",class:"mobile-model-select",popupClassName:"mobile-cad-select-dropdown",size:"large"},null,8,["value","options"])]),a.createElementVNode("div",s3,[a.createElementVNode("div",o3,[a.createElementVNode("div",a3,[a.createElementVNode("input",{type:"checkbox",checked:m.value,onChange:A,class:"mobile-checkbox"},null,40,r3)]),k[4]||(k[4]=a.createElementVNode("div",{class:"col-index"},"序号",-1)),k[5]||(k[5]=a.createElementVNode("div",{class:"col-name"},"图层名称",-1)),k[6]||(k[6]=a.createElementVNode("div",{class:"col-color"},"颜色",-1))]),a.createElementVNode("div",l3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(h.value,M=>(a.openBlock(),a.createElementBlock("div",{key:M.key,class:"list-item",onClick:B=>p(M.key,{target:{checked:!f.value.includes(M.key)}})},[a.createElementVNode("div",{class:"col-check",onClick:k[2]||(k[2]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("input",{type:"checkbox",checked:f.value.includes(M.key),onChange:B=>p(M.key,B),class:"mobile-checkbox"},null,40,d3)]),a.createElementVNode("div",h3,a.toDisplayString(M.index),1),a.createElementVNode("div",{class:"col-name",title:M.layerName},a.toDisplayString(M.layerName),9,u3),a.createElementVNode("div",f3,[a.createElementVNode("div",{class:"color-swatch",style:a.normalizeStyle({backgroundColor:M.layerColor})},null,4)])],8,c3))),128)),h.value.length===0?(a.openBlock(),a.createElementBlock("div",m3,[...k[7]||(k[7]=[a.createElementVNode("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[a.createElementVNode("path",{d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),a.createElementVNode("p",null,"暂无图层信息",-1)])])):a.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-63da9a15"]]),p3={class:"mobile-annotation-panel"},A3={class:"tools-section"},y3={class:"tools-grid"},E3={class:"style-section"},C3={class:"style-item"},v3={class:"color-picker-wrapper"},b3={class:"style-item"},w3={class:"line-width-options"},I3=["onClick"],S3={class:"width-label"},x3=be(a.defineComponent({__name:"MobileAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,s=a.inject("leitingMethods"),o=a.ref(""),r=a.ref("#ff0000"),l=a.ref(3),c=a.computed({get:()=>t.visible,set:C=>n("update:visible",C)}),d=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],h=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,f=()=>{const C=h();if(C&&(typeof C.hideEntityOutline=="function"&&C.hideEntityOutline(),C.selectedEntityObj=null,C.drawTool&&typeof C.drawTool.deactivate=="function"))try{C.drawTool.deactivate()}catch(I){console.warn("Failed to deactivate drawTool:",I)}o.value="",n("update:visible",!1)},m=C=>{if(o.value===C){o.value="";return}o.value=C;const I=h();if(I)switch(C){case"freehandLine":I.startFreehandLine();break;case"arrow":I.startArrow();break;case"straightLine":I.startStraightLine();break;case"rectangle":I.startRectangle();break;case"ellipse":I.startEllipse();break}},u=()=>{const C=h();C&&(C.setCurrentColor(r.value),C.changeColor(r.value))},g=C=>{l.value=C;const I=h();I&&(I.setCurrentWidth(C),I.changeWidth(C))},A=()=>{const C=h();C&&C.deleteSelectedEntity()},p=()=>{const C=h();C&&C.clearAll()},y=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const C=h();C&&C.saveAnnotations()};return(C,I)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[a.createVNode(a.Transition,{name:"annotation-slide"},{default:a.withCtx(()=>[c.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"mobile-annotation-overlay",onClick:a.withModifiers(f,["self"])},[a.createElementVNode("div",p3,[a.createElementVNode("div",{class:"panel-header"},[I[7]||(I[7]=a.createElementVNode("span",{class:"panel-title"},"标注",-1)),a.createElementVNode("button",{class:"panel-close-btn",onClick:f},[...I[6]||(I[6]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round"},[a.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),a.createElementVNode("div",A3,[I[13]||(I[13]=a.createElementVNode("div",{class:"section-label"},"绘图工具",-1)),a.createElementVNode("div",y3,[a.createElementVNode("button",{class:a.normalizeClass(["tool-btn",{active:o.value==="freehandLine"}]),onClick:I[0]||(I[0]=P=>m("freehandLine"))},[...I[8]||(I[8]=[a.createElementVNode("div",{class:"tool-icon"},"✏️",-1),a.createElementVNode("span",{class:"tool-label"},"手绘线",-1)])],2),a.createElementVNode("button",{class:a.normalizeClass(["tool-btn",{active:o.value==="arrow"}]),onClick:I[1]||(I[1]=P=>m("arrow"))},[...I[9]||(I[9]=[a.createElementVNode("div",{class:"tool-icon"},"↗️",-1),a.createElementVNode("span",{class:"tool-label"},"箭头",-1)])],2),a.createElementVNode("button",{class:a.normalizeClass(["tool-btn",{active:o.value==="straightLine"}]),onClick:I[2]||(I[2]=P=>m("straightLine"))},[...I[10]||(I[10]=[a.createElementVNode("div",{class:"tool-icon"},"📏",-1),a.createElementVNode("span",{class:"tool-label"},"直线",-1)])],2),a.createElementVNode("button",{class:a.normalizeClass(["tool-btn",{active:o.value==="rectangle"}]),onClick:I[3]||(I[3]=P=>m("rectangle"))},[...I[11]||(I[11]=[a.createElementVNode("div",{class:"tool-icon"},"▭",-1),a.createElementVNode("span",{class:"tool-label"},"矩形",-1)])],2),a.createElementVNode("button",{class:a.normalizeClass(["tool-btn",{active:o.value==="ellipse"}]),onClick:I[4]||(I[4]=P=>m("ellipse"))},[...I[12]||(I[12]=[a.createElementVNode("div",{class:"tool-icon"},"⭕",-1),a.createElementVNode("span",{class:"tool-label"},"椭圆",-1)])],2)])]),I[21]||(I[21]=a.createElementVNode("div",{class:"divider"},null,-1)),a.createElementVNode("div",E3,[I[16]||(I[16]=a.createElementVNode("div",{class:"section-label"},"样式设置",-1)),a.createElementVNode("div",C3,[I[14]||(I[14]=a.createElementVNode("span",{class:"style-label"},"颜色",-1)),a.createElementVNode("div",v3,[a.createElementVNode("div",{class:"color-preview",style:a.normalizeStyle({backgroundColor:r.value})},null,4),a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":I[5]||(I[5]=P=>r.value=P),onChange:u,class:"color-input"},null,544),[[a.vModelText,r.value]])])]),a.createElementVNode("div",b3,[I[15]||(I[15]=a.createElementVNode("span",{class:"style-label"},"线宽",-1)),a.createElementVNode("div",w3,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(d,P=>a.createElementVNode("button",{key:P.value,class:a.normalizeClass(["width-btn",{active:l.value===P.value}]),onClick:k=>g(P.value)},[a.createElementVNode("div",{class:"width-line",style:a.normalizeStyle({height:P.value+"px",backgroundColor:l.value===P.value?"#00e5d1":"#fff"})},null,4),a.createElementVNode("span",S3,a.toDisplayString(P.label),1)],10,I3)),64))])])]),I[22]||(I[22]=a.createElementVNode("div",{class:"divider"},null,-1)),a.createElementVNode("div",{class:"action-section"},[I[20]||(I[20]=a.createElementVNode("div",{class:"section-label"},"操作",-1)),a.createElementVNode("div",{class:"action-grid"},[a.createElementVNode("button",{class:"action-btn delete-btn",onClick:A},[...I[17]||(I[17]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),a.createElementVNode("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})],-1),a.createElementVNode("span",null,"删除",-1)])]),a.createElementVNode("button",{class:"action-btn clear-btn",onClick:p},[...I[18]||(I[18]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1),a.createElementVNode("span",null,"清空",-1)])]),a.createElementVNode("button",{class:"action-btn save-btn",onClick:y},[...I[19]||(I[19]=[a.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[a.createElementVNode("path",{d:"M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"}),a.createElementVNode("polyline",{points:"17 21 17 13 7 13 7 21"}),a.createElementVNode("polyline",{points:"7 3 7 8 15 8"})],-1),a.createElementVNode("span",null,"保存",-1)])])])])])])):a.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-9b4979c4"]]),M3=["src"],Qs=be(a.defineComponent({__name:"LeitingBIM",props:{accessToken:{},cesiumUrl:{},cesiumCssUrl:{},methods:{},viewerOptions:{},treeProps:{},showTree:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!1},playerUrl:{default:"https://leiting.chenxisoft.com/resource/person/person.glb"},playerModelName:{default:"Person"},playerModelId:{default:"player_111"},playerScale:{default:.0032},tiandituToken:{default:"c25f14fb6bd4397cf8fe45144ff768d6"},globe:{type:Boolean,default:void 0},terrain:{type:Boolean,default:void 0},depthTest:{type:Boolean,default:void 0},mapProvider:{},tiandituLayerType:{},tiandituShowLabel:{type:Boolean,default:void 0},arcgisUrl:{},teleportTarget:{},shadows:{type:Boolean,default:void 0},environmentMap:{type:Boolean,default:void 0},ambientOcclusion:{type:Boolean,default:void 0},time:{},brightness:{},backgroundColor:{},collision:{type:Boolean,default:void 0},mouseHabit:{},mode:{default:"3d"},mountAll3Dtiles:{},mountAllCad:{},saveRegion:{},saveCadRegion:{},saveCadCalibration:{},selectionChange:{},searchComponent:{}},emits:["register","init","ready"],setup(i,{expose:e,emit:t}){const n=a.ref(),s=a.ref(),o=a.getCurrentInstance(),r=a.ref(!1),l=a.ref(""),c=a.ref({}),d=a.ref("3d"),{isMobile:h}=_s(),f=i,m={title:"构件树",treeData:[]},u=a.ref(!1),g=a.ref(!1),A=a.ref(!1),p=a.ref(!1),y=a.ref(!1),C=a.ref(!1),I=a.ref(!1),P=a.ref(!1),k=a.ref(!1),M=a.ref(!1),B=a.ref(!1),_=a.ref(null),{visible:E,position:w,items:D,show:F,hide:U}=sh(),R=a.ref([]),b=$=>{R.value.push($)},v=$=>{R.value=R.value.filter(z=>z.id!==$)},x=a.ref([]),N=a.ref(""),O=a.ref(null),Q=a.ref([]),L=a.reactive({tree:!1,section:!1,roam:!1,info:!1,adjustModel:!1,setting:!1,cadLayer:!1,cadPosition:!1,gisCadPosition:!1,annotation:!1}),T=($,z)=>{$==="componentTree"&&($="tree"),$==="componentInfo"&&($="info"),$ in L&&(L[$]=z)},S=a.shallowRef({});a.provide("leitingMethods",S);const G=a.ref(f.showMenu),Y=a.ref([]);a.watch(()=>f.showMenu,$=>{G.value=$},{immediate:!0}),a.watch(()=>f.mode,$=>{$&&S.value?.set2d&&S.value.set2d($==="2d")});const q=a.ref("dark");a.provide("leiting-theme",q);const W=a.ref(f.teleportTarget);a.watch(()=>f.teleportTarget,$=>{W.value=$});const re=a.ref([]),ae=a.computed(()=>{const $=[];return u.value&&($.push("tree"),$.push("componentTree")),g.value&&$.push("section"),A.value&&$.push("roam"),p.value&&($.push("info"),$.push("componentInfo")),y.value&&$.push("adjust"),C.value&&$.push("setting"),I.value&&$.push("cadLayer"),P.value&&$.push("cadPosition"),k.value&&$.push("gisCadPosition"),M.value&&$.push("annotation"),B.value&&($.push("measure"),$.push("measurement")),$.push(...re.value),$}),de=a.ref(null),he=($,z)=>{$==="componentTree"||$==="tree"?u.value=z:$==="section"?g.value=z:$==="roam"?A.value=z:$==="componentInfo"||$==="info"?p.value=z:$==="homeView"?S.value?.is2dMode?.()?S.value?.flyToTopView?.({}):S.value?.getBIMmodelId()?S.value?.flyToTileset?.({}):S.value?.getCadModelId()&&S.value?.flyToTopView?.({}):$==="adjustModel"?(y.value=z,z&&de.value&&de.value.setModelType("BIM")):$==="osgbAdjust"?(y.value=z,z&&de.value&&de.value.setModelType("OSGB")):$==="setting"?C.value=z:$==="cadLayer"?I.value=z:$==="cadPosition"?P.value=z:$==="gisCadPosition"?k.value=z:$==="annotation"?M.value=z:$==="measurement"?B.value=z:z?re.value.includes($)||re.value.push($):re.value=re.value.filter(ee=>ee!==$)},ge=$=>{const z=$.key||$.ID;if(!z)return;if(z==="homeView"||z==="home"){he(z,!0);return}if(z==="measurement"){_.value="distance",B.value=!0;return}const ee=!ae.value.includes($.ID);he(z,ee)},De=$=>{const z=$.sub;if(!z)return;const ee=z.parentKey||$.parent?.key;ee==="measurement"?(_.value=z.id.replace("measure-",""),B.value=!0):ee==="section"&&(g.value=!0)};a.watch(u,async $=>{if($&&S.value?.loadTreeForModel&&S.value?.getMapTileset){const z=S.value.getMapTileset(),ee=Object.values(z).map(async ke=>{if(ke.leiting&&ke.leiting.model?.treeUrl){const rt=ke.leiting.model.modelId;try{ke.leiting?.node?.batchIdEIDInfos||await S.value.loadNodeDetailsForModel(rt);const tt=await S.value.loadTreeForModel(rt);tt&&(Array.isArray(tt)?tt:[tt]).forEach(zt=>{zt&&!Q.value.find(Ma=>Ma.id===zt.id)&&(zt.modelId=rt,Q.value=[...Q.value,zt])})}catch(tt){console.warn(`Failed to lazy load tree for ${rt}`,tt)}}});await Promise.all(ee)}});const Re=()=>{S.value&&(S.value.getDxfModels&&(x.value=S.value.getDxfModels()||[]),S.value.getCadModelId&&(N.value=S.value.getCadModelId()||""))};let We;a.watch(I,$=>{$&&Re()}),a.watch(P,$=>{$&&(Re(),O.value&&x.value.length&&O.value.addGltfOr3dTilesModelList(x.value))});const Ve=t,et=$=>{S.value&&S.value.saveCadCalibration&&S.value.saveCadCalibration($),S.value&&S.value.saveCadRegion&&S.value.saveCadRegion($)};return a.onMounted(async()=>{if(s.value&&ce.setContainer(s.value),!!n.value)try{const $={...jt,cesiumUrl:f.cesiumUrl||jt.cesiumUrl,cesiumCssUrl:f.cesiumCssUrl||jt.cesiumCssUrl,accessToken:f.accessToken||Ws()||jt.accessToken};await js($);const z=f.accessToken||Ws()||jt.accessToken;z&&(Cesium.Ion.defaultAccessToken=z),r.value=!0,We=async(ke={},rt)=>{if(n.value){const{showMenu:tt,showTree:Ri,globe:zt,terrain:Ma,depthTest:Y3,mapProvider:z3,tiandituLayerType:j3,tiandituShowLabel:W3,arcgisUrl:$3,shadows:K3,environmentMap:q3,ambientOcclusion:X3,time:J3,brightness:Z3,backgroundColor:eP,collision:tP,mouseHabit:iP,heightBasedZoom:nP,mode:fh,...wt}=ke||{},sP=f.showMenu!==void 0?f.showMenu:tt!==void 0?tt:!0;G.value=sP;const He=(ie,Te,gt)=>ie!==void 0?ie:Te!==void 0?Te:gt,mh=He(f.globe,zt,!1),gh=He(f.terrain,Ma,!1),ph=He(f.depthTest,Y3,!1),Ah=He(f.mapProvider,z3,"tianditu"),yh=He(f.tiandituLayerType,j3,"img_w"),Eh=He(f.tiandituShowLabel,W3,!1),Ch=He(f.arcgisUrl,$3,"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),vh=He(f.shadows,K3,!1),bh=He(f.environmentMap,q3,!1),wh=He(f.ambientOcclusion,X3,!1),Ih=He(f.time,J3,void 0),Sh=He(f.brightness,Z3,1),Ys=f.mode||fh||"3d";console.log("LeitingBIM Mode:",Ys,"Props:",f.mode,"Options:",fh),d.value=Ys;const oP=Ys==="2d"?"#000000":"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)",xh=He(f.backgroundColor,eP,oP),Mh=He(f.collision,tP,!1),Bh=He(f.mouseHabit,iP,0),Th=He(f.heightBasedZoom,nP,!1);c.value={globe:mh,terrain:gh,depthTest:ph,mapProvider:Ah,tiandituLayerType:yh,tiandituShowLabel:Eh,arcgisUrl:Ch,shadows:vh,environmentMap:bh,ambientOcclusion:wh,time:Ih,brightness:Sh,backgroundColor:xh,collision:Mh,mouseHabit:Bh,heightBasedZoom:Th,useBrowserRecommendedResolution:!0};const Dn=c2({container:n.value,appContext:o?.appContext,methods:{...S.value,handleMenuAction:he,setCardFullHeight:T,onLoadingStatus:ie=>{ie?ce.loading(ie,"",s.value):ce.close()},...wt,tilesLoad3dTiles:async ie=>{let Te=ie.leiting?.tree;const gt=ie.leiting?.model?.modelId;if(!Te&&u.value&&S.value?.loadTreeForModel)try{Te=await S.value.loadTreeForModel(gt)}catch(Nn){console.warn("Failed to lazy load tree",Nn)}Te&&(Array.isArray(Te)?Te:[Te]).forEach(ci=>{ci&&!Q.value.find(_h=>_h.id===ci.id)&&(ci.modelId=gt,Q.value=[...Q.value,ci])});const{brightness:Ba,contrast:Ta,saturation:Tt}=Dn.methods.getConfigure();Dn.methods.setModelColorAdjustment({brightness:Ba,contrast:Ta,saturation:Tt}),wt.tilesLoad3dTiles?.(ie)},mountAll3Dtiles:ie=>{f.mountAll3Dtiles&&f.mountAll3Dtiles(ie),wt.mountAll3Dtiles?.(ie)},updateModels:ie=>{if(Array.isArray(ie))if(ie.length===0)Q.value=[];else{const Te=ie.map(gt=>gt.modelId);Q.value=Q.value.filter(gt=>Te.includes(gt.modelId))}},mountAllCad:ie=>{if(Dn.methods.setModelBrightness){const Te=f.brightness!==void 0?f.brightness:c.value.brightness;Te!==void 0&&Dn.methods.setModelBrightness(Te)}f.mountAllCad&&f.mountAllCad(ie),wt.mountAllCad?.(ie)},saveRegion:ie=>{f.saveRegion&&f.saveRegion(ie),wt.saveRegion?.(ie)},saveCadRegion:ie=>{f.saveCadRegion&&f.saveCadRegion(ie),wt.saveCadRegion?.(ie)},saveCadCalibration:ie=>{f.saveCadCalibration&&f.saveCadCalibration(ie),wt.saveCadCalibration?.(ie)},selectionChange:ie=>{f.selectionChange&&f.selectionChange(ie),wt.selectionChange?.(ie)},onSearchComponent:ie=>{f.searchComponent&&f.searchComponent(ie),wt.searchComponent?.(ie)}},viewerOptions:f.viewerOptions,options:{...wt,mode:Ys,playerUrl:f.playerUrl,playerModelName:f.playerModelName,playerModelId:f.playerModelId,playerScale:f.playerScale,globe:mh,terrain:gh,depthTest:ph,mapProvider:Ah,tiandituLayerType:yh,tiandituShowLabel:Eh,tiandituToken:f.tiandituToken,arcgisUrl:Ch,shadows:vh,environmentMap:bh,ambientOcclusion:wh,time:Ih,brightness:Sh,backgroundColor:xh,collision:Mh,mouseHabit:Bh,heightBasedZoom:Th},callbacks:{onLoading:ie=>ie?ce.loading(ie,"",s.value):ce.close(),onSuccess:ie=>ce.success(ie,"",void 0,s.value),onError:ie=>ce.error(ie,"",void 0,s.value)}}),{Cesium:li,viewer:Fi,methods:zs,menuEvents:kn}=Dn,Ae=zs;kn.on("showMenu",ie=>{G.value=ie}),kn.on("insertMenu",ie=>{Y.value=[...Y.value,...ie]}),kn.on("setMenuActive",(ie,Te)=>{he(ie,Te)}),S.value=Ae,rt&&(rt.value=Ae),kn.on("setMode",ie=>{d.value=ie}),kn.on("deleteAllModels",()=>{Q.value=[]}),new li.ScreenSpaceEventHandler(Fi.scene.canvas).setInputAction(async ie=>{if(U(),d.value==="2d")return;const Te=Fi.scene.pick(ie.position),gt=Fi.container.getBoundingClientRect(),Ba=gt.left+ie.position.x,Ta=gt.top+ie.position.y,Tt=[];if(li.defined(Te)&&Te instanceof li.Cesium3DTileFeature){const Nn=Ae.baseCompt.getFeatureId(Te),ci=qi(Te.tileset);Ae.baseCompt.hasSelectedFeaturesMap[ci]?.some(Rn=>Rn.batchId===Nn&&Rn.rank===0)||(await Ae.baseCompt.clearSelection(),await Ae.baseCompt.toggleMultiSelect(ci,Nn,Ae.baseCompt.selectedColor)),Tt.push({id:"details",label:"构件详情",action:()=>{p.value=!0}}),Tt.push({id:"hide",label:"隐藏选中构件",action:async()=>{const Fn=(await Ae.baseCompt.getSelected()).map(Pt=>({elementId:Pt.elementId,modelId:Pt.modelId,show:!1}));Ae.baseCompt.setComponentVisibility(Fn)}}),Tt.push({id:"translucent",label:"半透明选中构件",action:async()=>{const Fn=(await Ae.baseCompt.getSelected()).map(Pt=>({elementId:Pt.elementId,modelId:Pt.modelId,rgba:{...Pt.rgba,a:.3}}));await Ae.baseCompt.setSelectColorUserModelCpt(Fn,{rank:0})}}),Tt.push({id:"isolate",label:"隔离选中构件",divided:!0,action:async()=>{await Ae.baseCompt.loadAllNodeDetailsForModel();const Fn=(await Ae.baseCompt.getSelected()).map(Pt=>({elementId:Pt.elementId,modelId:Pt.modelId,show:!0}));Ae.isolateComponents(Fn)}})}Tt.push({id:"showAll",label:"显示所有",action:async()=>{Ae.baseCompt.setAllComponentsVisibility(!0),await Ae.baseCompt.clearSelection()}}),Tt.push(...R.value),F({x:Ba,y:Ta},Tt)},li.ScreenSpaceEventType.RIGHT_CLICK),Ae.addContextMenuItems=b,Ae.insertContextMenu=Ae.addContextMenuItems,Ae.removeContextMenuItems=v,Ae.deleteContextMenu=Ae.removeContextMenuItems,Ae.closeContextMenu=U,Ae.hideContextMenu=Ae.closeContextMenu,Ae.onSetTeleportTarget=ie=>{W.value=ie},await a.nextTick();const Ph=ke?.onLoaded||ke?.onloaded;Ph&&Ph({Cesium:li,viewer:Fi,methods:zs}),Ve("init",{Cesium:li,viewer:Fi,methods:zs}),Ve("ready",{Cesium:li,viewer:Fi,methods:zs})}};let ee=!1;Ve("register",(ke,rt)=>{ee=!0,We(ke,rt)}),ee||setTimeout(()=>{S.value.getViewer||We()},0)}catch($){l.value="Failed to load Cesium: "+($.message||$),console.error($)}}),a.onUnmounted(()=>{ce.setContainer(null)}),e({initMap:()=>S.value,initializeViewer:($,z)=>We($,z)}),($,z)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["leiting-bim-container",[`theme-${q.value}`]]),onContextmenu:z[29]||(z[29]=a.withModifiers(()=>{},["prevent","stop"]))},[!r.value&&!l.value?(a.openBlock(),a.createBlock(a.unref(se.Spin),{key:0,class:"loading",size:"large",tip:"加载基础组件中..."})):a.createCommentVNode("",!0),l.value?(a.openBlock(),a.createBlock(a.unref(se.Alert),{key:1,class:"error",type:"error",message:l.value,"show-icon":""},null,8,["message"])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"containerRef",ref:n,class:"cesium-viewer"},[a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(xn,{key:0,visible:G.value,"active-ids":ae.value,"custom-items":Y.value,onAction:he,"is-2d":d.value==="2d"},null,8,["visible","active-ids","custom-items","is-2d"])),a.unref(h)&&!A.value&&!B.value?(a.openBlock(),a.createBlock(oh,{key:1,"active-ids":ae.value,"is-2d":d.value==="2d",onItemClick:ge,onSubItemClick:De},null,8,["active-ids","is-2d"])):a.createCommentVNode("",!0),a.unref(h)&&i.showTree!==!1&&!A.value&&d.value!=="2d"?(a.openBlock(),a.createElementBlock("button",{key:2,class:a.normalizeClass(["mobile-float-tree-btn",{active:u.value}]),onClick:z[0]||(z[0]=ee=>u.value=!u.value)},[a.createElementVNode("img",{src:a.unref(ks),class:"mobile-float-tree-icon",alt:"目录树"},null,8,M3)],2)):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.Teleport,{to:W.value||"body",disabled:!W.value},[a.createElementVNode("div",{ref_key:"uiOverlayRef",ref:s,class:"leiting-ui-overlay"},[a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Tn,{key:0,visible:p.value,"full-height":L.info,"onUpdate:visible":z[1]||(z[1]=ee=>p.value=ee)},null,8,["visible","full-height"])),a.unref(h)?(a.openBlock(),a.createBlock(hh,{key:1,visible:p.value,"onUpdate:visible":z[2]||(z[2]=ee=>p.value=ee),onClose:z[3]||(z[3]=()=>{p.value=!1})},null,8,["visible"])):a.createCommentVNode("",!0),a.createVNode(Pn,{ref_key:"LeitingPositionRef",ref:de,visible:y.value,"full-height":L.adjustModel,"onUpdate:visible":z[4]||(z[4]=ee=>y.value=ee)},null,8,["visible","full-height"]),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(_n,{key:2,visible:C.value,"full-height":L.setting,"tianditu-token":f.tiandituToken,"initial-config":c.value,"onUpdate:visible":z[5]||(z[5]=ee=>C.value=ee)},null,8,["visible","full-height","tianditu-token","initial-config"])),a.unref(h)?(a.openBlock(),a.createBlock(rh,{key:3,visible:C.value,"onUpdate:visible":z[6]||(z[6]=ee=>C.value=ee),onClose:z[7]||(z[7]=()=>{C.value=!1,re.value=re.value.filter(ee=>ee!=="setting")})},null,8,["visible"])):a.createCommentVNode("",!0),i.showTree!==!1&&!a.unref(h)?(a.openBlock(),a.createBlock(Ds,a.mergeProps({key:4},{...m,...i.treeProps},{visible:u.value,"full-height":L.tree,"tree-data":Q.value.length>0?Q.value:i.treeProps?.treeData||[],"onUpdate:visible":z[8]||(z[8]=ee=>{u.value=ee})}),null,16,["visible","full-height","tree-data"])):a.createCommentVNode("",!0),i.showTree!==!1&&a.unref(h)?(a.openBlock(),a.createBlock(ah,{key:5,visible:u.value,"tree-data":Q.value.length>0?Q.value:i.treeProps?.treeData||[],"onUpdate:visible":z[9]||(z[9]=ee=>{u.value=ee}),onClose:z[10]||(z[10]=()=>{u.value=!1})},null,8,["visible","tree-data"])):a.createCommentVNode("",!0),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(WB,{key:6,visible:M.value,"onUpdate:visible":z[11]||(z[11]=ee=>M.value=ee)},null,8,["visible"])),a.unref(h)?(a.openBlock(),a.createBlock(x3,{key:7,visible:M.value,"onUpdate:visible":z[12]||(z[12]=ee=>M.value=ee)},null,8,["visible"])):a.createCommentVNode("",!0),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(f4,{key:8,visible:B.value,"onUpdate:visible":z[13]||(z[13]=ee=>B.value=ee)},null,8,["visible"])),a.unref(h)?(a.openBlock(),a.createBlock(ch,{key:9,visible:B.value,"default-tool":_.value,"onUpdate:visible":z[14]||(z[14]=ee=>{B.value=ee,ee||(_.value=null)}),onClose:z[15]||(z[15]=()=>{B.value=!1,_.value=null})},null,8,["visible","default-tool"])):a.createCommentVNode("",!0),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Mn,{key:10,visible:g.value,"full-height":L.section,"onUpdate:visible":z[16]||(z[16]=ee=>g.value=ee)},null,8,["visible","full-height"])),a.unref(h)?(a.openBlock(),a.createBlock(lh,{key:11,visible:g.value,"onUpdate:visible":z[17]||(z[17]=ee=>g.value=ee),onClose:z[18]||(z[18]=()=>{g.value=!1})},null,8,["visible"])):a.createCommentVNode("",!0),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Bn,{key:12,visible:A.value,"full-height":L.roam,"onUpdate:visible":z[19]||(z[19]=ee=>A.value=ee)},null,8,["visible","full-height"])),a.unref(h)?(a.openBlock(),a.createBlock(dh,{key:13,visible:A.value,"onUpdate:visible":z[20]||(z[20]=ee=>A.value=ee),onClose:z[21]||(z[21]=()=>{A.value=!1})},null,8,["visible"])):a.createCommentVNode("",!0),a.unref(h)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Lx,{key:14,visible:I.value,"current-model-id":N.value,"onUpdate:visible":z[22]||(z[22]=ee=>I.value=ee),onHandleCloseCardByCadCard:z[23]||(z[23]=()=>{I.value=!1})},null,8,["visible","current-model-id"])),a.unref(h)?(a.openBlock(),a.createBlock(g3,{key:15,visible:I.value,"current-model-id":N.value,"onUpdate:visible":z[24]||(z[24]=ee=>I.value=ee),onHandleCloseCardByCadCard:z[25]||(z[25]=()=>{I.value=!1})},null,8,["visible","current-model-id"])):a.createCommentVNode("",!0),a.createVNode(PM,{ref_key:"cadPositionRef",ref:O,visible:P.value,"onUpdate:visible":z[26]||(z[26]=ee=>P.value=ee),onSave:et},null,8,["visible"]),a.createVNode(OB,{visible:k.value,"onUpdate:visible":z[27]||(z[27]=ee=>k.value=ee)},null,8,["visible"]),a.createVNode(A4,{visible:a.unref(E),position:a.unref(w),items:a.unref(D),"onUpdate:visible":z[28]||(z[28]=ee=>E.value=ee)},null,8,["visible","position","items"]),a.renderSlot($.$slots,"default",a.normalizeProps(a.guardReactiveProps({methods:S.value,isReady:r.value})),void 0,!0)],512)],8,["to","disabled"]))],512)],34))}}),[["__scopeId","data-v-3d848c49"]]);function B3(i,e={}){const{tapDelay:t=300,doubleTapDelay:n=300,moveThreshold:s=10}=e;let o=0,r={x:0,y:0},l=0,c=0,d=null;const h=[],f=[],m=[],u={},g=w=>{const D=w.touches[0]||w.changedTouches[0];return{x:D?.clientX??0,y:D?.clientY??0}},A=w=>{const D=g(w);o=Date.now(),r=D,l=0,m.forEach(({handler:F,delay:U})=>{d=window.setTimeout(()=>{F(w),d=null},U)})},p=w=>{const D=g(w),F=D.x-r.x,U=D.y-r.y;l=Math.sqrt(F*F+U*U),d&&l>s&&(clearTimeout(d),d=null)},y=w=>{const D=Date.now()-o,F=g(w),U=F.x-r.x,R=F.y-r.y;d&&(clearTimeout(d),d=null);const b=D<t&&l<s;if(b&&Date.now()-c<n&&l<s?(f.forEach(N=>N(w)),c=0):b&&(h.forEach(N=>N(w)),c=Date.now()),l>50){const N=Math.abs(U),O=Math.abs(R);N>O?U>0&&u.right?u.right(w):U<0&&u.left&&u.left(w):R>0&&u.down?u.down(w):R<0&&u.up&&u.up(w)}},C=w=>{h.push(w)},I=w=>{f.push(w)},P=(w,D=500)=>{m.push({handler:w,delay:D})},k=w=>{u.left=w},M=w=>{u.right=w},B=w=>{u.up=w},_=w=>{u.down=w},E=()=>{d&&(clearTimeout(d),d=null),h.length=0,f.length=0,m.length=0,Object.keys(u).forEach(w=>{delete u[w]})};return a.onMounted(()=>{const w=i.value;w&&(w.addEventListener("touchstart",A,{passive:!1}),w.addEventListener("touchmove",p,{passive:!1}),w.addEventListener("touchend",y,{passive:!1}))}),a.onUnmounted(()=>{E();const w=i.value;w&&(w.removeEventListener("touchstart",A),w.removeEventListener("touchmove",p),w.removeEventListener("touchend",y))}),{onTap:C,onDoubleTap:I,onLongPress:P,onSwipeLeft:k,onSwipeRight:M,onSwipeUp:B,onSwipeDown:_,destroy:E}}function T3(i){const e=t=>{t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement||t.preventDefault()};return i.addEventListener("touchmove",e,{passive:!1}),()=>{i.removeEventListener("touchmove",e)}}function P3(){let i=0;const e=t=>{const n=Date.now();n-i<=300&&t.preventDefault(),i=n};return document.addEventListener("touchend",e,{passive:!1}),document.addEventListener("gesturestart",t=>t.preventDefault()),document.addEventListener("gesturechange",t=>t.preventDefault()),()=>{document.removeEventListener("touchend",e)}}function _3(i,e={}){const{delay:t=500,moveThreshold:n=10}=e,s=a.ref(!1);let o=null,r={x:0,y:0},l=!1;const c=u=>{if(u.touches.length!==1)return;u.preventDefault(),l=!0,s.value=!1;const g=u.touches[0];r={x:g?.clientX??0,y:g?.clientY??0},o=window.setTimeout(()=>{l&&(s.value=!0,i())},t)},d=u=>{if(!l||o===null)return;const g=u.touches[0],A=(g?.clientX??0)-r.x,p=(g?.clientY??0)-r.y;Math.sqrt(A*A+p*p)>n&&f()},h=()=>{l=!1,s.value=!1,o!==null&&(clearTimeout(o),o=null)},f=()=>{l=!1,s.value=!1,o!==null&&(clearTimeout(o),o=null)};return{isLongPressing:s,handlers:{onTouchStart:c,onTouchMove:d,onTouchEnd:h},start:c,end:h,cancel:f}}function D3(i,e,t={}){const{delay:n=500,moveThreshold:s=10}=t;let o=null,r={x:0,y:0};const l=h=>{if(h.touches.length!==1)return;h.preventDefault();const f=h.touches[0];r={x:f?.clientX??0,y:f?.clientY??0},o=window.setTimeout(()=>{e()},n)},c=h=>{if(o===null)return;const f=h.touches[0],m=(f?.clientX??0)-r.x,u=(f?.clientY??0)-r.y;Math.sqrt(m*m+u*u)>s&&(clearTimeout(o),o=null)},d=()=>{o!==null&&(clearTimeout(o),o=null)};return i.addEventListener("touchstart",l,{passive:!1}),i.addEventListener("touchmove",c,{passive:!1}),i.addEventListener("touchend",d),i.addEventListener("touchcancel",d),()=>{o!==null&&(clearTimeout(o),o=null),i.removeEventListener("touchstart",l),i.removeEventListener("touchmove",c),i.removeEventListener("touchend",d),i.removeEventListener("touchcancel",d)}}const k3={tapThreshold:10,doubleTapInterval:300,longPressDelay:500,panThreshold:20,pinchThreshold:.02};function N3(i={}){const e={...k3,...i},t=a.reactive({type:"none",startX:0,startY:0,currentX:0,currentY:0,deltaX:0,deltaY:0,scale:1,rotation:0,velocityX:0,velocityY:0,duration:0}),n=a.ref(!1),s=a.ref(!1),o=a.ref(!1);let r=0,l=0,c=null,d=0,h=1,f=0,m=null;const u={onTap:[],onDoubleTap:[],onLongPress:[],onPanStart:[],onPanMove:[],onPanEnd:[],onPinchStart:[],onPinchMove:[],onPinchEnd:[],onRotate:[]},g=R=>{if(R.length<2)return 0;const b=R[1].clientX-R[0].clientX,v=R[1].clientY-R[0].clientY;return Math.sqrt(b*b+v*v)},A=R=>R.length<2?0:Math.atan2(R[1].clientY-R[0].clientY,R[1].clientX-R[0].clientX)*(180/Math.PI);return{state:t,isActive:n,isPanning:s,isPinching:o,handlers:{onTouchStart:R=>{if(R.touches.length===1){const b=R.touches[0];m=b.identifier,r=Date.now(),t.startX=b.clientX,t.startY=b.clientY,t.currentX=b.clientX,t.currentY=b.clientY,t.deltaX=0,t.deltaY=0,n.value=!0,c=window.setTimeout(()=>{t.type="long-press",u.onLongPress.forEach(v=>v(R))},e.longPressDelay)}else R.touches.length===2&&(c&&(clearTimeout(c),c=null),o.value=!0,d=g(R.touches),h=1,f=A(R.touches),u.onPinchStart.forEach(b=>b(R)))},onTouchMove:R=>{if(R.touches.length===1&&m!==null){let b=null;for(let O=0;O<R.touches.length;O++)if(R.touches[O].identifier===m){b=R.touches[O];break}if(!b)return;const v=b.clientX-t.startX,x=b.clientY-t.startY;Math.sqrt(v*v+x*x)>e.panThreshold&&!s.value&&(s.value=!0,t.type="pan",c&&(clearTimeout(c),c=null),u.onPanStart.forEach(O=>O(R))),s.value&&(R.preventDefault(),t.deltaX=b.clientX-t.currentX,t.deltaY=b.clientY-t.currentY,t.currentX=b.clientX,t.currentY=b.clientY,t.velocityX=t.deltaX,t.velocityY=t.deltaY,u.onPanMove.forEach(O=>O(R)))}else if(R.touches.length===2&&o.value){R.preventDefault();const b=g(R.touches),v=A(R.touches),x=b/d;t.scale=h*x,t.rotation=v-f,u.onPinchMove.forEach(N=>N(R)),u.onRotate.forEach(N=>N(R))}},onTouchEnd:R=>{if(t.duration=Date.now()-r,c&&(clearTimeout(c),c=null),R.touches.length===0){if(s.value)t.type="pan",u.onPanEnd.forEach(b=>b(R));else if(o.value)u.onPinchEnd.forEach(b=>b(R));else if(t.type==="none"&&t.duration<300){const b=Date.now();b-l<e.doubleTapInterval?(t.type="double-tap",u.onDoubleTap.forEach(v=>v(R)),l=0):(t.type="tap",u.onTap.forEach(v=>v(R)),l=b)}s.value=!1,o.value=!1,n.value=!1,m=null,setTimeout(()=>{t.type="none",t.deltaX=0,t.deltaY=0,t.scale=1,t.rotation=0},50)}}},onTap:R=>{u.onTap.push(R)},onDoubleTap:R=>{u.onDoubleTap.push(R)},onLongPress:R=>{u.onLongPress.push(R)},onPanStart:R=>{u.onPanStart.push(R)},onPanMove:R=>{u.onPanMove.push(R)},onPanEnd:R=>{u.onPanEnd.push(R)},onPinchStart:R=>{u.onPinchStart.push(R)},onPinchMove:R=>{u.onPinchMove.push(R)},onPinchEnd:R=>{u.onPinchEnd.push(R)},onRotate:R=>{u.onRotate.push(R)}}}const Hs={enableFpsLimit:!0,targetFps:30,enableResolutionScale:!0,resolutionScale:.75,enableLazyLoad:!0,lazyLoadDelay:200,enableModelLod:!0,modelQualityLevel:"medium",enablePostProcessing:!1,enableFxaa:!1,enableAmbientOcclusion:!1,enableShadows:!1,maxTextureSize:1024,enableDebounce:!0,debounceDelay:100};function R3(i={}){const e={...Hs,...i};return{requestRenderMode:e.enableFpsLimit,maximumRenderTimeChange:e.enableFpsLimit?1e3/e.targetFps:void 0,scene3DOnly:!0,shouldAnimate:!0}}function F3(i={}){const e={...Hs,...i};return{resolutionScale:e.enableResolutionScale?e.resolutionScale:1,targetFrameRate:e.enableFpsLimit?e.targetFps:void 0,sceneModePicker:!1,navigationHelpButton:!1,animation:!1,timeline:!1,fullscreenButton:!1,vrButton:!1,infoBox:!1,selectionIndicator:!1,shadows:e.enableShadows,skyAtmosphere:e.enablePostProcessing,fog:e.enablePostProcessing}}function L3(i={}){const e={...Hs,...i},n={low:{maximumScreenSpaceError:64,skipScreenSpaceErrorFactor:256,skipLevels:8,baseScreenSpaceError:2048},medium:{maximumScreenSpaceError:48,skipScreenSpaceErrorFactor:128,skipLevels:5,baseScreenSpaceError:1024},high:{maximumScreenSpaceError:32,skipScreenSpaceErrorFactor:64,skipLevels:3,baseScreenSpaceError:512}}[e.modelQualityLevel];return{cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:10,backFaceCulling:!0,colorBlendAmount:0,minimumPixelSize:128,maximumScreenSpaceError:n.maximumScreenSpaceError,skipLevelOfDetail:e.enableModelLod,baseScreenSpaceError:n.baseScreenSpaceError,skipScreenSpaceErrorFactor:n.skipScreenSpaceErrorFactor,skipLevels:n.skipLevels,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,maximumMemoryUsage:4096*5,preloadWhenHidden:!0,preferLeaves:e.enableModelLod,progressiveResolutionHeightFraction:.5,dynamicScreenSpaceErrorDensity:.002,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceError:!0,dynamicScreenSpaceErrorHeightFalloff:.25,foveatedConeSize:0,foveatedTimeDelay:10,foveatedMinimumScreenSpaceErrorRelaxation:0}}function O3(i=30){const e=a.ref(60),t=a.ref(!1);let n=0,s=0,o=0;const r=1e3/i,l=()=>{t.value=!0,n=performance.now(),o=n,s=0},c=()=>{if(!t.value)return!0;const h=performance.now(),f=h-n;return s++,h-o>=1e3&&(e.value=Math.round(s*1e3/(h-o)),s=0,o=h),f>=r?(n=h-f%r,!0):!1},d=()=>{t.value=!1};return a.onUnmounted(()=>{d()}),{fps:e,isControlling:t,startControl:l,stopControl:d,tick:c}}function G3(i,e){let t=null;const n=((...s)=>{t!==null&&clearTimeout(t),t=window.setTimeout(()=>{i(...s),t=null},e)});return n.cancel=()=>{t!==null&&(clearTimeout(t),t=null)},n}function U3(i,e){let t=!1;return((...s)=>{t||(i(...s),t=!0,setTimeout(()=>{t=!1},e))})}function V3(i,e=200){let t=null;const n=()=>{t!==null&&clearTimeout(t),t=window.setTimeout(()=>{i(),t=null},e)},s=()=>{t!==null&&(clearTimeout(t),t=null)};return a.onUnmounted(()=>{s()}),{load:n,cancel:s}}function uh(i){const e=a.ref(),t=a.ref(i.theme||"dark"),n=a.ref(i.menuSize||"medium");a.provide("leiting-theme",t),a.provide("leiting-menu-size",n);function s(l){a.onUnmounted(()=>{e.value=null}),l(i,e)}function o(){const l=a.unref(e);return l||console.error("未获取到leiting实例!"),l}const r=new Proxy({},{get(l,c){const d=o();if(!d)return;const h=d[c];return typeof h=="function"?h.bind(d):h},set(l,c,d){const h=o();return h?(h[c]=d,!0):!1}});return[s,r]}const Q3=jt,H3={install:(i,e)=>{if(i.component("LeitingBIM",Qs),i.component("LeitingTree",Ds),i.component("LeitingDraggableCard",je),i.component("leiting-draggable-card",je),i.component("LeitingMenu",xn),i.component("leiting-menu",xn),i.component("LeitingSection",Mn),i.component("leiting-section",Mn),i.component("LeitingPlayer",Bn),i.component("leiting-player",Bn),i.component("LeitingInfo",Tn),i.component("leiting-info",Tn),i.component("LeitingPosition",Pn),i.component("leiting-position",Pn),i.component("LeitingSetting",_n),i.component("leiting-setting",_n),!e)return;const t={...Q3,...e};t.cesiumUrl&&js(t).catch(n=>{console.error("[LeitingBim] Failed to load Cesium resources:",n)}),i.config.globalProperties.$leitingBimOptions=t}};V.DEFAULT_CESIUM_CONFIG=jt,V.LeiTingBIM=Qs,V.LeiTingDraggableCard=je,V.LeiTingInfo=Tn,V.LeiTingMenu=xn,V.LeiTingPlayer=Bn,V.LeiTingPosition=Pn,V.LeiTingSection=Mn,V.LeiTingSetting=_n,V.LeiTingTree=Ds,V.LeitingBIM=Qs,V.LeitingDraggableCard=je,V.LeitingInfo=Tn,V.LeitingMenu=xn,V.LeitingPlayer=Bn,V.LeitingPosition=Pn,V.LeitingSection=Mn,V.LeitingSetting=_n,V.LeitingTree=Ds,V.MobileBottomNav=oh,V.MobileDrawer=Vs,V.MobileInfo=hh,V.MobileMeasurement=ch,V.MobilePlayer=dh,V.MobileSection=lh,V.MobileSetting=rh,V.MobileTree=ah,V.default=H3,V.defaultMobileConfig=Hs,V.disableDoubleTapZoom=P3,V.getAccessToken=Ws,V.getCesiumOptionsForMobile=R3,V.getTilesetOptionsForMobile=L3,V.getViewerOptionsForMobile=F3,V.leitingBim=Qs,V.loadCesium=js,V.preventDefaultTouchEvents=T3,V.useDebounce=G3,V.useDevice=_s,V.useFrameRateControl=O3,V.useGestureDetection=N3,V.useLazyLoad=V3,V.useLeiTing=uh,V.useLeiting=uh,V.useLongPress=_3,V.useLongPressOnElement=D3,V.useModelTree=$d,V.useRightContextMenu=sh,V.useThrottle=U3,V.useTouchEvents=B3,V.waitForCesium=Rh,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));